Posts

Showing posts from March, 2015

embedded - Enabling external aborts on an ARM CPU -

from cortex-r reference manual , probably not cortex-r specific asynchronous abort masking the nature of asynchronous aborts means can occur while processor handling different abort. if asynchronous abort generates new exception in such situation, r14_abt , spsr_abt values overwritten. if occurs before data pushed stack in memory, state information first abort lost. prevent happening, cpsr contains mask bit, a-bit, indicate asynchronous abort cannot accepted. when a-bit set, asynchronous abort occurs held pending processor until a-bit cleared, when exception taken. a-bit automatically set when abort, irq or fiq exceptions taken, , on reset. must clear a-bit in abort handler after state information has either been stacked memory, or no longer required. my question is, if have a bit masked since reset how can know if asynchronous abort pending? can pending external aborts cleared without unmasking a bit , taking exception? or more generally, there advice on clear

artificial intelligence - Generate unique identifier for chess board -

i'm looking checksum chess board pieces in specific places. i'm looking see if dynamic programming or memoized solution viable ai chess player. unique identifier used check if 2 boards equal or use indices in arrays. help. an extensively used checksum board positions zobrist signature . it's unique index number chess position, requirement 2 similar positions generate entirely different indices. these index numbers used faster , space efficient transposition tables / opening books. you need set of randomly generated bitstrings: one each piece @ each square; one indicate side move; four castling rights; eight file of valid en-passant square (if any). if want zobrist hash code of position, have xor random numbers linked given feature (details: here , correctly implementing zobrist hashing ). e.g starting position: [hash white rook on a1] xor [white knight on b1] xor ... ( pieces ) ... xor [white castling long] xor ... ( castling rights ) xor

java - Jaxb deserialization with access to Spring beans -

i have model, looks that: @xmlrootelement class foo { private list<bar> bars; //getters , setters.. } i deserialize object of class foo xml, problem is, instatiate class bar need spring-congigured service , 1 property of bar object(from prior serialization). as far know, cannot use xmladapter(no access spring beans), , cannot serialize bars directly(no access spring beans , moreover, calling service model layer not do). is ther simple way of doing this? not add aspectj injecting spring beans xmladapter.

node.js - Nodejs and Jade rendered my submit button as a text field -

in nodejs application, jade templating, can't manage render submit button. this app.js code : var express = require('express'); var app = express(); app.get('/todo', function(req,res){ res.set({ "content-type" : "text/html", "charset" : "utf-8" }); res.render('todo_list.jade', {list : [ "lire un livre", "jouer de la musique", "apprendre la programmation", "jouer au dé pipé !" ]}); }); // app.post('/todo/ajouter', function(req, res){ // // }); // // app.post('/todo/supprimer/:id', function(req, res){ // // }); app.listen(8080); this view/todo_list.jade : doctype html head title ma todo list body h1 ma todo list ul - (var = 0; < list.length; i++) li #{list[i]} form label(for=new_task) que dois-je faire ? input(type=text, id=new_task, name=new_task, size=15) input(type=submit, value=ajouter) s

How to run GUI Python script on Apache? -

i wrote program in c, , designed gui using python. want convert web app. i have gui.py , abc.exe file. can directly execute gui python script (gui.py) on 'apache2' local server? if yes, how? it depends on how gui written, abc.exe , how want use web interface. in general, want not possible. while local applications there 1 user , clear, when user terminates program, web applications there can millions of users @ same time, , when application doesn't hear form user, not clear, if user closed window, or there network connection broken, or else. that's why web applications far possible stateless, or session information written databases. not case local applications, have rewrite large parts of c code.

java - Query on default page of Tomcat server -

Image
this basic question understand. i running fresh apache tomcat server on port 8080, , when type url http://localhost:8080 , see browser sends following request tomcat. get / http/1.1 host: localhost:8080 connection: keep-alive cache-control: max-age=0 accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 user-agent: mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/35.0.1916.114 safari/537.36 accept-encoding: gzip,deflate,sdch accept-language: en-us,en;q=0.8 i see below http response content-type:text/html my question: 1) how / parameter of get request mapped above html page response @ tomcat side, when tomcat server received get request? below xml element in tomcat/conf/web.xml? flow on tomcat side after receiving request? <!-- mapping default servlet --> <servlet-mapping> <servlet-name>default</servlet-name> <url-pattern>/</url-pattern> </servlet-

java - Visitor design pattern intent : misleading or I am missing something? -

in reference book "design patterns elements of reusable object-oriented software" gang of four, intent of visitor pattern explained follow : represent operation performed on elements of object structure. visitor lets define new operation without changing classes of elements on operates. another advantage read visitor pattern that: add new operation without having source code of classes.. i made deep search in google, did not find example showing how that. let's take simple example : public interface myinterface { public void mymethod(); } public class myclassa implements myinterface { /* (non-javadoc) * @see com.mycomp.tutorials.designpattern.behavorials.myinterface#mymethoda() */ public void mymethod() { system.out.println("mymethoda implemented in myclassa"); } } public class myclassb implements myinterface { /* (non-javadoc) * @see com.mycomp.tutorials.designpattern.behavorials.myinterfac

How to get a C++ Windows service to be properly notified when user log on/off or PC enters sleep/hibernation -

i have c++ windows service starts tcp server when booted. problem when user logs on/off service no longer responses client requests, when returns hibernation. need notified power modes suspend/resume server proper way. i tried servicebase.onpowerevent() visual studio says undefined. method available c#? there counterpart in c++? it worth mentioned service template used have downloaded online tutorial, not default template comes vs. servicebase.onpowerevent .net services based on servicebase. wrapper of service_control_powerevent.services notified of log on , log off events via service_control_sessionchange. for list of notification code, check handlerex callback function

How to specify timezone for dates in parse.com? -

when updating or creating objects in database, need specify timezone. how can achieved in parse dot com? is there global setting this? if you're talking rest apis, there no local time zone support. parse.com uses utc timestamps , you'll have locally convert time between time zone in question , utc before passing apis or - other way - after getting api before presenting user.

Append data to file in hadoop using java api -

i have created file results of sequence of map-reduce jobs. program i' ve made iteratively outputs results. want append data in result file using java api. have tried fs.append doesn't work. time being using built-in libraries of java (eclipse 4.2.2) , when i'm ok debugin i'll make jar , throw in cluster. first of all, "append" accepted in hdfs? , if yes can tell me how it's done? thnx in advance. the code using job following: try{ path pt = new path("/home/results.txt"); filesystem fs = filesystem.get(new configuration()); bufferedwriter br = new bufferedwriter(new outputstreamwriter(fs.append(pt))); string line = "something"; br.write(line); br.close(); } catch (exception e) { system.out.println("file not found"); } early versions of hdfs had no support append operation. once file closed, immutable , changed writing new copy different filename. see more information here if

java - CAS Authentication -

exception: javax.servlet.servletexception: org.jasig.cas.client.validation.ticketvalidationexception: supplied service app url not authorized use cas proxy authentication root cause: org.jasig.cas.client.validation.ticketvalidationexception: supplied service appurl not authorized use cas proxy authentication. getting above exception while authenticating application through cas well, stacktrace shows application not have authorization use cas. try register on service register of cas. if cas have jdbc service store service registry, access service register in services context (something https://youtcasserver.com/services ). or if going have xml based in memory service registry, add deployerconfigcontext.xml. refer following url configuring service registry: https://wiki.jasig.org/display/casum/configuring when on cas 3.x or http://jasig.github.io/cas/4.0.0/installation/service-management.html when on cas 4.0

jquery - javascript check json for img tag and change src -

hi have custom made crm saves img's in our database /upload/image/image.jpg have images have full url. need way find out if image starts /upload , add our web address front of image src image shows correctly , not square no image, we using json , javascript here code have far function loadnewsstory(e) { if(newsview !== true) { document.getelementbyid("newsarticals").style.display = "block"; document.getelementbyid("activecontent").style.display = "none"; newsview = true; } xmlhttp=new xmlhttprequest(); xmlhttp.open("post","http://media.queerdio.com/mobiledevice/?uri=loadstory/"+e ,false); xmlhttp.send(); var newsreponse = json.parse(xmlhttp.responsetext); var news = newsreponse[0]; document.getelementbyid("newsarticals").innerhtml = '<h1 class="newsheader">' + news.post_title + '</h1> <div class="ne

.net - Deploy An Application on Azure, Need Some Pointers -

i'm new @ azure , environment, if not suitable question sincere apology... i'll try simplified can: i programmed 2 project in .net: engine - project work.("business layer") presentation - project gui engine.("presentation layer") both of project communicate each other. the engine have api (dcom), can access in local area newwork. now want upload engine on azure , access computer. how can upload application ? useful tips or articles/tutorials ? i saw lot of microsoft article didnt pick there... thanks. update: i created virtual machine , installed engine there, working till now. now search way website (asp.net mvc 4) publish on azure communicate software installed on virtual machine created( send file software , back). any idea how can accomplish ? how can website connect , invoke procedure in vm ? , transfers files there , back/ thanks again. i assume engine implemented .net com+ serviced component (since there r

JQuery sortable only works on browser hard reload (meteor/blaze) -

i used avital's example here: https://github.com/meteor/meteor/tree/master/examples/unfinished/reorderable-list for reason, in implementation need reload page work. in other words, once app loads in browser, list isn't sortable. refresh browser page , fine. my implementation: on client call server method set initial ranks each item in list. note, tried running meteor.call on server inside meteor.startup same result: meteor.call("setinitialtodosrank") i add sortable code (from avital's example) ui.body.rendered = -> # uses 'sortable' interaction jquery ui $('.list-group').sortable stop: (event, ui) -> # fired when item dropped el = ui.item.get(0) before = ui.item.prev().get(0) after = ui.item.next().get(0) newrank = undefined unless before # moving top of list newrank = simplerationalranks.beforefirst(ui.getelementdata(after).rank)

java - How to dynamically remove a JPanel? -

Image
i have a gui looks follow. i want dynamically add/remove panel. use arraylist keep trace of jpanel objects. , add panel dynamically, when want delete panel, not attribute can not remove it. here code: public class main implements actionlistener{ private list <mypanel> mplist; private jpanel btnpanel; private jbutton jbtadd,jbtdelete; private jframe jf; private jpanel jp; private jscrollpane js; private mypanel mp; private static int size=0; private int selectedid=-1; //private public main(){ mplist=new arraylist<mypanel>(); btnpanel=new jpanel(); jbtadd=new jbutton("addjpanel"); jbtdelete=new jbutton("deljpanel"); btnpanel.setlayout(new flowlayout(flowlayout.left,1,1)); btnpanel.add(jbtadd); btnpanel.add(jbtdelete); jf=new jframe("hello"); jp=new jpanel(); js=new jscrollpane(jscrollpane.vertical_scrollbar_as

javascript - Dynamic simplification with projection in D3 -

i drawing svg map d3 using d3.geo.mercator() projection. i use zoom behaviour map applies transform <g> object holding paths of map. after looking @ examples of dynamic simplification mike bostock ( http://bl.ocks.org/mbostock/6252418 ) wonder whether can apply such algorithm in case redraw geometry fewer points when it's zoomed out? in examples i've seen, there simplify function skips negligible points , plots rest is, , function used in var path = d3.geo.path().projection(simplify) . can't use since need applied on top of existing projection = d3.geo.mercator().scale(*).translate([*,*]) . how should use dynamic simplification existing projection? according example quoted, dynamic simplification ii the simplify function like var simplify = d3.geo.transform({ point: function(x, y, z) { if (z >= area) { this.stream.point(x, y); } } }); where area treshold variable can set beforehand or modify dinamically according

Is it possible for xpath to return NULL if there is no text data? -

i trying extract data table. table data rows formatted <td headers="h1" align="left"></td> when there no data. using etree.tostring() method lxml library prints out these elements <td headers="h1" align="left"/> instead of source formatting. furthermore, using xpath if run code tree.path('//td[@headers="h1"]/text()') resulting list not include blank values there no data. as trying write these results csv file, how include null, i.e. "" when there no data? one workaround use //td[@headers="h1"] xpath elements , .text property on each: from lxml import etree data = """ <table> <tr> <td headers="h1" align="left"></td> <td headers="h1" align="left">text1</td> <td headers="h1" align="left"/> <td headers="h1&

laravel - How do I add an array of pivot table data to a user? -

i have pivot table of user_activities. have relationship defined in model, example: $activities = user::find($id)->activities; this returns array of objects. want send user object activities array. i've tried dynamically assigning activities array user object empty object result ( $user->activities = {} ) instead of array full of activity objects. how add array of activity objects user object? you may try following approach (your approach should work, related models loaded later on call (dynamically) better, known eager loading ): $user = user::with('activities')->find($id); make sure have declared relationship , have related models well.

Look up or insert new element to string list in Haskell -

so want have function takes string , list argument, , checks if element on list, if is, returns same list, if isnt, adds list , returns it, 'im begginer haskell heres have tried no sucess: check:: string ->[string] ->[string] check x [] = []++[x] check x (y:xs) | x==y = (y:xs) | otherwise = check x xs can point me way ? thks you can use existing function elem http://hackage.haskell.org/package/base-4.7.0.0/docs/prelude.html#v:elem check x ls | x `elem` ls = ls | otherwise = (x:ls) if want on own learning purpose, suggest re-implementing elem .

email - Use e-mail confirmation in grails -

i want use email confirmation user after creating user. have installed plugin email confirmation 2.0.8. using grails 2.3.7 version. , have done following attempt although have no idea it. no email being sent in yahoo account. can me on please ? here attempts follows : in config file plugin >>> plugin.emailconfirmation.from = '"do not reply" <noreply@mymegacorp.com>' in view page >>> <g:form controller="userinformation" action="saveuserinfo"> user e-mail address : <g:textfield name="useremail" id="useremail" required=""/> <br/> <g:submitbutton name="submit" id="submit" value="save user"/> </g:form> in controller action >>> def saveuserinfo() { println(params) // send simple confirmation emailconfirmationservice.sendconfirmation( to:params.useremail, subject:"pl

average - python: plotting numbers as a custom range -

i'm not sure how word it, want want make 3 sets of number equivalent range of 0 10 i can call later. for example, if have numbers 2, 4, , 9, want 2 represents 0, 4 5, , 9 10. way if write command says "call number represents 2.5", gives me 3. more examples: 0=2, 2.5=3, 5=4, 7.5=6.5, 10=9 and want after have set these numbers, can call within custom range of 2-9 saying part of scale want (like want value represents 1.25). there way in python...? ps: i'm sorry if question exists, don't know sort of thing called. edit: understand more of want do, i'm trying set thing script in maya (3d program), , have set of curves. right have script written smooth out jagged curves taking averages of 3 points , replacing average middle number. want rather taking average, able have input of value 0-10 controls how curve smooths out. if have curve have 2 6 , 4 on y, instead of making middle number 3.667 (the average of 3 values), want @ 4 or 3.25, or other average.

html - Local storage in chrome -

i have javascript code save string local storage, string size 400000, var dataurl = canvas.todataurl("image/jpg").tostring(); localstorage.setitem("dataurl", dataurl); i open html file chrome, in 1 computer ok in other computer uncaught quotaexceedederror: failed execute 'setitem' on 'storage': setting value of 'dataurl' exceeded quota. in computer allowed save string length no more 100000 chars. both computers have same chrome's version 35.0.1916.114 m why? the chrome local storage default 25m, clear chrome's local storage work it. luck!

entity framework - Migrations is enabled for context 'ApplicationDbContext' but the database does not ex -

i`m trying extend useridentity, using code first migration(ef 6.0.0.0). first try of code first migration. public class applicationuser : identityuser { public string nameofuser { get; set; } } add-migration "nameofuser" - ok update-database - ok field in db created , marked "allow null" but when using action in accountcontroller app throw error migrations enabled context 'applicationdbcontext' database not exist or contains no mapped tables. use migrations create database , tables, example running 'update-database' command package manager console. how can resolve prob?

html - Bootstrap CSS: Fixed Left Side Bar -

i working on web page based on bootstrap css i'd similar bootstrap dashboard example. problem experiencing section @ right side of left fixed sidebar scrolls horizontally while i'd fixed (although fluid). here jsfiddle page reproducing issue http://jsfiddle.net/k7m5f/embedded/result/ here html <div class="container-fluid"> <div class="row-fluid"> <div class="col-sm-3 col-md-2 sidebar"> <ul class="nav nav-sidebar"> <li><a href="#" class="active">choicea</a> </li> <li><a href="#">choiceb</a> </li> </ul> </div> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main" style="height: 100%; width: 100%;"> <div class="row">this test</div>

c - GCC ARM register expected -

i'm trying port bunny armv7h, uses x86 asm stuff i'm having trouble converting asm. static __inline__ void atomic_inc(volatile int* ptr){ __asm__ __volatile__("lock incl %0": "=m" (*ptr): "m" (*ptr)); } static __inline__ void atomic_dec(volatile int* ptr){ __asm__ __volatile__("lock decl %0": "=m" (*ptr): "m" (*ptr)); } is what's there, i've tried "add/sub %0 %0": "=r" (*ptr): "m" (*ptr)); and both give error: arm register expected -- `add [r3] [r3]' and error: arm register expected -- `sub [r4] [r4]' compiled using: armv7l-unknown-linux-gnueabihf-gcc -wall -o3 -funroll-loops -fno-strict-aliasing -ffast-math -wno-pointer-sign -mcpu=cortex-a15 -mfpu=neon -marm the clue lies in error message - entirely accurate. arm arithmetic instructions take 3 operands : add{s} rd, rs, <operand> sub{s} rd, rs, <operand> where

cypher - Modelling time-varying financial exposures in `Neo4j` -

how 1 model kind of data in neo4j ?: > holdings portfolio holding instrument date balance.usd 1 abc stock 1 share class stock 1 2013-12-31 25360291 2 abc stock 1 share class stock 1 2014-01-31 25302011 3 abc stock 1 share class b stock 1 2013-12-31 12264011 4 abc stock 1 share class b stock 1 2014-01-31 12893201 5 def fund 1 share class eur series 1 fund 1 2013-12-31 21012222 6 def fund 1 share class eur series 1 fund 1 2014-01-31 21632101 7 def fund 1 share class eur series 2 fund 1 2013-12-31 8214325 8 def fund 1 share class eur series 2 fund 1 2014-01-31 8292630 9 def portfolio abc account portfolio abc 2013-12-31 155364592 10 def portfolio abc account portfolio abc 2014-01-31 156202162 > factors instrument

scala - Zipper vs. iterator for walking over a list or tree -

suppose need walk on list or tree read (but not modify) data. can use either iterator or zipper . zipper have advantages aside immutability in case? do need backtrack or otherwise move around in structure in non-sequential order? want able traverse structure multiple times without worrying left iteration? want avoid thinking concurrent access or thread safety? go zipper. do know fact need performance iterator can provide in situations? working on team doesn't want learn new abstraction? go iterator.

java - karaf 3 with OSGi , how install a bundle -

how create bundle using apache karaf 3 ? know ? i have try in eclipse : export jar manifest file ... , why have error: karaf@root(dev)> feature:repo-add file:///c:/users/xx/downloads/apache-kara f-3.0.1/apache-karaf-3.0.1/deploy/features.xml adding feature url file:///c:/users/xx/downloads/apache-karaf-3.0.1/apache- karaf-3.0.1/deploy/features.xml karaf@root(dev)> feature:install greeter_server error executing command: jar not bundle, no bundle-symbolicname file:///c:/ users/xx/downloads/apache-karaf-3.0.1/apache-karaf-3.0.1/deploy/nebula_cdat etime_vf4.jar karaf@root(dev)> this features.xml : <features> <feature name='greeter_server' version='1.0'> <bundle>file:///c:/users/xx/downloads/apache-karaf-3.0.1/apache-karaf-3.0.1/deploy/nebula_cdatetime_vf4.jar</bundle> </feature> </features> when want export bundle or declarative service eclipse rcp must use file -> export -> plugin development-&

extjs4 - extjs 4 how to declare a global variable from a store -

we have extjs4 - spring mvc application. declare variable user information (name, firstname, role). role can set field in read or hidde part of application. in app.js: ext.application({ name: 'appname', appfolder: 'js/app', enablequicktips:true, controllers: [ 'maincontroller',.... ], autocreateviewport: true, globals: var1 : 5 //it works simple variable }); i create store variable this var appglobalstore = ext.getstore('mystore'); this not possible : globals: appglobalstore : ext.getstore('mystore'); and value in extjs (i guess) var role= appname.app.globals.role is possible ? or if it's not possible, whereever need role have declare ? that var role = ext.getstore('mystore').getat(0).raw.role; the name given app name of global variable extjs provides you. so, can that: appname.role = role = ext.getstore('mystore').getat(0).ra

javascript - Jerky parallaxing with scrollwheel in WebKit -

i'm having issues parallaxing backgrounds. i've made little website event organized friends of mine, , on site have bunch of background images alternating in between content sections. i've added logic offset these background images when scrolling, create parallaxing effect. it's working enough , haven't noticed performance issues, when using scrollwheel, parallaxing seems lagging behind in webkit browsers. here's link website: http://eventyrfestival.info/ the effect i've tried mimic, @ least background images, 1 seen on spotify website: https://www.spotify.com/ from looking @ source code, seem doing more or less same thing: have parallaxing function calculates background transform based on scrolltop value of document, , function throttled 16 ms , bound window's scroll event. still, background transformation on spotify site instant, while mine visually lags behind content. it's not "broken" in works in firefox/ie , works in

matlab - Create sparse graph from matrix -

i have large sparse graph want display mupad. graph denoted in matlab sparse squared matrix of edge weights. when using graph::creategraphfrommatrix(m) , unable create connected graphs. tried values of 0 , nan / undefined , inf missing edges, changed weight of resulting edges, did not make them disappear.

lua - sqlite first executed query slow after opening connection -

i create sqlite3 database (using sqlite expert professional) 1 table , more 500,000 records; if command simple query like: select * tableone entry 'book one' if it's first command executed after connecting database, takes considerably long time executed , retrieve result(~15seconds) after first command, comes normal , every command executes acceptable speed; even if close application(i use pure lua sqlite modules)(and within it's logic, reasonably close connections) long windows(8 x64) running not restarted, every command first 1 executes after restarting windows, again, first command slow executed; what reason? how can prevent this? most after first time run this, you've loaded cache data, subsequent queries fast. have index on entry ? index allow efficient querying using entry filter. may want create one: create index i_tableone_entry on tableone( entry );

jquery - Trigger bootstrap tooltip options via javascript -

pls right way pass options via javascript bootstrap tooltip/popover: via data attributes works in: <input type="text" data-toggle="tooltip" data-placement="right" data-animation="fade" data-delay="200" data-trigger="focus" data-content="foo"> but using javascript doesn't: <script> jquery(function ($) { $("input").popover()({ animation:"fade", delay: "200", trigger:"focus", placement: "right" }); }); </script> what right syntax? for tooltip , should be: jquery(function ($) { $("input").tooltip({...}); }); instead of: jquery(function ($) { $("input").popover({...}); }); update: sorry mis-confusions, it works here but: popover()({...}); should popover({...}); html: <input type="text" data-toggle=&q

android - Facebook Open Graph test user has different Story layout -

firstly, images accompany following descriptions: http://imgur.com/a/kfpdm i have created custom open graph story app. story called record race . modified story include parameters (name , results) added race object (see image 1) . pretty simple stuff. when app launches facebook share dialog while my account logged in facebook app on phone, share dialog mirrors story layout set (see image 2) . far. however, when app launches fb share dialog while test user account logged in fb app, share dialog looks regular dialog, not including modifications story (see image 3) . has come across this? can't find on stack overflow or facebook developers documentation. thanks!

Simulation error in verilog in modelsim ACTEL6.6d -

i new verilog, trying compile basic code found on stackoverflow ( simulation error in verilog ). design block module inst_line_buffer(input wire [511:0]from_ls, input wire clk, output reg [63:0]to_if_id); parameter mem_size=16; integer k; reg [31:0] ilb[0:mem_size-1]; initial begin (k = 0; k < mem_size ; k = k + 1) begin ilb[k] = 32'b00; //$display ("ilb= %b",ilb[k]); end end @(posedge clk) begin ilb[0]= from_ls[511:480]; ilb[1]= from_ls[479:448]; ilb[2]= from_ls[447:416]; ilb[3]= from_ls[415:384]; ilb[4]= from_ls[383:352]; ilb[5]= from_ls[351:320]; ilb[6]= from_ls[319:288]; ilb[7]= from_ls[287:256]; ilb[8]= from_ls[255:224]; ilb[9]= from_ls[223:192]; ilb[10]= from_ls[191:160]; ilb[11]= from_ls[159:128]; ilb[12]= from_ls[127:96]; ilb[13]= from_ls[95:64]; ilb[14]= from_ls[63:32]; ilb[15]= from_ls[31:00]; to_if_id [63:32]= ilb[0]; to_if_id [

jquery - JavaScript onClick handler does not work as expected -

i have question regarding javascript. below codes. 1) search.html <html> <head> <link href="styles.css" type="text/css" rel="stylesheet" /> <script type="text/javascript" src="jquery-1.4.2.js"></script> <script type="text/javascript"> function checksubmit(thisform) { if (thisform.last.value == '') { alert('please enter last name'); return false; } } function lookup(inputstring) { if (inputstring.length == 0) { $('#suggestions').hide(); } else { $.post("autocom.jsp", { querystring: "" + inputstring + "" }, function (data) { $('#suggestions').show(); $('#autosuggestionslist').html(data); }); } } function fill(thisvalue) { $('

c# - Discard scale transform of Camera in Viewport3D -

i have main viewport3d mcamera , controlled trackballdecorator . want create viewport3d cube in represent current camera direction on main viewport. this code: matrix3d transformationmatrix = mcamera.transform.value; // ? orientationcamera.transform = new matrixtransform3d(transformationmatrix); works well, besides fact don't want orientationcamera apply zoom main 1 (i want rotate). i can see values m11 , m22 , m33 of matrix changing when operating on zoom main camera, change when i'm rotating it, , change try apply resulted preview cube transform in unexpected way. does have idea how discard scaletransform transformation matrix? or maybe there way it? the first 3 rows (or columns) in pure rotation matrix unit vectors. if apply scale, these vectors aren't of unit-length more. can apply inverse scale rid of scale. assuming scale equal in 3 directions: var m11 = transformationmatrix.m11; var m12 = transformationmatrix.m12; var m13 = transformatio

cmd - Batch code for execution of .exe files with parameters -

my command line arguments question getpkt.exe 15-05-14.dlf the getpkt.exe file , .dlf file in same folder. copy batch file same location , double click that. need execute command. the folder contains 1 getpkt.exe , 1 .dlf file. .dlf file name varies every time. so me batch script code need execute following getpkt.exe file the.dlf file in same folder? thanks in advance. goto correct path get filename (if there more one, last one) execute program filename parameter cd /d "c:\path getpkt" for /f %%i in ('dir /b *.dlf') set file=%%i getpkt.exe %file%

c++ - Using qualified name in the global scope -

i've written following code: #include <iostream> namespace { int z=::b; } int b=5; int main() { std::cout << a::z; } and expected worked correctly. because: a name prefixed unary scope operator :: (5.1) looked in global scope, in translation unit used. name shall declared in global namespace scope or shall name declaration visible in global scope because of using-directive (3.4.3.2). use of :: allows global name referred if identifier has been hidden (3.3.10). this quote said nothing variable must declare lexically before using of qualified id. the name shall declared in global namespace scope you have write: int b=5; namespace { int z=::b; }

c# - Call .fail(error) without throwing exception -

using signalr, there possibility call .fail instead of .done when specific values returned hub method? perhaps using signalr pipeline? public bool delete(int addressid) { // user should not able delete default address if(addressservice.isdefaultaddressofcustomer(addressid)) return false; // should call .fail() on client addressservice.delete(addressid); return true; // should call .done() on client } the alternative throw exception avoid since error not server fault, user fault. assuming convinced exception not right tool you, use custom attribute define mark methods false return value must translated error, , intercept incoming call buildincoming hubpipelinemodule : http://msdn.microsoft.com/en-us/library/microsoft.aspnet.signalr.hubs.hubpipelinemodule.buildincoming(v=vs.118).aspx from inside there can intercept call original method, inspect if it's marked attribute , if returned false , if it's case can throw exception there

Sending text and and Image simultaneously in android -

in application, requirement send image , text simultaneously. use following code intent share = new intent(intent.action_send); share.settype("image/jpeg"); share.putextra(intent.extra_text, "my photos"); share.putextra(intent.extra_stream, uri.parse("file:///"+f)); startactivity(intent.createchooser(share, "share image")); but image sended text not sending. how can solve problem? plz try this //assuming uris list of uri intent intent = null; if (uris.size > 1){ intent = new intent(intent.action_send_multiple); intent.putparcelablearraylistextra(intent.extra_stream, uris); } else if (uris.size() == 1) { intent = new intent(intent.action_send); intent.putextra(intent.extra_stream, uris.get(0));} intent.settype("image/*"); intent.putextra(intent.extra_text, "some message"); startactivity(intent.createchooser(intent,"compatible apps:"));

javascript - How to duplicate Y Axis on JQuery Flot -

Image
i'm being able use jquery flot, , it's nice tool. however, not find solution problem. i want duplicate y axis, can display 1 on left , 1 on right, users, when comparing data rightmost side of chart, won't have scroll through leftmost side of chart. i'm assuming accessing through smartphone. jquery flot allows multiple axis, each axis, need different set of data, in example: http://people.iola.dk/olau/flot/examples/multiple-axes.html but don't want duplicate data. can't 'tell' flot duplicate yaxis using same set of data? you can use hooks functionality force flot show second yaxis though has no data series assigned it: // hook function mark axis "used" // , assign min/max left axis poff = function(plot, offset){ plot.getyaxes()[1].used = true; plot.getyaxes()[1].datamin = plot.getyaxes()[0].datamin; plot.getyaxes()[1].datamax = plot.getyaxes()[0].datamax; } $.plot("#placeholder2", [ { data: d2 } ],

Method or data member Issue with my Excel VBA Code -

hello started program macro , have come across error stating method or data member not found , pointing me following line in code: set wssheet = wstpcc.sheets("tpcc") i clueless why might happening , have assistance in figuring out throughout rest of programming beginning of code. here whole code in case. option explicit sub traininghoursmacro() dim wbthmacro workbook, wsregulares worksheet, wsregularesdemitidos worksheet, wstempactivos worksheet, wstempja worksheet, wstempfit worksheet, _ wstempdemitidos worksheet, wsps worksheet, wsresultados worksheet, wsdllist worksheet, wssheet worksheet dim wbregularesbruto workbook, wsmovimentacao worksheet, wsdemitidos worksheet dim wbtemporariosbruto workbook, wstemporariosativos worksheet, wsjaativos worksheet, wsaprendizesfit worksheet dim wbpresencesystem workbook, wstpcc worksheet set wbthmacro = workbooks("training hours macro.xlsm") set wsregulares = wbthmacro.sheets("regulares") wsregulares.