Posts

Showing posts from June, 2010

javascript - AngularJS: Error when injecting $modal inside a controller that is nested inside of a directive -

we have custom directive generates html around checkbox. uses transclusion inject contents passed within it. looks this: somecheckbox.js angular.module('namespace.directives') .directive('somecheckbox', function() { return { templateurl: 'directives/checkbox.html'; restrict: 'e', transclude: true } }]); directives/checkbox.html <label class="styling" ng-transclude> ... other html </label> we extensively use modals throughout our application , in process of converting bootstrap's angular directive. we've created controller handles particular type of modal appears sporadically throughout out application: angular.module('namespace.controllers').controller('legalmodalcontroller', ['$scope', '$modal', function($scope, $modal) { $scope.showlegalmodal = function(title, legaltextlocation) { $modal.open({ templateurl: 'modals/legal.html',

wordpress - Using PHP inside a shortcode inside PHP... syntax issue -

ok, i'm ok php not expert. what's correct syntax here? i'm trying pull in advanced custom field data inside php, inside shortcode. i have acf field called: the_sub_field("google_doc_key") <div><?php echo do_shortcode("[gdoc key='https://docs.google.com/spreadsheets/d/"'. the_sub_field("google_doc_key") .'"/edit' gid='0']"); ?></div> somethings not right here... appreciated. <div><?php echo do_shortcode("[gdoc key='https://docs.google.com/spreadsheets/d/'". the_sub_field("google_doc_key") ."'/edit' gid='0']"); ?></div> try that, had ' , " mixed before the_sub_field

java - need to deploy web app on server -

i need write web app scratch date picker allows user select date , queries database according thee input provided user , displays results. deployed on companies web servers(they have various apps on server). however, have no idea start have never written web app before. need local test , prod environment set up. should start, needs included in classpath. how install build tools , configure them?eventually more people work on enhancing app first need set , deployed on prod. written in java. cant comment due low reputation, have post suggestion answer. as jonk posted, site specific code problems, i'd suggest looking few things, might task. choosing various possibilities, tricky thing, , if ware you, ask @ work more common there, problems in development near ;) spring framework quite popular , find plenty tutorials it jsf interesting one, , if choose one, @ so, can answers provided user balusc. 1 said me, if balus has written something, said ;) struts not i&#

android - Set Views from TextViews/Layouts? -

is possible set view of view taking data created layout? for example: i have layout file test_layout.xml <textview android:id="@+id/textview1" android:text="textview1" android:background="@color/wisteria" android:layout_width="fill_parent" android:layout_height="wrap_content"/> i want create new view being created out of textview. if creating new view out of drawable do: imageview.setimageresource(r.drawable.shape1); how create new view, including all attributes in textview1? want create new view out of existing textview. textview above acts "template". should setviewbyid ? i hope made myself clear, little hard describe. just use layoutinflater , inflate resource again. layoutinflater inflater = layoutinflater.from(context); view v1 = inflater.inflate(r.layout.test_layout, null); view v2 = inflater.inflate(r.layout.test_layout, null); ...

ios - UIPageViewController displays pages out of order and never calls viewControllerBeforeViewController -

i have uipageviewcontroller , implemented 2 optional methods on data source automatic uipagecontrol. i have following helper methods convert between indices , view controllers. - (uiviewcontroller *)viewcontrollerforindex:(nsinteger)index; - (nsinteger)indexfromviewcontroller:(uiviewcontroller *)viewcontroller; the first method creates new view controller, configures specific index, , stores index in retrievable location (i.e. 1 accessed second method). i instantiate page view controller following code: [pageviewcontroller setviewcontrollers:@[[self viewcontrollerforindex:0]] direction:uipageviewcontrollernavigationdirectionforward animated:no completion:nil]; and here data source methods: - (uiviewcontroller *)pageviewcontroller:(uipageviewcontroller *)pageviewcontroller viewcontrollerbeforeviewcontroller:(uiviewcontroller *)viewcontroller { nsinteger currentindex = [self inde

html - bootstrap 3.0 responsive 5 images in one row -

i having problem bootstrap 3.0 making 5 images in 1 row , make responsive ? grid system based of 12 , how make 5 images , centered without spaces ? also there away can make when viewed on tablets or smartphones <480 px 2 images per raw? right shows 5 images under each other?? here code: <div class="row"> <div class="col-md-2"> <img class="img-responsive" src="/images/img1.jpg" /> </div> <div class="col-md-2"> <img class="img-responsive" src="/images/img2.jpg" /> </div> <div class="col-md-2"> <img class="img-responsive" src="/images/img3.jpg" /> </div> <div class="col-md-2"> <img class="img-responsive" src="/images/img4.jpg" /> </div> <div class="col-md-2"> <img class="img-responsive" src="/images/img4.jpg&quo

error with feed excel in drupal -

after installing feeds excel parser , feeds xls, error fatal error: require_once(): failed opening required 'sites/default/libraries/phpexcel/phpexcel/iofactory.php' (include_path='.;c:\xampp\php\pear') in c:\...\sites\all\modules\feeds_xls\feeds_xls.template.inc on line 34

password alphanumeric php without use regex -

i try this. for($i=0;$i<$length;i++) { if(!ctype_alpha($password[$i]) { header("location:regist.php?err=password not contain letter"); } else if(!is_numeric($password[$i])) { header("location:regist.php?err=password not contain numbers"); } else { //?? } } how validate password if password must alphanumeric without using regular expression ? i think looking ctype_alnum check- http://www.php.net/manual/en/function.ctype-alnum.php update- you can check special characters in string like- <?php $test = "password123"; $special_char = "#$%^&*()+=-[]';,./{}|:<>?~"; if (false === strpbrk($test, $special_char)) { echo "good password"; } ?>

python - How can I speed up this bit of code (loop/lists/tuple optimization)? -

i repeat following idiom again , again. read large file (sometimes, 1.2 million records!) , store output sqlite databse. putting stuff sqlite db seems fast. def readerfunction(recordsize, recordformat, connection, outputdirectory, outputfile, numobjects): insertstring = "insert node_disp_info(node, analysis, timestep, h1_translation, h2_translation, v_translation, h1_rotation, h2_rotation, v_rotation) values (?, ?, ?, ?, ?, ?, ?, ?, ?)" analysisnumber = int(outputpath[-3:]) outputfileobject = open(os.path.join(outputdirectory, outputfile), "rb") outputfileobject, numberofrecordsinfileobject = determinenumberofrecordsinfileobjectgivenrecordsize(recordsize, outputfileobject) numberofrecordsperobject = (numberofrecordsinfileobject//numberofobjects) loop1starttime = time.time() in range(numberofrecordsperobject ): processedrecords = [] loop2starttime = time.time() j in range(numberofobjects):

javascript - jQuery functions never getting executed on .ready() -

Image
i'm little new jquery , having issue wiring click events. if put alert(''); can see menu.js referenced when alert inside .ready() function alert never triggered... jsfiddle: click here could kind enough point out issue? thanks! html <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>menu demo</title> <link href="content/themes/base/minified/jquery-ui.min.css" rel="stylesheet" /> <link href="content/menudemo.css" rel="stylesheet" /> </head> <body> <div class="navbar"> <img id="navbar-logo" src="content/images/ingr_logo.png" class="ui-button-icon-primary"> <img id="navbar-logo" src="content/images/smaller.png" class="image-right"> </div> <div id="menu1" class="floating-menu ui-menu&qu

android - Easy Tracker issue -

i trying set context easytracker before using in on create method : context context= this; easytracker.getinstance().setcontext(context); but getinstance needing context , when call setcontext, becomes red-underlined saying "the method setcontext(context, parameterloader, servicemanager) in type easytracker not applicable arguments (context) ". i want set context easytracker track button clicks. there no need use setcontext here, follow google's tutorial : @override public void onstart() { super.onstart(); ... // rest of onstart() code. easytracker.getinstance(this).activitystart(this); // add method. } @override public void onstop() { super.onstop(); ... // rest of onstop() code. easytracker.getinstance(this).activitystop(this); // add method. }

php - preg_replace td in table -

i have in mysql stored html table. i need modify values ​​of td. for example: <tr>...<td class="(different classes)" name="mynamea">20</td>...</tr> <tr>...<td class="(different classes)" name="mynameb">10</td>...</tr> i need: <tr>...<td class="(different classes)" name="mynamea">(20 * 0,60)</td>...</tr> <tr>...<td class="(different classes)" name="mynameb">(10 * 0,60)</td>...</tr> thanks lot. here need :) $re = '/(<tr>(?:.*?)<td (?:.*?) name="mynamea">)(.*?)(<\/td>(?:.*?)<\/tr>)/'; $str = '<tr>...<td class="(different classes)" name="mynamea">20</td>...</tr>\n<tr>...<td class="(different classes)" name="mynameb">10</td>...</tr>'; preg_replace_callbac

javascript - ReferenceError: prettyPrint is not defined error -

hope can me referenceerror: prettyprint not defined . <a class="question helpcenterheading" href="http://www.google.com">how contact you?</a> <span class="answer">one moment...</span> <script> $(document).ready(function() { $("span.answer").hide(); $("a.question").click(function() { $(this).toggleclass("active").next().slidetoggle(2000, function() { window.location.href = $(this).attr('href'); }); return false; }); }); </script> ( live version ) according documentation there 2 ways run prettify: 1) auto-loader run_prettify.js . doesn't require call functions, can specify parameters in url. 2) serving own js , css, loading prettify.css , prettify.js . need use <body onload="prettyprint()"> . i think you're using auto-loader, , trying call prettyprint() . pick 1 or other method, can't

How to correctly pass a float from C# to C++ (dll) -

i'm getting huge differences when pass float c# c++. i'm passing dynamic float wich changes on time. debugger this: c++ lonvel -0.036019072 float c# lonvel -0.029392920 float i did set msvc++2010 floating point model /fp:fast should standard in .net if i'm not mistaken, didn't help. now can't give out code can show fraction of it. from c# side looks this: namespace example { public class wheel { public bool loging = true; #region members public intptr nativewheelobject; #endregion members public wheel() { this.nativewheelobject = sim.dll_wheel_add(); return; } #region wrapper methods public void setvelocity(float lonroadvelocity,float latroadvelocity { sim.dll_wheel_setvelocity(this.nativewheelobject, lonroadvelocity, latroadvelocity); } #endregion wrapper methods } intern

colors - getColor() method not found? Chess Game Help Java -

so i'm trying code chess program in java i'm having trouble getcolor() method. i'm relying on of code gridworld. i've created class each piece. want piece work critter gridworld in sense have method creates arraylist of possible locations choose when moving. i've hit problem. i've tried create getcolor() method, reason not working. asked teacher puzzled was. tried debugging don't see wrong it. exact error this: "cannot find symbol - method getcolor()" here's code, i'm using bluej record: import java.util.arraylist; import java.awt.color; public interface piece { public enum piecetype {pawn, rook, knight, bishop, queen, king} } next chesspiece abstract class. haven't worked on selectmovelocation method yet though: import java.util.arraylist; import java.awt.color; import info.gridworld.grid.location; import info.gridworld.grid.boundedgrid; public abstract class chesspiece implements piece { color colorofpiece;

google form submit script -

on form submit trying value of record number cell set in spreadsheet. getting incorrect values in confirmation message though logger displays right value. /** * gets list of responses , display recordnumber spreadsheet * */ function ticketnumberalert() { var form = formapp.getactiveform(); logger.log("form name " + form.getid() + " " + form.gettitle()); logger.log("form destination " + form.getdestinationid() + form.getdestinationtype()); var sheet = spreadsheetapp.openbyid(form.getdestinationid()); var lastrow = sheet.getlastrow(); logger.log("record number " + lastrow); var lastitem = sheet.getrange('i'+lastrow).getvalue(); var newrecnum = lastitem + 1; logger.log("last record number" + newrecnum); //form.setconfirmationmes

java - How to display text in LWJGL using version 3.2 or above -

i've been using lwjgl wiki learn how use library, , i've been setting lwjgl following (as per this tutorial ): pixelformat pixelformat = new pixelformat(); contextattribs contextattributes = new contextattribs(3, 2) .withforwardcompatible(true) .withprofilecore(true); display.settitle("title"); try { display.setfullscreen(true); display.setvsyncenabled(true); display.create(pixelformat, contextattributes); } catch(lwjglexception e) { e.printstacktrace(); } glviewport(0, 0, sizex, sizey); glclearcolor(0, 0, 0, 1); another tutorial explains how draw text. however, truetypefont deprecated replaced standard unicodefont. initialize , use this: unicodefont font = null; try { font = new unicodefont(font.createfont(font.truetype_font, new file("path/to/font.ttf")).derivefont(24))); } catch (fontformatexception | ioexception e)

Javascript variable scope within onload function -

this question has answer here: what scope of variables in javascript? 21 answers i had similar situation , curious why p not know b is, since p defined within same function b . var = "a"; window.onload = function() { var b = "b"; var p = new person(); p.doiknowaorb(); } function person() { this.name = "nate"; } person.prototype = function(){ var doiknowaorb = function() { console.log(a); console.log(b); }; return { "doiknowaorb": doiknowaorb } }(); you're accessing b outside function declared in. the local scope function-oriented. so in: window.onload = function() { var b = "b"; var p = new person(); p.doiknowaorb()' } b local variable anonymous (un-named) function connected onload. but inside function doiknowaorb in

html - Javascript Interval not repeating -

i have setinterval in html/javascript document. now, far aware, setinterval part typed out in document of mine, , works there. in interval not repeating every 1 second. runs once, stops. there blatant errors missing? <html> <head> <title>time</title> </head> <body> <p id="line-one" /> <p id="line-two" /> <p id="line-three" /> <p id="line-four" /> <p id="seconds" /> <script type='text/javascript'language='javascript'> var = new date(); var hour = now.gethours(); var minute = now.getminutes(); var second = now.getseconds(); var nintervid; function counter() { if (typeof(nintervid) != "undefined") { clearinterval(nintervid); } nintervid = setinterval(changeascii, 1000); } function changeascii() { document.getelementbyid("seconds").innerhtml = second; switch(second) { case 00:

ios - Undefined symbols for architecture armv7 error -

i've found unlock7 example project on github , i'm trying add blur (stackblur) background when music controllers shown,but have error when compile it: axel-4:/var/mobile/unlock7 root# make package install /var/mobile/unlock7/theos/makefiles/targets/darwin-arm/iphone.mk:43: targeting ios 4.0 , higher not supported iphone-gcc. forcing clang. /var/mobile/unlock7/theos/makefiles/targets/darwin-arm/iphone.mk:53: deploying ios 3.0 while building 6.0 generate armv7-only binaries. /var/mobile/unlock7/theos/makefiles/master/bundle.mk:17: warning: overriding commands target `unlock7' /var/mobile/unlock7/theos/makefiles/master/tweak.mk:20: warning: ignoring old commands target `unlock7' making tweak unlock7... make[2]: nothing done `internal-library-compile'. making bundle unlock7... copying resource directories bundle wrapper... linking bundle unlock7... undefined symbols architecture armv7: "_mshookmessageex", referenced from: _logoslocalinit() in t

javascript - python flask: How to handle send_file on the client side -

i generated excel file server-side in situ input given on client side using xlwt , stringio. send file client, s/he can save (ideally save dialog). i trying send_file , not javascript/jquery/ajax, not know how handle on client side. based on code below (gathered flask homepage), give me hint how there? thanks help! here's code: please note: js code triggered click event on button. works fine when passing json client server , back... python import stringio import wordpuzzle # code creates excel file @app.route('/_create_wordsearch') def create_wordsearch(): wordlist = json.loads(request.args.get('wordlist')) # create stringio object output = stringio.stringio() # instantiate puzzlegrid class p = wordpuzzle.puzzlegrid(wordlist) # create puzzle p.main() # create xls file in memory p.output2excel(output) # set start output.seek(0) # send client return send_file(output, mimetype='application/

c# - Linq to sql update does now work -

i'm trying update data database using linq. of other codes write in following method work expected update code @ marked line not work. no changes in database. have debugged , i'am getting values expected user. problem change expect in database. can problem ? private void addtocart() { fixbaydbdatacontext db = new fixbaydbdatacontext(); if (session["customerauthentication"] != null) { carttbl carttbl = new carttbl(); cartshoetbl cstbl = new cartshoetbl(); int cusid = convert.toint32(session["customerauthentication"]); int shoeid = convert.toint32(sizeddl.text); var idquery = c in db.carttbls.asqueryable() c.customerid == cusid select new{c.cartid,c.customerid}; var shoequery = s in db.shoetbls.asqueryable() join m in db.shoemodeltbls on s.modelid equals m.modelid

java - Passing & Adding two numbers using Parse Cloud code? -

ive got parse sdk set up, , "hello world!" function runs fine. im trying send 2 int's ( i1 & i2 ) , return sum. need know is: 1) how send variables 2) how receive them. changing hashmap hashmap<string,object> hashmap<integer,object> gives error parsecloud function (js) parse.cloud.define("add", function(request,response) { var inta = 1; var intb = 2; var intc = inta + intb; //var s = "hello add!"; //response.success(s); response.success(intc); }); android method, doaddition() s1 = et1.gettext().tostring(); s2 = et2.gettext().tostring(); i1 = integer.parseint(s1); i2 = integer.parseint(s2); parsecloud.callfunctioninbackground("add", new hashmap<integer, object>(), new functioncallback<integer>() { @override public void done(integer sum, parseexception e) { s3 = sum.tostring(); et3.settext(s3); } }); the ab

php - Remove and Override WooCommerce Process Registration action -

i'm developing plugin customise woocommerce registration , trying avoid direct editing of core files. i need override or replace process_registration action in woocommerces includes/class-wc-form-handler.php file through plugin. add_action( 'init', array( $this, 'process_registration' ) ); i tried following links, didn't work. also, files mentioned on pages doesn't exist on woocommerce current version. checked woocommerce documentation, seems don't have hook that. http://wordpress.org/support/topic/overriding-woocommerce_process_registration-in-child-theme-functionsphp woocommerce hooks: http://docs.woothemes.com/document/hooks/ i'd appreciate help! two options , considering wc method starts like: class wc_form_handler public function __construct() { add_action( 'init', array( $this, 'process_registration' ) ); } public function process_registration() { if ( ! empty( $_post['

504 - Gateway Timeout when using Azure CDN -

i started using azure , createad azure cdn https , querystrings enabled. when accessing images through http theres no issues both when accessing same image through https "504 - gateway timeout". try links below. first 1 through normal http works second 1 through https doesn't: http://az620855.vo.msecnd.net/profiles/user-cc667cfc-fc9a-4343-9a2f-90f5d3539c08/profile-c5c108a0-1a7c-46a3-b00a-5607f6458973.jpg?size=www-profilepicturesmall https://az620855.vo.msecnd.net/profiles/user-cc667cfc-fc9a-4343-9a2f-90f5d3539c08/profile-c5c108a0-1a7c-46a3-b00a-5607f6458973.jpg?size=www-profilepicturesmall any ideas why? my bad. found article http://azure.microsoft.com/en-us/documentation/articles/cloud-services-configure-ssl-certificate/ , uploaded certificate cloud service worked right away.

Rails 4 - has_many through fetching issue -

i have many many association wich being implemented rails has_many through shortcut. my models called: cliente statustransacaopagseguro historico they defined way: class statustransacaopagseguro < activerecord::base has_many :historicos has_many :clientes, through: :historicos end class cliente < activerecord::base has_many :historicos has_many :status_transacao_pag_seguros, through: :historicos end class historico < activerecord::base belongs_to :cliente belongs_to :status_transacao_pag_seguro end i have following historico record: #<historico id: 1, cliente_id: 3, status_transacao_pag_seguros_id: 3, created_at: "2014-06-01 19:44:42", updated_at: "2014-06-01 19:44:42"> when run historico.cliente i associated 'cliente' record, when run historico.status_transacao_pag_seguro i nil . where's problem? defined pluralization correctly? since names in portuguese language think there's problem don&

qt - How do I enable HiDPI (Retina) support in a Qt4 OpenGL application? -

i using qgraphicsscene qgraphicsview, described in this document ; intend overlay qt widgets on top of opengl rendered scene. when launch dummy application modeled after tutorial above, rendered view heavily pixelated-- hidpi isn't working @ all. per this document , i've manually added: <key>nshighresolutioncapable</key> <string>true</string> to application's info.plist file, still no effect. (it seems supposed default true anyway, maybe that's not surprising). beyond above, haven't found what's needed hidpi working. not using qtcreator, , qt install macports' qt4-mac . missing? qt5 enables hidpi opengl context, not widgets , qgraphicsitems. according this bug , support rendering widgets , qgraphicsitems on qglwidget in hidpi not yet supported; render @ standard res , resized. qgraphicsview render in hidpi if has ordinary qwidget it. if possible achieve desired effect using qgraphicsitems without opengl, may

ios - Animating uiview continously using Core Graphics in ios7 -

i creating game bubble shooter uiview object animate continuously based on screen touched. able animate uiview object based on touch event problem is, stops @ touch point clicked..i used uiview animation giving 1 sec animate ball. don't want stop ball @ point , want automatically go forward direction clicked , should take care of screen size ball (uiview) not go out of view.this code. -(void)touchesended:(nsset *)touches withevent:(uievent *)event { gametimer = [cadisplaylink displaylinkwithtarget:self selector:@selector(updatedisplay:)]; [gametimer addtorunloop:[nsrunloop currentrunloop]formode:nsdefaultrunloopmode]; } -(void) updatedisplay:(cadisplaylink*)sender { if (lasttime == 0.0) { // first time through, initialize lasttime lasttime = previoustimestampvalue; } else {

iphone - UITableView within UIScrollView surpassing bounds -

i've had growing headache last couple days. i'm trying add uitableviews scroll view, , page through respective tables (like twitter's app, example). use macros screen's frame can compatible 3.5 , 4 inch screens: #define screen_x 0 #define screen_y 0 #define screen_width [[uiscreen mainscreen] bounds].size.width #define screen_height self.view.bounds.size.height #define screen_frame cgrectmake(screen_x, screen_y, screen_width, screen_height) i make instance of uiscrollview so: scroll_view = [[uiscrollview alloc] initwithframe:screen_frame]; scroll_view.backgroundcolor = [uicolor clearcolor]; scroll_view.contentsize = cgsizemake(screen_width * 3, screen_height); scroll_view.bounds = screen_frame; scroll_view.maximumzoomscale = 1.0; scroll_view.minimumzoomscale = 1.0; scroll_view.delegate = self; scroll_view.bounces = false; scroll_view.scrollstotop = no; scroll_view.clipstobounds = true; scroll_view.pagingenabled = true; [self.view addsubview:scroll_view]; i m

postgresql - String field length in Postgres SQL -

i have string filed in sql database, representing url. url's short, , long. don't know waht's longest url might encounter, on safe side, i'll take large value, such 256 or 512. when define maximal string length (using sqlalchemy example): url_field = column(string(256)) does take space (storage) each row, if actual string shorter? i'm assuming has implementation details. i'm using postgresql, interested in sqlite, mysql also. usually database storage engines can many thing don't expect. basically, there 2 kinds of text fields, give hint go on internally. char , varchar. char give fixed field column , depending on options in sql session, may receive space filled strings or not. varchar text fields maximum length. varchar fields can stored pointer outside block, block keeps predictable size on queries - implementation detail , may vary db db.

linux - How do you extract only the CPU usage and the process names columns from top command? -

i want extract cpu usage column percentages , process names output of top command. redirecting output file , using that. output need below. %cpu command 6.2 xorg 6.2 gnome-terminal 6.2 top 0.0 init 0.0 kthreadd 0.0 ksoftirqd/0 0.0 kworker/0:0h 0.0 kworker/u:0h 0.0 migration/0 0.0 rcu_bh from command line or within top ? if you're in top , press f , toggle columns want see. alternatively, can use ps : ps -eo %cpu,pid --sort -%cpu

xpages FTsearch to excel not working for input fields being blank -

my xpage creating excel file is: <?xml version="1.0" encoding="utf-8"?> <xp:view xmlns:xp="http://www.ibm.com/xsp/core" rendered="false"> <xp:this.afterrenderresponse><![cdata[#{javascript: // conditions qstring = tmparray.join(" , ").trim(); sessionscope.querystring = qstring; myview.ftsearch(qstring); var vec:notesviewentrycollection = myview.getallentries() // code write // code </xp:view> what noticed: example if let input fields blank, excel file should contain documents saved in xpinc application, redirect me blank xpage : ( http:// domain /xb.nsf/export_hidden.xsp ). i use ftsearch modulo within button, search ( letting input fields blank ) expected, works: displays documents via viewpanel. i appreciate time. if search fields empty don't need execute ftsearch(). myview.getallentries() still work , return documents in view without calling ftsearch(). ... if (ct

javascript - Event when I assign a cell like source/target on a link? -

i use default links , want restrict source , target links because want links between rect(source) , circle(target) . i have tried link.on(change:source) , link.on(change:target) events don't launch when want. somebody knows solution problem? var defaultlinks = new joint.dia.link({ attrs: { '.marker-source': {transform: 'scale(0.001)' }, '.marker-target': {fill:'black', d: 'm 10 0 l 0 5 l 10 10 z' }, '.connection-wrap': { stroke: 'black' } }, smooth:true, path: [] }); defaultlinks.on('change:source',function(){ alert("change source") }); defaultlinks.on('change:target',function(){ alert("change source") }); this.paper = new joint.dia.paper({ el: this.paperscroller.el, width: 1200,

lucene - Could not lock IndexWriter isLocked [false] -

i try create index in couple of seconds , got this: [2014-06-02 14:10:14,414][warn ][index.engine.internal ] [shardicaprio] [myindex][0] not lock indexwriter islocked [false] and here full stack trace: org.apache.lucene.store.lockobtainfailedexception: lock obtain timed out: nativefslock@/var/lib/elasticsearch/data/shardicaprio/nodes/0/indices/myindex/0/index/write.lock @ org.apache.lucene.store.lock.obtain(lock.java:84) @ org.apache.lucene.index.indexwriter.<init>(indexwriter.java:702) @ org.elasticsearch.index.engine.internal.internalengine.createwriter(internalengine.java:1388) @ org.elasticsearch.index.engine.internal.internalengine.start(internalengine.java:256) @ org.elasticsearch.index.shard.service.internalindexshard.postrecovery(internalindexshard.java:684) @ org.elasticsearch.index.gateway.local.localindexshardgateway.recover(localindexshardgateway.java:158) @ org.elasticsearch.index.gateway.indexshard

c# - MVC. In some reason dynamic css style is empty -

Image
i'm trying apply dynamically generated css style. action returns style content. there simplified examples of code. controller code: public class maincontroller:controller{ ... [actionname("dynamicstyles.css")] public contentresult getstyle(){ response.contenttype = "text/css"; return content(".someclass{color: #0f0;}", "text/css"); } } _layout code ... <head> ... @styles.render("~/content/css") <link href='@url.action("dynamicstyles.css","main")' rel="stylesheet" type="text/css"/> </head> when request page there empty style. if make direct request httр://localhost/main/dynamicstyles.css - renders right style file. when watching tab html in firebug, can expand link , shows right style content: but css tab in firebug dynamicstyles.css empty. and no styles applied. what i'm doing wrong? additional in

jQuery Auto-Selecting an option in drop-down -

i trying auto-select option in drop down when specific image clicked, have made jsfiddle show current code, can point me in right direction? link: http://jsfiddle.net/cwtx6/ html: <img class="auto-image" data-name="01" style="cursor:pointer;" src="img/plaque/horses/01.png"> <select name="productoption[]" id="product-option-11" class="product-option product-option-select" data-force="0" data-title="image"> <option value="0" data-price="0">please select...</option> <option value="11::167" data-price="0.0000" data-modify="0">01</option> </select> js: $('.auto-image').on('click', function() { var search = $(this).data('name'); console.log('click being run, search has been varred as: ' + search); $('.product-option-select').find('opt

How to use AngularJs Inside the Scala template? -

i'm trying show image database. however, can't put angular variable inside @ sign of scala template. <div class="col-sm-6 col-md-3" ng-repeat="product in products"> <a href="#"> <div class="thumbnail"> <img class="img-responsive" ng-src="@routes.bookstore.getimage(product.name)"> ... </div> </a> </div> it gave error: can't find product variable . tried: <img class="img-responsive" ng-src="@routes.bookstore.getimage( {{ product.name }} )"> it still gave me same error. how can use angularjs variable inside scala template? you can not that's obvious - scala template processed @ backend side much, earlier arrives frontend. instead angular app should have method create string containing path image literally, /book-store/get-image/foo.jpg , add route routes file: get /book-s

android - How Long Does It Take For A Google Maps API Key To Become Active? -

how long take new google maps api key take become active? have added new key , new package existing key, neither seem work. issue key getting activated? you have enable api access services need https://code.google.com/apis/console/

jquery - scroll the page to show div position of page after post back -

i using following jquery scroll page specified div position while clicking on linkbutton. using linkbuttons on top of page , want page navigate on specified div @ bottom of page. $(function () { $('#<%=linkbtn1.clientid%>, #<%=linkbtn2.clientid%>, #<%=linkbtn3.clientid%>, #<%=linkbtn4.clientid%>').click(function () { $('html,body').animate({ scrolltop: $("#grddv").offset().top }, 800); }); return false; }); i using linkbutton events 4 linkbuttons below, performing suitable work. protected void linkbtn1_click(object sender, eventargs e) { try { session["interval"] = 1; bindgrid(id); } catch (exception ex) { } } the problem when linkbutton calls jquery scroll page required position, after that, when codebehind event called page goes server , when returns shows top position of page. i want use linkbutton's click event in each cas

validation - Parsing SOAP response message java -

i have following soap response message, need validate response code 1, if project import successful. how can using restassured , java? <?xml version="1.0" encoding="utf-8" standalone="yes"?> <env:envelope xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <env:header/> <env:body> <n1:importprojectresponse xmlns:n1=" text here......" xmlns:n2="..some text here...." xsi:type="n2:arrayofprojectimportresultcode"> <n2:projectimportresultcode> <n2:code>1</n2:code> <n2:message>project 'test1' import successful.</n2:message> </n2:projectimportresultcode> </n

java - static block inside static inner class -

we know static block in java resovled while compliling, not @ runtime. hence again know static inner class instantiated during first call nested class. suppose nested class having static block. so, in case can static block inside nested class resolved when first attempt access nested class made? sample code: public class { public static class b { static a; static { a=new a(); } public static geta() { return a; } } } now accessing as: a= a.b.getinstance(); hope @ point static block in b executed , not before that. this should answer question: public class test { public test() { system.out.println("test instantiated"); } public static class inner { static { system.out.println("static block executed"); } public inner() { system.out.println("test.inner instantiated"); } } } when calling: test test = new test(); test.inner inner = new

Url Route asp.net -

my model is public class organization { public int id { get; set; } public string url { get; set; } } and routeconfig routes.maproute( "url", "{controller}/{action}/{url}", new { controller = "organization", action = "pagecontent", url = "" } ); routes.maproute( name: "default", url: "{controller}/{action}/{id}", defaults: new { controller = "home", action = "index", id = urlparameter.optional } ); is there way fix routing both url , id work? example ...organization/details/{id} , ...organization/details/{url} both work as both routes seems same can combine both , define 1 , in action (or onactionexecuting) can decide behavior based id or url routes.maproute( name: "default", url: "{controller}/{action}/{segment}", defaults: new { controller = "

vba - Excel Visual Basic Application-defined or Object-defined error -

so have 2 excel worksheets in 1 workbook. there bigger 1 called "data" , smaller 1 called "sheet1." code below first creates new sheet called "dailyreport" , compare 2 sheets. if 1 cell column b of "sheet1" same 1 cell in column b of "data", should copy row in "data" new sheet "dailyreport." below code. macro. keeps saying "invalid procedure call or argument"error. sub dailyreportgenerator() sheets.add.name = "dailyreport" application.screenupdating = false dim startnumber integer dim endnumber integer dim startnumber2 integer endnumber = 9999 startnumber = 1 endnumber startnumber2 = 1 endnumber if worksheets("sheet1").cells(startnumber, "b").value = worksheets("data").cells(startnumber2, "b").value sheets("data").range(sheets("data").cells(startnumber, "b"), sheets("data").cells(startnumber,