Posts

Showing posts from January, 2015

python - dot routine for scipy.sparse matrices produces error -

i have csr matrix : >> print type(tfidf) <class 'scipy.sparse.csr.csr_matrix'> i want take dot product of 2 rows of csr matrix : >> v1 = tfidf.getrow(1) >> v2 = tfidf.getrow(2) >> print type(v1) <class 'scipy.sparse.csr.csr_matrix'> both v1 , v2 csr matrices. use dot subroutine: >> print v1.dot(v2) traceback (most recent call last): file "cosine.py", line 10, in <module> print v1.dot(v2) file "/usr/lib/python2.7/dist-packages/scipy/sparse/base.py", line 211, in dot return self * other file "/usr/lib/python2.7/dist-packages/scipy/sparse/base.py", line 246, in __mul__ raise valueerror('dimension mismatch') valueerror: dimension mismatch they rows of same matrix, dimentions ought match: >> print v1.shape (1, 4507) >> print v2.shape (1, 4507) why dot subroutine not work? thanks. to perform dot product of 2 row vectors, have

sql - MySQL Point in Polygon Queries and DB Setup -

i trying set table consists of regions polygon . want able query table find whether given point lies in of stored regions or not. i read mysql spatial extensions provide 2 types of functions operate geometries: st_* operating on object shapes mbr* operating on minimum bounding rectangles i tried following worked in this post . here's how set table: create table `region` ( `id` int(11) unsigned not null auto_increment, `name` varchar(50) not null, `rpolygon` polygon not null, primary key (`id`) ) engine=innodb default charset=utf8; i inserted few records in table after getting polygon definitions qgis. learned inserting spatial records table here . here's how inserted record in table set @g= st_geomfromtext('polygon ((-117.84293016891291472 33.64825334189644224, -117.8428418279120109 33.64599663087331294, -117.84048874488789238 33.64467151585973426, -117.84002294688312418 33.64517746886491523, -117.83983020288114574 33.64549067786812486, -117.8398141408

ios - Why isn't the parameter not passing as ViewController? -

Image
i trying pass viewcontroller parameter, keep getting error. not sure why error occuring. appreciated. class major: uiviewcontroller, uicollectionviewdelegate, uicollectionviewdatasource{ let initial = json.finddetailclass(self viewcontroller, predicate: predicate) } func finddetailclass(viewclass: major, @noescape predicate: json -> bool) -> json? { if predicate(self) { return self } else { if let subjson = (dictionary?.map { $0.1 } ?? array) { json in subjson { if let foundjson = json.findmultiple(viewclass uiviewcontroller //this error, predicate: predicate) { let shorten = foundjson["html"].stringvalue print(shorten) } } } } return nil } if wanna pass viewcontroller parameter, using type parameter type [anyobject]. anyobject likes id in objective-c. can understand type of object of pointer. func findd

html - Huge, unnecessary and mysterious scroll bar -

i'm looking website . , have no idea why has huge scroll. i'm try understand why or scroll created. the problem in div .nav-path-wrap has diplay:initial , on hover make position absolute , have space on page not visible. so need make display:none , on hover display:block css must : .left_menu .nav-path-wrap { background: url(../images/icons/icon_left_menu_arrow_l.png) no-repeat left 1em; padding-left: .7em; display: none; // edit initial none } .left_menu li:hover .nav-path-wrap { position: absolute; left: 12em; top: -.5em; height: 100px; display: block; // add line } note if edited .left_menu { overflow: hidden; } . sub menu .nav-path-wrap not visible on hover

if statement - If and Vlookup across range in Excel -

Image
essentially, need work out each unique id(column a), whether or not "y" exists in set range of cells unique id (column $d). id's there once (where use vlookup) other id's repeated different values in return column. ideally i'd output sheet output sheet. each id grouped (no duplicate id's). raw sheet output sheet please let me know if i've structured incorectly or other feedback. appreciated, sam in output sheet try countifs. first test count id in raw data, second check if there y's: =if(countifs( 'raw sheet'a:a, a1, 'raw sheet'!d:d,"y")>0, "y","n") countifs looks rows satisfy having both matched id in column , @ least 1 "y" in column d. if there 1 or more matches, if condition returns "y" otherwise "n". let me know if need removing duplicates raw data column a.

javascript - Jquery Validation and Messages -

i'm trying error message show when fields missing input. once both filled in want success message show in place of #error. not sure why i'm not getting message currently. $("input[type='button']").click(function() { $("form").validate({ rules: { username: "required" }, messages: { username: "please enter name" } }); alert("submitted"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script> <script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.15.0/jquery.validate.min.js"></script> <form> <p> <label for="username">username:</label> <input type="text" name="username" id="username"> </p> <p> <label for="pw">password:</label> <input type="

Ruby, STDIN, and Curses -

i'm trying take input stdin in same script i'm using curses . causes ruby exit , never draw curses on page. the following works fine: require 'curses' curses.init_screen begin curses.setpos(6, 3) # column 6, row 3 curses.addstr("hello") curses.getch # wait until user presses key. ensure curses.close_screen end but if run with, example ls | example.rb , fails immediately, if consume stdin stdin.read . i have tried stripping stdin.read , , tried solutions how test filter-like ruby scripts pry? no luck.

How to keep writing in batch file after I execute it -

so i'm learning how program using laravel php framework. noticed controllers , classes can created , there high interaction level framework using php artisan commands. decide create little batch script reads: cd:/xampp/htdocs/project php artisan make:controller pause as can see, php artisan missing controller name. need bat is: open bat file execute cd command go directory (which doing) input php artisan command not execute php artisan , keep waiting me finish command controller name or else crash , give me error after write controller name, press enter, execute php artisan command , create controller. all need program halt , ready, waiting input. you can batch file ask user input this: set /p input=enter controller name: and can use result in rest of batch file: php artisan make:controller %input% also, if don't want see each command it's executing, put @ top of batch file: @echo off

c# - Passing a list of objects between events in a single ASP.NET form from DevExpress -

so have website coded in c#, , when load form, loads several records database , populates grid view. 1 event button click button marked resend. method takes items in grid selected , resend them. if selected items don't follow particular set of rules form pops , says records must moved resend. user has option hit yes , move records or no , continue on business. i need pass list of selected items resend click yes click on separate form, issue popup , grid technically same form. can load , jazz, load event , of popup's code located in same form.cs grid. haven't been able make event handlers work. create custom eventargs class , store values in there, since 2 forms technically same, i'm not sure how transfer information properly. keep getting null reference exception when try access list of selected values yes click event. any suggestions should do? properties , variables haven't worked, leads me believe technically 2 different forms, don't know how work the

javascript - Find current client (websocket) -

i using following code save clients in array... var websocketserver = require('ws').server, wss = new websocketserver({port: 8080}), clients=[]; wss.on('connection', function(ws) { clients.push(ws); ws.on('message', function(message) { console.log('received: %s', message); findclient(message); }); ws.send("new user joined"); }); function findclient (message) { (var i=0; i<clients.length; i++) { //this i'm stuck if current client return } } i not know put inside loop find current client. want iterate through array, , if current client == 1 of client in array, want return index. i'm sure there simple way this, stuck. do findclient(ws) -- have ws (socket) belonging particular client bound closure of message event handler. findclient function becomes: function getclientindex(socket) { return clients.indexof(socket); }

jquery - Bootstrap dropdown-menu not working in Mac but works in windows -

i have simple dropdown-menu. works in windows machine not in mac. checked through few suggestions nothing seems work. tried various versions of bootstrap.js , jquery.js <li class="dropdown"><a href="#" class="dropdown-toggle" data-toggle="dropdown" style="border-radius: 5px !important;" id="logincheck">login</a> <ul id="login" class="dropdown-menu"> <li>some content</li> </ul> </li> here order of js , css files in html <script src="<c:url value="/angular.min.js"/>"></script> <script src="<c:url value="/angular-resource.min.js"/>"></script> <script src="<c:url value="/jquery.min.js"/>"></script> <script src="<c:url value="/bootstrap.min.js"/>"></script> <link rel="styles

ios - FIrebase 3 query to return value that matches child key/value -

i've upgraded ios application use firebase 3 , query working in firebase 2 no longer works in firebase 3. the old query written follow. firebaseuser.queryorderedbychild("displayname").queryequaltovalue(frienddisplayname) .observesingleeventoftype(.value, withblock: { snapshot in } where frienddisplayname have been 'someguy1' , have returned object someguy1 part of. now however, same query returns nothing on firebase 3. feeling because firebase 3 isn't looking inside child objects themselves, it's looking displayname actual child itself. if update query example returns expected. database.child("0hftq3cttfwnfvg0dmea1raypow2").queryequaltovalue("someguy1", childkey: "displayname").observesingleeventoftype(.value, withblock: { snapshot in } but won't work solution me because don't want have parse through child nodes , search through them etc.. way see 1 solution if firebase had 'catch all

javascript - Get undefined in req.body.id (body-parser and express 4) Nodejs -

Image
app.js: var express = require('express'); var path = require('path'); var bodyparser = require('body-parser'); var routes = require('./routes/index'); var person = require('./routes/person'); var app = express(); // view engine setup app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'pug'); app.use(bodyparser.json()); app.use(bodyparser.urlencoded({ extended: false })); app.use(express.static(path.join(__dirname, 'public'))); app.use('/', routes); app.use('/person', person); module.exports = app; routes/person.js: var express = require('express'); var bodyparser = require('body-parser'); var urlencodedparser = bodyparser.urlencoded({ extended: false }); var router = express.router(); /* page. */ router.get('/', function (req, res) { res.render('person', { message: 'person works' }); }); router.pos

mysql - sort calculation data to rank my data in php -

how can sort data give rate 5 stars, 4 stars, until 1 stars. this query function top5cust($tahun, $bulan) { if ($tahun == 'semua' && $bulan == 'semua'){ $data = $this->db->query("select nama_jalan, no_rumah, jarak, kelurahan, kecamatan, kota, count(*) freq t_cust group nama_jalan, no_rumah, jarak,kelurahan, kecamatan, kota order freq desc limit 5"); } else { $data = $this->db->query("select nama_jalan, no_rumah, jarak, kelurahan, kecamatan, kota, count(*) freq t_cust year(tgl_req) = $tahun , month(tgl_req) = $bulan group nama_jalan, no_rumah, jarak, jarak,kelurahan, kecamatan, kota order freq desc limit 5"); } return $data->result(); } and php code <table>

Rerouting custom routes when user is not authenticated (Devise, rails gem) -

i want reroute non-authenticated user login page, lets route http://localhost:3000/users/sign_in aka devise/sessions#new right default devise edit page when not logged in since built in. custom routes break app if you're not logged in since not apart of devise reroutes. how set these routes reroutes if not logged in? quoting directly devise below, i'm still @ loss on how implement routes, should code like? goes inside lib class customfailure < devise::failureapp def redirect_url new_user_session_url(:subdomain => 'secure') end # need override respond eliminate recall def respond if http_auth? http_auth else redirect end end end , add following in config/initializers/devise.rb: config.warden |manager| manager.failure_app = customfailure end goes inside initializers config.warden |manager| manager.failure_app = customfailure end you can try in routes.rb authen

android - UncaughtException: java.lang.IncompatibleClassChangeError -

my app working fine, when updated compile 'com.google.android.gms:play-services version 8.0 9.0 gives following exception. e/uncaughtexception: java.lang.incompatibleclasschangeerror: method 'java.io.file android.support.v4.content.contextcompat.getnobackupfilesdir(android.content.context)' expected of type virtual instead found of type direct (declaration of 'com.google.android.gms.iid.zzd' appears in /data/data/com.dp.needdepartmentalstore/files/instant-run/dex/slice-com.google.android.gms-play-services-iid-9.0.0_e1052c945fd50ca8f379bb7d2402b9b1cd0dcbb4-classes.dex) @ com.google.android.gms.iid.zzd.zzec(unknown source) @ com.google.android.gms.iid.zzd.<init>(unknown source) @ com.google.android.gms.iid.zzd.<init>(unknown source) @ com.google.android.gms.iid.instanceid.zza(unknown source) @ com.google.android.gms.iid.instanceid.getinstance(unknown source) @ com.google.android.gms.iid.instanceidlistenerservice.zzn(unknown source) @ com.google.and

sql - INT to Binary and then read bits -

i have int value in database, storing selected days of week. for example, 65 = 1000001 which mean: 1:sun 0:mon 0:tue 0:wed 0:thu 0:fri 1:sat so then, need land small temp table with: dayofweek: sunday saturday so, read int, , output table of days. can done in sql server? ; tbl ( select col = 65 union select col = 3 ) select * tbl t cross apply ( select dayofweek = 'sun' col & 64 = 64 union select dayofweek = 'mon' col & 32 = 32 union select dayofweek = 'tue' col & 16 = 16 union select dayofweek = 'wed' col & 8 = 8 union select dayofweek = 'thu' col & 4 = 4 union select dayofweek = 'fri' col & 2 = 2 union select dayofweek = 'sat' col & 1 = 1 ) d

Local notification except string in codenameone -

is possible send local notification other string? instance have slider component indicating download percentage. can show in local notification. localnotification n = new localnotification(); n.setid("download-notification"); getid = n.getid(); n.setalertbody("check notification"); //can send slider instead of string? n.setalerttitle("downloading"); it not possible @ moment, please file rfe in git project

Can C# WinForm static void Main NOT catching Exception? -

i have winform application written in c# put try-catch block in program.cs , in program entry, static void main method, right in beginning of application this: using system; using system.io; using system.windows.forms; namespace t5shortesttime { static class program { /// <summary> /// main entry point application. /// </summary> [stathread] static void main() { try { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new t5shortesttimeform()); } catch (exception e) { string errordir = path.combine(application.startuppath, "errorlog"); string errorlog = path.combine(errordir, datetime.now.tostring("yyyymmdd_hhmmss_fff") + ".txt"); if (!directory.exists(errordir)) directory.createdirectory(errordir);

unicode - how to convert ANSI to utf8 in java? -

this question has answer here: converting txt file ansi utf-8 programmatically 1 answer i have text file ansi encoding, have convert utf8 encoding. my text file stochastic programming area of mathematical programming studies how model decision problems under uncertainty. example, although decision might necessary @ given point in time, essential information might not available until later time. you can explicit java.nio.charset.charset class (windows-1252 proper name ansi): public static void main(string[] args) throws ioexception { path p = paths.get("file.txt"); bytebuffer bb = bytebuffer.wrap(files.readallbytes(p)); charbuffer cb = charset.forname("windows-1252").decode(bb); bb = charset.forname("utf-8").encode(cb); files.write(p, bb.array()); } or in 1 line if prefer =) files.write(paths.get("

selenium - Located a input field by Xpath method -

Image
i have question : there login page ( http://mail.126.com ). we have 2 input fields(username , password). want locate 2 input fields x-path method in selenium. me solution. edit : sharing inspect element screen elements : xpath - > //input[@name='email']

c# - WebAPI DI Framework that understands HttpContext.User -

i looking di framework can satisfy scenario: every controller has constructor this public thiscontroller( thatrepository repo) every repository has controller this: public thatrepository (datasource ds) there 1 master datasource, never passed repository. instead needs: masterdatasource.withuser ( httpcontext?.user?.identity?.name ) are there di frameworks webapi support out of box? i believe use every di container such purpose, registering current httpcontext (or current user identity ) inside container , injecting constructing datasource instance. here simple solution using httpcontext in simpleinjector (you may port code di framework like): container.register<httpcontextbase>(() => new httpcontextwrapper(httpcontext.current), lifestyle.scoped); container.register<datasource>(() => { var httpcontext = container.getinstance<httpcontextbase>(); return masterdatasource.withuser(httpcontext?.user?.iden

CodeIgniter allow hyphen in url? -

i have tried following, unfortunately not work: $route['request-guide'] = "request_guide"; in application/core created my_router.php, not working. <?php defined('basepath') || exit('no direct script access allowed'); class my_router extends ci_router { function _set_request ($seg = array()) { // str_replace() below goes through our segments // , replaces hyphens underscores making // possible use hyphens in controllers, folder names , // function names parent::_set_request(str_replace('-', '_', $seg)); } } ?> open file /application/config/routes.php , add following line in route array. $route['translate_uri_dashes'] = true; it automatically translate my_controller my-controller or in small letters.

scriptaculous - jQuery conflict with script.aculo.us -

i include jquery 1.10, script.aculo.us , prototype in same file. shows error: cannot call method 'click' of undefined i suspect due library conflict, did this: jquery(document).ready(function() {... and move script.aculo.us after other scripts. unfortunately shows: uncaught referenceerror: jquery not defined the solution in using jquery noconflict() script.aculo.us doesn't work me. my code {literal} <script src="include/js/jquery-1.10.2.js" type="text/javascript"></script> <script src="include/js/general.js" type="text/javascript"></script> <script> jquery(document).ready(function() { ... </script> <script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script> <script src="include/scriptaculous/scriptaculous.js" type="text/javascript&qu

I can't connect to sql server via asp.net from android -

i'm using ksoap2 libs in apps. there 3 webmethod in asp.net file. 1 methods sql server query, rests kinds of helloworld, adding 2 numbers. i checked asp worked in vs 2012. 3 methods worked well. problem when running android app, 2 methods working properly. method sql server throwing errors: 05-25 13:35:46.630 8269-8478/com.example.bruce.xmlwork w/system.err: soapfault - faultcode: 'soap:server' faultstring: 'server unable process request. ---> network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: tcp provider, error: 0 - access denied.) ---> access denied' faultactor: 'null' detail: org.kxml2.kdom.node@241d2389 05-25 13:35:46.630 8269-8478/com.example.bruce.xmlwork w/system.err: @ org.ksoap2.serialization.soapserializationenvelope.parsebody(soapserializat

odesk - Not Getting Job On upwork.com -

i applying jobs on upwork, not getting positive feedback clients. i want tips , sample cover letter, may doing wrong, why not getting job there you should search tips, find on upwork site. can https://www.upwork.com/blog/2008/09/writing-a-killer-cover-letter

html - Browser issues centering widgets (not text) in bootstrap panels -

i using angularjs , bootstrap3. proper procedure centering widgets within panel , obtaining responsive behavior? getting unique results in firefox. i have 4 column divs demarcated this, each including panel: <div class="col-lg-3 col-md-6 col-xs-12"> <div class="panel panel-default"> i have created css class called "center-block" div's want centered. center-block class below. .center-block { display: table; margin: 0 auto; } i using justgage widget ( http://justgage.com/)and angular-justgage ( https://github.com/mattlaver/angular-justgage ). versions are: <script src="./lib/angular-thirdparty/justgage-1.2.2/raphael-2.1.4.min.js"></script> <script src="./lib/angular-thirdparty/justgage-1.2.2/justgage.js"></script> <script src="./lib/angular-thirdparty/angular-justgage-master/ng-justgage.js"></script> these being included in panel in following manner:

html - HTML5 Download Attribute for image not working -

trying file downloaded , renamed "image.png", every time click on download button, file downloaded name: "leisa_christmas_false_color.png". appreciate help, thanks. <a id="download" href="https://www.nasa.gov/sites/default/files/styles/image_card_4x3_ratio/public/thumbnails/image/leisa_christmas_false_color.png" download="image.png">download</a> firefox allows users download files of same origin due security concern. file must come own server or domain name, otherwise opened in browser. while downloading cross-origin files allowed in chrome , latest opera (with chromium/blink), both ignore attribute value. in other words, file name remain unchanged. don't use extension '.png' in download attribute. can't change extension; automaticly added. btw not every browser support download attribute. more information take here: http://www.w3schools.com/tags/att_a_download.asp

css - Html tags hidden attributes -

i have problem people have when html on different browsers. doesn't render expected in browsers. i notice render same in browsers if specified of attributes. browsers adjust attributes of elements, other don't. so, question is is there tool give element attributes, don't specified in css ? way, won't depend on browser render algorithms see in browsers in best render , copy attributes in css :) thx in advance you can try chrome's web inspector (right click, inspect element). go expand computed style accordion. you'll see whatever being applied element. same case firefox (firebug) or opera (dragonfly) or ie (f12 dev. tools) apart this, suggest use reset stylesheet such "normalize.css" override browser applied styles on elements, more or less same in browsers. also, elements such buttons not same on firefox , chrome by default . you'll need css make them same across browsers.

javascript - Is it possible to send the result of one mustache template to another? -

i working mustache , atomic design patterns. i have component called card looks little bit this <div class="card {{ type }}"> <h2 class="card-title"> {{ title }} </h2> <div class="card-content"> {{{ content }}} </div> </div> i want use in other templates , send result template content . this: {{> molecules-card(title: 'title', content: {{> my-content-template }} ) }} the closes got is: {{> molecules-card(title: 'title', content: '<div>long , nasty string of html</div>' ) }}

php - PostageApp Email Issue -

Image
i trying send email client per shown in image postage app script unfortunately getting following error:- may 24 06:05:07 transmission created may 24 06:05:13 error: mismatched envelope , domains may 24 06:05:13 failed i checked postage app docs didn`t find solution. i'm not postageapp user, appears complaint have sender address of sender@postageapp.com (domain postageapp.com) , address of whatever domain developing. i suggest changing sender email address valid (or "no-reply@") same domain. if have spf record domain may need add postageapp.com (or server used) record show postageapp.com allowed send emails domain.

android - LibGDX Rotate 2D image with touchDragged() event -

objective: rotate image in center of screen movement equal left or right touchdragged event. right have basic stage created , adds actor (centermass.png) stage. created , rendered this: public class application extends applicationadapter { stage stagegameplay; @override public void create () { //setup game stage variables stagegameplay = new stage(new screenviewport()); stagegameplay.addactor(new centermass(new texture(gdx.files.internal("centermass.png")))); gdx.input.setinputprocessor(stagegameplay); } @override public void render () { gdx.gl.glclearcolor(255f/255, 249f/255, 236f/255, 1f); gdx.gl.glclear(gl20.gl_color_buffer_bit); //before drawing, updating actions have changed stagegameplay.act(gdx.graphics.getdeltatime()); stagegameplay.draw(); } } i have separate class file contains centermass class, extending image. familiar enough know extend actor, not sure benefit gain using actor vs image. in centermass class

android - Shared preference with session timeout using countdowntimer -

i want using startcountdown timer method change preference value not worked. private void startcountdowntimer(final string judul){ countdowntimer = new countdowntimer(120000, 1000) { public void ontick(long millisuntilfinished) { sharedpreferences pref = getactivity().getsharedpreferences("data", context.mode_private); sharedpreferences.editor editor = pref.edit(); editor.putstring("click"+judul, "1"); } public void onfinish() { sharedpreferences pref = getactivity().getsharedpreferences("data", context.mode_private); sharedpreferences.editor editor = pref.edit(); editor.putstring("click"+judul, "0"); } }.start(); } can use method ontick , onfinish change preference ?? want make session timeout in android actually. im using countdown timer manipulate it.

VBA - Word - Bookmarks disappearing when I try to write text on them -

i trying make macro in excel, takes sample word file bookmarks on , writes on bookmarks. works 1 bookmark, second, third, etc deletes other entries. e.g. after running of code, have written "info4". see info1, info2 , info 3 being written , deleted while macro run. any ideas? here comes code: option explicit public sub main() if [set_in_production] on error goto main_error dim word_obj object dim word_doc object dim obj object dim rng_range variant dim obj_table object dim origdoc$ dim l_row&: l_row = 2 on error resume next set word_obj = getobject(, "word.application.14") if err.number = 429 set word_obj = createobject("word.application.14") err.number = 0 end if if [set_in_production] on error goto main_error else on error goto 0 origdoc$ = activeworkbook.path & "\" & cstr(replace(time, &q

rename files in a folder with left pad zeros -

i need rename multiple files in folder. file names either 6 digits long or 9 digits long , need left pad file names leading zeros make total of 16 digits long. for example if file name 123456.jpg should renamed 0000000000123456.jpg , if 123456789.jpg should renamed 0000000123456789.jpg . maximum length of total digits should 16 digits. there can 100 or more files in folder. i tried this, know not code required task. started 1 , need move forward. @echo off setlocal enableextensions enabledelayedexpansion rem iterate on jpg files: %%f in (c:\documents\pictures\pic\*.jpg) ( rem store file name without extension set filename=%%~nf rem add leading zeroes: set filename=00000000000!filename! rem add extension again set filename=!filename!%%~xf rem rename file rename "%%f" "!filename!" ) i prefer batch script. if not possible, vb script accepted. based upon stephan's recommendation, have updated code below. code not

javascript - Add doubleclick on jQuery Easyzoom plugin on mobile devices -

i want implement jquery easyzoom double click on mobile devices. on desktop monitors fine, user hovers image , applies easyzoom plugin , zoom image. on mobile devices, image 100% width , height if user wants scroll down activates zoom on image instead scrolling down. is there possibility allow easyzoom on mobile devices (window.width <= 767px) via double clicking image. var page_width = $('body').innerwidth(); if (page_width >= 768) { var easyzoom = $('.easyzoom').easyzoom({ loadingnotice: 'loading image...', errornotice: 'error while loading image!' }); var api = easyzoom.filter('.easyzoom').data('easyzoom'); } else { // doubleclick js code easyzoom }

javascript - Angularjs localstorage with object -

i need store json object angularjs local storage. in case when ever push notification receive gcm need store local storage object , need display in 1 separate page, have done below code var sessionmessages = []; var notification = { "local": "bk3rnwte3h0:ci2k_hhwgipodkcizvvdmexudfq3p1...", "ldata": { "nick": "mario", "body": "great match!", "room": "portugalvsdenmark" } }; sessionmessages.push(notification); var notification1 = { "server": "bk3rnwte3h0:ci2k_hhwgipodkcizvvdmexudfq3p1...", "sdata": { "nick": "mario", "body": "great match!", "room": "portugalvsdenmark" } }; sessionmessages.push(notification1); $localstorage.set('mrksesionnotifi', sessionmessages); console.log($localstorage.getobject('mrksesionn

python - Scrapy spider not crawling the required pages -

here website link trying crawl. http://search.epfoservices.in/est_search_display_result.php?pagenum_search=1&totalrows_search=72045&old_rg_id=ap&office_name=&pincode=&estb_code=&estb_name=&paging=paging , below scrapper,as 1 of first attempts scrapping, pardon silly mistakes. kindly have , suggest changes make code running. items.py import scrapy class epfocrawl2item(scrapy.item): # define fields item here like: # name = scrapy.field() scrapy.item import item, field s_no = field() old_region_code = field() region_code = field() name = field() address = field() pin = field() epfo_office = field() under_ro = field() under_acc = field() payment = field() pass epfocrawl1_spider.py import scrapy scrapy.selector import htmlxpathselector class epfocrawlspider(scrapy.spider): """spider regularly updated search.epfoservices.in""" name = "pfdata" allowed_

vb.net - Validation to get null values -

i trying make validation if there no value on label application run normally. explain better show the code using , explain it private sub showtotalresult() sqlcon = new sqlconnection sqlcon.connectionstring = "...." try sqlcon.open() dim query string query = "select cast(sum(cast(filesize float)) / 1024 / 1024 decimal(10,2)) infofile" sqlcmd = new sqlcommand(query, sqlcon) sqldr = sqlcmd.executereader if lblresultadototal.text <> "" if sqldr.read() lblresultadototal.text = sqldr.getdecimal(0) exit sub end if end if sqlcon.close() catch ex sqlexception msgbox(ex.message) sqlcon.dispose() end try end sub what piece of code giving me total in mb of got on database. make tests deleted info database , when i've tried run application gives me error on lin

database - Attach sql server 2012 error, Unable to open the physical file -

i got message box blockquote unable open physical file "c:\project basdat\daycare.mdf". operating system error 5: "5(failed retrieve text error. reason: 15105)". (microsoft sql server, error: 5120) when trying attach database file made pc. use window 10. :( if google 2 minutes find people facing same issue , getting solved: http://schoening.it/blog/attach-database-failed-for-server-unable-to-open-the-physical-file-operating-system-error-5-5failed-to-retrieve-text-for-this-error-reason-15105-microsoft-sql-server-error/

jquery - Multiple arrays in javascript doens't work passing values -

i'm trying create multidimensional arrays in js this: on app.js file have var equipvalue = new array(); var selectedtrucks = new array(); in function.js file instead have: for (var in selectedtrucks) { (function(i){ // simple ajax request return me json values var ajaxurl = '/ajaxrequest/getsingletruckposition/' + selectedtrucks[i]; $.ajax({ url: ajaxurl, }) .done(function(data) { if(data != null){ // equipvalue doens't go. // unable set property '0' of undefined or null reference equipvalue[i] = jquery.parsejson(data); } }); why obtain: unable set property '0' of undefined or null reference ? why variables doens't work on function.js file selectedtrucks work perfectly? thanks guy edit doing test i've tried this: equipvalue = jquery.parsejson(data); so, problem isn't scoope

python - Django allauth custom login form not rendering all fields in custom user model -

i trying implement login of consists custom user model. possible inherit allauth.account.forms.loginform , add custom field custom login form? idea assign user role @ time of login overriding login() method. i have followed allauth configuration , mentioned forms use login in settings.py following code auth_user_model = 'core.user' account_signup_form_class = 'core.forms.signupform' account_forms = {'login': 'core.forms.coreloginform'} i using no auth backends other django.contrib.auth.backends.modelbackend , allauth.account.auth_backends.authenticationbackend . custom signup working fine me without issues. custom loginform not rendering fields in user model . allauth loginform inherited per accepted answer in so post , choicefield added custom login form. from allauth.account.forms import loginform class coreloginform(loginform): def __init__(self, *args, **kwargs): self.request = kwargs.pop('request', none)

spring mvc - @Autowired field is null in one SpringMVC controller while others work -

i've quite simple , classic page spring mvc controller , jsp (the jsp not relevant here): @controller public class playlistlistcontroller extends basecontroller<playlist> { @autowired userrepository userrepository; @requestmapping("/playlist/{username}") private modelandview displaylist(@pathvariable("username") string username) { user user = userrepository.getuserbyusername(username); .... } } my problem following. when want access page url: http://localhost:8080/playlist/foo throws nullpointeurexception in controller @ line 8. user user = userrepository.getuserbyusername(username); when debugging, see userrepository indeed null. userrepository supposed injected spring, , in other controllers, happens fine: same bean (userrepository) correctly injected sptring. why in specific controller (which in same package others) instantiated , called spring, userrepository null? don't understand @ all. sug

dynamics crm 2011 - clearoption for optionset in crm business process flow -

Image
i have business process flow in 1 of steps have added option set(sub category) i trying clear options in optionset using below code xrm.page.getcontrol("new_subcategory").removeoption(100000005) xrm.page.getcontrol("new_subcategory").clearoptions() this removes options optionset inside form, not removing same option set in step of business process flow you need added header_process_ id. so: xrm.page.getcontrol("header_process_new_subcategory").removeoption(100000005) xrm.page.getcontrol("header_process_new_subcategory").clearoptions() sdk reference

d3.js - D3: two x-axis with independent zoom behavior -

i want have 2 independent x-axis in time-comparison chart (timescale) , have problem implement zoom behavior both. d3 calculates x-domain both axis independently - perfect. how can bind (and call) 2 zoom behavior each axis 1 'g'-element (.d3-draw-area) ? i have listener both axis "master-axis" (logically) being computed: d3.select(".d3-draw-area").call(d3.behavior.zoom() .on('zoom' + ".x" + self._getxaxismaster().id, function () { self._zoomx(self._getxaxismaster()); }) .on('zoom' + ".x" + self._getxaxisslave().id, function () { self._zoomx(self._getxaxisslave()); }) .x(self._getxaxismaster().d3axis.scale()) ); thx...! i'm not able make master-slave independent scales work on single domain (x). in code above, have specified masterscale on domain (x), master scale gets triggered. i'm not able understand kind of data plotting, or relation between mast

sql - in MySQL can I compare id FK with varchar in another table -

i have table courseid, studentname , other table courseid , coursename user search course name in student table based on student name sql syntax should use ? join or inner join if use join , specify constraint (e.g. on a.courseid = b.courseid ) same if use inner join , according table structure should like: select * studenttable inner join coursetable on studenttable.courseid = coursetable.courseid studenttable.studentname = 'jack black'; in mysql write select * studenttable, coursetable studenttable.courseid = coursetable.courseid , studentname = 'jack black'; as internally queried in same way. check out exact syntax joins here: http://dev.mysql.com/doc/refman/5.7/en/join.html

css - Multi column list html -

Image
i make product list above, tried following code not looks 1 please suggest me in right way, .tablep{ float:left; padding-right:150px; } .bg{ background-color:grey; } <div class="tablep bg">code #</div><div class="tablep bg">product name</div><div class="tablep bg">date</div><div class="tablep bg">amount</div><br> <div class="tablep">id1</div><div class="tablep">product1</div><div class="tablep">2015</div><div class="tablep">100usd</div> how can achieve pic.thanks alot you should use table kind of data. it's semantically correct way. a table matches it's size content. if use divs in own code not stretch nicely. i've created table , gave width of 100%. should give want. the tr stands table row, th stands table header , td stands table