Posts

Showing posts from February, 2013

java - jsp not working on linux ec2 -

i have set amazon linux ec2. new it, want set up. have domain pointed, elastic ip, php/apache/mysql. wanting run java on instance well, assume possible. php stuff works, when hit .jsp page, looks simple html. i log instance through console, , these: [ec2-user@ip-* ~]$ java -version java version "1.7.0_25" openjdk runtime environment (amzn-2.3.10.3.29.amzn1-x86_64) openjdk 64-bit server vm (build 23.7-b01, mixed mode)` echo $path /usr/local/bin:/bin:/user/bin:/usr/local/sbin:/usr/sbin:/sbin:opt/aws/bin:/home/ec2-user/bin:/usr/lib/jvm/java/bin and when hit my_domain:8080 tomcat page. so know java installed, , tomcat running. else missing? my .jsp file looks this: <%@page contenttype="text/html" pageencoding="utf-8"%> <!doctype html> <html> <head>

time - Batch: Trying to get a command to execute at a specific amount of seconds -

this works hours, running in loop hits 13 hours executes. @echo off :time echo %time% /f "tokens=1*delims=0" %%a in ("$0%time:~0,2%") set /a hh=%%b if %hh% equ 13 goto success goto time :success echo success pause goto time but if run seconds in loop execute @ 13 seconds keeps running in loop , doesn't execute command. @echo off :time echo %time% /f "tokens=1*delims=0" %%a in ("$0%time:~5,2%") set /a ss=%%b if %ss% equ 13 goto success goto time :success echo success pause goto time this doesn't work either for /f "tokens=1*delims=0" %%a in ("$0%time:~6,2%") set /a ss=%%b i need execute @ specified amount of seconds. instead of instance executing @ 13:00:00.00. can execute @ 13:00:13.00 or that. needs 6 not 5 offset. %time:~6,2% it not have complex. works, unless provide more details trying accomplish cannot provide best help. :time echo %time% if %time:~6,2% equ 13 goto success goto t

tokbox - Blinding other audio inputs with opentok stream -

i'm trying create audio chat using opentok webrtc. there 1 publisher. publisher able upload music file, start speaking, , have music , voice published opentok session. possible opentok? currently, there no way blend music , microphone output , publish using opentok, since opentok receives input publishing mic or webcam. 1 thing play uploaded file on site audio file, , able hear file along microphone input opentok's stream. to publish audio using opentok, can set publishvideo false when initialize publisher. documentation here .

unit testing - How to write jasmine test to check update -

i'm trying write jasmine test check view changing time or not it 'ticks time', -> @time = parseint($('#timer h1').text()) settimeout (-> @after = parseint($('#timer h1').text()) expect(@time).tobelessthan(@after) ), 1000 the problem when time of settimeout jasmine finished job, no html code on page related test @ moment. jasmine has solutions kind of task: it 'ticks time', -> runs -> @time = parseint($('#timer h1').text()) waits(1000) runs -> @after = parseint($('#timer h1').text()) expect(@time).tobegreaterthan(@after)

javascript - Grammar rules for comments -

i working reflect.js (a nice javascript parser) zach carter on github; trying modify behavior of parser handle comments normal tokens should parsed else. default behavior of reflect.js keep track of comments (the lexer grabs them tokens) , append list of them end of ast (abstract syntax tree) creates. however, these comments included in-place in ast. believe change involve adding grammar rules grammar.y file here . there no rules comments -- if understanding correct, why ignored main parsing code. how write rules include comments in ast? the naive version modifies each rule of original grammer: lhs = rhs1 rhs2 ... rhsn ; to be: lhs = rhs1 comments rhs2 comments ... comments rhsn ; while works in abstract, screw parser generator if ll or lalr based, because can't see far enough ahead next token decide do. you'd have switch more powerful parser generator such glr. a smarter version replaces (only and) every terminal t nonterminal:

javascript - Extjs Combo return array and not only integer -

i use combobox extjs. when submit form return of combobox array. need string... the return : {"data":{"idapourmutuelle":"","idorganisme":["","1"],"idpersonne":"3","mutuelle":""}} and combobox: xtype: 'combobox', anchor: '100%', fieldlabel: 'nom', name: 'idorganisme', allowblank: false, editable: false, displayfield: 'mutuelle', hiddenname: 'idorganisme', store: 'mutuelle', valuefield: 'idorganisme'

jvm - How to measure stack memory in Java? -

there single core class used in transaction engine. did test high number of concurrent transaction resulted in deadly stack-overflow exception. know if there way measure how stack memory available in order avoid exception. i looking dynamic way of doing setting hard limit on number of concurrent transactions not ideal. give java visualvm try. it's oracle, , included jdk. can find here: ${jdk}/bin/jvisualvm.exe almost want know java application's performance can observed through this. here's quick tutorial if need it, although doesn't need of explanation.

c# - How can I initialize DataSpace.SSpace and DataSpace.CSpace generically? -

i'm creating general-purpose ef model browser, model loaded selecting dll, using reflection instantiate objectcontext. that part working - problem operations require dataspace.sspace , dataspace.cspace failing , i'm trying figure out how these initialized in generic fashion run-time ef utility metatadata query functions use them work. is there way initialize metadata information while having dll available (edmx not available). thanks in advance leads. thanks julie lerman, craig stuntz, , hadi hariri, able find solution, using syntax revealed in http://social.msdn.microsoft.com/forums/en-us/dd7b1c41-e428-4e29-ab83-448d3f529ba4/creating-an-entity-connection-from-a-sql-connection . may not optimal, works: var workspace = new metadataworkspace(new string[] { "res://*/" }, new assembly[] { assemblycontainingyourmodel }); i tried using metadataworkspace.loadassembly() resulted in: the space 'ospace' has no associated collection.

iphone - Status bar in iOS remains in the last orientation view -

status bar in application remains in last orientation view have selected. in app playing tube video not using web view playing automatically played after clicking on play button given tube site. , works in portrait , landscape view if during playing mode of video select landscape mode , stops video status bar remains in same position while whole app moves portrait view. hi sharma, you need set orientation per requirement.you can show , hide status bar per requirement. [[uiapplication sharedapplication] setstatusbarhidden:no]; [[uiapplication sharedapplication] setstatusbarorientation:uiinterfaceorientationportrait]; try 1 !!

MySQL Trigger to automatic insert based on date -

i tried following example .but doesn't insert. problem in clause?? create definer = `root`@`localhost` trigger `new` after insert on `employee` each row insert employee_log( first_name, last_name ) select first_name, last_name employee start_date = now( ) i'm not sure if can done triggers. can make shell script, , execute mysql commands test.sh: #!/bin/bash #delete today_plan mysql -e "delete today_plan" --user=user_name --password=your_password db_name #insert todays plans today_plan mysql -e "insert today_plan (pjtno, pattern, itemno, belt, kiln, qty, lnusr, distant, remark, decww, plandate, nowdate, shipment) select pjtno, pattern, itemno, belt, kiln, qty, lnusr, distant, remark, decww, plandate, nowdate, shipment daily_plan plandate=now()" --user=user_name --password=your_password db_name exit then add execution of shell script cron job in /etc/crontab like: 0 6 * * * root php /path/to/script/./test.sh which execute every mor

delphi - Service cannot access folder -

i've made service backups of firebird databases using delphi. service gets destination dir , create fbk file using gbak. works in directory except of "google drive" directory, , don't know how solve it. when execute gbak separately service, works don't know going wrong here's code if not fileexists(getenvironmentvariable('programdata') + '\my\' + nombre) try fillchar(seinfo, sizeof(seinfo), 0); seinfo.cbsize := sizeof(tshellexecuteinfo); seinfo begin fmask := see_mask_nocloseprocess; wnd := 0; lpfile := pwidechar(regquerystringvalue('software\firebird project\firebird server\instances', 'defaultinstance') + 'bin\gbak.exe'); nshow := sw_hide; lpparameters := pwidechar('-v -t -user sysdba -password "masterkey" ' + '"' + getenvironmentvariable('programdata') + '\my\' + nombre + '"'); end; if shellexecuteex(@seinfo) begin

php - Mod Rewrite faux-directory path with extra query string -

i'm trying write rewrite rule in .htaccess file has following behavior. i'm doing api located @ real location in form of: https://www.domain.com/apifolder/entry.php?call=testcall&data=testdata the api call routed starting entry.php , delivers appropriate response. entire api lands upon large switch statement of valid api calls. problem is, url not nice. i'm trying replace url of form: https://www.domain.com/api/testcall?data=testdata i have gotten close following rewrite rule: rewriterule ^api/([^/]+)/? /apifolder/entry.php?call=$1 [l] however, desired example above not work, because there first parameter seems coming in ( data , in reality second parameter), led ? . if try url: https://www.domain.com/api/testcall&data=testdata where it's led & instead, works fine. looks weird me too, sadly. there can let rewritten url take in query string beginning ? instead? i managed solve including [qsa] flag in rule, passes query string (

reference - regarding usage of arrow notation in perl -

i've following 2 statements written in perl : @m1 = ( [1,2,3],[4,5,6],[7,8,9] ); # array of references. $mr = [ [1,2,3],[4,5,6],[7,8,9] ]; # anonymous array. $mr holds reference. when try print : print "$m1[0][1]\n"; # statement outputs: 2; expected. print "$mr->[0][1]\n"; #this statement outputs: 2; expected. print "$mr[0][1]\n"; #this statement doesn't output anything. i feel second , third print statements same. however, didn't output third print statement. can let me know wrong third print statement? this simple. $mr reference. use arrow operator dereference. also, if use use warnings; use strict; , have received obvious error message: global symbol "@mr" requires explicit package name

node.js - How to set callback url in Facebook realtime updates using nodejs -

is there way can realtime update facebook in localhost , if can not how set callback url? try using "passport" authentication in node.js... you can set call url follows..... passport.use(new facebookstrategy( { clientid: facebook_app_id, clientsecret: facebook_app_secret, callbackurl: "your url" }

Karma - Unexpected token when including an html file -

i'm trying include simple html file in karma config file access html elements javascript files , test jasmine in karma. but i'm getting unexpected token < error. saw in webcast possible include html files, don't know why doesn't works configuration? thanks in advance you need use html2js preprocessor (or ng-html2js preprocessor if using angularjs). see preprocessor description how works. since karma 0.10, html2js preprocessor shipped karma , configured default: module.exports = function(config) { config.set({ files: [ 'templates/*.html' ], preprocessors: { '**/*.html': ['html2js'] } }); }; then can access html content js string: var elm = $(__html__['templates/x.html']) the error getting means html files not preprocessed. default, html files under basepath preprocessed, maybe html files somewhere else, in case need put them in preprocessors config explicitly. share karma.c

php - How get html from remote url? -

Image
goood day. i have link if open link in blowser see window i html element id tarifvalue for use code: $ch = curl_init(); curl_setopt($ch, curlopt_url, 'http://www.russianpost.ru/autotarif/autotarif.aspx?viewpost=26&countrycode=643&typepost=1&viewpostname=undefined&countrycodename=%d0%a0%d0%be%d1%81%d1%81%d0%b8%d0%b9%d1%81%d0%ba%d0%b0%d1%8f%20%d0%a4%d0%b5%d0%b4%d0%b5%d1%80%d0%b0%d1%86%d0%b8%d1%8f&typepostname=undefined&weight=1100&value1=2650&postofficeid=123456'); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch, curlopt_header, 0); $output = curl_exec($ch); curl_close($ch); but echo $output show next code: <html> <head></head> <body onload="document.myform.submit();"> <form method="post" name="myform" style="visibility:hidden;"><input id="key" name="key" value="497947"> <input type="submit">

android - Saving state of activity on orientation change using different Layouts? -

i using 2 different layouts same activity, on orientation change activity state not maintained. please suggest how that? you can store "activity state" using onsavedinstancestate. example: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); if(saveinstancestate != null) { if(savedinstancestate.getboolean("running") == true) { // running } else { // not running } } } @override protected void onsaveinstancestate(bundle outstate) { super.onsaveinstancestate(outstate); if(condition) { outstate.putboolean("running", true); } }

how to find a sum using linq in a bson document using C# -

the sample collections structure :- { arr : [ { "seq" : 2 }, { "seq" : 4 } ] } the c# code tried is var maxticketseq = bsontrans["arr"].asbsonarray.sum(m => (int)m["seq"]); this working fine... but structure { "arr" : [ { "name" : [{"seq" : 2 } , {"seq" : 5 }] }, { "name" : [{"seq" : 2 } , {"seq" : 5 }] } } for need find sum of seq. how achieve in linq query. actually bsondocument similar 1 getting result of mongo query.

Illegal character range in regex -

i getting error message regex. here message: message: illegal character range near index 17 . [~?!@#$%^& ()_-+=[]|\;:‘“<>,.?/]{8,9}.* ^ note: ^ inthe end of message below + sign. here code: private static final string password_pattern_special_8 = ".*[~?!@#$%^&*()_-+=[]|\\;:‘“<>,.?/]{8,9}.*"; seems working in java. try: 1. `pattern.quote()` function 2. \q(characterlistherewithoutbracket)\e 3. escape character manually using `\` in front of character. second option uses thing literal lies between \q..\e . edit regarding second option mean can use given in this example. see special characters . or can check if qouted pattern regex engine using similar or not: \.\*\[~\?!@\#\$%\^&\*\(\)_-\+=\[]\|\\\\;:‘"<>,\.\?/]\{8,9}\.\* note: pattern obtained .net regex.escape() function.

fileinputstream - Android - read internal data -

i'm trying make app, , need save string, tinydb in appinventor. so, found there http://developer.android.com/guide/topics/data/data-storage.html#filesinternal i'm looking saving data internal storage, don't know how read it. say: to read file internal storage: call openfileinput() , pass name of file read. returns fileinputstream. read bytes file read(). then close stream close() but don't know how, code never works. googled how read internal storage, , no code worked. can please tell me, how read text internal storage? :) this code: edittext tagbox = (edittext)findviewbyid(r.id.edittext1); string tag = tagbox.tostring(); context context = getapplicationcontext(); fileinputstream fis = context.openfileinput( tag ); inputstreamreader in = new inputstreamreader(fis); bufferedreader br = new bufferedreader(in); string data = br.readline(); toast.maketext(getapplicationcontext(), data, toast.length_long).show(); o

c# - Jquery Chosen selected not working on asp listbox -

i using jquery chosen plugin on listbox multiple selection of items. when retrieving selected items, works, , number of selected items remains 0. this how applying control: <script type="text/javascript"> function pageload(sender, args) { $('#<%= this.listbox.clientid%>').chosen(); } </script> <asp:panel id="pnladdupdate" runat="server"> <asp:updatepanel id="updpaddupdate" runat="server" updatemode="conditional"> <asp:listbox id="listbox" runat="server" selectionmode="multiple"></asp:listbox> </asp:updatepanel> </asp:panel> this codebehind: foreach (listitem item in this.listbox) { if (item.selected) list.add(convert.toint32(item.value)); } the list remains empty..any idea have missed?

c# - How to catch and log exception inside Using statement without using try-catch? -

as know using statement has built in implementation of dispose() , try-catch. want know few things is possible log exception inside using statement without using try-catch block , either inside or outside statement. if not, why built in statement. nested or overuse of try-catch not preferred, why such model preferred use. using (some_resource) { try { } catch { } { //my exception logging mechanism } } will become try { try { } catch { } { //my exception logging mechanism } } catch { } { //some_resource.dispose() } a using statement i

Android/Java - How check when the OutputStream has finished to write the bytes -

i have created server socket accept connection client, , when connection established image transferred using outputstream write bytes. question how can check if outputstream has finished write bytes before close socket connection, because not image correctly transferred. code i'm using: file photofile = new file(getheader); //getheader file have transfer int size2 = (int) photofile.length(); byte[] bytes2 = new byte[size2]; try { bufferedinputstream buf = new bufferedinputstream(new fileinputstream(photofile)); buf.read(bytes2, 0, bytes2.length); buf.close(); } catch (filenotfoundexception e) { e.printstacktrace(); } catch (ioexception e) { e.printstacktrace(); } client.getoutputstream().write(bytes2, 0, size2); //client server socket thanks my question how can check if outputstream has finished write bytes before close socket connection, because not image correctly transferred no, problem assuming read() fills

deployment - Is there a Maven way to deploy a Java App (not a WebApp)? -

i developing simple command line application. use cloudbees to: git repo (ok, private one) jenkins continuous build (ok, trigger build when push repo, perfect) deploy run@cloud (ok, painful sdk installation) my question be: there way deploy java app (not web app) maven cloudbees plugin ? (it record experience). running raw java container documented: http://developer.cloudbees.com/bin/view/run/java+container the bees-maven-plugin documented here: https://developer.cloudbees.com/bin/view/run/mavenguide . plugin not seems sdk can do. couldn't use in jenkins. what did adding "script shell / post build step" in jenkins job. following script: . /private/brnvrn/scripts/setup-sdk bees app:deploy -a brnvrn/gdataaccess -t java -r class=com.brnvrn.test.main -r classpath=gdataaccess.jar target/gdataaccess-1.0-snapshot.jar waitforapplicationstart=false how install sdk in jenkins explained here: http://wiki.cloudbees.com/bin/view/dev/scripting+bees+sdk+in+jenki

collada - Three.js CanvasRenderer Artifacts -

Image
i trying load collada file using threejs. works well, if make object spin can see rendering not right. check image: here code (which partially stolen example): function init() { container = document.createelement( 'div' ); document.body.appendchild( container ); var info = document.createelement( 'div' ); info.style.position = 'absolute'; info.style.top = '10px'; info.style.width = '100%'; info.style.textalign = 'center'; info.innerhtml = 'drag spin cube'; container.appendchild( info ); camera = new three.perspectivecamera( 20, window.innerwidth / window.innerheight, .1, 10000 ); camera.position.x=50; camera.position.y=50; camera.position.z=50; camera.lookat(new three.vector3(0,0,0)); scene = new three.scene(); renderer = new three.canvasrenderer(); renderer.setsize( window.innerwidth, window.innerheight ); container.appendchild( renderer.domeleme

javascript - Using jQuery / JS to switch form values fails when value contains a '/' -

i'm using switch function unit converter allows user swap units instead of changing selection. works fine noticed in cases failed. i went through options until reducing size of value field/ worked. assumed value long after checking on here: max length of html attribute value it looks within boundaries. i'm wondering else be? below 2 examples taken console log showing before , after switch button pressed , results once changed name. measurement type: thermalexpansion convertfunctions.js:30before!!! from: length/length/degreec to: length/length/degreeran convertfunctions.js:40after!!! from: length/length/degreec to: length/length/degreeran convertfunctions.js:1020parsed input 1 , result 0.555555556 measurement type: thermalexpansion convertfunctions.js:30before!!! from: lengthran to: lengthk convertfunctions.js:40after!!! from: lengthk to: lengthran edit: tested again using oblique in field , failed. edit again: more info: the function, shows co

css - HTML form cursor position is in the middle -

for reason when form displays, text content aligned half way vertically. i'm not sure why? i'm using sinatra on ruby. html: <form action="/create" method="post"> <h1>arrays:</h2><br> <input type="text" name="file" value="<%= @contents1 %>" id="form"> </form> css: #form { width: 100%; height: 120px; border: 3px solid #cccccc; padding: 5px; font-family: calibri, sans-serif; font-size: 12px; } jsfiddle it's because <input type='text'> designed deal single line of text. did mean use <textarea> instead?

visual studio - Inline assembly in C++ fail? -

alright wrote assembly function detect if process present during run-time. i'm not quite getting inline assembly point though wrapped assembly code asm wrapper still detects inner code c code ... goes little this: __inline bool isprocloaded() { _asm { mov ah, 0x48 int 0x68 ; after compiling breaks on line, 'int' highlighted cmp ax ... } } what issue here, , how can fix it? that because int interrupt instruction useful in user mode nowadays because interrupts privileged ( related ). without more details can't tell trying achieve here, though after searching around beginning looks similar method detecting softice debugger , code pretty ancient (dos , windows era) seems reasonable on modern os 0xc0000005 status_access_violation exception.

.htaccess - Wordpress 3.8.1 Multisite Subdirectory WP-Admin 404 Error - Tried Everything -

domain www.sandersonathletics.org wordpress 3.8.1, multisite subdirectory. the error thats cropping identified on new subdirectory site; www.sandersonathletics.org/football - unformatted , www.sandersonathletics.org/football/wp-admin 404 error i've verified .htaccess file matches what's in wordpress. i've verified appropriate location of .htaccess (public_html root) i've verified wp-config file , location of multisite data in right place , i've checked what's there. i've reviewed entries in mysql database , www. matches in wp-config, database, etc. (the host suggested this) i've renamed plug-in directory plugin-bak debug plugin issue. had no effect. i'm hosted dreamhost shared servers. .htaccess <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] # add trailing slash /wp-admin rewriterule ^([_0-9a-za-z-]+/)?wp-admin$ $1wp-admin/ [r=301,l] rewritecond %{request_filename} -f [or] rewrite

java - how to show error message when session time out glassfish security? -

i using glassfish security realm j2ee project using jsf . session time out in 30 min. when click on component redirecting login page thats good. but u want before user click on component when session out dialog or msg need apear alarm user session expired . thats why tried way didnt work using jsf listener : <f:event listener="#{logincontroller.checksessiontimeout}" type="prerenderview"/> and in managed been : public void checksessiontimeout(componentsystemevent event) { facescontext context = facescontext.getcurrentinstance(); httpservletrequest request = (httpservletrequest) context.getexternalcontext().getrequest(); if (request.getrequestedsessionid()!=null && !request.isrequestedsessionidvalid()) { system.out.println("session log out"); } } but when session time out didnt print nothing me thats prove function didnt work . if can't use

AngularJS ng-repeat don't see scope variable - in WYSIWYG editor loaded with AJAX? -

i'm modifying website, built angularjs, , in 1 page have wysiwyg editor. the whole widget includes editor, div has 'ng-controller="textscontroller"'. in div have button, clicking on displays editor. , initializing of editor happens in directive - "richtexteditor". so - i'm making popup in editor, has show images server. put code pulling images in controller ... , there set $http.get('/url/to/files').success(function(data) { $scope.imagesfromserver = data; }); and in view have 'ng-repeat="image in imagesfromserver"' and problem ngrepeat doesn't see items. i have 2 ideas: the view, containing ngrepeat (the html editor, , popup images well) loads ajax, , @ moment scope variable not set. i'm initializing scope variable in wrong place. (eventually has in directive instead of controller? ... examples i've seen , done far - pull every data in controller, , view sees directly.) hope i'v

Creating database in Netbeans for Java web application -

i have jdialog contains jtextfields , save button.how create database table stores projectid , projectname , description , store them locally? for use sqlite , relevant jdbc driver. here'e tutorial http://www.tutorialspoint.com/sqlite/sqlite_java.htm sqlite allows create local database on file system, won't need database server host it.

forms - Rails form_for submit button not working -

thank patience. still pretty new rails. using rails 3.2 making signup page simple app. problem submit button on form doesn't cause effect, whether information in form valid or not. the user model , database both seem work fine. if add user manually rails console, add database. far can tell, issue seems in form generated form_for. here page in question: <% provide(:title, 'sign up') %> <h1>sign up</h1> <div class="row"> <div class="span6 offset3> <%= form_for(@user) |f| %> <%= render 'shared/error_messages' %> <%= f.label :name %> <%= f.text_field :name %> <%= f.label :email %> <%= f.text_field :email %> <%= f.label :password %> <%= f.password_field :password %> <%= f.label :password_confirmation, "confirmation" %> <%= f

powershell - Don't want some part information in output -

hi guys have following code search folder , return string containing value down: filter multiselect-string( [string[]]$patterns ) { # check current item against patterns. foreach( $pattern in $patterns ) { # if 1 of patterns not match, skip item. $matched = @($_ | select-string -pattern $pattern) if( -not $matched ) { return } } # if patterns matched, pass item through. $_ } get-childitem -recurse | multiselect-string 'report','product1' so if code gets file displays that: directory: c:\users\sarvesh.nundram\desktop\pmi\rpd_extract_xml\sql_tobemigrated2\group1 mode lastwritetime length name ---- ------------- ------ ---- -a--- 11/21/2013 1:07 pm 133279 acapulco what if don't want these info: mode lastwritetime length name ---- ------------- ------ ---- -a--- 11/21/2013 1:07 pm this? get-childitem -recurs

.net - Why does Visual Studio only expose part of the Environent.SpecialFolder enumeration? -

the .net documentation shows environment.specialfolder enumeration extensive, , apply versions of framework , including 4.0. when attempted use in visual studio 2010 professional, found intellisense did not recognise commondocuments member. used context menu "go definition", whereupon opened new tab called "environment [from metadata]" showed specialfolder enumeration follows: // summary: // specifies enumerated constants used retrieve directory paths system // special folders. [comvisible(true)] public enum specialfolder { // summary: // logical desktop rather physical file system location. desktop = 0, // // summary: // directory contains user's program groups. programs = 2, // // summary: // directory serves common repository documents. personal = 5, // // summary: // "my documents" fol

Javascript : changing a value of element html -

how can change value of first price span using javascript <span class="regular-price" id="product-price-27"> <span class="price">$2,699.99</span> </span> <span class="price">$2,000</span> i've tried getelementbyclassname change tow of them i want change value of first 1 <span class="price">$2,699.99</span> try this, first gets outer span element, elements within class... var outerspan = document.getelementbyid("product-price-27"); var innerspans = outerspan.getelementsbyclassname("price"); innerspans[0].innerhtml = "$xxxx"; here live jsfiddle demo

Remove facebook HipHop (hhvm) Ubuntu and debug it -

i have installed hhvm using building , installing hhvm in ubuntu 13.10 github , want uninstall system completely. not getting documentation regarding this. i uninstalling because not able make server using: hhvm -m server -p 8080` nor ` hhvm -m server -vserver.type=fastcgi -vserver.port=8080 it giving error like warning: logging before initgooglelogging() written stderr e0321 17:09:56.491703 13532 fastcgi-session.cpp:562] fastcgi protocol: received invalid record run sudo /usr/share/hhvm/uninstall_fastcgi.sh the run sudo apt-get remove hhvm then restart server(nginx/apache)

ios - GDataXML string values are not saved into data on [GDataXML XMLData] -

i have gdataxmldocument created xml file. xml being read file: <pages count="1"> <page pagenumber="1"></page> </pages> i need add new "page" tag (programmatically). xml after new "page" added: <pages count="2"> <page pagenumber="1"></page> <page pagenumber="2"></page> </pages> everything ok long there no need set stringvalue "page" tags; xml should this: <pages count="2"> <page pagenumber="1">some value</page> <page pagenumber="2">some other value</page> </pages> and in program looks! (you can see xmlstring method), when save document ([document xmldata]) file looks this: <pages count="2"> <page pagenumber="1">some value</page> <page pagenumber="2"></page> </pages> pa

actionscript 3 - show dimension of flv in text field -

below basic code, im loading flv video using flvplayback. i need features of flvplayback compulsorily. i have finished loading flv video sucessfully. now im stuckup showing source video files original dimension in text field. how should proceed further here. please guide me...... stage.displaystate = stagedisplaystate.full_screen; stage.align = stagealign.top_left; stage.scalemode = stagescalemode.no_scale; import fl.video.*; stop(); var rmys01:flvplayback = new flvplayback(); rmys01.source = "rhym01.flv"; rmys01.skin = "minimaflatcustomcolorplaybackseekcountervolmute.swf"; rmys01.autoplay = true; rmys01.fullscreentakeover = false; rmys01.scalemode = "maintainaspectratio"; rmys01.setsize((stage.stagewidth/1.03), (stage.stageheight/1.03)); rmys01.x = (stage.stagewidth/2) - (rmys01.width/2); rmys01.y = (stage.stageheight/1.1) - (rmys01.height/1.1); addchild(rmys01); setchildindex(rmys01,1); did set client netstream? because, work o

c# - Page_Load is not executed in asp.net -

i have c# code namespace zumaapp { public partial class _default : system.web.ui.page { servicereference1.qslwebbookingsoapclient services; public string callerid = ""; public int32 rowcount; protected void page_load(object sender, eventargs e) { callerid = request["callerid"]; and in asp have this: <%@ page title="vmp online booking" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="default.aspx.cs" inherits="zumaapp._default" %> my problem the page load function not executing. how did know that first: make break point on first line in page_load function, visual studio doesn't stop @ break point. second: make break point @ line public string callerid = ""; , visual studio stops on line, press step over page loaded without going page_load function. i tried clean , rebuil

jquery - Javascript: Get body html in one row string. How to remove linebreaks? -

i have html <span style="font-family: tahoma, arial, helvetica, sans-serif; font-size: 10pt;">one two:</span> i need receive html in 1 row string. a = $("body").clone().find("script").remove().end().html(); = a.replace("\r\n", "zzz"); = a.replace("\n", "zzz"); console.log(a); but it's not working. same. <span style="font-family: tahoma, arial, helvetica, sans-serif; font-size: 10pt;">one two:</span> replace new line characters regex , global flag: a.replace(/\r?\n/g, ' '); demo

sql - Table from comma separated Column at two level -

Image
i have 1 old db in there 2 columns contain comma separated values this, sql fiddle link schema now problem trying import values database normalized. instead of comma separated values, need convert values tabular format . so output should this, you need define columns mean. in example discarding original id column, in case "1,2,3" & "a,b" mean? i'd approach cursoring through each row , using split function convert each field table of values. create function dbo.fn_split1 (@sep nchar(1), @s nvarchar(4000)) returns table /************************************************************************************************** * author: http://stackoverflow.com/questions/314824/ * description: splits string table of values, single-char delimiter. * example usage: select * dbo.fn_split1(',', '1,2,5,2,,dggsfdsg,456,df,1,2,5,2,,dggsfdsg,456,df,1,2,5,2,,') ****************************************

sql server 2008 - remove duplicates from a row and keep the order sql -

i have table follows seriesvariables_id seriesvariables_label seriesvariables_value series_id 143 batch number test20passall 28 144 serialno simtest 28 145 seg pull date 20/1/2014 28 146 seg pull time 101010 28 147 batch number test20passall 28 148 serialno simtest 28 149 seg pull date 20/1/2014 28 150 seg pull time 101010 28 151 batch number test20passall 7 152 serialno simtest2 7 153 seg pull date 20/2/2014 7 154 seg pull time

Firefox CSS3 isosceles triangle rendering issues -

Image
i'm trying create isosceles triangle using css3 , looks firefox can't render them properly? is there way of fixing that? here's example: http://jsfiddle.net/wajly/1/ css: .arrow { vertical-align: middle; content: ""; border-right: 50px solid transparent; border-left: 50px solid transparent; border-top: 75px solid #222; width: 0; height: 0; } html: <div class="arrow"></div> (firefox renders 1 on left) seems firefox still has problems jagged lines. workaround: came accross workaround: example maybe helps out - no guarantee. alternative i: make borders same size (in example e.g. 50px) not see jagged lines. can scale size of arrow border-size. alternative ii: use image (should not huge request / load time ...) edit: got work!: jsfiddle trick add line of code: border-style: solid dotted none; best regards.

ember.js - "Resolved all models on destination route, finalizing transition". But Ember renders 'view:loading' -

router calls hooks hangs in finalizing transition renders view:loading . the problem is, don't know why ember isn't finalizing transition, far know models:menus fetched , categories sideloaded. both categories , categories.index routes defined. categories , categories:index controllers defined , ember.arraycontroller.extend({}) categoriesroute export default ember.route.extend({ model: function(params){ return this.modelfor('menus').findby('id', params.menu_id).get('categories'); } }); categoriesindexroute export default ember.route.extend({ model: function(params){ return this.modelfor('categories'); } }); what ember logs: https://gist.github.com/pekhee/b07917dcf6d9f78bb7d1 due lack of template controller, ember hangs in finalizing transition since can't render template. i'm not 100% sure though, apparently of mar 2014 ember app kit grunt server task isn't compiling new files.

php - Get the value of a cell in mysql table -

i'm using codeigniter write few lines of simple code value mysql table. what i've tried: $interview_id=45 $category_raw = $this->db->query("select category interview interview_id='$interview_id'"); $category = $category_raw->first_row(); but reason, $category shown "array()", while want value within. any advice on how proceed? thanks much, try $interview_id=45; $category_raw = $this->db->query("select category interview interview_id=$interview_id"); $category = $category_raw->first_row()->category; or active record $interview_id=45; $this->db->select("category"); $this->db->where("interview_id",$interview_id); $category_raw = $this->db->get("interview"); $category = $category_raw->first_row()->category;

python 2.7 - Can you assign more than one command to a Tkinter OptionMenu? -

i have following optionmenu: self.wcartsn = stringvar(self.frame1) self.e1 = optionmenu(self.frame1, self.wcartsn, *watercarts, command=(self.wcart, lambda selection:self.other_entry(selection,'wcartsn',10,6))) self.e1.grid(row=10, column=5, stick=e+w) this doesn't work, makes question clear. how (if possible) call multiple functions 1 optionmenu? function gives error typeerror: 'tuple' object not callable you create function calls each of multiple functions in turn: def compose(functions): """ returns single function composed multiple functions. calling returned function execute each of functions in order gave them. """ def f(*args, **kargs): function in functions: function(*args, **kargs) return f self.e1 = optionmenu(self.frame1, self.wcartsn, *watercarts, command=compose(self.wcart, lambda selection:self

Neo4j Browser – query lost on refresh -

is there way recover latest queries after refreshing browser? steps reproduce (without part question short) :) open browser load "neo4j manager" page run several queries refresh page the history should preserved such can cycle through old queries up-arrow key - across page reloads.

html5 canvas - KineticJS Image Flip - Preserve coordinates and dimensions -

i'm looking in library images position. i'm working v4.5.1. it appears in drawfunction images placed @ (0, 0). here excerpt kinetic.image::drawfunction() // if cropping if(crop) { cropx = crop.x || 0; cropy = crop.y || 0; cropwidth = crop.width || 0; cropheight = crop.height || 0; params = [image, cropx, cropy, cropwidth, cropheight, 0, 0, width, height]; } // no cropping else { params = [image, 0, 0, width, height]; } how positioned? i'm asking because want flip images , looks there no method that. i know there various ways it. i'm setting scale -1, end having translate coordinates flipped image. don't want modify coordinates or dimensions in object attributes. i'm using kinetic foundation larger project , kinetic classes used base classes. override right method , either re-implement account scale , translate before draw or pass translated values. ​any great help. thanks! ~micah to flip image, can apply negat

put elements in an array- C-cooja -

i want put each message received in array , print out array after received message of time : received message hello node 1 , want put message in array- array[1], , receive message letsgo node 2 , put message in array - array[2] , after couble of time 3 or 4 times want print out array element : hello,letsgo, ... how can .. i appreciat hard work me guys , in advance .. this code : int o =0; char sendtoo[3]={}; recv_uc(struct unicast_conn *c, const rimeaddr_t *from) { { i++ ; if ( table[i] == from->u8[0] ); b=table[from->u8[0]]++ ; printf(" message received %d.%d , & = %d = %s\n ", from->u8[0], from->u8[1], b,(char *)packetbuf_dataptr()); } while (i<1); if ( sendtoo[o] == from->u8[0] ); sendtoo[o] = packetbuf_copyto (sendtoo) ; o++ ; printf("%d,",sendtoo); }

asp.net mvc - MVC Model Validation Fails Followed by Empty Response -

i'm testing screens in mvc application html input in fields of text , i'm not sure what's wrong. for of fields validation summary shown expected when enter text suspect characters <b>bold</b> framework invalidates model before controller code hit , empty response server. the string property in question decorated in model this: [stringlength(1000, errormessage = "must under 1000 characters long"), datatype(datatype.multilinetext, errormessage = "text error")] why validation on 1 field generate empty response?

Camel integration with existing web application -

i have web application providing rest full service , standalone (jar) application doing soap request response (using camel) can give me pointers me how integrate 2 applications specifically around how kick camel routes when war file deployed in tomcat, , how re-run routes when specific http request arrives. i using camel dsl (xml) , spring. update 1: have followed this checked web.xml has following lines: <context-param> <param-name>contextclass</param-name> <param-value>org.springframework.web.context.support.annotationconfigwebapplicationcontext</param-value> </context-param> <context-param> <param-name>contextconfiglocation</param-name> <param-value>com.mycompany.server.binder</param-value> </context-param> <context-param> <param-name>log4jconfiglocation</param-name> <param-value>/web-inf/classes/log4j.properties</param-value> </context

How to parse http headers in Go -

i have http response headers shipped in logs elsewhere. in log file have things :- date: fri, 21 mar 2014 06:45:15 gmt\r\ncontent-encoding: gzip\r\nlast-modified: tue, 20 aug 2013 15:45:41 gmt\r\nserver: nginx/0.8.54\r\nage: 18884\r\nvary: accept-encoding\r\ncontent-type: text/html\r\ncache-control: max-age=864000, public\r\nx-ua-compatible: ie=edge,chrome=1\r\ntiming-allow-origin: *\r\ncontent-length: 14888\r\nexpires: mon, 31 mar 2014 06:45:15 gmt\r\n given above string, how go parse header object described in net/http . 1 way split string myself , map key, values... looking avoid doing hand , use standard (or maintained 3rd party) library parse it... pointers? the builtin parser in textproto. can either use directly, or add fake http request header , use readrequest in http package. either way need wrap data bufio.reader, here i'm assuming we're starting string. with textproto: logentry := "content-encoding: gzip\r\nlast-modified: tue, 20 aug 2013 1

How is it possible to save client entered text in the same format in PHP? -

i save text database can entered client php , mysql. lets have textarea , want save exact layout, how client entered text. by exact layout mean: exact spaces exact linebreaks after want display them in same format. of course html js tags wiped out when we're outputting text. it's practice store original text in database render filtered text. you can change linebreaks html nl2br() , use htmlentities() function prevent xss vulnerability.

c# - Send dynamic list of strings to controller from view in MVC -

i have view this: <div class="editor-label"> @html.labelfor(model => model.parts) </div> <div class="editor-field"> <ul id="parts"></ul> <span id="parts-button" onclick="addpart()">+ add part</span> </div> , js so: function addpart(name) { var input = $('<input>').attr("name", "parts"); if (name != null) input.val(name); $('<li>') .append(input) .append($('<div>') .html("x") .on("click", function () { var div = $(this) div.parent().slideup(function () { $(this).remove(); }); }) .addclass("delete")) .appendto($('#parts')).hide().slidedown(); } and model this: public virtual ilist<string> parts { get; set; } my question is; it's

ruby - Is there a way to make shotgun output requests? -

when run sinatra app without shotgun , tells every request being done: $ ruby app.rb [2014-03-21 16:56:03] info webrick 1.3.1 [2014-03-21 16:56:03] info ruby 2.0.0 (2013-06-27) [x86_64-linux] == sinatra/1.4.4 has taken stage on 4567 development backup webrick [2014-03-21 16:56:03] info webrick::httpserver#start: pid=27957 port=4567 127.0.0.1 - - [21/mar/2014 16:56:07] "get / http/1.1" 200 12 0.0019 localhost - - [21/mar/2014:16:56:07 eet] "get / http/1.0" 200 12 - -> / shotgun doesn't this: $ shotgun -p 4567 app.rb == shotgun/webrick on http://127.0.0.1:4567/ [2014-03-21 16:58:05] info webrick 1.3.1 [2014-03-21 16:58:05] info ruby 2.0.0 (2013-06-27) [x86_64-linux] [2014-03-21 16:58:05] info webrick::httpserver#start: pid=28322 port=4567 is there way make shotgun work same way?

http - SSL/TLS debugging: How to view messaging until encryption keys are exchanged? -

for e.g. if did https://www.gmail.com , thought use firebug see tls/ssl handshaking , message exchanges. did not see any. in forum answered firebug operates @ http , not @ https level. until keys exchanged, operate in unencrypted or clear mode. so, should firebug not show these messages, such cypher exchanges? these handshaking, keyexchange, cypher exchange messages carried through http protocol requests/responses or separately done through modules built in browser ssl/tls module , therefore cannot viewed through tools firebug? thanks. firebug works both http , https, doesn't show ssl/tls details under https connection. are these handshaking, keyexchange, cypher exchange messages carried through http protocol requests/responses or separately done through modules built in browser ssl/tls module , therefore cannot viewed through tools firebug? the ssl/tls handshake not carried on http protocol, it's done @ ssl/tls level, under http (https http on ssl/tls). do

numpy - How to compare great circle distance with euclidean distance of two sphere points using python? -

i trying check error introduced when compute distance of 2 points on earth euclidean distance instead of using great circle distance (gcd). have 2 points defined lattitude , longtitude. used python geopy framework great circle distance . here code gcd: def measure(self, a, b): a, b = point(a), point(b) lat1, lng1 = radians(degrees=a.latitude), radians(degrees=a.longitude) lat2, lng2 = radians(degrees=b.latitude), radians(degrees=b.longitude) sin_lat1, cos_lat1 = sin(lat1), cos(lat1) sin_lat2, cos_lat2 = sin(lat2), cos(lat2) delta_lng = lng2 - lng1 cos_delta_lng, sin_delta_lng = cos(delta_lng), sin(delta_lng) d = atan2(sqrt((cos_lat2 * sin_delta_lng) ** 2 + (cos_lat1 * sin_lat2 - sin_lat1 * cos_lat2 * cos_delta_lng) ** 2), sin_lat1 * sin_lat2 + cos_lat1 * cos_lat2 * cos_delta_lng) return self.radius * d so or 2 points: p1=[39.8616,-75

java - JavaFX8 - sun.util.logging.PlatformLogger not found Exception in NetBeans 8 -

i have installed jdk8 + netbeans8 (downloaded bundled setup oracle site) on windows 8.1 machine. when create simple javafx fxml application, works fine. when add new database entity class using wizard , compile it, following stack trace: note: creating non-static metadata factory ... error: com.sun.tools.javac.code.symbol$completionfailure: class file sun.util.logging.platformlogger not found annotation processor threw uncaught exception. consult following stack trace details. java.lang.runtimeexception: com.sun.tools.javac.code.symbol$completionfailure: class file sun.util.logging.platformlogger not found @ org.eclipse.persistence.internal.jpa.modelgen.canonicalmodelprocessor.process(canonicalmodelprocessor.java:407) @ com.sun.tools.javac.processing.javacprocessingenvironment.callprocessor(javacprocessingenvironment.java:794) @ com.sun.tools.javac.processing.javacprocessingenvironment.discoverandrunprocs(javacprocessingenvironment.java:705) @ com.sun.tools.javac.processing.j

c# - Microsoft Exchange Services - How to get exact match using Resolve -

here question related microsoft exchange-integration. calling microsoft exchange services-method resolvename (string) : i passing in username, e.g. myusername , , 2 matches -one match username myusername , 1 myusername2 . question is: there possibility call returns direct matches, matches exact username returned? here follows code: : var service = service.getservice(); username = regex.replace(username, ".*\\\\(.*)", "$1", regexoptions.none); var resolvednames = service.resolvename(username); foreach (var resolvedname in resolvednames) { mailboxname = resolvedname.mailbox.address; } that method resolves e-mail addresses, exact match you'd need this. string username = "myusername"; string domain = "mydomain.com"; string emailaddress = username + "@" + domain; nameresolutioncollection resolvedcontactlist = _ser