Posts

Featured post

c - What is the difference between LVM_GETITEM and LVM_GETITEMTEXT? -

i want text of listview row (text of item , subitems), not sure if should use lvm_getitem or lvm_getitemtext . what difference between these 2 messages, first retrieve entire information item or subitem while other retrieve text? both lvm_getitem , lvm_getitemtext can used retrieve item's or subitem's text data. since retrieving item's text data common operation, lvm_getitemtext message provided convenience implementation. to illustrate difference, here 2 implementations using either message (error handling elided brevity): std::wstring getlistviewitemtext( hwnd a_hwnd, int a_item, int a_subitem) { std::vector<wchar_t> buffer( 1024 ); lvitem lvi = { 0 }; lvi.mask = lvif_text; // required when using lvm_getitem lvi.psztext = buffer.data(); lvi.cchmaxtext = static_cast<int>( buffer.size() ); lvi.iitem = a_item; // required when using lvm_getitem lvi.isubitem = a_subitem; ::sendmessage( hwnd, lvm_getitem,

ios - Do I need to remove NSMutablearray objects before NULL/deleting NSMutablearray -

nsmutablearray *thisarray = [[nsmutablearray alloc] initwithobjects:@"one", @"two", @"three", nil]; do need delete objects before deleting thisarray? thisarray = null; a nsarray/nsmutablearray keeps reference objects contains, , setting array null automatically releases references. don't have cycle through them release them manually.

mysql - changing from 5.3 to 5.5 php getting SQL Error: 1064 in loop -

i have upgraded php 5.3 5.5 used code: foreach($searcharr $token) { foreach($longtbldef $element) { if (isset($element['th']) && !empty($element['th'])) $query .= "lower(" . $element['td'] . ") '%" . strtolower($token) . "%'"; if (next($longtbldef) && !empty($element['th'])) $query .= " `or "; }` if (next($searcharr)) $query .= ") , ("; } in 5.3 , worked fine. when use in 5.5 message: sql error: 1064 -- have error in sql syntax; check manual corresponds mysql server version right syntax use near 'lower(cases_tbl.host) '%dawn%') order cases_tbl.rec_id desc' @ line 6[] this query: select cases_tbl.rec_id "cases_tbl.rec_id", cases_tbl.date_added "cases_tbl.date_added", cases_tbl.status "cases_tbl.status", clients_tbl.client_number "clients_tbl.client_number"

python - Mongodb How to add addtional information when aggregating? -

i beginner , wrote line pipeline works, wanna add other information output, screen name , or number of tweets.i tried add under $group gave me syntax error everytime here pipeline: def make_pipeline(): # complete aggregation pipeline pipeline = [ { '$match': { "user.statuses_count": {"$gt":99 }, "user.time_zone": "brasilia" } }, { "$group": { "_id": "$user.id", "followers": { "$max": "$user.followers_count" } } }, { "$sort": { "followers": -1 } }, { "$limit" : 1 } ]; i using on example : { "_id" : objectid("5304e2e3cc9e684aa98bef97"), "text" : "first week of school on :p", "in_reply_to_status_id" : null, "retweet_count" : null,

r - Create bubble chart with biggest bubble at the center -

Image
i'm trying create bubble chart using set of data follows: x --> 10 y --> 20 z --> 5 q --> 10 i need have biggest bubble (based on number) @ centre (give or take) , rest of bubbles around without overlapping. all of r examples have seen require 2 dimensional dataset, , since data have 1 dimensional, know if it's @ possible create such graphs in r. it great if suggest me useful hints or so. way task need use sa tools d3js out of options. however, open using tool other r. i wasn't quite sure if question should asked in on stack overflow or cross validated , if moderators believe doesn't belong here, i'll remove it. this should do, main idea being sort value of radius, first biggest, shift values around (odd on 1 side, on other) values decreasing both ways. further explanations in code. library(plotrix) library(rcolorbrewer) # set random seed, reproducible results set.seed(54321) # generate random values radius num.circles <

java - Spring Data JPA: Why findOne(id) executing delete query internally? -

i have 1 application using @manytomany annotation link 2 different entities 1 parent entity. not sure if have implemented properly. when execute .findone() on parent entity's repository find it, @ first fetch data along executing delete queries internally delete record mapping table (a table jpa creates after adding @manytomany annotation.). following generated sql queries , code snippet: java class @entity @table(name = "inventory") public class inventory { @id long id; // many other properties @manytomany(fetch=fetchtype.lazy) private list<stream> streams; @manytomany(fetch=fetchtype.lazy) private list<subject> subjects; } there no other annotation i've put in stream , subject entity class link inventory class. when run app, create following tables: inventory stream subject inventory_stream inventory_subject (inventory_stream , inventory_subject, 2 tables created automatically, don't k

sql - ORA-02292: integrity constraint violated - child record found -

when try delete user interface of application, integrity constraint ora-02292: integrity constraint (v.fk_s) violated - child record found.. but not able see constraint in all_constraints : select table_name all_constraints owner = 'v' , constraint_name = 'fk_s'; i guess missing here. tips search further?