Posts

Showing posts from January, 2013

linux - How to wait till all services are up in parallel using bash? -

i have script starts 5 services on 4000-4004 ports. want script blocked till of them up. following works me. while ! nc -vz localhost 4000; sleep 1; done while ! nc -vz localhost 4001; sleep 1; done while ! nc -vz localhost 4002; sleep 1; done while ! nc -vz localhost 4003; sleep 1; done while ! nc -vz localhost 4004; sleep 1; done the problem above if 4002 still not up, keep on waiting while have no information 4003 & 4004. what run of these in parallel somehow , print out status of each port. , when of them up, continues after block else blocks , prints out ports , down. (optionally need add timeout well, should doable once how above.) thanks lot. edit: following worked great me: $ parallel --timeout 300 -j0 'while ! nc -vz localhost {}; sleep 10; done; echo {} open' ::: {4000..4004} 5001 || { echo "one or more serves failed start. exiting.."; exit 1; } note: make sure run following after installation. ref-link $ sudo rm /etc/parallel/con

jquery - Pop-up not showing in IE (with magnific-popup) -

Image
i'm trying implement magnific popup on website. works on ie10, firefox end on ipad. reason images not showing in ie8 in popup mode. (i have not checked in ie9). shows white screen. issue? here link: http://www.fietseling.org/media/routes2013/index.html this code: magnific popup <!-- magnific popup core css file --> <link rel="stylesheet" href="http://www.fietseling.org/templates/nuni_fietseling/css/magnific-popup.css"> <!-- jquery 1.7.2+ or zepto.js 1.0+ --> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <!-- magnific popup core js file --> <script type="text/javascript" src="http://www.fietseling.org/templates/nuni_fietseling/js/jquery.magnific-popup.js"></script> </head> <body> <div class="window-content"> <img src="fotos/routekaart2013fotos_gro

ajax - jQuery Form Plugin posting array as string -

i using jquery form plugin ( http://malsup.com/jquery/form/ ) , trying post array php file processed, can't work intended. with regular jquery $.ajax code example: var = [1,2,3]; $.ajax({ url: "uploader.php", type: "post", data: ({ a: }) }); would output php variable $_post['a'] as array ( [0] => 1 [1] => 2 [2] => 3 ) with plugin output of $_post['a'] string equals "1,2,3". i want plugin act $.ajax does. would handy see code sets jquery form plugin, if you're doing drop-in replacement assume like: $('#myformid').ajaxform({ url: uploader.php, type: "post", data:({ a:a }) }); without checking i've assumed "data" gets merged form data jquery form plugin i'm guessing ajax form plugin calls tostring javascript method on a - give "1,2,3" to json string json.stringify(a). ie: $('#myformid'

database - MySQL multiple processes writing -

i trying build database used store results on tests. problem these tests run in parallel , separate processes , after each 1 of them finishes commit results database. know mysql designed handle such situations , engines innodb can achieve row level locking. if process access locked table or entry, process blocked , poll until table or entry unlocked or query cached , process can terminate ? when process try connect server when down, happen or me handle ? any highly appreciated. the number 2 you, when mysql_connect() or whatever use connect database throw exception. number 1 issue resolved @ mysql level, depending on process require locked table or row. results in temporary delay query access data in locked areas, can return out-of-time error, should other process lock table/row extended period of time. mutual lock possible, process locks row 1, , process b locks row 2, , wants data row 2 , b wants data row 1. named "deadlocking", , 1 of processes chosen d

java - More elegant approach regarding the camera -

i'm using libgdx draw 2d scene. before drawing this: batch.setprojectionmatrix(camera.combined); as expected, (0,0) coordinates no longer in bottom left of screen, @ middle of screen. what more elegant solution position whole scene correctly: 1) translate/position camera accordingly show that's on screen. 2) draw while having in mind (0,0) @ middle now, so: batch.draw(background, -background.getregionwidth()/2, -background.getregionheight()/2); note i'm doing parallax scrolling , first option dispositions midground layer objects bit, expected. if there no solution problem, i'm leaning more towards second option. try keep objects in "world space" , keep translations "world space" screen in "camera" (the "camera" abstraction around matrices defined translate world space screen space). polluting object's locations information screen cause confusion , problems. specifically, in case, call camera.t

iphone - pass NSMutableArray to another view giving null values -

i'm new ios development , want pass nsmutablearray 1 viewcontroller gives me null values firstviewcontroller.h @interface firstviewcontroller : uiviewcontroller @property (nonatomic, retain) nsmutablearray *colorarray; -(ibaction)btn:(id)sender; firstviewcontroller.m @implementation firstviewcontroller -(ibaction)btn:(id)sender { secondviewcontroller* secondviewcontroller = [[secondviewcontroller alloc] initwithnibname:@"secondviewcontroller" bundle:nil]; secondviewcontroller.animalarray = self.colorarray; nslog(@"%@",secondviewcontroller.animalarray); // here not null [self.navigationcontroller pushviewcontroller:secondviewcontroller animated:yes]; } secondviewcontroller.h @interface secondviewcontroller : uiviewcontroller @property (nonatomic, retain) nsmutablearray *animalarray; secondviewcontroller.m i used nslog(@"animalarray:%@",self.animalarray); in viewdidload check values gives me null is there i&#

Object Data Encryption using javascript -

i have object following var caregiverdata = new object(); caregiverdata.firstname = 'abg'; caregiverdata.lastname = 'abg'; caregiverdata.address1 = 'abg'; caregiverdata.address2 = 'abg'; caregiverdata.city = 'abg'; caregiverdata.state = 'abg'; caregiverdata.zip = 'abg'; caregiverdata.phone = 'abg'; caregiverdata.email = 'abg'; caregiverdata.language = 'abg'; i want encrypt object data , send webservice using json.stringify(data) there want decrypt.. can encrypt entire object data using javascript?? can 1 please suggest me better way

Android - Out of memory Error. When it run on real device -

i have image gallery application, , i'm trying image external storage.my application can run on android emulator on real device(htc onex) got exception. my log cat here. 07-25 17:17:49.027: e/dalvikvm-heap(3008): out of memory on 480016-byte allocation. 07-25 17:17:49.052: e/dalvikvm(3008): out of memory: heap size=65571kb, allocated=63717kb, limit=65536kb 07-25 17:17:49.052: e/dalvikvm(3008): info: footprint=65315kb, allowed footprint=65571kb, trimmed=0kb 07-25 17:17:49.052: e/mediastore(3008): failed allocate memory thumbnail content://media/external/images/thumbnails/300; java.lang.outofmemoryerror: (heap size=65571kb, allocated=63717kb) 07-25 17:17:49.142: e/dalvikvm-heap(3008): out of memory on 480016-byte allocation. 07-25 17:17:49.152: e/dalvikvm(3008): out of memory: heap size=65571kb, allocated=63718kb, limit=65536kb 07-25 17:17:49.152: e/dalvikvm(3008): info: footprint=65315kb, allowed footprint=65571kb, trimmed=0kb 07-25 17:17:49.152: e/mediastore(3008): failed a

php - Using AJAX in a WordPress plugin -

i'm trying create wordpress sample plugin based in ajax. read tutorial , did plugin, it's not working. new ajax. here code tried: <?php class ajaxtest { function ajaxcontact() { ?> <div id="feedback"></div> <form name="myform" id="myform"> <li> <label fname>first name</label><input type="text" id="fname" name="fname" value=""/> </li> <li> <label lname>last name</label><input type="text" id="lname" name="lname" value=""/> </li> <input type="submit" value="submit" id="submit" name="submit"/> </form> <script type="text/javascript"> jquery('#submit').submit(ajaxsub

spring mvc - Difference between springmvc @Async, DeferredResult, Callable -

i've long-running task defined in spring service, started springmvc controller. want start service , return httpresponse caller before service ends. service saves file on file system @ end. in javascript i've created polling job check service status. in spring 3.2 i've found @async annontation, don't understand how different deferredresult , callable. when have use @async? , when use deferredresult? async annotates method going called asynchronously. @org.springframework.stereotype.service public class myservice { @org.springframework.scheduling.annotation.async void dosomework(string url) { [...] } } so spring need define how going executed. example: <task:annotation-driven /> <task:executor id="executor" pool-size="5-10" queue-capacity="100"/> this way when call service.dosomework("parameter") call put queue of executor called asynchronously. useful tasks executed concurren

How to manage restricted profiles in android app? -

restricted profile available in android 4.3, came know apps camera, gmail etc not available in these kind of profiles. how can manage these type of conditions in app? how manage in app products , restricted profile settings in corresponding app? thanks user370305 if visited http://developer.android.com/about/versions/android-4.3.html#restrictedprofiles i improve reference https://www.youtube.com/watch?v=pducannm72o restricted profiles new feature introduced in android jelly bean 4.3 enables give users of applications improved control when sharing tablet. these restricted profiles share apps, google account of primary user account in restricted manner.they dont access gmail, play store, calender etc. primary user can select restrictions each applications. usermanager class extended managing these restrictions usermanager.getuserrestrictions returns user-wide restrictions imposed on user specified usermanager.getapplicationrestrictions returns bundle

jquery - filter img src to remove file in directory, How to cut the array remove file in php -

i have html structure below, random div tag , img tag, , these store in database too. have filter img src in below string, remove files not in structure store in directory, whats best way src in structure in frontend use jquery or server side use php. suggestion how this? much!! in frontend <div class="h1">content<div> <div class="h1" style="">content</div> <div class="h1" style="">...</div> <div class="h2">...</div> <div class="h1" style="">content</div> <img src="u_img/5/1.png" style="" class=""> <div class="link" style="">link: http://...</div> <img src="u_img/5/14.jpeg" style="" class=""> <div class="h1" style=""..</div> <img src="u_img/5/3.png" style="" class="">

postgresql delete role with similar names -

i have created roles similar names abc_ number varies abc_ stays same. can see roles following query select * pg_roles rolname 'abc_%'; but don't know how drop role similar name. have got following query takes full name. drop role name; i trying dropping psql , not writing functions. there query to drop roles can have 'abc_%'? without using dynamic sql of sort, no, can't that. simple example using dynamic sql drop roles: select 'drop role ' || rolname || ';' pg_roles rolname 'abc_%'; if unwilling paste results psql session, can pipe 1 session another. psql -d yourdb -u youruser -qtac "select 'drop role ' || rolname || ';' pg_roles rolname 'abc_%'" | psql -d yourdb -u youruser

javascript - Adding series dynamically in highcharts -

(function($){ $(function () { $(document).ready(function() { highcharts.setoptions({ global: { useutc: false } }); var i=0; var chart = new highcharts.chart({ chart: { type: 'spline', renderto: 'container', animation: highcharts.svg, // don't animate in old ie marginright: 10, events: { load: function() { // set updating of chart each second var series = this.series[0]; setinterval(function() { var name = new array(); name[0] = "random data"; name[1] = "volvo"; var length=chart.series.length; var flag=0; var index=0; var x = (new date()).gettime(), // current time y = math.random(); (var k=0;k<name.length;k++) { for

ios - What is the reason behind my App rejection by AppStore? -

my app has been rejected again (for forth time) because of following reason: 22.1: apps must comply legal requirements in location made available users. developer's obligation understand , conform local laws my app simple , free mobile banking application provides simple banking services such balance inquiry, mini-statement, bill payment, etc. bank customers of bank in middle east. there no purchasing or money transferring services in app. i've called appstore review team several times, repeat mentioned reason , did not provide me more detailed reasons. could kindly guide me issue? how can resolve app? edit 1: seems far use cryptography in app, , regarding fact due usa regulations, sending encrypted data outside usa without license in conflict laws, appstore has rejected app. if publish app on appstores outside usa? have same regulation well? edit 2: far apps registered in different appstores kept in usa , users download them outside usa, apps regarded usa exp

Installshield 2010 - On upgrade check its already upgraded to certain version -

i'm updating installer (basic msi) program v5.00.0000. need installshield check if it's upgrade, must on @ least 4.00.0034. so if it's not installed, installs ok. if it's on 4.00.0020, must return message please upgrade v4.00.0034 first. thanks, ian. examine ispreventdowngrades action , major upgrade item finds newer versions, or read on how prevent downgrades. can copy approach, tweaking instead find , error out on ones less 4.0.34.

javascript - SmartGWT listgrid cell over shading behaving erratically -

i have listgrid in smartgwt , set base style set_basestyle enables appendign dark, on , selected suffixes i have overrired getcellstyle function each record , grab style generated gwt calling super method , append own suffixes class (since gwt not allow adding class element). i dark suffix correctly, there seems problem on suffix. not suffix when hover on records, magically starts appearing after click anywhere in browser or other action on grid such scrolling. does know why happens , can trigger on suffix appended correctly.

Ruby on Rails - Debug Purposes - Add file name (partial/view) to HTML output -

i learning spree ecommerce. although ask spree example, think useful elsewhere well. in spree have many views defined admin section. can override them via deface gem if know view need override. other deface can put physical file same route , rails use instead of 1 provided gem. either way, need know view need override. when in page/view, have many smaller partials making 1 whole page. my interest is, there way find section created partial. for example, thing like: <!-- /route/to/view.html.erb --> <div id="something"> <!-- other html --> </div> <!-- end of /route/to/view.html.erb --> i hope got point, maker know specific html segment generated specific view/partial. so way, can know/debug easily. thank, appreciate can give. you should try xray , i'm using spree , works fine.

Is it possible to pause an iframe? (All scripts/css-animations stop) -

take @ pens on codepen: http://codepen.io/ after few seconds stop. if inspect elements you'll see in fact real iframes, somehow manage "pause" them. how made? it's done loaded content, see source of http://codepen.io/rafaelcastrocouto/full/pfxat (the iframe path of first one).

jasper reports - Error Executing SQL Statement:data -

i'm new jasperreports . i'm using ireport 5.1.0 , i'm trying fetch data tables done when try fetch of columns when try fetch whole columns(complete table) not generate preview when view in design, gone editor , checked there error in executing query error:net.sf.jasperreports.engine.jrexception:error executing sql statement:data my template: <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="test5" language="groovy" pagewidth="595" pageheight="842" columnwidth="555" leftmargin="20" rightmargin="20" topmargin="20" bottommargin="20" uuid="c0460b6f-54ff-4c1b-8166-84

customization - What approaches exist for personal configuration in a Rails project? -

consider have typical rails project under git repository. want personal tweaks configuration or code base (e.g. simplify debugging). don't want work when switching, merging or pulling git branches. don't want affect other developers either. approaches use (or can suggest) that? my approach following: create file (let personal_initializer.rb ) in config/intializers/ directory in ~/.gitconfig define [core] excludesfile = ~/.excludesfile in ~/.excludesfile add config/intializers/personal_initializer.rb do hacks , tweaks in personal_initializer i add development.rb file .gitignore , create development.example.rb development.rb contain personal configuration, , wont pushed other devs local sources development.example.rb contain default configuration, when new dev pull sources must copy development.example.rb development.rb , tweak wish

c# - deserialize json into .net object using json.net -

i having problem deserializing json string .net objects. have container class contains information external , there field call classtype defined type of information , actual content in property, can anything, define object type. following .net class definition helps understand issue. class classone { public string name { get; set; } public int age { get; set; } } class classtwo { public string addressline { get; set; } public string addressline2 { get; set; } } class classthree { public string country { get; set; } public string passport { get; set; } } class containerclass { public string classtype { get; set; } public object classcontent { get; set; } } when getting information external in json format like: {"classtype":"class1","classcontent":{"name":"james","age":2}} i using newtonsoft json.net library deserialize json string. seems default deserialize function deserialize

python - What's wrong with the IF some words IN a string -

this question has answer here: compare multiple variables same value in “if” in python? 7 answers how check string specific characters? find link useful. what's wrong codes? string = "a17_b_c_s.txt" if ("m.txt" , "17") in string: print true else: print false and answer comes out true this because and evaluates 17 in stringlist . and evaluates 17 because of short circuiting. >>> "m.txt" , "17" '17' python evaluates non empty strings value true . hence, m.txt evaluates true , value of expression depends on second value returned( 17 ) , found in stringlist . (why? when and performed true value, value of expression depends on second value, if it's false , value of expression false , else, it's true .) you need change expression if "m.txt" in str

java - Error on initialization of server mk-worker -

i trying execute wordcount example using storm-0.8.1 , zookeeper-3.3.3 in local mode using maven. but, everytime run command getting following error: mvn exec:java -dexec.mainclass="com.test.newpackage.topologymain" dexec.args="resource/words.txt " i searched , found earlier using zookeeper 3.4.5. so, changed zookeeper 3.3.3. still not able execute. if wants reference of code here link info com.netflix.curator.framework.imps.curatorframeworkimpl - starting 3706 [nioservercxn.factory:0.0.0.0/0.0.0.0:2001] warn org.apache.zookeeper.server.nioservercnxn - endofstreamexception: unable read additional data client sessionid 0x1401598b305000a, client has closed socket 3857 [thread-6] error backtype.storm.daemon.worker - error on initialization of server mk-worker java.lang.illegalargumentexception: not find component common null @ backtype.storm.utils.thrifttopologyutils.getcomponentcommon(thrifttopologyutils.java:39) @ backtype

php - open a div having id using onclick in a hyperlink -

below given div having id "panel" , links in same page outside div, when click on link div should open. there several links jquery not work , button created dynamically through php while loop hence cannot put unique id in hyperlink <div id="panel"> <form name="userloginform" action="xxx.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="tb"> <tr> <td align="left" valign="middle" height="80">user name</td> <td align="left" valign="middle">:&nbsp;</td> <td align="left" valign="middle"><input name="user" type="text" class="log"/></td> </tr> <tr> <td align="left" valign="middle">passw

Is it posibble to use django-crispy-form FormHelper without modifying Form class -

for sake of consistency want use crispy login form. i'm using 'django.contrib.auth.views.login' , i'm coding template. the problem {% crispy form %} doesn’t output submit button nor "next" hidden field. is there way create formhelper outside of forms.py ( it's in contrib.auth need try extend authenticationform or it) use in template without modifying views.py (also in contrib.auth) if require ninjitsu extending classes etc. go pure html if there simple way include 'external' formhelper on template level regret not asking i'm not sure why need use {% crispy form %} , not crispy filter. i'm using crispy in login form, overriding template django.contrib.auth, way: {% load crispy_forms_tags %} {% block body %} <form method="post" action="" class="form-signin">{% csrf_token %} {{ form|crispy }} <div> <button type="submit" class="btn btn-primary

casting - C++ What's the named cast equivalent -

what's named cast equivalent following old-style cast? const string *ps; void *pv; pv = (void*)ps; // <--- is pv = static_cast<void*>(const_cast<string*>(ps)); ? pv = const_cast<string *>(ps); is enough - void * implicitly assignable from (non-qualified) data (object) pointer type. (of course, same reason, direct assignment const void * without casting work.)

c# - Linking credential-based authentication information with OAuth -

i implementing proof-of-concept site can optionally linked external provider. external provider used additional user data. provider conveniently exposes authentication oauth 1.0a. to data, user authenticates on provider site , grant permission. easy. the site uses servicestack. users register , login using credentialsauthprovider . have looked @ docs on servicestack, explored socialboostrapapi demo, , modeled services accordingly; first, added user class, serialized db, hold additional data. then, created customusersession, override onauthenticated method. plugins.add(new authfeature(() => new customusersession(), new iauthprovider[] { new credentialsauthprovider() })); my onauthenticated method similar 1 in socialboostrapapi demo; walks through session.provideroauthaccess , gets necessary info out of them (looking oauthtokens of "externalprovider" provider). of course, means when user gives authorization app on external provider,

html - Show content when hovering over DIV -

is possible show content when hovering on div. see image when hover on div, transition takes place, possible show content inside hovering div, ie. images etc html : <div class="flowingdown"> </div> css3 : .flowingdown { width:1045px; background-image:url(images/vertical_cloth.png); height:50px; float:left; margin-top:2px; margin-bottom:2px; border-radius:0 0 55px 55px ; transition: height 1s; -webkit-transition: height 1s; } .flowingdown:hover { height:100px; } assume have following markup: <div id="parent"> content <div id="hover-content"> show when hovering parent </div> </div> the css: #hover-content { display:none; } #parent:hover #hover-content { display:block; } this should trick. not sure how you'd transitions, you'd have put same selector @ least. example

php - Compare two multidimensional Associative arrays -

i've been trying hours now. have 2 multidimensional arrays. $newdata ( [0] => array( [id] => 1 [name] => john [sex] => male ) [1] => array( [id] => 2 [name] => kenny [sex] => male ) [2] => array( [id] => 3 [name] => sarah [sex] => female ) [3] => array( [id] => 4 [name] => george [sex] => male ) ) $olddata ( [0] => array( [id] => 3 [name] => sarah [sex] => female ) [1] => array( [id] => 4 [name] => george [sex] => male ) [2] => array( [id] => 5 [name] => peter [sex] => male ) [3] => array( [id] => 6 [name] => lexi [sex] => female ) ) if name in $olddata matched $newdata need fetch id of array without using more loops you want use array_search() which can return key of array find match in. eg $key = array_search('$array1['name']', $array2);

java - How can I know how many concurrent flows are currently active -

does spring-webflow provide way of getting know number of flows executing ? i work around global bean, maybe webflow provides solution out-of-the-box. edit: requested, here called "global bean" solution based on flowexecutionlisteneradapter package your.package; import org.apache.log4j.logger; import org.springframework.webflow.core.collection.attributemap; import org.springframework.webflow.definition.statedefinition; import org.springframework.webflow.definition.transitiondefinition; import org.springframework.webflow.execution.flowexecutionlisteneradapter; import org.springframework.webflow.execution.flowsession; import org.springframework.webflow.execution.requestcontext; public class flowexecutionlistener extends flowexecutionlisteneradapter { private static logger logger = logger.getlogger(flowexecutionlistener.class); private int sessioncount = 0; @override public void sessionstarted(final requestcontext contex

jquery ui - ui Datepicker - Format the Date after selection -

i running ajax call places available date. i can date comfortably following code : $('.booking-date').datepicker( { beforeshowday: enableallthesedays, numberofmonths: 2, dateformat: 'dd, d mm, yy', showbuttonpanel: true, onselect: function(datetext, inst) { } } i know dateformat there, ideally want in nice neat format end user, produces : sunday, 28 july, 2013 if can switch dateformat datetext variable mysql friendly date better. hope can help cheers solved creating following : onselect: function() { var datetext = $.datepicker.formatdate("yy-mm-dd", $(this).datepicker("getdate")); $('.date_hidden').html(datetext); }

iphone - make object move from 1 point to another at a custom speed -

i made app there object moves towards moving point time - why didn't use animated function. problem made function: cgpoint center = self.im.center; // "i" cgpoint, im imageview. if (!cgpointequaltopoint(self.im.center, i)) { = (i.y-center.y)/(i.x-center.x); //y = a*x+b - linear function in math b = (center.y-(a*center.x)); if (i.y>center.y) { self.im.center = cgpointmake(((center.y+1)-b)/a, center.y+1); } else { self.im.center = cgpointmake(((center.y-1)-b)/a, center.y-1); } } the problem closer functions becoming straight horizontal line faster because change x axis means if add 1 y change x bigger means move faster.. if there way glad try if know other ways tell me! managed find different solution cgpoint center = self.im.center;//im = image view x = center.x;//starting point y = center.y;//starting point double distance = sqrtf(powf(i.x - x, 2) + powf(i.y - y, 2));// = cgpoint (ending point) float

javascript - onClick event is not triggering function -

i have following script attempts change color of div, when clicked, id of wrapper. have tried variations of what's below, can't see issue. on click event not trigger function. have tried changing background-color backgroundcolor, didn't make difference. know i'm using global variable here, please ignore part: var wrapper; function wrappercolortocoral () { wrapper.setattribute('style', 'background-color:lightcoral;'); } function wrappercolortogreen () { wrapper.setattribute('style', 'background-color:lightgreen;'); } function colorchange () { //if (wrapper.getattribute('style', 'background-color:lightcoral;') === true) { if (wrapper.style != 'background-color:lightgreen;') { wrappercolortogreen(); } else { wrappercolortocoral(); } } // init function function init () { wrapper = document.getelementbyid('wrapper'); wrapper.onclick = colorchange(); } win

emacs - ritz-nrepl with lein not working on osx -

i use ritz-nrepl debugging purposes within emacs. because fails lein ritz-nrepl did not go further emacs integration yet. exception in thread "main" com.sun.jdi.connect.vmstartexception: vm initialization failed for: ... the full stacktrace shown @ end of post. know exception around time , there potential fixes did not in case: a working nrepl-ritz setup? can't emacs + ritz-nrepl working on macintosh system . otherwise, nrepl et al. working fine on system. i'm using clojure 1.5.1 $> lein version leiningen 2.2.0 on java 1.7.0_25 java hotspot(tm) 64-bit server vm my ~/.lein/profiles.clj looks this: {:user {:plugins [[lein-ritz "0.7.0"]] :dependencies [[nrepl-inspect "0.3.0"] [org.clojure/tools.trace "0.7.5"] [ritz/ritz-nrepl-middleware "0.7.0"] [ritz/ritz-debugger "0.7.0"] [clojure-complete "0.2.3"]] :repl-options {:nrepl

time - Timestamped messages in Akka -

i have actor emits messages other actors. these messages contain timestamp comes system.currenttimemillis , therefore based on time of jvm emitting actor resides in. if remote actor on node - time not synchronized emitting actor - uses timestamp calculating e.g. duration based on system.currenttimemillis, results possibly not correct. are there helpers available in akka tackle such time-related problems , internal time actorsystem synchronized each actor, no matter if it's local or remote?

Remove .php from single file with .htaccess -

i know there hundreads of these questions, , i've went through each one, copied code , put link in, still redirects 404. having mind blank right now. want make example.com/web load example.com/web.php rewriteengine on rewritebase / rewriterule ^web$ /web.php errordocument 404 /404.php i figured out problem. don't know why, added options -multiviews above rewriteengine on , loads page fine answer below. try using below rule instead... rewriterule ^web/?$ web.php [nc] also rule optional slash @ end...so won't throw 404 if have url like http://www.domain.com/web or http://www.domain.com/web/

How to add a folder to your cmd's path? -

my current window of cmd displays this: c:\users\akshat> want include folder named 'python' located in c:\users\akshat\python cmd's path environment such searches entered file name in mentioned directory well. how do that? thanks, in advance. :) you have necessary steps here, careful not delete other folders or replace other characters: http://www.computerhope.com/issues/ch000549.htm by using echo %path% in cmd can see if folder has been appended @ end of path environment variable.

hibernate - Not allowed to create transaction on shared EntityManager - use Spring transactions or EJB CMT -

this post in continuation of jpa how value database after persist when execute following getting following exception, how can resolve this? not allowed create transaction on shared entitymanager - use spring transactions or ejb cmt daoimpl code public void create(project project) { entitymanager.persist(project); entitymanager.gettransaction().commit(); project = entitymanager.find(project.class, project.getprojectid()); entitymanager.refresh(project); system.out.println("id -- " + project.getprojectid()); system.out.println("no -- " + project.getprojectno()); } applicationcontext.xml <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemalocation="http

c - Expand __COUNTER__ macro once per source file -

i'm trying write macro expand __counter__ macro once per source file. understand how macros work expansion i'm having difficulty one. want expand __counter__ macro once @ top of file , each reference define not expand __counter__ it's next number. so want expand __counter__ single value , use 1 value consistently through current working source file. i can use features available c . the __counter__ extension (i suppose using compiler gcc family) restricted such use. difficulty if put macro, toto , not expanded @ definition @ use. each invocation of toto give rise new value of counter. in p99 have portable replacement this, achieves goal #include hackery. p99_fileid per file identifier, , p99_lineid id should unique lines in compilation unit (but use care). another alternative if need compile time constant , nothing in preprocessor use counter in enumeration constant. enum { toto_id = __count__, };

c# - System.DBNull to String error in excel -

i have own custom file type similar .csv except custom delimiters. delimiter comma (char)20 (looks square) , quotes (char)254 (looks þ). have created excel 2010 add-in in visual studio parse through document replaces custom delimiters commas , double-quotes in .csv format. the program creates new toolbar , button start process. works fine on documents not on others , if try twice in 1 instance of excel comes error "cannot implicitly convert type 'system.dbnull' 'string'" . because row.text property being read {} . now question causing row.text property read {} instead of text inside cell? why occur on documents not others though use same encoding? an example of in cell (note-the comma symbol won't print here): þitem_idþþbegdocþþenddocþþbegattþþendattþþparent_attachmentþþattachment_batesþþ etc. edit here code: public partial class thisaddin { office.commandbarbutton toolbarcommand; private void thisaddin_startup(object sen