Posts

Showing posts from August, 2012

c# - UserControl animation Cannot resolve TargetName -

i'm trying create simple animation in uwp user control, i'm running error cannot resolve targetname . code simple , feel overlooking obvious, can't figure out. xaml <usercontrol ... x:name="manipulationmediaviewercontrol" ... > <usercontrol.resources> <storyboard x:name="zoomanimation"> <doubleanimation duration="0:0:0.25" to="4" storyboard.targetproperty="(uielement.rendertransform).(compositetransform.scalex)" storyboard.targetname="viewboxhost" d:isoptimized="true"/> <doubleanimation duration="0:0:0.25" to="4" storyboard.targetproperty="(uielement.rendertransform).(compositetransform.scaley)" storyboard.targetname="viewboxhost" d:isoptimized="true"/> </storyboard> </usercontrol.resources> <grid> <viewbox x:name="vi

deep learning - Define custom model/architecture in TensorFlow -

from little have played around tensorflow see has already-implemented architectures rnn/lstm cells, convnets, etc. there way define one's "custom" architecture (e.g. "enhanced" lstm network few convolutional layers)? yes, totally possible. output of lstm or network tensors cab used input of network. see how combine them @ https://github.com/jazzsaxmafia/show_and_tell.tensorflow . you can find more examples @ https://github.com/tensorflowkr/awesome_tensorflow_implementations .

Insert the model field in the middle of existing one in Django -

say i'm trying insert new char field called tag, , want @ middle of existing table. in django when add field , make migration, add new field end of sql table. i can't edit in migration file either since adding 1 field: operations = [ migrations.addfield( model_name='chat', name='tags', field=models.charfield(blank=true, max_length=100, null=true), ) is there anyway can customize order in django? or have go sql manually. no, there's no way insert column between other columns without creating new tables. couldn't figure out reason have columns(model fields) in particular order, doesn't make sense. in fact, doubt there's sql statement directly reorder column sequence database schema.

javascript - can't match a page with firefox jpm sdk page-mod inlclude -

i'm writing firefox addon, original greasemonkey userscript, replaces eztv site's links ajax ones, when click on show's watched/unwatched links sends ajax request eztv , removes row on success. everthing working fine, firefox's jpm sdk page-mod never matches site if specify include run on eztv sites. require('sdk/page-mod').pagemod({ include: [/(https?:\/\/eztv\.(it|ch|ag)\/myshows)/, '*.eztv-proxy.net/myshows'], contentscriptwhen: 'ready', contentscriptfile: ["./jquery-2.2.3.min.js", './main.js'], contentstylefile: "./eztv.css", attachto: ["existing", "top"], }); if change include: "*" , scripts loaded fine. i've tested regexp , seams match https://eztv.ag/myshows without hich, how not work in addon. can spot problem ? finally found answer problem, regexp missing end slash. , if using string wildcard example: "*.eztv.it" cannot specify path or query m

Does Google Tag Manager ignore META tags CSS selectors? -

Image
first had variable set at: meta[property='gtm'] value input "content" gtm preview retunrs null variable/value so tried meta id="gtm-tagmanger" content="foo" and setup css selector id of "gtm-tagmager", value in content then trigger set use variable when equals "foo" still not firing. i beginning believe - gtm not read meta properties. can confirm or deny this? you should able meta properties using "dom element" variable type:

r - How do we connect Azure Machine Learning Studio to Google BigQuery? -

we trying use support vector machines predictions on our dataset 70,000 rows , 7 features - have tried svm on google datalabs our data set big calculate in reasonable finite time on datalabs vm. we leverage approach scales statistical approaches across cpu cores revolution analytics version of r on azure machine learning studio our data on google bigquery. how connect r script on azure machine learning studio use our dataset on google bigquery? you can pull data "execute python script" module using http request or google sdk python ( https://cloud.google.com/bigquery/exporting-data-from-bigquery ). add "execute r script" logic

objective c - Get name of test method in setUp (Xcode) -

i want append message log includes name of test method run. want in setup method in test superclass don't have repeated code everywhere. i wanted this: - (void) setup { [super setup]; [self log:@nsstringfromselector(_cmd)]; } however, _cmd gives "setup" string, whereas want "test00testthething" is there way this? i found this: self.name however, gives me "-[appuitests test00testthething]"

javascript - jQuery if iframe with class exists -

Image
i trying detect if iframe specific class exists, not working me. i need detect if iframe chat exists on site https://gaming.youtube.com 1 of scripts. weird in demo can detect iframe: http://jsfiddle.net/t7qmf/13/ when go live stream on https://gaming.youtube.com , can not detect if iframe chat exists. when use $("iframe.class"); returns iframe, when try $("iframe.class").length; undefined . i tried googling, saying use element.length , not working me. returns undefined when use $("iframe").length here screen of console not working: thanks. because $ not jquery. in chrome dev console, when jquery not available, alias document.queryselector()

osx - How to define a series of bash commands as a string? -

right of code in .zshrc file looks this: inetfunction(){ echo ${lred}ip address:${nc} ifconfig en0 | grep "inet " | awk '{print $2}' } $lred defined changing color light red, , $nc setting normal. implement inetfunction code alias inet='inetfunction' . output of command is ip address: xx.x.xx.xxx where "ip address:" in red. wanted make ip address green, reason, when try of these, doesn't work: ${green}ifconfig en0 | grep "inet " | awk '{print $2}' ifconfig en0 | grep "inet " | ${green}awk '{print $2}' ${green}ifconfig en0 | grep "inet " | awk '{${green} print $2}' i tried setting whole thing variable like: variable='ifconfig en0 | grep "inet " | awk '{print $2}'' and trying echo ${green} $variable , still doesn't work. any ideas? $green needs echoed. it's set of ansi color codes terminal recognizes signal change text c

python - Does with_entities result in smaller objects? -

when need column values , don't need else provided model, use with_entities , iterate on tuple-like sqlalchemy.util._collections.result objects result. am correct these objects smaller full-blown model objects otherwise getting? example: models = thing.query.filter_by(user_id=3).all() type(models[0]) # => project.models.thing # # vs # tuples = thing.query.with_entities(thing.id).filter_by(user_id=3).all() type(tuples[0]) # => sqlalchemy.util._collections.result

A drag and drop function from a bat file -

so i'm trying launch 2 files dont on own rather need dragged , dropped onto program function, issue being people seem more interested in other way around , not launching files bat through program. so looks i'm trying do. file1.pk3 + file2.wad -> program.exe any great i hoping use bat file perform drag , drop function .pk3 file level , .wad moded game mode , in order function needed dropped onto main program. if wanting drop file onto batch file , have batch file meaningful, can use %1 . no different executing batch file "dragged" file parameter. try this: droponme.bat @echo off echo opening %1 in notepad. echo please close continue. notepad.exe %1 echo closed it. thanks! pause helloworld.txt hello world! try dropping helloworld.txt onto droponme.bat . should open text file. try running droponme helloworld.txt command line (in same directory files). should see exact same results.

javascript - How correct recconect to socket via angularjs service? -

i write angularjs app , have problem. app use socket connection data every time. reason write factory(code below). var service = {}; var ws = new websocket("url"); var timer; service.onmessage = function(message) { /* code */}; service.onclose = function() { timer = $interval(function () { ws = new websocket("url"); service.connect(); }, 1000); }; service.onopen = function() { console.log("open"); if (timer) $interval.cancel(timer); }; service.onerror = function(error) { /* code */}; service.connect = function() { // (re)connect // reattaching handlers object ws.onmessage = service.onmessage; ws.onclose = service.onclose; ws.onopen = service.onopen; ws.onerror = service.onerror; } return service; and problem have? simplicity lats imagine server down. , socket connection down too. after onclose event start. dont understand how re-connect socket. should check c

java - how to retrieve specific chart in power point slide using apache POI -

i have power point slide has multiple charts (multiple bar , line chart) need update them using apache poi library. far used have 1 chart per slide , used chart using below code identify , update values. xslfchart chart = null; for(poixmldocumentpart part : mainslide.getrelations()){ if(part instanceof xslfchart){ chart = (xslfchart) part; break; } } not sure how identify specific chart dont see method identify shape for(xslfslide slide:ppt.getslides()){ (xslfshape shape : slide.getshapes()) { if (shapename.equals(shape.getshapename())) return slide; } } i gave name table,textbox in powerpoint , can retrieve in code using shapename dont see chart . can 1 me plz? i figured out way identify of office mate. first give title chart in power point open layout> chart title> above chart give name . hide title keep font size small , make font color white . add

angular2 routing - Component Router and children with routes on AngularJS v1 -

i trying create blog component (a component create subpaths pages/tags, etc) using new angular router. on every component, component template same (only path of component changes) show different data. goal provided standard blog component can shared on github. the key problem, blog component template provide prev/next buttons. the blog template should provided user (as every blog's structure different...) how can done new component router? route: $routeconfig: [ {path: '/blog/...', name: 'blog', component: 'blog'} ] component: bindings: query : '@' posts : '=' prevpage : '&prev' nextpage : '&next' pagesize : '@' tags : '@' currentpage : '@' opts : '@' routes example done ui router: .state 'blog', url: '/blog' templateurl: '/app/blog/blog.html' data: pagesize:

angular - How to pass data in ionic2 -

i data through http. want pass data placeslistpage. there "id, name, category, ..." in data. want use theese in placeslistpage this: {{xxx.id}}, {{xxx.name}}... please me... xxx - example) import {page, navcontroller, navparams} 'ionic-angular'; import {http} 'angular2/http'; import 'rxjs/rx'; import {placeslistpage} '../places-list/places-list'; /*enter code here generated class placespage page. see http://ionicframework.com/docs/v2/components/#navigation more info on ionic pages , navigation. */ @page({ templateurl: 'build/pages/places/places.html', }) export class placespage { static parameters() { return [[navcontroller], [http], [navparams]]; } constructor(nav, http, navparams) { this.nav = nav; this.http = http.get('https://api.myjson.com/bins/2ud24').map(res => res.json()).subscribe( (data) => { this.data = data; }); } you can use approach well:

Copy specific columns into NEW workbook using VBA in Excel -

i total rookie @ please gentle lol. i have workbook 2 sheets, concerned sheet1 function. sheet 1 has bunch of columns, need data columns , g. need copy columns new workbook. did using following code found on site sub dural() dim r1 range, r2 range sheets(1).select set r1 = range("a:a") set r2 = range("g:g") set wbnew = workbooks.add r2.copy range("a1") r1.copy range("b1") end sub this did needed automatically create , save output new file, preferably in specific directory. don't need open , displayed above code does. lets call output.xlsx. original file source.xlsm thank kindly :) something simple this: sub dural() workbooks.add thisworkbook.sheets(1).range("g:g").copy .sheets(1).range("a1") thisworkbook.sheets(1).range("a:a").copy .sheets(1).range("b1") .saveas "your path + filename here" .close end end sub should want. if still have quest

wpf - xaml desing issue with ZeroProximity.Accordian for window store app -

i have following mainpage.xaml: <page x:class="componentguidtestuw8.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:componentguidtestuw8" xmlns:controls="using:zeroproximity.controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d"> <grid background="{themeresource applicationpagebackgroundthemebrush}"> <controls:accordion> <controls:accordionitem header="heading 1"> <controls:accordionitem.content> <textblock text="texting"/> </controls:accordionitem.content> </controls:accordionitem> </controls:accordion> </grid> the page display accordion cont

python - None of Paramiko's Read methods work for me? -

i have class i've written: class remote(object): def __init__(self, address, username, password): self.address = address self.username = username self.password = password def stdout(self, s): print('out: ' + s) def stderr(self, s): print('err: ' + s) def sh(self, s): paramiko import autoaddpolicy, sshclient threading import thread time import sleep ssh = sshclient() ssh.set_missing_host_key_policy(autoaddpolicy()) ssh.connect(self.address, username = self.username, password = self.password) stdin, stdout, stderr = ssh.exec_command(s) def monitor(channel, method): while true: line in channel.readlines(): method(line) sleep(1) thread(target = monitor, args = (stdout, self.stdout)).start() thread(target = monitor, args = (stderr, self.stderr)).start()

How to decide what root value to use for GraphQL mutations -

i'm experimenting graphql , need understanding how know root value provide when mutation performed. concrete example: want update username of logged in user. mutation looks this: mutation testmutation { updatemyusername(newname: "coolname") { username } } the root object provide here current user. how know when receive mutation without parsing , seeing name? no decision possible based on url 1 endpoint exists. , parsing string send further parsed again sounds wasteful @ best. is maybe common practice instead provide parameters in url or request body give application more context? it's not common include more data in url, since each mutation backed function, not need parse name, can define in function. since mutations top level, root object top level root object. if need access different object, need ensure you've provided enough information retrieve it to keep track of logged in user, check out context , 1 o

java - Sending variable between activities -

this question has answer here: how send object 1 android activity using intents? 31 answers this question simple. there example 2 activities main activity , main activity 2. how can send string(for example) main activity main activity 2. let's if main activity 2 gets string. calls function change string. , how send changed string main activity? from main activity 1 send string: intent intent = new intent(this, mainactivity2); intent.putextra("string", stringval); intent.addflags(intent.flag_activity_new_task); startactivity(intent); then in main activity 2, receive string: string str = getintent().getextras().getstring("string"); then change value , send main activity 1, intent within onresume if want, check nulls.

bluetooth - How can I use hci command to setup my Linux laptop as a BLE peripheral to advertise service with specified UUID? -

i need setup linux laptop ble peripheral advertise service specified device name , service uuid. can achieve following set of commands, sudo hciconfig 0 reset sudo hcitool -i hci0 cmd 0x08 0x0008 15 02 01 1a 11 07 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f 50 00 00 00 00 00 00 00 00 00 00 sudo btmgmt -i hci0 le on sudo btmgmt -i hci0 connectable on sudo btmgmt -i hci0 name myname sudo btmgmt -i hci0 advertising on sudo btmgmt -i hci0 power on (note btmgmt built bluez5.37) it works , iphone can scan , discover peripheral name "myname" , service uuid 504f4e4d-4c4b-4a49-4847-464544434241. my question is, need replace above btmgmt commands hciconfig and/or hcitool, possible? , if yes, how set parameters each command? thanks in advance. you should able replace btmgmt commands start advertising: sudo hciconfig hci0 leadv 0

node.js - templateData variables return undefined from helper function (docpad.coffee configuration file) -

this configuration file . docpadconfig = { templatedata: site: title: 'hello docpad' gettitle: -> @site.title getstring: -> 'just string' } # export docpad configuration module.exports = docpadconfig from jade layout when title= site.title renders ok. when try call helper function title= gettitle() console outputs this: error: error occured: referenceerror: /volumes/data/project/am/lab/docpad/hello_docpad/src/layouts/default.html.jade:21 19| 20| //- our site title , description > 21| title= gettitle() 22| 23| //- output docpad produced meta elements 24| != getblock('meta').tohtml() site not defined @ docpadconfig.templatedata.getwat (/volumes/data/project/am/lab/docpad/hello_docpad/docpad.coffee:10:16) @ eval (eval @ <anonymous> (/volumes/data/project/am/lab/docpad/hello_docpad/node_modules/docpad-plugin-jade/node_modules/j

How do I change the default text and color for jQuery UI MultiSelect Widget? -

i using jquery ui multiselect widget eric hynds how change default bluish text "select options" different text , color? thanks! this 1 coming jquery ui css you need change below class whatever color need .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default{ color :black; } note: :this may impact other places have used jquery ui classes. if doing via jquery can add custom class , add color. hope helps !!

database - flyway 4.0 java base callback afterValidate not catching the hook -

i have both sql , java based migrations. trying use flyway callback hook else right after validation done, not catching callback. documentation , seems it's simple following. here file structure: -java --db ---migrations ----v1__apple <----java based --fruitshopflywaycallback.java <---- callback class -resources --migrations --- v1__orange.sql <----sql based my callback: public class fruitshopflywaycallback extends baseflywaycallback { @override public void aftervalidate(connection dataconnection) { system.out.println("it worksssssssss"); } } my thought once migration done, flyway going callback method. not sure missing? in case helpful. looking how configure flyway work java callbacks using maven. need register callback classes flyway (using flyway pure java use setcallbacks). in maven looks this: <plugin> <groupid>org.flywaydb</groupid> <artifactid>flyway-maven-plugin</artifacti

html - Vertical border messed up by horizontal border - flexbox -

i created table using flexbox. i'm wanting add vertical line down center , added border-right first columns, borders on bottom of rows breaking visual flow of vertical line. i'm having hard time wrapping head around how solve this. how can add vertical line while still keeping bottom border? jsfiddle: https://jsfiddle.net/oczxqxmu/ just remove .flex_row:not(:last-child) { border-bottom: 2px solid #fff; } like https://jsfiddle.net/oczxqxmu/1/ if want keep bottom-borders, use ::after , position:absolute create line in middle of table, this https://jsfiddle.net/oczxqxmu/11/

python - Get current URL in Twisted -

i wrote script in twisted proxies websites, , i'm wondering if there's way current url in twisted? or let me know when url changes? thanks! from twisted.internet import reactor twisted.web import proxy, server site = server.site(proxy.reverseproxyresource('www.website.com', 80, ''.encode("utf-8"))) reactor.listentcp(80, site) reactor.run()

Python While Loop: Else tripped despite valid input -

doing cs101 course github oss , i've got bug 1 of projects runs fine specific use case(input: o, m, n, ., n) last 'n' triggers else block (even though prints out 'n' variable gamedecision. i've tried can think of coming short. since course closed, advice appreciated. thanks! link problem: https://courses.edx.org/courses/course-v1:mitx+6.00.1x_8+1t2016/courseware/week_4/problem_set_4/ code: # 6.00x problem set 4a template # # 6.00 word game # created by: kevin luu <luuk> , jenna wiens <jwiens> # modified by: sarina canelake <sarina> # import random import string vowels = 'aeiou' consonants = 'bcdfghjklmnpqrstvwxyz' hand_size = 7 scrabble_letter_values = { 'a': 1, 'b': 3, 'c': 3, 'd': 2, 'e': 1, 'f': 4, 'g': 2, 'h': 4, 'i': 1, 'j': 8, 'k': 5, 'l': 1, 'm': 3, 'n': 1, 'o': 1, 'p': 3, 'q

Execute Selenium Python Code in a For Loop -

i have script call create_cpe.py open firefox , create cpe. create_cpe.py # -*- coding: utf-8 -*- selenium import webdriver selenium.webdriver.common.by import selenium.webdriver.common.keys import keys selenium.webdriver.support.ui import select selenium.common.exceptions import nosuchelementexception selenium.common.exceptions import noalertpresentexception import unittest, time, re import random import requests class createcpe(unittest.testcase): def setup(self): self.driver = webdriver.firefox() self.driver.implicitly_wait(30) self.base_url = "http://localhost:8888" self.verificationerrors = [] self.accept_next_alert = true def test_create_c_p_e(self): mac = [ 0x00, 0x24, 0x81, random.randint(0x00, 0x7f), random.randint(0x00, 0xff), random.randint(0x00, 0xff) ] cpe_mac = ':'.join(map(lambda x: "%02x" % x, mac)) cpe_mac = cpe_mac.replace(":&

Why does redirecting from HTTPS to HTTP fail in this Rails 4 app (OpenShift)? -

when user on http, can redirect him https (ssl) variant so: redirect_to { protocol: 'https://', domain: 'ssl.tld' } however, when want do reverse , creates infinite redirection loop . i've tried several variants. mention some: redirect_to { protocol: 'http://', domain: 'nonssl.tld' } redirect_to "http://nonssl.tld#{request.fullpath}" the loop, according log: 000.000.000.000 - - [21/apr/2016:18:50:04 -0100] "get /en http/1.1" 302 887 "https://ssl.tld/en/users/sign_in" "= the_user_agent_here" whereas https://ssl.tld/en/users/sign_in apparantly referrer/the current page before redirection. i wonder why get shows path opposed url - given redirect_to "http://nonssl.tld#{request.fullpath}" should explicitly considered absolute url, according docs. update here relevant part application_controller's before_action : exceptions = ['errors', 'subscriptions', 

javascript - BitGO-JS Exceed Transaction 250 limit -

i'm trying simulate of test.bitgo.com more 250 transactions current limit set api... tried , tried again different methods achieve same results , after 1 week still can't find proper way transaction data in 1 go . one of devs said promise has nested while-loop adds count:250 skip:0 , run function again , again until there nothing left sum because count gets 0 @ end , gets 852 transactions. this i'm using https://www.bitgo.com/api/#list-wallet-transactions . gives object has 250 transactions , keeps count this. var walletid = '2nb96fbwy8eohttuzttbwvvheyrbwz494ov'; bitgo.wallets().get({ "id": walletid }, function callback(err, wallet) { if (err) { throw err; } wallet.transactions({limit:2, skip:0}, function callback(err, transactions) { // handle transactions console.log(json.stringify(transactions, null, 4)); }); }); // result { "transactions": [ { "id": "71fb53e7d70ce27dced2eb327ac544b8f046e66480342ba815

javascript - node-sass and sass-eyeglass Get the tree -

i interested in using sass-eyeglass node-sass build custom functions. 1 of things looking retrieve value of sass variable so: js: // eyeglass-exports.js "use strict"; var path = require("path"); module.exports = function(eyeglass, sass) { return { functions: { "get-var($prefix, $subject)": function(prefix, subject, done) { // return variable {prefix + ' - ' + subject} } } } }; sass: // index.scss $my-foo: 20px; div { font-size: get-var(my, foo); // font-size: 20px; } to able this, need access kind of tree of has been parsed (at point in time). possible node-sass?

javascript - Efficient Coding of Many Similar HTML pages -

i'm new html , jquery. running website survey experiment, means have ~50 pages identical exception of few values. there way can capture differences variable , loop through template html code? i'm using variables in code, i'm not sure how or if can applied instantiations of block of html/jquery code. thank in advance! in asp.net can have cshtml page inherits layout. layout single page same, while inherits can vary slightly. more on here: http://www.w3schools.com/aspnet/webpages_layout.asp another option mvc model - can have single page, or view, , model can change dynamically. view adapts values in model. more on here: http://www.w3schools.com/aspnet/mvc_intro.asp all in all, doing possible. both of above options, , there more well. don't take easy way out , manually create identical pages.

javascript - Why doesn't my sinon fake server return anything? -

i'm trying setup fake sinon server testing requests. in code below, callback function never gets called. test errors out error: timeout of 500ms exceeded. ensure done() callback being called in test. why callback function not called immediately? var request = require('request'); var sinon = require('sinon'); describe('job gets data', function(){ var server; beforeeach(function(){ server = sinon.fakeserver.create(); }); aftereach(function(){ server.restore(); }); context('when there request /something', function(){ it('will throw error if response format invalid', sinon.test(function(done){ server.respondwith('get', '/something', [200, { "content-type": "application/json" }, '{invalid: "data"}']); request.get('/something', function (err, response, body) { console.log(response);

typescript1.8 - Import external libraries and generate single file with typescript -

in gulp, use typescript transpile files es6, babel generate es5, , browserify generate 1 file modules. code: gulp.task('scripts', function() { return browserify('./src/scripts/main.ts') .plugin(tsify, {moduleresolution: "node", target:"es5", allowjs:true, allowunreachablecode:true"}) .transform("babelify", {presets:["es2015"], extensions:[".ts", ".js"]}) .bundle() //pass desired output filename vinyl-source-stream .pipe(source('main.js')) // start piping stream tasks! .pipe(gulp.dest('./dist/scripts/')); }); i thought nice , less error prone if had rely on typescript of above. transpiler tried tsc --moduleresolution "node" --module "amd" --allowjs --outdir "out/" --allowunreachablecode --out foo.js main.ts this works fine, problem doesn't import external libraries jquery or d3 . is, i

java - Pass list of values on query parameter -

string hql = "select * mytable isactive in (:isactive)"; query query = session.createquery(hql); query.setstring("school",""); query.setstring("isactive", "y");//working query.setstring("isactive", "n");//working query.setstring("isactive", "y","n"); // not working query.setstring("isactive", "'y','n'"); // not working return query.list(); i have no idea if code below should work, wondering if can pass list of values search string parameter there's no need me create queries ; 1 select data regardless of status , select active data. use query.setparameterlist() pass in list parameter: string hql = "select * mytable isactive in (:isactive)"; query query = session.createquery(hql); list<string> isactivelist = new arraylist<>(); isactivelist.add("y&quo

Error reading TextBox value in C# -

i'm having problems making program read text textbox. i'm reading 2 values 2 textboxes seems nothing reading. ends happening enter values textboxes , press button enter values program. have set print out values in textboxes, when prints, looks didn't read textboxes. here's code window: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace giveaway_program { public partial class giveawayprogram : form { public giveawayentry[] entries = {}; public giveawayprogram() { initializecomponent(); } private void giveaway_load(object sender, eventargs e) { } private void panel_paint(object sender, painteventargs e) { } private void emailtext_textchanged(object sender, eventargs e) {

objective c - iOS SQLite Blob data is saving NULL -

i trying insert blob data of signatureview using code when browse database there null instead of data. signature table schema given below. create table sign(id integer primary key autoincrement, image blob,invoiceid integer); -(void)storeimagedata:(nsdata *)imagedata withinvoiceid:(nsinteger)invoiceid{ nsstring *dbpath = [[[nsbundle mainbundle] resourcepath ]stringbyappendingpathcomponent:@"database.sqlite3"]; const char *dbpath = [dbpath utf8string]; sqlite3 *contactdb; sqlite3_stmt *statement; nslog(@"%@",dbpath); if (sqlite3_open(dbpath, &contactdb) == sqlite_ok) { int invoiceidint = (int)invoiceid; // nsstring *insertsql = [nsstring stringwithformat: @"insert sign (image,invoiceid) values (?,%d)", invoiceidint]; const char *insert_stmt = [insertsql utf8string]; sqlite3_prepare_v2(contactdb, insert_stmt, -1, &statement, null); if (sqlite3_step(statement

go - Why is Golang written in Golang? -

i see go language written in golang itself. golang @ github why done way ? what new features ? how build compiler ? it's practice called self-hosting . lots of languages start out written in low-level language c make goal rewrite canonical compiler in own language before version 1.0. it's way eat own dog food , make sure language complex piece of software needs , ensure compiler works right.

jquery - simple ajax request with react.js -

im trying display data ajax request, done inside react.js. far no joy.... its trying pull data test web api, jquery installed, although not necessary, have looked @ alternatives, struggled far implement them. for request trying 2 things, bind data , append method jquery, both don't work. else renders , console not spitting out errors. i trying work towards generic function can ported on react-native, im stuck @ jquery implementation. var url = 'https://demo2697834.mockable.io/movies'; //main logic var getstuff= react.createclass({ getinitialstate: function() { return { entries: [] }; }, componentdidmount: function() { $.ajax({ url: 'https://demo2697834.mockable.io/movies', datatype: 'json', cache: false, success: function(data) { this.setstate({entries: data}); $('.test').append(data); }.bind(this), error: functio

android - How To See If One Date Is Newer Than Another -

hello think have simple question i'm having trouble figuring out. i got date , time in android using code string currentdatetimestring = dateformat.getdateinstance().format(new date()); it gave me value apr 21, 2016 9:30:16 pm how compare using dates value if want see if apr 21, 2016 9:30:16 pm is newer or older apr 21, 2016 9:35:16 pm how check thanks attempt one i tried dateformat format = new simpledateformat("mm-dd-yyyy", locale.english); date filedate = format.parse(date1); dateformat format2 = new simpledateformat("mm-dd-yyyy", locale.english); date metadate = format.parse(date2); this value date 1 , 2 being apr 21, 2016 9:35:16 pm but threw parse exception. must use value above need doesn't break code when tries parse date the easiest way use date.before(), rather comparing strings. in fact easier convert string date use strings.

javascript - Should Reacts `propTypes` and `defaultProps` be used in conjunction with Flowtype, or is Flowtype comprehensive enough? -

thinking of simple example such as: class commentareacomponent extends react.component { static proptypes = { id: proptypes.string.isrequired, loading: proptypes.bool, }; static defaultprops = { loading: false, }; in constructor can define achieve (i think) same thing: class mycomponent extends react.component { constructor({ loading = false, }:{ id:string, loading?:boolean }) { super(arguments[0]); } } the second example using flowtype. using reacts proptypes , defaultprops offer advantage? or can drop them when using flowtype? you can surely use flow types instead of react proptypes, proposed syntax not common way it. see flow docs (scroll down es6 syntax): class button extends react.component { props: { title: string, visited: boolean, onclick: () => void, }; state: { display: 'static' | 'hover' | 'active'; }; static defaultprops = { visi

haskell - Monad: [UI Element] vs [Element] -

in following code sample tried create box number of select elements , combine selection list of values using behaviors. (code compiles/runs in ghci threepenny-gui) {-# language recursivedo #-} module threepenny.gui import prelude hiding (lookup) import control.monad import data.list import data.traversable import data.maybe import data.monoid import qualified data.map map import qualified data.set set import qualified graphics.ui.threepenny ui import graphics.ui.threepenny.core hiding (delete) {----------------------------------------------------------------------------- (#) reverse function application: flip $ (#+) append dom elements children given element: parent #+ children (#.) returns ui element css class changed second parameter ------------------------------------------------------------------------------} gui :: io () gui = startgui defaultconfig setup fixedtextarea = ui.textarea # set style [("resize", "none"), ("height", &q

sed - How to replace a character in a pattern in unix -

i have search string in particular position , if string contains { , has replaced 0 . for example: text='i have 45320{ dollar' in above example, { needs replaced 0 , @ same corresponding number needs converted 2 decimal places. expected output: text='i have 4532.00 dollar' is possible implement logic in unix using sed? using sed , can do: $ text='i have 45320{ dollar' $ sed 's/\(.\){/.\10/' <<< "$text" have 4532.00 dollar

node.js - Try to Intersect JSON Array -

i need intersect query result. after intersection data want use in page. this data : (i store data in variable "hasilget") [ { "_id" : "2017-05-22", "kamar" : [ [ { "_id" : objectid("570f5095c8dbf1045d7fe9b3"), "namkam" : "vip one", "idtipe" : objectid("57023e5e36b35501f17ea5c6") } ], [ { "_id" : objectid("570f509dc8dbf1035d7fe9b5"), "namkam" : "vip two", "idtipe" : objectid("57023e5e36b37601f17ea5c6") } ] ] }, { "_id" : "2017-05-23", "kamar" : [ [ { "_id"

How to draw line between point using python -

Image
how draw line between 2 or 3 point. have 2 text file, first text file list of posisition each point. point long lat 115 12 b 89 13 c 100 13 etc. and second file this: 3, 4 a, b, c r, x, y v, p, o j, m, n 2, 3 q, s h, k t, w 4, 1 e, d, f, g and want draw lines pic: actually, i'm not sure code. code:: import psycopg2 import psycopg2.extensions import matplotlib.pyplot plt import itertools import collections import numpy np def readrules(_dir): #_dir = r'd:\s2\semester 3\tesis\phyton\hasil\hasil_20160116_09.12.11' mydict = {} open(os.path.join(_dir, 'rule3.csv'), 'rb') testfile: line in testfile: # first line next record "matrix size" columns, rows = (int(x) x in strip_comment(line).split(',')) # next line header record key = tuple(strip_comment(next(testfile)).split(',')) # next lines rows record vals = [tuple(int(