Posts

Showing posts from June, 2013

receive sms from my application in android from special number -

i want program able receive sms special number("+9856874236"). but, if sms other number, should go phone's message inbox , not application. please me dears import android.content.broadcastreceiver; import android.content.context; import android.content.intent; import android.os.bundle; import android.telephony.smsmessage; import android.util.log; public class receiver extends broadcastreceiver { public string str = ""; @override public void onreceive(context context, intent intent) { // ---get sms message passed in--- bundle bundle = intent.getextras(); smsmessage[] msgs = null; if (bundle != null) { object[] pdus = (object[]) bundle.get("pdus"); msgs = new smsmessage[pdus.length]; (int = 0; < msgs.length; i++) { msgs[i] = smsmessage.createfrompdu((byte[]) pdus[i]);

sql - Teradata client on Unix Solaris -

i deploy .bteq , .sql scripts on teradata database. doing this, use client on desktop called bteqwin version 13.10.0.03. i .bteq/.sql version control pvcs/svn etc , once files in workspace folder (from version control tool), drag , drop files windows browser bteqwin client (which connect database prior drag/drop running scripts). now, have automate whole process in unix. i have written shell ksh/bash script getting .bteq/.sql tag/label in version control tool given unix folder. now, need pass these files 1 one (i'll take care of order) teradata client. my ? - client need tell unix admin team install on unix server - can run below: someteradatacommand -u username -p password -h hostname -d database -f filenametoexectue | tee output_filename.log where, someteradatacommand client / executable - let me run teradata scripts (like doing using bteqwin on desktop - gui session). other parameters can username, password, database connect on server , file run or make file pass

add on - World of Warcraft Lua - If statement flow -

i'm trying create addon world of warcraft. have created function checks whether buff has been added current player. button:registerevent("unit_aura"); local function auragained(self, event, ...) if (unitaura("player", "heating up")) if (heatingupisactive ~= 1) heatingupisactive = heatingupisactive + 1 print (heatingupisactive) end end button:setscript("onevent", auragained); this works great, how check if unitaura not "heating up" ? also, prefer if heatingupisactive boolean , seems not when that. correct way create boolean in lua? your function isn't checking aura caused event. it's looking "heating up" time unit_aura event comes by. in fact, looks unit_aura event doesn't tell aura triggered it. can't "check if unitaura not "heating up" ", because don't know aura caused event. perhaps several auras

How to overwrite a jQuery function or stop it from executing -

i have jquery function transforms wordpress menu floating menu , again. i create demonstration panel in theme allows users toggle or switch between static , floating menu. the working site can seen here: http://morphius.wpinsite.com here jquery code sets menu floating. function header_transform(){ window_y = $(window).scrolltop(); var wp_admin_height = "0px"; if ($("#wpadminbar").length > 0){ wp_admin_height = parseint($("#wpadminbar").height()) + "px"; } if (window_y > scroll_critical) { if (!($("#header-wrapper").hasclass("fixed"))){ $("#header-wrapper").hide(); $("#wrapper").css("margin-top", header_h + "px"); $("#header-wrapper").addclass("fixed").css("top", wp_admin_height); $("#header-wr

javascript - dojox.mobile.ListItem OnClick not working -

i trying call function when listitem clicked in dojo mobile application. this function programatically creates listitems showresults : function(results) { results.foreach(function(result) { var li = new dojox.mobile.listitem({ class : "linklist", href : "#", label : result.address, moveto : "#", clickable : true, onclick : function() { console.log("click"); } }, domconstruct.create("li", null, this.searchlist)); // dojo.connect(li, "click", lang.hitch(this, this.addresult, result)) }, this); } i have tried providing function onclick property in constructor, using dojo.connect after creation. neither way works. i've tried different variations of click , onclick , , onclick . any other posts have seen regarding issue have suggested using dojo.connect method commented above

How do I prevent exceptions from causing a transaction rollback under Grails? -

my grails service having issue swallowed exception unrelated transaction causing transaction rollback when unrelated persistance of domain object. in service have along lines of updatesomething(domainobj) { def oldfilename = domainobj.filename def newfilename = getnewfilename() domainobj.filename = newfilename domainobj.save(flush: true) try { cleanupoldfile(oldfilename) } catch (cleanupexception) { // oh well, log , swallow } } what seeing when have exception when cleaning old file, log , swallow it, still causes transaction rollback, though done updating domain object. how limit scope transaction complete before clean or there way clean exception not cause rollback? just record using grails 2.1.1 you can use annotations more fine-grained transaction demarcation. default services transactional, , public methods transactional. if use @transactional annotations, grails doesn't make transactional - have complete co

Wordpress - adding custom field to category page -

i want add custom select field category page of wordpress. tried searching google , wordpress solution found outdated , not support ajax update. kindly show me example adds custom field category page , uses ajax. thanks update: below link solved problem. simple , awesome http://en.bainternet.info/2011/wordpress-category-extra-fields there lots of solutions of them have 1 thing in common. saving field value added category in option table not in post meta table. because on next wp update 1 may loose custom category field values. if problem solved hare links same. a whole discussion related problem. a tutorial based on posted question.

Best File format to import data into remote MySQL from a local software -

let me clarify looking for. building dynamic website school on php mysql platform require data updated local offline software school uses. in touch software provider , software provider ready provide data in whatever format required me. so best format, easiest, fastest , more reliable. csv, excel, etc. need student details, grades etc local database. else require take care of in case of have done similar project? looking forward replies. csv easiest handle. don't need process in php if can in format mysql can use load data infile if have access database server itself. excel not @ easy import , can mangled in kinds of ways aren't obvious. it's best avoided unless absolutely need support it. if you're building new application, hope use popular php framework foundation. of these include modules handling csv data, saving trouble of having yourself.

sql - Oracle err handling -

i writing proceudre , trying logging of sql insert query success status. have no clue how write if err insert error log table. insert tablea (select * tableb); commit; **if (show err <> null) insert tableerr** can guy me how shall it? try search don't know key for it's called "exception handling". have @ this tutorial .

c++ - Setting a Gtk::ComboBoxText to non editable -

how set gtk::comboboxtext non-editable, mean here there may 10 selections in combo box choose how can make not allowed choose other text have set to? (this question not relate putting gtk::entry combo box , making non editable, or that) set_sensitive(false) fixed everything

javascript - How to check if element has HTML in it before removing? jQuery -

in function need check if (div, span, p) contains .html elements in before attempting remove html , add in new content. not sure how this... i tried this, not working: // here below tried check see if div's have html, did not work if ($('.'+rowname+' div').html) { $('.'+rowname+' div').html.remove(); $('.'+rowname+' span').html.remove(); $('.'+rowname+' p').html.remove(); } full function // create role / fan rows function rowmaker (rowname, rolename) { //alert(rowname+' '+rolename); // here below tried check see if div's have html, did not work if ($('.'+rowname+' div').html) { $('.'+rowname+' div').html.remove(); $('.'+rowname+' span').html.remove(); $('.'+rowname+' p').html.remove(); } // blue button $('.'+rowname+' div').append(rol

algorithm - C# - Looping through pairs and matching -

so i'm stuck on program have series of pairs may or may not able connect form complete path through pairs. need able check if second item in pair can match first item in pair , on until there no pairs left. example, pairs might be: (1,5) (2,4) (3,2) (5,3) (4,3) i need able somehow iterate through pairs , check if can complete path travels through each one, based on if second digit of pair matches first digit of next pair. in example, output be: (1,5), (5,3), (3,2), (2,4), (4,3) forming complete match. if match can't formed, need report failure. input based on text file. far i've been able read file streamreader , split pairs based on newline, iterate through , split each pair items based on comma. i'm pretty clueless on how proceed, if has ideas appreciate it. streamreader sr = new streamreader("inputs.txt"); string line = null; line = sr.readtoend(); var str = line.trim().split('\n'); int length = str.length; int index=1; while (index

amazon ec2 - Ubuntu 12.10 Copy Virtual Hosts From One Server to Another -

i'd copy sites-available , sites-enabled folders 1 server , move them new server without typing them out again. there fast way this? maybe copy them desktop , new server? don't know commands make work. can use rsync ? on server1: rsync -ap /etc/apache2/sites-available you@<ip_of_server2>:/etc/apache2/sites-available

c# - MVC DropDown Lists Complex Parent Model -

i'm guessing i've missed simple principle here point out rather quickly. have person object contains basic properties , couple of lists<> phones , addresses. phone , address each have type (home/work/etc.). addresses has state , county. when i'm executing manage action, i'm setting viewbag countyid, stateprovinceid, etc. when have second address or phone, these dropdowns don't seem have correct selected value. i'm sure pathetically basic i'm doing wrong here... resolved... i knew there basic missing , answer create custom view models address , phone objects. these new view models contain list each of of these select lists... model sample public customermodel() { isactive = true; if (phones == null) { phones = new list<phone>(); } if (addresses == null) { addresses = new list<address>(); } } public guid id { get; set; } publi

Sub query count in mysql -

i have following query gets me data i'm after... $query = @"select table1.user_id, table1.col8, table2.col5, user_tokens.expiry table1 inner join table2 on table1.user_id=table2.user_id inner join user_tokens on user_tokens.user_id=table1.user_id table1.col2 = '{$username}'"; i've been playing around give me data without second query. data want row count table - table10 (that has user_id column) user_id columns match. so like... , (select count(*) table) userdatacount which giving me row count whole table, not rows have same user_id table1 i figured inner joins i've done count table10 rows user_id columns match rest of query, , different ways i've tried of joining table10, or using where table10.user_id = table1.user_id failing. is there simple way this, or need 2 separate queries? select table1.user_id, table1.col8, table2.col5, user_tokens.expiry, (select count(*) table table.user_id=table1.user_id)

javascript - How can I check if a browser's textareas are resizable? -

i'm going attach custom resize handles if browser not make textareas resizable: how can check if case? (without resorting testing specific browsers). after bit of playing around, seems work: if($(textarea).css('resize') != 'both'){ // add custom resize handle }

Xcode: Random label generator no repeat? -

i creating app has random label generator, i'm finding repeating sometimes. , wondering if can take problem right out, i'm not sure how to? appreciated. i've provided .h , .m files. here's .h #import <uikit/uikit.h> #import "messageui/messageui.h" #import "social/social.h" #import "accounts/accounts.h" #import <iad/iad.h> @interface viewcontroller2 : uiviewcontroller <mfmessagecomposeviewcontrollerdelegate, adbannerviewdelegate> { slcomposeviewcontroller *myslcomposersheet; //label being randomly generated. iboutlet uilabel *label; } -(ibaction)randombutton; -(ibaction)randombutton2; -(ibaction)sendsms:(id)sender; -(ibaction)posttofacebook:(id)sender; - (ibaction)sendatweet:(id)sender; @end here's .m -(ibaction)randombutton { int randomtext = rand() %151; switch (randomtext) { case 0: label.text = @"1"; break; case 1: label.text = @"2"; break

java - Can someone explain why I'm encountering stackoverflow? -

i have int, "count" adds 1 after each recursion, have if statement stops recursion once int equal to, or greater integer. somehow if statement ignored. public static boolean wildcard(string x, string y, int substring, int count) { if (count >= y.length()){ system.out.println("asdf"); return true; } if (x.charat(count) == y.charat(count)){ system.out.println("alskdfjkl"); return wildcard(x, y, substring, count++); } if (y.charat(count) == '*'){ return wildcard(x.substring(substring), y, substring++, count); system.out.println("wildcard end"); return false; } instead of return wildcard(x, y, substring, count++); try return wildcard(x, y, substring, ++count); count++ post increment (meaning increment after method returns) you want update return wildcard(x.substring(substring), y, substring++, count); same reason. also, last if statement bro

python - convert string to int? -

working on letter-guessing game. why in following example, when hardcode value of variable, "userguessposition" 2, code works expected. secretword = ('music') userguessposition = 2 slice1 = (secretword.__len__()) - userguessposition - 1 print (secretword[slice1:userguessposition]) but when rely on input() function , type in 2 @ prompt, nothing happens? secretword = ('music') userguessposition = 0 userguessposition == input() slice1 = (secretword.__len__()) - userguessposition - 1 print (secretword[slice1:userguessposition]) i assume because keyboard input of "2" being seen string , not integer. if case, i'm unclear on proper syntax convert it. the problem not input recognized string, rather in syntax: you're doing comparison operation should doing assignment operation. you have use userguessposition = input() instead of userguessposition == input() the input() function convert input number appropriate ty

Is it possible to use Twitter Bootstrap to create a Magento site? -

a client wants magento site done, , have never used before. thought, "sure, i'll create standard site using bootstrap , query database products". i've been looking it, looks way use magento creating theme doesn't bootstrap friendly. please tell me creating themes isn't legitimate way of creating magento site. some starting points: http://www.bootstrapstart.com/portfolio-type/bootstrap-magento-theme/ http://magenthon.com (info , code) or demo here https://github.com/cvaldemar/magento-bootstrap (doesn't seem active though ?) if planning on doing yourself, second link looks promising candidate download, reverse engineer cusomise! good luck

algorithm - Set sizes for large number of sets -

i have use case need store large number of entries unique set sizes each one. if simplify contacts (which problem not). have problem : given user know how many friends have: joe - mary, john, bob, tom mary - carol, suzy, mike, fred, robert thus friends(joe) = 4 - operation supported addfriend(joe, sam) . while mary might friends joe there no need store of related information. what rather not store of entries in each set, yet bloom filter doesn't quite feel right. there other alternatives? update: challenge i've got 20m joe/mary/... in top level sets 4m semi-distinct members in each set. quick code example below (python simplicity) - @ scale + persistent storage universe comes end. class world: def __init__(self): self.friends = defaultdict(set) def addfriend(self, id, member): self.friends[id].add(member) def friends(self, id): return len(friends[id]) since you're considering bloom filter, so

imagemagick - RMagick torn edges -

i'm trying create torn edge effect in rmagick. there filter similar photoshop's crystallize? also, found imagemagick code here http://www.imagemagick.org/usage/thumbnails/#torn : convert thumbnail.gif \ \( +clone -alpha extract -virtual-pixel black \ -spread 10 -blur 0x3 -threshold 50% -spread 1 -blur 0x.7 \) \ -alpha off -compose copy_opacity -composite torn_paper.png however, don't understand of it. can provide advice? this command 2 main things: create mask torn-paper effect, apply mask image. them, fancily, in 1 line, using +clone , parentheses. it's less confusing 2 commmands though: convert thumbnail.gif \ -alpha extract \ -virtual-pixel black \ -spread 10 \ -blur 0x3 \ -threshold 50% \ -spread 1 \ -blur 0x.7 \ mask.png convert thumbnail.gif mask.png \ -alpha off \ -compose copy_opacity \ -composite torn_paper.png the first comma

c# - Solution for INSERT or UPDATE and fetching newly created id on SQL server -

is possible perform insert or update following constraints : dapper used in project the primary key auto-incrementing positive the newly inserted data may not have pk value (or has value of 0 ) the data needs have pk value on newly inserted row. the query being generated procedurally, , generalizing preferable something : int newid = db.queryvalue<int>( <<insert or update>>, somedata ); i have read different solutions, , best solution seems this one : merge tablename target using (values ('new value', 'different value')) source (field1, field2) on target.idfield = 7 when matched update set field1 = source.field1, field2 = source.field2, ... when not matched insert ( idfield, field1, field2, ... ) values ( 7, source.field1, source.field2, ... ) but it seems fail on third constraint , it not guarantee return newly generated id. because of 5th constraint (or preferance), stored proc

How do I make auto select text in HTML -

i have further question solution provided elsewhere on site ( html textbox, auto highlighting text ) the solution making auto select text worked, can't figure out how include html in box, without disappearing. have used text on following page: http://www.tennessee-scv.org/camp1640/tour/media/ for example, need first box read: <a href="http://www.germantowntour.com" target="_blank">germantown tour</a> but if set that, it displays first ("), had use ('). this require!! <textarea name="textarea" cols="85" rows="10" wrap="virtual" onclick="this.select();">code here!!/textarea> fiddle link : http://jsfiddle.net/qnmxr/8/ updated fiddle link. exact thing works you. check out!

iphone - iOS App crashing on production but not on debugging -

i have been working on ios app. working fine until couple of days ago, started behaving strangely. app crashes on production creates no crash logs. however, when same scenario tested out in qa, works fine. have been trying find out reason without crash logs or crash in debugging mode, has become difficult me. any suggestion, how tackle it? thanks! p.s. using xcode 4.6.1 , app ios 6.0. i had same problem, building ipa's in xcode 4.6.1 sdk version 6.0 or above crashes app anything. try archiving in xcode 4.4 or 4.3 may lower version , try.

java - what is AbstractTestNGSpringContextTests -

i have testng class following: public class webapitestcase extends abstracttestngspringcontexttests{.....} i trying understand means extends abstracttestngspringcontexttests . how work , use of it? please read javadoc: abstract base test class integrates spring testcontext framework explicit applicationcontext testing support in testng environment. basically spring application context setup test class. if still doesn't make sense i'd recommend read chapter 11 of spring manual on testing .

Spring with Hibernate JPA using Virtual database columns not working -

i have scenario have entity variable (say x) points virtual column in db. used variable x project data onto ui or , don't want inserted or updated when iam updating or creating entity object. for achieved have introduced insertable , updatable false shown below @column(name = "virtual_column_name_in_db", length = 4000, updatable = false, insertable = false) private string x; i have introduced associated getters , setters well. with annotations introduced, expected variable x not included part of insert or update opeartions but, not case , see coming in insert , update operations, inturn causing me have db error below org.springframework.orm.hibernate3.hibernatejdbcexception: jdbc exception on hibernate data access: sqlexception sql [n/a]; sql state [99999]; error code [54017]; ora-54017: update operation disallowed on virtual columns ; nested exception org.hibernate.exception.genericjdbcexception: ora-54017: update operation disallowed on virtual colu

A little lost setting up my git starting state - I'm sure it's just a couple simple commands, but -

context: user "dev", home directory /home/dev production code in i'll call /thepath/codebase working directory /thepath/dev (currently files should branch) project called kizunadb ultimately want bare repo called kizunadb.git somewhere (i guess home directory logical) want seen "original", clones from . (per conclusions this discussion ) not knowing how start empty bare repo , put files elsewhere, tried starting files are. made repo in /thepath/codebase , committed files. did: cd ~ mkdir kizunadb.git cd kizunadb.git git clone --bare /thepath/codebase hmm... made /home/dev/kizunadb.git/codebase.git - not quite had in mind. i can again /home/dev/ fix location, still called codebase.git - if change name, break it? and how swap roles between , codebase directory later can completed code from kizunadb.git to /thepath/codebase (with clone or checkout - not sure right command @ point)? know git doesn't have concept of "the

Android OBD Reader not going through all switch cases -

i working on android app modifies bluetooth chat example given eclipse create on-board diagnostic (obd) reader. code sends message vehicle's ecu , retrieves data use of switches. now, problem is, reason when run program receive data 6 of cases , not receiving data rest of them. the code kind of lengthy. public void starttransmission() { sendmessage("01 00" + '\r'); } public void getdata(int messagenumber) { final textview tx = (textview) findviewbyid(r.id.txview2); switch (messagenumber) { case 1: sendmessage("01 0c" + '\r'); // rpm tx.settext("01 0c"); messagenumber++; break; case 2: sendmessage("01 0d" + '\r'); // mph tx.settext("01 0d"); messagenumber++; break; case 3: sendmessage("01 04" + '\r'); // engin

php - [Microsoft][SQL Server Native Client 11.0]Shared Memory Provider: Timeout error [258] -

good day. i have website on php5. all query perform sqlsrv; when make query error: [microsoft][sql server native client 11.0]shared memory provider: timeout error [258] how fix error? this error caused slow connection or sql query taking long time. it not sql server problem. try extending timeout value in connectionstring in php. see previous answer you need change setting in php.ini : upload_max_filesize = 2m ;or whatever size want max_execution_time = 60 ; also, higher if must were php.ini depends on enviroment

wordpress - How to change default timezone UTC to Local timezone -

i'm maintaining wordpress based website observed not working following local time. follows default utc timezone. tried general setting yet site working based on default utc timezone. how can fix it? thanks. there couple of solutions can suggest. check if settings being saved. settings not being saved. happened me wordpress blog hosted on windows azure. if using custom theme. make sure not override time get_post_time('u', true); the second parameter true, forces wordpress use gmt timezone rather using local timezone. you can go through functions in order check it.. similar situation here : http://wordpress.org/support/topic/how-to-display-local-time-instead-of-utc if can share theme files or file date function written, can :-)

css - Prevent page jump from :target selector -

so have modal pops using css :target selector. however, page jumps anchor when clicked. prevent page jumping :target selector. how can this? <a href="#openmodal">info</a> <div id="openmodal" class="modaldialog"> css: .modaldialog { position: absolute; pointer-events: none; z-index: 99999; opacity:0; } .modaldialog:target { opacity:1; pointer-events: auto; } .modaldialog > div { width: 900px; height: 506px; position: relative; background: rgba(0,0,0,0.9); } make .modaldialog position: fixed instead of absolute . cause positioned @ wherever page scrolled. a more complete example: http://codepen.io/mblase75/pen/xbrnev (there's other trickery involved in codepen demo -- adding target 'close' button on modal fixed keeps page scrolling when modal closed, , changing z-index of modal -1 100 (or other suitably large integer) keep blocking clicks right after close it

How to get random value from a file in python? -

it have been gratifying figure out myself haven't been able to. i want grab random value text file contains data in form of dictionary eg: {'one': '1111111', 'two': '2222222', 'three': '3333333'} i've tried few variations, code currently: from random import * table = open('file.txt') random_value = random.choice(table.values()) when try , print 'random_value' (to see if working), error: attributeerror: 'file' object has no attribute 'values' table file object, , want turn dictionary. here use ast module: from random import choice # no need import if you're going use 1 function import ast table = open('file.txt').read() mydict = ast.literal_eval(table) random_value = choice(mydict.values())

Android Application idea how to achieve this -

i want create android app.which unique. want app connect kind of energy bad or good..my main motive connect app ghosts , spirits..so can become interface between humans , spirits...i mean if app installed in person's phone app should connected person's soul.... have no idea how achieve same animation effect see in android foxnews application. after displaying splash screen, view of main activity smoothly displayed. have same animation between splash screen , dashboard activity. this post features how change android’s default animation when switching between activities. before reading rest, please know code changes standard animation found @ api demo comes android sdk. since there’s lack of proper documentation regarding subject , it’s difficult find place explaining it, here post helps in aiding these 2 problems. so, code change animation between 2 activities simple: call overridependingtransition() current activity , after starting new intent . method availabl

Amazon s3 bucket policies restrict access has no effect -

i want restrict access file in amazon s3 public except sites (using referer), have bucket policies { "id":"foosite-test", "statement":[ { "sid": "allow foosite admin", "action": "s3:getobject", "effect": "allow", "resource": "arn:aws:s3:::mybucket/*", "principal": { "aws":["*"] }, "condition": { "stringlike": { "aws:referer": [ "http://www.foosite.co.uk/admin/*", "http://www.foosite.co.au/admin/*" ] } } } ] } but seems policy doesn't have effect. can copy paste s3 object url , still can access file. what's wrong policies? you need add policy deny also, block other referer. had answered similar question, did not included deny part in sample policy. can

c# - Why is this code slowing down? -

i'm in process of converting number of access databases xml files. have done before , still have code previous project. however, code not let me structure xml please need time around. i'm using xdocument for -loops achieve gets incredibly slow after couple of 1000 rows of data. reading in on how xdocument works tells me xelement.add copies entire xml-code , adds new element pastes file. if true that's problem lies. this part reads , writes data access xml, take , see if there's way of saving it. converting database 27 columns , 12 256 rows takes 30 minutes while smaller 1 mere 500 rows takes 5 seconds. private void readwrite(string file) { using (_connection = new oledbconnection(string.format("provider=microsoft.ace.oledb.12.0;mode=12;data source={0}", pathaccess))) { _connection.open(); //gives me values accessdb: tablename, columnname, colcount, rowcount , listoftimestamps. getvalues(pathaccess); xdocumen

Chrome-only Issue: Serving images using a servlet. One image loads, one image doesn't -

edit : i have page contains following html code: <img src="/static/ads/1111.png"> <!-- 1 --> <img src="/static/2222.png"> <!-- 2 --> when load page, image no. 1 cannot displayed. image no. 2 displayed. checking image request in chrome devtools's network tab, request "pending". what's weirder, when directly access image no. 1 in http://localhost:8080/static/ads/1111.png , image loads. this issue seems affect google chrome. tested in firefox , works there. for chrome console error: port error: not establish connection. receiving end not exist. when compare request headers of image no. 1 cache-control:no-cache pragma:no-cache referer:http://localhost:8181/index.html user-agent:mozilla/5.0 (macintosh; intel mac os x 10_8_3) applewebkit/537.31 (khtml, gecko) chrome/26.0.1410.43 safari/537.31 vs image no. 2 accept:*/* accept-charset:iso-8859-1,utf-8;q=0.7,*;q=0.3 accept-encoding:gzip,deflate,sdch accept

iphone - deleteRowsAtIndexPaths on heavily-updated model crashes -

a view controller has data model updates , aggressively a uitableview (storytable) called ever update , reflect changes date. (changed code reflect single beginupdates endupdates) - still crashes [self.storytable beginupdates]; if([deleteindexpaths count]){ dlog(@"table refresh delele rows :%@",deleteindexpaths); [self.storytable deleterowsatindexpaths:deleteindexpaths withrowanimation:uitableviewrowanimationnone]; } if ([addindexpaths count]){ dlog(@"table refresh add rows :%@",addindexpaths); [self.storytable insertrowsatindexpaths:addindexpaths withrowanimation:uitableviewrowanimationtop]; } if ([changedindexpaths count]){ dlog(@"table refresh change rows :%@",changedindexpaths); [self.storytable reloadrowsatindexpaths:changedindexpaths

performance - For Javascript game engines, is re-using a global variable more or less efficient than making locals? -

a lot of javascript performance guides tend emphasize 2 points: stay within scope; looking variables progressively through each scope expensive. don't abuse garbage collector creating unnecessary variables constantly. for programs run @ 60fps or similar high speeds, there difference in performance? jsperf seems go between 2 on system, i'd know little more how optimize type of stuff. considering following 2 code samples: var t0; function dosomethingglobal() { t0 = getwhatever(); t0.func1(); t0.func2(); } verses function dosomethinglocal() { var t0 = getwhatever(); t0.func1(); t0.func2(); } http://jsperf.com/global-verses-local i think depends on how access globals, , how nested globals in execution context(s). quicker access variable 1 execution context 'higher', 1 ten levels higher, instance (depending on js engine, imagine results , engine optimisations vary). i've modified test bit have 50 accesses of global

eclipse - Subclipse recognizes changes after changing the ignore file? -

i use subclipse in eclipse. after adding files svn ignore list of root directory , subdirectories, synchronize view shows changes directories. no file inside directory has changed, shows directories have changed (black outgoing arrow on each directory). i confused, because how can directory change existed? trying compare directory latest version of repository says "there no differences selected inputs". the svn:ignore property has been set on each folder. since svn properties versioned, constitutes change respect repository. true client , not subclipse. i'm not familiar subclipse don't know why isn't appearing in diff, know in tortoisesvn does.

html - How to simulate Windows Phone browser? -

i'm creating page using responsible web design problem. page works correct on each desktop browsers (after change screen resolution) , on iphone. but have problem on windows phone . want check wrong cannot duplicate problem on desktop browser when use custom user agent phone: mozilla/5.0 (compatible; msie 9.0; windows phone os 7.5; trident/5.0; iemobile/9.0; nokia; lumia 710) is there emulator (for windows phone) have developer tool chrome's one? any appreciated. try this out (html debugger). sure it'll you.

java - Icon is not set on submenu -

i had made sub menu in android , wanted add icon on sub-menu not display. have written following snippet of code: int base = menu.first; submenu sm = menu.addsubmenu(base, base + 1, menu.none, "submenu"); menuitem item1 = sm.add(base, base + 2, base + 2, "sub item1"); sm.add(base, base + 3, base + 3, "sub item2").seticon(r.drawable.block_user); sm.add(base, base + 4, base + 4, "sub item3").seticon(r.drawable.extendedaway); item1.seticon(r.drawable.away); sm.seticon(r.drawable.chaty); i don't think icons supported submenus. have search here in so, here example: adding icon submenu items see tutorial: http://www.linuxtopia.org/online_books/android/devguide/guide/topics/ui/menus.html options menu this primary set of menu items activity. revealed pressing device menu key. within options menu 2 groups of menu items: icon menu collection of items visible @ bottom of screen @ pre

android - Can't synchronize call to notify() -

forgive me, not able call on notificationbuilder's notify() method. have code: timer.scheduleatfixedrate( new timertask() { @override public void run() { synchronized (this) { builder notif = new notificationcompat.builder(c); notif.setcontentintent(contintent) .setwhen(system.currenttimemillis()) .setticker("notification ticker") .setsmallicon(r.drawable.ic_launcher) .setcontenttitle("vinceri") .setcontenttext("ha recibido una oferta de trabajo") .setautocancel(true); notif.notify(); } } } and no matter put synchronized block, same exception: 04-05 10:42:55.116: e/androidruntime(18244): fatal exception: timer-0 04-05 10:42:55.116: e/androidruntime(18244): java.lang.illegalmonitorstateexception: object not locked thread before notifyall() 04-05 10

c# - Entity Framework Code First - How to ignore a column when saving -

i have class called client mapped database table using entity framework code first. table has computed field need available in client class, understand won't possible write field. there way of configuring entity framework ignore property when saving, include property when reading? i have tried using ignore method in configuration class, or using [notmapped] attribute, these prevent property being read database. you can use databasegeneratedattribute databasegeneratedoption.computed option: [databasegenerated(databasegeneratedoption.computed)] public computedpropertytype computedproperty { get; set; } or if prefer fluent api can use hasdatabasegeneratedoption method in dbcontext class: public class entitiescontext : dbcontext { public dbset<entitytype> enities { get; set; } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { modelbuilder.entity<entitytype>().property(e => e.computedproperty).hasdatabas

java - Depending on first drop list selection, second drop down list should contain related contents -

depending on first drop down list item selection, want second drop down list should contain related contents. how can in java? instance, let say, first drop down list contains name of countries, , second drop down list contains names of states. , if select particular country, "india", name first drop down list second list should show related states of country i.e states of "india". , both lists dynamic. this more javascript java , struts 2. there 2 options can map first drop down's values key , other dropdown's values related item. then when first combobox's value selected can values form javascript map , set second dropdown. other option send ajax request on first dropdown's selection , pupulate second dropdown results.

activerecord - CodeIgniter: How to use the get() active record twice with previous active records? -

i have following function under models shown.. public function get_products($category, $brand, $filter, $page, $limit) { // output $output = ""; // offset $offset = $limit * ($page - 1); // query pagination $this->db->select("*"); $this->db->from("products"); $this->db->where("category", $category); if ($brand != "all") { $this->db->where("brand", $brand); } // first time use $query = $this->db->get(); $total_rows = $query->num_rows(); $this->db->limit($limit, $offset); switch ($filter) { case 'latest': $this->db->order_by("released", "asc"); break; case 'most-viewed': $this->db->order_by("views", "asc"); break; case 'price-low-to-high': $this->db->order_by("price