Posts

Showing posts from July, 2012

graph - Neo4j/Gremlin/Cypher: how to get all nodes until i reach a certain distance (depth) in a map-like setup? -

graph - Neo4j/Gremlin/Cypher: how to get all nodes until i reach a certain distance (depth) in a map-like setup? - i have simple graph fields - each fields has 4 neighbours (north-east-south-west): @nodeentity public class field { @graphid long id; field north; field east; field south; field west; //.. other stuff } i graph db (neo4j) set these nice , connected (like grid). want nodes - starting node - i.e. 5 hops away. with classic traverses works fine , looks this: public collection<field> getfieldswithdepth(field startfield, final int depth) { node fieldnode = this.getgraphdb().getnodebyid(startfield.getid()); traverser traverser = fieldnode.traverse(traverser.order.breadth_first, // check direct relations first, go deeper new stopevaluator() { @override public boolean isstopnode(traversalposition pos) { if (pos.depth()==depth) ...

.net 3.5 - Strange behavior of the '??'-operator in C# 3.5 -

.net 3.5 - Strange behavior of the '??'-operator in C# 3.5 - is bug or interpreting '??'-operator wrong? check out property below , comments. i'm using c# .net 3.5 private list<mytype> _mytypelist; private list<mytype> mytypelist { { //the 2 code lines below should each behave 3 under, don't? //the ones uncommented working, commented result in list returning empty (newly created suppose). //return _mytypelist ?? new list<mytype>(); //return _mytypelist == null ? new list<mytype>() : _mytypelist; if (_mytypelist == null) _mytypelist = new list<mytype>(); homecoming _mytypelist; } } edit: sorry looked @ question when freshly asked, there errors in got confuse everyone. thanks great , fast feedback! i've understood error made. thanks! this line: return _mytypelist == null ? new...

vb.net - Items icons with listview and imagelist -

vb.net - Items icons with listview and imagelist - hello i've got list view opens items within folder , displays them. want know if there way have list view display icons aswell, maybe using shell32 or imagelist. here's code: imports system.io imports system.xml imports system.runtime.interopservices imports microsoft.visualbasic public class cv7import private sub cv7import_load(byval sender system.object, byval e system.eventargs) handles mybase.load dim caminho string caminho = "c:\documents , settings\software\ambiente de trabalho\1" lstvicon.view = view.details lstvicon.gridlines = false lstvicon.fullrowselect = true lstvicon.hideselection = false lstvicon.multiselect = true lstvicon.columns.add("nome") lstvicon.autoresizecolumns(columnheaderautoresizestyle.headersize) dim di system.io.directoryinfo = new system.io.directoryinfo(caminho) dim files() system.io.fileinfo = di.getfiles dim fi...

android - Hide notification bar without using fullscreen -

android - Hide notification bar without using fullscreen - here problem: possible hide android notification bar without using fullscreen flag? need adjustresize app when soft keyboard shown, fullscreen apps ignore resizing (as far know). has thought on how create app fullscreen without flag? here problem fullscreen flag: tries show important, need resize app: and xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <edittext android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:text="edittext1"/> <edittext android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom=...

objective c - About moving few methods to the superclass -

objective c - About moving few methods to the superclass - i need move same method 4 different classes superclass. such methods same except type of variable declared in them: for example, in method in first class have firstclass var = [[firstclass alloc] init] in sec class secondclass var = [[secondclass alloc] init] and on. what's best way implement variation in superclass ? should utilize nsclassfromstring in superclass , each string each method in subclasses? thanks if different types of ivar's intend on initializing in subclasses descended mutual class, i'd store class in super, or else store id. then, setup property accessor in each of subclasses casts ivar need it. @interface superclass : nsobject{ id _superivar; } @end @implementation superclass : nsobject ....super's code.... @end now in implementation of subclass declare property in category, shown below (or in interface, if want public) @interface subclass ...

c++ - Is it possible to apply breadth-first search algorithm of boost library to matrix? -

c++ - Is it possible to apply breadth-first search algorithm of boost library to matrix? - my task find shortest way in matrix 1 point other. possible move in such direction (up, down, left, right). 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 1 0 1 f 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 s 0 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 s - start point f - destination place (finish) 0 - free cells (we can move through them) 1 - "walls" (we can't move through them) it obvious breadth first search solves problem in optimal way. know boost library supplies algorithm, haven't boost before. how can breadth first search in case using boost? understood, breadth first search algorithm of boost intended graphs. guess isn't thought convert matrix graph m*n vertices , m*(n -1) + (m-1)*n edges. can apply breadth first search algorithm matrix (without converting graph), or improve implement own function breadth first search? (apologies in advance length...

Jquery mobile: How to pass params to the page (hash URL)? -

Jquery mobile: How to pass params to the page (hash URL)? - i've got list elements contain links: class="lang-html prettyprint-override"> <a class="ui-link-inherit" href="#card_ops?card=1111"> and class="lang-html prettyprint-override"> <a class="ui-link-inherit" href="#card_ops?card=2222"> 1) click on first link location in browsers changes on #card_ops?card=1111 - goes page #card_ops. 2) homecoming on previour page using button. 3) click on sec link href="#card_ops?card=2222" location in browsers changes 1 time again on #card_ops?card=1111 not 222 is possible pass params pages in jq mobile? here's 1 solution i've found. not sure how works haven't tried it. http://blog.digitalbackcountry.com/2011/12/passing-data-between-pages-in-jquery-mobile/ jquery-mobile

vba - Calling Subroutines and values in a User Defined Function (Excel) -

vba - Calling Subroutines and values in a User Defined Function (Excel) - i grateful if help in simple solution. below have short code user defined function in excel. naming columns (in big spreadsheet) to calculate in sumifs calculation. if want have same columns named , utilize variables writeoff1 , writeoff " in user defined function, how can that? have tried set names of column in subroutine (in same vba project , module) , tried phone call subroutine, looks can not pass names function. can help solution? many in advance. public function writeoff(rev_date variant) variant application.volatile (true) set order_type = sheets("kronos").range("$d:$d") set final_price = sheets("kronos").range("$h:$h") set paidalt = sheets("kronos").range("$i:$i") set excl_rev = sheets("kronos").range("$k:$k") set pamount1 = sheets("kronos").range("$o:$o") set fir...

java - Giving JMenuItem's name to it's ActionListener -

java - Giving JMenuItem's name to it's ActionListener - how can give jmenuitem s names actionlistener attached them at? i've got menu scheme that's handled single actionlistener , , items in menus duplicate names. isn't problem on user end, because it's obvious what; in fact, more confusing if had different names. however, @ end, want label each item uniquely. the section creates items looks this: string label = getlabel(forthisitem); jmenuitem item = new jmenuitem(label); item.setname(parentmenu.getname() + "_" + label); item.addactionlistener(actionlistener); parentmenu.add(item); interrogating item afterwards (and outside scope of method) getname() gives name gave it, should, output of public void actionperformed(actionevent ae) { string actionperformed = ae.getactioncommand(); system.out.println("actionperformed: " + actionperformed); } is the, perchance duplicated, name user sees, specified label , not u...

silverlight - How to display application title in XAML text field -

silverlight - How to display application title in XAML text field - i have windows phone page code shared multiple applications. at top of page, show title of application, so: is possible create text bound application title defined in application's assembly? i realise code reading title in assembly , doing like: this.applicationtitle.text = title; i hoping title defined in assembly accessed magic like: text={assembly title}" straight within xaml. thanks create property called applicationtitle returns name of application following, , bind in xaml: public string applicationtitle { { homecoming system.reflection.assembly.getexecutingassembly().getname().name; } } (you can utilize relative binding source if can't or don't want utilize info context.) edit: i realized method involved security considerations since getname method [security critical]. , got methodaccessexception stating: effort access method failed...

Writing CSV file. myPackage.MyClass cannot be cast to java.lang.CharSequence -

Writing CSV file. myPackage.MyClass cannot be cast to java.lang.CharSequence - i need write list<myclass> mylist csv file. in particular need write values . myclass has next implementation: public class myclass { private object[] values; //... @override public string tostring() { string line = ""; (int i=0; i<this.getsize(); i++) { //if (this.values[i] != null) { line = line + this.values[i] + " "; //} } homecoming line; } } the code following: private void savesolutiontocsv(list<myclass> solution) { int columnsize = solution.get(0).getsize(); seek { filewriter author = new filewriter("test.csv"); iterator result = solution.iterator(); while(result.hasnext()) { for(int = 0; < columnsize; i++) { charsequence element = (charsequence)result.next(); writer.append(element...

c++ - Are there any issues with allocating memory within constructor initialization lists? -

c++ - Are there any issues with allocating memory within constructor initialization lists? - i have used initialization lists great deal in c++ programs wasn't aware allocate memory within them. so can (as contrived example) this: class test { private: int* i; int* j; int count; int* k; public: test(void) : i(new int), j(new int[10]), count(10), k(new int[count]) { } ~test(void) { delete i; delete [] j; delete [] k; } }; are there issues in doing memory allocation in way? regarding order of initialization here safe have parameter initialized 1 initialized in same list? i.e. allocate count before utilize safe utilize or there special initialization order fall foul of? it's not exception-safe. if new j throws exception destructor test not called, , memory i not freed. the destructor of i called if initializer j throws, it's raw pointer has no destructor. create exception-safe rep...

playframework JPA Error and DB design issue -

playframework JPA Error and DB design issue - i next error: jpa error jpa error occurred (unable build entitymanagerfactory): @onetoone or @manytoone on models.issue.project references unknown entity: models.project here can see entities: package models; import java.util.*; import javax.persistence.*; import play.db.jpa.*; import models.issue; import models.component; public class project extends model{ public string self; @id public string key; @onetomany (mappedby="project", cascade=cascadetype.all) public list<component> components; @onetomany (mappedby="project", cascade=cascadetype.all) public list<issue> issues; public project(string self, string key) { this.self = self; this.key = key; this.components = new arraylist<component>(); this.issues = new arraylist<issue>(); } public project addcomponent(string self, int component_id, string name, int issuecount) { component newcomponent = new com...

timestamp - find record closest to a given time in ruby on rails -

timestamp - find record closest to a given time in ruby on rails - background i have ror application continuously recording , showing on web site real time sensor data. have table called sensors has unique list of sensors , stores latest values. i have table histories dumps sensor values ever received each sensor. so relation "sensor has many histories" , time_stamp col records creation time stamp. not sensors update @ same interval or frequency. problem now want take input time stamp user, date , time in past, , show sensors showing @ time. illustration want see sensors looked @ 2 pm yesterday, 1 time have time stamp user, how retrieve 1 sensors value closest input time stamp history table. i looking add together method in sensor model, take time_stamp argument, , retrive value closest input time_stamp history table. what simplest way write active record query? thanks shaunak just sort histories according difference between passed...

C: what is the function of an asterisk before a function name? -

C: what is the function of an asterisk before a function name? - i've been confused see on c programs has unfamiliar function declaration me. void *func_name(void *param){ ... } what * imply function? understanding ( * ) in variable type creates pointer variable can able track address @ latter variable stored in memory. in case of function, don't know * asterisk implies. the asterisk belongs homecoming type, , not function name, i.e.: void* func_name(void *param) { . . . . . } it means function returns void pointer. c function pointers

HTML Table Colspan -

HTML Table Colspan - i making calendar using next html code: <!doctype html public "-//w3c//dtd html 4.01//en" "http://www.w3.org/tr/html4/strict.dtd"> <html> <head></head> <body> <table border="1"> <tr> <td colspan="2">mon</td> <td colspan="2">tue</td> <td colspan="2">wed</td> <td colspan="2">thu</td> <td colspan="2">fri</td> </tr> <tr> <td colspan="1">item1</td> <td colspan="9">item2</td> </tr> </table> </body> each day has colspan of 2 can show whether item takes place in morning or whole day etc. in above illustration want "item1" show in first cell (mon morning) , "item2"...

asp.net - MVC3 check for references to model record before deletion -

asp.net - MVC3 check for references to model record before deletion - what best practice checking if references particular model record exist before deleting record? basically, have model represents images, , metadata associated image. other models have references 1 or more images (depending on model). let's example, have "item" has "mainimage" , "altimage", both of references image model. if delete item record, have check if 2 images referenced other item, or other table, , if not delete image. how go this? since using database, allow maintain referential integrity using foreign key constraints on images. database or ef prevent deleting image if still beingness referenced. can grab exception , go on processing request without deleting image. i found blog posting inferring foreign key constraints in ef may of utilize in setting these up. asp.net asp.net-mvc-3

header - how to create excel file and read xls using php excel reader? -

header - how to create excel file and read xls using php excel reader? - create excel file dataexcel.xls using php. dataexcel.xls file has more data. same dataexcel.xls file doesn't read php excel reader. straight created .xls files readable. created excel file not readable. have used http://sourceforge.net/projects/phpexcelreader excel reader class. header("content-type: application/x-msdownload"); header("content-disposition: attachment; filename=dataexcel.xls"); header("pragma: no-cache"); header("expires: 0"); any header content change? php header export-to-excel createfile

xml - Creating XSL for Atom feed -

xml - Creating XSL for Atom feed - i'm creating little custom xsl file render rss feed. contents basic, follows. works flawlessly except when source xml contains line 'xmlns="http://www.w3.org/2005/atom"' in feed definition. how address this? i'm not familiar plenty namespaces know how business relationship case. <?xml version="1.0" encoding="iso-8859-1"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" > <xsl:template match="/" > <html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns="http://www.w3.org/1999/xhtml"> <body style="font-family:arial;font-size:12pt;background-color:#eeeeee"> <xsl:for-each select="feed/entry"> <div style="background-color:teal;color:white;padding:4px"> <span style="font-weight:bold">...

java - Hibernate Mappings cannot be found, only when running from a JAR -

java - Hibernate Mappings cannot be found, only when running from a JAR - i have project in src/main/resources have 2 mapping files. foo.hbm.xml, bar.hbm.xml when running main class eclipse, works fine. when exporting jar file using maven assembly plugin, cannot create session mill due missing mapping files. error: exception in thread "main" org.hibernate.mappingexception: resource: foo.hbm.xml not found i not using spring altough tried spring , have same problem srping's session mill cannot find mapping when running jar. implementation following. code: configuration hibernateconfig = new configuration(); hibernateconfig.configure("hibernate.cfg.xml"); hibernateconfig.addresource("foo.hbm.xml"); hibernateconfig.addresource("bar.hbm.xml"); hibernateconfig.setproperty("hibernate.connection.url", conf.dburl); hibernateconfig.setproperty("hibernate.connection.username", conf.dbuse...

visual c++ - How to check whole number in vc++? -

visual c++ - How to check whole number in vc++? - uint itemlength = strvalue.length(); bret = ( ( itemlength > maxlength ) || ( itemlength < minlength ) ) ? variant_false : variant_true; this code beingness used length validation. i want validate number: for ex: min value = 0, max value =10, original value = 5 in status want check whole number. for ex, want display following: input -> output 5 -> true 5.1 -> false want display. assuming f precision number seek this if (f % (int)f > 0) { console.writeline("is not whole number"); } else { console.writeline("is whole number"); } visual-c++

php - XmlWriter comlex usage with a XmlReader -

php - XmlWriter comlex usage with a XmlReader - i im going read file xmlreader , insert kid elements object xmlwriter , save output. how can parse info between 2 classes? know simplexml exists , makes easy. have huge amount of info , need create faster simplexml can. teory , havnt code yet, need reply these qwestions: creating 2 objects reader/writer , work faster similar via simplexml ? how possible utilize xmlreader object , parse info parts xmlwriter? xmlwriter not faster simplexml , takes less memory. when need handle big amounts of info (as do), should utilize xmlwriter larger info speed starts matter. of course, can have xmlreader , xmlwriter @ same time. , wrote: read xmlreader , write xmlwriter . edit: found nice statistics (and code sample) here. reading that, learned simplexml takes less memory xmlwriter, surprises me little...so initial statement seems 50% true. faster: yes, less memory: no. php xml simplexml xmlreader xmlwriter

jquery - 24 hour time format (so no AM to PM) for fullCalendar -

jquery - 24 hour time format (so no AM to PM) for fullCalendar - i'm trying display 24 hr time format in fullcalendar, i'm trying utilize these instructions: http://arshaw.com/fullcalendar/docs/text/timeformat/ so i've added timeformat: { agenda: 'h(:mm)' //h:mm{ - h:mm}' }, to json.php : $(document).ready(function() { $('#calendar').fullcalendar({ header: { left: 'prev,next today', center: 'title', right: 'month,agendaweek,agendaday' }, editable: true, alldaydefault: false, events: "core/displays/calendar/json-events.php", defaultview: 'agendaday', timeformat: { agenda: 'h(:mm)' //h:mm{ - h:mm}' }, eventdrop: function(event, delta) { alert(event.title + ' moved ' + delta + ' days\n' + '(should update database)')...

c# - Is there a way, at design time, to initialize an object with all properties in Visual Studio 2010? -

c# - Is there a way, at design time, to initialize an object with all properties in Visual Studio 2010? - background i writing code in vs 2010, .net 4, c#. also, in case matters, using latest version of resharper. question let's have model: public class someobject { public string red{ get; set; } public string green{ get; set; } public string blue{ get; set; } public string yellow{ get; set; } public string purple{ get; set; } public string orange{ get; set; } public string black{ get; set; } } elsewhere in code, need instantiate 1 of these objects, so: someobject myobject = new someobject{ reddish = "some value", bluish = "some other value", . . ., black="last value" ...

how to open another app in a tabhost / how to open a word doc within a tabhost of android? -

how to open another app in a tabhost / how to open a word doc within a tabhost of android? - i've been trying create app open multiple activities help of tabhost. 1 of back upwards open word document within app. i know how open 1 other app, hope open within app rather having need press button homecoming app. the code utilize open word doc : file file = new file (environment.getexternalstoragedirectory(),"/mlt/student.doc"); intent intent = new intent(); intent.setaction(android.content.intent.action_view); intent.setdataandtype(uri.fromfile(file), "application/msword"); startactivity(intent); i tried add together tab using file file = new file (environment.getexternalstoragedirectory(),"/mlt/student.doc"); intent = new intent(); intent.setaction(android.content.intent.action_view); intent.setdataandtype(uri.fromfile(file), "application/msword"); spec = tabhost.newtabspec("info")....

vbscript - Get list of links pinned to the taskbar -

vbscript - Get list of links pinned to the taskbar - is there anyway retrieve list or table or of of applications/links have pinned taskbar in vbscript? i have script unpins ones looking them in start menu i'm running on different brands of computers out of box (part of setup script) different brands of computers pin different applications taskbar default. i want list of whatever there , phone call unpin link this illustration of code utilize unpin item if objfso.fileexists(strcurrentuserstartfolderpath & "\programs\internet explorer.lnk") set objfolder = objshell.namespace(strcurrentuserstartfolderpath & "\programs") set objfolderitem = objfolder.parsename("internet explorer.lnk") set colverbs = objfolderitem.verbs each objverb in colverbs if replace(objverb.name, "&", "") = "unpin taskbar" objverb.doit next end if this print list of items pinned taskbar of ...

PHP Session Variables Not Saved in Centos Linux? -

PHP Session Variables Not Saved in Centos Linux? - i having php script fails save session variable when nail submit in php version 5.1.6 linux centos system. problem happens on time. temporary solve problem php rebooting machine. however, not solution. temporary solution. here php session info: directive local value master value session.auto_start off off session.bug_compat_42 off off session.bug_compat_warn on on session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.save_path /var/lib/php/session /var/lib/php/session session.serialize_handler php php session.use_cookies on on session.use_only_cookies off off session.use_trans_sid 0 0 under php core: directive local value master value open_basedir /var/www/domain.com/httpdocs/public_html/:/tmp/ no value i suggest why rebooting machine solves temporary php...

javascript - Extjs combo not working in IE7 -

javascript - Extjs combo not working in IE7 - ext js combo not working in ie7. need combo deed textbox virtual combo (like google search). working in ie9 , ff not in ie7 this code: searchincidentform=new ext.formpanel ({ border:false, renderto:'searchincidentdiv', id: 'searchincidentform', items : [{ xtype:'panel', id :'panelsearchincident', layout:'column', defaults:{ columnwidth:0.50, labelalign : 'top', layout:'form', border:false, bodystyle:'margin-top:5px; ' }, border:false, items : [{ defaults:{anchor:'100%'}, items:[{ id : "incidentid", fieldlabel : 'incident id', ...

objective c - JSON data issue iPhone -

objective c - JSON data issue iPhone - i getting info json web services [{"identity":"demo","assets":[{"identity":"34dl3611","systemid":"544507"},{"identity":"34gf0512","systemid":"5290211"},{"identity":"34hh1734","systemid":"111463609"},{"identity":"34hh1736","systemid":"111463622"},{"identity":"34ycj15","systemid":"294151155"}],"systemid":4921244}] i using method values of assets identity ("assets":[{"identity":"34dl3611","systemid":"544507"}): vehiclelist = [dict objectforkey: @"assets"]; self.listvehicles = [[nsmutablearray alloc] init]; (nsuinteger index = 0; index < [vehiclelist count]; index++) { itemdict = [vehiclelist objectatindex: index]; [self....

iphone - popViewControllerAnimated animation not working in iOS5 -

iphone - popViewControllerAnimated animation not working in iOS5 - trying previous viewcontroller, animation in ios5 not working. - (ibaction)backtopreviouscontroller { [self.navigationcontroller popviewcontrolleranimated:yes]; } can help me? from op, davey jones~ problem solved adding animation manually catransition *transition = [catransition animation]; transition.duration = 0.5; transition.timingfunction = [camediatimingfunction functionwithname:kcamediatimingfunctiondefault]; transition.type = kcatransitionpush; transition.subtype = kcatransitionfromleft; [self.navigationcontroller.view.layer addanimation:transition forkey:nil]; iphone sdk uinavigationcontroller ios5 poptoviewcontroller

Stopping Children from being stretched when parent Layout container is scaled through animation in Android -

Stopping Children from being stretched when parent Layout container is scaled through animation in Android - how stop children controls beingness stretched when parent layout container scaled through android's scaleanimation ?? following images explain want do. note: have tried setting children's width in pixels in vain layout before stretching or view big image here layout after stretching or view big image here your helpis appreciated. thanks yydl pointing android left panel library used such purpose. it provides built in trying myself. android

c# - 'System.OutOfMemoryException' was thrown when there is still plenty of memory free -

c# - 'System.OutOfMemoryException' was thrown when there is still plenty of memory free - this code: int size = 100000000; double sizeinmegabytes = (size * 8.0) / 1024.0 / 1024.0; //762 mb double[] randomnumbers = new double[size]; exception: exception of type 'system.outofmemoryexception' thrown. i have 4gb memory on machine 2.5gb free when start running, there plenty space on pc handle 762mb of 100000000 random numbers. need store many random numbers possible given available memory. when go production there 12gb on box , want create utilize of it. does clr constrain me default max memory start with? , how request more? update i thought breaking smaller chunks , incrementally adding memory requirements help if issue due memory fragmentation, doesn't i can't past total arraylist size of 256mb regardless of tweaking blocksize. private static irandomgenerator rnd = new mersennetwister(); private static idistribution dist = new discretenorm...

Does Foursquare have a maximum number or frequency of API requests? -

Does Foursquare have a maximum number or frequency of API requests? - i want build application utilize lot of data, trying "understand" in roads there traffic based on users' check-ins, of import me know how many info can request foursquare. reading foursquare api platform policy found that foursquare expressly reserves right limit number and/or frequency of api requests in sole discretion does know if there maximum number or frequency of api requests or limition exist malicious attacks? 500 requests per hr user related requests. 5000 request per hours userless requests. if need more, allow email them , apply it. can read in depth here. https://developer.foursquare.com/overview/ratelimits api foursquare

jQuery and PhoneGap - Include a HTML file clientside with HTML or JS? -

jQuery and PhoneGap - Include a HTML file clientside with HTML or JS? - i'm creating native android application using phonegap , jquery mobile. when create multipaged page, don't include same navigationbar time. tried include (s)html. doesn't work. i've tried far: <!--#include file="navigation.inc.html" --> <!--#include virtual="navigation.inc.html" --> <!--#include file="navigation.inc.shtml" --> <!--#include virtual="navigation.inc.shtml" --> this page not placed on (web)server. when navigation.inc.shtml not server, possible include file html or javascript? i'm running same issue. far can tell, android ignores server side includes. i've been getting close reply load based on answer i'm taking different approach: wherever need include external file: <div data-include="footer"></div> then, @ end of ( multipage ) index.html $('div[data...

Awk script in R -

Awk script in R - i need run awk script observe local maxima(peaks) in spectrum. spectrum in form of 2 columns in text file. this part of larger project identify whether these peaks represent compounds(metabolites really). i have searched on google , myriad other places cant find running awk scripts in r. edit: awk script using looks this- awk 'begin{dydx = 0;} { if(nr > 1) { dydx = ($2 - y0)/($1 - x0); } if(nr > 2 && lastly * dydx < 0) { printf( "%.4f %.4f\n", (x0 + $1)/2, log((dydx<0)?-dydx:dydx)); } ; last=dydx; x0=$1; y0=$2 }' /home/chaitanya/work/nmr_spectra/caffeine/pdata/1/spectrumtext.txt | awk '$2 > 17' you can see this question had asked yesterday. please note not same question. you should able do system('your awk command here') if have single quotes in awk command, either hong ooi suggests , set awk command in separate file , run system command or escape single qu...

iPhone in-app purchase for single and bundled items -

iPhone in-app purchase for single and bundled items - say illustration app music album can purchase single songs 0.99 each, or discount buying whole thing @ 1 time @ 7.99. in-app purchase, how handle scenario user buys 3 or 4 single songs 0.99 each, , 7.99 more expensive remaining songs combined? the way can think of create new store item every cost point. surface store item user corresponded number of tracks they'd bought. huge pain in ass, don't know of automated way handle it. in other words, let's album has 5 tracks. have is: $0.99 track1 $0.99 track2 $0.99 track3 $0.99 track4 $0.99 track5 $4.99 entirealbum what need is: $0.99 track1 $0.99 track2 $0.99 track3 $0.99 track4 $0.99 track5 $4.99 entirealbum $3.99 entirealbumalreadyown1 $2.99 entirealbumalreadyown2 $1.99 entirealbumalreadyown3 $0.99 entirealbumalreadyown4 you have determine item offer user, based on own records of they've purchased. iphone in-app-purchase

vb6 - Alternative method for "For Loop" -

vb6 - Alternative method for "For Loop" - i have 4 different values, want check 4 values 4 different combination code dim tot1, tot2, tot3, to4 variant dim item1, item2, item3, item4 variant each item1 in tot1 each item2 in tot2 each item3 in tot3 each item4 in tot4 if item1 = "all" , item2 <> "all" , item3 <> "all" , item4 <> "all" '1 ssql = "insert table1 select distinct emp_code employee company = '" & item1 & "' , partition <> '" & item2 & "' , section <> '" & item3 & "' , location <> '" & item4 & "'" elseif item1 <> "all" , item2 = "all" , item3 <> "all" , item4 <> "all" '2 ssql = "insert ...

javascript - Private-like properties in models or views of Backbone.js -

javascript - Private-like properties in models or views of Backbone.js - is possible have private properties in model? locally declared variables in (constructor) function, not attached this , declared locally , visible whatever defined in (constructor)function. illustration without bb view: function myview(amodel){ var $internalinput = $('<input>'); this.render: function($where){ $internalinput.val(amodel.get('someproperty')); $where.append($('<div class="inputwraper">').append($internalinput)); }; this.togglereadonly: function() { toggle $internalinputs readonly attribute } ... + code bind input.val amodel property(ies) , setup events ... } note internalinput not accessible outside world , amodel not accessible (through myview @ least). if want utilize backbone.view implement above myview, how , maintain $internalinput 'private'? you should able accomplish private info p...

hibernate - @GeneratedValue(strategy="IDENTITY") vs. @GeneratedValue(strategy="SEQUENCE") -

hibernate - @GeneratedValue(strategy="IDENTITY") vs. @GeneratedValue(strategy="SEQUENCE") - i'm new hibernate. not understand the next 2 primary key generation strategies: identity sequence can please explain how these 2 work , difference between these two? quoting java persistence/identity , sequencing: identity sequencing uses special identity columns in database allow database automatically assign id object when row inserted. identity columns supported in many databases, such mysql, db2, sql server, sybase , postgres. oracle not back upwards identity columns can simulated through using sequence objects , triggers. in plain english: mark @ 1 id column in table identity. database engine set next available value automatically. and: sequence objects utilize special database objects generate ids. sequence objects supported in databases, such oracle, db2, , postgres. usually, sequence object has name, increment, , other databas...

ruby on rails - how to add dependencies to the paperclip gem file -

ruby on rails - how to add dependencies to the paperclip gem file - the error occured while trying 'rails g paperclip photo data' is: create sure dependencies added gemfile. (gem::loaderror) using rails 3.0.3 my gem file: source 'https://rubygems.org' gem 'rails', '3.2.0.rc2' # bundle border rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'sqlite3' # gems used assets , not required # in production environments default. grouping :assets gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.0' gem 'uglifier', '>= 1.0.3' end gem 'jquery-rails' gem 'paperclip', '2.3.3' # utilize activemodel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' # utilize jbuilder templates json # gem 'jbuilder' # utilize unicorn web server # gem 'unicorn' # deploy capistrano # g...

c# - WCF net.tcp not supported. (socketexception) -

c# - WCF net.tcp not supported. (socketexception) - i have learning application implements of import endpoints in sole service. implementing net.tcp + wshttp + basichttp , webhttp, work great except net.tcp. when access through browser tells me following: the protocol 'net.tcp' not supported. description: unhandled exception occurred during execution of current web request. please review stack trace more info error , originated in code. exception details: system.invalidoperationexception: protocol 'net.tcp' not supported. seems mutual problem researched through net , concluded because on xp using locally can't. , when request socketexception connection refused code. but 1 time again made project net.tcp , endpoints , bindings , works! means not using iis. i'm still beginner in wcf, tells me hosted wcf service host. can explain me can create work on windows xp? thanks yes, right - net.tcp not available on iis 5.1 (windows xp)...

internet explorer - CSS 3 Media Queries support for IE -

internet explorer - CSS 3 Media Queries support for IE - i having troubles finding process go registering css3 media queries in website i'm creating. i've tried css3-mediaqueries.js did nil , have heard respons.js way go, place in after css stylesheet(s) , check out in ie 8 , crashes site every single time! the site have linked have kept <script src="js/libs/respond.src.js"></script> where have placed yet have deleted .js file server or it'll maintain crashing. has had experience respond.js , experience registering css3 media queries own site? i've been trying figure out quite while , it's quite frustrating. i appreciate advice! my ie crashes when utilize combination in style.css: @media screen , (max-width: 320px) { #element {} @media screen , (orientation:landscape) { .element {} } } after @media screen , (max-width: 320px) { #element {} } @media screen , (orientation:landscape) , (max-width: 320px) { ....

Multi level inheritance in vb.net -

Multi level inheritance in vb.net - i want implement multi level inheritance in vb.net application. have base of operations form named base_level0 contains methods, properties etc. 1 more form named base_level1 inherits base_level0. these 2 forms base of operations forms. now actual form named form1 inherits base_level1. form1 contains form load event not fired. but if form1 inherits base_level0 straight load event fired. why load event dose not fire multi level inheritance. these 3 lists usercontrols. ***base list level0 public class frmnewbaselist_level0 ' ' private sub frmnewbaselist_level0_load(sender object, e system.eventargs) handles me.load end sub ' ' end class ***base list level1 public class frmnewbaselist_level1 inherits frmnewbaselist_level0 ' ' private sub frmnewbaselist_level1_load(sender object, e system.eventargs) handles me.load end sub ' ' end class ***actual list public class frmcustomerslist ...

ASP.NET MVC: How do I output the Controller and View that is currently being rendered? -

ASP.NET MVC: How do I output the Controller and View that is currently being rendered? - i have complicated set of routes , need edit specific web page. given url, how determine controller , view created page? i'm open using asp.net mvc write info straight page textcolor== background color, or else may recommend. i'd solution can utilize in production (where mvc route debugger disabled) you can access controller , action straight through viewcontext . // asp.net mvc 3 viewcontext.controller.valueprovider.getvalue("controller").rawvalue viewcontext.controller.valueprovider.getvalue("action").rawvalue // asp.net mvc 2 , below: viewcontext.controller.valueprovider["controller"].rawvalue viewcontext.controller.valueprovider["action"].rawvalue to view, have @ answer similar question phil haack. asp.net-mvc asp.net-mvc-3 routes

php - Concatenation in constant-definition -

php - Concatenation in constant-definition - i'm trying create little enum , i'm stuck: why doesn't work? class.layoutparts.php: <?php class layoutparts { const main = 1; const footer = 2; } ?> class.supportedlayouts.php: <?php class supportedlayouts { const main = layoutparts::main; const main_footer = layoutparts::main.layoutparts::footer; } ?> it results next message: parse error: syntax error, unexpected '.', expecting ',' or ';' in /*****/class.supportedlayouts.php on line 4 thanks help! regards, flo . operator, making layoutparts::main.layoutparts::footer; statement, isn't allowed in const or property declaration. see here the value must constant expression, not (for example) variable, property, result of mathematical operation, or function call. php const concatenation

java - how to set an image for jtable fixed column, when i am running, it's getting an image path only -

java - how to set an image for jtable fixed column, when i am running, it's getting an image path only - i created programme set imageicon in jtable fixed column, created jtable , getting database records, set first column fixed column. set image icon in fixed column. when compiling program, getting path of imageicon not getting image. fixed imageicon in project bundle folder. code used public void frm_flxd_database() { try{ tmprow=0; tmpmainprj.prj_db_connection_assgn(); tmpflxmdl =(defaulttablemodel)flxd.getmodel(); tmpflxdrow = 0; tmpflxst=tmpgprjvardec.gcontn.createstatement(); tmpflxdrs=tmpflxst.executequery("select * activitymaster"); prj_flx_deftl_assgn(flxd, "begin"); tmpflxdrs.first(); { flxd.setvalueat(tmpflxdrs.getstring("actvtydesc"), tmprow,1); ...

objective c - iOS Push Notifications to specific user in the same deviceToken -

objective c - iOS Push Notifications to specific user in the same deviceToken - i using urban airship test force notification , went well. my problem how specify user notification not device token. i mean in situations 1 device has multiple users, many users registered same device token server. or have filter on device (client side) itself? there's no real way want unfortunately. in apns there's such thing device. force device , shows message / badge / sound on device. if app can have multiple users associated you'd need work out force user relates , handle accordingly. how depend on app add together in custom key force indicated user it's for. if app ever has 1 user logged in @ 1 time suggest when hand force token server, server first turns off force user token registered , subsequently turns force on new user. objective-c ios push-notification apple-push-notifications

Can you append data to an existing Avro data file? -

Can you append data to an existing Avro data file? - it seems there isn't way append info existing avro serialized file. i'd have multiple processes writing single avro file, looks each time open it, start on scratch. don't want read in info , write out again. using ruby illustration code have tried "ab" , "ab+" various settings, no joy. file = file.open('data.avr', 'wb') schema = avro::schema.parse(schema) author = avro::io::datumwriter.new(schema) dw = avro::datafile::writer.new(file, writer, schema) dw << {"username" => "john", "age" => 25, "verified" => true} dw << {"username" => "ryan", "age" => 23, "verified" => false} dw.close don't pass schema append file avro

How to find whether the particular array variable is empty or not in JavaScript? -

How to find whether the particular array variable is empty or not in JavaScript? - i have array variable array[0] , , need check whether array[0] contains value or not within of it. should do? if have array , phone call eg. list , can check if has elements in next manner: if (list.length){ // has elements (exactly list.length elements) } else { // not have elements } see next details: documentation on length property of array objects in javascript javascript

c++ - Passing std::forward_as_tuple() result to multiple functions that may move from that object's rvalue-reference members? -

c++ - Passing std::forward_as_tuple() result to multiple functions that may move from that object's rvalue-reference members? - edit: think utilize case i'm asking about, when creating function receives tuple of rvalue-references std::forward_as_tuple() . the reason question came mind because checking members of objects passed constructor initializers see if rvalue-references (i'm open advice telling me wrong wrong wrong... followed rule of thumb avoid in future, that's prompted question). occurred me that, in different context, might end handing object has rvalue-reference members multiple functions (or function objects), may or may not control, may moves members. template<typename... args> void my_func(std::tuple<args...>&& tup) { //if tup's members rvalue references, //and function moves guts tup members, then... func_i_dont_control(tup); //what happens here if moves done on same members? another_func_i_dont_...

windows phone 7 - Async cancellabel task -

windows phone 7 - Async cancellabel task - i want implement behaviour application @ start checks webservivce if news available. if there news available, pop open screen show user. if there no news available, or user quits application (or starts game) dont want bother user instead cancel task retrieve news item i thought breeze doing task library unfortunatly not available in default loadout on windows phone (or it?). i think key here cancelable part. know how start async op, best practice hte cancelable part? the task parallel library available windows phone, in nuget package: system.threading.tasks. but don't why care cancel task. if user quits application, task end, , if action, nil happens. windows-phone-7

My java class implementation of XOR encryption has gone wrong -

My java class implementation of XOR encryption has gone wrong - i new java fluent in c++ , c# c#. know how xor encryption in both c# , c++. problem algorithm wrote in java implement xor encryption seems producing wrong results. results bunch of spaces , sure wrong. here class below: public final class encrypter { public static string encryptstring(string input, string key) { int length; int index = 0, index2 = 0; byte[] ibytes = input.getbytes(); byte[] kbytes = key.getbytes(); length = kbytes.length; char[] output = new char[ibytes.length]; for(byte b : ibytes) { if (index == length) { index = 0; } int val = (b ^ kbytes[index]); output[index2] = (char)val; index++; index2++; } homecoming new string(output); } public static string decryptstring(string input, string key) { ...