Posts

Showing posts from January, 2015

flex - Blaze DS custom marshaled object in Java end -

i have arraylist of custom object in servlet end. want send flex end custom marshaling through blazeds (as web project holds blazeds settings) flex end can arraycollection objects. how do that? can string or json arrays, dont want that, want custom marshaled object thorugh blaze ds, how do that? use [remoteclass(alias="")] metadata tag represent server-side java object @ flex end. same question asked , answered @ this link . how [remoteclass] work in flex actionscript can use custom data-binding?

html - Table - border not showing -

Image
it may in below image, there no border @ bottom of table. in code have set same properties rest of table, isnt picking up. priority? the table set 3 columns , 7 rows, have hidden first column. how can border appear @ bottom? replies. <table class="detailstable" style="width:100%; background-color:white; border-left-color:transparent; border-bottom-color:transparent; border-top-color:transparent;"> <tr> <th style="width:70%; border-left-color:transparent; border-top-color:#dbddff; border-bottom-color:transparent; border-right-color:#dbddff; background-color:white"></th> <th style="text-align:left; border-left-color:#dbddff; border-top:solid 2px #dbddff;">summary</th> <th style="text-align:right; border-top:solid 2px #dbddff"></th> </tr> <tr> ...

Google App engine JSP form -

i want use datastore in program .that on 1 jsp enter user info , after submitting redirects me jsp can see previous users information. using datastore how doit. will it? https://github.com/googlecloudplatform/appengine-guestbook-java there plenty of other examples under https://github.com/googlecloudplatform/ also, see https://developers.google.com/appengine/docs/java/gettingstarted/usingdatastore

Android Preventing Double Click On A Spinner -

i have unwanted problem default in spinner view. on android 2.2 when double click spinner opens twice, upon pressing button 2nd spinner closes 1st 1 remains open. i need fix issue. i want spinner show once regardless of how many times user clicks it. this problem doesn't exist in android 4.0+. is there way fix bug? you can use setenabled(false) when user click on item first time prevent further interaction, , make setenabled(true) when need.

lotus notes - Exporting Chinese characters to CSV file results in it being converted to question marks -

we exporting lotus notes documents csv file. of field have chinese characters in them. visible in lotus notes (though don't understand them) when export them csv file converted question marks. below code snippet using export: fieldnames = split("field1,field2,field3,field4", ",") set stream = session.createstream if stream.open(csvfilename) call stream.truncate() forall f in fieldnames call stream.writetext("""" + doc.getitemvalue(f)(0) + """,") end forall ..... ..... ..... end if here if field field1 contains chinese characters , exported, converted question marks. how export chinese characters? set charset "utf-16" stream: stream.open(csvfilename, "utf-16") works chinese.

c# - Calculate the volume of a GeometryModel3D -

i'm using helixtoolkit's modelimporter class( helix 3d toolkit collection of custom controls , helper classes wpf.) loading 3d objects stl files ( stereolithography file format native stereolithography cad software created 3d systems) . 3d models contain modelgroup3d object 1 or several geometrymodel3d objects inside depending on how many parts model comprised from. calculate volume of whole 3d model. searched similar questions , 1 answered 1 calculate volume of 3d mesh i'm not sure how reform solution. since i'm newbie appreciated. additionally models i'm loading closed meshes. thanks first convert surface mesh volume mesh. example, can convert triangulated surface mesh tetrahedral mesh. 1 way constructing constrained delaunay triangulation of surface triangles. next, can estimate of volume enclosed surface mesh, summing volumes of elements in volume mesh. example, summing volumes of tetrahedrons in mesh.

javascript - Why isn't $digest updating my scope in my unit test -

i have following code. reason test 1 failing. can tell me why? angular. module('mymodule', []). directive('mydirective', function () { return { restrict: 'e', scope: { myattr: '=' }, link: function (scope, element, attrs) { element.text(scope.myattr); } } }); describe('test', function () { var compile, rootscope; beforeeach(module('mymodule')); beforeeach(inject(function ($compile, $rootscope) { compile = $compile; rootscope = $rootscope; })); describe('test 1', function () { it('test', function () { scope = rootscope.$new(); // scope.myvar = "test"; element = compile('<my-directive my-attr="myvar" />')(scope); scope.$digest(); scope.myvar = "test...

java - Add one day into Joda-Time DateTime -

i have date wed may 08 00:00:00 gmt+06:30 2013 . add 1 day using joda-time datetime this. datetime datetime = new datetime(date); datetime.plusdays(1); when print datetime, got date 2013-05-08t00:00:00.000+06:30 . joda date time didn't add 1 day. haven't found error. thanks the plusdays method not mutator. returns copy of given datetime object change made rather changing given object. if want change variable datetime value, you'll need: datetime datetime = new datetime(date); datetime = datetime.plusdays(1);

javascript - What is (function($) {...}) (jQuery)? -

this question has answer here: what !function ($) { $(function(){ }) }(window.jquery) do? 1 answer why write code jquery this 4 answers i javascript newbie , came following code. (function($){ if(!document.defaultview || !document.defaultview.getcomputedstyle){ var oldcurcss = jquery.curcss; jquery.curcss = function(elem, name, force){ if(name !== 'backgroundposition' || !elem.currentstyle || elem.currentstyle[ name ]){ return oldcurcss.apply(this, arguments); } var style = elem.style; if ( !force && style && style[ name ] ){ return style[ name ]; } return oldcurcss(elem, 'backgroundpositionx', force) +' '+ oldcur...

How to end input when I just end inputting in on of 10 EditTexts i in Android? -

there 10 edittexts.when input these edittexts, softinputkeyboard shows "next" , @ last edittext shows "done".i can not hide softinputkeyboard until finish inputting of them. however, want hide softinputkeyboard when end inputting 1 of these edittext.so how this? do write following in activity oncreat() : this.getwindow().setsoftinputmode(windowmanager.layoutparams.soft_input_state_always_hidden); and problem solve. may you. if yes upvote , accept answer.

sql - pointing foreign key to datetime -

is possible make foreign key datetime datatype ? try got error message : msg 1776, level 16, state 0, line 1 there no primary or candidate keys in referenced table 'penduduk' match referencing column list in foreign key 'tgllahir'. msg 1750, level 16, state 0, line 1 not create constraint. see previous errors. i use query parent table : create table penduduk ( no int identity(1,1), noktp char(11) primary key, nama varchar(20), tgl_lahir datetime not null, namahari varchar(20), tgl int, bulan int, namabulan varchar(20), tahun int, umur int ) create table tua( noktp char(11) primary key, tgl_lahir datetime not null constraint tgllahir foreign key references penduduk(tgl_lahir), foreign key(noktp) references penduduk(noktp), ) try this: create table penduduk ( no int identity(1,1), noktp char(11) primary key, nama varchar(20), tgl_lahir datetime not null unique, namahari varchar(20), tgl int, bulan int, namabulan varchar(20), tahun int, umur int ) c...

jquery - Regex for Date Validation in javascript -

pls can give date validation regex, allow following rules are it should allow mm/dd/yyyy, m/d/yyyy, mm/d/yyyy, m/d/yyyy (not allow yy) number of days month (30 , 31) validation. feb month validation leap & non leap years. try this: ([0-9][1-2])/([0-2][0-9]|[3][0-1])/((19|20)[0-9]{2}) and if got valid string above regex string manipulations, below: if(/([0-9][1-2])\/([0-2][0-9]|[3][0-1])\/((19|20)[0-9]{2})/.test(text)){ var tokens = text.split('/'); // text.split('\/'); var day = parseint(tokens[0], 10); var month = parseint(tokens[1], 10); var year = parseint(tokens[2], 10); } else{ //show error //invalid date format }

Integer too long Java -

this question has answer here: “integer number large” error message 600851475143 8 answers public static void gramstoatoms() { system.out.println("enter amount of grams"); scanner keyboard = new scanner(system.in); long x = keyboard.nextlong(); system.out.println("enter unit grams"); long y = keyboard.nextlong(); long result = x/y; long answer = result*60200000000000000000000; system.out.println(answer + "atoms"); } how change code don't integer long error? just use biginteger instead of long biginteger bi=new biginteger("6020000000000000000000"); for method: public static void gramstoatoms() { system.out.println("enter amount of grams"); scanner keyboard = new scanner(system.in); string x = keyboard.nextline(); system.out.println("enter unit grams...

Calling javascript function from highcharts plotOptions -

i want call function plotoptions of highcharts tried throwing error plotoptions: { series: { events: { legenditemclick: function(event) { //iam trying call function here sampletest(testarr); } } } } is possible..how call function plotoptions. the error iam getting typeerror: d undefined yes can call function plotoptions events. highcharts allows so. check scope of function

c# - UI refresh looping a Dispatcher.BeginInvoke -

i'm trying system.windows.shapes.rectangle rotation in y axis simulating card rotation, showing route. the problem ui refreshes @ end. simplified version of code call of method for (i=0; i<=180; i++) { int j = i; dispatcher.begininvoke(new a_dispatcher(() => { print_animation_of_card(card, i); }), null); } method private void print_animation_of_card(system.windows.shapes.rectangle card) { ... system.windows.media.planeprojection p = card.projection system.windows.media.planeprojection; p.rotationy = i; card.projection = p; } i have tried put method, same result... how can show rotation movement of system.windows.shapes.rectangle? i believe problem using begininvoke() instead of invoke . not wait 1 angle of rotation complete before next 1 called, calls stacked on top of eachother. try dispatcher.invoke() or put whole loop inside 1 dispatcher.begininvoke() , see if results more satis...

c# - Nesting PredicateBuilder predicates : 'The parameter 'f' was not bound in the specified LINQ to Entities query expression' -

Image
i building predicates using linqkit's prediatebuilder class dynamically setup filters , i want combine nested 1 another . i have read ( http://www.albahari.com/nutshell/predicatebuilder.aspx ) : here code : // main predicate. var mainpredicate = predicatebuilder.true<document>(); // ... other conditions main predicate here ... // inner predicate (combined conditions using or). var innerpredicate = predicatebuilder.false<document>(); foreach (var period in periods) { var p = period; innerpredicate = innerpredicate.or( d => (d.date >= p.datefrom && d.date <= p.dateto)); } mainpredicate = mainpredicate.and(innerpredicate); documents = this.objectset.asexpandable().where(mainpredicate).tolist(); i combining 2 predicates explained in documentation. however, exception : the parameter 'f' not bound in specified linq entities query expression i first thought inner predicate has expand...

TypeScript: Global static variable best practice -

i have class need increment number each time class instantiated. have found 2 ways both ways works, not sure yet on best practice declare variable in module scope module m { var count : number = 0; export class c { constructor() { count++; } } } declare variable in class scope , access on class module m { export class c { static count : number = 0; constructor() { c.count++; } } } my take example 2 not adds count variable in module scope. see also: c# incrementing static variables upon instantiation definitely method 2 since class using variable. should contain it. in case 1 using variable become confusing once have more 1 classes in there e.g: module m { var count : number = 0; export class c { constructor() { count++; } } export class a{ } }

php - Fatal error when extending included class -

i trying simple thing here doesn't seem work. take @ code: include 'custom/mainclass.php'; $child = new childclass(); class childclass extends mainclass { } apparently childclass() cannot found (according php).. i'm 100% sure i'm doing stupid in way of ordering code. i searched web understand i'm doing nothing wrong.. you have declare classes in code first before using them. include 'custom/mainclass.php'; class childclass extends mainclass { } $child = new childclass(); //create instance after class has been declared edit: after research turned out, can use class before declaring it. but , declaration of class , parent classes must in same file . so if declare parent class in 1 file , child class in another, won't work. also, must declare parent classes first. after can extend them.

Google maps/places API search by phone -

we have signup page user enters business phone number. want find business information phone number verification. how can done google places/maps api? there better alternative? kind of lost. after looking through google api double-check, response doesn't return phone number company either. https://developers.google.com/places/web-service/ it may depend on type of business you're looking yelp allow phone number searches in api: https://www.yelp.com/developers/documentation/v2/phone_search

iphone - IOS Issue Accessing Class Properties -

i have view loaded subview programmatically. view has 3 properties defined in .h , synthesized in .m. view loaded creating object of view in parent controller , calling it's initialization function. in initialization function set number of values respective properties. reason not able access properties outside of initialization function. first thought properties defined incorrectly after messing around strong , weak attributes nothing changed. the uiview's .h #import <uikit/uikit.h> #import <quartzcore/quartzcore.h> #import <parse/parse.h> @protocol subviewdelegate - (void)photofromsubview:(nsinteger *)imageid; - (void)downloaddata; @end @interface imageviewer : uiview @property (nonatomic, assign) id <subviewdelegate> delegate; //three properties @property (nonatomic, copy) uiimage *mainimage; @property (nonatomic, copy) uiviewcontroller *parentview; @property (nonatomic) nsinteger imageid; - (void)removeimageviewer; - (void)captureimag...

Rails + Cucumber + Selenium: Tests failing together, passing separately -

using: rails 3.2.13, cucumber (1.2.3), selenium-webdriver (2.31.0), capybara (2.0.3) i working on mobile site , need use selenium test javascript features. however, when try run cucumber tests together, test following @javascript tagged tests failing this: action 'assets' not found sitecontroller (abstractcontroller::actionnotfound) /users/emai/.rvm/gems/ruby-1.9.3-p362@sherry3/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:116:in `process' /users/emai/.rvm/gems/ruby-1.9.3-p362@sherry3/gems/actionpack-3.2.13/lib/abstract_controller/rendering.rb:45:in `process' /users/emai/.rvm/gems/ruby-1.9.3-p362@sherry3/gems/actionpack-3.2.13/lib/action_controller/metal.rb:203:in `dispatch' /users/emai/.rvm/gems/ruby-1.9.3-p362@sherry3/gems/actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' /users/emai/.rvm/gems/ruby-1.9.3-p362@sherry3/gems/actionpack-3.2.13/lib/action_controller/metal.rb:246:i...

c# - .NET returning incorrect username -

i made spelling mistake when created account few weeks back. changed account , can log onto domain new name. have web application in house still picking wrong name. the .net application uses system.security.principal.windowsidentity.getcurrent().name; which gives old name. if use environment.username i correct new name. did miss in ad? there somewhere can change name result in system.security.principal.windowsidentity.getcurrent().name; giving correct name? i have no experience .net i'm sorry if question has obvious answer. check out here answer: http://social.msdn.microsoft.com/forums/en-us/csharpgeneral/thread/27e42d4a-6452-4840-bbf2-abbc16e22557 add key: "hklm/system/currentcontrolset/control/lsa/lsalookupcachemaxsize=0" to registry cached. don't think restarting iis fix issue.

javascript - How to attach an event at runtime to all html elements of a certain type using css? -

is possible attach event html tag css: input [type="text"] { onkeypress (dojob(this)); } with jquery may write this $('input[type=text]').keypress(function() {...})

How to show all tweeted data in XML file through twitter api? -

when i've typed in browser address bar "https://api.twitter.com/1/users/show.xml?id=valid_twitter_user_id" show last tweeted xml data of account. it's perfect me, want tweeted data twitter account. tell me how data through method? or there other method or api tweeted data account. thank in advanced! with api function using cannot tweets undestand documentation. have @ documation api twitter @ url dev.twitter.com/docs i think functionality looking reached combining uri have posted information of user acccound, , use https://dev.twitter.com/docs/api/1/get/statuses/user_timeline lates tweets. documentation states use calling uri https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=twitterapi&count=2 twitterapi replaced id or screen name.

java - Function works in main class but not it test class -

i have class compiles , runs expected (adds 1 test node per execution): public class reqsdb { private final string store_dir; public graphdatabaseservice graphdb; private static enum reltypes implements relationshiptype { identifies, satifies } public reqsdb(string dbpath) { store_dir = dbpath; graphdb = new graphdatabasefactory().newembeddeddatabase(store_dir); registershutdownhook(graphdb); } public void createtestnode() { transaction tx = graphdb.begintx(); node newnode; try { newnode = graphdb.createnode(); newnode.setproperty("test", "test"); tx.success(); } { tx.finish(); } } private static void registershutdownhook(final graphdatabaseservice graphdb) { runtime.getruntime().addshutdownhook(new thread() { @override public void run() { ...

design patterns - C++ signal listener for non-child pid -

i'm using c++ , need equivalent of sigchld process i'm aware of (i.e. know it's pid), did not spawn. is there established design pattern listen/watch/monitor process's lifespan when not child or in group or session? edit: trying aware of abnormal terminations (i.e. seg faults, signals, etc...). eavesdrop on signals process in question receives. i don't know if follows specific pattern, per se , 1 technique have process establish connection watcher. watcher monitors connection, , when becomes closed, knows process has shutdown. if watcher wants know if watched process responsive or not, can use connection monitor heartbeat messages process obliged provide. if watcher wants know whether watched process making progress, heartbeat message provide state information allow watcher monitor that. different operating systems may provide different ways achieve same objective. example, on linux, watcher use inotify monitor /proc entry process determine ...

c# - Does my View Model have my Model and my Repository instance? -

hopefully being clear here. have viewmodel called a . have model called m . have repository model m , db stuff maps called rm . would viewmodel, a , have property of model m , 1 repository rm . i use calling various methods on rm , bind m pass methods in rm save() . make sense? "normal" or close? you describing typical situation, depending on preferences. if view model wishes work entities, via repository inject dependency using constructor injection, , view model work against abstraction rather specific implementation of repository. if wished access repository @ later point after construction, assign repository private field or property example. in terms of model, have property exposes view didn't need duplicate properties of model on view model. however, depend on whether happy view having direct access model violation of lod (law of demeter) in order not violate dry (don't repeat yourself) principle.

Is it bad practice to use a Visual Studio Project folder as a virtual directory in IIS? -

is bad practice use visual studio project folder virtual directory in iis when doing development? instead, should copy files separate folder once application compiled? provided you're not using same environment push live changes, it's fine development setup. of course if you're on live website, it's not idea @ all. think it's pretty idea dev testing, saves step of having move files on test.

gerrit - Cannot push tags in Git -

i unable push annotated tag in git remote repository. access permission have been provided in gerrit. eg. [refs/*] i creating tag using below command git tag -a v1.0 -m 'base version' 712d77e when try push using below commands git push origin v1.0 or git push origin --tags i following error. counting objects: 1, done. writing objects: 100% (1/1), 157 bytes, done. total 1 (delta 0), reused 0 (delta 0) remote: processing changes: refs: 1, done ssh://... ! [remote rejected] v1.0 -> v1.0 (prohibited gerrit) error: failed push refs 'ssh://...' please let me know how should able push tags in repository. thanks.... this general error message returned gerrit if push not allowed, e.g. because pushing user has no sufficient privileges. in particular error occurs: if push commit code review branch don’t have upload permissions (access right push on refs/for/refs/heads/* ) if bypass code review without push access right on refs/heads/* if...

javascript - How do I scroll to the right on a page that overflows horizontally? -

i want scroll far right edge of page wide (it's wide on purpose) when user closes modal (specifically, reveal modal in foundation 4). i've tried setting id on div that's aligned way right, doesn't work. to scroll horizontally, use scrollleft() . $('body, html').scrollleft(400); jquery supports animating scrollleft property. to scroll way right, full width of page, , subtract window width left edge : var left = $(document).outerwidth() - $(window).width(); $('body, html').scrollleft(left);

HTML5 canvas at button click? -

i want make menu options user choose before initializing canvas. how can it? want make options, user clicks button , page becomes canvas using values previous page (how can pass them?) the best thing put sliders increase/decrease (input type range?) value on canvas, can add form canvas somehow? how “keeping simple” create form asks setup questions. put canvas directly on top of form , hide it. when user has answered questions: hide form, show canvas. draw on canvas. no need reinvent wheels…just html. here’s code , fiddle: http://jsfiddle.net/m1erickson/jr4rx/ <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" media="all" href="css/reset.css" /> <!-- reset css --> <script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script> <style> body{ background-color: ivory; padding:20px; } #container{position:relat...

iphone - NSJSONSerialization JSONObjectWithData:options:error: encoding issue -

in code, download json data encoded in utf8 , ideal work nsjsonserialization , when parsed object, it's full of encoding problems such as: "jo\u00e3o e maria - ca\u00e7adores de bruxas" (it must "joão e maria - caçadores de bruxas"). tried reencode in ascii, unicode , others no success: nsdata *downloadeddata = [nsurlconnection sendsynchronousrequest:[nsurlrequest requestwithurl:requesturl cachepolicy:cachepolicy timeoutinterval:timeoutinterval] returningresponse:null error:&error]; nsdictionary *serializeddictionary = [nsjsonserialization jsonobjectwithdata:downloadeddata options:nsjsonreadingallowfragments error:&error]; edit: when print using this, shows correctly: nslog(@"test: %@", [[nsstring alloc] initwithdata:downloadeddata encoding:nsutf8stringencoding]); those utf8 encoded characters. format correct, put them on uilabel or , they'll appear expect.

android - How to format ListView Rows -

i have following xml file customadapter: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="?android:attr/listpreferreditemheight" android:padding="6dip"> <textview android:id="@+id/firstline" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignleft="@+id/nullline" android:layout_alignparentbottom="true" android:gravity="center_vertical" android:text="my application" android:textcolor="#0099cc" /> <textview android:id="@+id/nullline" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_above="@+id/secondline" android:layout_ali...

html - jquery.typer.js is not working on ie7 to ie9 versions -

i having issue jquery.typer.js isnot displaying texts shows on other browsers firefox, chrome, safari. have created demo of work on jsfiddle. main issue want typer.js work works on non-ie-browsers. here code using typewritter effect. <div class="bubble_wrap"> <div class="bubble"></div> </div> <script> var win = $(window), foo = $('.bubble'); foo.typer(['<h2><span>hey!</span><br> create hand-forged web 2.0/3.0/ responsive websites, illustrations , html/css/html5/css3 slicings....</h2> ', '<h2><span>i </span><br>love doing vector arts, playing games , listening music in spare time.</h2>', '<h2>i <span><br>rajesh kr. das</span> working in ixod ui/ux designer <br>&amp; <br>front-end developer.</h2>']); </script> the full working example works on modern browsers fails load o...

xslt - Convert escaped xml into nodes of the current document -

i working set of interrelated documents collecting single xsl , processing (determining url used based on content , processing done far). for example document being fetched xsl using: <xsl:for-each select= "(document('<someurl>')//atom:entry/atom:content/m:properties/d:presentationcontent) [position()=1]"> <xsl:call-template name="formhandler"/> </xsl:for-each> this fine documents. except in 1 case content of element d:presentationcontent contains escaped xml directly text (ie. not using cdata) e.g. &lt;component&gt;&lt;id&gt;tcm:10-7788&lt;/id&gt;&lt;/component&gt; is there way within xsl fetch document, convert encoded strings xml , process nodes if part of document example can treated if were: //atom:entry/atom:content/m:properties/d:presentationcontent/atom:component/atom:id i long way through solution , costly me change @ stage - gratefully received. (backup plan construct ...

Android Relativelayout gets messed up when background is applied -

without backgound: 1 http://puu.sh/2pybe.png with background: 2 http://puu.sh/2pyb2.jpg strangely, appears case in graphical layout tab of eclipse. when app opened in emulator or phone, layout appears fine. what problem here? code: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/paperh"!!!!!!!!!!!!!backround applied here!!!!!! android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context=".gamelayoutactivity" > <button android:id="@+id/button1" andro...

Jenkins with Active Directory Authentication, need DC log on rights to work -

we installed jenkins v1.514 on win2008r2 box service active directory v1.33 plugin. plugin not have dn or dc specified , authenticates correctly, except that, admin/local log on rights on hosting machine, cannot log jenkins without being granted local log on rights domain controller. thoughts on begin troubleshooting/research since jenkins users should not have log on rights dc?

Where is my Google map marker? -

i'm trying single marker show on google map, coordinates right, , map shows, dont know code marker. can help? here link live page here - live google map page you never call function pan() contains marker creation in code. that's why don't see it.

filtering packets from a specific ip using perl and Net::Pcap and Net::PcapUtils -

Image
i've been trying write script filters packets out of device , specific ip address on device. i want data output wireshark when select specific device , use ip.src==xx.xx.xx.xx my program far this #!/usr/bin/perl -w $interface='eth1'; sub process_pkt #packet processing routine { ($user_data,$header, $packet) = @_; $minipacket = substr($packet,0,54); print ("\n## raw: ###\n"); print ($minipacket); print ("\n==byte# / hex / dec / bin==\n"); ($i=0;$i<55;$i++) { $hexval = unpack('h2',substr($packet,$i,1)); $decval = hex(unpack('h2',substr($packet,$i,1))); printf ("%03s-%02s-%03s-%08b\n", $i, $hexval, $decval, $decval); } } # ###################################################################### # here invoking netpcap module , looping through forever. net::pcaputils::loop(\&process_pkt, snaplen => 65536, #size of data packet promisc => 1, #put in promiscuous mode filter => 'tcp...

c++ - Move constructor and pre-increment vs post-increment -

in c++, if have loop "copies" objects of user defined type using move constructor, make difference if use ++i or i++ loop counter? i know question seems rather vague, (i believe) asked in phone interview. wasn't sure if understood question correctly, , interviewer took not knowing answer, , cut interview short. what have been getting at? in c++, if have loop "copies" objects of user defined type using move constructor [...] first of all, move constructor used move-constructing, means not "copying": can realize moving copying - in fact, class copy-constructible move-constructible - why defining move constructor explicitly? [...] make difference if use ++i or i++ loop counter? it depends on i is. if scalar object, int , there no difference @ all. if i class-type iterator, on other hand, ++i should more efficient (on purely theoretical ground), because implementation of operator ++ not have create copy of iterator ...

file upload - Uploading content is only supported for 'http' and 'https' schemes -

i'm trying upload file ftp server, i'm using code : uri uri; if (!uri.trycreate(serveraddressfield.text.trim(), urikind.absolute, out uri)) { rootpage.notifyuser("invalid uri.", notifytype.errormessage); return; } // verify not snapped, or can unsnap open picker. if (applicationview.value == applicationviewstate.snapped && !applicationview.tryunsnap()) { rootpage.notifyuser("file picker cannot opened in snapped mode. please unsnap first.", notifytype.errormessage); return; } fileopenpicker picker = new fileopenpicker(); picker.filetypefilter.add("*"); storagefile file = await picker.picksinglefileasync(); if (file == null) { rootpage.notifyuser("no file selected.", notifytype.errormessage); return; } passwordcredential pw = new passwordcrede...

frequency - Elasticsearch how to return the number of maching term for each document -

i'm new elasticsearch , i'm interested in how possible retrieve number of matching term inside each document processed. know can score, i'm looking number of matches each document, possible? edit after mguillermin answer what looking query index, , receive @ same time tf on each document result, , not find term frequency of single document thanks for checking single document, can retrieve kind of information using explain api : http://www.elasticsearch.org/guide/reference/api/explain/ if need information collected along query results, can add "explain": true body sent _search . ex : { "explain": true, "query": { "term": { "description": "test" } } } with parameter, each hit associated _explanation data. ex : "_explanation": { "value": 1.4845161, "description": "fieldweight(description:test in 63), product ...

scroll - How do I lock a carousel in Sencha Touch -

i using carousel , lock carousel until button clicked. there easy way this? thanks! my code far: ext.define('babyben.view.maincarousel', { extend: 'ext.carousel.carousel', xtype: 'maincarousel', config: { fullscreen: true, activeitem: 1, indicator: false, scrollable: { direction: 'vertical', directionlock: true }, items: [{ xtype: 'whatscreen' }, { xtype: 'startscreen' }, { xtype: 'whenscreen' }] } }); you need write custom view lockable carousel: ext.define("myapp.view.lockablecarousel",{ extend: 'ext.carousel', initialize: function () { this.ondragorig = this.ondrag; this.ondrag = function (e) { if(!this.locked){this.ondragorig(e);} } }, locked: false, lock: function () { this.locked = true; }, ...

git - Purge a repository from my Github, using the command line -

i understand how purge github repository account using web interface ... but can't figure out how perform same operation local command line using authenticated git client. is possible? if so, how? you can delete remote branches in github repository (you cannot delete project or repository itself, without using github's special apis). push branch leading colon delete it. git push <remote name> :<branch name> typically, simple github project, 1 master branch, checked out using command line example shown in project page, be: git push origin :master certainly, be careful destructive command. check remote , branch names if there other remotes or branches in project don't want delete.

javascript - Fire Function if Button or Other Button Is Clicked -

this obvious, because it's hard describe, can't find through searching. i want if user clicks on of several buttons, 1 event gets triggered. possible? i've tried, doesn't appear work: $("#button1" || "#button2").click(function() {alert("example")}); try this: $("#button1, #button2").click(function() {alert("example")}); http://api.jquery.com/multiple-selector/

java - android.webkit.WebView cannot be cast to android.widget.Button -

i working on gui inside of app. had crappy contained of basic stuff test java functions in. after had functions , running redisgned gui using graphical editor in eclipse. next time ran app had android.webkit.webview cannot cast android.widget.button in logcat. didn't change in java , declarations in gui same far can tell. can revert gui crappy version doesn't me much. hope on here can me find problem. have posted xml, java, , logcat. 05-09 13:25:19.756: e/androidruntime(10424): fatal exception: main 05-09 13:25:19.756: e/androidruntime(10424): java.lang.runtimeexception: unable start activity componentinfo{com.example.dcc/com.example.dcc.actionitem}: java.lang.classcastexception: android.webkit.webview cannot cast android.widget.button 05-09 13:25:19.756: e/androidruntime(10424): @ android.app.activitythread.performlaunchactivity(activitythread.java:2059) 05-09 13:25:19.756: e/androidruntime(10424): @ android.app.activitythread.handlelaunchactivity(activitythread.j...