Posts

Showing posts from May, 2015

c# - Generate heatmap using canvas in WPF -

Image
i want know how can generate heatmap on canvas in wpf (.net) i have array of points (coordinates) color intensity, these data want create similar but, found there no tutorial or library generate them on canvas.. i sorry, have wrong. wpf canvas sandbox higher level objects, not points. there rectangles, circles, ellipses, lines, polylines etc, more put in, slower gets. image heat map use tens of thousands points or millions of points , pretty bad idea play directly in canvas. kind manipulation, need pixels play , means special kind of container, writableimage . please on link. this kind container/class capable manipulate efficiently pixels, , way should done. please note, there multiple kinds of bitmap containers wpf.

Rails disable eager loading for specific model -

i'm writing rails application functionality interfaces third-party api (streamsend) via activeresource. i'm using shopify's fork of activeresource thread-safe operation because different users of application have own streamsend api client id's , secret keys , don't want app step on them when interfacing third-party api. i have in controller associated around_action filter: private # set streamsend credentials in every request def set_ss_credentials streamsend.site, streamsend.user, streamsend.password = current_user_credentials yield ensure streamsend.site = streamsend.user = streamsend.password = nil end default_site, default_user, default_password = [ rails.application.secrets.streamsend_api_endpoint, "username", "password" ] def current_user_credentials current_user.present? ? [ rails.application.secrets.streamsend_api_endpoint, current_user.ss_userid, current_user.ss_key ] : [ default_site, defa

asp.net mvc - Wht is the best solution for HTML to PDF (on Azure Web app) -

actually trying convert html content pdf using nreco pdf converter, however, line of code pdfdoc.generatepdf(htmlcontent); unable through on azure web app, works on dev environment. question cloud service should go for? azure apps (former websites) operate in restricted (partial-trust) environment , wkhtmltopdf.exe (that internally used nreco pdfgenerator wrapper) cannot executed in case directly asp.net application. update: unfortunately not work azure webjobs well: tasks executed under same (limited) environment websites , gdi functions used wkhtmltopdf disabled. if asp.net app uses wkhtmltopdf-based component pdf generation (doesn't matter how invoked - in separate process or native dll api) work under azure webrole / workerrole / vm. -- update 2017 -- wkhtmltopdf (and nreco pdfgenerator wrapper) can used azure apps vm-based subscription plan (basic or higher). @ least 1 issue still exists: seems fonts api still restricted , custom fonts cannot rendered p

angularjs - validate dynamic form before submitting angular -

i'm dynamically creating forms ng-repeat , have validation attributes (simplified version): <div class="row" ng-repeat="defect in model.defects"> <form name="form_{{defect.id}}" novalidate> <input ng-model="defect.name" required/> <input type="submit" ng-click="savedefect(defect)"/> </form> </div> basically want this: $scope.savedefect = function (defect) { if ($scope.<how form name here>.$invalid) { return; } } since form name has been created dynamically id how access it? other ways of doing same welcome ofcourse :) you can use bracket notation access : $scope["form_"+defect.id] what advise : var app = angular.module("app", []); app.controller("ctrl", function($scope) { $scope.forms = {}; $scope.list = [{id: 1}, {id: 2}]; $scope.save = function(item) {

javascript - How to select a key: value pair in string format used in a JSON object? -

i want select length, it's in string form. along lines of attribs.length, returned nothing. attribs: { "length": ""4"", "nightride": "null" } i've tried splitting , rejoining either way don't want. i've tried attribs[length] , attribs["length"] no avail. here major chunk from: { places: [ { city: "boise", state: "idaho", country: "united states", name: "elk meadows", parent_id: null, unique_id: 1637, directions: "&quot;from boise's north end (at intersection of hill , bogus basin roads), travel north bogus basin road 16.5 miles.the pavement ends @ lower (main)parking lot near bogus creek lodge. proceed on boise ridge rd. sandy surface turns pavement leavesthe main ridge rd.and splitsright, through series of switch backs pioneer lodge milage starts here", lat: 43.764, lon: -116.103

prolog - Can smb explain why this is **true** -

can smb explain why true ? not(g). not(g) :- g, !, fail. it true because first clause reads: not(_). the code got there weird. name not not quite fit obvious declarative meaning.

sockets - TCP Connection Pooling JAVA -

i found similar question here: how implement tcp connection pooling in java? but see answers not enough. also, tried other links connection pooling examples either related db or http connection pooling. here situation: have server running using socket on port. now, there middle-ware clients interact , middle-ware interacts tcp server response. so, wanted create connection pool between middle-ware , tcp server. now, here questions: is tcp connection pooling possible. if is, there library me? or have implement myself? if former, link library, docs etc. help. if latter, related implementation (readable , understandable) of help. (i'd prefer former.)

Access Updating the Subform with Item selected in Listbox -

i have following code following: 1. delete data view table 2. appends data main main table 3. selects id & product nr of appended record , populates in view table 4. clears controls on main form 5. refreshes form note: id listbox rowsource select id query view table. subform populates when click on id listbox. prompt subform populate once id box populated. problem: after appending record, id listbox populates, selects item, subform (which linked through master - child) not requery record data id nr selected in listbox. private sub cmdinsert_click() dim ctl control docmd.setwarnings (warningsoff) currentdb.execute "delete ec_id_table" docmd.openquery ("ec_insert_new_record") docmd.openquery ("ec_id_table qry") each ctl in form_frmec.controls select case ctl.controltype case actextbox if ctl.name <> "id" ctl.value = "" end if case acoptiongroup, accombobox, aclistbox ctl.value = null case acche

mysql - How to return Multiple outputs from a database as different columns in SQL -

i trying access outputs database. question : how many songs released during each decade classification of pop music. how can output songs in different decades in 1 single query search. the desired output should different columns songs different decades. my try first 2 decades. select count(*) before1970 songs , classification = 'pop' releaseyear < 1970 , (select count(*) 'before1980' songs releaseyear between 1970 , 1980 , classification = 'pop' ); i checked oldest song database 1969 used 1970 starter , go each decade, output returns nothing. another alternative: select sum(if(releaseyear < 1970, 1, 0)) before1970, sum(if(releaseyear >= 1970 , releaseyear <= 1980, 1, 0)) before1980 songs classification = 'pop'

Error java.lang.NullPointerException JSF -

this question has answer here: what nullpointerexception, , how fix it? 12 answers i'm using jsf/primefaces, i'm getting npe, i'm invoking method "registrar" form appears i'm doing wrong. have class profesorbean.java , view edicion.xhtml **class: profesorbean** ............................................... @managedbean(name="profesorbean") @sessionscoped public class profesorbean { private profesor profesor; private list<profesor> profesores; private integer autogenerado=2; public string registrar(){ if (profesor.getcodigo()!=null) { }else { profesor.setcodigo(autogenerado); profesores.add(profesor); autogenerado++; } profesor=null; return "listado"; } } ............................................... here part of form submitted edicion.x

php - Update different databases in transaction (Laravel) -

Image
for our web application, written in laravel, use transactions update database. have separated our data cross different database (for ease, let's "app" , "user"). during application update, event fired update user statistics in user database. however, application update may called part of transaction on application database, code structure looks follows. db::connection('app')->begintransaction(); // ... db::connection('user')->dostuff(); // ... db::connection('app')->commit(); it appears attempt start transaction on user connection (since single query creates implicit transaction) while in game transaction not work, causing deadlock (see innodb status output ). used innotop more information, while showed lock wait, did not show query blocked. there lock present on user table, not find it's origin. relevant output shown below: the easy solution pull out user operation transaction, since actual code more complicated

PRISM 6 Regions in WPF using DataTemplate/CustomControl -

what recommended way defining regions in datatemplates using prism 6? if define region in datatemplate not registered in regionmanager... have same issue using custom control 3 contentcontrols on each defining region. can't find them in regions collection in regionmanager. this known issue in prism. here fix: http://southworks.com/blog/2011/11/10/regions-inside-datatemplates-in-prism-v4-using-a-region-behavior/

a crux about nil test in ruby code -

i have crux in ruby code(excerpt this page ): #!/usr/bin/env ruby class megagreeter attr_accessor :names #create object def initialize(names = "world") @names = names end # hi def say_hi if @names.nil? puts "..." elseif @names.respond_to?("each") # @names list of kind,iterate! @names.each |name| puts "hello #{name}!" end else puts "hello #{@names}!" end end # bye def say_bye if @names.nil? puts "..." elseif @names.respond_to?("join") puts "goodbye #{@names.join(",")}. come soon." else puts "goodbye #{@names}. come soon." end end end if __file__ == $0 mg = megagreeter.new mg.say_hi mg.say_bye # change name "zeke" mg.names = "zeke" mg.say_hi mg.say_bye # change name array of names mg.names = ["albert", "brenda&qu

ipad - MDM iOS 9 app install failure -

why ipa sideload, not install via airwatch? our in house application install when side-loaded mac using itunes. however, enterprise wide distribution, use airwatch. when using exact same ipa, via airwatch, app fails install, returning error reads " unable install " without other information. missing? if provision profiles , signing not correct, shouldn't able build app in first place. correct? and once built, , side-loadable, stand reason should install via airwatch without issue. when exploring ipa apple configurator, have retrieved following log file: oct 23 14:19:23 grant-test-ipad ondemandd[171] : unable update manifest, cannot find bundle url. oct 23 14:19:23 grant-test-ipad ondemandd[171] : calling applicationdownloadinitiated: reply block error : error domain=_ondemandresourceserrordomain code=114 "(null)" userinfo={nslocalizedrecoverysuggestion=lsapplicationproxy returned no bundle url.} oct 23 14:19:23 grant-test-ipad itunesstored[130] : [

sql - Oracle REGEXP_LIKE match up to a period (decimal point) or find next sequence in numbers such as Dewey Decimal -

i have data such oc_id parent_oc_id 4.0.1 4.0 4.0.1.1 4.0.1 4.0.1.1.1 4.0.1.1 4.0.1.1.2 4.0.1.1 4.0.1.1.3 4.0.1.1 4.0.1.2 4.0.1 4.0.1.3 4.0.1 4.0.1.4 4.0.1 4.0.1.5 4.0.1 4.0.1.5.1 4.0.1.5 4.0.1.5.2 4.0.1.5 4.0.1.5.3 4.0.1.5 4.0.1.5.4 4.0.1.5 4.0.2 4.0 4.0.2.1 4.0.2 4.0.2.2 4.0.2 4.0.2.2.1 4.0.2.2 4.0.12 4.2 <--------data anomally!!! i trying determine next number in hierarchy. example if start parent_oc_id = 4.0 need know next available sibling number (oc_id) within 4.0.? hierarchy 4.0.13 originally using , worked. select max(to_number (substr (eb_ocs.oc_id, instr (eb_ocs.oc_id, '.',

php - how to save ip address in database -

i creating voting website in person can vote once. want make sure person can vote in every 3 hour. technically speaking want save ip address , cookie whenever person click on vote button vote should increase 1 , person should not able vote 3 hour. want run session save ip , cookie 3 hours. have multiple entries on 1 page. don't know way go either saving database or other method. don't have advance knowledge of php guys please me out stuck here. you can capture ip address $_server['remote_addr']; every time if user clicks on vote , first capture ipaddress. run query select * table ipaddress = "current ip address" , question number = id , time difference >= 3 hours if ip address present, user has answered, else increment votes.

php - Unable to connect to the database on mongolab account -

i have created account on mongodb lab , when try connect command mongo ds037824.mongolab.com:37824/mydatabase -u rakeshstellen -p stellen@123 getting error: mongodb shell version: 3.0.6 connecting to: ds037824.mongolab.com:37824/mydatabase 2015-10-15t10:45:14.185+0530 w network failed connect 54.198.170.179:37824 after 5000 milliseconds, giving up. 2015-10-15t10:45:14.188+0530 e query error: couldn't connect server ds037824.mongolab.com:37824 (54.198.170.179), connection attempt failed @ connect (src/mongo/shell/mongo.js:181:14) @ (connect):1:6 @ src/mongo/shell/mongo.js:181 exception: connect failed any appreciated. try trouble-shooting guide: http://docs.mongolab.com/connecting/#help and if still have problems after that, email support@mongolab.com , can you. -will

osx - Get android studio (or the gradle part) running on OS X 10.7.5 -

i need start android-development develop app motorola smartwatch on old mac os x lion. therefore tried installing android studio when got point goes wrong , that's realised mac os x 1.8 required. after looking workarounds (i pretty sure there must found people claiming having android studio running on not-requirement-meeting os) stumbled upon a question on so . although answer there suggested forget android studio, tried again , discovered install android studio without avd. turned out better expected , after replacing adb older (mac os x 10.7.5 compiled) version, managed start new project. although seems work now, gradle hangs when try build random project blank activity. don't find information gradle, system requirements , don't have experience it, wondering whether know solution. which leads actual question: there workaround android studio running on older mac os x? instance solving gradle-problem or maybe totally other technique or doomed use eclipse (assuming

python - Tkinter StringVar Send mail error SMTPlib -

i making tkinter app send short email. the code in full: from tkinter import * smtplib import * time import sleep root=tk() root.wm_title("gmail short message sender") w = 500 # width tk root h = 500 # height tk root # screen width , height ws = root.winfo_screenwidth() # width of screen hs = root.winfo_screenheight() # height of screen # calculate x , y coordinates tk root window x = (ws/2) - (w/2) y = (hs/2) - (h/2) # set dimensions of screen # , placed root.geometry('%dx%d+%d+%d' % (w, h, x, y)) def send(): e1_var.get() e2_var.get() e3_var.get() try: smtpobj = smtp('smtp.gmail.com', "587") smtpobj.ehlo() smtpobj.starttls() smtpobj.ehlo() smtpobj.login("123@gmail.com", "password") smtpobj.sendmail(sender1, receivers1, msg1) l1=label(text="sent").grid() sleep(1) l1.destroy() except smtpexception: l2=label(tex

asp.net core - Unable to load libuv in windows server 2012 r2? -

in visual studio code, issue dnx kestrel in command line palette. encountering error this info : [microsoft.framework.dependencyinjection.dataprotectionservices] user profile available. using 'c:\users\myaccount\appdata\local\asp.net\dataprot ection-keys' key repository , windows dpapi encrypt keys @ rest. system.invalidoperationexception: unable load libuv. @ microsoft.aspnet.server.kestrel.networking.libuv.load(string dlltoload) @ microsoft.aspnet.server.kestrel.kestrelengine..ctor(ilibrarymanager librar ymanager, iapplicationshutdown appshutdownservice) @ microsoft.aspnet.server.kestrel.serverfactory.start(iserverinformation ser verinformation, func`2 application) @ microsoft.aspnet.hosting.internal.hostingengine.start() @ microsoft.aspnet.hosting.program.main(string[] args) --- end of stack trace previous location exception thrown --- @ system.runtime.exceptionservices.exceptiondispatchinfo.throw() @ microsoft.dnx.runtime.common.entrypointexecu

git - Proper way to submit pull request via GitHub (when contributing to open source) -

i've forked , cloned project github, made branch off master make changes. once i've made changes , want submit pull request, , wondering best way it. (1) submit pull request upstream repo directly off of branch, merge branch master in repo later on or (2) merge branch master in repo first, submit pull request upstream repo master? as rule of thumb, should not develop on master branch. although technically can, master branch used track current state of project. since pull request not accepted yet, not reflect current state, , merging local master cause confusion. best practice this: fork project create local feature branch (e.g., git checkout -b myfeature ) develop, test , validate locally. push local feature branch remote branch on github account (e.g., git push origin myfeature ). create pull request feature branch ( yourname/myfeature ) master branch ( projectowner/master ). get reviewed, fix pull request needed project maintainer merges pull requ

php - Laravel 5.1 how to use {{ old('') }} helper on blade file for radio inputs -

i'm learning laravel , creating first form. awesome until want use {{ old('') }} helper in blade file radio buttons. i'm not sure how go doing properly, , can't seem find info on here either. the code have follows: <div class="form-group"> <label for="geckohatchling">gecko hatchling?</label> <div class="radio"> <label> <input type="radio" name="geckohatchling" id="geckohatchlingyes" value="1"> yes </label> </div> <div class="radio"> <label> <input type="radio" name="geckohatchling" id="geckohatchlingno" value="0" checked> no </label> </div> </div> i think following little bit cleaner: <input type="radio" name="geckohatchling"

Get gradle.properties file from Gradle custom plugin -

i'm developing gradle plugin , need read , write gradle.properties project file. have tried this: @taskaction public void myaction() { properties properties = new properties(); try { properties.load(new fileinputstream(getproject().file("gradle.properties"))); } catch (ioexception e) { e.printstacktrace(); } } but filenotfoundexception . how can file? i found error. gradle api documentation says .file(object path) method in project class: resolves file path relative project directory of project. my gradle.properties file in root project, instead of in module plugin applied.

php - Skip validators in Zend Framework 2 Forms -

i using zend framework 2 building project. in 1 of forms have field needs validates several validators if given condition satisfied (e.g. value of form field). is there way skip validation of field based on external condition? you can use method setvalidationgroup inside inputfilter class set input fields should validated. you example extend inputfilter class , use setvalidationgroup in customized setdata method, , set group depending on presence of field in $data . for example this: <?php namespace application\inputfilter; use zend\inputfilter\inputfilter; class custominputfilter extends inputfilter { /** * set data use when validating , filtering * * @param array|traversable $data * @return inputfilterinterface */ public function setdata($data) { $group = array( // custom validation group ); if(isset($data['fieldname'])){ $this->setvalidationgroup($group);

java - Setting connection retry limit of orientdb -

Image
hello using orientdb in distributed environment there 2 orientdb servers instances on dbsrv-1 , dbsrv-2. have followed following tutorial setup distributed databases , working fine. but problem facing when node down , java client tries connect particular node, in such case client seems stuck in infinite loop of connection retries. have tried setting orientdb global setting via command line this: java -dnetwork.retry=1 also tried setting @ runtime this oglobalconfiguration.network_socket_retry.setvalue(1); but nothing doesn't seem work. following code open database connection: db = new odatabasedocumenttx("remote:localhost/mydb").open("admin", "admin"); java exception trace below: oct 15, 2015 8:03:48 pm com.orientechnologies.common.log.ologmanager log severe: can not open database url localhost:2424/mydb com.orientechnologies.common.io.oioexception: cannot open connection remote server: localhost:2424/mydb @ com.orientechno

postgresql - Django foreign keys : settings.AUTH_USER_MODEL keeps giving null for form.save -

i have read articles , tried implement in models. user = models.foreignkey(settings.auth_user_model) but whenever try save form user states value cant null. assume because not passing/picking auth_user for example: class degree(models.model): user = models.foreignkey(settings.auth_user_model) degreelevel = models.charfield(max_length = 50) areaofstudy = models.charfield(max_length = 50) i have feeling on user creation need create signal models use user = models.foreignkey(settings.auth_user_model) struggling find resource deals issue start finish, not sure going wrong. any great... this question relates profiles_details.id not exist django thank you. i have tried : user = models.foreignkey(settings.auth_user_model, null=false, on_delete=models.cascade, verbose_name=_(u"user")) got error message when running migrations of : nameerror: name '_' not defined if take verbose nameout , try migrate get: error: you try

python 3.x - "Task farming is disabled" or similar socket related problems encountered in IPython.parallel sessions -

ipython.parallel's load balanced interface has been great. used run complicated scientific computations on small cluster environment. several houndred problems, each taking 5~10 minutes complete on pc, sent cluster. had no problem getting results until started submitting more strenuous tasks cluster. engines unregistered though task assigned completed successfully. use "ipcontroller --ping=120000" circumvent problem, ipython tells me "task farming disabled". causing problem , should do? by way, use ssh mode on cluster.

ios - MVC model compliance -

i have app writes lot of data coredata db interrogate , give feedback based on user queries. for have db actions in vc , move separate file called modeldb. // mark: outlets @iboutlet weak var coursefield: uitextfield! @iboutlet weak var par3field: uitextfield! @iboutlet weak var par4field: uitextfield! @iboutlet weak var par5field: uitextfield! @iboutlet weak var errorlabel: uilabel! // mark: actions @ibaction func addnewcourse(sender: anyobject) { let appdel: appdelegate = uiapplication.sharedapplication().delegate as! appdelegate let context: nsmanagedobjectcontext = appdel.managedobjectcontext let newcourse = nsentitydescription.insertnewobjectforentityforname("coursedb", inmanagedobjectcontext: context) newcourse.setvalue(coursefield.text, forkey: "coursename" newcourse.setvalue(int(par3field.text!), forkey: "totalpar3") newcourse.setvalue(int(par4field.text!), forkey: "totalpar4") newcourse.setvalue(int(par5field.t

android - Unable to set Background in Imagebutton -

Image
here have imagebutton : <com.defcomdevs.invento16.squareimageview android:id="@+id/picture" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_gravity="center_horizontal|top" android:background="@drawable/custom_button" android:layout_margin="1dp" android:scaletype="fitcenter" /> squareimageview class extends imagebutton set width , height automatically according screen size. custom_button.xml: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="false"> <shape android:shape="rectangle"> <stroke android:width="5dp" android:color="#885599"/> </shape> </item> <item android:state_pressed="true"> <shape an

angularjs - MEAN stack delete -

trying add delete button list of posts, delete entry database, gets null when clicking button. my $scope $scope.remove = function(post) { posts.remove(post); } links function: o.remove = function(post) { $http({ url: '/posts/' + post._id, method: 'delete' }).then(function(res) { // deleted console.log(data); // update list $http.get("/posts") .success(function(data, status, headers, config) { console.log(data); }); }, function(error) { console.log(error); }); }; router: router.delete('/posts/:post', function(req, res, next) { post.remove({ _id : req.params.id }, function(err, post) { if (err) res.send(err); post.find(function(err, post) { if (err) res.send(err) res.json(post);

python - Pass multiple params in django url -

i have "viewtree "url requires multiple input params arbitrary strings input. i have tried following 2 implementations of url_patterns: urlpatterns=[ url(r'^$',views.home,name='home') url(r'^(?p<cutoff>.*)/(?p<threshold>.*)/(?p<data_file>.*)/(?p<clustering_func>.*)/(?p<num_groups>.*)',views.viewtree,name='tree') ] and urlpatterns=[ url(r'^$',views.home,name='home') url(r'^(?p<cutoff>.*)-(?p<threshold>.*)-(?p<data_file>.*)-(?p<clustering_func>.*)-(?p<num_groups>.*)',views.viewtree,name='tree') ] both of these implementations not working me , returning syntax errors. wondering syntax error , how fix it. (also did have regex .* correct matching arbitrary length string). also how write action part of post form in html send these values form viewtree view. have like <form action="{% url 'appname:viewtree' cuto

python 2.7 - If I change a field value in an api.onchange method, it's not updated in the view. Why? -

i have function executing in api.onchange('bom_line_ids') , inside function want have if statement clear bom_line_ids if condition matched. used self.bom_line_ids.product_id = false but reason field cleared (saw in prints, it's not updated in view). @api.onchange('bom_line_ids') def get_excl_list(self): list1 = [] in self.excl_list: list1.append(i.id) list2 = [] j in self.bom_line_ids: list2.append(j.product_id.id) if j.product_id.id in list1: warning_message = "product: " + self.env['product.template'].search([('id','=',j.product_id.id)]).name + " can't added bom.\n please select product." print "self.bom_line_ids.product_id", self.bom_line_ids.product_id self.bom_line_ids.product_id = false print "self.bom_line_ids.product_id", self.bom_line_ids.product_id return { 'warn

php - POST values from dynamically created radio buttons to mysql database -

i have sets of radio buttons fetched database. data tables - id title name option1 option2 option3 ------ ------- ------- ------- ------- ---------- 1 wi-fi wifi yes no (null) 4 parking parking yes no optional i have following codes fetch data database. $get_biz_meta_list = mysqli_query($connect, "select * biz_meta_list") <form class="form-horizontal" action="add-biz-meta.php" role="form" method="post" > <?php while($biz_meta_list = mysqli_fetch_array($get_biz_meta_list,mysql_assoc)){ ?> <input type="hidden" name="mid" value="<?php echo $biz_meta_list['id'];?>" /> <div class="form-group col-md-12"> <label for="inputemail1" class="col-md-3 control-label"><?php echo $biz_meta_list['title'];?></lab

jquery - JavaScript Button to href so I can call it from my html -

i built dialog in javascript has 3 buttons this: buttons: { 'spara': function() { if (!validate()) { alert('procent måste vara mellan 0-100'); return false; } locstring = "@(url.action("index"))/update/?"; locstring += '&projectid=' + $('#projectlist').val(); locstring += '&startdate=' + $('#startdate').val(); locstring += '&enddate=' + $('#enddate').val(); locstring += '&pct=' + $('#pct').val(); var sid = $('#sid').text(); if (sid != "") { locstring += '&id=' + sid; //locstring = "/delete/" + sid; } //window.location = locstring;

Python logging module imported in different scripts -

in python logging tutorial, there example 2 python scripts : myapp.py , , mylib.py the code : # myapp.py import logging import mylib def main(): logging.basicconfig(filename='myapp.log', level=logging.info) logging.info('started') mylib.do_something() logging.info('finished') if __name__ == '__main__': main() and # mylib.py import logging def do_something(): logging.info('doing something') what don't how fact using basicconfig in myapp.py changes logging behavior in mylib.py . i thought in python, when import same module in 2 different scripts, disconnected because first 1 becomes myapp.logging , second 1 mylib.logging . edit : i changed mylib.py code # mylib.py import logging def do_something(): logging.warning('doing something') do_something() when run myapp.py, logs printed in console , not appear in log file anymore. how possible? there's bug (if can call t

android - Does Whatsapp store my contacts on its server to implement last seen? -

whatsapp provides 3 options whom show last seen: everyone, contacts, nobody. , nobody pretty straight forwards, implemented setting flag in server database. but when comes showing last seen contacts, when requests server last seen, how server know person in contacts not?

vhdl - ERROR: Signal signal_led cannot be synthesized, bad synchronous description -

i don't understand why error: warning:xst:819 "c:/users/aa/desktop/tools/mycoursedesign/control.vhd" line 52: 1 or more signals missing in process sensitivity list. enable synthesis of fpga/cpld hardware, xst assume necessary signals present in sensitivity list. please note result of synthesis may differ initial design specification. missing signals are: <signal_led>, <signal_q0>, <signal_q1>, <signal_q2>, <signal_q3>, <signal_q4> error:xst:827 - "c:/users/aa/desktop/tools/mycoursedesign/control.vhd" line 52: signal signal_led cannot synthesized, bad synchronous description. description style using describe synchronous element (register, memory, etc.) not supported in current software release. library ieee; use ieee.std_logic_1164.all; use ieee.std_logic_arith.all; use ieee.std_logic_unsigned.all; entity control port ( clkadd,clksub: in std_logic;--脉冲 --模式 model : in std_log

Local-machine Kubernetes service unreachable by pods -

followed guide starting local-machine kubernetes cluster: http://kubernetes.io/v1.0/docs/getting-started-guides/docker.html i've created various pods .yaml files , works, can access nginx , mysql using container ips (in 172.17.x.x range, docker0), when create services, service ips in 10.0.0.x range, unreachable other containers. isn't kube-proxy supposed create iptables rules automatically, providing access containers behind service ip? no iptables changes happening, , other containers can't reach services. thanks! i ran through (slightly out of date) doc. found works if replace hyperkube:v0.21.2 hyperkube:v1.0.7 in 2 "docker run" lines, , replace 0.18.2 1.0.7 in kubectl download url. i have offered pull-request update doc. sorry trouble.

Consuming from rabbitmq using Celery -

i using celery rabbitmq broker on server a. tasks require interaction server say, server b , using rabbitmq queues interaction. queue 1 - server (producer), server b (consumer) queue 2 - server b (producer), server (consumer) my celery unexpectedly hanging , have found reason incorrect implementation of server consumer code. channel.start_consuming() keeps polling rabbitmq expected putting in celery task creates multiple pollers don't expire. can add expiry time completion data being sent server b cannot guaranteed. code pasted below 1 method used tackle issue not convinced best solution. i wish know doing wrong , right way implement because have failed searching articles on web. tips, insights , links articles extremely helpful. finally, code - @celery.task def task_a(data): do_some_processing # create 1 rabbitmq consumer instance avoid celery hangups task_d.delay() @celery.task def task_b(data): do_some_processing if data not none:

pseudocode - PN Sequence Generation using matlab -

i trying generate pn sequence using 5 shift registers. shift register should composed out of 10 states, giving period of 1023 bits. trying hard done, confused how generate 1023 bits using 5 shift registers. need submit tomorrow , feeling tense. can please me matlab code. p.s. not allowed use matlab's built-in functions generate sequence.

java - private static final String not doing its job -

i have implemented global private static final string key this: private static final string key_stufe = "stufe"; to use easypreferences. when type hardcoded string int abc = prefs.getint("mykey", 1); the code works fine. but when use global key: int abc = prefs.getint(key_stufe, 1); java.lang.classcastexception: java.lang.string cannot cast java.lang.integer i not error. global key defined string , functions expects string. fine good. why such error? from documentation of getint method: throws classcastexception if there preference name not int. this happens here, key "stufe" not have int value associated.

javascript - AngularJS - Using .Then Instead of .Success is not working with HTTP function -

i've been searching lot topic couldn't find solution still. believe not handling promise properly. have angularjs mvc model working fine when handle api call .success when changed .then ( because other depreciated ) doesn't work. can see in http-server log code below still json file , using simple json file testing believe did not forgot define view (like angularjs - can't access retrieved json data in view ) i tested complete http.get syntax in controller not working. services.js angular.module('myapp.services', []) .factory('apiservice', function($http, $q) { var myapis = {}; myapis.getfulllist = function() { return $http.get("myfile.json", {timeout: 30000, cache:false}); }; //(...) more apis here return myapis; }); controllers.js angular.module('myapp.controllers', []) .controller("tablectrl", function($scope, $http, $q, apiservice) { var promise = apiservice.getfull