Posts

Showing posts from January, 2013

javascript - How to select only one checkbox when data comes from database -

i want give permission user select 1 check box. $jsqla = mysql_query("select * products id='$product_id'") or die(mysql_error()); $jfeta = mysql_fetch_assoc($jsqla); $formats = explode(";", $jfeta['formats']); <div class=""> <?php foreach($formats $v){ ?> <label style="line-height: 1.25em;display: block;width: 100px;margin-right: 10px;float: left;"> <div class="fomat_buttons" style="border: 1px solid;border-radius: 9px;text-align: center;padding-top: 10px;padding-bottom:10px;padding-left: 3px;padding-right: 3px;border-color: #cccccc;font-family: 'ssemibold'; font-size: 13px; color: #44b7da;"> <input class="format_cheks" type="checkbox" value="<?php echo $v; ?>" style="visibility:hidden;"/> <span styl

selenium - getting error with chromedriver using RemoteWebdriver -

getting error: failed configuration: @beforemethod setup org.openqa.selenium.webdriverexception: path driver executable must set webdriver.chrome.driver system property; more information, see http://code.google.com/p/selenium/wiki/chromedriver . latest version can downloaded http://chromedriver.storage.googleapis.com/index.html my code : capability = desiredcapabilities.chrome(); capability.setbrowsername("chrome"); capability.setversion("38.0.2125.122 m"); string strchromepath = system.getproperty("user.dir") + "\\webdrivers\\chromedriver.exe"; system.setproperty("webdriver.chrome.driver", strchromepath); capability.setplatform(org.openqa.selenium.platform.any); return new remotewebdriver(new url("http://192.168.1.77:5555/wd/hub"), capability); on above code chromedriver self not getting invoked. then tried code: chromedriverservice chromeservice = new chromedriverservice.builder()

How to read many images in java without memory leak -

i need read many images process them 1 after another. @ first used io library read each image: file outputfile = new file(uri); bufferedimage imgbuff = imageio.read(outputfile); imgbuff.flush(); imgbuff = null; outputfile = null; however takes lot of memory , process crashes. after doing research found there many issues reading many images using java io library. used simple progam verify memory leak caused reading images using image http://tinyurl.com/ku3ff7w : import java.awt.image.bufferedimage; import java.io.file; import java.io.ioexception; import javax.imageio.imageio; import org.junit.test; public class memoryleaktest { static file outputfile = null; static bufferedimage imgbuff = null; public static void main(string args[]) { string uri = "/home/user/pictures/image.jpg"; outputfile = new file(uri); (int = 0; < 15000; i++) { outputfile = new file(uri); try { imgbuff = imageio.read(outputfile); } catch (io

jquery - How to know default position of the element? -

suppose of following html: <main class="main"> <div class="foo"></div> </main> .foo may anywhere in document not in above html. may this: <header class="header"> <div class="bar"></div> <div class="blah"> <div></div> <div></div> <div class="foo"></div> <div></div> </div> </header> so, shift .foo element footer : $('.foo').appendto('.footer') now, after time want rollback .foo element default position , place .foo there: $('.foo').appendto(????) //or, $('.foo').insertafter(????) //or, $('.foo').insertbefore(????) how should play this? if don't want hide original object , clone or want keep 1 instance of element, can add dummy hidden element after , then, hidden element , append div after

html - Full height input in td with bootstrap -

see http://jsbin.com/sawofo/2/edit . trying fill table cell input, using bootstrap's css, left gap can't rid of. my html snippet is: <table class="table table-bordered"> <tbody> <tr> <td class="with-input"><input class="form-control tall" type="text" value="text"></td> <td class="tall">xx</td> </tr> </tbody> </table> and css allows input stretch is: td { padding: 0px !important; } td.tall { height: 100px; } input.tall { margin: 0; height: 100% !important; display: inline-block; width: 100%; } but there still gap @ bottom of input can't rid of. appears have bootstrap setting * { box-sizing: border-box; } but can't figure out how reverse effect without removing bootstrap. if set td use content-box , height fine overflows horizontally next cell. add padding: 0; td { padding

jquery - Passing an PHP Array as variable into Flot Bar Chart -

Image
i trying implode php array variable flot bar chart. idea please ? what correct format flot data expects array of arrays ? someplot = null; $(function () { var data = $.map( <? php echo '['.implode(", ", $studentsage).']' ?> , function (val, idx) { return [[idx, val]]; }); var dataset = [{ label: "exams student age", data: data, color: "#5482ff" }]; var ticks = [ [0, "0-2"] ]; // expand each idx in data var options = { series: { bars: { show: true } }, bars: { align: "center", barwidth: 0.6, vertical: true, show: true }, xaxis: { axislabel: "exams student ages", axislabelusecanvas: true, axislabelfontsizepixels: 12, axislabelfontfamily: 'verdana, arial

bash - How can I change default root password on multi server -

how can change default root password (root's password provided via centos installation) on multi server after install new centos on servers. i can use ansible tool complete issue it's not work first time root password. how can achieve purpose. updated: don't want login each server change password. want change root password remote server via ssh , can complete @ least effort. solution: use ansible + below command easiest way change root pass on multi server. echo "newpass" | passwd root --stdin you try automate using expect. have used expect in past auto log in routers perform actions. expect scripts bit macros. can install expect sudo apt-get install expect or yum install expect you create expect script , run each of 100 servers (possibly via shell script). example basic expect script give idea of does: spawn ssh -l admin 123.111.123.11 match_max 100000 expect -ex "this system authorized use only.password:" send -- &qu

java - JavaFX TextField CSS -

Image
how create javafx textfield android textfield using javafx css ? for example : i have tried lots of fx css not achieved . here http://jsfiddle.net/qkm37/ css exist html input type not applicable in javafx scenebuilder . for example : /** not exist in javafx **/ -fx-border: none; -fx-background: bottom left linear-gradient(#a9a9a9, #a9a9a9) no-repeat, bottom center linear-gradient(#a9a9a9, #a9a9a9) repeat-x, bottom right linear-gradient(#a9a9a9, #a9a9a9) no-repeat; try in css file: .text-field { -fx-background-color: #a9a9a9 , white , white; -fx-background-insets: 0 -1 -1 -1, 0 0 0 0, 0 -1 3 -1; } .text-field:focused { -fx-background-color: #a9a9a9 , white , white; -fx-background-insets: 0 -1 -1 -1, 0 0 0 0, 0 -1 3 -1; }

c# - Revit API building: How to put drop down list in a dialog box? -

i using c# build api software called revit autodesk . i want show dialogue box shows drop down list , user can choose list. i initiated new object known taskdialog it shows me dialogue box , can't add dropdown list it. any help? you can't add dropdown list taskdialog. taskdialog class provided revit api, there aspects of can customized user. check revit api documentation see these are. if need construct dialog box has dropdown list, need create custom form yourself. accomplish trying do, should either winforms or wpf both user interface libraries part of .net framework. both compatible revit.

android caching image from sdcard -

i want image sdcard in listview item able show image want cache image have smooth scroll can please tell me how cache image sdcard got code show image drawable want sdcard import java.lang.ref.weakreference; import java.util.arraylist; import android.content.context; import android.content.res.resources; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.graphics.drawable.bitmapdrawable; import android.graphics.drawable.drawable; import android.os.asynctask; import android.util.lrucache; import android.view.view; import android.view.viewgroup; import android.widget.baseadapter; import android.widget.gridlayout.layoutparams; import android.widget.gridview; import android.widget.imageview; public class listadapter extends baseadapter { context context; arraylist<string> items; private lrucache<string, bitmap> mmemorycache; public listadapter(context context, arraylist<string> items) { this.context = co

java - Signing failure after editing jar file -

i did string changes "*.properties" file inside jar file. tried open application after change, following signing error: "could not verify signing in resource: ... xxx.jar". i'm new @ java, there way edit jnlp file , pass error? you can't edit jar file. can edit java project inside eclipse , after regenerate jar file.

javascript - Hello.js google credential not showing -

This summary is not available. Please click here to view the post.

Azure Virtual Machines stuck in Starting mode -

this morning found 5 of azure virtual machines stuck in starting mode. other vms working ok. i managed stop vms using azure command shell , start them again still stuck in starting mode no end in sight. it has been on 5 1/2 hours , still stuck in starting mode. i have contacted microsoft support taking hours respond :((( the azure status page doesn't show wrong in region. has else experiencing problem? we've had same issue , it's linked big issue azure having morning. the trick used in order instance running again is: 1. stop vms via powershell 2. change size of vm , (preferably d different hardware) 3. start vm we have people complaining rdp not working reboots fixed problem.

sql server - SQL owner chaining -

basically have front end application called adminprogram. in sql server have role called adminprogramusers. now role has permissions various sps , but, crucially, there no select permission on table. see or modify done through sps. now i've written new sp them. have had no choice use dynamic sql, constructing actual sql query in string variable called @finalquery , running execute @finalquery. now getting lot of user doesn't have access tables, needed either grant selects columns in question, solution won't work due internal politics. the other thing seem understand need use execute as somehow. have googled, i'm struggling right. and pre-emptively answer couple of questions, there no option use dynamic sql in sp displeasure, we're talking sql server 2005 , there no way of signing sps certificates (mainly dba flip nut @ prospect of complicated). so... think answer lies somewhere in execute ownership chaining... need know how it... assuming role avai

java - how to quit spring app during startup if certain condition meet? -

i have spring app listens on rabbitmq , processing message, when app runs, register on hub database note 1 instance running, during registering if instance running, need quit app without init rabbit connection/queue , listener, otherwise message wrongly consumed. how that, know there callback when init bean. should create bean , before init it, checking whether instance running, how make sure bean init before other beans? need init database source bean before checking bean, otherwise can't use database defined in configuration. <rabbit:connection-factory id="connectionfactory" host="localhost" username="guest" password="guest" /> <rabbit:admin id="containeradmin" connection-factory="connectionfactory" /> <rabbit:queue id="etlqueue" name="etlqueue" /> <rabbit:direct-exchange id="myexchange" name="etl"> <rabbit:bindings>

java - How to remove hash parameters from URL in GWT application -

for example have below url: http://server:port/?parameter#token;id=com.test;args=one&two&three here if want remove id , args url without reloading page how it. note:right doing below code , looking better option placerequest currentplacerequest = placemanager.getcurrentplacerequest(); final string counts= currentplacerequest.getparameter( "args", null ); string id = currentplacerequest.getparameter( "id", null ); string url = window.location.gethref(); if( counts!= null && !counts.isempty() ) { if( id!= null && !id.isempty() ) { string counts= ";" + "args" + "=" + counts; string urltoreplace = url.replace( counts, "" ); window.location.replace( urltoreplace ); } you can retrieve current token using history.gettoken , process , set using history.newite

python - Does virtualenv serve a purpose (in production) when using docker? -

for development use virtualenv have isolated development when comes dependencies. this question seems deploying python applications in virtualenv recommended. now we're starting use docker deployment. provides more isolated environment i'm questioning use of virtualenv inside docker container. in case of single application not think virtualenv has purpose docker provides isolation. in case multiple applications deployed on single docker container, think virtualenv has purpose applications can have conflicting dependencies. should virtualenv used when single application deployed in docker container? should docker contain multiple applications or 1 application per container? if so, should virtualenv used when deploying container multiple applications? virtualenv created long before docker. today, lean towards docker instead of virtualenv these reasons: virtualenv still means people consuming product need download eggs. docker, "known work". no

configuration - Storing encryption keys for desktop application(Email Client)[Duplication] -

there many articles on stack-overflow , security.stackexchange on storing encryption keys, still confused, that's why decided ask again here. basically, creating email client education purpose, in users can create account enter there email-id , password. looking secure way save information. i encrypting email-id , password and storing encryption key on user pc because don't want user type in password every time sends , email from reading have understood that, i need store encryption key in separate location, difficult find hacker, problem here application written in python , open source application, hacker can view source code , path of directory key stored. second solution can have master password used key, when user opens application first time after starting computer, application ask master password, can store key in ram. looking @ articles on internet on topic repetition, sill learning make applications , last 2 days going in loop no success. os: lin

angularjs - how to broadcast and emit events to other controllers in angular that have no parent-child relationship -

i trying hints post - working $scope.$emit , $scope.$on nothing seems work when controllers in no way related each other. that - and in ctrlb this: $rootscope.$broadcast('userhasloggedin', {}) and in ctrla listen so: $rootscope.$on('userhasloggedin, function(event, data){}); and no - ctrla never receives broadcasted event unless nest ctrlb div inside ctrla div any idea? it tough answer without knowing tried. please see plnkr: http://plnkr.co/edit/hyzworgeypllcmzndco2?p=preview i created 2 controllers, 1 sends text other: app.controller('ctrla', function($scope, $rootscope) { $scope.submit = function(){ $rootscope.$broadcast('userhasloggedin', $scope.input); } }); app.controller('ctrlb', function($scope) { $scope.$on('userhasloggedin', function(event, data){ $scope.data = data; }); $scope.data = 'nothing'; });

Android: make immediate calls -

i'm trying write app that, among other things, calls people. this, use following code: intent callintent = new intent(intent.action_call); callintent.setdata(uri.parse("tel:" + number)); callintent.addflags(intent.flag_activity_new_task); startactivity(callintent); the problem is: when run it, shows me dialog , need choose app want make call (skype/viber/dialer/etc.). how can make call using standard dialer (without dialog showing up)? the difference between intent.action_dial , intent.action_call first 1 allows user explicitly initiate call showing dialer ui. when using action_call , pop-up open , let choose dialer use. also, add permission on manifest: <uses-permission android:name="android.permission.call_phone" />

ios - +[UIPasteboard _accessibilityUseQuickSpeakPasteBoard]: unrecognized selector sent to class -

Image
i asked question on apple dev forum, still didn't answer. we expirience 100% ios 8 devices crash: +[uipasteboard _accessibilityusequickspeakpasteboard]: unrecognized selector sent class the stack trace is: thread : fatal exception: nsinvalidargumentexception 0 corefoundation 0x2889ec1f __exceptionpreprocess + 126 1 libobjc.a.dylib 0x36049c8b objc_exception_throw + 38 2 corefoundation 0x288a3f55 __cfexceptionproem 3 corefoundation 0x288a1def ___forwarding___ + 354 4 corefoundation 0x287d3df8 _cf_forwarding_prep_0 + 24 5 uiaccessibility 0x331fc157 +[uipasteboard_qsextras pasteboardwithname:create:] + 30 6 myapp 0x002eb507 -[tjeventoptimizer .cxx_destruct] 7 myapp 0x002eb28b -[tjeventoptimizer .cxx_destruct] 8 myapp 0x002f0c2b -[tjeventoptimizer .cxx_destruct] 9 myapp 0x00

cq5 - How to get the modified node lists before calling session.save()? -

is possible modified nodes list before calling session's save method? want know nodes modified or added, , right use inefficient way this: looping through 'content' path , calling these methods each node: node.ismodified() node.isnew() it looks bad solution, didn't find better 1 problem. thanks in advance! you can try using sql2 query nodes updated or modified since given timestamp for example nodes modified or created since 2014-10-27t14:00:00.801-08:00: select * [nt:base] s [jcr:lastmodified] > '2014-10-27t14:00:00.801-08:00' or [jcr:created] > '2014-10-27t14:00:00.801-08:00' note: performance vary based on returned dataset

mysql - PHP check if a certain number of rows are inserted one week before launch date in database -

first of all: i'm sorry if title vague (because is), have no idea how formulate question in 1 sentence... here's question: school project have build website can reservate special tours @ museum. if 8 or less reservations have been made 1 of these tours week before takes place, it's canceled. have no idea how accomplish this! i'm stuck @ checking if there 8 or less reservations week prior event. in database have 2 tables this: tours , tour_reservations. here's table structure clarify database setup i'm working with. tours http://imgur.com/nxkyval,lushmba tours_reservations http://imgur.com/nxkyval,lushmba#1 so, tour_id in tours_reservations linked t_id tours. want do, count rows 1 tour (tour_id) in tours_reservations table , see how many rows have been inserted 1 week before day field in tours table. i'm using mvc framework codeigniter. here's piece of code i've been playing with: controller public function check_sold_ticket() {

html - Divs intersecting and refusing to display side by side when 'floated' -

Image
i got purely css accordion work on number of webpages. wanted add 2 div elements above accordion , have them display side side. used float this, , moment did elements intersected so: i tried specify width of container (once trying percentages , once pixel values), no good. have awful feeling missing obvious and/or i've made coding busy , there's conflict. here's html: <div class="aboutus"> <div class="ac-container-info left"> <label>about politeia</label> <div class="verticalline"> lorem ipsum dolor sit amet, quas vocent impedit id duo. brute errem id mei, ignota regione principes ne has. dicit admodum ocurreret cum ea, eius neglegentur vix ei, soleat semper deterruisset duo. ut graeci aliquam interesset has. qui iusto signiferumque id, vel idque nonumes suscipiantur an. eu oblique tibique mei, no novum eruditi sea. </div> <div 'clear:both'>&nbsp;</div> <div class=

android - Returning a ListView from OnCreateView in a Fragment -

the following code makes app crash on start: public class listfragment extends fragment { listview list; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { listview view = (listview) inflater.inflate(r.layout.list_layout, container, false); view.setadapter(new myadapter(getactivity())); return view; } } however, code: public class listfragment extends fragment { listview list; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.list_layout, container, false); return view; } } runs fine, doesn't want, because doesn't show listview. can see reason why might happen? this log when run first code: 11-19 12:28:58.453 3244-3244/com.example.dan.myapplication e/androidruntime﹕

python - Pickling a trained classifier yields different results from the results obtained directly from a newly but identically trained classifier -

i'm trying pickle trained svm classifier scikit-learn library don't have train on , on again. when pass test data classifier loaded pickle, unusually high values accuracy, f measure, etc. if test data passed directly classifier not pickled, gives lower values. don't understand why pickling , unpickling classifier object changing way behaves. can please me out this? i'm doing this: from sklearn.externals import joblib joblib.dump(grid, 'grid_trained.pkl') here, grid trained classifier object. when unpickle it, acts different when directly used. there should not difference @andreasmueller stated, here's modified example http://scikit-learn.org/stable/tutorial/text_analytics/working_with_text_data.html#loading-the-20-newgroups-dataset using pickle : from sklearn.datasets import fetch_20newsgroups sklearn.feature_extraction.text import countvectorizer sklearn.feature_extraction.text import tfidftransformer sklearn.naive_bayes import mult

c++ - Starting with ViSP video grabber demo, when compile, multiple error LNK2001 and 2019 presented -

i'm learning visp tool inria, configuration vs2010 + visp 2.10 + opencv 2.4.8. firstly use c-make generate sln , compiling sln, got vispd.lib , visp/include/xxx.h; set include path , lib path , lib dependencies; when begin first demo open image (maily use vpimage.h), works well; however, here comes question , when use same configuration compile following code, comes out 144 errors!! chinese characters stands "unresolved external symbol" . #include <visp/vpdisplayopencv.h> #include <visp/vpopencvgrabber.h> #include <iostream> using namespace std; int main() { //#ifdef visp_have_opencv //try { vpimage<unsigned char> i; vpopencvgrabber g; g.open(i); std::cout<<"image size:"<<i.getwidth()<<" "<<i.getheight()<<std::endl; vpdisplayopencv d(i); while(1) { g.acquire(i); vpdisplay::display(i); vpdisplay::flush(i); if(vpdisplay::getclick(i

node.js - Consume a rest service? -

is there module abstract consuming web service away me. so can make synchronous call: var myobj = rest.getobjectfromurl('url') or that? do mean restful/http-based webservice? if http://nodejs.org/api/http.html#http_http_get_options_callback otherwise maybe https://github.com/vpulim/node-soap soap webservice. or else?

python - Greek nu (Tex) in matplotlib legend -

i'm plotting matplotlib.pyplot , trying use tex \nu letter in plot label. however, label='$b_\nu(\nu, t)$' , linebreak+u in plot legend, since \n interpreted new line. tried label='$b_{\nu}({\nu}, t)$' , give same result plus {} in output. how can nu work in legend?

angularjs - In Express.js with body-parser the value of request.body is undefined -

i'm having problem cannot diagnose. on server, have simple url handler using express.js: var express = require('express'); var app = express(); var bodyparser = require('body-parser'); var multer = require('multer'); app.configure(function() { app.use(app.router); app.use(bodyparser.json()); // see: http://expressjs.com/api.html#req.body app.use(bodyparser.urlencoded({ extended: true })); }); app.post('/submit', function (req, res) { console.log(req.body); }); on client side, there's form handled angular controller: $scope.submit = function () { // $http.post('/submit', $scope.data); // post request send data server $http({ method: 'post', url: '/submit', data: $scope.data }); console.log('post /submit ' + json.stringify($scope.data)); }; in browser's console fine: $scope.data valid; node.js responds console.log , expected, w

c# - How to set Spline chart 3d in .NET -

Image
i using chart component of .net framework 4.5 in c#. when fill component values not have same gap each other , set chartarea.area3dstyle.enable3d property true, there no impact on chart until equalize gaps between values in series. datapoint datapoint1 = new datapoint(0d, 20d); datapoint datapoint2 = new datapoint(1d, 30d); datapoint datapoint3 = new datapoint(200d, 50d); datapoint datapoint4 = new datapoint(300d, 20d); datapoint datapoint5 = new datapoint(400d, 0d); datapoint datapoint6 = new datapoint(500d, 30d); datapoint datapoint7 = new datapoint(600d, 10d); datapoint datapoint8 = new datapoint(700d, 10d); series1.points.add(datapoint1); series1.points.add(datapoint2); series1.points.add(datapoint3); series1.points.add(datapoint4); series1.points.add(datapoint5); series1.points.add(datapoint6); series1.points.add(datapoint7); series1.points.add(datapoint8); chartarea1.area3dstyle.enable3d = true; you can set various parameters here. 1 directly makes automtic

html - Move divs up from bottom in wrapper with css -

i have specific problem i'm stuck at. i have square, in there picture , text. need is, when box hovered, text, hidden, should appear bottom , push image (overflow:hidden on wrapper cut off). text arbitrary length, , action should css-only (no javascript) the html is: <div class="wrapper"> <div class="image"><img src="http://placehold.it/200x200" /></div> <div class="content">lorem ipsum dummy text of printing , typesetting industry. lorem ipsum has been industry's standard dummy text ever since 1500s,</div> </div> and css: .wrapper { width:200px; height:200px; border: 1px solid red; overflow:hidden; } .content { height:0; overflow:hidden; transition: 0.5s ease; } .wrapper:hover .content { height:auto; } (this sample) here jsfiddle of it: http://jsfiddle.net/a136ddj8/2/ (if not see on hover, remove overflow:hidden wrapper class)

c# - Unity lerp doesn't lerp, it just moves immediately -

Image
i cannot life of me figure 1 out. exact code works correctly camera.main object. door needs lerp when activated external switch, reason no matter value put in there jumps up, doesn't move prefer. code placed in void update() block, ideas? doing wrong, misunderstanding use of lerp ? private transform objtransform = null; public bool isdooropen = false; private vector3 posdoorstart; public vector3 posdoorend; public float doorsmoothing = 2.0f; // use initialization void start () { objtransform = transform; posdoorstart = transform.position; } void update() { if (isdooropen) { float smoothing = doorsmoothing; // tried this... // float smoothing = doorsmoothing * time.deltatime; transform.position = vector3.lerp(posdoorstart, posdoorend, smoothing); } } transform starting values: gate script values: also, on occasion if set lerp low, in example, partially moves location want. has hit around 1.5 before it'll go wa

javascript - Script error in line 0 on a JS environment -

i've got problem js code. have construct alarm clock objects, doesn't work, seems me fine. here is: function alarmclock(){ this.hour; this.minutes; this.hours=[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; this.currenttime= function(h, m){ this.hour=h; this.minutes=m; if (this.hour>23){ this.hour=0; } if(this.minutes>59){ this.minutes=0; } } this.alarm= function(h, m){ this.hour=h; this.minutes=m; if(this.hour>23){ this.hour=0; } if(this.minutes>59){ this.minutes=0; } } this.tic= function(){ var i=0; while(i<=m){ m.currenttime+=i; if(m.currenttime==60){ h.currenttime+=1; } if (h.currenttime==24){ h.currenttime=0; } if(((h.currenttime)&&(m.currenttime))==((h.alarm)&

javascript - Cannot use getActiveObject() in Fabric.js -

i want check image quality of selected image on canvas. my following code: var canvas = $(".canvas-container").children('canvas').get(0); //console.log(canvas.getactiveobject().get('type')); console.log(canvas); the getactiveobject() log gives error: undefined not function. the other log returns: <canvas class="lower-canvas" width="850" height="230" style="position: absolute; width: 850px; height: 230px; left: 0px; top: 0px; -webkit-user-select: none;"></canvas> the canvas created in js file: //create fabric stage var canvas = $productstage.children('canvas').get(0); stage = new fabric.canvas(canvas, { selection: false, hovercursor: 'pointer', rotationcursor: 'default', controlsaboveoverlay: true, centeredscaling: true }); what must change can use can use canvas.getactiveobje

javascript - Asp.net Hyperlink not working fine -

i have asp.net hyperlink im assigning navigation url @ run time. working fine actually, problem that, doesn't show hand icon when mouse over. below script. please missing? this code added on page load of page. want see hand icon on mouse on not showing.. link1.attributes.add("onclick", "window.open('/viewfleetterminal?id=" + request.querystring["id"].tostring() + "', 'window','height=600,width=820,top=50,left=50,toolbar=yes,scrollbars=yes,resizable=yes');return true"); <asp:hyperlink id="link1" runat="server" target="_blank">[link1]</asp:hyperlink> check css isn't overriding cursor. if add rule like a { cursor: pointer; } that should make cursor hand when hover on link.

bdd - Given-When-Then with multiple possible Thens? -

i discovered concept of bdd , i'm trying understand how write user stories right way. suppose need test application against external state may not possible stipulate via given , such instead of single then might have multiple: given [state] when [some action] , [some other action] [outcome a] , [outcome a'] or [outcome b] , [outcome b'] is reasonable story tell in bdd? in case, a , b both reasonable, expected outcomes given state , actions, , acceptable outcomes. if system has non-deterministic behaviour, appropriate. however, computer systems have deterministic behaviour, if you're developing software (rather using bdd on, say, human system of interaction), want specify more precisely. you can mock out or write own stubs context in givens. instance, in tetris game used develop jbehave, replaced random seed used in real game known seed purposes of scenario. able add lines like: given our current shape "t" , next shape &q

Is it possibility to alert the users as soon as the data is changed by another user (or process) on Oracle forms? -

i have oracle form many database data-blocks on it. sometimes, users open form , start entering data. meanwhile, process automatically run , updates values in tables. in cases user on form changes data , commits changes. these changes not visible users have form opened. when press "save" button, receive message says data has been changed user , have refresh data (due using dalyed locking mode). i wonder if have possibility alert users data changed user (or process). our process has first priority, therefore, don't want lock row first user started work on it. does have novel idea?! many in advance!

javascript - Is there a way to prevent alternate characters from being inserted by OSX's Long Press character menu? -

Image
i'm working on structured input class in javascript handles keydown/keypress events ensure types of input allowed in fields (for example, number cannot inserted alphabetic-only field). structured input throw out invalid characters before make input field. i discovered on osx, if hold down keys short interval, you're presented popup menu of alternate options key (like long-pressing u key presents options û , ü , etc). if choose 1 of these options popup menu , you're focused on input field being watched structured input class, character inserted field regardless of whether or not character valid. from can tell, happening because os adding character , not triggering normal javascript events expect fire when keying in text ( keydown , keypress , keyup ). however, input , change events fired. considered listening input event remove these non-standard characters, since character entered not included inside input event (there no e.which , e.keycode , e.charcode ),