Posts

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?

java - How to set TableLayout's cells vertical & horizontal alignments -

Image
is there way set alignments in tablelayout's cells ? if want component in cell set example right bottom? this example of using tablelayoutconstraints : import javax.swing.jbutton; import javax.swing.jframe; import layout.tablelayout; import layout.tablelayoutconstraints; public class tablelayoutcellalignmentexample { public static void main(string args[]) { jframe frame = new jframe("example of tablelayout"); frame.setsize(700, 400); double size[][] = {{200,200,200}, // columns {100,100,100}}; // rows frame.setlayout(new tablelayout(size)); string[] labels = { "should top left", "should top center", "should top right", "should middle left", "should middle center", "should middle right", "should bottom left", "should bottom ce...

Encryption between desktop app and server - C# to PHP -

i have app designed in c#. in simple terms app sends data , image web server takes $_post data , processes it. confess not understand how security end of things work. employ relevant experience wouldn't know ask them @ point in accepted techniques. i assume not simple base64 encode/decode data , needs higher level of encryption. webserver have https ssl(ov) certification on next few weeks limited understanding still need sort of protection/encryption when transferring data users pc web server not listening in on data transfer or that. in simple terms if want keep data secure between users , webserver of common or accepted methods c# php? the data goes directly app on users pc server, control source code both myself , not developer hence lack of technical knowledge on issue. one c# developer talked suggested symmetric/asymmetric algorithm not php developer doesn't know if php can take data , decrypt it. to answer further questions, when server issued , confi...

How to add duration for input.ondown in phaser? -

how can add duration this.input.ondown() event in phaser if user clicks 10ms action "a" should happen , if click prolonged action "b" should happen? if (this.input.activepointer.duration > 10 && this.input.activepointer.duration < 25) { // action "a" } else if (this.input.activepointer.duration > 25) { // action "b" } put inside update() or wrap in function call there. should work last active pointer if have multiple (e.g. on mobile).

android - How to add several relativeLayout with 2 views inside programmatically? -

i took on stackoverflow can't find answer. add several rows ( relativelayout ) parent ( linearlayout ). relativelayout composed of 2 views, imageview on left , textview on right, both same row, each item: linearlayout userlayout = (linearlayout) view.findviewbyid(r.id.participant_user); relativelayout rl = new relativelayout(context); relativelayout.layoutparams params = new relativelayout.layoutparams(relativelayout.layoutparams.wrap_content, relativelayout.layoutparams.wrap_content); params.addrule(relativelayout.align_left) (participant participant : participants) { textview textview = settextview(context, participant.getname()); rl.addview(textview, params); imageview imageview = new imageview(context); imageview.setimageresource(r.drawable.bz_ic_default_user); rl.addview(imageview, params); userlayout.addview(rl); } it doesn't work, first element displayed or app crashed... thank ! you should use listadapater or recylerview her...

jQuery isotope filter not working -

i have jquery isotope filtering working @ following address: http://romeavenue.com/en/2/tours-of-italy however, trying implement same functionality on different site can't work. have http://eternalcitytours.com/en/2/tours-of-italy the issue <ul id="filter-container" class="feature cf"> on 1 works, code shows class isotope being applied container <ul id="filter-container" class="feature cf isotope"> , <li> items having isotope-item class assigned. on 1 doesn't work isotope class isn't being assigned. have no idea why. my custom.js is: var $container = $('#filter-container'); $container.imagesloaded( function(){ $container.isotope({ itemselector : 'li', filter: '*', resizable: false, animationengine: 'jquery' }); }); // filter buttons $('#filter-buttons a').click(function(){ // select current ...

dplyr - Adding prefix or suffix to most data.frame variable names in piped R workflow -

i want add suffix or prefix variable names in data.frame, typically after they've been transformed in way , before performing join. don't have way without breaking piping. for example, data: library(dplyr) set.seed(1) dat14 <- data.frame(id = 1:10, speed = runif(10), power = rpois(10, 1), force = rexp(10), class = rep(c("a", "b"),5)) i want result (note variable names): class speed_mean_2014 power_mean_2014 force_mean_2014 1 0.5572500 0.8 0.5519802 2 b 0.2850798 0.6 1.0888116 my current approach is: means14 <- dat14 %>% group_by(class) %>% select(-id) %>% summarise_each(funs(mean(.))) names(means14)[2:length(names(means14))] <- paste0(names(means14)[2:length(names(means14))], "_mean_2014") is there alternative clunky last line breaks pipes? i've looked @ select() , rename() don't want explicitly specify each variabl...

Why some builtin methods in python requires assigning to a variable? -

i confused python treats below examples. example 1 >>> = '{}' >>> a.format('1') '1' >>> '{}' >>> example 2 >>> = [] >>> a.append(1) >>> [1] in example 1, 'a' '{}' in example 2, 'a' [1] in both examples, i'm not assigning result 'a', what's difference? answering on broader sense require more detail study particular case difference crops because 1 of object mutable , other non-mutable. you cannot expect call method on string , change it. supposed create new string object. for list.append , because mutable, method call can update list in place.

java - Strange behaviour during deployment of Jboss in Eclipse -

Image
i'm working in app with: eclipse version: luna service release 1 (4.4.1) jboss eap 6.3 maven, spring, hibernate, log4j etc... i'm experiencing strange strange issue when doing modification in code: if don't execute run as... maven install goals clean package -x nothing changes except debug points don't match code. build automatically enabled. why happening? can because .class files not syncronized .java ones? knowing this, it's bit tricky can deal it, every thime make modification, stop server, rebuild war file ( run as... maven install ) see changes applied in code , restart server. problem comes randomly when restart server, app not start , exception: 17:40:12,816 error [org.apache.catalina.core.containerbase.[jboss.web].[default-host].[/xxx]] (serverservice thread pool -- 71) jbweb000287: exception sending context initialized event listener instance of class net.aqualogy.xf.component.web.spring.contextloaderlistener : org.springf...

ms access - add decimal places to number in a report -

i have number in table 153695029 , need format 1,536,950.29 . have used ~format , decimal~ spot textbox , 153,695,029.00 . doing wrong? datatype double. you set format of textbox control, this. like, ? format(153695029, "###,###,###,###,###.00") 153,695,029.00

objective c - property not found on object of type error but property is there -

so i'm trying access property isportclosed(bool) in serialportcontroller , giving me error, i'm kinda new objective-c. feel should work i've got reference class *port. here link project. error messages: ~/groundstation/groundstation/viewcontroller.m:16:22: property 'isportclosed' not found on object of type 'serialportcontroller *' #import <cocoa/cocoa.h> #import "sceneview.h" #import "serialportcontroller.h" @interface viewcontroller : nsviewcontroller @property (strong) iboutlet serialportcontroller *port; @property (weak) iboutlet sceneview *accelsceneview; @end #import "viewcontroller.h" @implementation viewcontroller - (void)viewdidload { [super viewdidload]; // additional setup after loading view. while(!self.port.isportclosed) { } } - (void)setrepresentedobject:(id)representedobject { [super setrepresentedobject:representedobject]; // up...

android - Disappearing ImageView after scroll in GetView -

Image
i have problem. have inflate listview icons , texts. items should have icons (imageview) (with text1...text5) last item should haven't icon (text6). first image ok, second too, when scroll list (image 3) icon text1 disappear. again when scroll down list (image 4) icon text5 disappear... public class myadapter extends baseadapter { /* */ public view getview(final int position, view view, viewgroup parent) { final viewholder holder; if (view == null) { view = layoutinflater.inflate(r.layout.list, null); holder = new viewholder(); holder.textview1 = (textview) view.findviewbyid(r.id.text_view); holder.imageview1 = (imageview) view.findviewbyid(r.id.icon); view.settag(holder); } else { holder = (viewholder) view.gettag(); } /* */ //icons (text1 text5) if (array[position].istrue()){ holder.imageview1.setimageresource(r.drawable.icon1); ...

How to style select option with css -

Image
i need style select css, looks image below, there 2 things cant figure out, when option selected remove classic blue background, how indent text, text-indent not working me, , how lower option box. <select name="txtcountry"> <option>select country</option> <option value="1">georgia</option> <option value="2">afghanistan</option> </select> select tags near-enough impossible customise, , @ mercy of browser how styled (albeit height , width). you better construct , style own using css if looking customisable option in cross-browser compatible. i have used jquery in order complete functionality. makes use of spans in order replace option tags, allowing further styling (no external library needed, although there many available): $('.item').hide(); $('.item').click(function () { var x = $(this).text(); $(this).siblings(".selected").text(...

Refactor a Ruby switch statement when each case evaluates to the same value? -

suppose have ruby switch statement like: x = 1 case name when "bob" = x when "joe" b = x when "tom" c = x ... end what's best way refactor in one-liner? update: renamed variables make clearer i'm getting at. in case, can use eval method, not "nice way" it. name = "tom" a,b,c = [0]*3 config = {"joe" => "a", "bob" => "b", "tom" => "c"} x = 1 eval("#{config[name]}=#{x}") puts a, b, c # => 0 # => 0 # => 1