Posts

Showing posts from May, 2015

alarm - Perl: eval timer in while -

i try achieve timer several loops below while ( $try < 3) { eval { local $sig{alrm} = {}; alarm 3; $ret = # sending request , wait response alarm 0; } last if defined($ret); $try++; } but actually, when alarm expired, whole 'while' loop got interrupted, , loop didn't happen @ all. where got thing wrong? you need set alrm handler, alarm docs demonstrate: for (1..3) { print "loop $_\n"; eval { local $sig{alrm} = sub { die "alarm\n" }; alarm 5; $count = int rand 10; print "is $count < 5?\n"; sleep $count; alarm 0; #cancel alarm if not hang }; if ($@) { die unless $@ eq "alarm\n"; # propagate unexpected errors } else { print "our code succeeded\n"; last; } }

ios - Why when I set a low duration value for my CABasicAnimation does it jump? -

Image
sample project: http://cl.ly/1w3v3b0d2001 i'm using cabasicanimation create progress indicator pie chart. similar ios 7 app download animation: the animation set follows: - (void)drawrect:(cgrect)rect { [super drawrect:rect]; cgfloat radius = cgrectgetwidth(self.frame) / 2; cgfloat inset = 1; cashapelayer *ring = [cashapelayer layer]; ring.path = [uibezierpath bezierpathwithroundedrect:cgrectinset(self.bounds, inset, inset) cornerradius:radius-inset].cgpath; ring.fillcolor = [uicolor clearcolor].cgcolor; ring.strokecolor = [uicolor whitecolor].cgcolor; ring.linewidth = 2; self.innerpie = [cashapelayer layer]; inset = radius/2; self.innerpie.path = [uibezierpath bezierpathwithroundedrect:cgrectinset(self.bounds, inset, inset) cornerradius:radius-inset].cgpath; self.innerpie.fillcolor = [uicolor clearcolor].cgcolor; self.inner

actionscript 3 - Is it possible to remove an instance of an object from memory and restore it later in as3? -

my question bit vague let me elaborate. i'm beginner programmer working on first flash game point of question side-scrolling platformer mario example. unlike traditional platformer though, level continue indefinitely until player dies or quits game. level tilebased , generated automatically through array specifies object in each tile( or 0 if there no object). in order ensure game doesn't automatically crash excessive objects generate more of map( creating new instances of objects) player progresses player move right map generated past edge of screen. now matter @ hand, i'm guessing once player gets point in game start slow down because more , more objects being created. assume solution problem remove instances left of screen player progresses problem need player have ability go through level. so question is: how can 'delete' or remove instances memory, game doesn't slow down, restore instance when player moves proximity of instance (or was). note: as

javascript - Changing version numbers on window.reload() -

if had following <script> tag in code: <script src='http://your.site.com/js/big_script.js?version=1'></script> how can version number automatically update each subsequent window.reload() action placed on page? page refreshes... <script src='http://your.site.com/js/big_script.js?version=2'></script> page refreshes... <script src='http://your.site.com/js/big_script.js?version=3'></script> and on... through use of javascript only? i know localstorage come in handy here implementing within <script> tag itself? there way of doing this, or there alternative ways done? in case i'm after javascript based solutions application pure html5/javascript/css3. thanks in advance! as noted, localstorage way go. downside of doing client side you'll have late bind script tag. try: var my_site_cntr = parseint(localstorage.getitem('mysite.counter')||0); my_site_cntr++; localstorage

compilation - How to compile QEMU for 64 bit -

i'm trying comlpile qemu source code 64 bit ,but being compiled in 32 bit .. these commands i'm using #!/bin/bash cd qemu-1.6.0\ export pkg_config_path=`pwd`/../support_libs/libs/glib/lib/pkgconfig:`pwd`/../suu pport_libs/libs/zlib/lib/pkgconfig export cflags="-mabi=64" qemu_cflags="-mabi=64" sudo ./configure --prefix=`pwd`/../support_libs/libs/qemuu --target-list=mips64-softmmu --enable-kvm --enable-fdt --with-coroutine=sigaltss tack --extra-cflags="-i`pwd`/../support_libs/libs/glib/include/glib-2.0/" sudo make && sudo make install i'm saving in file named "build.sh" , running script "./build.sh" any appreciated you executing script ./build.sh environments export child shell sessions when give sudo make in script not inherit exported variables. change script little bit removing sudo make , make install , run script sudo #!/bin/bash cd qemu-1.6.0\ export pkg_config

php - Symfony2 forms collection -

Image
i have, 2 entities, topic , topiccontent relation topic_id. topic_id in topic table autoincremet , in topic_content it's not autoincrement. because, need topic_id topic entity when query it's ok, , insert data in topic_content table. me please, how in symfony orm. thanks. topiccontent namespace socialist\clubbundle\entity; use doctrine\orm\mapping orm; /** * @orm\entity * @orm\table(name="topic_content") */ class topiccontent { /** * * @orm\column(name="topic_id", type="integer") * @orm\id * */ protected $topic_id; /** * * @orm\column(name="topic_text", type="text", nullable=false) */ protected $topic_text; /** * @orm\onetoone(targetentity="topic", inversedby="topiccontent", cascade={"persist", "remove"}) * @orm\joincolumn(name="topic_id", referencedcolumnname="topic_id", ondel

.htaccess - Htaccess root to /frontpage/ -

how root direct /frontpage/ doesnt have load content there, because have rewrite url looks this rewriterule ^frontpage/?$ ?page=frontpage [nc,l] so has load content ?page=frontpage show /frontpage/ when enter site. possible, , how? i have tried things, seem able find rewrites loads /frontpage/ doesnt show in adress bar. have rules this: rewriteengine on rewritecond %{the_request} \s/+[\s?] rewriterule ^$ /frontpage/ [r=301,l] rewriterule ^frontpage/?$ ?page=frontpage [nc,qsa,l]

c# - Microsoft.Office.Interop.Excel for Office 2007 -

i want try windows form application converts office file (excel, word, powerpoint) pdf file. client's pc not install visual studio , office version 2007. application uses microsoft.office.iterop.excel.dll covert pdf format. dll file cannot found on client's pc , error has occurred following. system.augumentexception: value not fall within expected range. @ microsoft.office.interop.excel._workbook.exportasfixedfromat(.......) how can solve problem? my code following public bool exportworkbooktopdf(string workbookpath, string outputpath) { // if either required string null or empty, stop , bail out if (string.isnullorempty(workbookpath) || string.isnullorempty(outputpath)) { return false; } // create com objects microsoft.office.interop.excel.application excelapplication; microsoft.office.interop.excel.workbook excelworkbook; // create new instanc

How do I get all the numbers within a range JAVA? -

i have database field called numberrange not primary key. now in java, how numbers in range 101000001 - 10100050? i want display display, 10100001, 101000002, 101000003, 101000004, ... 10100050. i appreciate if me out here, struggling @ moment. edit, database looks this stockid|stockname|stockprice|stocklevels 1 | water| £0.50 | 101000001 - 10100050 java 8 officially out. return intstream.rangeclosed(101000001, 10100050);

php - Wordpress change sub-category class -

i'm having trouble wordpress site. i have page displaying categories , sub-categories. displayed in <ul> . now want give sub-categories class style them differently. is possible walker maybe? i can't change template because it's loaded in via plugin (events manager) edit: html generated: <ul> <li>category</li> <li>sub-category</li> <li>sub-category</li> <li>category</li> <li>sub-category</li> <li>sub-category</li> </ul> i can't change template because it's loaded in via plugin (events manager) it depends on plugin. should @ documentation plugin. plugins load default template allow override 1 of own in theme. plugin may provide filter allows customize output, seems specific customization you're not find. did know can target child <ul> elements in css without class? instance, following target <ul> elements nested under <ul>

Solr how to exclude custom fields from my schema -

my problem simple. have 30 fields in index. several cases want exclude 2 fields schema. won't happening always. based on customer data. for example if search "test". i trying add $querysolr: squerysolr->addparam('fq','available:(1) , (!field1 = '*test*' , !field2 = '*test*'); problem when other active fields match phrase ' test ' - there no result. how simple exclude field1 , field2 searching ? for excluding query, can add -(field1:"*test*" , field2:"*test*") . but if never want query on field1 , field2 , modify in schema. make indexed="false" fields.

html - bxSlider showing white background in phonegap -

i using bxslider simple slider. when displayed on browser bxslider works when debugging in phonegap slider displays white background slider navigational arrows. please help.... i had same problem cordova , jquerymobile. in ios bxslider worked charm, in android getting same, blank screen arrows you. i think related $(document).ready() function. in way, in android dom not organized, bxslider can't make work , hides images. if case, can solve calling bxslider init function in other event of jquerymobile, after document ready one. should work: <body> <div data-role="page" id="slider"> <script> $('#slider').on('pageshow', function(){ $('.bxslider').bxslider({ onsliderload: function(){ $('.slider_wrapper').css('visibility', 'visible'); } }); </scri

bash - How does terminal programs add scrolling to the screen? -

how programs less, more, or vi add scrolling section on terminal screen without clearing screen , how disappear afterwards? is there way run less specific amount of time if running script or way script exit? first off, has nothing bash or whatever shell you're using. less command handles screen updates; can run shell, or other program. your terminal emulator supports escape sequences . writing printable characters (letters, digits, etc.) causes characters displayed. writing escape sequences causes various other things happen: moving cursor, clearing current line, clearing screen, etc. the termcap or terminfo , curses or ncurses software packages provide access these escape sequences. less , vim , emacs , typically use ncurses manage screen. two sequences relevant question called ti , te termcap, smcup , rmcup terminfo. smcup sequence causes terminal save current state (everything displayed on screen cursor position), switches secondary display buffer

JavaScript jQuery dragging divs - is it really not that complicated? -

i have been working @ making durandal modals draggable off , on several days. there tons of info out there, , never of them work. tutorials, stackoverflow questions, , other such informational sources had these long elaborate code blocks job done. on w3.org website, less complicated-yet had hard time making drag methods work on durandal modal since added dom dynamically. ended copy-paste-deleting , trial-and-error methods until got working (though bit jumpy) on few lines of code , draggable attribute. want know if missing something...since easier found...or because things have come along far enough since of posts found works? html <div id="modaldialog" class="messagebox autoclose" draggable="true"> <div class="modal-header"> //modal html </div> <div class="modal-body"> //modal html </div> <div class="modal-footer"> //modal html </div&

ruby on rails - How do you search through a hash mapped from an ActiveRecord result? -

i have hash variable contains results activerecord search, iterated through display data. code (transcribed) goes somewhere this: hvar=user.map{|x| {:name => x.name, :type => x.type, :section => x.section, :result => (x.var1/x.var2).round(1)}} the hash variable 'hvar' display following through .inspect : [ {:name=>'michael', :type=>7, :section=>1, :result=>4.1}, {:name=>'seymour', :type=>4, :section=>1, :result=>3.9}, {:name=>'walter', :type=>2, :section=>1, :result=>6.3}, {:name=>'josephine', :type=>7, :section=>1, :result=>5.4}, {:name=>'carla', :type=>7, :section=>0, :result=>5.4} ] so far, good. now, wish search through resulting hash, e.g. records of type 7, , i'm not sure how it. found this: mission=hvar.select{|k| k[:type] == 7} but gives me 0 results, makes sense me, think searching through "first level

javascript - Dragging a div a fixed distance from bottom to top -

i creating project want able drag div (a drawer) (mostly) positioned off bottom of screen fixed distance on y axis. distance want move height of div (drawer - minus drawer handle). it pretty easy working top bottom, reversing posing quite challenge. feel might simple math error. i have put fiddle better illustrate issues i'm having. http://jsfiddle.net/q8de6/2/ here's code: html <div id="panelwrapper"> <div id="panel" class="panel"> <p> height of drawer dynamic, , slide appropriate amounted based on height of content. </p> <p> type of content can included in here. body of drawer , drawer pull tab can styled see fit, modify css/styles.css file. </p> <!--necessary div slide tab, modify needed, don't delete --> <div class="slide"> <a id="drawerslide" href="#" class="drawer-slide"> <table id="sta

visual studio express 2012 web cannot connect to Microsoft® SQL Server® 2012 Express -

is there bug when connecting visual studio express 2012 web installed on windows 7 connect sql server express 2012 or 2008r2? the error message this: > network-related or instance-specific error occurred while > establishing connection sql server. server not found or > not accessible. verify instance name correct , > sql server name configured allow remote connections. (provider: > sql network interfaces, error: 26 - error locating server/instance > specified.) in situation, vs connects sql if server os server os or win7 os win7 os ? here scenario got in environment : have 4 machines 1-win2012srv: -virtual machine -windows 2012 serversql server express 2012 visual studio express 2012 web -symantec antivirus (disabled) -firewall disabled -static ip address 2- win08r2srv: -virtual machine -windows 2008 r2 server -sql express 2008 r2 -visual studio express 2012 web -no antivirus -firewall disabled -static ip address 3- win7pc1: -real machine (pc)

json - d3 chloropleth losing geometry once second dataset is loaded -

i appear losing geometry data when load second json (containing electoral data) d3 chloropleth. prevents me calculating bounding box when want zoom particular electoral district. here mike's code (showing usa) zooms in , out fine when clicked doesn't overlay data: democra.me/zoom_mike.htm here live demo (using australia): democra.me/federal2.htm using chrome console, you'll see mike's correctly displays bounds of state while mine not because d no longer contains feature data, causing clicked() fail. i want keep map , data in separate files future flexibility (so matching id keep them in sync when loading) how can preserve geometry runtime? (the tooltips div outside svg , don't affect problem.) thx

saml - SPML client testing -

i have created spml client. need verify whether working perfectly. please suggest me available open source spml providers (servers) test spml client. thanks project keychain spml gateway. can used spml complaint provider.

Rails - unique template for multiple controllers -

for application, need several controllers having more or less same behavior (with few particularities each). basically, have that: # controllers/main.rb maincontroller < actioncontroller::base def show ... end def create ... end def destroy ... end end # controllers/first.rb firstcontroller < maincontroller helper_method :custom_stuff_one private def custom_stuff_one 'bli' end end # controllers/second.rb secondcontroller < maincontroller helper_method :custom_stuff_two private def custom_stuff_two 'bla' end end # routes.rb resources :first, :only => [:show, :create, :destroy] resources :second, :only => [:show, :create, :destroy] that works fine, wasn't able have same simplicity templates. i'd simple as: # views/main/show.html.erb <html> <body> here stuff in common controllers ... </body> </html> # views/first/show.html.erb <%= stylesheet_link_tag(

amazon s3 - Cannot view static webpage through custom domain via Route 53 -

Image
i own domain helpsaverosie.ca , i've set buckets www.helpsaverosie.ca & helpsaverosie.ca , have them both hosting static pages. i've used dig command in linux confirm helpsaverosie.ca hosted on route 53 properly. trying view website dns lookup failed here config under route 53 did delegate domain route 53? may take time dns caches expire old ns servers , start using route 53's. reason ask it's working me, see picture of rosie dog.

Want to open downloaded file in appropriate application in Android -

i have download document server, app , save private folder. the document can .doc, .pdf, .docs, .jpg etc. now, want is, after download completed, show alert dialog open document. when click on pen button open particular file in appropriate application , if app not available, show dialog download app. give me hint on this. thanks in advance. try way: mails attachment open file file = new file(yourdownloadfilepath); if ((download_file_name.endswith(".pdf")) || (download_file_name.endswith(".pdf"))){ if(file.exists() && file.length()!=0){ intent intent = new intent(); intent.setclassname("com.adobe.reader","com.adobe.reader.adobereader"); intent.setaction(android.content.intent.action_view); intent.setflags(intent.flag_activity_clear_top); uri uri = uri.fromfile(file); intent.setdataandtype

jquery mouse down event override. -

if have window , assign event attempts on right so. $( win ).mousedown( function ( e ) { alert( 1 ) } ) $( win ).mousedown( function ( e ) { alert( 2 ) } ) my second event 1 fires ( alert 2 ) , expect. though when move window child window(window.open) first event copped not second. example: make new window called newbrowserwindow then newbrowserwindow.document.body.appendchild( win );// copy in div once click on window in new browser window alert 1 not 2? just did simple .unbind( 'mousedown' ); before re assigning new event.

c# - AccountManagement create user return 'object already exists' exception -

i'm trying create new userprincipal in specific ou inside activedirectory, , returns exception message 'object exists'. (obviously) user don't exists in ou, , i'm testing existence. what doing wrong? here's code throwing exception: public userprincipal createuser(string username, string pass, string givenname, string surname) { principalcontext context = this.principalcontext; userprincipal user = new userprincipal(context); user.samaccountname = username; user.userprincipalname = username; user.givenname = givenname; user.surname = surname; user.setpassword(pass); user.save(); return user; } edit 1: after unit tests, found code ok. use method in lib (where run tests), called application, has windows authentication mode enabled. maybe app sending authentication ad? samaccountname must unique across enterprise. mention 'specific ou' when creating user. possible have user same username/sama

python - Django: Using expressions on related fields in extra or order_by -

i need calculate , order expression in django. what's efficient way this? example setup: class rating(models.model): rating = models.integerfield(...) prev = models.foreignkey('rating') i have calculate difference of current rating , previous , order it. have few methods work. method 1: use extra() add select clause calculates diff. depends on way django labels joined tables in sql query. example: rating.objects.filter(prev__isnull=false)\ .select_related('prev')\ .extra(select={'diff': 'rating.rating - t3.rating'})\ .order_by('-diff') (in case joined table named t3 since have second related field in model) method 2: add field model. method 3: sorting in python. inefficient. what i'd like: being able use f expressions in select clause, so: rating.objects.filter(prev__isnull=false)\ .extra(select={'diff': f('rating') - f('prev__rating')})\

php - Multiple User Types in Laravel 4 - Login Issues -

i doing project school , need more 1 user type : user, registrar , teacher. i followed laravel documentation , got user working (login/register). then tried adding user: registrar. got registration working , it's adding user in "registrar" table. but when i'm trying log in using "users" table, not "registrar" one, , giving me controller method "not found" error. model: registrar.php <?php use illuminate\auth\userinterface; use illuminate\auth\reminders\remindableinterface; class registrar extends eloquent implements userinterface, remindableinterface { protected $table = 'registrar'; protected $hidden = array('password'); public function getauthidentifier() { return $this->getkey(); } public function getauthpassword() { return $this->password; } } routes: route::get('/', array('uses' => 'homecontroller@authenticateuser')); rout

networking - Read IMAP packets from a tcpdump file in JAVA -

i have write program in java called imapsniffer.java analyzes imap packets (i.e., packets source or destination port of 143) contained in tcpdump file , outputs captured valid imap username/password pairs when terminates. valid username/password pair username , password has been accepted imap server. after reading imap packets tcpdump file program should exit exit code 0 captured usernames , passwords have been printed . in case of errors (e.g., wrong number of arguments, file not found, etc.) program should exit exit code 1 all found on internet programs sniffed packets devices attached systems (listening live traffic network device) none them had code sniff data saved file has packets pop3 , http imap etc .... all need step step tutorial how .. beginner java , first encounter it.. or link job ...

c# - How do I order the digits 1-10 randomly into an array and then call each part of the array one at a time? -

so basically, need have numbers 1-10 randomly ordered upon startup array, , on when form loads, should load first number. each time user clicks button, load info associated next number. code, reason generates number not integer lot. random rng = new random(10); int[] questionorder = new int[10]; (int = 0; < questionorder.length; i++) { int temp = rng.next(1,10); while(!(questionorder.contains(temp))) { questionorder[i] = temp; } } each time generates number 1 - 10 , checks if has been stored in array, if not, stores , runs again. for reason, generating numbers not integers 1 - 10, , cant figure out why. this work nicely static void main(string[] args) { random random = new random(); var range = enumerable.range(1, 10).tolist(); int[] rnd = new int[10]; int j = 0; { int = random.next(0, range.count); rnd[j++] = range[i]; range.removeat(i);

Rails + X-Sendfile serving large video to Ipad -

i have application serving large (some hundreds of mb) video files , working on desktop browsers, using rails + x-sendfile on apache. important requirement these videos must private , visible logged users, that's why i'm using rails serve them. everything works other devices. serve videos in way: response.headers["x-sendfile"]= filename send_file filename, :disposition => :inline, :stream => true, :x_sendfile => true but ipad 's requests need byte range header. solution (that not work perfectly) this: size = file.size(filename) bytes = rack::utils.byte_ranges(request.headers, size)[0] offset = bytes.begin length = bytes.end - bytes.begin response.header["accept-ranges"]= "bytes" response.header["content-range"] = "bytes #{bytes.begin}-#{bytes.end}/#{size}" send_data io.binread(filename,length, offset), :type => "video/mp4", :stream => true, :disposition => 'inline', :file

PHP MySQL Log of Additional Submissions -

i have online test taking system once user submits test form adds row table so; employee id | employee name | date test 1 taken employees can retake tests want replace 'date test 1 taken' date of recent submission, however, want log previous submissions. so i'd want second table 3 previous submissions so; employee id | previous submission 1 | previous submission 2 | previous submission 3 is possible "this employee retook test on different date, take current date in 'date test 1 taken', move other table under 'previous submission 1' , place current date in 'date test 1 taken'? extremely complicated, if @ possible..? i suggest design improvement. seems goal keep running record of each employee , test type. table should like: employeetest table: employeeid, employeename, testnum, datetaken, score you insert row employeetest table every test taken. can write queries like: select employeeid, employeename, testnum, datetake

ruby on rails 3 - accepts_nested_attributes_for triggering a 'Can't mass-assign protected attributes warning -

firstly first time have ever tried use accepts_nested_attributes_for , still learning , have missed small. so have setup , follow example doing accepts_nested_attributes_for keep getting activemodel::massassignmentsecurity::error @ /reports can't mass-assign protected attributes: deployment and can't figure out why, grateful code below: report model: class report < activerecord::base attr_accessible :name, :weekending, :visable, :deployments_attributes has_many :deployments, dependent: :destroy accepts_nested_attributes_for :deployments, allow_destroy: true end deployments model: class deployment < activerecord::base attr_accessible :deployment_comments, :deployment_name, :environment, :report_id belongs_to :report end report/new.html.erb <%= form_for (@report) |f| %> <%= render 'shared/error_messages' %> <h4>reprot detials</h4> <%= f.label "report written by: " %> <%= f.text_field :

python - django :: How to style a CheckboxSelectMultiple in a form? -

forms.py class formentry(forms.modelform): class meta: model = entry fields = ['name','price','share'] widgets = { 'share':forms.checkboxselectmultiple(), } after passing template: <ul id="id_share"> <li><label for="id_share_0"><input id="id_share_0" name="share" type="checkbox" value="2"> lily</label></li> <li><label for="id_share_1"><input id="id_share_1" name="share" type="checkbox" value="1"> rabbit</label></li> </ul> now want rid of ul , li, also, use bootstrap3's button group style it, this <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary"> <input id="id_share_0" name="share" type="checkbox" value="2"> lily

Stop process of webcam in java netbeans -

i want capture image using available webcam. have accessed webcam couldn't stop webcam process. want stop webcam process using stop button. how can accomplish this? code: public component componen() throws ioexception , noplayerexception, cannotrealizeexception { component comp_video; medialocator loo = new medialocator("vfw://0"); try { broadcast = manager.createrealizedplayer(loo); } catch (ioexception ex) { logger.getlogger(capturimage.class.getname()).log(level.severe, null, ex); } catch (noplayerexception ex) { logger.getlogger(capturimage.class.getname()).log(level.severe, null, ex); } catch (cannotrealizeexception ex) { logger.getlogger(capturimage.class.getname()).log(level.severe, null, ex); } broadcast.start(); if((comp_video = broadcast.getvisualcomponent()) != null)

android - Using ListActivity in Fragment -

the below code running custom listview implemented in seperate project. public class mainactivity extends listactivity implements ontouchlistener{ private mycustomadapter madapter; activity temp = this; string []s = new string[500]; arraylist<gs> q = new arraylist<gs>(); listview lv; int count=0; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); dbadapter db = dbadapter.getdbadapter(getapplicationcontext()); if (!db.checkdatabase()) { db.createdatabase(getapplicationcontext()); } db.opendatabase(); q = db.getdata(); madapter = new mycustomadapter(); madapter.addseparatoritem(new contentwrapper(q.get(0).geta_name(),null)); madapter.additem(new contentwrapper(q.get(0).getas_name(), q.get(0).getdesc_art())); (int = 1; < 460; i++) { if (!(q.get(i).geta_name().trim().equals(q.get(i-1).geta_name().trim()))) { madapter.addseparatoritem(new contentwrapper(q.get(i).get

R connecting R to twitter for sentiment analysis -

i refered link given below doing sentiment analysis http://heuristically.wordpress.com/2011/04/08/text-data-mining-twitter-r/ and when ran code given below :`for (page in c(1:15)){ # search parameter twitter_q <- urlencode('#prolife or #prochoice') twitter_url = # fetch remote url , parse mydata.xml <- xmlparsedoc(twitter_url, astext=f) # extract titles mydata.vector <- xpathsapply(mydata.xml, '//s:entry/s:title', xmlvalue, namespaces =c('s'='http://www.w3.org/2005/atom')) # aggregate new tweets previous tweets mydata.vectors <- c(mydata.vector, mydata.vectors) } after running code prompting me error error:error in usemethod("xpathapply") : no applicable method 'xpathapply' applied object of class "null" i/o warning : failed load http resource i installed packages roath,stringr,xml,plyr required.and using r ver 3.0.3 kindly me out pleas how go . struggling . great if guides me in righ

bufferedimage - Animating Frames -

Image
which class should use animate set of frames?i did this.it worked well.that animate picture.which class best? public jlabel frame; public image[] frames; public bird() { frames = new image[5]; frames[0] = gettoolkit().getimage("resources\\bird_swing_up2.png"); frames[1] = gettoolkit().getimage("resources\\bird_swing_up.png"); frames[2] = gettoolkit().getimage("resources\\bird_swing_down.png"); frames[3] = gettoolkit().getimage("resources\\bird_swing_up.png"); frames[4] = gettoolkit().getimage("resources\\bird_swing_up2.png"); } i animate in class this?is ok?is method better way do? private image city; private image ground; private int x = 0; private timer speedcontroller; private bird bird; private timer timer; int = 0; public board() { super(); ground = gettoolkit().getimage("resources\\ground.png"); city = gettoolkit().getimage("resources\\city.png"); speedcont

css - Form Box Weird in Chrome -

Image
any reason form act this? causing css issue between safari , chrome. form above actual box reason. thanks in advance! i figured out - there float:right; on actual input causing input go outside of form on chrome , ff - not safari. hope can else out!

Facebook Graph object not returning the values in android -

i want display users details in app facebook, here code: private string builduserinfodisplay(graphuser user) { stringbuilder userinfo = new stringbuilder(""); userinfo.append(string.format("name: %s\n\n", user.getname())); userinfo.append(string.format("birthday: %s\n\n", user.getbirthday())); userinfo.append(string.format("location: %s\n\n", user.getlocation().getproperty("name"))); userinfo.append(string.format("locale: %s\n\n", user.getproperty("locale"))); //jsonarray languages = (jsonarray)user.getproperty("languages"); graphobjectlist<mygraphlanguage> languages = (user.cast(mygraphuser.class)).getlanguages(); if (languages.size() > 0) { arraylist<string> languagenames = new arraylist<string> (); (mygraphlanguage

How can I access a variable in WCF in a static nature where the instance is not shared across calls? -

i have value want able access within wcf service in static nature, not have pass instance of object throughout different methods, not want each call service share instance, have value available within single call. if use "static" variable store value, ends being shared across multiple calls service, not behavior after. same thing happened when stored value in appdomain. service defined percall , hosted in iis, if makes difference solution. thank you. i got answer on over forum. http://social.msdn.microsoft.com/forums/en-us/aa27f0a3-2b9f-44cb-bd5c-9020c8502883/how-can-i-access-a-variable-in-wcf-in-a-static-nature-where-the-instance-is-not-shared-across-calls?forum=wcf

weka - Finding The Max Value from Density Function (Kernel Estimator) in Java -

i'm using kernelestimator class ( kernelestimator.java ) weka library. i want find max value in density function, is, value highest density. have been looking @ mean-shift algorithm ( mean-shift wiki ) don't know how implement methods have available kernelestimator class. specifically: how can implement mean-shift algorithm in java (or other algorithms find max value), preferable using have available kernelestimator class? if there better libraries can solve problem other weka library, please let me know. thanks.

delphi - Can I get a non MDI form to act as a MDI child? -

i have application have mdi form main form , several mdi childforms opens supposed have none mdi child forms able show inside mdi area. i have made unit inherites vcl.forms , has following code enables me control forms if try move them can't function work when form shown @ first. try move it jumps right place procedure tform.wmmoving(var amessage: twmmoving); var formsquare: ^trect; worksquare: trect; begin worksquare := getworksquare; formsquare := pointer(amessage.dragrect); if formsquare^.left < worksquare.left begin formsquare^.right := formsquare^.right - (formsquare^.left - worksquare.left); formsquare^.left := worksquare.left; end else if formsquare^.right > worksquare.right begin formsquare^.left := formsquare^.left - (formsquare^.right - worksquare.right); formsquare^.right := worksquare.right; end; if formsquare^.top < worksquare.top begin formsquare^.bottom := formsquare^.bottom - (formsqu

Mysql: How to strip out all the but letters and numbers in a column before performing a LIKE with a given string -

i wish know how google search, there road called st. john's road in database , type in ajax-auto-sugestion field... st john how can auto-selection show road content not use . or ' in database if start type... st. john then of course show suggestion used . can done ? my fields have proper names of roads , use utf8_general_ci road name field , method results. what using on server users interface mysql server? typically people use php process information between database , html on user's side. to purely in mysql (which i'm not sure you're trying accomplish), can use update table set field_name = replace( replace(field_name, '.', ''), '"'. ' ' ); this replace period no white space same, , periods whitespace space. it's easier in opinion sort of stuff in php, can use str_replace . this way you'll end using $address = ($_post['address']); $address = str_replace('.', 

html - Keep logo on the same line as nav -

i want have logo image on site on left of navigation. can tell me how should put code without having force other items onto row below: http://jsfiddle.net/spadez/gmm2p/11/ i think in-line block im not sure. i'm not sure if image should go within list or if should outside it. appreciated. here 2 ways can accomplish this: add css: .logo { float: left; } or make addition/change: .logo { position: absolute; } ul li { display: inline; padding-left: 30px; } where padding-left 's value enough pixels pushes links right of logo. it's impossible me know proper value without knowing width of logo image.

java - How do I connect a android app to a mysql database that is not local? -

hey have found plenty of tutorials people making databases on own computer trying connect 1 not local private class signupa extends asynctask<void, void, void> { @override protected void doinbackground(void... params) { string url = "jbdc:mysql://mywbdb.cjymdxzuzy46.us-east-1.rds.amazonaws.com:3306/mysql"; string dbname = "profiles"; string driver = "com.mysql.jdbc.driver"; properties userinfo = new properties(); userinfo.put("user", "user"); userinfo.put("password", "pass"); try { class.forname(driver); connection conn = drivermanager.getconnection(url + dbname, userinfo); charsequence text = "hello toast!"; toast tost = toast.maketext(getapplicationcontext(), text, toast.length_long); tost.show(); conn.close();