Posts

Showing posts from March, 2012

r - air quality index calculation -

if have statement in excel like: =if(and(q1>=0,q1<=12), 50/12*(q1-0)+0, if(and(q1>=12.1,q1<=35.4),(100-51)/(35.4-12.1)*(q1-12.1)+51, if(and(q1>=35.5, q1<=55.4), (150-101)/(55.4-35.5)*(q1-35.5)+101, if(and(q1>=55.5,q1<=150.4), (200-151)/(150.4-55.5)*(q1-55.5)+151,"na" )))) "q1" cell in column q row 1. question is, how can translate statement excel r? guess should use multiple if else statements in r, not sure how organize them... thank you! if in excel can ifelse in r. parameters same - @ file typing ?ifelse and in excel translates & between statements in r - see here #assume data called q result = ifelse((q>=0 & q<=12), 50/12*(q-0)+0, ifelse((q>=12.1 & q<=35.4),(100-51)/(35.4-12.1)*(q-12.1)+51, ifelse((q>=35.5 & q<=55.4), (150-101)/(55.4-35.5)*(q-35.5)+101, ifelse((q>=55.5 & q<=150.4), (200-151)/(150.4-55.5)*(q-55.5)+151,"na" )))) testing this, have: q = c(...

ajax - How do I make my hosting detect _escaped_fragment_ and fetch the corresponding HTML? -

i have ajax site , i'm using hashbangs (#!) in urls intention of providing correct html versions when google bots replace #! ?_escaped_fragment_. how go routing/proxying/redirecting url _escaped_fragment_ corresponding html pages? can't find documentation on part of process specifically, , first thought should using 301 or 302 redirect, told wasn't case, albeit not given more info. you can't use htaccess or redirects @ all. after # in url isn't sent server . url fragment entirely client side. you'll need use kind of javascript solution @ fragment, , make whatever appropriate ajax call server , load content back.

Javascript: Is it safe to refer to the <html> DOM-node? -

working in environment css-selectors available retrieving elements want obtain element in dom covers whole browser-window. using developer tools found out <body> has margin in case makes unsuitable requirements. i further discovered <html> element covers whole area of browser-window. safe use dom-node when document properties? i.e. getting width/height example? does chance <html> correspond referred document in javascript? edit: side note on setup: i'm working interns wrapped wd version , want coordinate mouse movements relative document. aiming using method selectbycssselector coodinate mouse movements respect selected element. working <html> node here seems work out far. never touched <html> node before , never saw else do, why wanted assured not bad using node. the document object dom html object so, yes, correspond <html> tag, not in way think. not <body> or <span> tag. tells browser following code o...

java - Centering elements in a BoxLayout -

Image
i cannot lblconinfo center, due it's inline html. know how this? import java.awt.color; import java.awt.component; import java.awt.dimension; import java.awt.toolkit; import java.io.ioexception; import javax.swing.boxlayout; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; public class streamer extends jframe { private static string ip = "127.0.0.1"; private static string key = "123456"; public streamer() throws ioexception { jpanel streampanel = new jpanel(); streampanel.setlayout(new boxlayout(streampanel, boxlayout.y_axis)); setdefaultcloseoperation(jframe.exit_on_close); setsize(200, 100); setresizable(false); dimension d = new dimension(toolkit.getdefaulttoolkit().getscreensize()); setlocation(d.width - 200, 0); setalwaysontop(true); add(streampanel); addcomponents(streampanel); settitle(...

visual studio - Sparrow.Chart.WinRT.45 Payload file 'C:\...\' does not exist errors -

when add sparrow.chart.winrt.45 through nuget package manager, upon attempting compile, faced error 7 payload file 'c:\repository\application\packages\sparrow.chart.winrt.13.1.0.114\lib\netcore45\sparrow.chart.winrt.45\sparrow.chart.winrt.45\legend\legend.xaml' not exist. electroencephalograph error 8 payload file 'c:\repository\application\packages\sparrow.chart.winrt.13.1.0.114\lib\netcore45\sparrow.chart.winrt.45\sparrow.chart.winrt.45\themes\generic.xaml' not exist. electroencephalograph error 9 payload file 'c:\repository\application\packages\sparrow.chart.winrt.13.1.0.114\lib\netcore45\sparrow.chart.winrt.45\sparrow.chart.winrt.45\themes\styles.xaml' not exist. electroencephalograph any ideas? in case if couldn't figured out still, path .xaml files wrong. if check packages see has 1 sparrow.chart.winrt.45\ folder, vs search them in sparrow.chart.winrt.45\sparrow.chart.winrt.45 . should create folder in packages folder ,...

Tumblr CSS positioning -

i'm making 2 column tumblr theme , need fix weird css positioning issue i'm having. if @ picture provided can see there's gap in between 2 pictures in first column. happens when picture smaller max-width guess rest of width filled blank space. how can fix it? code: http://pastebin.com/ey4esqkh picture: http://i.imgur.com/z8k22cq.png jsfiddle: http://jsfiddle.net/kqvnd try this: 1. divide content in 2 columns this: <div class="column"> <!-- articles --> </div> <div class="column"> <!-- articles --> </div> 2. add css: .column { display:inline-block; vertical-align:top; } jsfiddle demo.

AngularJS: what is the execution order of $watch? -

i have watch function: scope.$watch('target', function(){ scope.hasunsavedchanges = true; }, true); then change value: functiion change(target){ scope.hasunsavedchanges = false; scope.target.xxx = ''; console.log('scope.hasunsavedchanges = ' + scope.hasunsavedchanges); } it outputs false. when watch function executes? , how run code after scope.hasunsavedchanges becomes true in above code? $watch functions executes after every time $scope.$digests() function called. and if want execute code after variable hasunsavedchanges become true. wouldn't make more sense make function instead , execute code there like: scope.setunsavedchanges = function(){ scope.hasunsavedchanges = true; //the rest of code goes here } scope.$watch('target', function(){ scope.setunsavedchanges(); }, true);

c# - Html.BeginForm() not rendering properly -

Image
while searching in stackoverflow other questions didn't helped in situation. how possible debug such error 1 html.beginform not rendered page. i use code @model extremeproduction.models.selectusergroupsviewmodel @{ viewbag.title = "user groups"; } <h2>groups user @html.displayfor(model => model.username)</h2> <hr /> @using (html.beginform("usergroups", "account", formmethod.post, new { enctype = "multipart/form-data", id = "usergroupsform" })) { @html.antiforgerytoken() <div class="form-horizontal"> @html.validationsummary(true) <div class="form-group"> <div class="col-md-10"> @html.hiddenfor(model => model.username) </div> </div> <h4>select group assignments</h4> <br /> <hr /> <table> <tr>...

symfony - How does the configuration for Payum Bundle work? -

i'm new payum , trying create new payment gateway. can't figure out how config values relate files i've created (actions/factory etc). here's have far; payum: security: token_storage: path\to\paymentsecuritytoken: doctrine: driver: orm contexts: xxx: yyyy: api: options: sandbox: true storages: path\to\payment: doctrine: driver: orm i don't supposed put xxx , yyy . no matter values try still don't it. keep getting following error. invalidconfigurationexception: unrecognized options "yyy" under "payum.contexts.xxx" can tell me values supposed , how values set related gateway , there needed config matches in gateway code? thanks in advance :) yyyy - payment (or storage) factory name. under section put payment specific opti...

JavaFX editable combo box -

i trying use editable combo box. in want add listener pressing enter key. tried below options none of them working.:( cmb_year combo box object. cmb_year.setonkeypressed(new eventhandler<keyevent>() { @override public void handle(keyevent t) { if (t.getcode() == keycode.enter) { system.out.println("entered"); } else if (t.getcode() == keycode.escape) { system.out.println("entered"); }else { } } }); cmb_year.geteditor().setonkeypressed(new eventhandler<keyevent>() { @override public void handle(keyevent t) { if (t.getcode() == keycode.enter) { system.out.println("entered"); } else if (t.getcode() == keycode.escape) { system.out.println("entered"); }else { } } }); you can use...

PowerShell Regex with VSS command -

i wanted select select "writer name","writer id" , "writer instance id" output of "vssadmin list writers", needed on how go using regex , create powershell objects, can 1 help ps c:\windows\system32> $list = vssadmin list writers ps c:\windows\system32> $list vssadmin 1.1 - volume shadow copy service administrative command-line tool (c) copyright 2001-2012 microsoft corp. writer name: 'task scheduler writer' writer id: {d61d61c8-d73a-4eee-8cdd-f6f9786b7124} writer instance id: {1bddd48e-5052-49db-9b07-b96f96727e6b} state: [1] stable last error: no error writer name: 'vss metadata store writer' writer id: {75dfb225-e2e4-4d39-9ac9-ffaff65ddf06} writer instance id: {088e7a7d-09a8-4cc6-a609-ad90e75ddc93} state: [1] stable last error: no error writer name: 'performance counters writer' writer id: {0bada1de-01a9-4625-8278-69e735f39dd2} writer instance id: {f0086dda-9efc-47c5-8eb6-a944...

java - Android/Eclipse: how to prioritize a local over a library package -

i using eclipse , have android application composed of 2 packages, core package app , settings package stores series of global settings app (e.g. in-app purchase market key app). app imports library (e.g. in-app wrapper lib), in turn uses copy of aforementioned global settings package. how i've implemented this, date, 3 projects; app, library , third 1 for settings (as library). settings lib exported jar, put in build path of library , referenced library top level app, avoid dreaded "multiple dex files" error (as happen if reference mysettings project mylib). overall, looks bit this: myapp (mylib referenced) - core_app_logic - settings mylib (mysettings.jar in build path) - lib_logic mysettings - settings resources prioritized correctly; in myapp used rather in mylib. however, while myapp use myapp.settings package, mylib instead use mysettings.settings one. am missing approach, or should looking @ different one? i can answer own question, can becau...

javascript - Grails asset-pipeline not picking up resource requirements -

i have grails (2.3.6) app , have configured use asset-pipeline : // buildconfig.groovy plugins { compile ":asset-pipeline:1.8.7" } in grails-app/assets/javascripts directory, have: myapp.js fizz.js buzz.js then in grails-app/views/index.gsp : <!doctype html> <html> <head> <title>my app</title> <link rel="stylesheet" type="text/css" href="${resource(dir: 'css', file: 'myapp.css')}" /> </head> <body> <div id="home" class="page"> <!-- content... --> </div> <asset:javascript src="myapp.js" /> </body> </html> and finally, in myapp.js : = require fizz.js = require buzz.js = require_self // initialize application. init(); function init() { alert("do stuff!"); } when grails run-app , app starts fine. when go view pa...

c++ - Copy struct to vector -

say have structure of various data types, want copy each single byte in vector. this: vector<unsigned char> myvector; // vector unsigned char buf[sizeof mystructure]; // array memcpy(&buf, &mystructure, sizeof mystructure); // copy struct array myvector.insert(myvector.begin(), buf, buf + sizeof mystructure); // copy array vector is there quickest way allows me copy struct mystruct vector myvector without passing through array buf ? you can try iterator-pair constructor: auto const ptr = reinterpret_cast<unsigned char*>(&mystructure); std::vector<unsigned char> myvector( ptr, ptr + sizeof mystructure );

php - File upload with jQuery and ajax not working -

file uploading working in program after refreshing page. javascript <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script type="text/javascript" src="<?php echo base_url()?>assets/scripts/ajaxfileupload.js"></script> <script type="text/javascript"> function ajaxfileupload(){ $("#loading") .ajaxstart(function(){ $(this).show(); }) .ajaxcomplete(function(){ $(this).hide(); }); $.ajaxfileupload ( { url:'<?php echo site_url()?>/welcome/doupload', secureuri:false, fileelementid:'filetoupload', datatype: 'json', success: function (data, status){ if(typeof(data.error) != 'undefined'){ if(data.error != ''){ $("#info...

Java: Mixing together two double bitstrings for Genetic Algorithm crossover -

i implementing evolutionary neural network. ran problem when comes crossover of 2 double values. evolving weights of links in neural network. //get weights want crossover double weighta = a.getweight(); double weightb = b.getweight(); //round 6 decimal numbers. weighta = (double)math.round(weighta * 1000000) / 1000000; weightb = (double)math.round(weightb * 1000000) / 1000000; //convert doubles binary strings string binarya = long.tobinarystring(double.doubletorawlongbits(weighta)); string binaryb = long.tobinarystring(double.doubletorawlongbits(weightb)); //define random crossover point. int crossoverpoint = randint(0, binarya.length()); //put strings based on crossover point. string newbinary = binarya.substring(0,crossoverpoint) + binaryb.substring(crossoverpoint+1,binaryb.length()); double newweight = double.longbitstodouble(new biginteger(newbinary, 2).longvalue()); the problem encountering getting large or small weig...

linux - ERROR: stat: No Such File Or Directory, opendir() and stat() in C programming -

hey , reading. i making program takes 1 argument (directory) , reads files in directory used opendir()/readdir(), , displays file type (reg, link, directory etc) using stat. receiving error "no such file or directory" when execute me program in shell (i using redhat linux). here code: #define _bsd_source #include <stdio.h> #include <dirent.h> #include <sys/stat.h> #include <sys/types.h> #include <time.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { dir *dirp; struct dirent* dent; struct stat info; //if no args if(argc == 1){ argv[1] = "."; dirp=opendir(argv[1]); // specify directory here: "." "current directory" { dent = readdir(dirp); if (dent) { ////////////////////////////////////////////////////////////////////////// if (stat(dent->d_name, &i...

delphi - How loop a sound seamlessly in Firemonkey (FMX)? -

how loop sound seamlessly using tmediaplayer in firemonkey (using xe6, c++ builder)? what doing far using ttimer checks if (mediaplayer->currenttime >= mediaplayer->media->duration) { mediaplayer->currenttime = 0; mediaplayer->play (); } but doesn't create seamless loop, when ttimer's interval set 1. any ideas? i not familiar component assume, in windows, wrapper around directshow. means never able (frame) seamless playback because of overhead of starting/stopping graph. if can live small hiccup, best results (and better code) if there onlastframe() event, in can reset frame counter first frame (or currenttime zero).

java - dependencyClasspath error on Play! 2.2 as play.db.ebean cannot be found -

i running play! 2.2 , want models extend play.db.ebean. have 1 model called event extends play.db.ebean.model. following compilation errors when try generate eclipse files (from play command line) because application cannot find play.db.ebean package: [info] create eclipse project files project(s). [info] compiling 6 scala sources , 7 java sources c:\users\nickc\gatherme\target\scala-2.10\classes... error: cannot find symbol [error] public abstract class event_ extends play.db.ebean.model_ { [error] symbol: class model_ [error] location: package play.db.ebean [error] 1 error [error] not create eclipse project files: [error] error evaluating task 'dependencyclasspath': error i have following in build.sbt file: import play.project._ name := "forms" version := "1.0" val appdependencies ++= seq( javaebean, jdbc ) playjavasettings this suggested here , in zentasks sample project. guessing build.sbt file must wrong? or not getting picke...

c - How to prevent Buffer overflow with segmentation or paging? -

how make use of segmentation , paging prevent buffer overflow? 1 guess might - because segmentation gives portion of memory each process , if process tried access address outside segment segfault occur. please tell me if correct or not. thank you! segmentation / paging not prevent code attempting access memory outside of boundaries. definition of buffer overflow, , no sort of memory protections attempt broken code attempting things not allowed do. what segmentation or paging can do, prevent code successfully accessing memory doesn't own. option operating system has kill process hardware has detected attempting "bad".

Grails command line redirection in windows -

i've been trying co-worker's linux build scripts set of large grails apps work in windows (via cygwin). uses lot of 'here documents' can reduce problem down simple question - how, in windows or cygwin, grails accept series of commands stdin -- i.e. 'grails < cmds'. every time try grails opens 'grails>' interactive prompt. i have tried variations of -djline=jline.(windows linux unsupported)terminal -non-interactive , cygwin , cmd (windows 7 64 bit, grails 2.3.5 way) in seems ignore redirection of stdin. i've tried variation 'cat cmds | grails ..... ' i've looked through jiras haven't found definitive. there comments moving different windows consoles (e.g. conemu) didn't solve me. moving off windows not option :( anyone seen/solved problem before or have insights ? what grails ? mean, exactly started when run it? look in task manager or process explorer command line. supposing, runs java.exe, need r...

java - What is a NullPointerException, and how do I fix it? -

what null pointer exceptions ( java.lang.nullpointerexception ) , causes them? what methods/tools can used determine cause stop exception causing program terminate prematurely? when declare reference variable (i.e. object) creating pointer object. consider following code declare variable of primitive type int : int x; x = 10; in example variable x int , java initialize 0 you. when assign 10 in second line value 10 written memory location pointed x. but, when try declare reference type different happens. take following code: integer num; num = new integer(10); the first line declares variable named num , but, not contain primitive value. instead contains pointer (because type integer reference type). since did not yet point java sets null, meaning "i pointing @ nothing". in second line, new keyword used instantiate (or create) object of type integer , pointer variable num assigned object. can reference object using dereferencing operator . (a dot...

The import com.google.android.glass.timeline.TimelineManager cannot be resolved -

following livecard tutorial, realized eclipse keeps throwing following error: "import com.google.android.glass.timeline.timelinemanager cannot resolved". solution found online set project compile glass gdk changing build target glass development kit sneak peak version 15. i dont have glass development kit sneak peek under android 4.0.3. downloaded adt bundle http://developer.android.com/sdk/index.html . however, have glass development kit preview under android 4.2.2, version 19. could problem why timelinemanager not being identified or imported? i can't move forward until figure out.. =( here screenshot of error: https://dl.dropboxusercontent.com/u/14109184/screen%20shot%202014-05-31%20at%209.42.38%20pm.png yes, timelinemanager removed xe16 no immediate replacement. if you're planning on creating gdk based app going forward - don't try use old gdk. if need insert static card, may wish evaluate mirror api see if meets needs.

java - how to define cycles in protobuf? -

Image
say have following mode.proto file: message entityd { optional entitye epointer = 1; optional int32 dfield = 2; } message entitye { optional entityd dpointer = 1; optional int32 efield = 2; } this has 2 entities - d , e, allow cross-linking. issue after generating java code above *.proto im unable create cycle: public static void main(string[] args) throws exception { model.entityd.builder dbuilder = model.entityd.newbuilder(); model.entitye.builder ebuilder = model.entitye.newbuilder(); dbuilder.setdfield(42); ebuilder.setefield(7); dbuilder.setepointer(ebuilder); ebuilder.setdpointer(dbuilder); model.entityd d = dbuilder.build(); model.entitye e = ebuilder.build(); system.err.println("same d: "+(d==e.getdpointer())); system.err.println("same e: "+(e==d.getepointer())); } im trying create simple d <--> e cycle. instead this: same d: false same e: false there is cycle in created mo...

c - Dump Flash Memory through a single GPIO pin -

i'm working infineon's xmc4500 relax kit , i'm trying extract firmware through single gpio pin. my naive idea dump 1 bit @ time through gpio pin , somehow "sniff" data logic analyzer. pseudocode: while(word word memory copy hasn't finished) ... register = value; temp_value = value , 0x1; pin = temp_value; value = value >> 1; ... am on right track? have better/nicer idea how archive this? ### edit ### actually requirement of (shell)code needs tiny. found this nifty trick on how dump firmware blinking leds. however i'm struggling receive correct values saleae logic analyzer. basically i'm doing is: setup gpio pin directions output blink led1 (pin 1.1) clock (spi serial clock) blink led2 (pin 1.0) data bits (spi mosi) sniff pins logic analyzer here's c code: #include "xmc4500.h" #define del 1260 void init() { // p1.0 output, push pull port1->iocr0 = 0x80ul << 0; // p1.1 out...

search words in adobe pdf reader in access 2007 -

i can see pdf file private sub form_load() dim filename string filename = "c:\users\user\desktop\abandon.pdf" acropdf5.loadfile filename end sub but want search in pdf , find abandon , show on label on form.

opengl - Changing camera direction without affecting its location -

i'm changing camera location , direction according mouse movement , buttons pressed. in order move camera 5 units forward(for example) according direction, i'm using following code: float mview[16]; glgetfloatv(gl_modelview_matrix, mview); translate_forward_camera += 5; //i have translate_right_camera , //translate_up_camera variables glloadidentity(); gltranslatef(0, 0, 5); glmultmatrixf(mview); same moving sides. however, have not idea how change direction of camera without changing location. rotating camera around @ (0,0,0). previous y , x rotation angles are: old_x_ang, old_y_ang the new y , x rotation angles (i need rotate camera @ (0,0,0) using angles) are: x_ang, y_ang if i'll use following code, camera location change: glloadidentity(); gltranslatef(translate_right_camera,translate_up_camera,translate_forward_camera); glrotatef(x_ang,1,0,0); glrotatef(y_ang,0,1,0); how can 1 rotate camera without changing ...

javascript - Display Output During Each Iteration of for Loop -

i want show message displaying result of each iteration of loop in php. i have tried several methods using jquery, ajax etc doesn't seem fit needs or either not getting work around them. what script does? it scans website, grab links, visits each link 1 one , grab image each page , send wordpress including title , image. what's problem? the problem there can several links (more 200), though scripts displays message regarding success shows messages after whole loop finished executing. what want do? now, want during each iteration message should shown on browser rather waiting loop complete i.e. during 1st iteration (posted successfully) during 2nd (not posted) , on... here code: <?php $category = array(); ($i = 0; $i < count($result); $i++) { set_time_limit(30); // check if post exists global $wpdb; $query = $wpdb->prepare('select id ' . $wpdb->posts . ' post_name = %s',sanitize_title_with_dashes($result[$i]->t...

ios - Preventing my app's audio from interfering with other background music -

i think i'm looking combination of existing settings can't quite put in right order. have app plays sound clips using avaudioplayer. there start/stop button. i other apps' audio continue until app needs play something. when app launched itunes music playing, music continues correctly. when press play in app, other audio correctly stops, , app plays. stop player, switch music app, , press play again. when switch own app, music stops immediately. i again wait until needs play before killing music app. my best guess once i've used player, in kind of 'i need audio' state, , remains in state. how resign state?

angular.dart NgTwoWay and NgAttr deprecated? -

i have started using angular dart , im going through online tutorial examples, , darteditor striking out ngattr , ngtwoway saying deprecated, case? , if being replaced with? auto docs don't say. ngattr , ngoneway , ngtwoway , etc. marked deprecated in preparation new bind-* syntax, not implemented, yet. deprecation arguably bit premature, since there's no action users take, guess first warning of impending major breaking change.

html - (HTML5 & CSS) Issue with classes -

i don't understand why class no-support isn't updating element bold , red color. if type path $tbody tr .no-support it has red color it's not bold? can please explain? here code @ jsfiddle http://jsfiddle.net/sm8j8/ you should use font property , !important rewrite tbody td:first-child color css property : .no-support { font-weight: bold; color:red !important; } example

objective c - Turn off face recognition iOS 7 UIImagePicker -

is there way turn off face recognition when presenting uiimagepickercontroller (i.e. yellow box appears on face? _imagepicker = [[uiimagepickercontroller alloc] init]; _imagepicker.allowsediting = yes; _imagepicker.sourcetype = uiimagepickercontrollersourcetypecamera; _imagepicker.cameradevice = uiimagepickercontrollercameradevicefront; [self presentviewcontroller:_imagepicker animated:no completion:null]; based on these docs there key disable facial recognition. how set key disable it? cidetectortracking key used enable or disable face tracking detector. use option when want track faces across frames in video edit how go writing bare-bones camera using avfoundation ? according uiimagepickercontroller 's documentation . there no api enable/disable face recognition. if want disable when user take image, suggest use media capture , access camera in av foundation programming guide .

java - vlcj Error handling -

i'm working on selfmade video-media-player in javafx , therefore i'm using vlcj. i'm using directmediaplayercomponent renders video canvas. everthing fine here. video plays smooth , controlls working. however, lot of runtimeerrors cause canvas turn black sound still played, example java.lang.illegalargumentexception: image dimensions must > 0 @ com.sun.prism.image.<init>(image.java:271) @ com.sun.prism.image.<init>(image.java:241) @ com.sun.prism.image.frombytebgrapredata(image.java:79) @ com.sun.javafx.sg.prism.ngcanvas.renderstream(ngcanvas.java:591) @ com.sun.javafx.sg.prism.ngcanvas.rendercontent(ngcanvas.java:389) @ com.sun.javafx.sg.prism.ngnode.dorender(ngnode.java:201) @ com.sun.javafx.sg.prism.ngnode.dorender(ngnode.java:40) @ com.sun.javafx.sg.basenode.render(basenode.java:1145) @ com.sun.javafx.sg.prism.nggroup.rendercontent(nggroup.java:204) @ com.sun.javafx.sg.prism.ngregion.rendercontent(ngregion.java:420) @ com.sun.javafx.sg.prism.ngnod...

css - jquery setting z-index before toggleClass -

tying produce proof of concept function, ignore terrible naming conventions! ;-) i have jsfiddle here http://jsfiddle.net/dde8d/ $(document).ready(function () { $('#commission_1').on('click', function () { var newzindex = -1; if ($('#searchform_1').hasclass('showfrm')) { $('#searchform_1').css("z-index", newzindex); /* remove comment below make work */ /*$('#searchform_1').delay(750);*/ /*it chained on line above */ } $('#searchform_1').toggleclass("showfrm", 500, function () { if ($('#searchform_1').hasclass('showfrm')) { newzindex = 100; } $('#srchtext1').toggleclass("shrt", 500, function () { $('#commission_1').toggleclass("btn-success").toggleclass("btn-primary", 1000, function () { ...

Dealing with register_globals in PHP (On/Off) -

this question has answer here: what register_globals in php? 7 answers can explain me example happens if register_globals in php set on or off? i'll highly glad. thank you. in few php versions register_globals on default.this setting tells whether or not register contents of environment, get, post, cookie, server variables global variables. example, if register_globals on, url http://www.example.net/abc.php?id=3 will declare $id global variable. feature security risk, , should ensure register_globals off scripts.

ruby on rails - Need to prevent special character conversion when used in address bar -

i using ruby on rails bring language conversion parameter address bar using following link <%= url_for(controller: 'queries', action: 'index', search: @query.email, param: @query.file1, only_path: false ) %> with file1 param being following code work google translate: #googtrans(en|vi) in address bar switches following: %23googtrans%28en%7cvi%29 how print special characters without modifying them in address bar can picked properly? got work on own. had put url in html , place in variables in respective spot encoding needed encoded http://xxxx.herokuapp.com/queries?search=<%= @query.email.gsub(/@/, '%40') %>&param=<%= @query.file1 %>

javascript - Read a file from JQuery inside AngularJS -

hi i'm beginner @ programming. i'm trying put data json file variable i want have angularjs put text html document this {{ data.text }} and text based off of json file have in app.js, set data using jquery: myapp.controller('ctrl', function ($scope, $http) { $.getjson("../static/file.json", function(data) { $scope.data = data; }); but nothing shows initially. when log $scope.data, turns out undefined. know json file correct because if put code in method called $scope.foo = function(){$.getjson("../static/file.json", function(data) { $scope.data = data; });} and have button activate this, it'll work fine. want there initially. try $.getjson("/static/file.json", function(data) { $scope.data = data; }); then load file web http://xxx/static/file.json , not file system.

spring mvc - Using HashMap in dropdown list in Thymeleaf -

in controller setting hashmap @modelattribute("clientimpmap") public map<string,string> populateclientimpmap() throws malformedurlexception, ioexception { map<string,string> clientimpmap = new hashmap<string,string> (); clientimpmap.put("1","high"); clientimpmap.put("2","low"); return clientimpmap; } now want populate hashmap using thymeleaf tags .how it? using core spring-mvc tags can this <td>client importance :</td> <td><form:select path="personbean.clientimpref"> <form:option value="none" label="--- select ---" /> <form:options items="${clientimpmap}" /> </form:select></td> <td><form:errors path="personbean.clientimpref" cssclass="error" /></td> </tr> what equivalent of in thymeleaf? the following code corr...

java - Pseudo-Code non-maximum suppression -

Image
i have find maximum in octave 3x3x3 neighborhood. means have 4 layers on top of each other , between layers have find maxima. illustration here image. not iam doing represent issue. octave layer image http://docs.opencv.org/trunk/_images/sift_dog.jpg now maximum surpression found thi paper: efficient non-maximum suppression . here fast way explained find maxima in image. 2d case shouldn't problem shift in 3d space. problem pseudo code understanding. have pseudo-code: the problem red marked part. there have loop have no idea how apply "-[i, i+n] x [j, j+n]" loop. moment solution: //find local maxima after paper implementation not finished yet private vector<integer> findlocalmaximum(image image) { vector<integer> list = new vector<integer>(); int n = 1; int step = 2*n + 1; for(int = n; < image.getwidth()-n; =step) for(int j = n; j < image.getheight()-n; j =step) { int mi ...

java - Are socket connection UI thread blocking in Android? -

i'm new @ socket programming , i've read several tutorials have idea on when start. still have little knowledge android ui thread , socket programming. when using http request, should operation in different thread prevent ui blocking , getting anr. question socket connection? works same http request code execution stops until device gets response, therefore, have operations in background thread prevent anr? yes, socket connection , read operations blocking.

python - django string shows good in terminal but not in template -

i working on message system after have sent reply, tempalte view of mailbody gets put on 1 line, while when print same string in terminal works fine. the template: <div> to: {{ mail.to }}<br> from: {{ mail.sender }}<br> {{ mail.view_sent_at }}<br> </div> <div> <br> {{ mail.body }} </div> my reply body function: (to change body shown replay) def reply_format(self): message = self.body message = "> " + message message = message.replace("\r\n", "\r\n> ") send_information = "\r\n\r\n> to: %s\r\n> from: %s\r\n> date: %s\r\n>\r\n" % (self.to, self.sender, self.view_sent_at()) message = send_information + message return message now example mail body looks when save (and how looks in terminal after). send reply > to: admin > from: admin > date: 12:14 02-06-2014 > > test. > need lines > byebye when open in template looks like:...

if statement - How can I avoid using method selector arguments (flag/boolean arguments) in Java -

i've finished clean code , 1 of precepts avoid passing boolean arguments functional selectors, e.g., instead of this: public double calculateweeklypay(boolean overtime) { double pay = calculatepay(); if (overtime) { return pay *= 1.5; } return pay; } we should this, , let consumer call appropriate method: public double calculateweeklypay() { return calculatepay(); } public double calculateweeklypaywithovertime() { double pay = calculateweeklypay(); return pay *= 1.5; } but should in more complicated methods splitting method mean lots of duplicate code? what should done here: public double calculateweeklypay(boolean overtime) { double pay = calculatepay(); pay = modifypay1(pay); pay = modifypay2(pay) pay = modifypay3(pay) if (overtime) { pay = pay *= 1.5; } pay = modifypay4(pay); pay = modifypay5(pay); pay = modifypay6(pay); } you have distinguish between public api , in...

migration - CORDA Server Issue -

we migrating our applications new 2012 server , 1 of applications using cordanetembedder.dll.. have noticed there corda server installed on current application server. have not used corda server or net embedder corda earlier trying understand how works , want install latest corda server upgrading our server finding hard find information on this. free software or have buy , if have buy buy , information on installation tips , how net embedder talks corda server gray area me , not find on internet too. appreciate if here knows corda server , net embedder share information. thanks!

jquery - JavaScript filter object when property is true -

i have array of objects , i'm trying filter , return objects in 'issubstitute' property has value true. [ { endtime: "16:00", issubstitute: false, outletid: 619777, starttime: "05:00", visitdate: "2014-05-30", id: "168de242-d031-49f2-96d1-803154d0df1e" }, { endtime: "17:00", issubstitute: true, outletid: 619755, starttime: "05:00", visitdate: "2014-05-30", id: "168de242-d031-49f2-96d1-803154d0dabc" }, { endtime: "18:00", issubstitute: true, outletid: 619722, starttime: "05:00", visitdate: "2014-05-30", id: "168de242-d031-49f2-96d1-803154d0ddfg" } // , on... ] i've tried no luck: data = $.grep(data, function (e) { r...

sql - adding 'next' link to web application -

i have been able limit number of data send application need setting application show fetch next button. data retrieval code - using show 2 rows because have small amount of data in test database <webmethod(description:="retrieve members of client list"), soapheader("messagesoapheader", direction:=soapheaderdirection.in)> _ public function getclientlistmembers() dataset dim rs sqldatareader rs = objapp.connectuser(messagesoapheader.uid, messagesoapheader.pwd, messagesoapheader.campaign, messagesoapheader.keyword, localcommon.apsoapadvanced) rs.close() if objapp.classerrorscount > 0 objapp.db.close() dim nx new exception llib.throwsoapexception(objapp.errors(1).number, nx, objapp.db, objapp.errors(1).errortype, objapp.errors(1).description) getclientlistmembers = new dataset exit function end if llib.functioncount(objapp, "getclientlistmembers") 'this must placed after clo...

javascript - jQuery waypoint event triggered before reaching waypoint? -

i seem having problems executing waypoint event. executes before reach waypoint. strange thing is; set console.log see if waits waypoint , works fine. function execute @ right moment fadein executes document ready. javascript , jquery: $(document).ready(function(){ $("#trigger").waypoint(function(down){ $("p#ptje").fadein(4000).removeclass("hidden"); triggeronce:true; offset:'50%'; }); }); can me determine why executing 1 part on load , other part on waypoint properly? site up: athena.fhict.nl/users/i303973/pass in index.js removing hidden class p.hidden . removing should allow to shown when waypoint activated. $(document).ready(function(){ $("div.hidden").fadein(1500).removeclass("hidden"); $("h1.hidden").fadein(1500,function(){ //the line below causing paragraph shown before //you scroll down waypoint $("p.hidden").fadein(1500).removeclass...

Controlling whitespace/newlines in XSLT output -

i've been searching through questions see if particular one's been answered no success. if missed it, apologies. i have need "flatten" individual xml nodes output single line. whitespace between nodes not needed, , newlines within text nodes tobe replaced special character ('\n'). an example xml: <events> <event> <id>123</id> <type>read</type> <description> text here </description> </event> </events> what i'd output is: <events> <event><id>123</id><type>read</type><description>\nsome text here\n</description></event> </events> i tried using <xsl:strip-space> tag, , takes care of whitespace between tags, doesn't touch newlines in side element. i tried adding following template: <xsl:template match="text()"> <xsl:copy-of select="translate(.,'&#xa;...

android - database update method unable to accept integer value -

this further question earlier, on db.update. i'm used code karakuri's suggested , modified database adapter method following. note fma in integer number (34, actually) database adapter got mainactivity public void updatej(int fma){ string = "coli = ?"; contentvalues arw = new contentvalues(); cv.put("coli", fma); below no longer used null last argument instead // string jusi = integer.tostring(fma); // string[] whereargs = new string[] {jusi}; //log.w(tag, "whereargs = " + whereargs); db.update("supertable", cv, where, null); } it still not work. // previous 'the log.w reads 06-02 16:24:31.695: w/dba information(18940): whereargs = [ljava.lang.string;@5299a034' //but have question after reading online tutorials , android website , karakuri's explanation fourth argument whereargs suppose string[] instead of string or int. colu...

javascript - Facebook jQuery autocomplete plugin for textarea & free text -

Image
is there jquery plugin, similar facebook, suggests/autocompletes criteria: works textarea or contenteditable div. i'm finding many plugins support input fields (ex. http://loopj.com/jquery-tokeninput/ ). supports free text, combination of tags , non-tag text. example allows tags after hitting enter: http://brianreavis.github.io/selectize.js/ - not free text. examples of free text at.js ( http://ichord.github.io/at.js ), jquery-textcomplete ( http://yuku-t.com/jquery-textcomplete ), , jquery.mentionsinput ( http://podio.github.io/jquery-mentions-input ) pill-like css effect backspace/delete functionality. http://yuku-t.com/jquery-textcomplete/ gets pretty close styling example doesn't have delete functionality found in other plugins. example 1 has remove functionality. here example zapier well: found rich_textarea, meets criteria. https://github.com/yermo/rich_textarea

actionscript 3 - How I can read all nodes of external xml file? -

how can read nodes of xml file in 2 state: 1- if don't know name of nodes. 2- if l know name of nodes. note: can load , see file, want methods make access each nodes. can function each node. thanks. var txml:xml; var xmlloader:urlloader = new urlloader(); xmlloader.load(new urlrequest("‫‫ole.xml")); xmlloader.addeventlistener(event.complete,loaded);<br/> function loaded(e:event):void { txml = new xml(xmlloader.data); var childno:int; var namea: string; var sex:string; var id:int; namea= txml.@name; sex= txml.@sex;id = txml.@level; childno= txml.@child; trace(childno); trace(namea); trace(sex); trace(id); addmc(namea);} there few ways children. child property return xmllist , let search child name children gives children of specific node, no matter of names descendants give nested ones (can searched name) there might more, can @ documentation, these commo...