Posts

objective c - Create IOS 3D effect -

how go implementing kind of 3d effect: http://www.youtube.com/watch?v=1i2jnjwdcem i cmmotionmanager class devices attitude (pitch, roll, yaw) , move background image accordingly.. and vague formulation, thats get! :p good luck -v

android - Action Bar icon as up enabled not the title -

how make app icon enabled in actionbarsherlock (not title icon) in whats app. the title clickable icon since android 4.2.2. whatsapp uses custom view display 2 line title. disables title click along way. can same way: actionbar actionbar = getsupportactionbar(); actionbar.setdisplayhomeasupenabled(true); actionbar.setdisplayshowtitleenabled(false); actionbar.setdisplayshowcustomenabled(true); actionbar.setcustomview(r.layout.ab_title); textview title = (textview) findviewbyid(android.r.id.text1); title.settext("title"); /res/layout/ab_title.xml: <textview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/text1" style="@style/textappearance.sherlock.widget.actionbar.title" android:layout_width="match_parent" android:layout_height="match_parent" android:ellipsize="end" android:gravity="center_vertical" />

sql - query for search results with 'like' -

i'm looking query string better search results. at moment use operator like select title table lower(column) '%data%' but results not accurate enough. my "search engine" looking events, news , webcontent on website, want results 'data' word 'big-data' , 'big data.' , 'all data' , no results 'maxdata' , 'bigdata' , 'datapool' . can use regexp_like ? select title table regexp_like(column, '(\w|^)data(\w|$)', 'i')

arrays - vector with 10^7 elements in scala -

i testing ruby, python , scala see 1 has better support huge arrays. ruby (each) -> 84 mb, 2s # = [];(0...1e7).each{|i| a[i]=i} ruby (expand) -> 254 mb, 60s #a = [*(0...1e7)] python (numpy) -> 95 mb, < 1s # = np.arange(0, 1e7) python (range) -> 391 mb, < 1s # = list(range(0, int(1e7))) scala (range) -> memory limit exceeded :-) # var = range(0, 1e7.toint).map(_.toint) as can see, memory limit exceeds when using scala, what's problem?!!! --update ok should've used var = array.range(0, 1e7.toint) but, if want map array strings? var b = a.map(_.tostring()) failure here... scala's range isn't identical array in pure sense (inside doing additional work besides keeping n items, less memory efficient , eats memory faster). array.range(0, 1e7.toint) closer python's np.arange , work fine.

ios - Sencha Touch 2 app doesn't work on mini iPad -

i have created sencha touch 2 application , packaged ios after doing required provisioning in apple portal. application gets installed , works fine on ios devices except ipad minis, although "devicetype" in packager.json file set "universal". bug in st2 sdk ipad minis not supported? if not, workarounds can it?

How to get all occurance of a string in clob data in MySQL -

i have 1 clob field 'class_data' in table 'school' , in clob there 1 tag name '<fee-value>' , want select occurrences of tag clob data. used below query in mysql , select first occurrence of tag(there 12 occurrence of vallue) select substr(class_data, instr(class_data,'fee-value'),30) school class='s013' , grade='a' , date ='20130301'; the value showing : <fee-value>200</fee-value> and there 11 more such kind of tags not shown please suggest how do?

tkinter - shell is not opening on running a linux executable that was created by freezeing a python script -

this happenned: i wrote simple script: print 'welcome' name = input('type name:') print 'hi, %s' %name raw_input() i wrote on linux machine. freezed cx_freeze , ran linux executable. , nothing happenned. shell(as have happenned in windows) did not open. , confused. took following tkinter script: from tkinter import * root = tk() w = label(root,text="hello") w.pack(side="top") b = button(root,text="quit",fg = "red", bg = "black",command=quit) b.pack(side="bottom") root.mainloop() i freezed script using cx_freeze , when ran executable noticed window opened , worked well. doubt why shell not opening in linux? (i believe because there not shell in linux, not convinced. , if want confirm it.) details i used following setup.py file freezing both scripts: from cx_freeze import setup, executable setup( name = "hello.py" , \ version = "0.1" , \ d...

matplotlib - Python - reading a csv and grouping data by a column -

i working csv file 3 columns this: timestamp, value, label 15:22:57, 849, cpu pid=26298:percent 15:22:57, 461000, jmx mb 15:22:58, 28683, disks i/o 15:22:58, 3369078, memory pid=26298:unit=mb:resident 15:22:58, 0, jmx 31690:gc-time 15:22:58, 0, cpu pid=26298:percent 15:22:58, 503000, jmx mb the 'label' column contains distinct values (say total of 5), include spaces, colons , other special characters. what trying achieve plot time against each metric (either on same plot or on separate ones). can matplotlib, first need group [timestamps, value] pairs according 'label'. i looked csv.dictreader labels , itertools.groupby group 'label', struggling in proper 'pythonic' way. any suggestion? thanks you don't need groupby ; want use collections.defaultdict collect series of [timestamp, value] pairs keyed label: from collections import defaultdict import csv per_label = defaultdict(list) open(inputfilename, 'rb') inp...

listview - Android OnTouchEvent: Debugging InputEventConsistencyVerifier messages -

i have layout configured gesture listener ontouchevent() . layout contains listview , using gestures capture row id of listview. have following code - itemslist.setontouchlistener(new ontouchlistener() { @override public boolean ontouch(view arg0, motionevent evt) { // todo auto-generated method stub // int action = evt.getaction(); final string debug_tag = "debug"; detector.ontouchevent(evt); switch(action) { case (motionevent.action_down) : log.d(debug_tag,"action down"); return true; case (motionevent.action_move) : log.d(debug_tag,"action move"); return true; case (motionevent.action_up) : log.d(debug_tag,"action up"); return true; case (motionevent.action_cancel) : ...

string,list pair in a row in data frame in R -

i have data frame follows: date = "2000" values = c("a","b","d") df <- data.frame(date=date,values= values) df date values 1 2000 2 2000 b 3 2000 d actually have thousands of values in values field. instead of printing separate rows want make data frame contains 1 row contains information.ie, : 1 2000 a,b,d is possible in r, map<string,arraylist(string)> in java? it's not clear want, here's code aggregate started: > df$values <- as.character(df$values) > # `list` of values > (da1 <- aggregate(values ~ date, df, i, simplify=false)) date values 1 2000 a, b, d > str(da1) 'data.frame': 1 obs. of 2 variables: $ date : factor w/ 1 level "2000": 1 $ values:list of 1 ..$ 0:class 'asis' chr [1:3] "a" "b" "d" > # values collapsed 1 string > (da2 <- aggregate(values ~ date, df, paste, collapse = ...

c# - Windows Azure Cloud Service - Access to deployed xml file denied -

i have mvc app runs fine on premise, runs fine on azure web sites. when deployed cloud service have access denied problems accessing xml files. these xml files bits of data required application determine settings within application. there large number of these under hierarchical folder structure, idea each of these processed allow inheritance of these settings need within application. anyway largely irrelevant @ end of day these xml files stored in folder under web root. the build action properties of xml files set content deployed publish. in fact have rdp'd onto cloud service vm check xml files getting deployed , can confirm are. however whenever application tried read 1 of these files following access denied error. access path 'e:\sitesroot\0\templates\applications\controlproperties.xml' denied. (note : not hard coded path assumed answer below, using httpcontext.current.server.mappath determine physical path of file relative web root) this standard ac...

GWT: How to extract a content of a javascript function using (JSNI) -

i calling javascript function gwt client side using jsni follow: anchor.addclickhandler(new clickhandler() { public void onclick(clickevent event) { execute(notification.getactioncode(), notification.getparams()); } }); private static native string execute(string functionname, string params)/*-{ try{ $wnd[functionname](params); }catch(e){ alert(e.message); } }-*/; my problem javascript function contains window.open("servletname?...."). when clicking on anchor, window opened error below: the requested resource (/es/ gwt/core /servletname) not available. if replace window.open("servletname?....") window.open("../../servletname?...."), window open successfully, these javascript functions used outside gwt cant modify . i dont know why part /gwt/core being added url causing problem. there way in gwt before executing javascript function, extract content , adding ...

yii - Double Join Select -

three tables project , users , issues . project table columns: p_id,name,... users table columns: u_id username... issues table columns: i_id i_name... relations: project has many users - 1..* project has many users - 1..* project has many issues - 1..* users has many issues - 1..* what want do: in yii framework logic: select project it's users, these users has have issues of selected project. in tables logic: select issues of project and user. what sql code want mimic: select issue.i_name issue join project on issue.i_id = project.p_id join user on issue.i_id user.u_id what want in yii: //get project $model = project::model()->findbypk( $p_id ); //get project's users $users = $model->users; //get each of users issues of selected project foreach( $users $user ) $issues = $user->issues; to solve have use through in ralations method. project model relations method should this: public function relations() { ...