Posts

Showing posts from February, 2015

javascript - Swap position of number in a 4 digit number without array -

in 4 digit number how swap 1 number 3 , 2 4 number need solve 1 problem in javascript.thank you try this: x = '1234' x.replace(/(.)(.)(.)(.)/,'$3$4$1$2') result: "3412"

c# - nested repeater control and item count of child repeater -

Image
i have designed employee data using nested employee data.i have 2 table emp , dept .table information emp-empid(pk),empname,empjob,empsalary,deptid dept-deptid(fk),deptname i have shown data in department wise.parent repeater shows department table , child repeater shows emp details.and want count total number of employee department wise total salary.like wise in last want count grand total employee , grand total salary.but problem i'm facing in counting no of employee , salary department wise.here aspx.cs page .. if not getting me what's problem .. see output i've attached 1 screenshot using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.data; using system.data.sqlclient; using system.configuration; public partial class repeatercontrolnested : system.web.ui.page { sqlconnection cn = null; sqlcommand cmd = null; sqldataadapter da = null; dataset ds =...

java - Android Studio - FileNotFound exception in editor -

i'm getting error in android studio ide before hitting "run". unhandled exception: java.io.filenotfoundexception with class: (the function in class not yet being called!) import java.io.*; public class fileio { public static byte[] readbinaryfilefromassets(file file) { byte[] data = null; datainputstream dis = new datainputstream(new fileinputstream(file)); dis.readfully(data); dis.close(); return data; } } thanks. its bothering because haven't handled potential file not found exception. surround try/catch or throw exception. public static byte[] readbinaryfilefromassets(file file) { byte[] data = null; datainputstream dis = null; try { dis = new datainputstream(new fileinputstream(file)); dis.readfully(data); dis.close(); } catch (filenotfoundexception e) { e.printstacktrace(); } catch (ioexception e) { e.print...

Passing variables using jquery and ajax php -

i'm following tutorial, issue is: have code here, tables. <tr id="<?php echo $id; ?>" class="edit_tr"> <td class="edit_td"> <span id="first_<?php echo $id; ?>" class="text"><?php echo $kodi; ?></span> <input type="text" value="<?php echo $kodi; ?>" class="editbox" id="first_input_<?php echo $id; ?>" /&gt; </td> <td class="edit_td"> <span id="last_<?php echo $id; ?>" class="text"><?php echo $vlera; ?></span> <input type="text" value="<?php echo $vlera; ?>" class="editbox" id="last_input_<?php echo $id; ?>"/> </td> </tr> now, script: <script type="text/javascript"> $(document).ready(function() { $(".edit_tr").click(function() { var id=$(this).attr('id'); $...

jquery - Symfony 2 with AJAX: Submitting Formatted Request to Controller Method -

i have controller method takes in json request. controller returns data submitted form , updated data asynchronously loaded page. form should able re-submitted number of times without reloading page. the problem running has json data being read controller method differently following initial form submission. the relevant controller code is: /** * creates new hoursspecial entity. * * @route("/", name="hoursspecial_postcreate") * @method("post") */ public function postcreateaction(request $request){ $requestdata = $request->request->all(); $date = $requestdata['eventdate']; ... } and here ajax code: /* handle submission of special hours form */ $('.specialhours_form').on('submit', function(event){ var targetform = $(this); event.preventdefault(); ajaxobject = { url: $(this).attr("action"), type: 'post', contenttype: "application/json; ...

add on - Android: Option menu like on Motorola Gallery app? -

Image
i'd design option menus of new app similar option menu in motorola gallery app. when click on album, screen darkens, , on bottom right corner, option menu buttons scroll up. do know add-on, library or whatever achieve such behaviour or have program own (that means darkening screen, animations on buttons,...) you can in way. first create layout of window <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#7f000000"> <button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="close"/> </relativelayout> in onclicklistner method of item (say album) can write code open dialog listview.setonitemlongclicklistener(new adapterview.onitemlongclicklistener() { @overri...

python 2.7 - AndroidViewClient: How to check if "Id/Text/Image" exist before touch it? -

how can check if exist id/text before touch it? i trying this: # class=android.widget.imageview com_evernote___id_close = vc.findviewbyidorraise("com.evernote:id/close") if not com_evernote___id_close: vc.sleep(1) else: com_evernote___id_close.touch() after login on evernote. shows info. if exits want close if not script continue executing. and when not exist shows error: file "/usr/local/lib/python2.7/dist-packages/androidviewclient-11.0.10-py2.7.egg/com/dtmilano/android/viewclient.py", line 3352, in findviewbyidorraise raise viewnotfoundexception("id", viewid, root) com.dtmilano.android.viewclient.viewnotfoundexception: couldn't find view id='com.evernote:id/close' in tree root=root if don't want raise exception if view not found use viewclient.findviewbyid() instead of viewclient.findviewbyidorraise() . check if returned values not none . simple!

sql - how to make the new Autonumber in Access follow the last Autonumber -

i have little school project create exam of 30 questions, display these questions out of database table includes 70 questions (which created in advance). use array of random unique integers between 1 , maxid (in questions table) take these questions using id(autonumber, primary key) , display them. teacher told me create page admin can add question did. the problem starts when add question(id==71) , remove question , add one(id==72) if last id 72(for example) , before 70, if number 71 included in array of random unique integers gonna make problem cause there's no row includes 71 in access table. my question is: can make id's in autonumber column +1 last id in table? i know it's bit long i'm bothered this, if unclear, please tell me can make clear. no, autonumber +1 of last used. way accomplish assign own value id, you'll still have similar issue if delete record in middle.

vb.net - Cannot use AddRange on a list with an interface -

this vb in .net4, have same problem in c#. have use interfaces reasons won't go into. this works, doesn't use interfaces: public class personlist inherits list(of person) end class dim mypeople new personlist mypeople.addrange(somelist) i need use interfaces such iperson , ipersonlist because use dependency injection enable testing of these classes. when create interface personlist, can't see addrange more. new version of personlist using interface public class personlist inherits list(iperson) implements ilist(of iperson) implements ipersonlist end class interface list: public interface ipersonlist inherits ilist(of iperson) end interface everthing builds , works expected until try call addrange: dim mypeople ipersonlist = new personlist mypeople.addrange(somelist) 'build error addrange not member of ipersonlist presumably ipersonlist needs inherit has implementation of addrange . addrange part of list(of t) , interface cannot i...

jquery - WebAPI instantiating objects even if they are null in JSON -

when posting json models webapi controller methods i've noticed if there null objects in json model model binder instantiate these items instead of keeping them null in server side object. this in contrast how normal mvc controller bind data...it not instantiate object if null in json. mvc controller public class homecontroller : controller { [httppost] public actionresult test(model model) { return json(model); } } webapi controller public class apicontroller : apicontroller { [httppost] public model test(model model) { return model; } } model class posted public class model { public int id { get; set; } public widget mywidget { get; set; } } class used in model class public class widget { public int id { get; set; } public string name { get; set; } } here results when post json model each controller: $.post('/home/test', { id: 29, mywidget: null }) //results in: {"id":29,...

If an Arduino Mega only has 8 kb of SRAM, how am I able to use 14 kb without bugs? -

solved apologies wasting peoples' time, comment on compiling verbose made me realize i'm using 91% available, had 0 in 1 of calculations! i've been working on arduino sketch number of years, adding more variable declarations. upped size of array of longs 24*70 24*100 , seemed cause unexplainable errors. (i have many other arrays biggest.) i decided count how many bytes approximately declaring in sketch , counting bigger array structures came approximate number of @ least 14,000 bytes (taking account longs 4 bytes etc). how possible? other 6000 bytes being stored? should add i've been using number of years, upping of bytes used 14 kb approximately 17 kb caused bugs.

javascript - Mobile native browsers detection script -

i'm tying wrote script detect mobile browsers not supports css 100vh value: var is_android = ((nua.indexof('mozilla/5.0') > -1 && nua.indexof('android ') > -1 && nua.indexof('applewebkit') > -1) && !(nua.indexof('chrome') > -1)); if (is_android) { document.write('<link rel="stylesheet" type="text/css" href="moz5.css">'); } else { document.write('<link rel="stylesheet" type="text/css" href="maxi.css">'); } this code should target android native browser, targetting ie mobile too. is better js way target mobile browsers or browsers arent supporting css 100vh , 100vw value? it better use feature detection rather browser/device sniffing. use modernizr or see how doing here .

install - Android studio installation issues -

Image
i not able set installation location on android studio. when open installation setup, i'm not able view license agreement. i following: please help. well, see first time , looks strange, but... i hope you've installed oracle java 8. if not, find here: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html you don't need install android studio. on google's site there available .zip file, need unpack , run. look here: http://developer.android.com/sdk/index.html#other direct link: https://dl.google.com/dl/android/studio/ide-zips/1.5.1.0/android-studio-ide-141.2456560-windows.zip hope help

python - Dynamic function>form generation with PySide -

i'm exploring ways in automatically generate forms based on simple class methods of file. idea "items.py" package grows, "gui.py" automatically keeps tabs , bit of validation. got working bit: function file: def printhellosomeone(str_someone): print "hello %s" % str_someone def printn(int_n): print "%i" % int_n def printrange(int_min, int_max): print range(int_min, int_max) gui file: import inspect pyside import qtgui class autoform(qtgui.qformlayout): arg2gui = { 'int' : (qtgui.qspinbox, 'value'), 'str' : (qtgui.qlineedit, 'text'), } def __init__(self, (name, function)): super(autoform, self).__init__() self.function = function self.addrow(qtgui.qlabel(name)) self.call_list = [] arg in inspect.getargspec(function).args: self.call_list.append(self.arg2widget(arg)) button = qtgui.qpushbutton("run") button.clicked.connect(self.call...

jquery - Uninterrupted music using popunder or opening site in a new tab -

i have wanted keep writing on discussion, reputation doesn't allow me edit or answer (sorry that): uninterrupted background music on website so going point: i hate music on website, unfortunately couldn't find way change client's mind time. we working through comunication (graphic) agency, can't tell end client he's xxiot , need make agency happy since giving lot , right thing. so bottom line want music on site, , possibly have not restart @ each page load. i decided avoid frames. i'm struggling in between ways trying find "best" one: opening small popunder window music (imagine: "we recommend visit our website music..if hate close popup") pro: should not bad seo cons: popunder aren't reliable, browser changes , stop working, dont want spend time fixing that.. :) script tryed https://github.com/hpbuniat/jquery-popunder said works on firefox , ie, on chrome 25 opens popup, on safari doesn't work well. do vice vers...

cuda - How does the ABI defines the number of registers in GPU? -

there line in cuda compiler driver nvcc - options steering gpu code generation ambiguous me: value less minimum registers required abi bumped compiler abi minimum limit. does abi have standard or limitations number of registers __global__ , __device__ functions use? i think (can't find reference right now) cuda abi requires @ least 16 registers. if specificy lower register count (e.g. -maxrregcount) compiler bump specified limit minimum required abi, , print advisory message stating did so. maximum number of 32-bit registers available per thread, gpu architecture dependent: 124 registers sm_1x, 63 registers sm_2x, , 254 registers sm_3x. generally speaking, abi (application binary interface) architecture specific convention storage layout, passing of arguments functions, passing of function results caller etc.. abis (including x86_64, arm) designate specific registers specific tasks such stack pointer, function return value, function arguments etc. since gp...

javascript - 2D loops for building a table -

i want loop through two-dimensional structure in angularjs display in table. data looks follows: data = { "keya": ["valuea", "valueb"], "keyb": ["valuec", "valued"] } the output should this: <table> <tr> <th>keya</th> <td>valuea</td> </tr> <tr> <th>keya</th> <td>valueb</td> </tr> <tr> <th>keyb</th> <td>valuec</td> </tr> <tr> <th>keyb</th> <td>valued</td> </tr> </table> at moment angular enriched html doesn't work , looks follows: <table> <div ng:repeat="(key, values) in data"> <div ng:repeat="value in values"> <tr> <td>{{key}}</td> <td>{{value}}</td> </...

How to Access/Download OneNote notebook with Python? -

how access onenote notebook using python? there way export pdf or other file programmatically? notes taken hand, unfortunately can't parse text. i've found this article 2011, links dead , imagine outdated anyway. i've found this github don't see how implement want. alternatively, there language use? if notebooks stored in onedrive or office 365, can use onenote apis access them. information apis on http://dev.onenote.com/ . for sample code, check out https://github.com/onenotedev/ . there sample code (in c# , other languages) allows access pages in notebooks.

sql - Selecting multiple data from a database through PHP -

i have search form able retrieve username of user, can't figure out how return more that, want display first names , last names too. below code @ minute works, when try , add in more variables, example if ($stmt = $connection->prepare ("select username users username ?")) doesn't return @ , asks insert search query. i have tried if ($stmt = $connection->prepare ("select username users username %?%")) , like "%?%")) , no results. search.php <?php include 'connection.php'; if(isset($_post['searchsubmit'])) { include 'searchform.php'; $name=$_post['name']; if ($stmt = $connection->prepare ("select username users username ?")) { $stmt->bind_param('s', $name); $stmt->execute(); $stmt->bind_result($personresult); $stmt->fetch(); ?> <center> ...

javascript - HTML form skips required fields -

when press submit on html code access javascript if haven't entered required field "email". see litte "you need fill this" popup 0.5 seconds before sends me script. need do? seems it's problem in jquery maybe? haris. <form class="form-horizontal" role="form"> <div class="form-group"> <label for="inputemail" class="col-sm-3 control-label">epost :</label> <div class="col-sm-9"> <input type="email" class="form-control" id="inputemail" placeholder="epost" required="required"> </div> </div> <div class="form-group"> <div class="col-sm-offset-3 col-sm-3"> <button type="submit" href="javascript:;" class="simplecart_checkout"> <img src="/...

plsql - PLS-00103 Encountered the symbol "EOF" when expecting...error -

my error: ora-06550: line 3, column 3: pls-00103: encountered symbol "end-of-file" when expecting 1 of following: ; symbol ";" substituted "end-of-file" continue. this script i'm trying run begin bpt.insert_codes('test2','test', 'testing', 'abc',234); end;/ relevant stored procedure create or replace procedure bpt.insert_codes ( str_table_name in bpt.code_table_name.table_name%type, str_code in varchar2, str_desc in varchar2, str_user_id in bpt.city.user_id_ent_by%type, int_user_seq in number) /*******************************************declaration******************************** **********/ int_code_seq number(7); str_column_prefix varchar2(22); str_query ...

java - Jackson JSON - Strip Timezone from Calendar object while deserializing -

i have jackson deserializer convert date in json string calendar object. passing "2015-10-22" in request , gets converted "2015-10-22-04:00" after convert calendar object. there way suppress timezone being sent? in scenarios use xmlgregoriancalendar , using "date.settimezone(datatypeconstants.field_undefined)" suppress timezone. private static simpledateformat formatter = new simpledateformat("yyyy-mm-dd"); @override public calendar deserialize(jsonparser jsonparser, deserializationcontext arg1) throws ioexception, jsonprocessingexception { // todo auto-generated method stub string datestring = jsonparser.gettext(); try { calendar calendar = calendar.getinstance(); calendar.settime(formatter.parse(datestring)); return calendar; } catch (parseexception e) { throw new runtimeexception(e); } } no timezone sent, question "is there way suppress timezone being sent?" meanin...

ruby - Calling Class method via Rails ActiveRecord Association -

i have 2 classes as: class post < activerecord::base has_many :comments end class comment < activerecord::base belongs_to :post # class method # analysis on comments of given post def self.do_sentiment_analysis post_id = self.new.post_id # there better way post_id? # real code follows end end # class method called on post object this: post.find(1).comments.do_sentiment_analysis the question whether there better way know id of association object (post) on class method called. 1 way (which used above) is: post_id = self.new.post_id . bet there cleaner way don't have create object post_id . to answer question directly, comment.scope_attributes will return hash of attributes current scope on comment set. can test effect association has on i'm not sure i'd use though - seems little odd have class method can invoked on scopes of particular form.

jquery - Looping through external JSON file -

i have json file containing 2 different holiday resorts. compare values within 2 dropdown menus 2 values in json file. for example, if destination dropdown menu has value "caribbean" selected , comfortlevel dropdown has value "4" selected, search through external json file, find resort matching descriptions, , display information matching resorts. html: <div class="searchdestination"> <br> <label><b>select destination: &nbsp;</b></label> <select id="destination"> <option value="0">please select:</option> <option value="europe">europe</option> <option value="africa">africa</option> <option value="carribian">the carribian</option> <option value="asia">asia</option...

How to link a Bitmap to a button in C#? -

i'm beginner programmer , wondering how go linking image button. childrens maths game contains various questions "how many sheep there?", require them select button has value. sorry if simple thing i'm having issues it. thanks supposing doing windows forms application, first place button wherever want, can size it, put text on it... want, steps: select button , find properties tab attached in ide. in appearance, find property "text" , leave blank, if there text. in appearance section too, find backgroundimage , click button "..." in space. when window called "select resource" appears, select "local resource" , click "import". when selected, click ok. now image binded button background. resize want. i hope helps. there's not info in question.

javascript - Expecting a token named "token -

i can't figure out what's causing error https://github.com/sahat/satellizer satellize.js configurations withcredentials: !1, tokenroot: null, cordova: !1, baseurl: "/#", loginurl: "/auth/login", signupurl: "/auth/signup", unlinkurl: "/auth/unlink/", tokenname: 'token', tokenprefix: "satellizer", authheader: "authorization", authtoken: "bearer", storagetype: "localstorage", app.js .config(function($authprovider) { $authprovider.facebook({ clientid: '******' }); $authprovider.google({ clientid: '****' }); }) controller $scope.sociallogin = function(provider) { $auth.authenticate(provider) .then(function(data) { toastr.success('you have signed in ' + provider + '!'); $rootscope.$broadcast('session',2...

php - How to disable downloading a file from your web without a session variable? -

i don't hoy ask question, may repeated. let's see: disable downloading file web without download script (just using url: http://something/file.zip ) unless you're registered, php preferably. yes, it's common topic haven't found information! lot of pages this, such uploaded.net. hope understand i'm talking about. thanks! first , foremost, don't allow direct access file . store outside of web application's root folder, elsewhere on file system, there no link can used download it. because direct access skips php application , interacts web server, has no knowledge of application's session values. then create "download" script serve file users. such script given identifier file, like: http://yourserver.com/download.php?file=file.zip ( important: be careful how identify file. do not blindly let users download whatever want, or can enter longer paths onto url , download any file server. always validate access things ...

firebird - Data Pass Through in SymmetricDS -

i'm feeling little stupid, , searches answers haven't yielded else having problem. imagine have nodehq, node1 , node2. have created triggers synchronize tablea between 3 so: node1 <---> nodehq <---> node2 node1 , node2 have different subsets of data each other. nodehq has administrative information both nodes (subsets of both). each of 3 nodes in different node_group. right now, triggers , routers have setup, inserting/updating/deleting record @ nodehq works @ node1 , node2. however, if make change @ node1 or node2, makes nodehq. never passes through other. so far i've tried: setting sync_on_incoming_batch 1 triggers involved, no change creating separate sym_trigger each node_group, no change using transforms alter record innocuously, no change deleting , inserting of rules, no change using symadmin sync-triggers -f force trigger recreation, no change i've read user guides , down on this, , relatively unspecific this. http://www.symme...

sockets - Java charset - How to get correct input from System.in? -

my first post here. well, i'm building simple app messaging through console(cmd , terminal), learning, i'm got problem while reader , writing text charset. here initial code sending message, main.charset setted utf-8: scanner teclado = new scanner(system.in,main.charset); bufferedwriter saida = new bufferedwriter(new outputstreamwriter(new bufferedoutputstream(cliente.getoutputstream()),main.charset))); saida.write(nick + " conectado!"); saida.flush(); while (teclado.hasnextline()) { saida.write(nick +": "+ s); saida.flush(); } and receiving code: try (bufferedreader br = new bufferedreader(new inputstreamreader(servidor,main.charset))){ string s; while ((s = br.readline()) != null) { system.out.println(s); } } when send "olá" or "ÁàçÇõÉ" (brazilian portuguese), got blank spaces on windows cmd (not tested in linux). so teste following code: scanner s = new scanner(system.in,main.charset); syst...

parallel processing - OProfile with OpenMP -

i using oprofile openmp parallelized code doing following, $ gcc -i/usr/include/hdf5/serial/ -std=c11 -o3 -fopt-info -fopenmp sp_linsvm.c -o sp_linsvm -lhdf5_serial $ sudo ocount --events=cpu_clk_unhalted,llc_misses,llc_refs,mem_inst_retired,br_misp_exec, ./sp_linsvm events actively counted 22.0 seconds. event counts (scaled) /home/aidan/progs/linsvm/sp_linsvm: event count % time counted br_misp_exec 6,523,181 80.00 cpu_clk_unhalted 225,384,009,348 80.00 llc_misses 276,587,407 80.02 llc_refs 1,098,236,806 80.00 mem_inst_retired 51,754,855,734 79.99 how know if events counted per cpu or whole? pretty sure whole close numbers if compiled without openmp, want sure. default mode ocount ... ./program "command". understand, without -t ( --separate-thread ) or -c ( --separate-cpu ) option...

json - how to use dsp tags with jsonlib -

i want output data within jsp using json format. trying use json-taglib same. can please me combining jsontaglib atg dsp tags? below code. <%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %> <dsp:page> <json:property name="image" value="<dsp:valueof param='mysite.image'/>" /> <json:property name="name" value='<dsp:valueof param="mysite.name"/>' /> </json:object>` </dsp:page> but code above printing dsp:valueof tags instead of it's value. why? also, need use foreach droplet print out nested json array.can me example on how can achieve that? tia since explicitly importing json taglib, might need import dsp taglib too? apart missing starting tag <json:object> , rest appears correct. an example of using foreach droplet generate nested json array follow: <dsp:importbean bean="/atg/dynamo/droplet/foreach"...

regex - PHP Regular expressions not working -

i've been using regexr.com build , test regular expressions use in php programs. however, 1 particular expression, seems work on website not in program , not sure why i trying match eu label data (ex: g c 71) in following string: "viking snowtech ii 165/70 r13 79t winterreifen auf lager g c 71 dbkundenbewertung (2.00) 29,50 € details in den einkaufswagen" the regular expression '#\s\w\s\w\s\d{1,}#' works fine on regexr.com finds no match in program $eulab = $row_html -> plaintext; if( preg_match('#\s\w\s\w\s\d{1,}#', $eulab)){ $insert['eulab'] = $matches[0]; }else { echo "no match"; } i've tried other expressions \s{1}[a-z]{1}\s{1}[a-z]{1}\s{1}\d{1,}\s{1} work on regexr find no match in program. encoding issue? or php syntax? no errors being thrown. my problem browser displaying single whitespace when there more that. altered expression correct , worked. ...

Can spark-defaults.conf resolve environment variables? -

if have line below in spark-env.sh file export my_jars==$(jars=(/my/lib/dir/*.jar); ifs=,; echo "${jars[*]}") which gives me comma delimited list of jars in /my/lib/dir , there way can specify spark.jars $my_jars in spark-defaults.conf ? tl;dr no, cannot, there is solution. spark reads conf file properties file without additional env var substitution. what write computed value my_jars spark-env.sh straight spark-defaults.conf using >> (append). last wins no worry there many similar entries.

html - how to add a scrollbar inside a table with fixed header? -

can me adjust scrollbar inside table fixed header? table a:link { color: #666; font-weight: bold; text-decoration:none; } table a:visited { color: #999999; font-weight:bold; text-decoration:none; } table a:active, table a:hover { color: #bd5a35; text-decoration:underline; } table { font-family:arial, helvetica, sans-serif; color:#666; font-size:12px; text-shadow: 1px 1px 0px #fff; background:#eaebec; margin:20px; border:#ccc 1px solid; -moz-border-radius:3px; -webkit-border-radius:3px; border-radius:3px; -moz-box-shadow: 0 1px 2px #d1d1d1; -webkit-box-shadow: 0 1px 2px #d1d1d1; box-shadow: 0 1px 2px #d1d1d1; } table th { padding:21px 25px 22px 25px; border-top:1px solid #fafafa; border-bottom:1px solid #e0e0e0; background: #ededed; background: -webkit-gradient(linear, left top, left bottom, from(#ededed), to(#ebebeb)); background: -moz-linear-gradient(top, #ededed, #ebebeb); } table th:first-child { te...

javascript - Separate activation of <span> inside <li> of JQuery Menu -

i wondering if can have separate element( <span> ) on <li> using jquery menu, default style activating entire <li> , need have activate <span> being hover/focus user. possible or can guide me on should start? <ul id="menu"> <li>a</li> <li>b <ul> <li><span>b - 1.1</span><span>b - 1.2</span></li> <li><span>b - 2.1</span><span>b - 2.2</span></li> </ul> </li> <li>c</li> </ul> see fiddle demo activates b - 1.1 , b - 1.2 simultaneously. does kinda work you: .ui-menu .ui-menu > .ui-menu-item.ui-state-focus > span {background: #fff;} .ui-menu .ui-menu > .ui-menu-item.ui-state-focus > span:hover {background: transparent;} fiddle: https://jsfiddle.net/s7z9dpdd/ tried version padding: .ui-menu .ui-menu > .ui-menu-item.ui-state-focus > span {background: #fff...

ios - While building sign-in with twitter on safari for iphone, how can I use the accounts already added in my settings -

im trying build sign-in twitter on web application, redirects twitter sign-in shows app permissions page etc , comes application after authentication, want is, if have twitter app installed, , im signed it, want use information in web application running on safari. how do in case possible.

spring - No qualifying bean of type is defined [duplicated] -

currently experiencing beannameaware interface not working if aop implementing in knight bean. why happening? because of cglib conflict? reference using spring framework 3 here bean code public class braveknight implements beannameaware{ private quest quest; public void setquest(quest mockquest){ this.quest = mockquest; } public void embarkonquest(){ quest.embark(); } @override public void setbeanname(string beanname) { system.out.println(beanname +" bean has been initialized..." ); } } application context <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemalocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.2.xsd http://www.springframework.o...

ios - Why is QML deleting my C++ ListView model? -

using qt 5.5.1 on ios 9 i'm trying assign dynamically created qabstractlistmodel model property of listview : window { listview { model: api.model() delegate: delegate } component { id: delegate text { text: "test" } } } api c++ object assigned qml context setcontextproperty . model method q_invokable returns qabstractlistmodel * . works, listview populated data. the problem when start scrolling. after second full scroll (to bottom, top , down again) listview starts clear out. debugger telling me qabstractlistmodel being destroyed. i don't want set cppownership on model. there way prevent listview destroying model? qml seems kind of broken in regard, i've experienced arbitrary deletions of objects still in use in multiple scenarios. objects parents , referenced js engine being deleted no apparent reason while js garbage still takes hundreds of megabytes of memory instead of being fr...

C++ Output: GUI or Console? -

i making application in c++ runs simulation health club. user enters simulation data @ beginning (3 integer values) , presses run. after there no user input - simple. after starting simulation lot of logic deep down in lower classes lot of them need print simple output messages ui. returning message not possible objects need print ui keep working. i going pass reference ui object classes need end passing around quite lot - there must better way. what need can make calling ui's printoutput(string) function easy (or not more difficult) cout << string; the ui has displayconnectionstatus(bool[] connections) method. bear in mind ui inherits abstract 'userinterface' class simple console uis , guis can changed in , out easily. how suggest implement link ui? if use global function, how can redirect call methods of userinterface implementation selected use? don't afraid of globals. global objects hurt encapsulation, targeted solution no concern...

image processing - Digitize a file showing spatial area using Matlab -

Image
i have following scanned image of area want digitize in terms of coordinates , depths , depths shown in terms of contour lines. depths shown in above image number on contour line. divide image in terms of grids/pixels , 2 data - representing it's (x, y) coordinates , depth - every grid/pixel. is there matlab function or file exchange in matlab can used perform task doing manually? perform task faster if done manually. thanks!

python - Feedparser - KeyError: 'fullcount' -

i have tried follow this guide . making physical gmail notifier. when entered same code found error: traceback (most recent call last): file "c:/python27/projects/gmailnotifier.py", line 20, in <module> )["feed"]["fullcount"]) file "c:\python27\lib\site-packages\feedparser-5.1.3-py2.7.egg\feedparser.py", line 375, in __getitem__ return dict.__getitem__(self, key) keyerror: 'fullcount' i not sure why , thats why im asking. using windows 7, python 2.7.3, feedparser 5.1.3 , pyserial 2.6 here full code: import serial, sys, feedparser #settings - change these match account details username="mymain@gmail.com" password="mypassword" proto="https://" server="mail.google.com" path="/gmail/feed/atom" serialport = "com3" # change serial port! # set serial port try: ser = serial.serial(serialport, 9600) except serial.serialexception: sys.exit() newmai...

Generate HTML table from 2D JavaScript array -

in javascript, possible generate html table 2d array? syntax writing html tables tends verbose, want generate html table 2d javascript array, shown: [["row 1, cell 1", "row 1, cell 2"], ["row 2, cell 1", "row 2, cell 2"]] would become: <table border="1"> <tr> <td>row 1, cell 1</td> <td>row 1, cell 2</td> </tr> <tr> <td>row 2, cell 1</td> <td>row 2, cell 2</td> </tr> </table> so i'm trying write javascript function return table 2d javascript array, shown: function gettable(array){ //take 2d javascript string array input, , return html table. } here's function use dom instead of string concatenation. function createtable(tabledata) { var table = document.createelement('table'); var tablebody = document.createelement('tbody'); tabledata.foreach(function(rowdata) { var row = document.createele...

jvm - Cannot find sun.tools.java.* while compiling openjdk-7 -

i trying compile openjdk-7 source code on ubuntu 14.04: export lang=c alt_bootdir=/usr make i saw errors like: symbol: class classnotfound location: class compoundtype ../../../../src/share/classes/sun/rmi/rmic/iiop/compoundtype.java:1299: error: cannot find symbol these missing classes in package named sun.tools.java . suspect these nonstandard libs required jdk build process. cannot find relevant information in online build tutorials. these missing classes , how can fix them? thanks. some applications need tools.jar jdk has these packages. used runtime compilation of generated code. add class path jdk. note: these not package pass via rmi however. have @ classes see why need this.

c# - Can using UnmanagedMemory.LPTStr instead of .ByValTStr result in memory corruption? Why? -

we have tree view in windows forms app shows files using appropriate file icon using following code. problem call geticon() appears corrupt memory start getting various program crashes can't catch debugger after call. program work when change managedtype.lptstr managedtype.byvaltstr . true fix or masking problem? this code appeared working in our last product release , can't see has changed. using .net 4.0. see issue in release mode. [dllimport("shell32.dll")] private static extern int shgetfileinfo(string pszpath, uint dwfileattributes, out shfileinfo psfi, uint cbfileinfo, shgfi uflags); [structlayout(layoutkind.sequential)] private struct shfileinfo { public shfileinfo(bool b) { hicon=intptr.zero; iicon=0; dwattributes=0; szdisplayname = ""; sztypename = ""; } ...

c# - How to install OpenGL/OpenTK on client windows 7 machine? -

our c# winforms opentk based application unable run on windows 7 32bit client machine because relies on opengl 1.5 features. appears due absence of proper opengl dlls on machine, defaulting opengl 1.1 emulator described here: https://www.opengl.org/wiki/getting_started#windows the graphics card supports opengl 4.2: http://www.geforce.com/hardware/desktop-gpus/geforce-gt-520/specifications we have installed latest nvidia drives nvidia website under full admisitrator rights. however still when run opentk samples requiring opengl 1.5 (eg. "picking" or "vbo static/dynamic") errors specifying machine on opengl 1.1, or "access violation". i have searched web solutions no avail , banging our heads against wall. what correct, reliable way install latest opengl on windows machine physically supports opengl 4.2? however still when run opentk samples requiring opengl 1.5 (eg. "picking" or "vbo static/dynamic") errors ...

php - Change Field Name Tax To Vat -

Image
i using php paypal restfull sdk. when user redirect paypal site payment. know display items list & amount information. need display vat in replacement of tax label. how can change label of tax ? please let me know . link of sdk: https://github.com/paypal/paypal-php-sdk issue : https://github.com/paypal/paypal-php-sdk/issues/460 don't know why saying not possible. here proof: here code . function paypal_payment(){ if ($config) { set_config($config); } require __dir__ . '/../bootstrap.php'; $payer = new payer(); $payer->setpaymentmethod("paypal"); foreach ($pay_data->item_list $item) { $item1 = new item(); $item1->setname($item['title']) ->setdescription($item['description']) ->setcurrency($pay_data->currency) ->setquantity($item['quantity']) ->settax($item['tax']) ...