Posts

Showing posts from February, 2013

python - How to reload a configuration file on each request for Flask? -

is there idiomatic way have flask reload configuration file on every request? purpose of change passwords or other configuration related items without having shut down , restart server in production. edit: app.run(debug=true) not acceptable restarts server , shouldn't used in production. perhaps decorator following: def reload_configuration(func): @wraps(func) def _reload_configuration(*args, **kwargs): #even better, reload if file has changed reload(settings) app.config.from_object(settings.config) return func(*args, **kwargs) return _reload_configuration @app.route('/') @reload_configuration def home(): return render_template('home.html') if relevant, here how loading configuration now: my app/app/__init__.py file: from flask import flask settings import config app = flask(__name__) app.config.from_object(config) # ... my app/app/settings.py file: class config(object): sqlalchemy_track_

Reading value from JSON string Scala using ScalaJson -

i have json response follow { ......, "phonenumbers":[ { "info":[ ], "phonenumber":"1234567890", "phonenumbertype":"home_number" }, { "info":[ ], "phonenumber":"9876543210", "phonenumbertype":"work_number" }, { "info":[ ], "phonenumber":"7418529630", "phonenumbertype":"mobile_number" } ], ....... } i need extract mobile number , try this val jsonbody = json.parse(phonelistresponse.body) val phonelist: seq[jsvalue] = (jsonbody \\ "phonenumbers") val mobilenodes: seq[jsvalue] = phonelist.filter(number => { (number \\ "phonenumbertype").head.asinstanceof[jsstring].value == "mobile_number" }) (mobilenodes.head \\ "phonenumber").head.asinstanceof[jsstring].value but mobilenodes empty. suggestion? if using play-json

jquery - change URL of current page on reloading using javascript -

my requirement change url of current page on clicking refresh icon or ctrl+r. on refresh, reload page(different url). , should support browsers. have tried below snippet. not working. window.onbeforeunload = function(e) { window.location.href = 'www.google.com'; }; where 'google.com' should url of page on refreshing current page. it's nothappening window.onbeforeunload(). onbeforeunload needs return value work, actually, display message asking user if he's sure wants leave page (just facebook when try leave page pending changes). as far know, web browsers don't want give control on that, due websites redirecting users when try leave , stuff that, there's nothing "standard way" , if find workaround, i'm pretty sure not work on browsers. why customer wants behaviour on website? @ least in opinion, thing horrible user experience end users.

c# - Is it possible to create a Microsoft.CodeAnalysis.CSharp.CSharpCompilation from a dll and pdb? -

i'd code analysis using microsoft.codeanalysis, compiling our source code takes while. there way use already-compiled pdb , dll files semantic , symbol data? currently, no. neither pdb nor dll contain used reconstitute compilation in way faster could.

qt - How to avoid objects copying during passing from C++ to QML and again to C++? -

i try load qimage c++ qml. created subclass of qquickpainteditem in load qimage(casted qvariant) using slot(that means use qml in case transfer). have 1 issue: pass qimage value, , know can't pass arguments qml c++ using references , pointers. so, whether there trick allows avoid objects copying during passing c++ qml , again c++? the "trick" built in qt: many other classes contain data, qimage uses implicit data sharing aka copy-on-write/cow, quote qt5 docs : qimage objects can passed around value since qimage class uses implicit data sharing . link in docs provides more details means in context of qt, in short actual qimage instance small , cheap pass around value. pointer shared data reference count. when instance modified, detached (deep copy taken) first if reference count greater 1, when not modifying, it's copying around pointer.

algorithm - Find Associativity of this Cache? -

given cache following characteristics: main memory: 16 bit address cache size: 256 bytes cache block size: 8 bytes cache tag size: 11 bits what associativity of cache? n-way associative? if n? can please explain can understand it? have @ nice illustration . here how works: address size 16 bits, have 16 bits tag plus index plus offset within cache block. if assume want address single bytes in cache (which case), need 3 bits address 1 byte within block (since each cache block 8 = 2^3 bytes). leaves 16 - 3 - 11 = 2 bytes index. 2 bytes, can address 2^2 = 4 different sets. have 256 / 8 = 32 blocks in cache (size of cache / size of 1 block). 32 blocks split 4 sets, each set holds 8 cache blocks. cache 8-way associative.

Render string in 'label' of Yii2 Bootstrap widget as HTML -

i'm using yii2's bootsrap tabs widget (yii\bootstrap\tabs -- http://www.yiiframework.com/doc-2.0/yii-bootstrap-tabs.html ) i want insert html tags value of label key in array builds widget. i tried including key => value pair of 'encode' => true 1 of optional array elements did nothing. here's code: <?= tabs::widget([ 'navtype' => 'nav-pills', 'options' => ['class' => 'course-manager'], 'items' => [ [ 'label' => '<i class="fa fa-book"></i>&nbsp;show books', 'encode' => true, 'content' => '<h2>anim pariatur cliche...</h2>', 'active' => true ], [ 'label' => '<i class="fa fa-graduation-cap"></i><span>&nbsp;show students</span>',

Is there a way to permanently delete/remove an app from the Windows Store? -

i have several applications in windows store , i've stopped supporting of them. don't want unpublish them or make them unavailable, rid of them. how can permanently remove them names can reused again others. thanks, robcsi currently, app have never submitted store, click delete app in upper right corner of app overview page , releases reserved name , else can use it. however, you’re not able delete app dashboard once it’s been published. can make unavailable or select hide app , stop selling in distribution , visibility section. if want reuse name of them, don’t need permanently remove them. go manage app names page in app management section of apps in windows dev center dashboard. can click delete remove name want, means name available else reserve , use. but please note app needs have @ least 1 reserved name. might have reserve new name them before deleting old one. more details, please see manage app names .

assembly - Binary Bomb Lab - Phase 6 What is happening to my nodes? -

after looking through assembly, know need pass 6 ints long - each int in pass unique - ints in range of 1 6 (gdb) disas dump of assembler code function phase_6: 0x0000000000401182 <+0>: push %r14 0x0000000000401184 <+2>: push %r13 0x0000000000401186 <+4>: push %r12 0x0000000000401188 <+6>: push %rbp 0x0000000000401189 <+7>: push %rbx 0x000000000040118a <+8>: sub $0x50,%rsp 0x000000000040118e <+12>: mov %rsp,%rsi 0x0000000000401191 <+15>: callq 0x401801 <read_six_numbers> 0x0000000000401196 <+20>: mov %rsp,%r12 0x0000000000401199 <+23>: mov %rsp,%r14 0x000000000040119c <+26>: mov $0x0,%r13d 0x00000000004011a2 <+32>: mov %r14,%rbp 0x00000000004011a5 <+35>: mov (%r14),%eax 0x00000000004011a8 <+38>: sub $0x1,%eax 0x00000000004011ab <+41>: cmp $0x5,%eax

java - How to display bar labels in HorizontalBarChart? -

Image
i have horizontalbarchart mpandroidchart library (version v3.0.0-beta1) in display monthly spending of user's accounts. so implemented method: list<account> accounts = getaccounts(); final arraylist<barentry> entries = new arraylist<>(); float count = 0f; (account account : accounts) { entries.add(new barentry(count++, new float[]{float.valueof(account.getbalance())}, account.getname())); } bardataset dataset = new bardataset(entries, " "); dataset.setcolors(colortemplate.pastel_colors); dataset.setvaluetextsize(10f); bardata data = new bardata(dataset); horizontalbarchartmonthlyspending.setdata(data); horizontalbarchartmonthlyspending.setdescription("gastos por conta neste mĂŞs!"); horizontalbarchartmonthlyspending.getaxisleft().setdrawlabels(false); horizontalbarchartmonthlyspending.getaxisright().setdrawlabels(false); horizontalbarchartmonthlyspending.setfitbars(true); horizontalbarchartmonthlyspending.settouchenabled(false

Excel- Export specific columns to multiple text files vba -

my excel file looks this new_filename media_id sighting_id frame face_x face_y face_width 28069_00000.png 28069 15775 0 309.715 16.714 141 28069_00060.png 28069 15776 60 318 17 136.57 28069_00075.png 28069 15777 75 325.857 18 138.571 28069_00135.png 28069 15778 135 343.428 30.5757 134.1428 28069_00195.png 28069 15779 195 323.333 18 155.333 28069_00255.png 28069 15780 255 278.243 15.2857 138 28069_00315.png 28069 15781 315 284 18.8 137.85 i extract values columns facex, facey, face width , face height , save extracted values in text file having value in new filename column name of text file. i repeat same procedure 3000 rows. so txt file 1 should have values of (2,c6) (2,c7) (2,c8) , should named (2,c1) , on rows. clear enough? sub test() dim r long activesheet r = 2

c++ - Template alias, Template specialization and Template Template parameters -

i want determine underlying template of template parameter using combination of template alias , template specializations. follwing code compiles fine on gcc 4.8, 6.2.1 not on clang 3.5, 3.8. #include <iostream> template <typename t> struct first {}; template <typename t> struct second {}; template <template <typename> class f, typename t> struct foo {}; template <typename t> struct foo<first, t> { void f() { std::cout << __pretty_function__ << std::endl; } }; template <typename t> struct foo<second, t> { void f() { std::cout << __pretty_function__ << std::endl; } }; template <typename f, typename t> struct resolution {}; template <typename t> struct resolution<first<t>, t> { template <typename p> using type = first<p>; }; template <typename t> struct resolution<second<t>, t> { template <typename p> using type = second<p&

PHP to PDF from MySQL Database -

i have read , tried multiple tutorials , each time run block cannot pass. i have database 59 fields currently, have form agents fills in sales each day. each day 15-50 sales captured. have html template have populated variables of database fields , run through loop displaying sales each in separate table, print pdf each sale table on separate page. can imagine how labour intensive every day. i trying convert each loop run record of sale own pdf , name pdf file according mix of variables database table. i cannot php variables work in pdf generator. can display data in table, , generate pdf off template, add php mysql database field variables keep getting errors variables , pdf gereator fails. here have done: tcpdf: <?php $pdf = new tcpdf('l', pdf_unit, 'a4', true, 'utf-8', false); // set document information $pdf->setcreator(pdf_creator); $pdf->setauthor('asimegroup'); $pdf->settitle('asime loan app'); $pdf->setsub

excel - SumIfs formula with more than one "multiple criteria" -

i trying write formula such: =sum(sumifs([sum total], [range 1], {[criteria 1.1], [criteria 1.2]}, [range 2], [criteria 2], [range 3], [criteria 3], [range 4], {criteria 4.1], [criteria 4.2]})) leaving range 4 4.1 along 1.1 , 1.2 results in 3.81 total, makes sense. leaving range 4 4.2 along 1.1 , 1.2 results in 4.40 total, makes sense. however, adding in 4.1 , 4.2 1.1 , 1.2 results in 6.61. why 6.61 , not 8.21, sum of two? have no idea how formula returned 6.61 none of individual combinations without brackets equals 6.61.

Base64 Encoding on ng-file-upload -

when file selected or dropped, automatically converted base64 encoding? i need able take files, convert them strings pass them post requests our backend. is ng-file-upload converting file? or need manually calling either the: upload.base64dataurl(files).then(function(urls){...}); or upload.dataurl(file, boolean).then(function(url){...}); methods? i can post relevant code seems relatively straightforward. help!

javascript - Tracking Multi-page Forms in Datatables -

i have order form that's several pages long, users can input quantities of items. i'm trying keep running total of order total. https://jsfiddle.net/kodemonki/9vj98u9m/3/ here's bulk of code i've been working with. can see of i've tried. function recalculate(){ var qtyarray = new array(); var costarray = new array(); var total_cost = 0; // iterate on checkboxes in table // $('input[type="number"].part_qty').each(function(){ // // if checkbox doesn't exist in dom // if(!$.contains(document, this)){ // // create hidden element // $(form).append( // $('<input>') // .attr('type', 'hidden') // .attr('name', this.name) // .val(this.value) // .attr('class','part_qty') // ); // } // }); //$('input[type=number].part_qty').each(fu

python - Have Pandas column containing lists, how to pivot unique list elements to columns? -

i wrote web scraper pull information table of products , build dataframe. data table has description column contains comma separated string of attributes describing product. want create column in dataframe every unique attribute , populate row in column attribute's substring. example df below. products date description product 2016-9-12 steel, red, high hardness product b 2016-9-11 blue, lightweight, steel product c 2016-9-12 red i figure first step split description list. in: df2 = df['description'].str.split(',') out: description ['steel', 'red', 'high hardness'] ['blue', 'lightweight', 'steel'] ['red'] my desired output looks table below. column names not particularly important. products date steel_col red_col high hardness_col blue col lightweight_col product 2016-9-12 steel red high hardness product b 2016-9-11 steel

sql server - SQL - have full range of dates when units id is null /0 -

i building query count number of units of product , product b , total value amount series of dates. days have 1 or more units of product product b can have 0 units in days. i've joined product b table product table on date column. i've used clause count number of product b units. aggregation of units correct, however, want know how can 'add' days in range below instance not retrieved query, days there no units of product b - 08/08/16, 10/08/16 show in table below ( table below retrieved rows of query). date unit_a unit_b amount 07/08/16 24 1 48 09/08/16 62 17 207 11/08/16 52 12 102 12/08/16 31 5 152 16/08/16 32 12 110 17/08/16 30 3 120 18/08/16 43 41 315 19/08/16 20 1 50.12 21/08/16 19 12 48 22/08/16 35 1 32 here example of query trying create: with prod_a as( select cast(a.date_started date) a_date, count(a.

java - the program is throwing exceptions at me when reading from a file -

this question has answer here: what backslash character (\\)? 6 answers i have seen answered on others , have tried couldn't find worked me looking help. arraylist<integer> integers = new arraylist<integer>(); scanner filescanner = new scanner(new file("workspace\sudoku\file")); it keeps giving me error "invalid escape sequence (valid ones \b \t \n \f \r \" \' \\)" , file location correct way. think may because using scanner although not 100% sure. you need escape escape character "\", try this: scanner filescanner = new scanner(new file("workspace\\sudoku\\file"));

ios - How would you translate and localize a variable element list? -

i've got list of n people , construct sentence so: andrea, bob, chelsea, dan , emma this. this easy have in strings file if number of people known beforehand format 5 people this: %@, %@, %@, %@ , %@ this. say have variable number of people though , number of people determined @ runtime , go 15 (or more) people. how potentially translate of different cases in conventional , non-fragile way, not doing in strings file , appending translations together: "initiallistitem" = "%@, " "midlistitem" = "%@ " "finallistitem" = "and %@ " "postludelistitem" = "like this." ideally define list format automatically expanded based on number of people in list, , easy translators translate. exist or there way this?

c# - Dependency Injection with collections -

so, lets have view named myclassview vm called myclassviewmodel , , these components housed inside of imodule implementation. can register instance of myclass unitybootstrapper , instruct member of myclassviewmodel retrieve through injection. bootstrapper this.container.registerinstance<myclass>("myclass", new myclass()); view model [dependency("myclass")] public myclass myclass { get; set; } simple enouigh. now, lets want go 1 step further , create view myclasscollection follows similar injection strategy, allows inject each instance of myclass myclassview , employing 1 module itemtemplate module. how go this? thank advice. unity happily inject named registrations given interface array of interface. internal class mycollectionviewmodel { public mycollectionviewmodel( iitem[] theitems ) { // use theitems fill collection of itemviewmodels... } } the items have registered interface, of course: container.

javascript - RxJs: How to "listen" to change on a subscription when it receives a stream? -

i'm new angular 2 , observables, haven't found way "listen" change on subscription when receives stream, don't know if possible or if it's right way. this used promises: // constructor , more code // ... ngoninit(): void { this.loading.present(); this.getitems() .then(() => this.loading.dismiss()); } getitems(): promise { return this.itemservice .getitems() .then(items => this.items = items); } refresh(refresher): void { this.getitems() .then(() => refresher.complete()); } i've tried subscription/observables don't know how: // constructor , more code // ... ngoninit(): void { this.loading.present(); this.getitems() .subscribe(() => this.loading.dismiss()); } getitems(): subscription { return this.itemservice .getitems() .subscribe(items => this.items = items); } refresh(refresher): void { this.getitems() .subscribe(() => refresher.complete()); } and of cours

p5.js - Using functions from other files in JavaScript -

i'm making game in js using p5, , came upon problem. in html file have references .js files: <!doctype html> <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.3/p5.min.js"></script> <script src="main.js"></script> <script src="iskeypressed.js"></script> <script src="blocks.js"></script> <script src="player.js"></script> </head> <body> </body> </html> i have 1 .js file defining function iskeypressed(): function iskeypressed(keyquery) { var did = false; for(var = 0; < keyspressed; i++) { if(keyspressed[i] === keyquery) { did = true; } } return did; } i reference in object inside player.js: player.motion = function() { if(iskeypressed('w')) { this.velocity.add(0,-5); } if(iskeypressed('s')) { this.velocity.add(0,5); } if(iske

c# - ASP.NET MVC. How render a Partial with no model (like create view) -

i render partial this: @html.partial("_mypartial") however partial need typed object, instance: mypartial.cshtml : @model myapplication.models.myclass (...) but render on view without initialized model, "create" view. create views bound model, initialized empty. what tried: @html.partial("_mypartial") main view model passed partial , throws incompatible types error. @html.partial("_mypartial", null) throws same error. @html.partial("_mypartial", new myclass()) initializes view default values. don't want pre initialized view. in "create" view, no model passed view, view bound model. render partial in "create" view. must no bound initialized model instance. must initialized empty. you have write code accept model type in view: @model myapplication.models.myclass so compulsory have pass model in view. if don't wants use model remove code accept model

html - Link Above a Div with a Low Z-Index -

my situation this: i have div z-index of -15. have div, within div, has z-index of 15. i ran exact code in jsfiddle, , worked in jsfiddle not me in notepad when opened in google chrome. #contentdiv { position: absolute; width: 100%; height: 100%; background-color: #ebebeb; z-index: -15; font-family: arial; } #link { position: absolute; width: 143; height: 216; z-index: 15; } <div id="contentdiv"> <div id="link"> <a href="link.html">link</a> </div> </div>

ios - Troubles with a cell size of a UICollectionView -

Image
i have cell of uicollectionview size func collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, sizeforitematindexpath indexpath: nsindexpath) -> cgsize { return cgsize(width: self.view.frame.width / 2 - 10,height: self.view.frame.width / 2 - 10) but @ run time storyboard new! after scroll view fine start of array views before scroll end of array again start of array views after scroll thanks. wrong cell ?

c++ - Is my array the cause of rapid cpu & memory build up? -

my mcvc compiling not functioning intended. goal genetic algorithm performs basics i.e. crossover,mutation,evolution. in code have provided should print out job statements thats not case. new programmer, sorry. questions are: 1) cpu , ram rev'ed up, array declaration , implementation cause uncontrolled spike? std::array<std::auto_ptr<individual>,50>myarray; 2) 2.53 ghz intel core 2 duo not it? 3) should cut down amount of loops? any welcomed ! individual.h #include <stdio.h> #include <cstdlib> #include <ctime> #include <vector> #include <array> #include <iostream> class individual { public: inline int getrandomnumber(int min = 0, int max = 1) { srand(static_cast<unsigned int>(time(0))); static const double fraction = 1.0 / (static_cast<double>(rand_max) + 1.0); return static_cast<int>(rand() * fraction * (max - min + 1) + min); } private: int defaultgenelengt

java - How to adapt the URL that I want to crawl in crawler4j -

i tried modifying code crawler4j-quickstart example i want crawl following link https://www.google.com/search?biw=1366&bih=645&tbm=nws&q=%22obama%22&oq=%22obama%22&gs_l=serp.3..0l5.825041.826084.0.826833.5.5.0.0.0.0.187.572.2j3.5.0....0...1c.1.64.serp..0.3.333...0i13k1.tmd9narkiru which google news search link keyword obama i tried modifying mycrawler.java @override public boolean shouldvisit(page referringpage, weburl url) { string href = url.geturl().tolowercase(); return !filters.matcher(href).matches() && href.startswith("https://www.google.com/search?biw=1366&bih=645&tbm=nws&q=%22obama%22&oq=%22obama%22&gs_l=serp.3..0l5.825041.826084.0.826833.5.5.0.0.0.0.187.572.2j3.5.0....0...1c.1.64.serp..0.3.333...0i13k1.tmd9narkiru/"); } also, controller.java /* * each crawl, need add seed urls. these first * urls fetched , crawler starts following links * found in these pages */ //

Android activity written to internal storage -

i writing android app write state save files. erroneous ran under premise files in applications internal storage, ones wrote there....so did not parse extension. turns out there file there , named after main activity... called "namspace.applicationname.mainacitivty". what file for? serialized version of activity?

Search in Doubly Linked List c# -

i'm writing application using doubly linked list. need implement search in list. there list of employees name, id, department. need find specified employee her/his last name. ideas, how it's possible implement? please not reinvent wheel. classes in .net - initialize linkedlist , use enumerable.firstordefault search: linkedlist<employee> employees = .... var firstwithidseven = employees.firstordefault(e => e.id == 7); // assuming id int note if need frequent search subset of parameters using dictionary custom comparer more efficient.

javascript - Cannot get keyboard focused for <a> link elements in SVG under Firefox -

i want focus object through keyboard's tab key adding <a> link surrounding other tags <path> , etc. here reference link: svg focusable attribute not working using method in link above, can focus object want under chrome, won't work under firefox, can tell why firefox not support this? thanks tabindex , focus/blur support svg has been implemented in firefox , will appear in version 51 . you can see in nightly right if want.

javascript - Making recursive function -

i'd make object likes obj = {2 : {3 : {4 : { } } } } function tsttt (){ var tstobj = {}; var cntr = 0; //counter var key = [2,3,4]; ///keys array want put in object function re(obj){ var k = key[cntr]; if(cntr == 2){ return obj; }else if(!(k in obj)){ obj[k] = {}; } cntr++; return re(obj[k]); } var rslt = re(tstobj); logger.log(rslt); //google apps script log } it returns empty object {} it's returning last object created, or property assigned "3". if want return full object have return tstobj. function re(obj){ var k = key[cntr]; if(cntr == 2){ return tstobj; }else if(!(k in obj)){ obj[k] = {}; } cntr++; return re(obj[k]); }

python - Django does session.flush() expire the database session entry? -

this question has answer here: delete session key users 3 answers according django documentation here request.session.flush() deletes current session data session , deletes session cookie. (django.contrib.auth.logout() function calls it) but automatically expire session entry inside database table? because if doesnt, think might cause unnecessary build of non-usable non-expired sessions inside table. yes, does. if @ source docstrings explicitly state that: def flush(self): """ removes current session data database , regenerates key. """ self.clear() self.delete() self._session_key = none that being said, there build of expired sessions. that's why should set scheduled job clear them using clearsessions management command: django not provide automatic purging of expired sess

guava - Importing ArrayListMultimap into IntelliJ - Java -

i imported guava multimap library intellij when try use multimap interface multimap<string, blockingqueue<string>> addblock = new arraylistmultimap.create(); the create not activate. coloured in red. this import statement used import com.google.common.collect.arraylistmultimap; import com.google.common.collect.multimap; it's static factory method, not constructor. remove new keyword: multimap<string, blockingqueue<string>> addblock = arraylistmultimap.create();

javascript - How to make autofill input text from a select dropdown box with multiple lines? -

i trying have function user can select items want drop-down box, price displayed in input box @ side. i facing problem have same function in multiple lines. code below: <td class="formiterate" > <select id="employee_id" name="id[]"> <option value="">select one</option> <?php $st = $pdo->prepare("select * tbl_stock"); $st->execute(); $rowes = $st->fetchall(pdo::fetch_assoc); foreach ($rowes $rowe) { ?><option value="<?= $rowe ['id']; ?>"><?= $rowe ['stock_item']; ?> (<?= $rowe ['stock_brand']; ?>)</option><?php } ?> </select> </td> <td class="formiterate"><input type="text" name="last_name[]" id="last_name"></td> as can see, wh

javascript - How do I ensure setState is called after the Firebase query populates array? -

i new firebase , using react native. trying populate listview data firebase. see can use promises in firebase, however, seems cannot use them .on() , .once . because need listen changes, need use .on() . the challenge me comes when want ensure state set after (and after) data retrieved firebase. code below: listen() { var self = var currentuserid = firebase.auth().currentuser.uid var postlist = firebase.database().ref('/users/'+currentuserid+'/postkeys') postlist.on('value', function(snapshot) { var posts = [] snapshot.foreach((child)=> { var postid = child.val().postid var postref = firebase.database().ref('posts/'+postid) postref.orderbychild('sorteddateinmilliseconds').on('value', function(postsnap) { posts.push(postsnap.val()) }) }) self.setstate({ postcount:posts.length, datasource:self.state.datasource.clonewit

strange exceptions.SystemExit in Python 2.7 -

here code , error message, have ideas why there such exception? thanks. source code , import sys import tensorflow tf def main(argv): print 'in main' def f(): # method call def main(argv) try: tf.app.run() except: print "tf.app.run error ", sys.exc_info() if __name__ == "__main__": f() error code , in main tf.app.run error (<type 'exceptions.systemexit'>, systemexit(), <traceback object @ 0x10fa33f38>) this expected behavior: tf.app.run() passes result of main() sys.exit() (to make easier set edit code), , sys.exit() raises exceptions.systemexit exception. it's important mention using tf.app.run() completely optional . many tensorflow scripts include because more compatible google python coding style. however, if need customize logic in script, free omit tf.app.run() . (the same applies tf.app.flags .)

javascript - Unable to launch Appcelerator IDE? -

Image
followed steps provided platform.appcelerator.com : account created download appcelerator studio ide installed sucessfully launching providing username , password error occurred , unable lanunch , here screenshot: kindly solve issue . highy appreciated. the problem - appcelerator studio unable install latest appc cli due proxy/network configuration issues. to identify root cause. open terminal , run below command. appc use latest is same error you've reported? if yes, verify proxy configuration appc config proxyserver does show configured proxy? if yes, , set unintentionally, can remove running below command. appc config set proxyserver this nullify proxy configuration. if there no proxy configured, still facing issue. then, network firewall not allowing access appcelerator software update site. contact network admin unblock it.

entity framework - Where to run "dotnet ef scaffold" for a new console application? -

trying create new console application in visual studio accessing existing sql server database. use ef core scaffold models database. microsoft's "getting started" instructions seem way off. suggest using nuget console , running scaffold-dbcontext "server=...." microsoft.entityframeworkcore.sqlserver this nothing. one source suggests running "dotnet ef dbcontext scaffold "server=....", errors out with: categoryinfo: notspecified: (no executable f...and "dotnet-ef":string) [], remoteexception if i'm running dotnet ef shouldn't been command prompt, rather pm console? in folder? running in project folder errors out no executable found matching "dotnet-ef" . note console application (not asp) , not have project.json, etc... did install ef nuget package ? install-package entityframework https://www.nuget.org/packages/entityframework

edifact - Exception in EDI Stream to Java Object conversion -

i trying read edi message , converting java object ,but ended below exception . exception in thread "main" org.milyn.smooksexception: failed filter source. @ org.milyn.delivery.sax.smookssaxfilter.dofilter(smookssaxfilter.java:97) @ org.milyn.delivery.sax.smookssaxfilter.dofilter(smookssaxfilter.java:64) @ org.milyn.smooks._filter(smooks.java:526) @ org.milyn.smooks.filtersource(smooks.java:482) @ org.milyn.smooks.filtersource(smooks.java:456) @ org.milyn.edi.unedifact.d97a.d97ainterchangefactory.fromunedifact(d97ainterchangefactory.java:58) @ org.milyn.edi.unedifact.d97a.d97ainterchangefactory.fromunedifact(d97ainterchangefactory.java:40) @ com.ibm.gpohub.edi.common.smookssample.main(smookssample.java:18) caused by: org.milyn.edisax.ediparseexception: edi message processing failed [ordrsp][d:97a:un]. segment [ftx], field 4 (text_literal), component 1 (free_text_-_-1) expected contain value. @ segment number 6. @

logging - Is it possible to create user defined level of LOG in java? -

is possible create user-defined level of log in java? if yes can give me example? i have web application, , web services exposed same. want create new log file every new request. there way can it? if yes, please share solution. thank in advance :) you can use mdc(mapped diagnostic context) in logback. web application javax.servlet.filter can used set context values every request. example: http://logback.qos.ch/xref/chapters/mdc/userservletfilter.html

Install ubuntu 14.04 server on Raspberry Pi 3 -

i'm new raspberry pi , need install ubuntu 14.04 server it. have raspberry pi 3. when tried installing noobs, downloaded https://www.raspberrypi.org/downloads/noobs/ when tried booting rpi, didn't show on screen. when tried installing raspbian wheezy or jessie, same. nothing showed on screen. i able install ubuntu-mate-16.04 though need cui ubuntu. also, application need on rpi isn't supported on ubuntu 16.04. is there way can install ubuntu server 14.04 or 15.04 or 15.10 on raspberry pi way can install virtual machine? tia try installing raspbian jessie lite on device. can here for windows, use win32 disk imager , write jessie-lite card. boot device , should work. have cui debian. since keen on ubuntu, unfortunately there nothing available @ moment similar looking for. should solve purposes. in experience of raspberry pi, though limited, works quite same ubuntu. you might have run sudo apt-get update once start device.

oracle - Postgres foreign data wrapper encoding issue -

i'm trying migrate oracle data ' we8mswin1252 ' encoding postgres database has ' utf8 ' encoding. i'm using foreign data wrapper . i'm getting invalid byte sequence error what should do? such errors can caused 2 things: there may 0 bytes in oracle strings. allowed in oracle (even though problematic), forbidden in postgresql. it easy data corruption in oracle, because pretty sloppy encoding checks , allows insert arbitrary illegal byte sequences when client encoding , server encoding same. there 2 approaches dealing problem: the correct way: fix data on oracle side. oracle_fdw support telling row in result set caused error. the sloppy way: use postgresql database database encoding sql_ascii , allow store in string (except 0 bytes).

data binding - asp.net Dropdown list databinding in runtime -

con = new sqlconnection(s); con.open(); if (radiobuttonlist1.selectedindex == 0) { cmd = new sqlcommand("select [item] veg_items", con); da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds, "[item]"); dropdownlist1.datasource = ds.tables[0]; dropdownlist1.databind(); } else if (radiobuttonlist1.selectedindex == 1) { cmd = new sqlcommand("select [item] nonveg_items", con); da = new sqldataadapter(cmd); dataset ds = new dataset(); da.fill(ds, "[item]"); dropdownlist1.datasource = ds.tables[0]; dropdownlist1.databind(); } con.close(); } i have items in table , need items displayed in dropdownlist once select value in radiobuttonlist . visualized items in ds.tables[0] line can't bind them dropdownlist .

Android Rating bar displays only one star -

i have created custom style ratingbar , when apply style rating bar, shows 1 star, , in properties of ratingbar , i've define size of start 5 well, on run time displays 1 star. note:i using actionbaractivity , in displaying ratingbar , when use activity class, displays 5 star , theme applied on that. please me out issue. check if using vector drawable causing issue. work try replace vector drawable png image in drawable folder , see magic work. you using vector drawable layer-list vector drawable image fit whole layout try replace png solve problem.

c# - How can i create StateClient object in LoginController using service url or microsoft app credentials? -

i working on bot framework technology, in 1 of project want create state client object using service url or microsoft credentials in logincontroller.cs this code wrote in logincontroller.cs, it's working in bot emulator after published bot , added skype it's not working. //[httpget, route("api/{userid}/authorize")] [httpget, route("api/{userid}/token")] public async system.threading.tasks.task<httpresponsemessage> authorize(string userid, string code) { authenticationcontext ac = new authenticationcontext("https://login.windows.net/common/oauth2/token/"); clientcredential cc = new clientcredential(constants.constants.adclientid, constants.constants.adclientsecret); authenticationresult ar = await ac.acquiretokenbyauthorizationcodeasync(code, new uri(constants.constants.apibasepath + userid + "/token"), cc, "https://api.office.com/discovery/"); if (!string.isnullorempty(a

javascript - How to add vue js functions to jquery dynamically -

i using reusable bootstrap modal i.e same modal edit, delete operations. when edit or update buttons clicked same modal pop , need append appropriate functions modal footer buttons according operation is. my footer buttons like, <div class="modal-footer"> <button class="btn actionbtn" data-dismiss="modal"> <span id="footer_action_button" class='glyphicon'> </span> </button> <button class="btn btn-warning" data-dismiss="modal"> <span class='glyphicon glyphicon-remove'></span> close </button> </div> when edit button clicked, $(document).on('click', '.edit-modal', function() { $('#footer_action_button').text(" update"); $('#footer_action_button').addclass('glyphicon-check'); $('#footer_action_button').removeclass('glyphicon-trash

elixir - Ecto table join -

the ecto documentation shows how join 2 tables (a<-b) based on association defined in schema. i'd expand adding table (b <- c) https://hexdocs.pm/ecto/ecto.html#assoc/2 but error. how reflect fact :comments belong :posts in query? repo.all u in app.user, join: p in assoc(u, :posts), join: c in assoc(p, :comments), preload: [posts: p],