Posts

Showing posts from April, 2012

Julia: How do I create a macro that returns its argument? -

my question quite similar this one , difference. want create macro (or whatever) behaves way: julia> @my-macro x + 2 :(x + 2) (note x + 2 not enclosed in quotes). there in julia? , if there not, how do it? (please, give detailed explanation why works.) the input expression macro needs quoted because macro returns expression, evaluated, while expression itself, hence need quoting. quoting can done as: macro mymacro(ex) expr(:quote,ex) # creates expression looks :(:(x + 2)) end e=@mymacro x + 2 #returns :(x + 2)

javascript - Dygraph not shown on collapsed jQuery mobile collapsible widget -

i have multiple dygraphs plots, group in collapsible jquery widget, 1 show groups of graphs. sadly, works if collapsible div expanded @ start, if start collapsed, graph not drawn after expanding. although not real solution, start all elements expanded. however, if collapses graphs , switches pages in between, same problem occurs. here jsfiddle shows problem - set data-collapsed="false" , graph drawn. you might try calling g.resize() or g.updateoptions() on charts when widget expands. these should no-ops, effect force dygraphs recalculate size of container <div> , has changed due expanding widget. to knowledge, there's no way tell javascript when dom element becomes visible or resized in ways other window resizes. affects other js libraries well.

python - Merge values of same key, in list of dicts -

i relatively new python 2.7, , can't figure out following despite searching extensively on stackoverflow: i have list of dict s wan't combine, when key same, , add specific values (in example 'price' ). input: [{'id1': 'a', 'price': '2', 'color': 'green'}, {'id1': 'b', 'price': '5', 'color': 'red'}, {'id1': 'a', 'price': '2', 'color': 'green'}] expected: [{'id1': 'a', 'price': '4', 'color': 'green'}, {'id1': 'b', 'price': '5', 'color': 'red'}] same idea question before edit. >>> data = [{'id1': 'a', 'price': '2', 'color': 'green'}, ... {'id1': 'b', 'price': '5', 'color': 'red'}, ... {'...

Excels INDEX MATCH - Finding multiple matches -

------a ----------------- b ----------------------c ------------------------d 1 --first--------------last-----------------start date--------------end date 2 --john--------------smith--------------08/08/2014------------01/01/2015 3---john--------------smith--------------08/11/2014------------17/11/2014 4---john--------------smith--------------06/06/2014------------23/12/2014 5---abel--------------jones--------------14/05/2014------------29/04/2015 6---abel--------------jones--------------04/07/2014------------26/04/2015 sometimes on spread sheet duplicate names. example table above (with random data) there 3 john's , 2 abel's. these names start , end date. if have start or end date earlier or later previous entry name, calculate longest range (john smith) doing =max($d2:$d4)-min($c2:$c4) this give 209 days. also, want formula automatically recognize if name has duplicate within range, , if retrieve date. in order this, perform index match function follows....

php - LOAD DATA INFILE doesn't upload CSV data into MySQL table with no error -

update: i attempted execute query generated php script in phpmyadmin's sql tab , got: #7890 - can't find file 'c:wamp mpphpb4c4.tmp'. it cut path between c:wamp , tmp file name. i'm escaping file path incorrectly?: $file = $_files['csv']['tmp_name']; i'm writing cool webapp using php , mysql. 1 of functions upload contents of csv file table in database called suites. csv file looks this: 1230,cool business,,1 3612,not-so-cool business ltd.,john smith,0 column meanings left right in csv go such: suite number, name of business operating @ suite, primary contact(optional), did go there?(0 - no, 1 - yes; optional also). the database table, named suites, has following structure: suite_id (primary), location_id (foreign referencing locations table), suite , business , contact , visited as may have guessed i'm trying insert last 4 columns of suites table above csv example. i attempt following php code: <?php /*...

mysql - SQL Divide By Zero Error In SELECT Statement -

i'm brand new sql , use hand. i'm getting divide 0 error following in select statement: sum(cast((replace(replace(replace (p.[total sales], '$', ''), '(','-'), ')','')) money)) - sum(cast((replace(replace(replace (p.[total cost], '$', ''), '(','-'), ')','')) money)) / sum(cast((replace(replace(replace (p.[total sales], '$', ''), '(','-'), ')','')) money)) new_bal i know need use case, i'm not sure of application. you use nullif in following: nullif(expression1, 0) in case be: sum(cast((replace(replace(replace (p.[total sales], '$', ''), '(','-'), ')','')) money)) - sum(cast((replace(replace(replace (p.[total cost], '$', ''), '(','-'), ')','')) money)) / nullif(sum(cast((replace(replace(replace (p.[total sales]...

sql server - Subquery inside a view is not working corectly -

hey creating view used in fastreport(reportingsoftware) , have sub-query in form of scalar-valued function inside pull full address of property, though bringing error subquery returned more 1 value , im not sure why, have used similar in past cant seem figure out issue. here view code select top (100) percent dbo.propertymaster.propertyid, dbo.lookup_propertymanager.description, dbo.lookup_propertymanager.email, dbo.getfulladdress(dbo.propertymaster.propertyid) fulladdress, dbo.tenants.tenantid, dbo.tenants.leaseid, dbo.tenants.tenantforename + ' ' + dbo.tenants.tenantsurname fullname, dbo.propertymaster.spmreference, convert(varchar, dbo.propertylease.startdate,101) startdate, convert(varchar, dbo.propertylease.datesigned, 101) datesigned dbo.propertylease right outer join dbo.propertymaster on dbo.propertylease.propertyid = dbo.propertymaster.propertyid left outer join dbo.ten...

database - What are the approaches to the Big-Data problems? -

let consider following problem. have system containing huge amount of data (big-data). so, in fact have data base. first requirement want able write , read data base quickly. want have web-interface data-bases (so different clients can write , read data base remotely). but system want have should more data base. first, want able run different data-analysis algorithm on data find regularities, correlations, abnormalities , on (as before care lot performance). second, want bind machine learning machinery data-base. means want run machine learning algorithms on data able learn "relations" present on data , based on predict values of entries not yet in data base. finally, want have nice clicks based interface visualize data. users can see data in form of nice graphics, graphs , other interactive visualisation objects. what standard , recognised approaches above described problem. programming languages have used deal described problems? i approach question this:...

windows 8 - Add-AppDevPackage.ps1 asking for Name[0] parameter -

i created windows 8 app package following instructions at: http://blogs.msdn.com/b/patricka/archive/2012/11/05/how-do-i-deploy-a-windows-8-app-to-another-device-for-testing.aspx however, when run add-appdevpackage.ps1 on hp stream 7, administrator: .\add-appdevpackage.ps1 i being asked parameter value: name[0]: i enter such "test", prompt: name[1]: then press enter. error: cannot overwrite variable false because read-only or constant. @ c:\temp1234\apppackages\app3_1.0.0.0_anycpu_debug_test\add-appdevpackage.ps1:30 char:36 + [switch]$getdeveloperlicense = $false, + categoryinfo :writeerror (false:string) [], sessionstateunauthorizedaccessexception +fullyqualifiederrorid : variablenotwriteable found package: c:\temp1234\apppackages\app3_1.0.0.0_anycpu_debug_test\app3_1.0.0.0_anycpu_debug.appx found certificate: c:\temp1234\apppackages\app3_1.0.0.0_anycpu_debug_test\app3_1.0.0.0_anycpu_debug.cer before installing app, need following: - acquire develop...

php - Multiple level of different kind of inheritance -

for project, i'm trying use inheritance feature of doctrine. need represent medias (through different tables : 1 table uploaded documents, 1 linked videos, ... , on). but, videos can vary provider provider (such youtube, dailymotion, name it). so, thinking of doing inheritance, proper video table, through single_table inheritance. but, when declare entities, seems if add single_table inheritance annotation on abstractvideo entity, extends abstractmedia entity, video table never created (nor detected). here snippet of these 2 entities : <?php namespace acme\demo\entity; use datetime; use doctrine\orm\mapping orm; /** * @orm\entity * @orm\table(name="media") * @orm\inheritancetype("joined") * @orm\discriminatorcolumn(name="type", type="string") */ abstract class abstractmedia { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ private $...

android - Virtual device running in Genymotion periodically goes offline in ADB -

i have android device (with lollipop image, if important) running in genymotion 2.4 , connect via adb (version 1.0.32) developer pc eclipse in local network without connectivity problems. fine except periodical drops of adb connection (other protocols keep working fine), adb loses device, , when try reconnect says device offline. experience, offline status mean receiving end (the device) still thinks it's connected , declines new connection. method know remedy problem restart device , adb connects expected. if interested, adb not running on remote host machine genymotion - otherwise remove connections other pcs impossible. the question: how can refresh "softly" virtual device accept new adb connection without restarting entire device? p.s. if leave "offline" device own time (quite long time, example, hour) seems refreshes state without external interaction, adb again able connect , device reported "online". but, makes no sense wait long happe...

Can't Run 'app' in Android studio Execution failed for task ':app:mergeDebugResources' -

i'm beginner.. in fact installed android studio few days ago. anyway, when click run 'app' says: executing tasks: [:app:assembledebug] configuration on demand incubating feature. :app:prebuild up-to-date :app:predebugbuild up-to-date :app:checkdebugmanifest :app:prereleasebuild up-to-date :app:preparecomandroidsupportappcompatv72220library up-to-date :app:preparecomandroidsupportsupportv42220library up-to-date :app:preparedebugdependencies :app:compiledebugaidl up-to-date :app:compiledebugrenderscript up-to-date :app:generatedebugbuildconfig up-to-date :app:generatedebugassets up-to-date :app:mergedebugassets up-to-date :app:generatedebugresvalues up-to-date :app:generatedebugresources up-to-date :app:mergedebugresources [fatal error] :6:7: il tipo di elemento "resources" deve terminare con la corrispondente tag finale "< /resources>". c:\users\x\androidstudioprojects\myapplication\app\src\main\res\values\styles.xml:5:6: error: il tipo di e...

php - Return same array (zval) as passed in to a function -

i tried create new function in extension takes array parameter adds entry that same instance of array , returns instance again. so code far: php_function(make_array) { // array_init(return_value); // tried transform default null array if (zend_parse_parameters(zend_num_args() tsrmls_cc, "a", &return_value) == failure) { return_false; } add_assoc_long(return_value, "answer", 42); return; } but null return value or if uncomment array_init(return_value); return_value empty array. so why behavior? , did understand wrong? using return_value directly part of zpp argument typically not done (actually, never); it's commonly done introducing regular zval * container , return_zval or retval_zval macro used: php_function(make_array) { zval *arr; if (zend_parse_parameters(zend_num_args() tsrmls_cc, "a", &arr) == failure) { return; } add_assoc_...

JButton not performing it's Required Function in java -

here's code of currency converter program . earlier null pointer exception occurred , rectified . there no errors in program . program runs convert button not perform operation . believe problem lies in actionperformed function , i'm not being able identify . import java.awt.event.*; import javax.swing.*; import java.awt.*; import java.io.*; public class trial extends jframe implements actionlistener{ public string[] list={"dollars","euros ","yen","pounds","rupees"}; jpanel panel1 = new jpanel(); jpanel panel2 = new jpanel(); public jcombobox cb,cb1; public jtextfield tf1; public jtextfield tf2; public jlabel label3; public jlabel label4; jpanel panel3 = new jpanel(); public jbutton button1; public jbutton button2; public trial(){ setlayout(new boxlayout(getcontentpane(),boxlayout.y_axis)); ...

rest - AngularJS authentication questions -

we planning implement angularjs web application communicating business components via rest service layer. web app needs offer authentication mechanism. example particularly concerned user authentication process since angular code practically available users on clients. and how can reassure users authenticated after initial authentication process (in jsp/php use sessions)? could please give pros. , cons? your right client side code available, viewable, , editable thru standard browser developer tools. if company type of security audits on software you'll find security reasons processing done on server side outside of view of client code. companies have worked have taken approach trust nothing sent client side server. on server side rest layer typically contains authentication layer bubble client when. -invalid session -incorrect permissions make rest call -invalid rest args -prevents script jacking text fields -etc...

directory - How do you get files with extension from folder in Ada95? -

i'm trying create function .dll files in specified folder, plugins. all of web searches ( ada directories ) have work under ada 2005, need function work ada 95. knowledge ada 95 not have ada.directories extension. how go walking through file system find .dll files in ada 95? there starting points out there may have overlooked? there (as have noticed) no solution problem in ada 95 standard libraries. if program gnat only, use gnat.directory_operations . if program unix systems only, not gnat, import relevant c functions.

sql - MS Access multi (INNER, LEFT & RIGHT) JOIN query -

ok, here's thing. have following tables involved : > years ------------------------------ id year actual ------------------------------ 1 2014-15 true 2 2015-16 false > shops ------------------------------ id name ... ------------------------------ 1 thisshop ... > ita ------------------------------ id year_id shop_id ------------------------------ 1 1 1 2 1 2 ... > inspectors ------------------------------ id inspector ------------------------------ 1 m. black 2 m. white 3 m. brown ... > ita_inspectors ------------------------------------------------------- id id_ita id_inspctr startdate enddate ------------------------------------------------------- here's thing, want query display inspectors , listed or not in ita_inspectors shops id = 1 , years id = 1 . if inspector present in ita_inspectors table, show start , end dates, if not, show without...

php - Show unit of weight in product page for Opencart 2 -

hi! how display unit of weight (kg., gr., oz., ml.,) in product page in opencart 2.0.2.0 now displays number without units. i'm using default template in file template\product\product.tpl looks this: ...<li><?php echo $text_model; ?> <?php echo $model; ?></li> <?php if ($weight) { ?> <li><?php echo $text_weight; ?> <?php echo round($weight, 2)?></li> <?php } ?> ... in catalog\controller\product\product.php i have added line $data['text_weight'] = $this->language->get('text_weight'); $data['weight'] = $product_info['weight']; what else need add or perhaps change ? try in default opencart code. step 1 open file catalog/controller/product/product.php find (around line 242): $data['text_tags'] = $this->language->get('text_tags'); add after : $data['text_weight'] = $this->language->get('text_weight...

sql server - sql 2012 ssis All Executions report not showing anything -

i working on migrating sql 2008 ssis package sql 2012 . after upgrading , loading package, scheduled it. the job fails , error says 'package execution on server failed. execution id: 20, execution status:4. view details execution, right-click on integration services catalog, , open [all executions] report' when open report instructed, shows me zeroes columns - 0 failed, 0 running, 0 succeeded, 0 others . clicked on filter , applying date; changing date encompass past year , next month, nothing appears. this first experience sql 2012 , integration services reports. am missing find execution details? what happened me issue date filters. ssms defaulting date filters of executions report end @ current date, 2016-11-28. however, in server's time zone, date 2016-11-29. apparently though these filters appear default based on desktop's time zone, applied using server's time zone. able missing executions appear changing date filter include ...

date - Groovy TimeDuration Argument Types -

i'm quite new groovy (and haven't experience java) - i'm running problem doesn't make sense me. guess misunderstanding of how objects , classes work in these languages. question basic - appreciated. i'm trying calculate number of weeks between 2 dates. code (it more succinct, i've expanded make each step more clear): import groovy.time.timecategory start = new date(year: 2014, month: calendar.april, date: 1, hours: 12, minutes: 12, seconds: 0) finish = new date(year: 2014, month: calendar.may, date: 4, hours: 1, minutes: 12, seconds: 0) use ( timecategory ) { diff = finish - start println getweeks(diff) } i error groovy.lang.missingmethodexception: no signature of method: script1.getweeks() applicable argument types: (groovy.time.timeduration) values: [32 days, 13 hours] however, if change print line println diff.getclass().name my results output groovy.time.timeduration so question essentially: if diff object of cl...

Wrapping C++ struct template in SWIG -

i have c++ code wraps existing object probability follows: template< typename object > struct roll { object object; double probability; roll( object p, double s ) : object( p ) , probability( s ) { } } later, defined in same .h file as: typedef roll< color > rollcolor; there's instruction around how wrap c++ struct primitive type in swig 1 has template also, don't know how wrap in interface file. have idea how can ? thank much. in .i file, use: %template(rollcolor) roll<color>; more info @ http://www.swig.org/doc1.3/python.html#python_nn26 . assuming have template defined in roll.h , color defined in color.h , need use: %{ #include "roll.h" #include "color.h" %} #include "roll.h" #include "color.h" %template(rollcolor) roll<color>; update, in response op's comment you can use: %template(rollcolors) std::vector<roll<c...

java - Setting view in constructor Android with fragment -

i'm getting java java.lang.nullpointerexception error when i'm trying set view in class while using constructor. can't see i'm doing wrong here.. here's code: public class homefragment extends fragment { public homefragment() { // required empty public constructor } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_home, container, false); // define webview stuff dataselector dataselector = new dataselector(rootview); dataselector.getdata(); - public class dataselector { public view mrootview; public dataselector(view rootview){ mrootview = rootview; } textview resultview = (textview) mrootview.findviewbyid(r.id.result); public void getdata(){ ... the initialization code attributes run before constructor. mrootview empty when resultview init...

c++ - Unknown compiler version while compiling Boost with MSVC 14.0 (VS 2015) -

i "unknown compiler version - please run configure tests , report results" while attempting compile boost library on computer. have recent boost (as of date of post) - 1.58.0. doesn't boost support msvc 14.0, yet? how "run configure tests"? screenshots . latest (at time of posting answer) boost 1.58 support msvc 14.0 preview latest ms compiler @ time of boost 1.58 release. now, latest version of visual studio 2015 rc isn't covered in boost 1.58 config file. to stop boost 1.58 complaining unknown compiler version edit boost/config/compiler/visualc.hpp , replace: // last known , checked version 19.00.22129 (vc14 preview): #if (_msc_ver > 1800 && _msc_full_ver > 190022310) with: // last known , checked version 19.00.22816 (vc++ 2015 rc): #if (_msc_ver > 1800 && _msc_full_ver > 190022816) which can find done in boost repo here upcoming boost 1.59 release. update : visual studio 2015 rtm set to: //...

javascript - angularjs orderBy not working right -

i have array form $vars[1][1]["name"] = "john"; $vars[1][1]["lastname"] = "doe"; $vars[1][2]["name"] = "ely"; $vars[1][2]["lastname"] = "tim"; $vars[2][1]["name"] = "brad"; $vars[2][1]["lastname"] = "vinnie"; $vars[2][2]["name"] = "angelina"; $vars[2][2]["lastname"] = "van"; ..... $vars[10][1]["name"] = "ela"; $vars[10][1]["lastname"] = "pearl"; $vars[10][2]["name"] = "gustavo"; $vars[10][2]["lastname"] = "tim"; in php. after send angularjs , have $scope.vararr = data.vars after in view have <div ng-repeat="(key, det) in vararr| orderby: key"> {{det.name}} {{det.lastname}} </div> the problem it's not taking array in order 1,2,3...10 it's taking $vars[1] after $vars[10] , a...

accessibility - How to set priority for screen readers of some HTML page parts? -

Image
i want make html page suitable screen readers. currently, page have 3 main parts: header, sidebar , content: screen readers read header @ first, sidebar , search results . unfortunately, users has problems eyesight wait long time while program read side bar content (cause sidebar contain many filters). how can set bigger priority search results? cause search results should read before sidebar content. and great if provide me html tutorial can increase accessibility level of html pages: how can change div elements skipped screen reader? how can change sequence of reading page content? how can make readable search form , search results (and few links)? do not try hide content screen reader users, want access content. instead, can add landmarks content areas. screen readers able jump directly relevant portion of page, including results, still able other controls when need them. if can use html5, use <header> , <aside> or <nav> , <m...

c# - How can I change the input element name attribute value in a razor view model using a custom attribute in a model? -

i have following: @model pharma.viewmodels.searchboxviewmodel <div class="smart-search"> @using (html.beginform("index", "search", formmethod.get, new { @class = "form-horizontal", role = "form" })) { <div class="form-group"> <div class="hidden-xs- col-sm-1 col-md-1 col-lg-1 text-right"> @html.labelfor(m => m.searchphrase, new { @class = "control-label" }) </div> <div class="col-xs-8 col-sm-8 col-md-9 col-lg-10"> @html.textboxfor(m => m.searchphrase, new { @class = "form-control" }) </div> <div class="col-xs-4 col-sm-3 col-md-2 col-lg-1"> <input type="submit" value="search" class="btn btn-default" /> </div> </div> } </div> a...

javascript - HighCharts with Dynamic Data not working -

Image
i have asp.net mvc project signalr. i have page highchart , script looks this: $(function () { window.highcharts.setoptions({ global: { useutc: false } }); var chart; $(document).ready(function () { chart = new highcharts.chart({ chart: { renderto: 'container', type: 'line', marginright: 10 }, title: { text: 'gmas queues' }, xaxis: { type: 'datetime', tickinterval: 500, labels: { enabled: false } }, yaxis: { title: { text: 'queue count' }, plotlines: [{ value: 0, width: 1, color: '#808080' }] }, legend: { enabled: false }, exporting: { enabled: false }, series: [{...

java - Creating a Jooq Caching Layer -

so, i'm working on using jooq create caching layer on postgres. i've been using mockconnection/mockdataprovider objects intercept every query, , working, i'm having few issues. first, how determine between reads , writes? is, how tell whether query insert/update/etc or select, given mockexecutecontext that's passed execute method in mockdataprovider? and i'm bit confused on how can invalidations. basic scheme i'm implementing right whenever "write" query made table, invalidate cached queries involve table. goes first question, on telling different types of queries each other, brings issue: how identify tables used in query given sql string , bindings (both attributes of mockexecutecontext)? also, correct approach @ caching? first thought override fetch() method, method final, , i'd rather not change embedded in jooq itself. other way think of intercept requests made create separate, persistent caching layer. i have seen ( https://groups...

python - CSRF verification fails on requests.post() -

can't figure 1 out. csrf verification works fine in django template views. here i'm trying post python client using techniques i've found in other posts. client.get(url) call provide token (the debugger shows, example: client.cookies['csrftoken'] = 'poqmv69mupzey0nylmifbglfdfbgduo9') requests.post() fails error 403, csrf verification failed. what's going on? my django view (with dummy stuff in methods): class cameraupload(view): template_name = "account/templates/upload.html" def get(self, request): dummy = videoform() return render(request, self.template_name, {'form': dummy}) def post(self, request): dummy = videoform() return render(request, self.template_name, {'form': dummy}) and client that's trying post: import requests url = 'http://127.0.0.1:8000/account/camera_upload/' client = requests.session() client.get(url) csrftoken = client.cookies['csrf...

regex - Why do I get "-bash: syntax error near unexpected token `('" when I run my Perl one-liner? -

this driving me insane. here's dilemma, have file in need make match. use perl , works charm in case writing shell script , reason throwing errors. here trying match: loop_loopstorage_rev='latest.integration' i need match loop , latest.integration . this regex: ^(?!\#)(loop_.+rev).*[\'|\"](.*)[\'|\"]$ when use in perl script, $1 , $2 give me appropriate output. if this: perl -nle "print qq{$1 => $2} while /^(?!#)(loop_.+rev).+?[\'|\"](.+?)[\'|\"]$/g" non-hadoop.env i error: -bash: syntax error near unexpected token `(' i believe has beginning part of regex. real question there easier solution using sed, egrep or awk? if so, 1 know begin? double quotes cause bash replace variable references $1 , $2 values of these shell variables. use single quotes around perl script avoid (or quote every dollar sign, backtick, etc in script). however, cannot escape single quotes inside single q...

bash - How to sort and count occurrence of lines in linux -

this question has answer here: bash script: count unique lines in file 1 answer how can count occurence results of list in linux? a b b c c d result: = 1 , b = 2 , c=2 , d=1 i solve using command sort | uniq -c

base64 - Gmail API playground: Send method, converted MIME raw header not populating email fields on send -

i'm using google oauth 2.0 playground , attempting send email. autentication working fine. here simple message i'm trying send (email address changed prevent spam): to: 'michael to' <fakemichael@gmail.com> from: 'john from' <johnf@mydomain.com> subject: 'test message' htmlbody: '<b>hi!</b><br>test message' i convert base64 rfc 822 using vba gets me (i've tried swapping "+" , "-" per other stackoverflow posts no avail): dg86icdnawnoywvsifrvjya8rmfrzu1py2hhzwxaz21hawwuy29tpg1mcm9toiansm9obibgcm9tjya8sm9obkzabxlkb21haw4uy29tpg1zdwjqzwn0oianvgvzdcbnzxnzywdljw1odg1sqm9ketogjzxipkhjitwvyj48yni-vgvzdcbnzxnzywdljw== in playground method post , i've added 2 headers: raw: , base64 string above (no quotes or anything) content-type: message/rfc822 <i added because kept getting different error. putting prevetned error> request uri (removed https cause won't let me p...

jquery - How to Change the Contents ("value") of a Custom Attribute -

i have following html5 custom attribute: <input ... class="my-input" data-counted="n"> how change value (from "n" "y") in jquery? here have , not work: $(document).on('change', '.my_input', function() { $(this).attr('data-counted').val('y'); }); you can use $(this).attr('data-counted','y'); or $(this).data('counted','y');

windows - Python web request slow through Proxy -

some background: work corporation uses proxy. ping/nslookup blocked, , think may contributing following problem. operating system being used windows, , version of python i'm testing 3.4.3. i'm trying create application communicates webservice, , application run inside our network. however, requests take on 10 seconds complete, while in web browser loads in under second. note these requests succeed , take long usable. i profiled application using cprofile module, , found application spending 11 seconds on gethostbyaddr , , 4 seconds on gethostbyname . i'm not familiar enough networks, timeout? why request go through despite timeout? how disable these operations? , if can't, there library not use these operations? i tried both requests , urllib modules. pip exceedingly slow , may because of same cause. thanks in advance or information on subject. edit i tried monkey patching socket.gethostbyaddr , socket.gethostbyname, , speed delay gone. doesn't fee...

Bootstrap Forms -

i looking how bootstrap form looks like, , saw looks pretty this: <div class="form-group"> <label for="inputa">some input:</label> <input type="text" name="input" id="inputa" class="form-control"> </div> and it's bothers me for attribute every time. so, question is, possible somethig this?: <label class="form-group"> <span>some input:</span> <input type="text" name="input" id="inputa" class="form-control"> </label> and there possible issues working way? the for toggles control form input. essentially, when click label, form element focused upon, or selected, depending on type of form element is. not have include for on each label; however, common practice. not swap label span though, this... <div class="form-group"> <label class="col-sm-2 contr...

angularjs - Attempting to pop a modal window - Using Angular and Bootstrap -

first, in diapers stage angular, quite natural expect issues simple can't figure our , theiy are. have list of notifications being shown within ul pair of tags. body of notifications truncated. when user clicks on notification, modal window should pop full text of notification. 2 problems: 1) modal window indeed popped, body of notifications not shown @ all, , instead see {{$scope.display_notification.text}} 2) error message stating argument 'shownotificationdialog' not function, got undefined. here html of dialogue: <script type="text/ng-template" id="show-notification-details.html"> <div class="modal-header"> <h3 class="modal-title"> notification details... </h3> </div> <div class="modal-body" ng-controller="shownotificationdialog"> <div id="display_notification_body"> should "text...

sas dis - Conditionally skip transformations in SAS DIS -

i wondering if possible use conditional start transformation in sas dis conditionally bypass transformation based on whether given table empty (no rows). this link seems indicate condition must based on value of parameter variable. one idea had create parameter value in user written code transformation, , assign different values depending on state of table, seems elaborate , inelegant, , i'm not sure work. there simpler way? much gratitude to done without adding user written transformation , perhaps elegantly can try use. first, copy numobs macro posted @cmjohns ( https://stackoverflow.com/a/5664379/4653284 ) , add precode of jobflow. after go starting transformation needs skipped based on observation , right click properties tab of transformation. goto "precode , postcode" tab , add following code: %macro dummy; %if %nobs(&syslast) gt 0 %then %do; after done, goto transformation last transformation skipped basis observation count , right click...

Zend Gdata - missing HeaderValue.php -

so following this , i'm trying run first php example. following error: php warning: require_once( zend/http/header/headervalue.php ): failed open stream: no such file or directory in /opt2/sites/gdataapi/zendgdata-1.12.13/library/zend/http/client.php on line 45 i checked , file in fact not there. added minimial 1.12 download. says zend/xml/security.php doesn't exist add it. now getting following error: php notice: undefined offset: 1 in /opt2/sites/gdataapi/zendgdata-1.12.13/library/zend/gdata/clientlogin.php on line 150 php stack trace: php 1. {main}() /opt2/sites/gdataapi/test.php:0 php 2. google_spreadsheet->__construct() /opt2/sites/gdataapi/test.php:11 php 3. google_spreadsheet->login()/opt2/sites/gdataapi/google_spreadsheet.php:40 php 4. zend_gdata_clientlogin::gethttpclient() /opt2/sites/gdataapi/google_spreadsheet.php:223 php notice: undefined variable: php_errormsg in /opt2/sites/gdataapi/zendgdata-1.12.13/library/zend/gdata/app.php o...

java - Decode information from JSON Array within another JSON Array -

hello trying data json array in json array. trying parse but, unable it. json data. { "aggregate": "volume", "dimension1": "queries", "dimension2": "days", "results": [ { "id": 1998364102, "name": "denso", "data": {}, "values": [ { "id": "2015-05-23t00:00:00.000+0000", "name": "2015-05-23 00:00:00.0", "value": 5, "data": {} }, { "id": "2015-05-25t00:00:00.000+0000", "name": "2015-05-25 00:00:00.0", "value": 3, "data": {} }, { "id": "2015-05-21t00:00:00.000+0000", "name...

mysql - Php if up to an amount -

i trying use if statement increase db row ($row[ cost ]) 20% not including different row. of code is: $row-->cost/.80 want not hit maximumbid held in query: $result = $wpdb->get_results( "select bp.*, b.company `windows_brands_products` bp left join `windows_brands` b on bp.brand_id = b.id join windows_last_submissions ls join windows_materials wm ls.username = '$current_user->user_login' , bp.width = round(ls.width) , bp.height = round(ls.height) , bp.material in (wm.name) , bp.type = ls.type , if (ls.minimumbid != '0.00',bp.cost between ls.minimumbid , ls.maximumbid,bp.cost <= ls.maximumbid) order b.company asc"); question being how reference row minimumbid can prevent 80%increase hitting maximumbid?