Posts

Showing posts from February, 2015

c++ - error building MXE on Linux -

good day i having trouble building mxe on linux distro. this required cross platform development qt, etc. i have been following this tutorial, stuck on vtk package: /opt/downloads/git/mxe $ make [build] vtk i686-w64-mingw32.static failed build package vtk target i686-w64-mingw32.static! ------------------------------------------------------------ -- configuring incomplete, errors occurred! see "/opt/downloads/git/mxe/tmp-vtk-i686-w64-mingw32.static/vtk/native_build/cmakefiles/cmakeoutput.log". makefile:603: recipe target 'build-only-vtk_i686-w64-mingw32.static' failed make[1]: *** [build-only-vtk_i686-w64-mingw32.static] error 1 make[1]: leaving directory '/opt/downloads/git/mxe' real 0m8.965s user 0m6.084s sys 0m1.008s ------------------------------------------------------------ [log] /opt/downloads/git/mxe/log/vtk_i686-w64-mingw32.static makefile:603: recipe target '/opt/downloads/git/mxe/usr/i686-w64-...

arrays - Use result from MongoDB in Javascript file -

i trying pass results mongodb query use in javascript file in view. using handlebars view engine. mongodb schema is: var mongoose = require('mongoose'); var schema = mongoose.schema; var schema = new schema({ name: {type: string, required: true}, address: {type: string, required: true}, lat: {type: string}, lng: {type: string}, classes: [{ day: string, start: string, end: string }] }); module.exports = mongoose.model('dojo', schema); my routing file has following: router.get('/classes', function(req, res, next) { dojo.find(function(err, dojos) { if (err) { console.error(err); } res.render('admin/classes', { layout: 'layout-admin.hbs', title: 'admin', js: 'classes-admin', dojos: dojos }); }); }); within hbs file, have: <p>{{ dojos }}</p> the code above shows variable on screen ok when try console.log with...

java - Is an open SQLite browser considered to be a connection? -

can running sqlite browser considered connection? because connect (java) browser opened @ particular point (i not sure if make changes or what) stops working , says database locked (probably due open connection). can happen? because if close browser works.

c - Why is my binary filled with paths, empty data and what is all of this? -

i tried create absolutely minimum sized binary in c vc++. to accomplish removed c runtime library support in settings , used instead of regular old main crt setup comes before it. this source file: int winmaincrtstartup() { return 0; } i went around , removed find injected inside outputted binary. there few things didn't understand why there. this output: mz..................... @...................... ....................... !..l.!this program cann t run in dos mode... $.............d...d...d ..l...d...f...d.rich..d ....................... pe..l......x.........." ....................... . ....@................ .........0............@ ....................... ....................... ....................... . ..p.................. ....................... ....................... .........text.......... .................... .. .rdata....... ......... ............@..@....... ....................... ....................... ....................... .......................

javascript - Website Code that shows closest of two cities based on visitor IP -

i trying add line of text on website displays closest of 2 cities website visitor based on visitors ip address. i have found code displays users current city through geolocation , html5, unless user in 1 of 2 cities, correct information not displayed. there free api create simple or simple few lines of code? trying embed wix, javascript, html, , css or embedded content options. any great.

google cloud platform - the exception:boto.https_connection.InvalidCertificateException: Host storage.googleapis.com returned an invalid certificate -

i use boto create bucket. there appears problem: dump information: file "train.py", line 111, in <module> main() file "train.py", line 48, in main train(args) file "train.py", line 51, in train data_loader = textloader(args.data_dir, args.batch_size, args.seq_length) file "/users/sun/workspace/word-rnn-tensorflow/utils.py", line 32, in __init__ self.preprocess(input_file, vocab_file, tensor_file) file "/users/sun/workspace/word-rnn-tensorflow/utils.py", line 106, in preprocess uri.create_bucket(headers=header_values) file "/library/python/2.7/site-packages/boto/storage_uri.py", line 563, in create_bucket storage_class) file "/library/python/2.7/site-packages/boto/gs/connection.py", line 95, in create_bucket data=get_utf8_value(data)) file "/library/python/2.7/site-packages/boto/s3/connection.py", line 668, in make_request retry_handler=retry_handler ...

Global variable in Javascript, rerurn wrong value -

i have problem program. had "tempname" variable. global variable. set value in "ktdn" function , value in function "loadmain" has "undefined". please me!! much!! var tempname; var tempposititon; function ktdn() { for(var x=0; x < mangnhanvien.length; x++) { if(document.getelementbyid("txtuser").value == mangnhanvien[x].user && document.getelementbyid("txtpass").value == mangnhanvien[x].pass) { tempname = mangnhanvien[x].ten; tempposititon = mangnhanvien[x].position; alert(tempname +" "+tempposititon);//debug ==> right value //alert("dang nhap thanh cong"); window.open("../html/main.html"); window.open('','_self').close(); return true; } } alert("tai khoan dang nhap khong chinh xac"); } function logout() { window.op...

Passing a JSON string to HTTP GET method using libcurl -

i want pass json string via http method. server side requires json follows: const char* json[]= {\"revisions\":[{\"revision\":\"01\"},{\"revision\":\"02\"},{\"revision\":\"03\"},{\"revision\":\"04\"}]} so intend pass such json this, i'm not sure whether should convert query string format or not, this: curl_easy_setopt(curl, curlopt_url, "http://example.com?{\"revisions\"[{\"revision\":\"01\"},{\"revision\":\"02\"},{\"revision\":\"03\"},{\"revision\":\"04\"}]}"); i know should use post in case. however, requirement server side requires using get. appreciated. besides query string, can pass data in http requests via: header: struct curl_slist *chunk = null; chunk = curl_slist_append(chunk, "json: {\"revisions\"[{\"revision\":\"01\"},{\...

notepad - html img src not working -

i'm trying create simple web page using notepad. want add image. image not loading.i tried different browsers,but no luck. please help. image size 26kb. here code, <html> <head> <title>global warming</title> </head <body> <img src="images.jpg"/img> </body> </html> you have code error. on line 4 head closed missed ">" sign. plus way tagging image in html incorrect. should <img scr = "imagepath/imagename.extention" />

C# List Error, I try to search an item from the list in another class but show nothing exists -

i created list products , objective search them in class can add them datagridview. when search program dont find number of reference(referencia). how solve problem? search.cs bool encontrou = false; this.datagridviewadicionarproduto.rows.clear(); foreach (produto prod in program.listaprodutos) { if (prod.refproduto == convert.toint16(this.txtprocurar.text)) { this.datagridviewadicionarproduto.rows.add(prod.refproduto, prod.nome, prod.quantidade, prod.preco); encontrou = true; } } if (encontrou == false) { messagebox.show("não foi encontrada nenhuma referencia", "procurar referencia", messageboxbuttons.ok, messageboxicon.information); this.txtprocurar.resettext(); this.txtprocurar.focus(); } productcreate.cs: produto prod; private void btncriar_click(object sender, eventargs e) { ...

java - InvalidDataAccessApiUsageException: Parameter value element did not match expected type -

i'm trying execute in query using spring data. model looks this: @entity @table(name = "customer", schema = "public", catalog = "postgres") public class customerentity { private int id; private string name; private int balance; private string bankid; @id @column(name = "id") public int getid() { return id; } public void setid(int id) { this.id = id; } @basic @column(name = "name") public string getname() { return name; } public void setname(string name) { this.name = name; } @basic @column(name = "balance") public int getbalance() { return balance; } public void setbalance(int balance) { this.balance = balance; } @basic @column(name = "bank_id") public string getbankid() { return bankid; } public void setbankid(string bankid) { th...

javascript - Add class to elments with same matching class as per clicked element -

i need add .active class button matches of classes per div clicking: <button class="valuea"></button> <button class="valueb"></button> <button class="valuec valueb"></button> <div class="dynamic class"></div> $("div.valueb").on("click", function() { ... }); the result should be: <button class="valueb active"></button> <button class="valuec valueb active"></button> i tried using .each() i'm stack comparison of classes. the thing div has dynamic class buttons, don't know matches until in dom. one version create click function every single class have in document. this: $('.valuea').click(function() { $('.valuea').addclass('active') }) $('.valueb').click(function() { $('.valueb').addclass('active') }) $('.valuec').click(function() { $(...

c++ - Is calling non-member function from destructor OK? -

in c++, ok call non-member function (either free function or member of other objects) within destructor? calling (non-virtual, although in case shouldn't matter) method of object of different class. method crashes on trying access members. on other hand, if different object child of destructed object (qt), matter? in general destructor can call function needs destroy object. however, there couple of caveats: if function called destructor throws exception, exception must caught , handled in destructor. the function called destructor must not unconditionally create , destroy objects of type destructor belongs (since result in infinite recursion).

Java - parallel processing deadlock -

i want try simple deadlock example. know problem in (thread t1 = new thread() { ) , ( thread t1 = new thread() { ) . the value of local variable t1 not used. but can't fix it. public static void main(string[] args) { final string passenger1 ="pick passenger1"; final string passenger2 ="pick passenger2"; thread t1 = new thread() { public void run(){ synchronized (passenger1) { system.out.println("thread 1: locked passenger1 "); try { thread.sleep(100);} catch (exception e) {} system.out.println("thread 1: waiting passenger 2 "); synchronized (passenger2) { system.out.println("thread 1: locked passenger 2"); } } } }; thread t2 = new thread() { public void run() { synchronized (passenger2) { system.out.println("thread 2: locked passenger2 "); try { thread.sleep(100);}ca...

python - Doesn't pop() if a number follows a number -

this question has answer here: strange result when removing item list [duplicate] 4 answers remove items list while iterating 18 answers that code should clear list 'bag' out of numbers. number follows number doesn't work right. example 8 after 7. bag = ['apples', 1,'bananas', 'potatoes', 'tomatoes',2, 'chary',3, 'mo4ka', 7,8, 'candies', 'main_tx'] list_n = [] x = 0 in bag: if isinstance(i, int): list_n.append(i) bag.pop(x) x+=1 print(list_n) print(bag) result: [1, 2, 3, 7] ['apples', 'bananas', 'potatoes', 'tomatoes', 'chary', 'mo4ka', 8, 'candies', 'main_tx'] don't try modify list while iteratin...

java - strange behaviour of comparing two signed integers in a for loop -

i trying solve problem stated follows: given set segments, , set of points, calculate how many segments contain each point. the problem have encounterd when have count how many times point contained segment. when have input, inner loop, increments correctly counter of each point, weather when have data set, comparing 0 negative number , non-negative number takes place, behaves strangely. the following script created locate problem facing, , not represent actual implementation. the test cases give outputs follow: case 1: string debug = "test case 1: \n "; debug += " \n - 2 segments coordinates [0, 5] , [7, 10]."; debug += " \n - 3 points @ coordinates 1, 6, , 11."; int [] starts = new int[]{0, 7}; int [] ends = new int[]{5, 10}; int [] points = new int[]{1, 6, 11}; debug += "\n \n calculating coverage of points: "; ( int i=0; i<starts.length; i++) { (int j=0; j<points.length && (...

How to sort alpha-numeric in jQuery DataTables -

i wondering if there build in solution in jquery.datatables sort alpha numeric value (wrapped in html). in case rendering data (and how "sorted"): a1 b5 p10 p11 p12 p1 p2 p3 p4 instead of weird "sort" looking solution sort this: a1 b5 p1 p2 p3 p4 p10 p11 p12 i've tried num , natural sorting stype html (because wrapped in <a /> )

javascript - Tried to do a chronometer, but failed -

i trying simple chronometer, 1 number keeps counting infinite. please keep in mind trying correct own code , refrain answering "this post duplicate of ...", because won't understand other examples. reason code doesn't work, please help. <!doctype html> <html> <head> <style> #screen { position: relative; border: 2px solid black; width: 800px; height: 600px; top: 50px; left: 500px; } #chronometer { position: absolute; top: 150px; left: 300px; font-size: 100px; width: 300px; height: 300px; } </style> </head> <body> <div id="screen"> <div id="chronometer"></div> </div> <script> var chronometer = setinterval(increasechronometer, 1000); function increasechronometer () { var chronometernumber = 1; document.getelementbyid("chronometer").innerh...

angularjs - Webpack Config for Static Pug/HTML Pages -

i'm transitioning site use webpack, , need little configuration. have few pages written in pug/jade large , infrequently accessed (think terms of service or privacy policy). of .jade files angular templates, inlined in components , works well. these few files, however, webpack compile static html files served separately rest of app. however, would still file names include hash. the basic idea i've come this: in routes.ts : $routeprovider.when('/_tos', templateurl: require('./resources/terms-of-service.jade')) in webpack.config.js 's list of loaders: { test: /resources.*\.jade$/, loaders: ['file?name=[name].[hash].html', 'pug-html'] } i've tried various combinations of pug-loader , pug-html-loader (with , without ?exports=false option), html-loader , extract-loader , extract-text-webpack-plugin , , file-loader , try has artifacts in resulting .html file. e.g. might start module.exports = , or might put \" ev...

Swift Generic Protocol Function Parameters -

this seems should work me. trying make rule protocol able performrule on whatever struct adopts rule protocol , return boolean. however, way code cannot access properties on performrule(:value) value parameter. feel missing important concept or buggy. should able copy code below playground see issue yourself. import foundation protocol numbercalculation { var number : nsnumber { set } } protocol rule { var invalidmessage : string { set } func performrule<t>(value: t) -> bool } struct greaterthanrule : rule, numbercalculation { var invalidmessage: string var number : nsnumber init(valuemustbegreaterthan value: nsnumber, withinvalidmessage message : string = "") { number = value invalidmessage = message } func performrule<nsnumber>(value: nsnumber) -> bool { number.decimalvalue // works value.decimalvalue // doesn't work return true } } saying <nsnumber...

javascript - Remove objects from array and insert into another array with Angular -

i have list of objects store in array , have button remove items array , insert in array, know how remove , add separately. my difficult understand when call function, if need arguments or not, values pass or return. example add function has 2 arguments insert object values, don't know how call function after click , remove, array it's not updating, initial value before remove first list. first need understand how works remove index , index , insert list. i don't know how works factory or services, know it's how can access functions between controllers arrays var items = []; var boughtitems = []; service.displayitem = function(itemname, itemquantity) { items.push({name: "apple", quantity: 2}, {name: "strawberry", quantity: 10}, {name: "grape", quantity: 5}, {name: "orange", quantity: 6}, {name: "lemon", quantity: 4}); } how can insert or call add function after remove or removed ite...

assembly - array indexing with MIPS -

i have bit of trouble array indexing in mips. lets have following c code: void main() { . . int[2] a; # or other length . . a[1] = 7; # or other number . . } lets know 'a' offset frame pointer example 12, that: lw t0, -12($fp) gives me base address of 'a'. lets array access index value (in case 1) stored in $t1. don't is. how can store 7 in a[1]? looking like: mul $t1, $t1, -4 # since each integer takes 4 bytes addi $t1, $t1, -12 # t1 = exact offset $fp a[1] li $t2, 7 # t2 = 7 sw $t2, $t1($fp) the problem last operation illegal (despite integer array indexing mips assembly ). how can this? thank

c++ - clang vs gcc in abstract class handling in compile time -

one of these issues of nlohmann/json opensource library drew attention. i have minimal reproduction of case does not compile under few version of desktop gcc (4.8, 4.9, tried 5+) compiles mac clang , android ndk's gcc 4.9 #include <limits> struct base { virtual void foo() = 0; }; int main() { (void)numeric_limits<base>::is_signed; } gcc trying instantiate std::numeric_limits base class instead of derived: /usr/include/c++/4.8/limits: in instantiation of 'struct std::numeric_limits<base>': main.cpp:11:94: required here /usr/include/c++/4.8/limits:309:7: error: cannot allocate object of abstract type 'base' min() _glibcxx_use_noexcept { return _tp(); } i'm not quite sure if known compiler bug (in case of failure) or feature/relaxed rule (in case of success) i've tried work around std::is_abstract not help, looks 'short-circuit' evaluation not happening in enable_if , error stays same my question not h...

Quiz making in Tkinter with RadioButton and CommandButton -

i'm trying create quiz in tkinter. i'd use radiobuttons multiple choices, don't know how connect selected choice commandbutton. found similar program 1 i'm trying create,but still don't understand it. please me? i fail understand why in function called call(par) , command command =lambda: call(correct.get()) import tkinter tk root = tk.tk() def call(par): if par: lab2 = tk.label(root, text='corect!!!!').grid(row=4) else: lab2 = tk.label(root, text='of corse wrong').grid(row=4) lab2 = tk.label(root, text='how stupid?').grid(row=5) correct = tk.booleanvar() rad = tk.radiobutton(root, text='yes', variable=correct, value=true) rad2 = tk.radiobutton(root, text='no', variable=correct, value=false) lab = tk.label(root, text='is maker awsome?') btn = tk.button(root, text='submit', command=lambda: call(correct.get())) la...

mysql - Create statistic of table, use alias in case -

Image
i have table holds birthdays , genders select `tblresultdatetime`, `tblresultbirthdate`, `tblgendertexten` `ci_wizard_results` inner join ci_wizard_genders on ci_wizard_results.tblresultgender = ci_wizard_genders.tblgenderid returns: now want create table this: so want create table points out age groups etc. i believe first have convert dates ages: select *,year(`tblresultdatetime`)-year(`tblresultbirthdate`) - (right(`tblresultdatetime`,5) < right(`tblresultbirthdate`,5)) age `ci_wizard_results` but after that, not sure how continue. believe should use case: select *,year(`tblresultdatetime`)-year(`tblresultbirthdate`) - (right(`tblresultdatetime`,5) < right(`tblresultbirthdate`,5)) age, count(case when age <= 30 , age> 39 1 end) agegroup3039 `ci_wizard_results` but can't use alias in case, i'm kinda stuck. suggestion how continue? (my final goal display data in report via reportico) thanks! assuming age calculate usi...

winforms - c# lock a windows forms control -

i'm programming winforms app, , have encountered problem: i have, example, numeric updown control, , when pressing up/down button, don't want change, want access new value, without changing number on control itself. i need able unlock under condition, that: private void numericupdown1_valuechanged(object sender, eventargs e) { if (!canchange) { int newvalue = get_expected_new_value(); dosomestuff(newvalue); //some_code_to_cancel_the_value_change; } else { //allow change dosomeotherstuff(); } } how can thins thing? you can use tag property of numericupdown1 store last value. although it's not particulary elegant solution. credit to: c# numericupdown.onvaluechanged, how changed? in case can this: private void numericupdown1_valuechanged(object sender, eventargs e) { var o = (numericupdown) sender; ...

javascript - custom validator not working in bootsrap -

i have text field , if empty want throw error. using javascript function , custom validator this. <div class="table-container" style="border: none"> <div class="table-row"> <div class="table-col"> <div class="label"> abstract title (*) </div> <div class="smallnormal"> please enter abstract title appear on poster </div> </div> </div> <div class="table-row"> <div class="table-col"> <asp:textbox id="txttitle" runat="server" maxlength="500" cssclass="textentry" width="800px"></asp:textbox> <asp:customvalidator id="customvalidator6" clientvalidationfunction = "checktitle" runat="server" errormessage="title requir...

html - circular divs computed width incorrect causing not to be circular -

Image
i have circle divs (using large border-radius) , they're different sizes on different screen sizes using media queries. width doesn't kick in correctly on media query sizes. example here screenshot of small devices: the images shows width , height set 80px in css computed width 63px. when drag screen wider, seeing circles gradually become wider , wider until circles, kind of "responsive" div, rather div changes size @ width breakpoints. here jsfiddle: http://jsfiddle.net/52vtd/15513/ how can circle divs circles (same width height)? html: css: #about-page { height: 100%; padding-top: 57px; width: 100%; ...

python - Create identical model in django -

i using django 1.10 mysql. willing have 2 tables in db same fields. class ticket(models.model): listing = models.foreignkey(listing) ticketid = models.charfield(max_length=32) dateofposting = models.datetimefield() seatnumber = models.positiveintegerfield(null=true, blank=true) class soldticket(models.model): ### same fields here what best way it? having 2 identical tables in database suggests don't need them, boolean field or foreign key job. hovewer, if want have 2 identical models, should @ abstract models . class abstractbase(models.model): listing = models.foreignkey(listing) ticketid = models.charfield(max_length=32) ... class meta: abstract = true class model1(abstractbase): pass class model1(abstractbase): pass that way model1 , model2 have same fields.

c# - desible GetTouch after 1st touch -

i have object want throw @ distance gettouch.my code working problem when touch screen multiple time,the object move multiple time dont want,i want object move 1 time no matter how many time touch or swipe screen.here's tried. public class realballmove : monobehaviour { public float speed; public rigidbody rb; void start() { rb = getcomponent<rigidbody>(); } void update() { if (input.touchcount >0 && input.gettouch(0).phase == touchphase.ended || (input.getmousebuttondown(0))) { //rb.addforce(vector3.forward * speed); //rb.addforce(vector3.up * speed); getcomponent<rigidbody> ().iskinematic = false; getcomponent<rigidbody> ().addforce (new vector3(0.0f, 20.0f, 12.0f)); //destroy (getcomponent<rigidbody>()); } } } simply add boolean indicating whether have thrown ball ;) public class realballmove : monobehaviour { public float speed; public rigidbody ...

java - Accept user input from Activity -

i have experience java, trying create android app , not know how accept user input. id of edit text enterrequestmessage , name of xml file activity_score_entry.xml. here beginning of java file. import android.support.v7.app.appcompatactivity; import android.os.bundle; public class scoreentry extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_score_entry); } } you need access controls in xml public class scoreentry extends appcompatactivity implements view.onclicklistener { private edittext edittext; private button button; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_score_entry); edittext = (edittext) findviewbyid(r.id.edittext); button = (button) findviewbyid(r.id.button); button.setonclicklistener(this...

java - Menu does not show up in Android studio -

this androidmanifest <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="k.coursera.mylocation"> <uses-permission android:name="android.permission.internet" /> <application android:allowbackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsrtl="true" android:theme="@style/apptheme"> <activity android:name=".mainactivity"> <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <activity android:name=".test"></activity> </a...

asp.net mvc 5 - Call DisplayFormatAttribute's Logic from C# -

in mvc5 application, have displayformat attribute set on property of model. ensures double value 'totalprice' rendered 2 decimal places on screen (in razor page) [displayformat(dataformatstring = "{0:n2}")] public double? totalprice { get; set; } i'm trying figure out how call same logic within controller (c# code). like: return dataformatattribute.applyformattingto(shoppingcart.totalprice); that's near correct hope helps clarify question. i'm not interested in specific example of 2 decimal places, more how apply attribute's behaviour value myself in c#. i've downloaded mvc5 source code, it's bit abstract me head around. thanks can give. i'm not sure if available oob looks need read attribute , apply formatting. write extension method apply formatting based on displayformatattribute dataformatstring property. i hope sample gets started, if it's not exact solution. sample tightly bound displayformatattribute...

Distributivity check in Prolog -

suppose have equivalence relation eq , , multiple binary operators o_1, o_2, ... o_n . want find out operations distribute on others. assuming have knowledge base can determine whether 2 expressions equivalent, simple solution enter possible queries : (for left-distributivity) ?- eq(o_1(z,o_1(x,y)),o_1(o_1(z,x),o_1(z,y))). ?- eq(o_1(z,o_2(x,y)),o_2(o_1(z,x),o_1(z,y))). ?- eq(o_1(z,o_3(x,y)),o_3(o_1(z,x),o_1(z,y))). ... ?- eq(o_2(z,o_2(x,y)),o_2(o_2(z,x),o_2(z,y))). ?- eq(o_2(z,o_3(x,y)),o_3(o_2(z,x),o_2(z,y))). ... ?- eq(o_n(z,o_n(x,y)),o_n(o_n(z,x),o_n(z,y))). but there must better ways this. starters, i'd define predicate left_dist such left_dist(o_m,o_k) generate corresponding query me. thought i'd using call , in left_dist(o_m,o_k) :- eq(call(o_m,z,call(o_k,x,y)),call(o_k,call(o_m,z,x),call(o_m,z,y))). but nested calls not work reasons outlined in this question , , guess it's not way approach prolog programming either. so question : how ca...

python - print multidimensional dictionary with repeating key -

i new python , using python 2. built multidimensional dictionary looks this: targets = {house: {n: {red: {a:1}, garden: {n: 6}}} {great: {a: {very: {adv:12}, so: {adv: 5}, a: {det: 3}}}} etc. basically there 4 nested dictionaries entries of 'third' dictionary ({red: {}, horse: {} etc) can consist of arbitrary number of items. so, number of items in dictionary varies. now, write dictionary file, preferably csv-file. output file should display entries in tab-separated manner, each line starting outmost key. example: house n red 1 house n garden n 6 great adv 12 great adv 5 great det 3 i know, there lot of posts printing multidimensional dictionaries, have not found 1 (yet) outmost key printed during every iteration. tried include code snippets provided other questions concerning multidimensional dictionaries did not work far. i managed write dictionary normal .txt-file in dictionary format l...

javascript - Form submit giving Undefined value -

Image
i have table generating , has sort button. want column user wants sort keep getting undefined value in sort when try value "bycolumn": appreciated: function createtable(data){ var str = "<form id='tableselect' action='javascript:void(0);'><table><thead><tr> <th>ticketnum</th><th>recieved</th><th>sendername</th><th>sender email</th><th>subject</th><th>tech</th><th>status</th><th>select</th></tr></thead><tbody>"; for(var key in data){ if (!data.hasownproperty(key)) continue; var row = data[key]; str += "<tr> <td>"; str += row['ticketnum'] + "</td><td>"; str += row['recieved'] + "</td><td>"; str += row['send...

anaconda - Can not find the shared library:libhdfs3.so -

Image
everyone. i'm try used dask distributed + hdfs processing files. when installed distributed try install hdfs3 plugins, error : can not find shared library:libhdfs3.so my environment ubuntu 16 desktop version. strict according bewlo, still not working. hope can help! lot conda install hdfs3 -c conda-forge echo "deb https://dl.bintray.com/wangzw/deb trusty contrib" | sudo tee /etc/apt/sources.list.d/bintray-wangzw-deb.list sudo apt-get install -y apt-transport-https sudo apt-get update sudo apt-get install libhdfs3 libhdfs3-dev pip install hdfs3 since no 1 answers question , figure out solution myself , @ least works me. conda install libhdfs3 pip install libhdfs3 conda install -c clinicalgraphics libgcrypt11 conda install libprotobuf=2.5 conda update libhdfs3 if still not work try update.

javascript - Rendering a modal in React -

i'm trying trap onclick method on react component create react modal. i've added react-overlay dependency , added file. import modal 'react-overlays'; this anchor element, <a href="#" onclick={this.handleclick} data-id={image.id}> this handleclick method, handleclick(event) { event.preventdefault(); let mediaid = event.currenttarget.attributes['data-id'].value; this.setstate({ overlay: <modal show={this.state.showmodal} onhide={this.close} mediaid={mediaid}/> }); } i following error, warning: react.createelement: type should not null, undefined, boolean, or number. should string (for dom elements) or reactclass (for composite components). uncaught error: element type invalid: expected string (for built-in components) or class/function (for composite components) got: undefined.(…) i had problem , got around creating modal-component. import modal 'react-modal' export default class custommo...

c# - Error trying to archive a Xamarin Android app that uses WindowsAzure.Storage 7.2.1 -

i unable archive xamarin android app uses windowsazure.storage 7.2.1. doing in visual studio. building, running, debugging , working fine, including accessing resources in cloud in azure blob storage. however far cannot archiving/packaging release build work. apparently fails on compile warning "found conflicts between different versions of same dependent assembly", though pane shows archive errors not resizable , 3 lines high , clips majority of output. says "the archiving process has failed. please see errors section more details." little bit of output errors section shows matches same "found conflicts..." compile warning. the first instance of warning in build output one, there around 20 of these lots of assemblies: consider app.config remapping of assembly "system.security.cryptography.algorithms, culture=neutral, publickeytoken=b03f5f7f11d50a3a" version "4.0.0.0" [] version "4.2.0.0" [c:\program files (x86)\refere...

Python - Populate a dictionary with list items -

if create dictionary in fashion: output = {'playlist':{}} having list this: tracks = [u'no surprises', u'oceans', u'up in flames'] and with count = 0 i populate key playlist tracks items keys 0 value , this: output = {'playlist':{ 'no surprises': 0, 'oceans': 0, 'up in flames': 0}} how do that? output = {'playlist':{track: count track in tracks}}

java - Trying to select an item from a listView that is populated from an xml string array -

this question has answer here: how compare strings in java? 23 answers so had string array in mainactivity.java populated listview , able click on item in listview , open new activity. i've replaced string array xml string array resource populate listview. cannot select items listview. hope explained well. thank help! package com.example.zach.listview; import android.content.intent; import android.support.v7.app.appcompatactivity; import android.os.bundle; import android.view.view; import android.widget.adapterview; import android.widget.arrayadapter; import android.widget.listadapter; import android.widget.listview; import android.widget.textview; import android.widget.toast; public class mainactivity extends appcompatactivity { //public static string[] routes = {"information","crag map","main wall","1. shark bait - 5....

node.js - JavaScript Retain certain properties and remove other properties from array of objects -

i retain properties array of javascript objects. here array of objects. obj_array = [{ "chr_id": 1, "chr_name": "jim", "chr_bb_typ": 2, "chr_mac": "5474", }, { "chr_id": 3, "chr_name": "fro", "chr_bb_typ": 33, "chr_mac": "8e30", }, { "chr_id": 2, "chr_name": "jimb", "chr_bb_typ": 2, "chr_mac": "45e8", }, { "chr_id": 4, "chr_name": "kht1", "chr_bb_typ": 35, "chr_mac": "58d0", }, { "chr_id": 6, "chr_name": "sens", "chr_bb_typ": 34, "chr_mac": "d004", } ] i have string array specifies propertie...