Posts

Showing posts from March, 2015

vb.net - Adding Excel Object Library conflicts between Excel.TextBox & Forms.TextBox in Office Development -

i have implemented several basic excel functions in vb.net application (opening xls workbook & accessing worksheet). however, appears when add reference "microsoft excel 14.0 object library" application getting confused standard system.windows.forms objects , has following error: invalidcastexception occured: unable cast object of type 'system.windows.forms.textbox' type 'microsoft.office.interop.excel.textbox'. invalid cast error happening when calling subroutine & passing application form controls (check boxes, gridview, textbox, etc) main "form1" class utilityfunction module. utilityfunction has reusable windows registry sub routine retrieves/saves values @ application startup/closing. worked in past, crashing @ subroutine call in form1 class. exception occurs during application runtime, not during compile/build. also, deleted text controls form , created them manually, i'm still getting same exception error. when have n

events - Swing invokeandwait -

i learning swing , created sample gui. trying achieve following in exact order... the user enters text text fields. the user clicks "launch" button. the "launch" button becomes disabled. a background thread spawns , processes text text fields. the background thread finishes. the "launch" button becomes enabled again. i trying use invokeandwait can seen below "cannot call invokeandwait event dispatcher thread". main method in same .class file , i'm not sure "event dispatcher thread" is. whats best approach this, need setup kind of alert in worker thread route "event dispatcher thread"? launchbutton code private void launchbuttonactionperformed(java.awt.event.actionevent evt) { launchbutton.setenabled(false); try { java.awt.eventqueue.invokeandwait(new mytestthread()); } catch (exception e) { } launchbutton.

java - SOAP/HTTP + WSDL as a contract. What about JAX-WS? -

i'm newbie webservice, , i've read this chapter (and other articles) idea soap. sad, couldn't find next chapter wsdl in java.net. anyway, let's suppose need implement soap 1.1/http 1.1. the used "contract" exchange information wsdl . so, in order create webservices provider : what role of jax-ws ? would needed or alternative wsdl ? if needed, shall combine ( soap/http + wsdl)? what role of jax-ws in combination? could replaced jax-rpc (or else)? is jax-ws cross-platform or specific java ? if moving platform, such c or c++ or python , able use jax-ws if needed combined? talking c#,.net... jax-ws similar wcf? thank in advance :) soap , http message protocols. jax-ws implementation in java generating these messages. handles low level details of converting java objects soap messages, generating java classes based on wsdl , xsds. jax-ws used creating soap based rest based messages. underlying technology handles messages on both cli

java - YourKit Export CSV Data Formats -

i attempting extract data displayed in yourkit's "threads" view (on thread state; when each thread "waiting" or "runnable"). have used command-line export utility generate of formats of views supports. contained in export directory file "table--thread-life-cycle--name-history.csv". seems contain information require, cannot find documentation on columns in file. for reference, columns are: id uptime_ns thread thread_name frame top_method top_non_filtered_method thread_life_cycle_id name a sample of data single thread might be: 94 11879264791 57 executor task launch worker-0 39131 java.lang.thread.<init>(threadgroup, runnable, string) scala.collection.traversablelike$withfilter$$anonfun$foreach$1.apply(object) 52 keep-alive-timer 95 11899612660 57 executor task launch worker-0 39191 java.lang.thread.<init>() scala.collection.traversablelike$withfilter$$anonfun$foreach$1.apply(object)

javascript - Knockout.js textarea binding not updating after subscribe (item selected in combo box) -

i'm pretty new this, can't figure out i'm doing wrong... text-area not getting new value after subscribe occurs (item selected in combo-box) i'm getting data requests... can't figure out if i'm not doing in success part of 'subscribe' inside viewmodel or if wrong bindings... appreciated... <div style="margin-top: 100px; width: 80%; margin-left: auto; margin-right: auto;"> <h2>workflows</h2> <select data-bind="options: workflows, optionstext: 'name', value: workflow, optionscaption: 'choose workflow...'"> </select> <input data-bind="click: put" id="runworkflow" type="button" value="run workflow" /> <textarea data-bind="value: moo" type="text" style="background-color: beige; color: black; display: block; margin-top: 20px; height: 400px; width: 80%;"> </textarea> <script type="text/jav

ruby - Referencing delayed_job job id from within the job task -

i've got delayed_job task spits out file. i'd able prefix file id of job created it, reference later on. # create file has job id in name... job_id = thing.delay.create_file # we'll use job_id search file... is possible? let's take here... class writefilejob attr_accessor :dj_id, :file_name def initialize(file_name) @file_name = file_name end def perform # @dj_id; don't worry, we'll set below end end now when enqueue job, should job back: j = delayed::job.enqueue(writefilejob.new("foo.txt")) next, load object enqueued, , updated id got back: object_to_update = yaml.load(j.handler) object_to_update.dj_id = j.id # update handler j.handler = object_to_update.to_yaml j.save

Php Navigation issue -

i got line of code right here: <?php include_once('pages/component/header.php') ?> <?php include_once('pages/component/nav.php') ?> <!-- body --> <?php $action=$_get['status']; switch($action) { case 'about': include_once "pages/about.php";break; case 'portfolio': include_once "pages/portfolio.php";break; case 'contact': include_once "pages/contact.php";break; default : include_once "pages/default.php";break; } ?> <?php include_once('pages/component/footer.php') ?> but when i'm surfing in page on wamp localhost, error saying: notice: undefined index: status in c:\wamp\www\index.php on line 5 does body know why occurs? it works fine when upload on ftp. the problem not first checking if there $_get['status'] variable. example, if go url this: http://localhost/index.php or http://localhost/ there no $_get

javascript - Add legend to d3 scatterplot matrix -

i'm trying add legend d3 scatterplot matrix (using example template: http://bl.ocks.org/mbostock/4063663 ), , while scatterplot displaying expected, have been unable add legend. code plot , 1 of attempts @ adding legend below: var width = 960, size = 150, padding = 19.5; var x = d3.scale.linear() .range([padding / 2, size - padding / 2]); var y = d3.scale.linear() .range([size - padding / 2, padding / 2]); var xaxis = d3.svg.axis() .scale(x) .orient("bottom") .ticks(5); var yaxis = d3.svg.axis() .scale(y) .orient("left") .ticks(5); var color = d3.scale.category10(); d3.csv(datafilename, function(error, dataset) { var domainbytrait = {}, traits = d3.keys(dataset[0]).filter(function(d) { return d !== "class"; }), n = traits.length; traits.foreach(function(trait) { domainbytrait[trait] = d3.extent(dataset, function(d) { return d[trait]; }); }); xaxis.ticksize(size * n); yaxis.tick

If Ado.Net is "outdated" then why is it that everyone still uses it in solutions with sql? -

i having discussion other day in regards connecting databases , using stored procedures , such, told ado.net outdated , not being used, everywhere solutions on connecting sql or interacting sql still using ado. told days of using ado long gone , entity framework being used. because fewer people learning ado? or separation of programmers , sql developers?

bash - How to get memory usage high water mark on OSX -

i'd able test guesses memory complexity of various command line utilities. taking simple example grep pattern file i'd see how memory usage varies size of pattern , size of file . for time complexity, i'd make guess, run time grep pattern file on various sized inputs see if guess seems borne out in reality, don't know how memory. one possibility wrapper script initiates job , samples memory usage periodically, seems inelegant , unlikely give real high watermark. i've seen time -v suggested, don't have flag available on machine (running bash on osx) , don't know find version supports it. i've seen on linux information available through proc filesystem, again, it's not available me in context. i'm wondering if dtrace might appropriate tool, again concerned simple sample-based figure might not true high watermark? does know of tool or approach appropriate on osx? edit i removed 2 mentions of disk usage , asides , p

java - Input from a file (Find the nth element for the Linked List) -

the problem find nth element in linked list, have problem figured out on finding element. but have read input file , output nth element list for example input b c d 4 e f g h 2 output g it stated "the first argument path filename containing series of space delimited characters followed integer representing index list (1 based), 1 per line" i not sure how go this? first read file , store each line in list? yes, should read file line line, , store each line in list<string> . then, this: string line; // use iterator on list each line string[] elements = line.trim().split("\\s"); char[] chars = new char[elements.length - 1]; int index = integer.parseint(elements[elements.length - 1]); (i = 0; < elements.length - 1; i++) char[i] = elements[i].charat(0); now have characters in array ... , said have rest figured out.

Python TkInter bind breaking -

i have simple gui uses key binds - this. import tkinter, tkfiledialog class foo(object): def __init__(self, master): master.bind('3', self.do_bar) master.bind('9', self.load_new_config) self.load_config() if not self.conf: self.load_new_config() else: self.load_data() def load_config(self): try: self.conf = #get stuff known file except failedtogetstuff: self.conf = none def load_new_config(self): path = askopenfilename(initialdir='~') self.conf = #get stuff file in path self.load_data() def load_data(self): #get data self.conf, process , display def do_bar(self): #do stuff displayed data if __name__ == "__main__" root = tk() foo(root) root.mainloop() now, works fine when load_config() finds looking for. can use binds , after using '9' , loading new config,

regex - How to redirect attachment URL after permalink change -

say example blog permalink structure (year/month/title) http://blog.example.com/2012/04/my-title and posts permalinks are: http://blog.example.com/my-title to make sure google search results don't break want add .htaccess redirect. using yoast permalink redirector generator on website suggests adding: redirectmatch 301 ^/([0-9]{4})/([0-9]{2})/([^/]+)/$ http://blog.example.com/ $3 at first glance works great. wordpress has attachment urls such as: http://blog.example.com/2012/04/my-title/my-attachment-url/ that link should redirected to: http://blog.example.com/my-title/my-attachment-url/ but it's not when using yoast redirect. thoughts on how update .htaccess regex catch attachment urls well? i'll keep googling in mean time. can post on wp stack overflow tends better answers server regex htaccess questions. i think regex right. need escape slashes backslash: ^\/([0-9]{4})\/([0-9]{2})\/([^/]+)\/$ actually capture attachment urls surround

java - Guice FactoryBuilderModule NullPointerException On Generated Factory -

i new guice , have done lot of reading on have not hand success this. creating dao , want use guice , assistedinjection. end goal create injected factory in other classes throughout application. intended use in actual class have injection of factory classes it public class testallmodelbootstrap { @inject private daofactory factory; public testallmodelbootstrap() { } @test public void testgettingdao() { injector injector = guice.createinjector(new hibernatedaomodule()); token otoken = new opertokenv1(); accountingdao accountingdao = factory.create(otoken); } } this based on guice-based code of: public interface daofactory { public accountingdao create(token oticket); } the concrete class has constructor annoated @inject public hibernateaccountingdao(@assisted token oticket) { this.oticket = oticket; } and actual module: @override protected void configure() { install(new factorymodulebuilder() .implement(

c - initialization fail on struct -

this question has answer here: how initialize struct/class on global scope 3 answers i have been trying run before main (no calls yet). says initialization fail. cause? compiler complains on number of braces, seem ok. struct contain { char* a; int allowed; struct suit { struct t { char* option; int count; }; struct inner { char* option; int count; }; }; }; // initialize struct contain _vector = { .a = "john", .allowed = 1, .suit = { .t = { .option = "on", .count = 7 }, .inner = { .option = "on", .count = 7 } } }; you need declare member of

android - variable initialization failure -

as know asynctask works background thread , returns control gui when task complete , requests through volley can made in main activity thread , lets assign json response string variable upon completion of request , string null , program further processes reponse, problem got was thrown nullpointerexception while processing response string after successful response , absurd possible if response slow program may continue without initializing string variable ?? it sounds not using proper callback on data. in other words, after start asynctask, have wait until done until reference global variables might impact. so, if didn't write proper callback method, yes program continue. idea behind asynctask - let thread called on continue while long process of kind.

shell - Rename leaf subdirs with names starting in RR -

i looking rename subdirectories names begin rr , don't have subdirectories of own 'a' in bash , if glob wildcard doesn't match print wildcard character itself, e.g. if /somedir/ not have subdirectories, after expansion /somedir/*/ literary equivalent '/somedir/*/' . so simple bash script find directories without subdirectories , names beginning rr be #!/bin/bash shopt -u nullglob while read -r dir; [[ $(echo "$dir"/*/) == "$dir/*/" && ${dir##*/} =~ ^'rr' ]] && echo "$dir" done < <(find . -type d) should easy interpolate there, not clear want when have multiple directories matching criteria , can't rename them a ? to rename directories rretcetc a , change following #!/bin/bash shopt -u nullglob while read -r dir; [[ $(echo "$dir"/*/) == "$dir/*/" && ${dir##*/} =~ ^'rr' ]] && mv -v "$dir" "${dir%/*}/a"

java - Method calling itself.. recursive? -

public static int m(int i, int j) { if ( > j) return 0; else { i++; m(i++, j); } return i; } i had 2 questions. 1.) returned out.print(m(3,8)); , 2.) how many times method m called? answers should 5 , 7 respectively. when worked out question 1, came out 5 way did incorrect because method not called 7 times, called twice. way did went straight else statement since (i > j) false @ start , method m called again time (4, 8) figured still false went line m called , variable changed 5 because of i++ in m(i++, j) . after return 5 value of i. that wrong added out.prints values of throughout program see how value changing , went 3 9 out.print(i); @ beginning of method m . out.print(i); right before return i; showed values started go backwards 10 5 , method called 7 times. how work? edit: after logging it, able come logic clarify correct. method m called 3,8 @ start. after, calls 4,8 5,8....until 9,8 if stateme

Simple Java Graphic Program Not Displaying -

basically i'm starting learn graphics in java made simple program display 2 rectangles , string on screen. program compiles fine not display 2 rectangles or string. input on problem appreciated. //classone.java import javax.swing.*; public class classone { public static void main(string[] args) { jframe f = new jframe("title"); f.setdefaultcloseoperation(jframe.exit_on_close); classtwo object = new classtwo(); f.add(object); //add object frame f.setsize(400,250); f.setvisible(true); } } //classtwo.java import java.awt.*; import java.awt.event.*; import javax.swing.*; public class classtwo extends jpanel { public void paintcomponet(graphics g) //takes object graphics class { super.paintcomponent(g); this.setbackground(color.black); g.setcolor(color.white); g.fillrect(25, 25, 100, 30); //x,y,width, height g.setcolor(new color(190,81,215)); g.fil

Salesforce's APEX language specification -

i'd find out exact apex language specification (with grammars, etc.) i've spent half day , ended nothing. i know apex java-based language, compiling it's spec on own java spec , exclusively apex things pain. is there place can apex language specification? for not familiar them - i'm looking such document http://docs.oracle.com/javase/specs/jls/se7/html/index.html it. thanks in advance! my understanding salesforce haven't published such document. instead want use tooling api tokens etc... see grammar creating apex parser incidentally, salesforce stackexchange site linked above great place ask salesforce specific questions.

java - Web Server : retrieve POST data values -

i'd value of specific key when web server detects post request. the best method found : string content = request.getcontent(); example of post data : field1=some-data&field2=other-data i need : "some-data" given field "field1" i tried use : string value = request.getparameter("field1"); but works if pass data url .. i wonder if should use regex. if case, best pattern ? thanks in advance!

php - How to use OR function in a statement -

i want set $a = 5 between 09.00h , 16.59h, monday friday. $time = time()%86400; if( (date("d") == "mon") || (date("d") == "tue") || (date("d") == "wed") || (date("d") == "thu") || (date("d") == "fri") && $time >= 32400 && $time <= 61119){ $a = 5; } have && time read @ end? read "mon or tue or wed or thu or fri..." , "time...", or instead "fri , time"? you're close, you'll need set of parenthesis around ors, cleaner way write might be: if( in_array((date("d"), array("mon","tue","wed","thu","fri")) && $time >= 32400 && $time <= 61119 ){ or even: !in_array((date("d"), array("sat","sun"))

internet explorer - Javascript confirm box works in Chrome but not in Firefox and IE -

the following javascript works fine in chrome not in firefox or ie, in case, i'm executing in jquery ajax , ajax executed file echo code browser. <script> var con=confirm("well done, have made new sale. click ok proceed"); if(con==true) { window.location.href="sales_supervisor.php"; } else { return false; } </script> it working fine in chrome, not working in firefox , ie. remove else condition , since return should used in functions...

ios - Selectively push in viewWillAppear in a UIViewControllerContainer -

we have app model object can pass through various states in progressive fashion - think of order progressing sale, example. each state of order handled different view controller. each view controller recognizes state(s) can handle, , when state has been reached cannot handle, pushes subsequent view controller handle next state. various events can cause vc update view; method setupviewbyorderstate called @ point. same method called in viewdidappear . for example, order can pass through states 1-10. viewcontroller handles states 1-2, b handles 3-5, , c handles 6-10. if handed order in state 1 or 2, configures itself. if handed order in state 3 or greater, pushes b, , hands off order. etc. one advantage of technique first vc 'entry point' - hand given order , push necessary vcs until 1 reached can handle order in current state, without logic explicitly coding state->vc correspondences ever needing exist outside each vc. a problem arises, though, should 1 wis

tsql - Select start time between start and end time -

i want fetch start time should not in between start , end time (fetching reference of table). ve tried getting error. can me on this.? select distinct right(start_time,7) st_time session_info coursename = 'java' , (right(start_time,7) not in between (select right(start_time,7) session_info session_id in (select session_id sessions userid='a')) , (select right(end_time,7) session_info session_id in (select session_id sessions userid='a'))) also reusing same query (select session_id sessions userid='a') how store in variable? you can rewrite code like select distinct right(start_time,7) st_time session_info coursename = 'java' , session_id in (select session_id sessions userid = 'a') , not (right(start_time,7) between right(start_time,7) , right(end_time,

encryption - EFS in ASP.NET C# with form authentication? -

i'm new encrypting file system (efs). have asp.net web application hosted on windows server 2008. web application saves files in local folder on server. when applied efs (encrypt contents secure data) attribute folder while using administrator login, files inside got encrypted , not accessible other users. but, web application cant access files. web application set forms based authentication. how can permit web application access files? efs designed allow user encrypted data see it. since encrypted value administrator user user application running (network service or whatever you've configured) doesn't have access. need give them decrypt rights on folder. forms authentication has no bearing on this, doesn't interact windows-level security. you can specify user going through details section of folder properties window , specifying web app user. may have enable loading user profile application pool though. but being said, don't know if efs let iis dec

Two instance of SQL Server with same name? -

can have 2 db instance on same server same database name in sql server? if mean 2 sql server "named instances" each 1 containing same "database" name, yes. on 1 server have 2 named instances: servername\instancea servername\instanceb both instancea , instanceb each contain database name "mydatabase"

.htaccess - i want htaccess grammer to hide php extension -

i have folder e:\wamp\www\world_appeal admin panel e:\wamp\www\world_appeal\admin i want ht-access grammar hide php extension files of front , admi panel well. please give me idea. every effort appreciated. place these 2 rules first rule in /world_appeal/.htaccess : rewriteengine on rewritebase /world_appeal/ rewritecond %{the_request} /world_appeal/(.+?)\.php[\s?] [nc] rewriterule ^ %1 [r=301,l,ne] rewritecond %{request_filename} !-d rewritecond %{document_root}/world_appeal/$1.php -f rewriterule ^(.+?)/?$ $1.php [l]

ios - Phonegap app Jquery page scroll not working in iphone 5 -

Image
i developing phonegap app cordova 2.0 , jquery mobile design. app having header , content , footer mentioned in screenshot below my media content has 1000 lines of contents . main content not scrolling in iphone 5 . scroll works fine ipad , iphone 4 . you may want read - http://apachecordova.blogspot.co.il/2012/11/who-is-murdering-phonegap-its-jquery.html . working on project written jqm, , on client side there poor native app show html content. project convert native code pg, , later understood jqm bad companion pg. there many side effects, , application full of bugs, wish never had started project. consider not using jqm or pg (meaning, not together). know isn't answer cannot post comment.

vb.net - Get all the folders and sub-folders in side a directory -

i learning vb.net, know how folders , sub-folder s inside directory , how add them listbox. list folders while scanning showing current folders found. have tried few things never seem work. have tried this: sub getdirectories(byval startpath string, byref directorylist arraylist) dim dirs() string = directory.getdirectories(startpath) directorylist.addrange(dirs) each dir string in dirs getdirectories(dir, directorylist) next each item in directorylist listbox1.items.add(item) next end sub private sub button1_click(sender object, e eventargs) handles button1.click dim dirlist new arraylist getdirectories("c:\hexing\", dirlist) end sub try this private sub button1_click(sender object, e eventargs) handles button1.click try dim dirlist new arraylist dim dirs() string = directory.getdirectories(startpath) dirlist.addrange(dirs) each dir string in dirs getdirectories(dir, directorylist)

Linux kernel driver same device on different buses? -

is there example of same device using different buses, example spi , i2c (simultaneously, depending on choice)? i interested in device have common routines, uses different read/write functions. for example adc has common function calibration or triggering (never seen in kernel adc drivers, why not?), different functions read samples different sources. how such driver can realized? should in module? : static struct i2c_driver my_i2c_driver = { .driver = { .name = "my-i2c-driver", }, .probe = my_i2c_driver_probe, .remove = my_i2c_driver_remove, }; static struct spi_driver my_spi_driver = { .driver = { .name = "my-spi-driver", }, .probe = my_spi_driver_probe, .remove = my_spi_driver_remove, }; etc... read/write, ops i'm interested in theory, if "no need", "no 1 that." actually in 3.10.25 kernel there such

scala - IntelliJ IDEA 13 CE consuming lots of CPU -

i upgraded intellij idea 12 ce 13 ce few days ago , has been hogging cpu. every few minutes it'll peak 450-500% , come down 100-200%. also, i've upgraded scala plugin 0.30.380. not sure what's causing issue!? i'm posting comment k p answer, because k p not have enough reputation. it needed more memory prevent repeated garbage collection. found file idea.vmoptions [aka idea64.exe.vmoptions] , increased memory inteiij run (xms = 512m , xmx = 2048). cpu usage has come down 0.2 - 10% when nothing being done on it.

Combine different parts of sprites to form a single sprite in cocos2d-x in ios game using c++ -

i starter in cocos2d-x.i have multiple sprites of arms legs eyes etc.i want create single sprite ,suppose human out of has arms,legs,eyes,head,body etc.how it..as have animate them , make human walking , have kill on touch.any 1 here please tell me logic in cocos2d-x using c++ cocosbuilder can used assembling body parts. laying down each sprite own layer, can animate them, create different animations walking, dying. tutorials : http://www.raywenderlich.com/23996/introduction-to-cocosbuilder http://www.plungeinteractive.com/blog/2012/10/29/using-cocosbuilder-on-cocos2d-x-games/

asp.net mvc - Partial View - client validation is not working with jquery ajax post -

in index page show list of employees, when user click on edit link show edit view. this edit view renders partial view (_editpartial) show different fields edititable. when user click on save button want make ajax post call. i want validate inputs before posting data server. tried using unobtrusive validations validation not triggering @ me. following code snippet. clientvalidationenabled & unobtrusivejavascriptenabled enabled in web.config. code snippet partial view code @model webapplication1.models.employee <div id="mypartial" class="form-horizontal"> <h4>employee</h4> <hr /> @html.validationsummary(true) @html.hiddenfor(model => model.id) <div class="form-group"> @html.labelfor(model => model.name, new { @class = "control-label col-md-2" }) <div class="col-md-10"&g

javascript - Subtotal Group using jquery -

fiddle <table border="1" class="csstable"> <tr id="trgroup"> <td> black, total <asp:label id="lblcount" runat="server"></asp:label> </td> </tr> <tr> <td class="csstd"> </td> </tr> <tr> <td class="csstd"> b </td> </tr> <tr id="trgroup"> <td> white, total <asp:label id="lblcount" runat="server"></asp:label> </td> </tr> <tr> <td class="csstd"> x </td> </tr> <tr> <td class="csstd"> y </td> </tr> <tr>

python - Failed to execute proxy.cgi on virtualhost apache -

i've been trying execute proxy.cgi openlayers on computer using windows 7 , xampp. when tried using localhost/mymaps/cgi-bin/proxy.cgi execute perfectly. but when tried execute using virtualhost came server error! the server encountered internal error , unable complete request. error message: couldn't create child process: 720002: proxy.cgi i @ error log said [thu feb 06 14:24:16 2014] [error] [client 127.0.0.1] (os 2)the system cannot find file specified. : couldn't create child process: 720002: proxy.cgi [thu feb 06 14:24:16 2014] [error] [client 127.0.0.1] (os 2)the system cannot find file specified. : couldn't spawn child process: c:/xampp/cgi-bin/proxy.cgi this httpd-vhosts.conf file <virtualhost *:80> serveradmin admin@sidik.com documentroot "c:\xampp\htdocs\sidik" servername sidik.com serveralias sidik.com <directory "c:\xampp\htdocs\sidik"> order allow,deny allow options indexe

java - Is there a framework availabe that will let me load all the tweets of a user? -

is there way, can download or see tweets user ? want see oldest tweets users when have 8k tweets. browsing down first 1 take long ! if there shell command or twitter-api available task ? at most, can last 3,200 tweets. can retrieve 200 per request. see documentation @ https://dev.twitter.com/docs/api/1.1/get/statuses/user_timeline

java - android error "cant create handler inside thread that has not called looper.prepare" -

this question has answer here: can't create handler inside thread has not called looper.prepare() 15 answers i have dialog fragment named shareid , service named sendmapdataservice.when called sendmapdataservice shareid got error cant create handler inside thread has not called looper.prepare.... shareid package dialog; import com.rosaloves.bitlyj.url; import static com.rosaloves.bitlyj.bitly.*; import java.util.calendar; import updatedata.gpstracker; import updatedata.sendmapdataservice; import com.example.map.locationsendactivity; import com.example.map.r; import android.app.progressdialog; import android.content.intent; import android.net.uri; import android.os.asynctask; import android.os.bundle; import android.support.v4.app.dialogfragment; import android.util.log; import an

Composite index creation in DB2 -

i used create composite index oracle table following script. create index index_name on my_table (column1,column2,column3) tablespace tablespace_name; when tried same in db2 , got errors @ tablespace , tried using following script simply, create index index_name on my_table (column1,column2,column3); is fine in db2 ? new db2 , no syntax found when searched composite index in db2 , not sure this. need advice. for create index documentation, can check infocenter: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0000919.html the db2 create index sentence provided correct. remember in db2, not provide tablespace @ index creation. tablespace indexes specified when create table create table xx ( ... ) in ts_table index in ts_indexes for more information create table, please take @ this: http://pic.dhe.ibm.com/infocenter/db2luw/v10r5/topic/com.ibm.db2.luw.sql.ref.doc/doc/r0000927.html

javascript - KineticJS Undo layers: layers don't disappear on undo? -

Image
i have specific problem on designer drawing tool in canvas html5. developing action history system (undo & redo). building system on projeqht 's answer on this question serializing layers in history array. core, idea of solution working have strange problem. when hit undo creates new layers, old ones not disappearing. attach sourcecode , attach screenshots can see happening: sourcecode: var history = array(null); var historystep = 0; var arraynonremovable = array('movelayer', 'scalefromouternode', 'scalefrominnernode', 'rotatefromoutersign', 'rotatefrominnersign' ); function removelayerbyundoredo(l) { if (l) { l.destroy(); l.draw(); stage.draw(); } } function makehistory(layer, before, after, operation) { historystep++; if (historystep function undohistory() { if (historystep>0) { version = history[historystep]; layer = version.layer; var befo

Snort not showing blocked/dropped packets -

i'm trying detect ping flood attacks snort. have included rule (drop icmp any -> any (itype:8; threshold, track by_src, count 20, seconds; msg:"ping flood attack detected"; sid:100121)) in snort's ddos.rule file. i'm attacking using command hping3 -1 --fast the ping statistics in attacking machine says 100% packet loss however, snort action stats shows verdicts as block ->0. why happening? a few things note: 1) rule missing value seconds. need specify timeout value, have "seconds;" need "seconds 5;". since not valid i'm not sure when snort going generate alert, means may dropping of icmp packets, not generating alerts. 2) rule going drop every icmp packet itype 8. threshold specifies when alert, not when drop. going drop packets match , generate 1 alert per 20 drops. see manual on rule thresholds here . 3) if not have snort configured in inline mode, not able block packets. see more on

javascript - Dynamic HTML audio not loading/playing in Android browsers -

i trying load audios dynamically in project. i've used jplayer, mediaelement.js , javascript create audio element. working fine in desktop browser fails in android(os 4.1+) browsers except firefox. i've attached codes of various player tried. jplayer: $("#jquery_jplayer_1").jplayer({ ready: function (event) { $(this).jplayer("setmedia", { mp3: "sample.mp3", oga: "sample.ogg" }).jplayer("play"); }, swfpath: "js", supplied: "mp3, oga", wmode: "window", smoothplaybar: true, keyenabled: true, ended : function(){ //$(this).jplayer("stop" ); //$(this).jplayer("playhead",100); if(pcnt != tocarr.length-1){ $("#nextins").css("display","block"); } } }); mediaelement.js: audioplayer = new mediaelementplayer("

ios - Get specific objects from xml document -

i'm trying create array, xml documents. problem want objects id equal passedid . id previous viewcontroller. how can implement this? i've created gives me phrase objects. - (void)viewdidload { [super viewdidload]; nsstring* path = [[nsbundle mainbundle] pathforresource: @"lists" oftype: @"xml"]; nsdata* data = [nsdata datawithcontentsoffile: path]; rows = [[nsmutablearray alloc] init]; nsxmlparser* parser = [[nsxmlparser alloc] initwithdata: data]; [parser setdelegate:self]; [parser parse]; // additional setup after loading view. } - (void)parser:(nsxmlparser *)parser didstartelement:(nsstring *)elementname namespaceuri:(nsstring *)namespaceuri qualifiedname:(nsstring *)qualifiedname attributes:(nsdictionary *)attributedict { if ([elementname isequaltostring:@"phrase"]) { translation = attributedict[@"translation"]; meaning = attributedict[@"meaning"]; pron

php - Yii DropdownList prompt -

i have dropdownlist, doesnt take prompt or empty default value, takes last value of $list, why can be? $models = zfinfraestructuras::model()->findall(array('order' => 'infraestructura_nombre')); $list = chtml::listdata($models, 'infraestructura_id', 'infraestructura_nombre'); echo chtml::dropdownlist('infraestructuras', $models, $list, array('prompt' => 'selecciona infraestructura')); ?> </div> public static string dropdownlist(string $name, string $select, array $data, array $htmloptions=array ( )) check select parameter http://yiiapi.com/chtml#dropdownlist-detail

java - Eclipse generate getters and setters and automatically apply them -

in java code directly accessed member variables. want refactor , use getter , setters. how can make eclipse automatically replace direct assignments setters , each access getter? right click -> source -> generate getters , setters creates functions not apply them in rest of code. use refactor menu. has item "encapsulate fields" generates getters , setters "source -> generate getters , setters" does, in addition replaces usages of fields , makes fields private. (as mnemonic: change structure of existing code (i.e. refactor it), use refactor menu. generate new code not used yet, use source menu. is, if create new class getters , setters, can use of source menu coding fields , auto-generate getters , setters afterwards. if want existing code use getters , setters instead of direct field access, classic case of code refactor ing.)

julia lang - How to alter an expression in generic function? -

e.g. function sq(x) x ^ 2 end function sq2(x) (x+1) ^ 2 end function fun(x) sq(x) end i replace sq call sq2 call redefine fun generic function. attempt below changes call wasn't able redefine function. appreciated. change(:fun, (int,)) function analyze_expr(exp::expr) = 1:length(exp.args) arg = exp.args[i] if(typeof(arg) == expr) analyze_expr(arg) elseif(arg==symbol("sq")) exp.args[i] = symbol("sq2") end end end function change(sym::symbol, params) func = eval(sym) func_code = code_lowered(func, params) func_body = func_code[1].args[3] analyze_expr(func_body) println("printing function body:",func_body) end i suspect you'll find easier kind of work using macros: http://docs.julialang.org/en/latest/manual/metaprogramming/ given existing function definition, relevant thing in julia isn't syntax generated compiled machine code resulted.