Posts

Showing posts from July, 2012

c - Failed to load kernel modules on Raspberry -

i have big problem, hope can me because i've finished "bullet"... i'm working linux-rpi-3.6.y kernel on raspberrypi let's explain problem: created new syscall called sys_defclose closes files of given process's pid, putted source file in linux-rpi-3.6.y/arch/arm/kernel; then modified following files: linux-rpi-3.6.y/include/linux/syscalls.h linux-rpi-3.6.y/arch/arm/include/asm/unistd.h linux-rpi-3.6.y/arch/arm/kernel/calls.s for correctly install new system call. after cross-compiled following http://elinux.org/rpi_kernel_compilation guide , arrived problem: if transfer via ssh new kernel image "kernel.img" /boot raspberry's directory , reboot unless load module syscall works properly; naturally no modules installed ( lsmod empty )..., if follow steps have load compiled modules, generated make arch=arm cross_compile=${ccprefix} modules export modules_temp=~/modules make arch=arm cross_compile=${ccprefix} install_mod

unix - could not find the main class java error -

i having trouble not find main class error complicated program working on. eliminate possible problems decided try hello world program see if work. working on server i'm pretty sure running red hat enterprise 6. followed these steps provided bart kiers in answer this question : create file called helloworld.java; paste code posted below inside helloworld.java: compile executing command: javac helloworld.java in same folder helloworld.java in; execute code doing: java -cp . helloworld in same folder helloworld.java in. i following error after last step: exception in thread "main" java.lang.noclassdeffounderror: helloworld/ caused by: java.lang.classnotfoundexception: helloworld. @ java.net.urlclassloader$1.run(urlclassloader.java:217) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:205) @ java.lang.classloader.loadclass(classloader.java:321) @ sun

How to return value on timeout from Akka 1.3 future? -

given following: import akka.dispatch.{futuretimeoutexception, future} val f1 = future({ thread.sleep(2000); 0}, 500) f1.onexception { case timeout: futuretimeoutexception => -1 } f1.recover { case timeout: futuretimeoutexception => -2 } println(f1.get) why still exception? there way recover timeout such real value returned instead? building off victor said, if want recover particular type of failure future using recover need aware recover returns new future , that's 1 need call get on in order recover functionality. this: val f1 = future({ thread.sleep(2000); 0}, 500) val withrecover = f1.recover { case timeout: futuretimeoutexception => -2 } println(withrecover.get) or chain onto future creation so: val f1 = future({ thread.sleep(2000); 0}, 500).recover { case timeout: futuretimeoutexception => -2 } println(f1.get) edit so looks things work different in akka 1.3 own internal futures compared futures , promises scala 2.10

java - Tomcat can't find JSF API in a JSF webapp built by Maven with javaee-api dependency -

i have searched many similar posts, cannot find definitive answer on correct way build , deploy jsf applications, therefore i'm hoping can help... currently using eclipse maven build simple jsf application , deploy onto tomcat 7, 1 dependency in pom.xml of: <dependency> <groupid>javax</groupid> <artifactid>javaee-api</artifactid> <version>6.0</version> </dependency> when deploy onto server get: java.lang.classnotfoundexception: com.sun.faces.config.configurelistener i cant figure out coming from? have no listeners defined in web.xml. if change dependency to: <dependency> <groupid>javax</groupid> <artifactid>javaee-api</artifactid> <version>6.0</version> <scope>provided</provided> </dependency> and attempt run application on server get: java.lang.classnotfoundexception: javax.faces.webapp.facesservlet which can understand bec

python - Does import __foo__ import from the __init__ file of the foo package? -

i've been reading code used following import statement: import __ompc__ when tried grep find being imported, found was: me@bedrock1:~/projects/pythonprojects/ompc$ grep -r "__ompc__" ./* ./build/lib.linux-x86_64-2.7/ompclib/m_compile.py:import __ompc__ ./build/lib.linux-x86_64-2.7/ompclib/m_compile.py: codeobject = __ompc__.compile(codestring, dfile or file,'exec') ./build/bdist.linux-x86_64/egg/ompclib/m_compile.py:import __ompc__ ./build/bdist.linux-x86_64/egg/ompclib/m_compile.py: codeobject = __ompc__.compile(codestring, dfile or file,'exec') binary file ./build/bdist.linux-x86_64/egg/ompclib/m_compile.pyc matches ./ompclib/m_compile.py:import __ompc__ ./ompclib/m_compile.py: codeobject = __ompc__.compile(codestring, dfile or file,'exec') since __ompc__ used find method named ' compile ', did recursive grep on that. found __init__.py file in ./ompc/ompc directory had compile method. is impor

sql server - Count and Percentage of skill ratings -

i have program brings in skill ratings assessment people title of "worker” have take along file number assigned. program brings in reporting line each worker part of. select distinct o.vp, o.avp, o.director, o.supervisor, o.worker, bs.file_nbr, s.skill bs.score [new_ees].[dbo].[sbc_best_scores] bs inner join new_ees.dbo.sbc_skills s on bs.skill_nbr=s.skill_nbr inner join gw_ppp.dbo.org_hierarchy oon bs.file_nbr=o.file_nbr; i dataset this: vp avp director supervisor worker file_nbr skill rating gerald kris doris null mack 107812 b2 4 gerald kris doris null mack 107812 d1 3 gerald kris doris null mack 107812 d2 3 gerald kris doris null mack 107812 d3 3 gerald kris doris null mack 107812 e1 4 gerald kris mike null brady 109080 a1 5 gerald kris mike null brady 109080 b1 4 gerald kris mike null brady 109080 b2 3 gerald kris mike null bra

c# - Make the ProgressRing in MahApps.Metro Smaller -

it looks mahapps.metro progressring control defaults minimum size of 60x60. there property progressring called "islarge", when set "false" seems have no effect on being able make progressring smaller 60x60. obiviously changing height , width properties not affect either. looking on github actual c# code progressring, looks there several properties affect ellipse diameter, etc, these properties private properties, , can not set outside calls. how can make smaller? 20x20 or 30x30? in below code specify islarge=false, , set size 30x30, still defaults 60x60. <window x:class="wpfapplication3.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:controls="clr-namespace:mahapps.metro.controls;assembly=mahapps.metro" title="mainwindow" height="350" width="525"> <

Python list comprehension: list sub-items without duplicates -

i trying print letters in words in list, without duplicates. wordlist = ['cat','dog','rabbit'] letterlist = [] [[letterlist.append(x) x in y] y in wordlist] the code above generates ['c', 'a', 't', 'd', 'o', 'g', 'r', 'a', 'b', 'b', 'i', 't'] , while looking ['c', 'a', 't', 'd', 'o', 'g', 'r', 'b', 'i'] . how modify list comprehension remove duplicates? if want edit own code: [[letterlist.append(x) x in y if x not in letterlist] y in wordlist] or list(set([[letterlist.append(x) x in y if x not in letterlist] y in wordlist])) else: list(set(''.join(wordlist)))

python argparse: use arguments as values for a list -

i've google'd quite bit, , read argparse documentation think suggests using vars(). namespace violation expected, cant figure out path around issue. essentially, take argparse multi-value argument , create list values can run for-loop through them. interface our vnx array reset data snapshot on developer environments. when run command can see argparse getting values correctly, throwing namespace exception , not using values argument. much appreciation guidance, link better docs explain problem better. know issue, , how want fix it, i'm not sure read(or google) around syntax-wise? this when run code: [root@robot.lipsum.com tmp]# ./envrestore.py -e dev1 dev2 dev3 namespace(myenv=['dev1', 'dev2', 'dev3']) traceback (most recent call last): file "./envrestore.py", line 43, in run_create_snap() file "./envrestore.py", line 36, in run_create_snap e in myenv: typeerror: 'namespace'

Merge two forms rails -

basiclly have same issue @user1224344 here: how submit multiple, duplicate forms same page in rails - preferably 1 button and first answer looks quite nice, rails beginner have problems transpose in project. ok have 2 forms same controller should saved 1 submit button: <table width="100%"> <tr> <%= form_for([@patient, @patient.treatments.build]) |f| %> <th><%= f.collection_select :category_id, category.find(:all), :id, :typ %></th> <th><%= f.text_field :content %></th> <th><%= f.hidden_field :note, :id => "canvascontent" %></th> <th><%= f.text_field :day, :value => date.today %></th> <th><%= f.submit :class => 'btn btn-small btn-primary', :onclick => "sketch.todataurl()" %></th> <th><input type="button" onclick="sketch.clearrecording()" class="btn btn-small btn-danger" value="

r - getOptionChain with multiple expiries -

i use r download option chains, via quantmod package. goal download , export option chains in order used on other software. if download front month expiry, able correctly export .txt file, using these lines: library(quantmod) aapl_front <- getoptionchain ('aapl') front <- do.call('rbind', aapl_front) write.table (front, 'data_front.txt') problems appear when download expiries. here rbind function fails work think should, , export table useless; these lines: aapl_total <- getoptionchain('aapl', null) total <- do.call('rbind', aapl_total) write.table(total, 'data_total.txt') i guess in second case aapl_total list of lists, contains expiries, , i'm not able correctly split them. any suggestions? you loop through each expiration , rbind calls , puts. lapply(aapl_total, function(x) do.call(rbind, x)) then, you'd have list do.call(rbind()) . in 1 step: do.call(rbind, lapply(aapl_total, f

python - Convert Census shapefile to SVG while keeping internal data? -

i new gis not sure how difficult may be. found tutorial on how make choropleth using python tools. want follow use own data , map. tutorial uses map svg file , need use ca zipcode map. map have found shapefile census. have tried using kartograph.py convert svg, loses zipcodes within file when so. makes useless it's shape without metadata need. how can convert file svg , keep each path id'ed appropriate zipcode. i trying follow tutorial here . should give idea of trying do, don't have svg formatted map. i have seen references javascript utilities. have never used javascript suppose use simple. suspect may need involve associated dbf file, don't know how begin that.

mysql - How to add to a user-user correlations table based on whether users have rated any of the same items? -

i'm building site determines correlation values between users based on users liking or disliking posts on site. so, i'm setting database lot of materialized views (tables updated sql triggers upon alteration of other tables). one of tables update table storing information relationship between users, based on table storing rates (likes , dislikes on posts) users have provided. in rates table have columns user_id , post_id , , liked (1 if user liked post, -1 if user disliked post.) in table of user-user correlations, plan on having columns user_id_a , user_id_b , agreed , disagreed , , total . agreed number of posts rated same, disagreed number of posts rated opposite, , total total number of posts have both rated. i want set trigger on rates table when row added it, will: add necessary user-user correlation rows didn't exist user-user correlations table update agreed , disageed , , total columns in relevant rows of user-user correlation tables edit

networking - Why wait DIFS in order to sense if the channel is idle -

station waits in order sense if channel idle difs , starts transmission. question why wait difs , not sifs only. problems, issues may cause (sense sifs instead of difs)? short answer: sifs not long enough detect if channel indeed idle. implication of waiting sifs instead of difs mac protocol shall no longer able detect busy channel, collisions may happen time, , poor channel efficiency. long answer: what sifs ? standard defines sifs (short inter-frame space) used separate data , ack frames. station (sta) receiving data wait sifs before sending ack . should short possible, enough decode frame, mac processing, , preparation time send ack . 802.11n/ac, sifs = 16 microseconds. what difs ? difs = sifs + 2*slot_time . similar sifs , slot_time phy-dependent. 802.11n/ac, slot_time = 9 microseconds. slot_time defined long enough account for, among others, propogation delays, enable neighbouring stas detect transmitting sta's preamble. having said that, if

css - How to insert character in firefox style editor? -

e.g. have such css code edit on fly: nav { margin: 100px auto; text-align: center; } it seems way edit through firefox's inspect element high light part , overwrite it. every time when try move cursor somewhere, delete characters , add new (for example, move position between 2 zeros, delete first 1 , add 5 such 100 changes 150), automatically brings characters have deleted. see below: nav { margin: 1050px auto; text-align: center; } the deleted 0 automatically goes back. turns out super annoying me couldn't around issue @ all. can tell me how edit style way same people in text editor instead of bringing have deleted, making edition totally messed up.

missing + sign causes javascript interpreter to go haywire -

on several occasions, i've encountered situation missing character causes javascript interpreter go haywire or give useless error message. example, following 2 files differ in 2 characters (there's missing plus sign in second file): http://phillipmfeldman.org/english/hangman.html http://phillipmfeldman.org/english/test.html tracking such things down can huge pain. there way debug such things? your error line is: elem.value= score + ' (' + points_received_sum.tofixed(2) + '/' + points_possible_sum ')'; the error in console on chrome says uncaught syntaxerror: unexpected string test.html:737 that's clear error. it's not haywire, it's helpful error message telling problem is. there's nothing more parser / runtime you.

actionscript 3 - FLVPlayback/VideoPlayer: How to access VideoPlayer.load() method that accepts 5 parameters? -

i want use following load() method accepts 5 parameters can load small "excerpt" larger video: http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/fl/video/videoplayer.html#load() in particular, starttime , duration parameters seem need, getting errors seem indicate don't have right object/version of something, though adobe docs should work. here steps: start new, blank fla document (as3). drag flvplayback component stage , name vplayer. create new layer , add actionscript in frame 1: import fl.video.*; var innerplayer = vplayer.getvideoplayer(vplayer.activevideoplayerindex); trace(innerplayer); // "[object videoplayer]" appears in output window innerplayer.load( "rtmp://..." , 0 // totaltime , false // islive , 60 // starttime , 10 // duration ); this should give me ten-second clip starting one-minute mark, keep getting errors argumenterror: error #1063: argument count mismatch on fl.video::

Suggestions for HTML5 Canvas sketching libraries -

i in need of library/plugin html5 canvas allows sketch. aware can create own script draw on canvas, it's additional functionality don't know how implement. i'm hoping can suggest library can add support for: brush manipulation (image, size, color) layered drawing (or form of 'history') undo support (or again, history) does exist? if not can send me in right direction creating own functionality this? thank you! i'm not sure undo support sketch.js place start. http://intridea.github.io/sketch.js/

Javascript detect Wireless settings -

it possible detect wireless settings on mobile device pure html/javascript? that e.g. check if mobile device (a) connected wi-fi , if (b) given radius/certificate enabled in connectivity of given network ? thanks, no. the best can use http://www.w3.org/tr/netinfo-api/#idl-def-connection avaliable. support low, decide sort of connection device has. if want geolocation, ask directly using navigator.geolocation. ( http://diveintohtml5.info/geolocation.html )

MS Access query to toggle between records with true and all records -

i have query returns, among other things, active flag: true active, false not active. there active checkbox control on form. default checked. when checkbox checked need query return records active = true. when checkbox not checked, need records returned. i have been trying set criteria on active field in query this: iif([forms]![myform]![chkactive]=true,true,) iif([forms]![myform]![chkactive]=true,true, true or false) iif([forms]![myform]![chkactive]=true,true,([myquery]![active])=true or ([myquery]![active])=false) the reasoning if chkactive checked, iif returns true , otherwise returns indication want records. checked part seems work fine. , if use like: iif([forms]![myform]![chkactive]=true,true,false) i can switch between seeing true records , false records. switch between seeing true records , records. the other thing query returns nothing when form opens. think value of [forms]![myform]![chkactive] not exist @ time when query needed populate form. however, query

html - CSS for an image sitting inside a div within a lightbox (Many layers) -

i having issues getting head around dimensions of image sitting within div inside lightbox. break down: 1 light box 2 columns in lightbox named lhc , rhc image sits in lhc no matter if use % or px distorts thumb. the image needs not distort regardless of original size needs scale down , sit dead centre of lhc div. see code , going wrong: .imagebox_container { height: 600px; width: 800px; } .fancybox-prev { width: 20%; } .fancybox-next { width: 20%; right: 400px; } .lhc { width: 500px; height: 100%; position: relative; float: left; display: block; background-color: #000; } .rhc { width: 300px; background-color: #fff; height: auto; position: relative; overflow-y: scroll; } .fancyimg{ height: 50%; width: 50%; display:block; margin:auto; margin-top: 25%;} here html/php: <div class="imagebox_container"> <div class="lhc"><img class="fancyimg" src=&quo

Android Tabs Bottom to Top -

i followed tutorial , got tabs wanted @ bottom of screen. here main.xml: <?xml version="1.0" encoding="utf-8"?> <tabhost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <framelayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="0dip" android:layout_weight="1" /> <tabwidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content"

swing - How to clear text fields using for loop in java -

i created text fields in java following. when click "clear" button want clear of these text fields @ once. private javax.swing.jtextfield num1; private javax.swing.jtextfield num2; private javax.swing.jtextfield num3; private javax.swing.jtextfield num4; private javax.swing.jtextfield num5; private javax.swing.jtextfield num6; private javax.swing.jtextfield num7; now want know how use loop clear these text fields like: for(int i=1;1<7;i++){ num[i].settext(null); } code this: private javax.swing.jtextfield num1; private javax.swing.jtextfield num2; private javax.swing.jtextfield num3; private javax.swing.jtextfield num4; private javax.swing.jtextfield num5; private javax.swing.jtextfield num6; private javax.swing.jtextfield num7; is code crying out arranged , simplified using collections or arrays. if use array of jtextfield or perhaps better arraylist<jtextfield> . clearing them trivial. public static final int field_list_count = 7; priva

embedded - ARM Development on Linux -

i have purchased tiva c series launchpad tm4c123g evaluation kit texas instruments. kit contains small pcb arm cortex m4f microcontroller. want start writing software microcontroller. used program avr 8-bit microcontrollers using avr studio on windows. heard shoud easy program arm-based microcontrollers on linux, , since linux main platform, simple ide work more or less used avr. for several days have been searching ide , tools job. surprise, few run on linux, , none open source or freeware. can true? not want spend several hundred dollars try out programming cortex m4f. nor want learn 1 ide , later when found out not enough or expensive. used linux , open source way of doing things , shocked nobody seem doing serious embedded arm programming open source tools on linux. please correct me if wrong. i have no plans running linux on cortex m4f - want program normal microcontroller. texas instruments recommends 1 of following tool chains on cover of evaluation kit: code compos

java - Drawing a text field without the use of JTextField etc -

i'm making launcher game i'm developing , use graphics2d render buttons, gui etc. i've extended class (launcher.java) canvas. means can't use jtextfields (plus ugly anyway). question is, how make text field without use of jtextfield, means rendering it, getting key input display input. thanks. you state: i'm making launcher game i'm developing , use graphics2d render buttons, gui etc. you seem re-inventing wheel. why not instead use or create , feel works well. you state: i've extended class (launcher.java) canvas. by committing awt components unnecessarily limiting can do. why not stick swing components? you state: means can't use jtextfields you can if stick swing. you state: (plus ugly anyway). without images, it's hard discuss point. you state: question is, how make text field without use of jtextfield, means rendering it, getting key input display input. again, why commit re-invent wheel? use sw

Resource Failed To Load, streaming Mp3 playback with mediaelement.js -

i'm working on audio streaming app reddit http://alienstream.com/ , whatever reason links randomly fail "resource failed load" mid track, i've been unable find out reason why, double check links , they're totally valid , download fine. i'm using mediafire host files , medialement.js playback. idea why might happening? i switched jplayer , still having same issues this seems bug in chrome streaming mp3 playback via html5 audio. doesn't occur on firefox , if fallback flash disappears, i've enbabled "legacy option" , added following line error: function(e) {if(e.jplayer.error.type=="e_url") {if(e.jplayer.status!==undefined) {$("#player").jplayer("play", e.jplayer.status.currenttime)} else {next_track()}};} this causes song stop quarter of second resume in exact spot errored, not ideal, it's better was

c# - Chaining multiple Linq Where calls as an OR, not an AND -

i have filtering code refactoring presently has large number of if blocks determine way apply filter. it looks @ various options filters , builds 1 big linq (to ef) statement everything. when chain multiple linq .where calls, resultant operation and. how do or when chaining multiple .where calls. for example users = users.where(l => l.location == "mylocation") users = users.where(r => r.role == "role") the result same as users = users.where(u => u.location == "mylocation" && u.role == "role") where want users = users.where(u => u.location == "mylocation" || u.role == "role") thanks. you're looking predicatebuilder , can construct expression trees logical operators.

Cannot export data to a file in R (write.csv) -

i trying export data in r csv file, , simple try it, same error message. example: i create simple data vector export x <- c(1,3,4,3,5,7,5,8,2,5,7) i try export with: write.csv(x,file='whatever.csv') and error: error in file(file ifelse (append w )) cannot open connection in addition: warning message: in file(file, ifelse(append, "a", "w")) : cannot open file 'whatever.csv': permission denied how can solve this? first part check working directory , ensure have write access directory. can check getwd() . can reproduce error trying write directory read only. to set working directory else read access can type setwd("h:/foo") . once have write access write.csv(x,file='whatever.csv') should work.

c - What are the benefits of using wait() and signal()? -

this question has answer here: conditional variable vs semaphore 5 answers why should use wait() , signal() operation in multithreading applications? i'm relatively new multithreading , understand mutual exclusion need better understanding of how wait() , signal() come equation. it seems i'm achieving thread safety using lock() , unlock(). wrong? can give me example of wait/signal being used , wait , signal not being used lock/unlock? benefits using wait/signal on lock/unlock? thanks. i work computational maths/science examples come there. if doing reduce operation such dot product (need sum many calculations) lock , unlock useful order of sum not matter , if it's free thread should go it. if solving pde on time before can take next time step previous time step needs completed, lock/unlock wouldn't work if data free modification p

php - sql table to update nulled column -

this question has answer here: sql table how multliply array of numbers fetched sql table , stored array , return 3 answers table given below id country person money sum 1 uk john 2010 null 2 usa henry 120 null 3 rus neko 130 null 4 ger suka 110 null 7 can beater 1450 null 8 usa lusi 2501 null each money column multiply 2 , stored corresponding sum column how, given below id country person money sum 1 uk john 2010 4020 2 usa henry 120 240 3 rus neko 130 260 4 ger suka 110 220 7

c# - Entity Framework - Source control for database schemes and test data? -

i'm generating models entity framework powertools - keeps models date nicely. however, how can keep actual db scheme date? how populating test data? feel should covered somewhere google has failed me. considering using "database first" approach, can (within visual studio) create "database project" scheme. using database project, don't need keep sql managemenet studio opened maintain scheme and can configure deploy including loads of data pre-deployment , post-deployment scripts . believe simple, elegant , professional way solve problem. the database project improved in visual studio 2012. hope helps.

socket connection between c server and PHP client -

i trying establish socket communication php client c target, getting warning error below: warning: socket_connect(): unable connect [10061]: no connection made because target machine actively refused it. please me solve problem. in advance. note: tried links: http://www.pmoghadam.com/homepage/html/c-php-unix-domain-socket.html socket_connect(): unable connect [10061] - target machine actively refused it

shell - Grep/Awk part of directory name to variable iteratively -

i trying part of directory name saved variable can add beginning of file name. this have far: var=1 ch=`ls | awk '/[0-9]{2}(?=_.*)/ {if (nr=$var) print $0}'` echo $ch a folder name looks 01_startup . echo blank. can't figure out. know if possible shell script? i'm not quite sure order of |'s , how combine commands. thanks. tree: benu-master | |--chapter_02_startup |--|--01_source_tree |--|--02_console |--|--03_debug and on. something this? for c in chapter_*; v=${c#chapter_} v=${v%%_*} echo chapter $c has number $v # more chapter-processing code here done as aside, avoid parsing ls output .

java - Unix Executable unable to execute in MAC OSX -

i have console application written in c++ (using boost libraries) , compiled in xcode , unix executable communicates daemon , specific task. when run console application command line arguments works perfectly. when call console application java code not executing. using processbuilder execute it. able execute system related command using same code. console application using depends on static library. following spec's using: jdk - 1.7, mac osx - 10.7.5, xcode - 4.6.2, boost version - 1.53.0. code using: string str[] = {"/bin/sh", "-c" ,"/users/user/downloads/cppapplication_1"}; processbuilder builder = new processbuilder(str); builder.directory(new file("/users/user/downloads/")); final process process = builder.start(); process.waitfor(); inputstream = process.getinputstream(); inputstreamreader isr = new inputstreamreader(is); bufferedreader br = new bufferedreader(isr);

android - Why I can't get google map V2 working -

i can't load basic google map v2 in phone. coding according website , got api key. program still didn't work.this give below error error 07-22 13:02:24.630: e/androidruntime(5323): fatal exception: main 07-22 13:02:24.630: e/androidruntime(5323): java.lang.runtimeexception: unable start activity componentinfo{com.example.googlemap/com.example.googlemap.mainactivity}: android.view.inflateexception: binary xml file line #17: error inflating class fragment 07-22 13:02:24.630: e/androidruntime(5323): @ android.app.activitythread.performlaunchactivity(activitythread.java:1651) 07-22 13:02:24.630: e/androidruntime(5323): @ android.app.activitythread.handlelaunchactivity(activitythread.java:1667) 07-22 13:02:24.630: e/androidruntime(5323): @ android.app.activitythread.access$1500(activitythread.java:117) 07-22 13:02:24.630: e/androidruntime(5323): @ android.app.activitythread$h.handlemessage(activitythread.java:935) 07-22 13:02:24.630: e/androidruntime(5323)

javascript - highlight specific words in textarea similar to gmail spell check bottom -

basically, develop django based application synonym dictionary, user can write paragraph , application, highlights set of words in different colors , clicking on highlight words, set of synonym shown popup box (exactly gmail spell checker) , clicking replaced word. the main question should start. there api can assist me ? also, wonder, if such editable area still called "textarea" ? library out there me me out coloring , pop-up box or similar code ? i appreciate hint.

html - php echo within an echo for a checkbox -

i'm trying use checkboxes display , update records in mysql database. want change value of checkbox based on whether it's checked or unchecked. i'm getting error: parse error: syntax error, unexpected t_encapsed_and_whitespace, expecting t_string or t_variable or t_num_string here's line of code that's throwing error: echo"<input type='checkbox' name='pljan' {if (isset($_post['pljan'])) print 'value='checked''} $row->pljan /> january "; is there better way me saving update database 'checked' if box checked, , blank if box unchecked? thanks in advance halps. echo"<input type='checkbox' name='pljan' {if (isset($_post['pljan'])) print 'value='checked''} $row->pljan /> january "; should be echo"<input type='checkbox' name='pljan'"; if (isset($_post['pljan'])) { echo " value=

mysql - php Loop and insert into -

i'm using php form mysql. have loop , put data in database depends on column. example data1 -> insert column1, data2 -> column2 in loop i= 1 5 try this mysql_query("insert day(numb, g['$i']) values('$num', '$tout' ) ") or die(mysql_error()); but doesn't work. have other solution? thanks as others have suggested use mysqli , i. query like: mysqli_query($con,"insert day (numb, $g[$i]) values('".$num."', '".$tout."' )") or die(mysql_error()); just remind $con variable used connect db mysqli_connect(host,username,password,dbname);

ios - Reduce AVPlayer Video Memory Usage -

we have video player play videos inside avplayer (1gb of content in 8mb .mov files in size). load avplayer using avmutablecomposition of video track , audio track on local disk bundled app. we like: avasset* videoasset = [[avurlasset alloc] initwithurl:videourl options:nil]; avasset* voiceasset = usevoice ? [[avurlasset alloc] initwithurl:voiceurl options:nil] : nil; avmutablecomposition* composition = [[avmutablecomposition alloc] init]; avmutablecompositiontrack* videotrack = [composition addmutabletrackwithmediatype:avmediatypevideo preferredtrackid:kcmpersistenttrackid_invalid]; avmutablecompositiontrack* audiotrack = [composition addmutabletrackwithmediatype:avmediatypeaudio preferredtrackid:kcmpersistenttrackid_invalid]; avmutablecompositiontrack* voicetrack = usevoice ? [composition addmutabletrackwithmediatype:avmediatypeaudio preferredtrackid:kcmpersistenttrackid_invalid] : nil; nserror* error = nil; [videotrack inserttimerange:cmtimerangemake(kcmtimezero, videoasse

php - use LIKE to search exact word in mysql -

please help., lets want search word "ink" when use im getting every word has "ink" letters on including "wrinkled"., if use regexp results has word 'ink" first word., i need able search exact word example "blaaah ink blah" product show because has word ink., "ink blah blah".. i cant use fulltext there way using like..? thank in advance.. :) the query be select * table_name column_name 'ink %' or column_name '% ink' or column_name '% ink %'

extjs4 - How to decrease the extjs Grid panel size to fit into another continer? -

Image
i have panel consist data grid multiple number of columns. have re sized column widths fit parent container there still columns hidden. need use horizontal scroll bar see remaining columns. need have grid fit panel. so if decrease font size of grid panel or fits panel. please see screenshot below: thanks in advance! i know forcefit property, data being hidden in grid of columns. in flex possible. window of normal size , grid bit less in size fit in window. see below screenshot how wanted grid be: use "forcefit" config of grid fit available width. refer below docs http://docs.sencha.com/extjs/4.2.1/#!/api/ext.grid.panel-cfg-forcefit i hope looking for.

c# - itextsharp importing msmincho font style -

i new in itextsharp , trying read existing pdf file , when encountered font used not preset in itextsharp msmincho, register font factory how come when tried import msmincho font style , uses identity_h or identity_v encoding returns exception known font fontloc\msmincho.ttc identity_h not recognize. the pdf able use font style though, ask font msmincho derives? this diamond symbol (like dot symbol found in list format). i tried itextsharps fontfamily.symbol no avail. i wonder font have symbols used in msmincho if cant use msmincho.ttc font. what kind of encoding identity_h , identity_v anyway? thanks in advance. never mind use seguisym.ttf

java - How to delete whole child entities by ancestor? -

i'd reduce number of queries delete entities in google app engine. know how delete them ancestor below sequences. set ancestor query , fetch them. convert entities keys , delete them using keys. i'd remove first step. expectation deleting entities ancestor without fetching below. delete ds1 ancestor "parent" is possible? there's no way delete entities that. need access them key , batch delete. though there's query type better suits needs, keys-only query , appear querying full entities delete them.

c# - SqlDataSource UpdateCommand parameters not changing -

Image
i have formview updatebutton , sqldatasource below. updatebutton update sil table same values (the values @ first line of gridview), couldn't figure out why. <asp:formview id="frm_benefit" runat="server" datakeynames="id" datasourceid="sds_benefits" oniteminserted="frm_benefit_iteminserted" onitemupdated="frm_benefit_itemupdated"> <edititemtemplate> <table class="formview"> <tr> <td> code: </td> <td> <asp:textbox id="codetextbox" runat="server" text='<%# bind("code") %>' /> </td> </tr> <tr> <td> name: </td> <td> <asp:textbox i