Posts

Showing posts from February, 2014

python - Program stuck in while loop not printing -

import random def usertype(): randletter = random.choice('qwer') userinput = raw_input('press '+str(randletter)) if userinput == randletter: return 'correct' else: return 'incorrect' def usertypetest(x,y,result): while x <= 9: result = usertype() if result == 'correct': x = x+1 y = y+5 else: x = x+1 y = y-2 return str(y)+'is score' print usertypetest(0,0,usertype) here code. want ask user press button, randomly chosen set (q, w, e, r), print either correct or incorrect, depending on button press. want happen 10 times. after ten tries print score: 5 each 'correct' , -2 'incorrect'. instead receive this. press e(e) press e(e) press w(e) press q(e) press q(e) press q(e) press r(e) press e(e) press w(e) press q(e) press e(e) press e(e) press e(e) press e(e) press q(e) press w(e) press r(e) press w(e) press r(e) press w(e) pres

python - Trouble embedding bokeh plot -

in working on flask website allow users plot data, decided use bokeh instead of matplotlib seems built embedding, ability use dynamic data. i've scoured online examples, , bokeh documentation. in examples see command 'create_html_snippet', supposed return snippet of html can inserted template: from bokeh.plotting import * import numpy np # define function return html snippet. def build_plot(): # set output our plot. output_file('plot.html', title='plot') # create data our plot. x_data = np.arange(1, 101) y_data = np.random.randint(0, 101, 100) # create line plot our data. line(x_data, y_data) # create html snippet of our plot. snippet = curplot().create_html_snippet(embed_base_url='../static/js/', embed_save_loc='./static/js') # return snippet want place in our page. return snippet i'm running code in conjunction main flask code below: from flask import flask, render_template

Selecting Model for offline speech recognition in Android -

i want implement cmu sphinx speech recognition toolkit in project in android. want ask demo project me in implementation in project, want ask model being used , how? for want ask demo project me in implementation in project you can find demo here http://cmusphinx.sourceforge.net/wiki/tutorialandroid also want ask model model being used , how? models located in assets folder in demo application. can learn more models , how used in recognition tutorial http://cmusphinx.sourceforge.net/wiki/tutorial

javascript - Vertically align sans-serif font precisely using jquery/css -

i'm trying align sans-serif headline precisely menu elements in other div-elements, this: header b c where aligned left end of header , c right end. use float distribute -elements , compute font-size fit header div width. problem use sans-serif font. problem demonstrated in fiddle http://jsfiddle.net/ksutq/2/ <div id="hideheader" class="header" style="position: absolute;font-size:40pt;padding:0px;visibility: hidden;width:auto;height:auto;">header</div> <div id="header" class="header">header</div> <div id="menubar" class="menubar"> <div class="menubutton_left"><a href="#" id="workbutton">a</a> </div> <div class="menubutton_middle"><a href="#" id="aboutbutton">b</a> </div> <div class="menubutton_right"><a href="#&quo

Execute PL/SQL script in C++ using OCCI oracle -

i want run sql script c++ program. code goes this: int main() { //..... sql_stmt = "insert t1 values ('qwerty');\ninsert t1 values ('dothar');" "//and many more insert statements"; sql_stmt = "declare\nrollback_check_counter number;\n" "begin\n" "rollback_check_counter :=1;\n" "savepoint sp_1;\nif rollback_check_counter = 1 then\n" "begin\n"+sql_stmt+"exception\n" "when program_error then\n" "rollback_check_counter :=0;\n" "rollback sp_1;\n" "when others then\n" "rollback_check_counter :=0;\n" "rollback sp_1;\n" "end;\n" "end if;\n" "commit;\n" "end;"; try { connection *conn = env->createconnection(user,passwd); //error prone statement *stmt = conn->createstatement(); stmt->setsql(sql_stmt); row_count = stmt->execute(); //stmt->execute(sql_s

jasper reports - How to properly stretch with overflow for non-detail band -

Image
i have fields in title , page header have multiple lines. want them stretch vertically problem field below stretched field missing. grouped them using frame. the properties set: position type : float stretch type : relative tallest object stretch overflow : true please see below screen shot. you can try these properties of text : - for first field (cashier name) of title band use properties :- position type- fix relative top stretch type- relative band height stretch overflow - true for second field (date) set these properties position type- fix relative bottom stretch type- no stretch stretch overflow- false in report can see properties if run report sample hsql database in ireport :- <?xml version="1.0" encoding="utf-8"?> <jasperreport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemaloca

actionscript 3 - A3 Arrays of movieClips -

[as3.0] i'm working on graduation diploma , have problem managing movieclips same instance name..sort of. i'm creating array of objects class arrays in frame 1: package { import flash.display.movieclip; public class createfractionbuilding { public function createfractionbuilding(_fractionbuildingmovieclip:movieclip, _fractionbuildinglevel:number,_fractionbuildingcost:number, _fractionbuildingframe:number) { fractionbuildinglevel = _fractionbuildinglevel; fractionbuildingcost = _fractionbuildingcost; fractionbuildingmovieclip = _fractionbuildingmovieclip fractionbuildingframe = -fractionbuildingframe } public var fractionbuildinglevel:number,fractionbuildingcost:number,fractionbuildingframe:number; public var fractionbuildingmovieclip:movieclip } } on main timeline i'm refering class creating array of objects: var allhumanbuildingslist:array = new array(); va

What do scripts(stored in bin directory of the project) do in addition to modules in a python project? -

i have been following lpthw ex. 46 in says put script in bin directory can run. don't idea of using script when have modules. significance scripts provide? scripts executable *.exe files(in case of windows) rather modules compiled python? if modules provide code needed project scripts provide code needed execute them? how scripts , modules linked each other, if so? scripts can used stand-alone programs tasks both simple , complex. when put them in bin directory, , have bin directory in path , can execute them exe , assuming have configured interpreter correctly (in windows), or have put #!/usr/bin/python top line linux. for example, might write python script computes mean of list of numbers passed stdin , stick in bin directory, , execute c program same purpose.

githooks - pull hook after pushing to a git repo -

when 1 pushes specific branch in git repository want automatically pulled web server directory on same machine. it looks post-receive hook in order haven't been able find example of how write such hook. can point me in right direction?

python - Sleep takes 86% of time in rabbitpy consumer? -

Image
i found rather interesting problem today. have queue 2k messages in it. consumer: import rabbitpy rabbitpy.connection('amqp://guest:guest@localhost:5672/%2f') conn: conn.channel() channel: queue = rabbitpy.queue(channel, 'example') message in queue.consume_messages(): message.ack() takes 41 seconds these messages , ack them. (messages vary 4kb 52kb ) publisher, however, took 15 seconds publish them. upon profiling, found there call sleep spend 86% of time. this, application, not acceptable. me rid of sleep? (i'm ok if cpu cycles wasted or whatever till message arrives.) zoomed in screenshot

jquery - Datetimepicker bootstrap not functioning with properly with CSS bootstrap file -

i'm using datatimepicker of bootstrap , it's working extent. select date fine stuck @ time icon if want select time. if remove css/bootstrap.css file performs fine loose layout. it's obvious conflict of files, , wanted know if fix it? thank much <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <script src="//code.jquery.com/ui/1.10.4/jquery-ui.js"></script> did try chaning order in occur in html file? if 1 style-sheet more important put last. if dosn't slove issue have manually fix css conflicts in each file, or might consider go bootstrap , compose own css fitting neeeds

qt - QComboBox text colour won't change with style sheet -

Image
i'm trying style combobox in qt5. i'm using qt creator layout , loading app-wide style sheet @ start up. the css have related combobox follows: qcombobox { color:white; background-color: qlineargradient(x1:0, y1:0, x2:1,y2:1, stop: 1 rgba(228, 41, 81, 100), stop: 0 rgba(234, 107, 101, 100)); border-color: rgba(255,255,255,200); border-width: 1px; border-style: solid; } qcombobox qlistview { border-style: none; background-color: qlineargradient(x1:0, y1:0, x2:1,y2:0, stop: 1 rgba(228, 41, 81, 100), stop: 0 rgba(234, 107, 101, 100)); } qcombobox::drop-down { width: 20px; border: 1px; border-color:white; border-left-style:solid; border-top-style: none; border-bottom-style: none; border-right-style: none; } qcombobox::down-arrow { image: url(:/arrowimages/images/whitearrowdown16.png); width: 16px; height: 16px; } but text colour in combo box remainds default (black) colour. colour in drop down white. b

haskell - Why is a built-in function applied to too few arguments considered to be in weak head normal form? -

the haskell definition says: an expression in weak head normal form (whnf), if either: a constructor (eventually applied arguments) true, (square 42) or (:) 1 a built-in function applied few arguments (perhaps none) (+) 2 or sqrt. or lambda abstraction \x -> expression. why built-in functions receive special treatment? according lambda calculus, there no difference between partially applied function , other function, because @ end have 1 argument functions. a normal function applied argument, following: (\x y -> x + 1 : y) 1 can reduced, give: \y -> 1 + 1 : y in first expression, "outermost" thing application, not in whnf. in second, outermost thing lambda abstraction, in whnf (even though more reductions inside function body). now lets consider application of built-in (primitive) function: (+) 1 because built-in, there's no function body in can substitute 1 first parameter. evaluator "just knows"

parse through urllib2 in python -

i want convert following statement urllib urllib2 equivalent statement params = urllib.parse.urlencode( {'status': msg} ) i can import urllib2 , urlparse . urllib2 not "2nd version" of urllib . it's not possible "translate" functionality urllib urllib2 . even the documentation urllib2 states should use urllib url encoding. extracted urllib2.urlopen documentation : ...data should buffer in standard application/x-www-form- urlencoded format . urllib.urlencode() function takes mapping or sequence of 2-tuples , returns string in format.

javascript - Appending to dynamic content -

i have set dynamically created divs same class name. want append entirely new div of above mentioned divs. say class name extra-upper-block at end of page have code <script> //function call load dynamic content </script> <script> $('.extra-upper-block').append('<div>new div</div>'); </script> this throws error in chrome's console uncaught typeerror: undefined not function but when code executed in chrome's console after page loaded, works! why doesn't work when load dynamic content before executing append command. help? use jquery class selector. $(document).ready(function(){ $('.extra-upper-block').append('<div>new div</div>'); }); wrap code in $(document).ready() jquery elements available, , include jquery file reference. note : .append() method part of jquery. demo

tld - More than one top level domain? -

in normal url, have protocol, subdomains (optional), domain name, top level domain , subdirectories. for example: http://www.google.com/path . here www subdomain, google domain name , com tld; path subdirectory here. parsing simple programming task. but problem comes when there more 1 tld's. example: www.google.co.in/path . here co.in tld. see there website name www.co.in present. my doubts are: how many top level domains can url have? in url how find top level domains, if there multiple tlds? in above example google.co.in not subdomain of co.in , how come www.co.in resolving different website google.co.in ? if have write algorithm decides "www.co.in" belongs india top level domain (tld) , "www.google.co.in" belongs india second level domain (sld), go here , grab list: https://wiki.mozilla.org/tld_list then, process url this: compare the last part of url tlds in list , find matching one. [www.google.co.in -> in, www.co.

wordpress - New theme creation and plugin Installation -

how install plugin in newly created theme i converting html site wordpress. gallery installed "jquery lightbox native galleries". not working new theme. don't know issue. please me. in advance. there might jquery conflicting. avoiding jquery confliction make sure calling latest jquery library ones in theme. regards

apache pig - Finding the difference between start_times and end_times in PIG -

could please tell me how find difference between 2 times in pig... for e.g., below sample start_times , end_times, need find difference between start_time , end_time in pig. 12:31:38,14:54:04 10:18:34,13:30:56 13:37:43,15:18:57 08:15:10,11:28:17 thanks in advance... couldn't find straightforward way. here workaround: t = load ' input/data' using pigstorage(',') (time1:chararray,time2:chararray); u = foreach t generate secondsbetween(todate(time2,'hh:mm:ss'),todate(time1,'hh:mm:ss')) seconds; v = foreach u generate seconds/3600 hours,(seconds%3600)/60 minutes,(seconds%3600)%60 seconds; store v 'output/data' using pigstorage(':'); output sample data code: 2:22:26 3:12:22 1:41:14 3:13:7

vba - Force no empty cell depending on another cell in Excel -

is possible in excel force no empty cell depending on cell? mean if type in e.g. casenumber in a1, have type in in b1 , c1 also. , should dynamic, should work on cells in column b , c, should @ cell in same row in column a. just more details.... because original sheets isn't designed exported, need copy appropiate data sheet before exporting. so have ungly sheets filled out cell copy nicer layout on sheet, in turn export csv. i use code copy data: private sub copyallnonblanksinrange() sheets("flexhal tilbudsregistrering") .columns("e").specialcells(xlcelltypeconstants).copy destination:=sheets("ark1").range("a1") .columns("f").specialcells(xlcelltypeconstants).copy destination:=sheets("ark1").range("b1") .columns("g").specialcells(xlcelltypeconstants).copy destination:=sheets("ark1").range("c1") end end sub so problem in copy process, as should cop

mysql - How to calculate MLM User Income points in php -

Image
i'm trying calculate income points mlm network users (i.e)., i'm having 5 types of kits such rs.0/-, rs.1000/-, rs.2000/-, rs.4000/-, rs.10000/- . once kit purchased unique pin , user id generate each individual kit if 2 number of 2000/- kit purchased means userid , pin 2000100 539fdda37c435 , 2000101 5395b0d8b66d1 ..... then based on new user sponsor id(sponsor id old user), registration proceed group left , right. now what's problem while calculating income point of user how can take children user top bottom. i'd strucked in mysql query. for example., now how can each node's value parent node(1) root node(12) dynamic tree in php ?? struck in loop concept., thanks in advance., database architecture id par lev lef rgt status wallet userstatus 1 1 1 2 3 1 0 0 2 2 2 4 5 1 0 0 6 3 2 6 7 1 0 0 8 4 3 8 9 1 0 0 9 5 3 10 11 1

php - How to send information from android app to server? -

hello everone started studying webservices in android , tried save information android app server for firstly made php file. tried insert code using that. succesful in inserting code using php code file <?php $con=mysqli_connect("localhost","root","","abhi_db"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } // escape variables security $uname = mysqli_real_escape_string($con, $_post['uname']); $email = mysqli_real_escape_string($con, $_post['email']); $sql="insert user_records (user_name, email) values ('$uname', '$email')"; if (!mysqli_query($con,$sql)) { die('error: ' . mysqli_error($con)); } echo "1 record added"; mysqli_close($con); ?> after tried send information app server hitting url. code used is public class mainactivity extends activity { textview tv1; httpclient httpclie

c# - Method Within A Method -

i creating c# library reusable code , trying create method inside method. have method this: public static void method1() { // code } what this: public static void method1() { public static void method2() { } public static void method3() { } } then choose either method1.method2 or method1.method3 . compiler isn't happy this, appreciated. thanks. no, can't that. could create nested class: public class containingclass { public static class nestedclass { public static void method2() { } public static void method3() { } } } you'd call: containingclass.nestedclass.method2(); or containingclass.nestedclass.method3(); i wouldn't recommend though. usually it's bad idea have public nested types. can tell more you're trying achieve? there may better approach.

arm - What are ATAGs for a device that uses Linux Kernel? -

i trying understand how kernel boots. trying port new kernel htc incredible s vivo (s710e) device, cannot boot. so, looked device's original kernel, , looked through documentation, , found out device uses atags. now, have several questions cannot find clear answer for: what atags? what used for? how kernel boot using atags? do atags play vital role in booting kernel? atags arm tags. used carry information such memory size boot code kernel. references (which in turn lead other references): booting standards, customized atag . this reference arm/booting explains theory, not tell user do. on target use following in u-boot config: config_cmdline_tag, config_setup_memory_tags, , these in kernel config: config_atags=y, config_use_of not set. not sure if sufficient gives clues search on, luck.

xcode - How to compile for all OS X architectures from the command line? -

i build portable c program gcc , make . on os x want include os x architectures local compiler supports. if specify: gcc -arch x86_64 -arch i386 -arch ppc -arch ppc64 ... the build fails on new xcode, ppc , ppc64 not supported. how pick architectures xcode on build machine supports?

String hostname from properties file: Java -

this may sound simple problem can't figure out way around this. i have config.properties file contains 2 key values: ip address , port number. read config file extract key values in string format. however, when trying use these values, unable connect ip address retrieved config file. the reason values read in string format , need convert them proper formats before using them. want value "192.168.1.40" stored in config file converted string host format. tried using inetaddress gives error. contents of config file are: ip=192.168.1.40 port=9124 the code uses these values follows: properties prop = new properties(); string propfilename = "...//testjedis//resources//config.properties"; prop.load(new fileinputstream(propfilename));//testjedis/resources/config.properties"));// configstream); jedis jedis=new jedis(prop.getproperty("ip"),integer.parseint(prop.getproperty("port"))); //jedis jedis = new jedis("192.168.

php - Add base64 image from canvas to pdf button -

i have html form uses canvas allow users sign name. there quite lot of code involved in project, difficult copy/paste working code. when form submitted, fields , base64 string (e.g. "data:image/png;base64,blahblahetc") sent processing -- field values saved database, , signature images saved server. the parts uncertain are: 1 - can add signature image icon on designated button on final pdf? there better way signature image onto pdf? i've seen can't manage use following syntax: << /t (button1)/apref << /n << /f (http://www.yoursite.com/pfds/icons.pdf)/name (icon3)>> >> >> 2 - achieve preparing .png or .pdf file set button? have been successful in generating .png on server, haven't tried .pdf because don't know if need it. 3 - using php , pdftk fill final pdf dynamic fdf. need perform special preparations on signature button on pdf template? think read setting layout "icon only." i ears if ha

javascript - Radio button REQUIRED if input field has content -

i have a reasonably quick problem solve (i think). have form online , validates required content user's data, has no validation on first part of form. i've been asked if can make radio button required depending on whether input field has been filled in. the form can found here: http://www.elcorteingles.pt/reservas/livros_escolares/form.asp so if person start's filling in input fields on first line, radio buttons in group become required (for either cdrom ou caderno not both) you can handle focusout , blur events input : $(function () { // handle every input type text. // select specific inputs, give them common class , change // selector accordingly. $("input[type=text]").on("focusout blur", function () { // check inputs class radio_btns in // parent element (li). // set required property. $(this).parent().find("input.radio_btns") .prop("required", $(

android - Getting facebook user id using Facebook SDK -

i'm using facebook login @ app, , able neccesery information logged in user (first , last name, id. gender etc..) can open specific profile id. since i'm working latest facebook sdk i'm not able user id. i've noticed there few changes in sdk issue thing i'm missing user id. can other information except id - gives me wrong id (17 digits). when check through browser (using graph instead www) can see user id including 10 digits. here's code: private void onsessionstatechange(final session session, sessionstate state, exception exception) { if (state.isopened()) { log.i(tag, "logged in..."); @suppresswarnings("deprecation") requestasynctask request = request.executemerequestasync(session, new request.graphusercallback() { @override public void oncompleted(graphuser user, response response) { if (session == session.getactivesession()) { if (

kendo ui - Uncaught TypeError: Cannot read property 'replace' of undefined with KendoTreeView` -

below kendoui tree view, using templates show edit link on each node, getting error: "uncaught typeerror: cannot read property 'replace' of undefined " @section scripts{ <script src="~/scripts/kendo.all.min.js"></script> <script type="text/javascript"> var territory = new kendo.data.hierarchicaldatasource({ transport: { read: { type:'post', url: rooturl + "territory/allterritories", datatype: "json" } }, schema: { model: { id: "id", haschildren: "haschildren", children: territory } } }); $("#treeview").kendotreeview({

c++ - Declaring an array with constant size - compilation error -

can me explain this: i declare constant in headerfile: const int incrsize; then in mil constant initialized: : incrsize(10) then later on in function in code (its callback-function used in gtkmm-gui bool mywindow::on_drawing_expose_event(gdkeventexpose* event) i allocate array on stack using constant double arrpxstep[incrsize]; when compiling following errors: -expected constant expression - cannot allocate array if constant size 0 - arrpxstep unknown size i know constant initialzed - how come array cannot use constant memeber-variable alreade initialized in mil? by looks of code post, incrsize non-static member of class. can't use initialize array, if value set same in constructor. it's rules. make incrsize static const member, defined within class, , work.

oncreate - Problems continued to change. Android -

i have timer in code. when screen orientation changed or when leave app button, timer not retain value. solved onpause, onstop, oncreate methods .... not know how. solution might in each case? u have store time value in onsaveinstancestate, inside in oncreate u have reassign saved time value.

javascript - jQuery doesn't catch the event -

i trying use following code jquery selection doesn't catch click event $('#addlevel').on('click', function() { var div = '<div class="form-inline">'; var addbutton = '<button class="btn btn-success additems" onclick="alert()" type="button">Добавить</button>'; div += addbutton; div += '</div>'; $('#levels').append(div); }); //i assume following code not working why? $('.additems').eq(0).on('click', function() { alert('clicked'); }); thank you then try add handler .additems there no such dom nodes. @blgt said must use event delegation: $(document).on('click', '.additems:first', function() { alert('clicked'); }); p.s. better use parent node of .additems:first instead of document .

asp.net c# generate page event handler automatically -

asp.net vs 4.0 there way generate page event handler protected void page_loadcomplete(object sender, eventargs e){} protected void page_prerender(object sender, eventargs e){} automatically in c# editor? ( possible in vb using top of page dropdown list) or have retype them manually every page.

How to search singular/plurals in php mysql -

when enter word (ex: freshers) want fresher , freshers records both getting freshers records. code this: $search='freshers'; $qry=mysql_query("select count(*) jobs job_title '%$search%' or match(job_title) against('$search' in boolean mode)"); when search word freshers m getting count 1200. when search word fresher again getting count 2000. how same count when enter either freshers or fresher. you cannot precisely same matching-record count mysql technology search term that's either singular or plural. mysql doesn't have smarts know freshers plural of fresher or children plural of child . if want mysql you'll have start search singular form of word want plural. neither mysql know mice plural of mouse . if need automated plural/singular functionality may want investigate lucene or other natural language search tech. name of capability seek "stemming." but can use fulltext search terms trailing ast

json - How to post form data for new person to Pipedrive (API) via REST -

here form not work: <form action="https://api.pipedrive.com/v1/persons" method="post"> <!-- these hidden fields have valid values, not shown here --> <input type="hidden" name="owner_id" id="owner_id" value="my-id" /> <input type="hidden" name="org_id" id="org_id" value="my-company-id" /> <input type="hidden" name="api_token" id="api_token" value="my-api-key" /> <input type="hidden" name="stage_id" id="stage_id" value="35" /> <b>name</b><br/> <input type="text" name="name" id="name" id="name"/> <br/><br/> <b>e-mail</b><br/> <input type="text" name="email" id="email" id="email"/>

Windows Phone create DirectX App and C# library -

Image
my visual studio 2013 had updated update 2 directx application changed "c# interprop c++ dll" "all c++". now want create directx application have use classes in dll library written in c#. how can that?

android - ListActivity layout not having margins around -

Image
edit: problem seems with: requestwindowfeature(window.feature_indeterminate_progress); within oncreate... don't know why... i have code: public class bluetoothdiscovery extends listactivity { @override protected void onlistitemclick(listview l, view v, int position, long id) { string mac = this.discoveredprinters.get(position); intent = new intent(); i.putextra("mac", mac); setresult(result_ok, i); // finalizamos el activity finish(); } private arraylist<string> discoveredprinters = null; private arrayadapter<string> marrayadapter; private static discoveryhandler btdiscoveryhandler = null; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); requestwindowfeature(window.feature_indeterminate_progress); // configuramos el theme del activity utils.setcustomtheme(this, getapplicationcontext(), true); setcontentview(r.layout.discovery_results); -

c# - Mangling column names in MSSQL for security -

i joined new project previous product manager decided mangle column names in majority of tables, hear aimed @ security/protection of our code since major part sql stored procedures. here's simple visualization: +-----------+------------+----+----------+-------+ | c1 | c2 | c3 | c4 | c5 | +-----------+------------+----+----------+-------+ | john doe | 11-11-1944 | m | street 1 | julie | +-----------+------------+----+----------+-------+ | mary jane | 13-02-1991 | f | street 2 | null | +-----------+------------+----+----------+-------+ somewhere agree him need mangle names, not when developing rather before delivering product customer. application in .net c#. first, how can recover this? strategy or preferably tool (similar lines of uglify js)? second, how can still protect code (stored procedure) after unmangling names? i have no idea why think mangling names make system more secure. if want security, use database security features

vb.net - Visual Basic - how to prevent keyboard keys in textbox -

i want create program site http://www.lexilogos.com/clavier/araby.htm . when click on key example "m" writes "Ù…", programmed buttons in visual basic program send keystrokes textbox. when tried code below, when hit keyboard key clicked on button in visual basic sends keystroke if (getasynckeystate(65)) button19.performclick() end if and works write normal keyword hit, writes 2 keywords, example "m" , "Ù…". is there solution? you can try that: private sub textbox1_keypress(sender object, e system.windows.forms.keypresseventargs) handles textbox1.keypress if e.keychar = "a" e.keychar = "1" end if end sub .

google app engine - dev_appserver.py run on fqdn hostname -

how run dev_appserver.py run on http://fullyqualifieddomainname:8080 other http://localhost:8080 i running dev_appsever.py via ssh in vm in cloud. first of not supported configuration , highly discouraged performance , security reasons. might want check if violates licensing terms in jurisdiction. however, if insist , testing purposes etc should it dev_appserver.py --host ipaddress the ipaddress should address fullyqualifiedname resolves to.

jquery - Run recursive function on Javascript array -

this question has answer here: cartesian product of multiple arrays in javascript 12 answers jquery/javascript multiple array combinations 2 answers i have simple javascript object: options[0] = { title: 'title 1', items: ['a', 'b', 'c'] }; options[1] = { title: 'title 2', items: ['1', '2', '3'] }; options[2] = { title: 'title 3', items: ['x', 'y', 'z'] }; i need recursively run array on itself. output example above should 27 entries/rows: a / 1 / x / 1 / y / 1 / z / 2 / x / 2 / y / 2 / z / 3 / x / 3 / y / 3 / z b / 1 / x b / 1 / y b / 1 / z b / 2 / x b / 2 / y b / 2 / z b / 3 / x b / 3 / y b / 3 / z c / 1 / x c / 1 / y c / 1 / z c / 2 / x c / 2 / y c

javascript - Angular architecture for a sorting directive -

being quite new angular, searching best way achieve quite simple task. my aim update in database, through angular $resource service, order (i have position attribute) of project model. i have following template structure : <table class="table table-hover"> <thead> <tr> <th>#</th> <th>title</th> <th>date</th> <th>link</th> <th></th> <th></th> </tr> </thead> <tbody id="sortable" my-drag-list> <tr ng-repeat="project in projects" ng-class="{warning: !project.publish}"> <td></td> <td>{{project.title}}</td> <td>{{project.date|date: 'mmmm yyyy'}}</td> <td><a ng-href="{{project.link}}" target="blank">{{pr

android - adjust the first image view height according to second imageview -

<relativelayout android:layout_width="0dp" android:layout_height="wrap_content" android:layout_gravity="center" android:layout_weight=".40" android:orientation="vertical" > <imageview android:id="@+id/first" android:layout_width="match_parent" android:layout_height="160px" android:layout_centerinparent="true" android:padding="5dp" /> <imageview android:id="@+id/second" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerinparent="true" android:background="@drawable/play_small" /> </relativelayout> i want set height of first imageview id --> first according second image view id --

java - Exception loading a really simple context -

i had application accessing oracle database working. then, wanted configure database access using spring, , here's result. cannot find context values: org.springframework.beans.factory.beancreationexception: error creating bean name 'datasource': invocation of init method failed; nested exception javax.naming.namenotfoundexception: el nombre mydb no este asociado este contexto @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapablebeanfactory.java:1482) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:521) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:458) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:295) @ org.springframework.beans.factory.support.defaultsingletonbean