Posts

Showing posts from September, 2015

c# - Catel custom View creation -

i create custom window , show without iuivisualizerservice catel. the problem is: when create window, bind viewmodel it, seems view not react on properties changes. i have done following: var photo = new photo(); newphotowindow newphotowindow = new newphotowindow(); var viewmodel = new newphotowindowviewmodel(photo); newphotowindow.datacontext = viewmodel; newphotowindow.showdialog(); is there way create via kind of viewlocator? i have tried typefactory , not allow me put photo model viewmodel. you shouldn't manually doing viewmodel creation in catel. it's done automatically. this should sufficient: uivisualizerservice.showdialog<newphotowindow>(); this automatically: resolve vm belongs newphotowindow (newphotowindowviewmodel or newphotoviewmodel). instantiate vm using iviewmodelfactory create window , set vm it

html5 - javascript variable not working inside html tag -

i want html attribute values javascript statement(function). marks portion block red on image targeted co-ordinates inside area tag. full code given below @ bottom. this works fine: <script type="text/javascript"> document.write('<area href="#" select="red" shape="rect" coords="69,76,84,102">'); </script> but reason reason, not seem work. ideas? <script type="text/javascript"> var crd=[69,76,84,102]; document.write('<area href="#" select="red" shape="rect" coords="'+crd[0]+","+crd[1]+","+crd[2]+","+crd[3]+'">'); </script> this html file. <!doctype html> <html> <head> <title>mapping physical library</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> <scr...

python - Finding all legal moves in a simple board game -

i have 8x8 board represented numpy.ndarray: array([[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]]) # 0 = free space # 1 = player1's figure a figure can either move forward , left, forward , right or forward (forward means down board in case). right using nested loops in order through board indexes. when find figure append board states can achieved making moves figure list , keep searching figures. for example output of function looks this: [array([[[0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0]], [[0, 0, 0, 0, 0, 0, 0, 0], ...

Receiving "NO CARRIER" error while tring to make a call using GSM modem in Python -

Image
i want make call using gsm modem. wrote below program: import time import serial recipient = "+98xxxxxxxxxx" phone = serial.serial("com10", 115200, timeout=5) try: time.sleep(0.5) phone.write(b'atz\r') time.sleep(1) phone.write(b'atd"'+recipient.encode() +b'"\r') while(1): print(phone.readline()) time.sleep(0.5) finally: phone.close() but when run receive output: >>> ================================ restart ================================ >>> b'atz\r\r\n' b'ok\r\n' b'atdxxxxxxxxxx\r\r\n' b'no carrier\r\n' what "no carrier" error means? note can send sms successfully. this program use send sms: import time import serial recipient = "+98xxxxxxxxxx" message = "test" phone = serial.serial("com10", 115200, timeout=5) try: time.sleep(0.5) phone.write(b'atz\r') time....

How to connect android app to App engine -

i'm trying connect app in android server i've opened on appengine. my server's name : dddd-daniel-2345 , website server : http://dddd-daniel-2345.appspot.com/ this how connect android app server in app engine: app.yaml: application: dddd-daniel-2345 version: 1 runtime: python27 api_version: 1 threadsafe: yes handlers: - url: .* script: main.app libraries: - name: webapp2 version: "2.5.2" main.py: #!/usr/bin/env python # # copyright 2007 google inc. google.appengine.api import users import webapp2 class userhandler(webapp2.requesthandler): def get(self): user = users.get_current_user() if user: greeting = ('%s,%s,%s' % (user.email(),user.user_id(),user.nickname())) else: greeting = ('not logged in') self.response.out.write(greeting) app = webapp2.wsgiapplication([('/', userhandler),], debug=true) my applications code : add manifast main....

android - View is not updating from other controller Appcelerator Alloy -

i hope fine. having trouble updating views in titanium appcelerator alloy, i want able delete previous children picker , add new 1 in picker in different controller/view in..... i have followed this solution unfortunately not working me. here code trying. createevent.js ti.app.addeventlistener('db_update', function(){ alert("ok"); $.picker.removeallchildren(); }) customparty.js $.btnclick.addeventlistener('click', function(){ ti.app.fireevent('db_update'); }); // ok alert shows children of picker aren't removed. since ok alert shown, in way , callback function called successfully. problem here calling removeallchildren method not removing rows picker. solution iterate on colums , delete rows : ti.app.addeventlistener('db_update', function(){ alert("ok"); //get picker columns var columns=$.picker.getcolumns(); //iterate on picker columns (var it=0,length=columns.length;i<l...

how to get HTML5 Application Cache Status by Selenium/Java -

how html5 application cache status selenium/java for selenium/java programming, how can selenium/java status of html5 application cache status? tried below, didn't work. "cannot cast org.openqa.selenium.html5.applicationcache.." import org.openqa.selenium.webdriver; import org.openqa.selenium.firefox.firefoxdriver; import org.openqa.selenium.html5.appcachestatus; import org.openqa.selenium.html5.applicationcache; public class html5appcache { public void testhtml5localstorage() throws exception { webdriver driver = new firefoxdriver(); driver.get("http://www.w3schools.com/html/tryhtml5_html_manifest.htm"); appcachestatus status = ((applicationcache) (driver)).getstatus(); } } you casting short appcachestatus object below, hence error. appcachestatus status = ((applicationcache) (driver)).getstatus(); applicationcache interface have write own version of getstatus method. you may want cache status usi...

Ruby class initialize override module initialize -

i using super pass arguments parent initialize method, not called default. looks like. (notice use of super on last 2 arguments) module pet def initialize name, is_pet @is_pet = is_pet if is_pet @name = name else @name = "unnamed" end end def pet? return @is_pet end def get_name return @name end end class dog include pet def initialize tricks, name, is_pet @tricks = tricks super name, is_pet end def get_tricks return @tricks end end here's can it: d = dog.new ["roll", "speak", "play dead"], "spots", true d.pet? #=> true d.get_tricks #=> ["roll", "speak", "play dead"] d.get_name #=> "spots" it works fine, i'm wondering if there's better way this. it not programming practice hard code fixed string "unnamed" value @name . in such case, should assign nil , , whatever...

python - Importing a large CSV from Cloud Storage into App Engine Datastore -

i have large csv file, on order of 1 gb big, , want create entities datastore, 1 entity per row. that csv file residing in google cloud storage. there clean way this? examples can find online seem rely on having csv file locally, or don't scale well. ideally there's streaming api lets me read in small enough pieces cloud storage make update calls datastore, haven't been able find that. the buffer receive when open gcs file streaming buffer, can pickled. gcs not support iterator protocol read lines of csv. have write own wrapper . like: with gcs.open('/app_default_bucket/csv/example.csv', 'r') f: csv_reader = csv.reader(iter(f.readline, '')) row in csv_reader: logging.info(' - '.join(row)) if familiair blobstore can use read large csv's gcs using blobstore.create_gs_key( "/gs" + <gcs_file_name_here>) . example here

php - Why can't I insert data to MySQL? -

my idea put data in textfield , pass database mysql , when text field filled , button clicked nothing happened. when checked database there nothing there. why that? please me? <?php //connection string database mysql require 'db.php'; //check if it's set. if(isset($_post['dateloangrantedmonth'], $_post['dateloangrantedday'], $_post['dateloangrantedyear'], $_post['maturitymonth'], $_post['maturityday'], $_post['maturityyear'], $_post['expirymonth'], $_post['expiryday'], $_post['expiryyear'], $_post['mrs'], $_post['name'], $_post['resident'], $_post['loaninwords'], $_post['pesos'], $_post['interest'], $_post['daysmonths'], $_post['pesosinword...

Python Pandas filter rows based on the string value of an entry -

i have excel sheet (bloomberg data license output) read in with import pandas pd raw_data = pd.read_excel('my-file.xlsx') there 1 column ( start-of-file ) , varying number rows, depending on amount of data returned. i interested in data between 2 rows, start-of-data , end-of-data . rows in column 19 start-of-data 20 wts equity|0|6|wts|50545|54.440000|54.000000|5... 21 xom equity|0|6|xom|6555175|84.950000|85.300000... 22 sup equity|0|6|sup|27405|19.250000|19.200000|1... 23 end-of-data with varying number of rows, (not 20 22). how can filter rows in column data between cells, ie raw_data['start-of-file']['start-of-data' : 'end-of-data'] . , use str.split('|') seperate pipe delimited data seperate columns new dataframe? >>> import pandas pd >>> df = pd.dataframe(['abcdef', 'start-of-data', 'g|h|i', 'j|...

c - Can't sort array of structures alphabetically -

i trying sort strings in array of structures alphabetically print, code doesn't work. i've been trying figure out why past few hours, can't figure out. i'm sure super obvious, i've been programming few weeks , can't figure out. it compile no errors, output print of original unsorted array without aardvark, so: boy acumen addle cat affix agar ahoy aigrette ajar here code far: #include <stdio.h> struct entry { char word[15]; char definition[50]; }; struct entry dictionary[100] = { {"boy", "a boy " }, {"aardvark", "a burrowing african mammal" }, {"acumen", "mentally sharp; keen" }, {"addle", "to become confused" }, {"cat", "a cat...

mysql - Doctrine2 query(Builder) loses relations after using "where" and "in" clause -

i have 2 entities, let's call them "girl" , "feature". entity "girl" in undirectional manytomany relation "feature". i have page simple search form. want search girls features. after form submission on server side list of features id's, , should return list of girls have selected features listed with other features, girl have . let's @ this: ╔════════════╦═══════════════╦═══════════════╦═══════════════╗ ║ ║ (1) feature 1 ║ (2) feature 2 ║ (3) feature 3 ║ ╠════════════╬═══════════════╬═══════════════╬═══════════════╣ ║ (1) girl 1 ║ yes ║ yes ║ no ║ ║ (2) girl 2 ║ yes ║ no ║ yes ║ ╚════════════╩═══════════════╩═══════════════╩═══════════════╝ numbers in brackets entities id. what @ first is: $qbd = $this->getqbd('appbundle:girl', 'g') ->select('g, gf') ->leftjoin('g.features', 'gf'); ...

database design - to alter or create a new table in cassandra to add new columns -

i using dse cassandra. i wanted add new attributes existing table. i wanted know best practice achieve this? should adding new columns existing table or creating new table? what pros , cons either approach? adding columns fine. see alter statement . unless need change primary key, should not need create/migrate new table.

ios - PresentViewController Troubleshooting -

in swift app trying make button tap switches view controllers. code using: presentviewcontroller(pyththeoremviewcontroller.self, animated: true, completion: nil) this returns error "cannot invoke 'presentviewcontroller' argument list of type')pyththeoremviewcontroller.type, animated: bool, completion: nil) what mean , how fix it? if viewcontroller-instance pyththeoremviewcontroller, remove self

java - How to access elements in a generic arraylist of arrays -

i have been trying access elements of several arrays held within array list. able access regularly, problem comes when use generic type e account different data types. gives me class cast exception. if change type of tempstart , tempscan , corresponding casts int[] (since using pass in) runs. public static <e> arraylist<e> removeduplicates(arraylist<e> list) { if (list.get(0).getclass().isarray()) { system.out.println(" array!"); //go through arrays , make sure //not same, remove same //make flag see if different boolean matching; (int idx = 0; idx < list.size() - 1; idx++) { e[] tempstart =(e[])list.get(idx); (int k = idx + 1; k < list.size(); k++) { matching = true; e[] tempscan = (e[])list.get(k); (int index = 0; index < tempstart.length; index++) { if (tempstart[index] != tempscan[index]) { ...

DISTINCT ON with Ruby on Rails and Arel -

i have following table structure (simplified) id | version | slug | state ------------------------------- 1 | 1 | | published 2 | 2 | | draft 3 | 1 | b | published 4 | 1 | c | published 4 | 2 | c | published 4 | 3 | c | draft i want records highest version number, grouped slug , state published. sql looks this: select distinct on(slug) * guides state = 'published' order slug asc, version desc; and packed rails: klass.select('distinct on(slug) *').where(state: :published).order(slug: :asc, version: :desc) is there nicer syntax available? in past used bit of arel, don't seem distinct part correct. the ar query quite nice , simple. don't think can different , don't see wrong it. the thing can change use distinct(slug) rather distinct on(slug) * .

read eval print loop - settings.maxPrintString for Scala 2.9 REPL -

i'd disable truncation of string values in scala repl. the following thread suggested typing settings.maxprintstring = 0 : how force interpreter show complete stack trace? unfortunately, doesn't seem work scala 2.9: welcome scala version 2.9.1.final (java hotspot(tm) 64-bit server vm, java 1.6.0_29). type in expressions have them evaluated. type :help more information. scala> settings.maxprintstring = 0 <console>:10: error: not found: value settings val $ires0 = settings.maxprintstring ^ <console>:7: error: not found: value settings settings.maxprintstring = 0 ^ is there need import? i tried :power , makes settings available, doesn't seem support maxprintstring : scala> :power ** power user mode enabled - beep boop spiz ** ** :phase has been set 'typer'. ** ** scala.tools.nsc._ has been imported ** ** global._ , definitions._ imported ** ** try :help, vals.<tab>, power.<tab...

node.js - Redis pub/sub - same process listening to one channel -

i have single node.js server - process listen messages sent - testing only. problem having when publishing message same process, subscriber doesn't seem receive @ all. i have setup: var redis = require('redis'); var rcpub = redis.createclient(); var rcsub = redis.createclient(); var message = string('testing123'); rcsub.subscribe('redis_channel@test_overall_health'); rcsub.on('message', function (channel, msgs) { console.log(channel,msgs); }); rcpub.publish('redis_channel@test_overall_health', message); i have 1 redis client acts subscriber , 1 publisher, way must it, reason messages aren't being received. there limitation process can't listen messages publishes? doesn't seem make sense. can verify code more or less right because other processes listening same channel received message. apparently, subscribe command being sent after publish command. node's redis client queues commands until co...

bash - awk not capturing first line / separator -

Image
i don't understand following behaviour: this text file: example.txt 12345 4321 hello hello test blobb 14324 2131 test , incoming ! blubb 52341 1231 last test shutting down bla ... it consists of x rows of text, 4 tab-separated columns each. need first three, used awk (for first time): awk '{fs="\t"; ofs="\t"; print $1,$2,$3}' < example.txt > excerpt.txt the result this: excerpt.txt 12345 4321 hello 14324 2131 test , incoming ! 52341 1231 last test shutting down ... the first entry not contain full third column, , printing $1,$2,$3,$4 gives 12345 4321 hello hello first row. so, apparently separates @ whitespace (both after first , second hello ), , not @ tab. checked if tab snuck in there, not case: i find confusing, since works correctly other rows. you setting field separators on every line. then, awk reads record (line) in way when cursor reached it, first time setting is too l...

Java Finalize Method similar in python -

i want determine how can determine if object goes out of scope , perform operations when object goes out of scope in java have finalize method called jvm when object has no more references. i new python world , want determine if there similar way java finalize can perform operations before , object destroyed or there no more references object what want called destructor of object. python has concept using - __del__ method of class. example - class footype: def __init__(self, id): self.id = id print self.id, 'born' def __del__(self): print self.id, 'died' the __del__ method called when object destroyed. now if define above class inside python file , lets call test.py , , add following lines below , run python code, following result - f1 = footype(1) f2 = footype(2) python test.py 1 born 2 born 1 died 2 died please note, __del__ destructor may not called in circumstances , , more advised use contexts ha...

f.fields_for a has_many relationship in rails -

i have assessment model has_many answers. i'm trying build f.fields_for getting error: "undefined method `content' <answer::activerecord_associations_collectionproxy:0x007fdb12041fd8>" view: <%= f.fields_for @answers |builder| %> <%= builder.text_area :content, :class=>"form-control question-field", :data => {:question => question.id} %> <% end %> controller: def edit @assessment = current_user.assessments.find(params[:id]) @answers = @assessment.answers end i understand error seems i'm calling methods on collection rather individual object. don't understand how fix it. if f builder @assassment , can do: <%= f.fields_for :answers |builder| %> <%= builder.text_area :content, :class=>"form-control question-field", :data => {:question => question.id} %> <% end %> you need in assassement model: class assasement < activerecord::bas...

how to get id of any control using javascript? -

i have html page various textbox , button then added javascript window.onload = function () { window.addeventlistener('click', function (evt) { alert(this.id); }, false); }; my goal return id of control clicked user (as alert)? add more this. alert ok now. thank you use target of event. here's runnable sample: window.onload = function () { window.addeventlistener('click', function (evt) { alert(evt.target.id); }, false); }; <input id="button" type="button" value="button" /> <input id="text" type="text" />

Java Append Key Input to String -

for current project need create custom text box gets each key pressed , adds string. i'm updating method retrieves key user pressing , add so: public void addcharacter(string c) { string before = text; string after = before; if (!before.endswith(c)) { after = text + c; } else { //what can here check if key //was released , pressed again, //it adds character number of times user presses key. } text = after; } my problem if type key adds tons of them because of fact updating, why had check if it's same letter before, , not add it. edit: example of how add key: if (key.a) { addcharacter("a"); return; } i think can job done using keylistener . listener sends events each time key typed, pressed , released. in nutshell, listen keypressed event , not type letter until receive keyreleased event.

javascript - Can I load partials from another file in Mustache.js? -

i'm trying load in partials separate file while using mustache.js it's proven difficult. php implementation makes easy, not in js side. i've gone through docs , can't find related this, using object partial instead of file. here's sort of psuedocode explain i'm trying do. $.mustache.load('/mustaches.php', function () { var item = { thing: 'one' }; var partial = 'partials/actions.mustache'; $('.container').mustache( 'main_mustache', {item: item}, partial ); }); so, i'd able load secondary file partial include template used don't have duplicate code across different templates use. with blaze can import template {{> templatename}} doesn't seem quite easy mustache.js. if isn't possible mustache, other libraries recommend? you load both templates mustache, , pass 1 of them (the partial) 1 should render partial. aware in order make work, in m...

r - How do I select values from a list based on character length? -

i working on program follows basic logic: read 3 csv files, first 2 of contain keywords , last 1 of contains exclusion words. combine 2 keyword lists 1 thing, capitalizing keywords , removing keywords less 3 characters . sort , remove duplicate keywords keyword list. capitalize of words in exclusion list. remove keywords have match in exclusion list. it step 2 having trouble with. i've tried quite few solutions nothing working. here code: # read in individual data sets set1=read.csv("set1.csv",header=false,sep=",") set2=read.csv("set2.csv",header=false,sep=",") exclude_list=read.csv("exclude.csv",header=false,sep=",") # create new set aggregate of keyword sets, # capitalizing keywords , excluding keywords # less 2 characters in length set_agg=rbind(set1,set2) keywords=set_agg[c("v1")] keywords = as.data.frame(sapply(keywords, toupper)) ??? goes here ??? # sort , remove duplicate keywords key...

npm install imagemagick-native not getting installed in Windows 7 -

npm install imagemagick-native not getting installed. 1. issue 1 - not able find lib files 2. issue 2 - failed on finding x11.lib. solution issue 1 - didn't install included libraries , dependencies while installing imagemagick(imagemagick-6.9.1-5-q8-x64-dll.exe). after reinstalling additional dependencies selected during installation process solves issue. solution issue 2 - removed '-l<(magick_root)/lib/x11.lib' binding.gyp . run node-gyp configure, node-gyp build solved issue. tip : either can source of imagemagic-native github ( https://github.com/mash/node-imagemagick-native ) or terminate process after giving npm install imagemagick-native before fails.

django - MEDIA_URL in class-based view -

i'm not able access media_url in class-based view. my understanding has been create view, , context processor provide function-based view. i'm trying switch class-based, , no longer have access media_url . do context processors not work class-based views? have add context manually now? here processors: template_context_processors = ( 'django.contrib.auth.context_processors.auth', 'django.core.context_processors.media', 'django.core.context_processors.static', 'django.core.context_processors.request', 'django.contrib.messages.context_processors.messages', 'django.core.context_processors.request', ) my previous views looked like: def my_view(request): context = { "foo": "bar" } return render(request, 'index.html', context) and able use {{media_url}} . my class-based view looks like: class myview(view): def get(self, request): ...

cannot find the file while using textscan in matlab -

i have file name test.net. put in same location matlab working directory. then, put following 2 lines of codes. path='test.net'; [pajekfile,errmsg] = fopen(path); the errmsg is: "no such file or directory". know going on here?

build - Need access to SceneCombiner.h and ScenePrivate.h and other headers in the "assimp/code" folder -

i've compiled assimp, 2 .h aren't included in build output directory , useful if use them. is there way can access headers without copy , pasting manually build directory? what's point of code folder if isn't possible include them after build? thanks.

magento - Magmi root category not recognized -

i'm getting errors of when use magmi importer, following doc http://wiki.magmi.org/index.php?title=on_the_fly_category_creator/importer sku fh-74739 - on fly category creator/importer v0.2.5 - cannot find site root names : default category my csv file being read: store,sku,categories "main website store",fh-74739,"[default category]::1::1::1/clothing::0::1::1/tops::0::1::1" "main website store",fh-74393,"[default category]::1::1::1/clothing::0::1::1/bottoms::0::1::1" "main website store",fh-91916,"[default category]::1::1::1/clothing::0::1::1/bottoms::0::1::1" in magento, have root category called default category , capitalizations , all. i'm not sure issue is. tried in 3 different modes, skip, overwrite, or create new entries. of them give same error. nothing @ imported. what correct syntax, or missing when comes getting import successfully? your store column needs magento store code . ...

html - change image on hover and keep the text -

i working wordpress , bootstrap . trying have 1 image on every colum containter , , change image on hover , keep text before on original image .. there way css3 or need use js ? here html code : <?php get_header(); ?> <div class="page-header"> <h1 class="titletxt">eco greece</h1> </div> <div class="row"> <div class="col-md-6 imageholder img1"> <div class="overlay img1"> <span class="plus"> walking </span> </div> </div> <div class="col-md-6 imageholder img2"> <div class="overlay img2"> <span class="plus"> walking </span> </div> </div> </div> <div class="row"> <div class="col-md-6 imageholder img3...

jquery - geb/selenium test, chosen multiple selection -

i want test multiple selection realized via jquery plugin called chosen. the html of selection: <select id="pickusers" name="users" multiple="true" class="many-to-many" > <option value="1" >me</option> <option value="3" >leader</option> <option value="2" >test</option> </select> exception is: org.openqa.selenium.elementnotvisibleexception: element not visible , may not interacted i think has todo display: none css property , read alot didnt find solution problem edit: my selenium bindings are: users {$("select", name:"users")} i tried several assignments: users = ["me", "test"] or users = [1,2,3] users = ["1","2","3"] ran same issue. geb can access elements visible. in case, chosen adds display none select ( <select ... style="display:none"> ). the...

Excel return value or run calculation if criteria is not met. Formula needed -

this formula need syntax for. not know syntax excel accept. formula: want return value of "0" if target cell has value of "2" or less. if value greater "2" want multiply "25". i tried below formula syntax wrong , not sure correct syntax: =if(b2<2,0),(b2>2, b2*25) thank help. first, note proper syntax if() function: if(logical_test, value_if_true, [value_if_false]) the logical_test b2 <= 2 . value_if_true_ 0 . value_if_false ( i.e. , if b2 > 2 ) b2 * 25 . so formula =if(b2<=2, 0, b2*25) . for example (data starting in b2 , formula in c2 ): [b] [c] [2] 0 0 [3] 1 0 [4] 1.9 0 [5] 2 0 [6] 2.1 52.5 7 3 75 8 4 100 follow-up comments: how set formula value couldn't go on number... ie don't want return values on 100 , instead set value 100 if higher. now want if() function evaluate if b2 > 2: =if(...

neural network - How does Caffe determine the number of neurons in each layer? -

recently, i've been trying use caffe of deep learning work i'm doing. although writing model in caffe easy, i've not been able know answer question. how caffe determine number of neurons in hidden layer? know determination of number of neurons in layer , number of hidden layers problems cannot determined analytically , use of 'thumb rules' imperative in regard. there way define or know number of neurons in each layer in caffe? , default, how caffe inherently determine this? any appreciated! caffe doesn't determine number of neurons--the user does. pulled straight caffe's website, here: http://caffe.berkeleyvision.org/tutorial/layers.html for example, convolution layer of 96 nodes (or neurons): layer { name: "conv1" type: "convolution" bottom: "data" top: "conv1" # learning rate , decay multipliers filters param { lr_mult: 1 decay_mult: 1 } # learning rate , decay multipliers biases ...

python - Empty Template while drawing graphs using Django-graphos -

i new django. want draw google graph using django graphos. have written small code , getting empty template..any lead appritiated.. view.py from graphos.renderers import gchart django.shortcuts import render django.shortcuts import render_to_response graphos.sources.model import modeldatasource models import mycityviews def get_context_data(self): queryset = mycityviews.objects.all() data_source = modeldatasource(queryset,fields=['city', 'views']) line_chart = gchart.linechart(data_source) context = {"chart": line_chart} return render_to_response('gchart.html', {'chart': line_chart}) models.py from django.db import models # create models here. class mycityviews(models.model): city = models.charfield(max_length = 30, blank = true , null = true) views = models.integerfield() class meta: ordering = ['city'] verbose_name = 'city' verbose_name_plural = 'city...

Javascript onpaste event of everytext box value should be split and paste in corresponding textbox -

strictly no jquery please have text 1234abc984ik4h2j , have 4 text box onpaste need text split , copied in remaining text box purely in javascript no jquery application doesn't support jquery , ie>8 functions no function supports queryselectorall , addeventlistener html <td><input type="text" id="id1" maxlength="4" size="4" onpaste="paste();"></input></td> <td><input type="text" id="id2" maxlength="4" size="4" onpaste="paste();"></input></td> <td><input type="text" id="id3" maxlength="4" size="4" onpaste="paste();"></input></td> <td><input type="text" id="id4" maxlength="4" size="4" onpaste="paste();"></input></td> js function paste(){ var inputs = new array...