Posts

Showing posts from August, 2010

How to print out line in Javascript -

i want test return value of function getfileextension(input.files[0].name) (i have comment there point @ line) question how print out value in javascript? thanks! <script> function getfileextension(filename) { var ext=filename.split('.').pop(); return ext } </script> <input type='file' onchange="readurl(this);"> <script> function readurl(input) { if (input.files && input.files[0]) { if (getfileextension(input.files[0].name)=="png") { // line our problem var reader = new filereader(); reader.onload = function (e) { document.getelementbyid("pdf").innerhtml="<img id='blah' src=" + e.target.result + " alt='your image' width='450'>" } reader.readasdataurl(input.files[0]); } } } </script> you

Wordpress theme with front page and index at the same time? -

when using wordpress' front-page.php file on theme, supposing site hosted @ http://example.com/ , initial page ( get / ) retrieve contents. doing that, link index.php lists latest posts categories? i expected get /posts or take me index.php , doesn't :( can me? in wp admin panel, under settings -> read, can specify "home page" , "posts page" (by picking them dropdown of pages on site). whatever specify "home page" take front-page.php template (if exists, otherwise revert default page.php template), , whatever specify 'posts' page considered 'posts feed' expect on homepage , use index.php template if no home.php template exists. the template hierarchy flexible enough can manage stuff in whatever way want - see codex details http://codex.wordpress.org/template_hierarchy

javascript - Why would a change to a label or icon on a dojo IconMenuItem while the page is running not change the page? -

when have html set , run js code through web browser iconmenuitem never visually changes icon or label. after js runs , call function on iconmenuitem, direct iconmenuitem.label not empty , iconmenuitem.icon "images/icon.png". how element's values changed visually in browser, iconmenuitem not change? html: <script type="text/javascript" data-dojo-config="isdebug: false, async: true, parseonload: true, mblhideaddressbar: false" src="dojo/dojo.js"></script> <div data-dojo-type="dojox.mobile.swapview" id="mainpageview" data-dojo-props="selected:true"> <ul data-dojo-type="dojox.mobile.iconmenu" id="menu" style="width: 320px; height: 400px;" data-dojo-props="cols: 3"> <li data-dojo-type="dojox.mobile.iconmenuitem" label="empty" onclick=handlebutton(this) id="btn1"><

audio - Detecting sound from microphone using Java. Issue with Java Versions -

i'm running simple code listens microphone , prints out bytes. problem: listens microphone changes correctly on java version "1.6.0_43" but doesn't listen microphone changes correctly on java version "1.7.0_25" code compiles , runs fine on both versions. example output using java 1.6 5172 1 5196 2 5103 3 2859 4 2549 5 2742 6 3112 7 5028 8 4515 9 3856 10 5189 11 5080 12 5165 13 4925 14 when drops down around 2500 that's when there sound going microphone. example output using java 1.7 5652 1 5655 2 5699 3 6081 4 6213 5 5972 6 5907 7 5828 8 5931 9 6187 10 6015 11 5949 12 6196 13 it no longer detects noise microphone. import java.io.*; import javax.sound.sampled.*; public class speechdetectiontest { public static void main(string[] args) { bytearrayoutputstream bytearrayoutputstream; targetdataline targetdataline; int cnt; boolean stopcapture = false; byte tem

xaml - Using the selected tab in a TabControl to clear a variable - WPF -

i have window contains a tabcontrol 2 tabitems inside it. inside second tab, there textbox binding string property inside view model. want able clear property (or textbox since bound will association, clear property) whenever user clicks on different tab (and if user closes window). i'm hoping can achieve xaml since trying follow mvvm pattern (so no code behind , view model shouldn't know of tabcontrol or textbox in view). i have tried few different things , can't quite working , while i'm getting better @ wpf, i'm still new it. inside tabs have listviews , comboboxes, understanding bubble selectionchanged event (same when tab selection changed) should stay away that. appreciated. here 1 of attempts (snippet showing gist): <tabcontrol> <tabitem> ...stuff in first tab goes here </tabitem> <tabitem header="rules"> <tabitem.style> <style> <style.triggers> <data

opentok - Setting width/height for subscriber div elements via properties -

one can set width/height publisher div element via properties: http://www.tokbox.com/opentok/docs/js/reference/tb.html however, it's not possible same other streams. properties don't have width/height: http://tokbox.com/opentok/webrtc/docs/js/reference/session.html#subscribe even if set via css, they'll overwritten. for example, how can 1 make app facetime subscribed video stream larger publisher stream? you can set subscriber div's height , width passing object width , height attribute session.subscribe function: session.subscribe(stream, divid, {width: 320, height: 240}); you style css using parent container , setting subscriber's width/height 100%: session.subscribe(stream, divid, {width: "100%", height: "100%"}); here's example of making large subscriber might you.

python - customize BeautifulSoup's prettify by tag -

i wondering if possible make prettify did not create new lines on specific tags. i make span , a tags not split up, example: doc="""<div><div><span>a</span><span>b</span> <a>link</a></div><a>link1</a><a>link2</a></div>""" bs4 import beautifulsoup bs soup = bs(doc) print soup.prettify() below want print: <div> <div> <span>a</span><span>b</span> <a>link</a> </div> <a>link1</a><a>link2</a> </div> but print: <div> <div> <span> </span> <span> b </span> <a> link </a> </div> <a> link1 </a> <a> link2 </a> </div> placing inline styled tags on ne

Creating an OSX application without Xcode -

i'm new os x, , i'm trying create simple application without xcode. did found other sites doing that, cannot attach event handlers button. below code (crafted other sites). creates window , button, don't know how attach event button: #import <cocoa/cocoa.h> @interface myclass -(void)buttonpressed; @end @implementation myclass -(void)buttonpressed { nslog(@"button pressed!"); //do want here... nsalert *alert = [[[nsalert alloc] init] autorelease]; [alert setmessagetext:@"hi there."]; [alert runmodal]; } @end int main () { [nsautoreleasepool new]; [nsapplication sharedapplication]; [nsapp setactivationpolicy:nsapplicationactivationpolicyregular]; id menubar = [[nsmenu new] autorelease]; id appmenuitem = [[nsmenuitem new] autorelease]; [menubar additem:appmenuitem]; [nsapp setmainmenu:menubar]; id appmenu = [[nsmenu new] autorelease]; id appname = [[nsprocessinfo processinfo] p

SQLite CreateTable<> Database that already exists is replaced -

database exists replaced calling method createtable <> in sqlite windows 8, erasing lines , creating new table. how can solve? following code analyze: using(var db = new sqlite.sqliteconnection(app.dbpath)) { db.createtable<listasentid>(); if (db.executescalar<int>("select count(1) listasentid")==0) { db.runintransaction(() => { db.insert(new listasentid() { nome = "lista", eletros = "teste" }); }); } } not sure language using, if can execute raw sql can use following syntax: create table if not exists listasentid (nome text, eletros text); this ensures table listasentid exists without nuking of previous data.

c# - Tiling tile buffer in an Image buffer Index calculation issue -

i have problem in tiling image buffer tile buffer of square size. kindly point, doing wrong. the idea image buffer filled predefined square tile buffer condition. output image buffer tilled tile, keeping in mind, image can rectangular (not square) thank you. i have tried this. static int imgwidth = 150; static int imgheight=100; static int gl_fxf = 4;//4*n byte[] img_byte8rgbbuff = new byte[imgwidth*imgheight*3];// variable size byte[] tile_byte8rgbbuff = new byte[gl_fxf * gl_fxf * 3];// can of size 4nx4n public byte[] fillwithtile(byte[] in_image, byte[] tile) { byte[] img_byte8rgbbuff_out = new byte[in_image.length]; int somemainindex; action<int, int, int> tffxmethod = (int a_h, int b_w, int in_indx) => { int t_indx; //int t_indx2; int counter = 0; (int j = a_h; j < a_h + gl_fxf; j++) (int = b_w; < b_w + gl_fxf; i++)

delphi - Draw/overlay a rectangle box on top of application and capture mouse XY -

i have cad application trying build plugin , need able select lines , arcs. cannot directly application. in code want start drawing windowing rectangle free hand mouse. through api can determine lines/arcs enclosed in rectangle drawn. the question is, how can draw rectangle mouse on top of application? left click start upper left corner, drag resize, , releasing left click end rectangle? there's not forms involved either, don't know if can use picturebox/tcanvas or what. me, windowing screen capture draw rectangle on part of screen want save. i used xor draw rectangle proposed fduenas , works quite well, not work smoothly on windows vista , 7. rectangle may partially erased if draw on changing areas (and pieces of rectangle remain if erase afterwards). instead use rectangular window rectangular hole in it. have reposition window. can create , show in mousedown , reposition in mousemove , destroy in mouseup . set borderstyle of tdragrectangleform bsnone. un

Is it feasible to bundle dynamic libraries with dependencies in a Tcl Starkit/Starpack? -

i've written tcl script uses tclmagick extension graphicsmagick. for graphicsmagick, i've both windows dlls , linux files. want able make 2 starkit/starpack applications bundled libraries: 1 windows (with dlls) , 1 linux (with files). is reasonable? can done? edit i cannot seem use dlls dependencies under windows. in case, want use tclmagick extension, needs graphicsmagick's dlls , starkit cannot find those. should in situation? you can it, might need windows trickery things work properly. windows has quite few options load dependent libraries, page explains basics: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682586%28v=vs.85%29.aspx there 1 part can you: if dll same module name loaded in memory, system checks redirection , manifest before resolving loaded dll, no matter directory in. system not search dll. so, dependencies right, dependent libraries loaded memory first (sadly cannot use load this, use twapi, e.g. twapi::load_

java - Setting a parameter for returned string values -

i trying create game user enters phrase, phrase can in lower case letters (if catch drift). program prompt user do-while loop. if user enters (1234567890, or !@#$%^&* or asdfgh, loop should re-prompt user enter lower case letters. extremely new java, code going shitty. here is: import java.util.scanner; public class program05 { public static void main(string[] args) { scanner scanner01 = new scanner(system.in); string inputphrase; char inputchar; { system.out.print("enter common phrase begin!: "); inputphrase = scanner01.nextline(); } while (!inputphrase.equals(character.digit(0,9))); } } use string.matches() appropriate regex test if it's lowercase letters: inputphrase.matches("[a-z ]+") // consists of characters a-z , spaces so loop like: do { system.out.print("enter common phrase begin!: "); inputphrase = scanner01.nextline(); } while (!inputphras

java - Exporting Android application with ProGuard gives ParseException error -

i getting following error when exporting android application proguard (via adt eclipse). "proguard.parseexception: expecting opening '(' or separator ';' before 'name'" i see other proguard parse error problems solved upgrading proguard , sdk; however, no luck here after upgrades. 1 seen / solved before? thank in advance help! environment adt 22.0.1 eclipse sdk 4.2.2 android sdk 4.2, sdk tools rev 22 proguard v4.9 console log proguard returned error code 1. see console proguard.parseexception: expecting opening '(' or separator ';' before 'name' in line 155 of file '~/project/bin/proguard.txt', included argument number 4 @ proguard.configurationparser.parsememberspecificationarguments(configurationparser.java:966) @ proguard.configurationparser.parseclassspecificationarguments(configurationparser.java:729) @ proguard.configurationparser.parsekeepclassspecificatio

c# - How to hide a window from the taskbar when started using System.Diagnostics.Process -

this question has answer here: hide app's taskbar button 2 answers i writing code open program : system.diagnostics.process aprocess = new system.diagnostics.process(); aprocess.startinfo = new system.diagnostics.processstartinfo( system.io.path.combine(environment.getfolderpath( environment.specialfolder.applicationdata), @"myapp.exe")); aprocess.start(); myapp.exe not dot net program. want hide icon of program taskbar. try aprocess.startinfo.windowstyle = system.diagnostics.processwindowstyle.hidden;

ruby on rails - Specify gems specific for Heroku -

is there way specify gems installed when deploying heroku? want able have 2 production environments, 1 on heroku , on not. you can set :heroku environment (or other string) separate :production heroku application. the documentation : heroku config:set rack_env=heroku rails_env=heroku create config/environments/heroku.rb environment, other. can specify :heroku group in gemfile too.

maven - groovy-eclipse-compiler Excludes and Includes not working -

i using groovy-eclipse-compiler , trying include , exclude directories under src/main/groovy directory; default (without filters) compiler includes everything, filter works when exclude groovy files in source path. exclude filter works: works build output directory <plugin> <groupid>org.apache.maven.plugins</groupid> <artifactid>maven-compiler-plugin</artifactid> <version>3.1</version> <configuration> <source>1.7</source> <target>1.7</target> <!-- <compilerargument>${compilerargs}</compilerargument> <executable>${java_home}/bin/javac</executable> --> <showdeprecation>true</showdeprecation> <encoding>utf8</encoding> <compilerid>groovy-eclipse-compiler</compilerid> <excl

android - Permission in calling service from another app -

possible duplicates: permission services , permission issue while starting service android , exported service not require permission: mean? , not allowed start service intent without permission etc i have 2 applications app "a" , app "b". app has 1 service custom permission , app b wants call service. following code snippet app a: : manifest file <service android:name="sendservice" android:permission="android.permission.myservice"> <intent-filter> <action android:name="com.example.calledactivity.myservicecaller" /> <category android:name="android.intent.category.default" /> <data android:scheme="sms" /> <data android:scheme="smsto" /> </intent-filter> </service> here have secured service using permission android.permis

symfony - Doctrine OneToMany relationship error -

i trying set manytoone/onetomany relationships on objects in database using doctrine (2.2.3+) via symfony2 (2.3.0) , getting strange error. here relevant parts of objects (many attributes 1 product): /** * product * * @orm\table(name="product") * @orm\entity */ class product { /** * @var integer * * @orm\column(name="id", type="integer") * @orm\id * @orm\generatedvalue(strategy="auto") */ protected $id; ... /** * * @onetomany(targetentity="productattributes", mappedby="product") */ protected $product_attributes; public function __construct() { $this->product_attributes = new \doctrine\common\collections\arraycollection(); } } /** * productattributes * * @orm\table(name="product_attributes") * @orm\entity */ class productattributes { /** * @var integer * * @orm\column(name="pa_id", type

java - How can you change the name of a colum in a GWT DataGrid? -

i have gwt datagrid static columns. while know can remove columns , add them different names, possible change column's name directly? update: i don't understand what's going on. per thomas boyer's answer below, see in docs .getheader() inherited abstractcelltable public method, compiler says no such method exists datagrid. grid created: datagrid mygrid = new datagrid<mytype>(integer.max_value, gwt.<datagridresources2> create(datagridresources2.class)); and fails compile: header<myheaderclass> header = mygrid.getheader(0); compiler says no such method exists type datagrid. you can use getheader method of datagrid obtain column header, , getcell().setvalue

c# - Producing a list of distinct points but running OutOfMemory -

i'm trying improve performance of method have reprojects points 1 coordinate system another. list<point> reproject(list<point> points, string sourceprojection, string destinationprojection) to coordinate transformation pass points 3rd party library (fme.) i'm trying achieve take input list of points, select out distinct points list, pass transformation engine, reconstruct original list , return client. my basic plan use dictionary<point, int> distinct points , assign index them, reconstruct original list index. here's rough code wrote test out behaviour: var distinctpoints = new dictionary<point, int>(); var distinctpointsmapping = new dictionary<int, int>(); var pointnumber = 0; var distinctpointnumber = 0; foreach (var point in points) { if (distinctpoints.containskey(point)) { distinctpointsmapping.add(pointnumber, distinctpoints[point]); } else { distinctpoints.add(point, distinctpointnumber)

Garbage collection of class instance variables in ruby -

if use method like def self.get_service_client return @service_client if !@service_client.nil? @service_client = #initialize logic end now @service_client instance variable of class. how long in memory? can bank on not re-initialized long class in memory (i.e static variable)? classes instances in ruby, too, when define class usual way, gets assigned constant, , constant referenced other constants, preventing collection. so, class in memory indefinitely. since class remain in memory, class instance variable too, class (which object instance) retains reference instance variables. as aside, idiomatic way is: def self.get_service_client @service_client ||= initialize_service_client end

Overlapping selectors in css -

in html page, have div id footer. inside of couple of other divs, , last 1 of them has p-tag inside. how apply css style p? #footer div p { background-color: #000; } #footer div { float: left; width: 23%; border-left: solid 1px; margin: 0; padding-left: 5px; } the first 1 not seem overwrite second, works fine. give me hint find information order of css selectors? your css fine. suggest checking structure of html. css provided html should below: <div id="footer"> <div></div> <div> <p>my paragraph</p> </div> </div> i have tested , appears kosher. see fiddle .

javascript - negative boundingClientRect value for text inside cufon and cufontext tags.. How to get positive boundingClientRect of That text? -

my code goes below... <cufon class="cufon cufon-canvas" alt="john " style="width: 59px; height: 24px;"> <canvas width="76" height="25" style="width: 76px; height: 25px; top: 0px; left: -1px;"></canvas> <cufontext> <cufon class="cufon cufon-canvas" alt="john " style="width: 5px; height: 1px;"> <canvas width="6" height="2" style="width: 6px; height: 2px; top: 0px; left: 0px;"> </canvas> <cufontext>john </cufontext> </cufon> </cufontext> i need correct boundingclientrect object.. i trying below code giving negative value rect.left , rect.right.. if(documentnode.createrange){ var range = documentnode.createrange(); range.selectnodecontents(textnode); if (range.getboundingclientrect) { var rect = range.getboundingclientrect(); if (rect)

syntax - Meaning of ${} in javascript -

i need work on javascript lately. unfortunately, newbie. have come across following code , don't understand meaning of ${count == 0}. function body_onload() { if(${count == 0}) { document.getelementbyid("dispaly").style.display="none"; } scanimagereportfrom.shopcodes.focus(); } thank you. finally found this can solve question. it's not you. :-) that's not valid javascript (the { triggers syntax error). it perhaps token pre-processor replaces before javascript passed javascript engine.

android - GCM Cloud Connection Server - how to start using it? -

i want use gcm cloud connection server. far have read gcm cloud connection server , i'm confused. @ top of page there link form. my question is: do need fill , wait response form google saying enabled gcm ccs project, or can start coding without filling form? if answer need fill form, there restrictions can use it? because did fill sample data (confirmed id of project google console) , got no answer. you can start coding whenever wish, until google whitelist api project id (the 1 should specify in sign-up form), new features (ccs , user notifications) won't work you.

c# - How to calculate the digit products of the consecutive numbers efficiently? -

i'm trying calculate product of digits of each number of sequence of numbers, example: 21, 22, 23 ... 98, 99 .. would be: 2, 4, 6 ... 72, 81 .. to reduce complexity, consider [ consecutive numbers ] in limited length of digits, such 001 999 or 0001 9999 . however, when sequence large, example, 1000000000 , repeatedly extract digits , multiply every number inefficient. the basic idea skip consecutive zeros encounter during calculation, like: using system.collections.generic; using system.linq; using system; // note digit product not given iteration // need provide delegate calculation public static partial class numericextensions { public static void numberiteration( int value, action<int, int[]> delg, int radix=10) { var digits=digititerator(value, radix).toarray(); var last=digits.length-1; var emptyarray=new int[] { }; var pow=(func<int, int, int>)((x, y) => (int)math.pow(x, 1+y));

ios - Best way to pass variable to a Class/Instance? -

i have instance returns distance earth sun depending on day of year. calculates today's date internally self-contained. want change pass day of year integer. best way , have options? -(double) calculatedistrancefromsun { // calculate day of year nscalendar *gregorian = [[nscalendar alloc] initwithcalendaridentifier:nsgregoriancalendar]; nsuinteger dayofyear = [gregorian ordinalityofunit:nsdaycalendarunit inunit:nsyearcalendarunit fordate:[nsdate date]]; setdayofyear = dayofyear; // source: curious.astro.cornell.edu/question.php?number=582 double rad2deg = pi/180; double theta = (dayofyear/(daysinyear/360)*rad2deg); double cc = cos(theta); setdistancefromsun = semimajoraxis*(1-pow(eccentricy,2))/(1+eccentricy*cc); return setdistancefromsun; } -(double) calculatedistrancefromsunwithdate:(nsdate *)date { // calculate day of year nsuinteger dayofyear = [gregorian ordinalityofunit:nsdaycalendaruni

PHP Regex Help preg_match -

http://regexr.com?35hk2 the above site shows correct regex when php doesn't show names such 'jj5x5's white top hat' here php : <?php function newecho($value){ echo $value . "<br>"; }; function curlauto($url){ $channel = curl_init(); curl_setopt($channel, curlopt_url, $url); curl_setopt($channel, curlopt_returntransfer, 1); return curl_exec($channel); }; function automatchall($string,$pattern){ $found = array(); $match = preg_match_all($pattern,$string,$found); return $found; }; function replacematch($string,$pattern,$subject){ return str_replace($pattern,$subject,$string); }; $count = 0; $output = curlauto("www.roblox.com/catalog/json?subcategory=2&sorttype=0&sortaggregation=3&sortcurrency=0&legendexpanded=true&category=2&pagenumber=1"); $assetid = automatchall($output,'/"assetid"

scala - Liftweb form processing -

how test see option in focus during form submittal? <select name="temp" id="keys"> <option selected="selected" value="isbn">isbn</option> <option value="title">title</option> <option value="author">author</option> <option value="publisher">publisher</option> <option value="date">date</option> </select> from snippet i've tried s.param("temp")... a common way use shtml.select() this way can have options taken scala code, in typesafe manner , prone typos. as far understand, s.param("temp") should work also, if din't mess <form> .

Check if service is running on Android? -

l want check if service running l wrote code public class startserviceorno { public static void startserviceifitsnotruning(class<?> class1, context context) { activitymanager manager = (activitymanager) context.getsystemservice(context.activity_service); (runningserviceinfo service : manager.getrunningservices(integer.max_value)) { if (class1.getname().equals(service.service.getclassname())) { lg.d("servisstart service start" + class1.getname()); return; } } lg.d("servisstart sservice new servis " + class1.getname()); context.startservice(new intent(context, class1)); } and use startserviceorno.startserviceifitsnotruning(offlinechopsmonitor.class,this) if l check service 1 class work, if l check same service different class, check don't work 1.) in activity class: private boolean ismyservicerunning(class<?> serviceclass) { activitymanager manager = (activitymanager

javascript - Need a specific regular expression -

i create following regex: * [ * , * ] * where * can text of size have tried following: /[*.,.*]/ but not (if matters need javascript) examples correct text: test[1,2] test[3,test2] can help? try this: [^\[]*\[[^\]]*\] ^----^ [ ^^ - [ ^----^ - ] ^^ - ] optionally can wrap whole regex in ^ , $ match whole string only. example: > /^[^\[]*\[[^\]]*\]$/.test("test[1,2]") true > /^[^\[]*\[[^\]]*\]$/.test("test[1,test2]") true > /^[^\[]*\[[^\]]*\]$/.test("test_wrong") false > /^[^\[]*\[[^\]]*\]$/.test("test[wrong") false

Phonegap app in jquery mobile not supported for some devices in google play -

my phonegap android app built in jquery mobile not support devices in google play. there way change supported , unsupported phones in google play or in phonegap using config.xml? i know native app there way android manifest file me working jquery mobile , taking build in phonegap config file manage these types of settings. reading question more closely, want control xml file. config.xml not place since far understand feature of phonegap/cordova , unlikely have power specify outside of it. there android manifest xml file however, seems strictly limited specifying features, not models, see: http://developer.android.com/google/play/filters.html google's inclusion , exclusion of devices controlled filters have set there: screen resolution, android versions , more. for other options may know about: there page in developer console in google play excluding phones. go apk sub page of app, , click on "manage excluded devices". in list item left, choose "

html - how to give different names to different checkboxes when checkboxes are created from while loop -

i creating checkboxes @ runtime, in while loop according amount of data coming database. want know should write in attribute name give different name each checkbox. value, if want pass value of rs.getstring(1) using jsp. here piece of code. <%while(rs.next()) { %><tr><td align="center"><input type="checkbox" name="" value=""> <% for(int i=1;i<=5;i++) { %> <td align="center"> <%=rs.getstring(i)%> </td> <%}%> </tr> <%}%>

c# - What should I identify with the id argument in TraceSource.TraceEvent method? -

i use tracesource class logging in .net projects. however point has never been clear me is, intent of id parameter in traceevent method. currently, set 0. but expected or typical useful usage of it? i can think of few possibilities: it id occurrence of event (i.e. same line of code produces different id on each execution); it id method call (i.e. can infer line of code id); it id family of similar events (e.g. error messages database absent share same id); it id set of events related logical operation, in combination traceeventtype.(start|stop|suspend|resume|transfer) enumeration values; i've asked myself same question , didn't found clarify in microsoft documentation. i've manage find article written microsoft mvp, richard grimes: "the id parameter whatever choose be, there no compulsion particular id associated particular format message." uses 0, id argument, in examples. in msdn articles, i've seen used random, not providin

jquery - From Codiqa to the Android App Store -

i have account codiqa, , i've created mobile reference app. provides utility export .zip package compiled phonegap adobe. when import it, works fine drag/drop app via usb cable. sell on app store, have generate license key. no problem if compiled via eclipse, since didn't, think there no way generate key it.it seems codiqa doesn't provide support , have rest of process set up. sorry hear you're having trouble, i'm intern @ drifty, company makes codiqa. when select export in codiqa, receive source code bundle eclipse (if you're using android, or xcode ios). can load source package eclipse using project import , signing , generate apk way other phonegap or android project. you said didn't compile using eclipse, using ant or phonegap build similar building eclipse. hope helps! :)

change in dropdown list value not picked up in jquery validation -

i'm trying build validation web app , having small issue. have asp dropdown list , textbox , want make textbox mandatory if selects 'other' dropdown list. validation works when select other if decide select option , click save button, still asks me enter value in text box though selected value of dropdown not other. here jquery function: $(function() { $("#btnmainsave").click(function() { val = $('#ddlrefto').val(); alert(val); $("#form1").validate({ rules: { txbreftoother: val == "other" ? "required" : "notrequired", txbrefconcern: "required" }, messages: { txbrefconcern: "*this field mandatory", txbreftoother: "*this field mandatory" }, ignore: "" }); }); }); the alert shows change in value being p

kendo Grid grouping incompatibility with row template -

when i'm using other "groupable" row template doesn't work in kendo grid before there no problem , how use grouping of row template i put code wrote in review do jsfiddle : click here check jsfiddle <script> $(document).ready(function () { var ds = new kendo.data.datasource({ transport: { read: { url: '/api/clientssnapshot', datatype: 'json', type: 'get' } } }); $('.table').kendogrid({ datasource: ds, sortable: true, groupable: true, selectable: true, navigatable: true, height: 500, scrollable: true, rowtemplate: kendo.template($("#client-row-template").html().replace('class="k-alt"', '')), altrowtemplate: kendo.template($("#cli

javascript - How to construct a js object and call its methods with js_of_ocaml? -

i try build application using js_of_ocaml. let's have following code in javascript : function myfunction(){ this.name = "a" } myfunction.prototype.setname = function(arg){ this.name = arg } how write in ocaml/js_of_caml code have same effect js code below ? val myinstance = new myfunction(); myinstance.setname("joe"); i tried write : let onload _ = let myinstance = js.unsafe.new_obj (js.unsafe.variable "myfunction") [||] in js.unsafe.call (js.unsafe.variable "myfunction.prototype.setname") myintance [|js.unsafe.inject "joe"|]; js._false ;; let _ = html.window##onload <- html.handler onload; the constructor called have errors following doesn't seem right way it. have tried js.unsafe.meth_call function it's not better. any appreciated. your unsafe version should work with let onload _ = let myinstance = js.unsafe.new_obj (js.unsafe.variable "myfunction") [||] in js.unsafe.met

r - Selecting a subset of rows where a % of the values meet the threshold -

i have dataframe values in rows , samples in columns (two groups, , b). example df: df <- rbind(rep(1, times = 10), c(rep(1, times = 9), 2), c(rep(1, times = 8), rep(2, times = 2)), c(rep(1, times = 7), rep(2, times = 3)), rep(1, times = 10), c(rep(1, times = 9), 2), c(rep(1, times = 8), rep(2, times = 2)), c(rep(2, times = 7), rep(1, times = 3))) colnames(df) <- c("a1", "a2", "a3", "a4", "a5", "b1", "b2", "b3", "b4", "b5") row.names(df) <- 1:8 i have been selecting subset of rows samples below threshold using following: selected <- apply(df, margin = 1, function(x) all(x < 1.5)) df.sel <- df[selected,] result of is df[c(1,5),] i require 2 further type of selections. first select, example, rows @ least 90% of samples below threshold values of 1.5. result of should be: df[c(1,2,5,6)] t

post - Simple request from mobile client to Meteor server -

using browser client interact db in meteor trivial. however, having trouble retrieving data (non-js) mobile client. in usual django or php server, simple or post request client , respond whatever want server, meteor works different; haven´t seen example of how respond server client. if it's of interest, mobile client uses c#. edit: question. can achieve ironrouter or somehow using ddp? read ddp posing option. you can use middleware purpose: webapp.connecthandlers.stack.splice(0, 0, { route: '/api/endpoint', handle: function(req, res, next) { res.writehead(200, {'content-type': 'application/json'}); res.end('{"success": true}'); }, }); in handle function, req , res usual node.js requests , response objects , can handle them in same way in typical node.js application. next function may call in case decide reason don't want respond request, , let meteor propagate request further through stack.

javascript - how to write/update the data in html page depeding upon the json response in ajax jquery -

i working javascript jquery. m sending request url getting json response , want json response should displayed in html page format may in table or smoother format.then how can that.and want update data in html page depending upon json response dynamically.so how can that.and working phonegap technology should use server side ? $.ajax({ type: "get", url: "url", data: null, contenttype: "application/json; charset=utf-8", success: function(data) { alert("success"); } }, error: function(jqxhr, exception) { if (jqxhr.status === 0) { alert('not connect.\n verify network.'); } else if (exception === 'timeout') { alert('time out error.'); } else if (exception === 'abort') { alert('ajax request aborted.'); } else { alert('uncaught error.\n' + jqxhr.responsetext); } } }); replace code $.ajax({ type: &quo

ios - Convert some bytes from a unsigned char to int -

i want convert bytes int. code far: unsigned char *byteptr = (unsigned char *)[ansdataframe]; i want take 4 bytes unsigned char: myframe[10] , myframe[11] , myframe[12] , myframe[13] , convert them integer. int bytestoint(unsigned char* b, unsigned length) { int val = 0; int j = 0; (int = length-1; >= 0; --i) { val += (b[i] & 0xff) << (8*j); ++j; } return val; }

Software licensing: Managing security -

i have implement software licensing mechanism organization. provide 30 day trial software. how ensure after 30 days on no 1 able use software. product web based product developed in java ee , can installed on windows linux either on physical machine or on virtual machine. want generate unique id machine can manage in server , @ time of installation can query servers info whether trail being installed or not. shared computers i.e, 2 persons using same computer have our separate mechanism. want know safest way , reliable way generate unique id machine work in every case. have read other questions. telling use bios, processor id etc don't think these work in virtual machines product can installed in cloud ex: amazon aws, rackspace etc. disclosure: work license4j. you can use combination of hostname, mac address, disk volume id etc hardware id, works on both physical , virtual machines. trial license normal license limited validity period (e.g. expires after 30 days). c

c# - Request additional claims Owin Security -

i trying retrieve additional information google oauth handshake using owin security. i have following request user profile claim google , google permissions page reflects claim requested. var googleconfig = new microsoft.owin.security.google.googleoauth2authenticationoptions { clientid = clientid", clientsecret = "secret" }; googleconfig.scope.add("https://www.googleapis.com/auth/userinfo.profile"); app.usegoogleauthentication(googleconfig); however when response using authenticationmanager.getexternallogininfoasync(); there 1 name claim on user. what need user profile data google on login? you need access additional claims in provider's onauthenticate event. in there context param contains these additional properties asked in scopes. exmaple, when using facebook: var fb = new facebookauthenticationoptions { appid = "...", appsecret = "...", authenticationtype = "facebook", sign