Posts

Showing posts from September, 2013

javascript - Google Map not centring on marker -

the following code finding memberid on page , rendering map , placing marker not centring map on marker. map ending centred in presumably default location (somalia). what doing wrong? function initialize() { var memberid = $('#member-section').data("member-id"); if (typeof memberid === "undefined") { memberid = 0; } var latitude = $('#member-section').data("latitude"); if (typeof latitude === "undefined") { latitude = 51.21921589999999; } var longitude = $('#member-section').data("longitude"); if (typeof longitude === "undefined") { longitude = 4.402881799999932; } var mapcentrelatlng; mapcentrelatlng = new google.maps.latlng(latitude, longitude); buildmap(memberid, mapcentrelatlng); } function buildmap(memberid, mapcentrelatlng) { google.maps.visualrefresh = true; var infowindow = null; var mapoptions = {

Where is Keras 2 's channels? -

i once used keras 1 (maybe 1.0.5) multi-category classification. , input in cnn (n, 1, 24, 113) , 113 channel numbers, , kernel size (1, 5). code like: x_train = x_train.reshape((-1, 1, sliding_window_length, num_sensor_channels)) x_test = x_test.reshape((-1, 1, sliding_window_length, num_sensor_channels)) # network inputs = input(shape=(1, sliding_window_length, num_sensor_channels)) conv1 = elu()(convolution2d(num_filters, filter_size, 1, border_mode='valid', init='normal', activation='relu')(inputs)) conv2 = elu()(convolution2d(num_filters, filter_size, 1, border_mode='valid', init='normal', activation='relu')(conv1)) conv3 = elu()(convolution2d(num_filters, filter_size, 1, border_mode='valid', init='normal', activation='relu')(conv2)) conv4 = elu()(convolution2d(num_filters, filter_size, 1, border_mode='valid', init='normal', activation='relu')(conv3)) reshape1 = reshape((8, num_f

php - safari browser not displaying img src tag images -

my website working fine on chrome , firefox safari not showing normal images, showing background-images. here link of website - http://urcoach.staging.wpengine.com/ normal img src=""/> tag images not showing need help. in html:not(.mobile-true) #bottom-bar img, html:not(.mobile-true) #header img, html:not(.mobile-true) #main img:not(.animate-element,.ls-s-1) class: opacity set 0;

python - Tkinter: set method does not work in a function for toplevel window -

for reason, var.set(str) not update var when toplevel window created function. code below works when placed in mainloop (without function), though. when adding mainloop function works intended. intended behaviour? from tkinter import * tkinter import ttk root = tk() def function(): mainframe = ttk.frame(root) mainframe.grid(column =1, row =1) configurewindow = toplevel(mainframe) pathinfocontent = stringvar() graphpathframe = ttk.frame(root) graphpathframe.grid(column = 1, row =1) graphpathlabel = ttk.label(graphpathframe, text = 'graphviz installation path:') graphpathlabel.grid(column = 1, row =1) graphpathlabel3 = ttk.label(graphpathframe, textvariable = pathinfocontent) graphpathlabel3.grid(column = 2, row =1) pathinfocontent.set('something') function() mainloop()

user interface - Update GUI components after loading settings JAVA -

i have application gui sliders , comboboxes mainly. use sliders , combos change values , parameters in various classes in project. i'm trying implement possibility save , load parameters , have done using preferences api. can save , load parameters, when load them can see changes in values, works, gui not update reflect new values. there way tell gui so? for instance have frequency slider changes frequency value in oscillator. if change value slider, save it, change value of slider again , load saved value, can hear has changed slider didn't move.(makes sense haven't told too). can bind position of slider frequency value somehow? gui //osc1 slider jslider osc1freqslider = new jslider(swingconstants.horizontal, min_osc_freq, max_osc_freq, note_a_freq); osc1freqslider.setopaque(false); osc1freqslider.setmajortickspacing(50000); osc1freqslider.setminortickspacing(50); osc1freqslider.addchangelistener(new changelistener() { public void sta

ascii - Printing characters to LCD - Verilog HDL -

i have question regarding printing character lcd screen. i using altera de1-soc 5csema5f31c6n , lt24 terasic lcd. i have question regarding printing letters in row on lcd. i relying on x , y counter raster across screen, starting @ (0,0) upper left corner of screen. incrementing x way end of row, , once reached end, reset x 0, increment y , continue counting x again until end of screen lcd pixels i creating arrays print character values (8x8 px) the long array concatenates 'each row of pixels' characters, , whilst counter rastered across screen pixels each character print lcd. eg. row0 - print first row of pixels characters. row1 - print second row of pixels characters. however, when try print 2 characters, order of characters being printed reversed [from origin (0,0)] e.g. if want print 'i' 'm'. 'm' , 'i' in order. when try print 3 characters, no characters show @ all! i struggling understand why case, counter values u

php - <sup> and <sub> tags displaying in Webpage -

i working on project hosts online exams students, , few chemistry questions when trying display subscripts , superscripts formulas , displaying tags in webpage follows, using codeigniter framework this. //get exam question details including subjects (subjects quiz/exam) $quizrecords = $this->base_model->run_query( "select q.*,qq.*,s.subjectid,s.name subjectname " .$this->db->dbprefix('quiz')." q, ".$this->db->dbprefix('quizquestions') ." qq, ".$this->db->dbprefix('subjects')." s qq.quizid=q.quizid , qq.subjectid=s.subjectid , q.quizid=".$id ); $questarray = array(); foreach ($quizrecords $r) { $subjectwisequestions = $this->base_model->run_query( "select * ".$this->db->dbprefix('questions') ." subjectid=".$r->subjectid." , difficultylevel='" .$r->difficultylevel.&quo

database - At least more than two cardinality in E/R diagram -

i making e/r diagram , have question. have two entities, namely: member , matches. to consider "match", need @ least 2 members. now, problem is: how should note this? it's not 0.. * , assume, because match not match when have 0 members, right? it's not 1.. 1 or 1.. * , can't play @ least 1 or @ 1.... so, how should note it? 2.. * not exist, best practice here then?

psexec not getting output on powershell on remote PC -

readpower.ps1 contain following. , able output on output.csv locally. $port= new-object system.io.ports.serialport com7,19200,none,8,one $port.open() $port.writeline("?p") $port.readline() $machinepower= $port.readline() $date = get-date $texttosend = "machinename,"+ $date +"," +$machinepower $texttosend | out-file output.csv -append -encoding ascii $port.close() when run remotely, using psexec \\remotepc -s -u username -p password powershell c:\readfamlaser\readpower.ps1 no output on output.csv did miss out anything?

MySql query sum rows based on other column value -

hey have weird logic can 1 me write query. want sum prices regoption regoption have xncoupon (coupon , regoption share same entry_id). in exaple wanted amount 139. |id |trans_id| entry_id |type | price ------------------------------------------------------ |43575855 |24419612| 26898343 |regoption| 139 |43575856 |24419612| 26898343 |xncoupon | 50 |43575857 |24419612| 26898346 |regoption| 139 |43575858 |24419612| 26898346 |tshirt | 10 in second example wanted amount 278 |id |trans_id| entry_id |type | price ------------------------------------------------------ |43575855 |24419612| 26898343 |regoption| 139 |43575856 |24419612| 26898343 |xncoupon | 50 |43575857 |24419612| 26898346 |regoption| 139 |43575858 |24419612| 26898346 |xncoupon | 50 my try this select sum(price) table type ='regoption' , (something) check regoption related xncoup

ios - Maximum Concurrent Http connections per host, Alamofire? -

i'd increase maximum concurrent connections per host in swift, limited 4 default in ios. i'm using alamofire . i've tried increase httpmaximumconcurrentperhost 50. i've tried in loop method , still limited. also tried wrap url request operation queue , still limited connections. i've seen library written in obj-c tells use more 4 connection @ same time per host, don't program obj-c know if real or not. library on github is there solution uses more concurrent connections per host? apple says limit per session, limit can exceeded using multiple session per whole application how can achieved ? *i've tested internet speed , server response charles , 250 req/second, when using above methods in simulator 22 req/second. this seems the solution : let configuration = nsurlsessionconfiguration.defaultsessionconfiguration() configuration.httpmaximumconnectionsperhost = 50 configuration.timeoutintervalforrequest = 30 let m

sql server - Stringe timeout trigger error -

i've trigger in sql server database strange behavior, these strange instructions: ... exec [ope].[spmissiondepartment] @aircraftid = @vnaircraftid raiserror('test error', 16, 1) end try begin catch select @errormessage = error_message() rollback transaction raiserror(@errormessage, 16, 1) -- strange line end catch the strange behavior this: if remove strange line receive in web page error timeout expired. timeout period elapsed prior completion of operation or server not responding. otherwise, if don't remove strange line , receive error test error there no other triggers, exec should last statement executed, how possible receive timeout without raiserror ? errors unaffected try…catch construct try…catch constructs not trap following conditions: warnings or informational messages have severity of 10 or lower. errors have severity of 20 or higher stop sql server database engine task processing session. if error

excel - create VBA for copy and adding sheet 2 while copy paste row in first sheet1 -

question. i need vba code copy complete worksheet when inserting copied row in first sheet. example: sheet one; row a1:n1 has formulas, combined sheet 2. now copied row a1:n1 a2:n2 module needs copy sheet 2 , insert after it. whit formulas combined row a2:n2 sheet 1.. and on.. is possible?? wp sample 1 wps samples 2 in "wp sample 1"; row a14 "wps 1" linkt "worksheet wps1" (wps sample 2) row a15 "wps 2" linkt "worksheet wps2" -i want create "wps 3", going copy row 14 , paste info under 15. this vba needs copy "worksheet "wps1" , ad copy after worksheet "wps2" so creates wps3, need have same formulas in "wps1" thnx in advanced. mitch you can try similar procedure: public sub copywps1asnew() dim nameinput string requestname: nameinput = application.inputbox(prompt:="type new name of wps.", title:="wps name", default:="wp

css - jekyll-sass-converter not working -

i'm french, sorry english, have problem jekyll i installed gems: jekyll, jekyll-sass-converter but jekyll dont convers styles.scss styles.css i declared styles on _includes/head.html: <!-- css --> <link rel="stylesheet" href="{{ site.baseurl }}css/styles.css"> assets declared on _config.yml: sass: sass_dir: _lib style: compressed styles.scss output // imports @import "base"; @import "main"; _lib folder output /base.scss /main.scss github project: https://github.com/micaelandre/micaelandre.github.io github issue: https://github.com/micaelandre/micaelandre.github.io/issues/1 website: https://micaelandre.github.io jekyll convert sass files if .scss starts 2 lines of triple dashes, in css/styles.scss : --- --- // imports @import "base"; this generate: css/styles.css . also note don't need explicitely install sass converter, 1 of jekyll gem dependency .

ios - crash in core data xcode 8 -

Image
i facing issue in ios swift xcode 8 after setup core data , before insert junk data in purpose of testing fetch function app run correctly no crash , no data after insert data app crash below message terminating app due uncaught exception 'nsunknownkeyexception', reason: '[<uitableviewcell 0x7f9b26054c00> setvalue:forundefinedkey:]: class not key value coding-compliant key deatials. here code // import uikit import coredata // nsfetchedresultscontrollerdelegate needed start woring in function datacore class mainvc: uiviewcontroller , uitableviewdelegate, uitableviewdatasource,nsfetchedresultscontrollerdelegate{ // definning main view table , segment. @iboutlet weak var tableview: uitableview! @iboutlet weak var segment: uisegmentedcontrol! // need difine nsfetchedresultscontroller define remaining 3 functions tableview var controller : nsfetchedresultscontroller<item>! override func viewdidload() { super.viewdidload()

javascript - Looking to strip html comments out of my jspm bundle (any approaches using gulp packages?) -

i'm using jspm bundle app, mangling + minifying still see many html comments in bundle. whats best way remove comments bundle? jspm.bundle('bootstrap.js', _paths.bundlepath, { mangle: true, injectconfig: true, minify: true}) })

elasticsearch - Index main-object, sub-objects, and do a search on sub-objects (that return sib-objects) -

i've object (simplified here), each strain have many chromosomes, have many locus, have many features, have many products, ... here put 1 of each. the structure in json is: { "name": "my strain", "public": false, "authorized_users": [1, 23, 51], "chromosomes": [ { "name": "c1", "locus": [ { "name": "locus1", "features": [ { "name": "feature1", "products": [ { "name": "product1" //... } ] } ] } ] } ] } i want add object in elasticsearch, moment i've add objects separatly: locus, features , products. it's okay search (i want type keyword, watch in name of locus, name of features, , name of product

javascript - React - handle state of value nested in initial object -

Image
i trying handle input state of tasks nested in initial object . want set task value name in state datagoal object. the initial state so: the render method: render(){ return( <div> <main classname="content"> <form onsubmit={this.onsubmit}> <div> {object.keys(this.state.datagoal).map( (key, index) => { return <div key={key}> <label>{this.state.datagoal[key].name}</label> <p>index: {index}</p> <div classname="input-wrap"> {object.keys(this.state.datagoal[key].tasks).map( (taskkey) => { return <div key={`task-wrap-${taskkey}`}> <p>{taskkey}</p>

filtering - Need to pass filter with URL -

hey can please driving me nuts. need make url 3 filters 'ecvnd', 'ecdiv', , 'ecclas' , have values 3 plus base url. i'm stuck , think wouldn't difficult if colleague didn't leave me guessing. ecom site need filters display proper products in link. the values such: ecvnd=59375, ecdiv=53 , ecclas=59 the closest got was, not returning right products. https://shop.michells.com/orders/catalog/filter_ecvnd=59375&filter_ecdiv=53&ecclas=59 as can see snippet below, filters hidden in url on click when arrive need proper filters display there thousands of other products in system. ss snippet hint <!doctype html> <!-- saved url=(0050)http://getbootstrap.com/examples/starter-template/ --> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <meta charset="utf-8"> <meta http-equiv="x-ua-co

javascript - TwitterFetch JS mobile text goes off screen. -

Image
hi, pretty new of still , working on making sure twitter text link stays within plate behind it. unsure why happens goes over. works fine on desktop. is there can fix css? or within js?

Gradle Dynamically Generate Tasks -

this first attempt using clojure , i'm attempting generate tasks in build.gradle file. i'm encountering complication errors such as: * where: build file '/users/austin/repositories/test/build.gradle' line: 47 * went wrong: a problem occurred evaluating root project 'test'. cannot set value of read-only property 'src' task ':downloaddriverfirefox' of type de.undercouch.gradle.tasks.download.download. i'm it's inexperience groovy language, use pointers i'm going wrong. ext { // drivers want use drivers = ["firefox", "chrome"] driverssrc = [:] driverssrc['firefox'] = 'https://github.com/mozilla/geckodriver/releases/download/v0.15.0/geckodriver-v0.15.0-macos.tar.gz' driverssrc['chrome'] = 'https://chromedriver.storage.googleapis.com/2.29/chromedriver_mac64.zip' driverdest = new file("${builddir}/webdrivers") } import org.gradle.api.tasks

No code completion of SCSS files in PhpStorm/WebStorm -

Image
in phpstorm while editing ts file no import code completion files other ts . on screenshot below can see no suggestion valid alerts.scss file. template.ts visible in suggestions. please vote web-26481 notified on progress it

git - Can't save commit messages with Adobe Brackets as Editor -

first - here's how installed adobe brackets text editor of choice in order commit messages git. git config --global core.editor "brackets" here's problem i'm having.... i able add file staging area. , when type git commit mac terminal launches adobe brackets expected applicable commit_editmsg file. i able type in message, save file, , exit text editor. when perform git log make sure recorded commit error message: fatal: current branch 'master" not have commits yet basically what's happening editor not saving commit_editmsg , recording file new commit repository. does know if i'm doing wrong (possibly installation error?) or if bug adobe brackets , need use new text editor committing messages built in emacs? thanks!

Using a function within a class in python (to use self or not) -

class neuralnetwork(object): def __init__(self, data): self.data = data def scan(self): print(self.data) def sigmoid(self, z): g = 1 / (1 + math.exp(-z)) return (g) a1 = sigmoid(7) print a1 i'm not sure why won't print a1 variable sigmoid function. keeps kicking off error saying requires 2 inputs instead of 1. thought calling function within class, didn'tneed supply self again? edit: have last 2 statements in there because i'm still testing things out make sure doing it's supposed within class. sigmoid method of neuralnetwork class, need create instance of neuralnetwork class first, before can utilize sigmoid function, if you're calling after class definition: class neuralnetwork(object): def __init__(self, data): self.data = data def scan(self): print(self.data) def sigmoid(self, z): g = 1 / (1 + math.exp(-z)) retu

powershell - Extract multiple Substrings from String -

i have xlsx file contains listing of barcodes, listed 3 or 4 cell, need split have barcode. the barcodes strings of 6 numbers, may prefaced several different letters , there may or may not commas, ampersands, , other words in cell them. looks this: col 1 | col 2 | col 3 | col 4 | col 5 info | identifier | info | info | l123456 , pc 654321 , m 123654 & 546123 vacant | info | identifier | info | info | pc 123456 , m 456789 occupied info | identifier | info | info | l 987654 so far have attempted use regex remove noise data , left barcodes, has been returning jumbled mess. i need have way keep track of row came from, there identifier in earlier column needs linked these barcodes. able access identifier quite easily. i using excel comobject manipulating sheet. code using attempt regex, how can extract barcodes? $xl = new-object -comobject excel.application $xl.visible = $true $xl.displayalerts = $false $xl.workbooks.open("file.xls") $sheet = $xl.activewor

bash - Command 'checkout' not found - Git repository on server -

i trying create git repository on amazon server first time. bare repository , file post_receive inside repo's hooks folder created. when running following command: git_work_tree=/var/www/html checkout -f i getting -bash: checkout: command not found by above command want git auto push latest commits in repository web root. did not find solution after googling time. please suggest how can working.

webdriver - Selenium, opening ff browser and automaticly close -

trying run testng suite compiled jar on remote linux machine. problem have is, if run tests, ff open url have defined , after closing brower, , on. org.openqa.selenium.nosuchelementexception: unable locate element: {"method":"name","selector":"username"} selenium 2.53.0 ff 45.0 any idea why test open browser , close? nosuchelementexception thrown when element not exist. may not reason fx crash. possibilities : some in code closing driver. i had faced same issue earlier. try upgrade firefox latest version. try set firefox driver using setproperties system.setproperty("webdriver.firefox.bin","c:\\users\\appdata\\local\\mozilla firefox\\firefox.exe"); webdriver driver=new firefoxdriver(); follow link upgrade or downgrade fx: https://support.mozilla.org/t5/install-and-update/install-an-older-version-of-firefox/ta-p/1564 below of helpful links. firefox crashes when started selenium firefox d

VS Code -- Are there user/support forums or an IRC channel? -

there seem multiple places ask questions, report bugs, feature requests, etc. here, github, msdn. it's kind of on place. there readme documents i'm missing discuss support options? here's rough guide of communications channel use: for issues / feature requests, please file github issue: https://github.com/microsoft/vscode/issues/new for general "how to" questions, stackoverflow best bet for other discussions, try https://gitter.im/microsoft/vscode or twitter

constructor not displaying values in c++ switch statement -

hi im trying build program ferry keep track of free space im stuck trying output values user gave in inside constructor. problem occurs in case 5 im trying output it. loop doesnt work cuz break while loop didnt work either. creating seperate function didnt work. appreciated. #include <iostream> #include <string> #include <sstream> using namespace std; struct cars { int carlength, carcount; string registrationnumber; int carseats; } caaars[100]; void printcars(cars car); int n, x; int main() { int loop = 0; string mystr, mystr1, mystr2; int ferrylength; cout << "the ferry program\n\n"; cout << "please enter length of ferry in meters: "; cin >> ferrylength; while (loop == 0) { system("cls"); cout << "choose vehicle \n\n"; cout << "1: car.\n"; cout << "2: bus.\n"; cout << "

convert API query from Python to MATLAB -

i thought should straightforward struggled convert following api query python matlab import json import requests url='http://amp.pharm.mssm.edu/enrichr/addlist' gstr='\n'.join([ 'phf14','rbm3','msl1','phf21a','arl10']) payload={'list':(none, gstr)} response=requests.post(url, files=payload) here tried on matlab gstr = 'phf14\nrbm3\nmsl1\nphf21a\narl10' input = struct('list', gstr); response = webwrite(url, input) edit: following error on matlab the server returned message: "bad request" url (with http response code 400) i on matlab r2015b. matlab doesn´t natively support writing files webservice. used mathworks function so, solved problem.

android - Blank App : Index was outside the bounds of the array -

i have weird problem. i narrowed mere blank xamarin forms project. can run on android api 22 (samsung core prime) , on simulator cannot deploy on android api 23 (asus zenfone 3). index outside bounds of array in error panel. tried on mac , on pc. this in output panel : [e:]: deployment failed system.indexoutofrangeexception: index outside bounds of array. @ mono.androidtools.androidinstalledpackage..ctor(string value) @ mono.androidtools.internal.adboutputparsing.parselastresortpackagelist(string output) @ mono.androidtools.androiddevice.<>c__displayclass65_0.<getpackageslastresort>b__0(task`1 t) @ system.threading.tasks.continuationresulttaskfromresulttask`2.innerinvoke() @ system.threading.tasks.task.execute() i updated xamarin latest version , xamarin forms version 2.3.4.231 i verified phone driver , still have problem. this in xamarin diagnostic panel : [i:]: found xamarin.android 7.2.0.7 [i:sdk]: runtime path: c:\pr