Posts

Showing posts from April, 2015

Issues with 'checked' attribute in 'input' form tags within PHP while loops -

Issues with 'checked' attribute in 'input' form tags within PHP while loops - i'm using html form edit sql db, want have form display value in database. i'm using while loop display sql rows. simple radio button allowing user chose between 'listings' (shows '0' in sql) or 'recent transactions" (shown '1' in sql). the radio buttons not pre-filling value sqlas checked or not <form name="edit listing" action="edit_list.php" method="post" id="edit_form" > <ul> <?php while ($data=mysqli_fetch_assoc($result)): $transaction = $data['transaction']; $chkvalue='checked="checked"'; ?> <li> <fieldset> <legend>designation <h6>required</h6></legend> <input name="transaction" type="radio" tabindex="11" value="0" <?php if

json - Providing data models to use in Gulp Nunjucks templates -

json - Providing data models to use in Gulp Nunjucks templates - i'm looking utilize gulp render nunjucks templates either gulp-nunjucks or gulp-nunjucks-render. there way can pass 1 or series of .json files templating bundle utilize json info in nunjucks templates? ideally i'd have models/ directory each page having corresponding page.json file contents used in template. i'd know if it's possible either of above plugins , if how can implemented. examples single or series of .json files useful. look using gulp-data https://www.npmjs.org/package/gulp-data produces json source, json file, or database, sends downwards stream via new attribute on file object (file.data). nunjucks plugin need modified consume info property. json gulp nunjucks

node.js - Session data is not saving to memory while using express-session -

node.js - Session data is not saving to memory while using express-session - i encountering problem when seek next illustration using different express-session versions. using express-session 1.0.2 : var connect = require('express'), cookieparser = require('cookie-parser'), session = require('express-session'); var app = connect(); app.use(cookieparser()) .use(session({secret:'sessionsecret',cookie:{maxage:60000}})) .use(function(req,res,next){ if(req.session.views){ res.setheader('content-type','text/html'); res.write('<p>views ' + req.session.views + '</p>'); //here res.end(); req.session.views++; } else { req.session.views = 1; res.end('welcome demoe. seek refresh page'); } }) .listen(3000); this works; view counter keeps increasing when refresh page. however, when alter express-session 1.8.2 (the lat

encryption - Generate AES key in C# for windows store app -

encryption - Generate AES key in C# for windows store app - i need genearte 256 bit key aes encryption in c# fore windows store app. ised next code , getting execption. please point me doing wrong. public string genaeskey() { uint32 keysize = 32; cryptographickey key; symmetrickeyalgorithmprovider algorithm = symmetrickeyalgorithmprovider.openalgorithm(symmetricalgorithmnames.aesecb); ibuffer keymaterial = cryptographicbuffer.generaterandom((keysize + 7) / 8); seek { key = algorithm.createsymmetrickey(keymaterial); homecoming key.tostring(); } grab { homecoming null; } the error "value not fall within expected range." @ algorithm.createsymmetrickey(keymaterial); command. my bad. problem in this. uint32 keysize = 32; changed to uint32 keysize = 256; and evrything goo

C++ beginner - simple outputs -

C++ beginner - simple outputs - here have simple code serve calculator integers. //calculator, michael lowry #include <iostream> using namespace std; void main () { int input = 0; int input2 = 0; int reply = 0; int operation = 0; cout << "enter first number" << endl; cin >> input; cout << "type 1 addition, 2 subtraction, 3 multiplication, or 4 division" << endl; cin >> operation; cout << "enter sec number" << endl; cin >> input2; if (operation = 1) { input + input2 == answer; } if (operation = 2) { input - input2 == answer; } if (operation = 3) { input * input2 == answer; } if (operation = 4) { input / input2 == answer; } cout << "your reply " << cout << reply << endl; scheme ("pause"); } when com

mozilla firefox extension: creating a javascript library and using it in a HTML page -

mozilla firefox extension: creating a javascript library and using it in a HTML page - i created library in firefox extension : ./components/main.js ./skin/icon.png ./install.rdf ./chrome.manifest my main.js utilize define class calling mozilla tcpscoket ( https://developer.mozilla.org/en-us/docs/web/api/tcpsocket) function mylib() {} mylib.prototype.dowork = function(arg1,arg2) { /* tcpscoket */} how should utilize library on client side in html ? i'm looking (?): <html><head><script> var mylib = mozillaapithing.createnewinstance("chrome://myextension/", "mylib"); .... </script>(...) chrome or resource (not in restartless) urls available direct urls (ie can come in them address-bar , show up). hence can utilize simple script src <script src="chrome://myextension/components/jsfile.js"></script> alternatively, can read js file (ie xmlhttprequest or fileutils.jsm or osfi

Biztalk Map, How to execute a scripting functoid ONLY IF the source message contains a specific value? -

Biztalk Map, How to execute a scripting functoid ONLY IF the source message contains a specific value? - in biztalk map, how can execute scripting functoid if source message contains specific value? functoid combination can allow me this? edit i want check element specific value. scripting inline xslt. in response 40alpha first suggestion: method utilize can't connect scripting functoid value mapping functoid. i'm doing wrong here? the 2 easiest options (imo) be: what is: create equal functoid (1st status beingness "certain element" , 2nd status beingness text check against) create value mapping functoid , connect equal functoid (that made) first , connect scripting functoid. now connect scripting functoid desired target element(s). or simpler approach be: wrap xslt in scripting functoid: <xsl:if test="/yournode[text()="somevalue"]"> <!--your scripting here --> </xsl:if> biztalk

emf - An Acceleo-based generator built with Maven does not work on Obeo Designer 6.2 -

emf - An Acceleo-based generator built with Maven does not work on Obeo Designer 6.2 - i have acceleo-based generator generates text files uml classes. want run on obeo designer. created in obeo designer 6.2. when build , debug application locally obeo, works fine. but if build application using maven , install on obeo designer plugin, then, whenever seek generate text file using acceleo-based generator, next exception: java.lang.stringindexoutofboundsexception: string index out of range: -1 @ java.lang.string.substring(string.java:1911) @ org.eclipse.emf.ecore.impl.emodelelementimpl.eobjectforurifragmentsegment(emodelelementimpl.java:417) @ org.eclipse.emf.ecore.resource.impl.resourceimpl.geteobject(resourceimpl.java:774)... i think, issue similar one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=421341 .emtl file, generated during maven build, contains "%" cannot parsed during execution of generator , gives exception. .emtl file generated during local build

sqlite - PHP - How to extend SQLite3Result class -

sqlite - PHP - How to extend SQLite3Result class - this came far: class sqlite3_extended extends sqlite3 { public function query($string){ $result = parent::query($string); if(is_bool($result)) homecoming $result; else homecoming new sqlite3result_extended($this); } } class sqlite3result_extended extends sqlite3result { public function test(){ echo 'sqlite3result extended successfully!'; } } and this: fatal error: phone call private sqlite3result::__construct() context 'sqlite3_extended how extend sqlite3result class? you can't. sqlite3result class can instantiated internally sqlite3::query() ; there no way build instance of class, or of subclass, yourself. if want extensible database class, utilize pdo. can utilize custom subclass statements/results calling pdo::setattribute() pdo::attr_statement_class argument. bonus, may enable back upwards database engines other sqlite. php sqlite extend

c# - Having trouble getting a progress bar to run -

c# - Having trouble getting a progress bar to run - in programme have file input operation pretty lengthy. during operation, application freezes until file loaded (as in, can't click on anything). due this, trying implement progress bar loading screen user not think wrong. have created .xaml window progress bar , attached viewmodel , datamodel facilitate properties of progress bar. for simplicity, routines run on file open located in big while loop. before while loop open loading window , alter progress bar's isindeterminate property true . i utilize isindeterminate property because need progress bar this: however, mentioned earlier, during process window freezes. causing progress bar freeze. how can display progress bar , allow run while go through file input process? edit xaml progress bar: <progressbar name="progress" value="{binding loadscreenmodel.value}" minimum="{binding loadscreenmodel.min}" maximum="{bind

vba - Fetch Data into Excel from batch file using vbs script -

vba - Fetch Data into Excel from batch file using vbs script - i have batch file run set of sql queries , loads info table. i have written vba script button click in excel retrieve info above table. however requirement has changed populate info excel without button click. not want code in workbook open event. i have alter vba code .vbs script can phone call batch file. please help me. right me if wrong approach. write vbscript that: executes bat shell.run """c:\...\my.bat""" then executes macro (example below) runmacro sub runmacro() dim xl dim xlbook dim scurpath path = createobject("scripting.filesystemobject").getabsolutepathname(".") set xl = createobject("excel.application") set xlbook = xl.workbooks.open(path & "\workbook.xlsm", 0, true) xl.application.visible = false xl.displayalerts = false xl.appli

How to generate JBoss jboss-deployment-structure from maven dependencies -

How to generate JBoss jboss-deployment-structure from maven dependencies - we have project built using maven. there lot of dependencies resolved designed pom files. need generate sar module planning deploy on jboss7as. have describe dependencies (including our modules) manually in file meta-inf/jboss-deployment-structure.xml <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0"> <deployment> <resources> <resource-root path="lib/activemq-camel-5.6.0.jar"/> <resource-root path="lib/activemq-core-5.6.0.jar"/> <resource-root path="lib/activemq-pool-5.6.0.jar"/> <resource-root path="lib/activemq-protobuf-1.1.jar"/> <resource-root path="lib/ant-1.6.5.jar"/> <resource-root path="lib/antlr-2.7.6.jar"/> and when alter version of dependency in maven config must

broadcastreceiver - Stopping alarms after the app is killed Android -

broadcastreceiver - Stopping alarms after the app is killed Android - i have situation in application. calling service using alarm. alarm wakes every 5 min , calls service. but may happen user might close app , allowing functionality of service work if user not using app. to stop service there 2 ways either user comes app , presses button cancel alarm or sec way after x time want stop service i.e cancel alarm broadcast receiver. now how can sec way ? when tried reference of alarmmanager giving me error of null pointer. (i accessing alarm manager broadcast receiver) can give me suggestion on how cancel repeating alarms outside activity context ? thanks :) you can stop service context.stopservice(new intent(context, yourservice.class)) also in order cancel alarm can this intent intent = new intent(this, yourclass.class); pendingintent pendingintent = pendingintent.getbroadcast(getapplicationcontext(), 1253, intent, pendingintent.flag_update_current| intent.

odata - Table dynamic loading SAPUI5 / UI5 -

odata - Table dynamic loading SAPUI5 / UI5 - i want display huge set of info in sapui5-table component. used implement these datatables dynamically loading, means table loaded ~50 records. after user scrolled downwards far enough, next set of 50 records loaded table. way possible me display table of more 160.000 entries without performance issues. now need same sapui5-table. implemented server side, odata service ready use. implemented clientside without dynamic loading. page trys load records out of database. how can accomplish this? there premade way implement this? know odata service can called various parameters specify dataset deliver, dont know how create table these calls while scrolling? generally, table bound odata model of you. if you´re using sap.m.table can take @ growing properties here. an illustration on how utilize paging sap.m.table can found in explored app in list section. using sap.ui.table.table threshold property controls fetch s

scala - Is there a Gatling2 REPL console? -

scala - Is there a Gatling2 REPL console? - i utilize scala repl console gatling debug code , evaluate it. there easy way that? there fast way syntax check on gatling scripts? if you're using sbt, can take advantage of sbt's console task gatling in classpath , and experiment apis, won't able execute requests, etc... repl. the next best solution utilize gatling's sbt plugin (https://github.com/gatling/gatling-sbt) : using it, can compile , run simulations, launch them on every successful compilation until result suits you. scala read-eval-print-loop gatling

c# - WPF data binding to dictionary with enum key -

c# - WPF data binding to dictionary with enum key - i have solution couple of projects. in 1 project, model has enum called modelenum. then in wpf project have viewmodel has dictionary. and in viewmodel have valuesdictionary setup as: private dictionary<modelenum, string> _valuesdictionary = new dictionary<modelenum, string>(); public dictionary<modelenum, string> valuesdictionary { { homecoming _valuesdictionary; } set { _valuesdictionary = value; onpropertychanged(_valuesdictionary); } } in xaml have: xmlns:model="clr-namespace:model.data;assembly=model" ... <textbox text="{binding path=valuesdictionary[(model:modelenum)modelenum.enum1].value}" horizontalalignment="left" height="29" margin="90,82,0,0" textwrapping="wrap" verticalalignment="top" width="50"/> the next xaml snippet: (model:modelenum)modelenum.enum1 is givin

eclipse - Spring tool suite: Tomcat server constant permgen -

eclipse - Spring tool suite: Tomcat server constant permgen - i working spring sts. hoping webapplication on tomcat v7.0 server added using internal server wizard. the server keeps running out of memory , throws permgen error when editing java files since server redeploying automatically (maybe? thats understanding). there way increment allocated permgen space server considering did not install own re-create of tomcat? any help or clarification awesome. i added stacktrace if helps: severe: unexpected death of background thread containerbackgroundprocessor[standardengine[catalina]] java.lang.outofmemoryerror: permgen space @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclass(classloader.java:800) @ java.security.secureclassloader.defineclass(secureclassloader.java:142) @ org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:2957) @ org.apache.catalina.load

java - Install local jar dependency as part of the lifecycle, before Maven attempts to resolve it -

java - Install local jar dependency as part of the lifecycle, before Maven attempts to resolve it - because of incompatibilities between 2 dependencies, forced create shaded version of 1 of dependencies. means project depends on local .jar file. i fine using mvn install-file install .jar local repository, before running mvn install : mvn org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -dfile=lib/my-custom-jar-1.0.0.jar mvn install however, project on automated build server, mvn clean install , nil else. by looking long while, have found several solutions, none perfect. i writing downwards solutions found reply below, i'm posting question hoping has improve thought solve problem. here's few solutions tried, weren't great uses: 1. maven-install-plugin the thought add together install-file goal part of install lifecycle adding pom: <plugin> <artifactid>maven-install-plugin</artifactid> <version&g

python - C# .NET serial port connects, doesn't read or write -

python - C# .NET serial port connects, doesn't read or write - i'm using c# , .net 4.5, visual studio 2012 compiler/ide open , interact serial port. code designed connect qsb quadrature-to-usb converter digital. here code i'm using open port , connect. this.port = new serialport(); this.port.baudrate = 230400; this.port.portname = "com9"; this.port.parity = parity.none; this.port.handshake = handshake.none; this.port.databits = 8; this.port.stopbits = stopbits.one; this.port.open(); setting breakpoint after this.port.open() allows me verify serial port indeed connected. in section of code, next called in response button push: this.port.writeline("w168"); this command *should cause hardware spin motor, , in fact if send command using putty, or using python script wrote (both using same settings c# code does). yet nil happens. can open port in putty or python , execute command expected results, , run c# code , nil happens. am

html5 - CSS - Mobile menu placement issue -

html5 - CSS - Mobile menu placement issue - i trying place mobile menu responsive sectioned site. the mobile menu placed within relatively positioned header block. when actived mobile menu absolutely positioned - pushes parent content upwards - perchance due height of teh content - content remains in place when closed (ios firefox). i'm struggling figure solution menu can positioned required , show @ right width without screwing when menu opens!? other fixing position of menu - mean content scrolls beneath - isn't ideal - have ideas? site build here (mobile width re-create problem) - http://www.liquidclients.co.uk/landsail/ls2/ try on line 140 in landsail_mobmenu.css: #nav { position: fixed; top: 75px; left: auto; } css html5 css3

Native C++ dll in one solution with C# project -

Native C++ dll in one solution with C# project - i have source file written in c++, performing simulation. create user interface in c#. how can have both c++ , c# in single visual studio solution? what did far created .net c# project , solution, , native project dll library. have marked c# project "depends on" c++ dll. have provided necessary dllexport directives , imported using dllimport . compiles fine, when execute application, dll not found: unable load dll 'xxxx.dll': specified module not found. it no surprise dll not found, application run output directory , output directories different c# , c++ projects. not want write explicit path import `"..\..\debug\xxxxx.dll". is there mutual way how construction solution containing native dll , c# app c# app can phone call native dll? if know after deployment c++ dll in same folder c# dll (or executable), on simple way solve problem utilize postbuild event (project properties, build

xcode - How to solve the ipa is invalid issue ? ios -

xcode - How to solve the ipa is invalid issue ? ios - i using xcode 6. want validate project, keeping recieving error : the ipa invalid not include payload directory how solve problem ? search net lot , there no suggestions help me? by way when opened new project same identifier , provision validate succeed ! make sure application requires iphone environment , aka lsrequiresiphoneos , key in application's info.plist file true . if isn't, xcode build ios .ipa in os x applications folder. ios xcode app-store xcode6

autocomplete - haskell repl case-insensitive autocompletion -

autocomplete - haskell repl case-insensitive autocompletion - can create cabal repl autocompletion case-insensitive? other cabal repl autocompletion features matching ones in zsh nice well. haskell autocomplete read-eval-print-loop case-insensitive

javascript - Issues with .on() and AJAX -

javascript - Issues with .on() and AJAX - this question has reply here: event binding on dynamically created elements? 13 answers i have these lines in header $( document ).ready(function() { $(".thumb").hide(); $(".thumb").first().show(); $(".text" ).mouseenter(function() { $(this).prev(".thumb").show(); }).mouseleave(function() { $(this).prev(".thumb").hide(); }); }); they work fine on page load, i'm loading new html content ajax, these lines beingness ignored. in previous questions, gentle person told me utilize .on() okay. how apply .on() code above? i know it's dumb question of you, i'm absolute beginner , i'd appreciate it, if give helpful advice. your code (open modifications) $(document).ready(function() { $(".thumb").hide();

javascript - Using location.search to locate a parameter's value -

javascript - Using location.search to locate a parameter's value - im working on tool takes value parameters in url , few things them. my issue is, cant seem utilize document.location show specific value im after, example: www.examplesite.com?yourname=gilgilad i want utilize document.location.search , set in var, need var's value "gilgilad" i read on location.search in w3school , tired looking similar questions on here seems no 1 has specific need. is doable using location.search? give thanks you. location.search homecoming after question mark including it. there universal js value of first parameter (even if url has more parameters): var want = location.search.split("&")[0].replace("?","").split("=")[1] example: lets take url http://example.com?name=jon&country=us location.search equal ?name=jon&country=us .split("&")[0] splits 2 strings ( ?name=jon , country=u

stripe payment - how to suspend a subscription (not cancel) -

stripe payment - how to suspend a subscription (not cancel) - we want utilize stripe payment system. our model based on weekly fee billed every 13 weeks. so, user billed 13 weeks @ initial subscription quantity. our users changing quantity of subscription several times on 13 week billing period , weeks have subscription level of zero. can set subscription quantity 0 (0), suspend subscription. for example $10 per week per subscription unit first bill 13 weeks, total of $130. at end of 3rd (3) week, client increment subscription quality 3, weekly charge of $30. at end of 6th (6) week, client decrease subscription quality 0, weekly charge of $0. at end of nineth (9) week, client increment subscription quality 4, weekly charge of $40. so, sec charge (after 13 weeks) is: bill 13 weeks in advance @ current subscription quantity 4: $40 * 13 weeks = $520 prorate charges 3 weeks * ($30 - $10 (prepaid)) = $60 3 weeks * ($0 - $10 (prepaid)) = -$30 (credi

serialization - C++ class "upgrade" with minimal boiler-plate -

serialization - C++ class "upgrade" with minimal boiler-plate - let's have following: struct c1 { int w; } struct b1 { int x; int y; int z; c1 c; }; struct a1 { int x; int y; int z; b1 b; }; struct c2 { long w; short t; } struct b2 { int x; int y; int z; c2 c; }; struct a2 { int x; int y; int z; b2 b; }; and want implement function a2 upgrade(const a1 &a1); such takes a1 object, , creates a2 object (assume a2.w = a1.w , a2.t = 6 ). an ideal (but impossible knowledge) implementation following: a2 upgrade(const a1 &a1) { dynamic d = to_dyn(a1); d["b"]["c"]["w"] = (long)d["b"]["c"]["w"]; d["b"]["c"]["z"] = (short)5; a2 a2 = from_dyn(d); homecoming a2; } how close can in actual c++? as classes aggregates, concise , straight-forward using aggregate-initialization: a2 upgrade(const a1& a) { homecoming {a.x, a.y, a.z,

jquery - keydown not firing on div -

jquery - keydown not firing on div - i'm having issues keydown. when page on div "screena" user has 2 options, press space or "i" key. "i" key shows alert, , space bar shows div screentimer . when user on div screentimer should able press right arrow key phone call starttesting() , console log. the key , space bar work, right arrow key (39) nothing, , doesn't display console log either. $(document).keydown( function(e) { if ( boolkeydepressed ) return; else boolkeydepressed = true; var e = e || window.event; var ltr = e.keycode ? e.keycode : e.charcode; var trans = ""; if ( ltr == 13 ) { event.preventdefault(); } switch(ltr) { case 73: // "i" key

XML transform with XSLT 1 -

XML transform with XSLT 1 - today im struggling xslt, has been long time had utilize it. have edit xml , can't utilize xslt 2.0. have utilize 1.0. xml im struugling (basic example) : i tried making template 2 nodes, , 'call' template create new node desired values didnt work either , im missing if can point me right direction. class="snippet-code-html lang-html prettyprint-override"> <messagemap> <author> <au_id>274-80-9391</au_id> <au_lname>straight</au_lname> <au_fname>dean</au_fname> <phone>415 834-2919</phone> <address>5420 college av.</address> <city>oakland</city> <state>ca</state> <zip>94609</zip> <contract>1</contract> </author> </messagemap> xm: class="snippet-code-html lang-html prettyprint

php - Check for errors in wkhtmltopdf via command line? -

php - Check for errors in wkhtmltopdf via command line? - my php script using wkhtmltopdf generate pdf reports isn't working. is there way through command line monitor php script sending wkhtmltopdf? i error when running via command line: ./wkhtmltopdf http://www.google.com google.pdf loading pages (1/6) counting pages (2/6) resolving links (4/6) loading headers , footers (5/6) printing pages (6/6) done exit code 1 due http error: 1005 i wasn't sure if possible via command line, ssh, perl, etc. or if there's way php script still generate pdf , download though gives error code 1. this on linux server cpanel installed. php perl shell command-line wkhtmltopdf

objective c - Dynamic "itemSize" specified in a storyboard on UICollectionView based on new iOS 8 Size Classes -

objective c - Dynamic "itemSize" specified in a storyboard on UICollectionView based on new iOS 8 Size Classes - how can set different "itemsize" on uicollectionview different size classes. e.g. want have different itemsize ipad , iphones defined in 1 storyboard. thanks objective-c uicollectionview

angularjs - how to open a kendo UI modal window and pass it some help text to display, using angular -

angularjs - how to open a kendo UI modal window and pass it some help text to display, using angular - i looking simple equivalent msgbox.show( message text) when using kendo ui in angular, without using bootstrapui since i'm using kendo ui. i've read http://blogs.telerik.com/kendoui/posts/13-06-24/announcing-angular-kendo-ui but has modal window defined in markup. is there counterpart jquery version dynamically creates div , stuffs markup html property? $(".helpimg").on("click", function (e) { $(document.createelement('div')) .attr({ title: 'help', 'class': 'help' }) .html(help[e.target.id]) .dialog({ buttons: { ok: function () { $(this).dialog('close'); } }, close: function () { $(this).remove(); }, draggable: true, modal: true, resizable: true, width: '50%', height: 'aut

ruby on rails - Restarted instance causes cloudflare error 521 -

ruby on rails - Restarted instance causes cloudflare error 521 - i had running rails application on amazon instance via passenger + nginx cloudflare enabled. i restarted instance on online amazon console right-clicking "reboot". whenever visit site using dns, gives me 521 error stating web server down. however, if visit through ip address directly, works. i read in few places cloudflare may have been blocked. can identify blocking cloudflare's requests? that sound @ amazon blocking our ips. have reached out them? cloudflare's ip ranges. ruby-on-rails nginx amazon-ec2 passenger cloudflare

github - Git push from fork to specific remote branch? -

github - Git push from fork to specific remote branch? - still git noobie, been using basic commands commit, push, pull. i taking forked project , pushing private repo, creating remote within forked repo git remote add together mysite https://github.com/siterepo/site.git then upon changes force private repo. git force -u mysite master my question first logical, should skip using forked version since google web starter kit , there brilliant guys wont need contributions. so should clone web starter kit own repo customize @ will? still able merge updates way if how? okay suppose should follow said above useless, in case logic came googlemaster > myfork > mymaster how force specific branch, said used git force -u mysite master but git force -u mysite testbranch does not work. the reason want own repo can force own versions, have own branches , abstract initial project while still beingness able merge when create drastic or improve pe

win32com - close any open window using python -

win32com - close any open window using python - i wrote programme downloads images urls using urllib.urlretrieve( url , address ) . after each download of image, open using os.startfile(address) or os.system(address) . then wait 5 seconds using time.sleep(5) , download next image , open in same way. it opens, old 1 still opened. want old window closed. one way how tell python 2.7 simulate alt+f4 in order close old window before opening new one. python win32com

php - Secure contact form? -

php - Secure contact form? - currently working on contact form(e-mail contact form) somebodies website. after research, heard there ways of securing you're contact form , got me thinking. 1.is there actual big threat if don't "secure" you're contact form other spams ? worse possible scenario ? 2.if follow guidelines on how create contact form secure, best place start ? (plugins, tutorials recommendations help !) thanks guys ! "security" extremely broad topic, starters can secure info beingness transferred buying (--or generating own self-signed) ssl certificate. encrypt info sent form. whether or not need encryption depends on kind of info you're asking for. if you're asking suggestions don't need secure, if you're requesting sensitive info cc numbers or ssns it's illegal not have ssl (at to the lowest degree here in states). http://www.akadia.com/services/ssh_test_certificate.html https://www.youtube.co

How can I more elegantly remove duplicate items across all elements of a Ruby Array? -

How can I more elegantly remove duplicate items across all elements of a Ruby Array? - i want remove duplicate items within array object. it's best explain example. i have next array entries = ["a b c", "a b", "c", "c d"] i want method clean removing duplicate items within elements in array , homecoming array has 1 element each unique item. so here's method i've written this: class array def clean_up() self.join(" ").split(" ").uniq end end so when phone call entries.clean_up next result: ["a", "b", "c", "d"] this result want there more elegant way in ruby? split splits on whitespace default (assuming of course of study haven't done insane changing $; ). want split each string , flatten results 1 list, time want "do x each element , flatten" want utilize flat_map . putting yields: self.flat_map(&:split

php - Iterating through FileMaker record set -

php - Iterating through FileMaker record set - i'm new @ filemaker , trying info out via api. issue i'm having when create newfindcommand , execute resulting record set contains many rows there in layout each row same. more specifically, each row re-create of first row in database. e.g. i'm looking products product code 'xxx', of there should 7. 7 rows each 1 same product. i've looked couple of tutorials online , same operations i'm lost why results come out way. this code problem. haven't been able track cause myself yet. $findcommand = $productsfm->newfindcommand($productslayout); $findcommand->addfindcriterion('product code', 'xx123'); $findcommand->addsortrule('product code', 1); $result = $findcommand->execute(); if (filemaker::iserror($result)) { echo "<p>error: " . $result->getmessage() . "</p>"; exit; } $records = $result->getrecords(); foreach(

wordpress - Stuck in plotting Coordinates in Google Map -

wordpress - Stuck in plotting Coordinates in Google Map - i' using wordpress create application plot voyage journey on google map. here website illustration of mean. wordpress query info voyage <?php $args = array( 'post_type' => "track-the-voyage", 'posts_per_page' => -1, 'order' => 'desc', 'post_status' => 'publish' ); $voyage_query = query_posts($args); $total = $wp_query->found_posts; ?> now, making google map dynamic , plotting multiple coordinates <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=aizasyc6yp3d4z-magfbpfxzrr1pbdv7w6mqfl8&sensor=false"></script> <script type="text/javascript"> var centerlatlng = new google.maps.latlng(0, -180); <?php $i = 0; foreach( $voyage_query $voyage ){

android - Google Developers Console server error when attempting to create new Client ID -

android - Google Developers Console server error when attempting to create new Client ID - using google developers console have created new project , attempting generate oauth client id (credentials google api access android.) select oauth alternative take 'installed application' , come in bundle name , sha1 receive next error: server error an internal error occurred: error (projectid=333333333333) internal: failed update client key. any ideas? forced pay silver back upwards since there no alternative of contacting google cloud tech without it? i had created google developer console project same bundle name ended deleting client id (and deleting project.) i'm thinking google scheme didn't finish delete process or requires sort of clean process since error message above says failed 'update' client key. i'm answering own question in hopes may helps others. even though had deleted client id same bundle name , sha1 fi

"Could not create SSL/TLS secure channel" Azure Storage .NET API error since POODLE -

"Could not create SSL/TLS secure channel" Azure Storage .NET API error since POODLE - reads work, create / delete / updates don't when using .net azure storage api library blobs , azure queue (built on storage well). running within asp.net mvc 5.2 website, .net 4.5.1, libraries updated newest versions. problem arose of yesterday (oct 14) evening, poodle exploit became known. been using api project years without problem, , deployed version working until time. frustratingly, on dev / local machine problem doesn't appear. there long lag until error shows, due retry attempts or something. the request aborted: not create ssl/tls secure channel. system.net.webexception: request aborted: not create ssl/tls secure channel. @ system.net.httpwebrequest.getrequeststream(transportcontext& context) @ system.net.httpwebrequest.getrequeststream() @ microsoft.windowsazure.storage.core.executor.executor.executesync[t](restcommand`1 cmd, iretrypolicy policy,

asp.net web api - Renamed C# project, can't get rid of the old dll -

asp.net web api - Renamed C# project, can't get rid of the old dll - i writing web api application. begin with, created project , gave short name, pnlink.csproj compiled pnlink.dll - ok far. @ 1 point decided rename project , dll bit more fitting rest of naming scheme , project file became pnlink.rest.api.csproj. also, assembly name , default namespace changed accordingly. today noticed bin directory contains old pnlink.dll (which wasn't touched in several months, according filesystem information). new pnlink.rest.api.dll nowadays , newly touched. removed old pnlink.dll , saw application not able run more. compiles fine, in runtime 404 message when navigate root (instead of going default controller (which produces welcome message)). other navigation paths work fine, actually. i can find no references pnlink.csproj or pnlink.dll or anywhere in application code. of course of study tried delete compilation results (obj, bin) , compile scratch, no avail. any ideas muc

c# - any .net unit test framework supports for nested sections within a function based fixture like C++ Catch framework -

c# - any .net unit test framework supports for nested sections within a function based fixture like C++ Catch framework - i using c++ unit test framwork named grab https://github.com/philsquared/catch and think approach easy pick , organize tests: support nested sections within function based fixture example: scenarios("abc....") { given("xyz") { when("uvt..") { then("erew") { } } and_when("ssd") { then("324") { } } } } the thing construction is easy reuse setup , back upwards new variations of scenarios (green path vs not greenish path) so wonder 1 have seen thing other unit test framework in c#. thanks. answer own question: found njasmine: https://www.nuget.org/packages/njasmine gives me want. c# c++ try-catch unit-testing

ruby on rails - Fixtures not loaded using minitest to test services -

ruby on rails - Fixtures not loaded using minitest to test services - i have added /app/services directory in rails app set business logic not related specific db table and/or may phone call external apis. i added rakefile : namespace :test desc "test tests/services/* code" rails::testtask.new(:services) |t| t.pattern = 'test/services/**/*_test.rb' end end rake::task['test:run'].enhance ["test:services"] as can see, tests located within "/test/services". now tests can performed using "spring rake test", except fixtures aren't loaded @ services. worst, if seek adding "fixtures :all" @ top of service test class, "undefined method `fixture' # do have thought how can load fixtures tests located in non regular directory ? yeah, chris kottom you've got reply ! trick utilize : require 'test_helper' class vattest < activesupport::testcase # test code

python - What's the right way to use a sparse matrix in scikit? -

python - What's the right way to use a sparse matrix in scikit? - i'm trying accomplish classification task trying utilize sparse matrix. when pass training set logistic regression function, in scikit, returns error: valueerror: array contains nan or infinity. the type of matrix i'm passing argument logistic regression scipy.sparse.csr.csr_matrix . this how create sparse matrix, numpy array nans: x=sparse.csr_matrix(x_hat) what doing wrong? same error train_test_split , , these functions supposed take sparse matrices argument according documentation. i'm using version 0.14 of scikit-learn. update: total traceback. --------------------------------------------------------------------------- valueerror traceback (most recent phone call last) <ipython-input-65-acdaac419166> in <module>() 1 ----> 2 model2.fit(x_train, y_train) c:\anaconda\lib\site-packages\sklearn\svm\base.pyc in fit(self, x,

c# - Logarithmic Vertical and Horizontal Axes lines in MS Chart Control -

c# - Logarithmic Vertical and Horizontal Axes lines in MS Chart Control - the image presents logarithmic graph. want create similar graph using ms chart control. know there way convert normal graph logarithmic graph not able create vertical , horizontal axes lines (light grayness in color) similar graph below. you seek set chart's axes islogarithmic property true , set minorgrid follows: private static void setupaxis(axis axis) { // set logarithmic scale mode: axis.islogarithmic = true; // enable minor grid lines: axis.minorgrid.enabled = true; // set color of minor grid lines: axis.minorgrid.linecolor = color.gray; // set inverval 1: axis.minorgrid.interval = 1; // enable major grid lines: axis.majorgrid.enabled = true; // if not set, major grid lines defaulted black color } usage: chartarea area = chart1.chartareas[0]; setupaxis(area.axisx); setupaxis(area.axisy); c# mschart

docusignapi - Docusign Custom Button Error: List has no rows for assignment to SObject -

docusignapi - Docusign Custom Button Error: List has no rows for assignment to SObject - custom button code: `{!requirescript("/apex/dsfs__docusign_javascript")} var rc = getrelcontentids("{!contact.id}"); var cctm = 'client~signer'; var crl='email~{!user.email};role~client;firstname~{!user.firstname};lastname~{!user.lastname};signnow~1'; window.location.href = "/apex/dsfs__docusign_createenvelope?dseid=961202fa-36c6-4a9a-b061-edc7be6c8b07&sourceid={!contact.id}&rc="+rc+"&cctm="+cctm+"&crl="+crl;` visualforce error: list has no rows assignment sobject error in look '{!createenveloperecord}' in component <apex:page> in page dsfs:docusign_createenvelope:(dsfs) unexpected error has occured. solution provider has been notified. (dsfs) i have checked permissions suggested docusign , nil has changed. any advice/help hugely appreciated! thanks! the script failing be

When to setImageBitmap during creation of Fragment in Android? -

When to setImageBitmap during creation of Fragment in Android? - i need setimagebitmap during creation of fragment. cannot in oncreate , because imageview not initialized yet. had same problem in activity, called onwindowfocuschanged method , worked. there no such method in fragment. how should solve this? tried @override public void onactivitycreated(bundle savedinstancestate) { super.onactivitycreated(savedinstancestate); string imgpath = day.getphotopath(); if (imgpath != null) { dayphoto.setimagebitmap(photoutils.decodesampledbitmapfromfile(dayphoto, imgpath)); } } but gives no results. fragment blank @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_day, container, false); sethasoptionsmenu(true); dayphoto = (imageview) rootview.findviewbyid(r.id.dayimage); homecoming rootview; } so needed utilize global

java - Cordova and startResolutionForResult VS. startActivityForResult -

java - Cordova and startResolutionForResult VS. startActivityForResult - i making cordova plugin google play. @ moment i've "corrupted" plugin modifying cordovaactivity function manually. need set code within of plugin file, not split between cordovaactivity , plugin file. to this, need transfer callbacks onactivityresult initiated via startresolutionforresult plugin-specific function. comparison, believe startactivityforresult have mechanism, cannot find similar startresolutionforresult . can think of mechanism this? here cordovaactivity code , plugin code. cordovaactivity: package com.flyingsoft.safari.jigsaw.free; import android.os.bundle; import org.apache.cordova.*; import android.util.log; import android.content.intent; import com.flyingsoftgames.googleplayservices.googleplayservices; public class mygame extends cordovaactivity { private static final string logtag = "mygame"; public void onactivityresult (int requestcode, int

data.frame - R - Subset dataframe to include only subjects with more than 1 record -

data.frame - R - Subset dataframe to include only subjects with more than 1 record - i'd subset dataframe include records subjects have >1 record, , exclude subjects 1 record. let's take next dataframe; mydata <- data.frame(subject_id = factor(c(1,2,3,4,4,5,5,6,6,7,8,9,9,9,10)), variable = rnorm(15)) the code below gives me subjects >1 record using duplicated(); duplicates <- mydata[duplicated(mydata$subject_id),]$subject_id but want retain in subset all records each subject >1 record, tried; mydata[mydata$subject_id==as.factor(duplicates),] which not homecoming result i'm expecting. any ideas? a simple alternative utilize dplyr : library(dplyr) dfr <- data.frame(a=sample(1:2,10,rep=t), b=sample(1:5,10, rep=t)) dfr <- group_by(dfr, b) dfr # source: local info frame [10 x 2] # groups: b # # b # 1 2 4 # 2 2 2 # 3 2 5 # 4 2 1 # 5 1 2 # 6 1 3 # 7 2 1 # 8 2 4 # 9 1 4 # 10 2 4 filter(

c++ - Pickling a vector in boost python? -

c++ - Pickling a vector in boost python? - i have simple c++ code: class contained {}; class cannotpickle { public: cannotpickle() {}; cannotpickle(std::vector<boost::shared_ptr<contained>> new_vector) : my_vector(new_vector) {}; std::vector<boost::shared_ptr<contained>> my_vector; }; struct cannotpickle_pickle_suite : boost::python::pickle_suite { static boost::python::tuple getinitargs(cannotpickle const& c) { homecoming boost::python::make_tuple(c.my_vector); } }; i'm trying enable pickling back upwards cannotpickle this: class_<contained>("contained"); class_<std::vector<boost::shared_ptr<contained>>>("containedptrlist") .def(vector_indexing_suite<std::vector<boost::shared_ptr<contained>>, true>()); class_<cannotpickle>("cannotpickle") .def_pickle(cannotpickle_pickle_suite()); when seek

actionscript 3 - Adding a child to the stage from a class AS3 -

actionscript 3 - Adding a child to the stage from a class AS3 - i'm trying basic, add together film clip library stage. created class called link extends movieclip. have 2 film clips in library, first 1 loaded contains buttons should remove first film clip , load second. however, unable load sec using addchild(). i'm hoping there obvious i'm missing. i'm new as3. here code link class: package classes.gen1p0 { import flash.display.simplebutton; import flash.display.*; import flash.events.*; import fl.controls.*; import fl.transitions.easing.*; import fl.transitions.tweenevent; public class link extends movieclip { public var links:vector.<simplebutton > = new vector.<simplebutton >; public var sourcemap:redmc = new redmc ; public var sourcemap2:bluemc = new bluemc ; public var panzoommap:panzoommap = new panzoommap(sourcemap,704,556.3); public var diagram:panzoommap = new

.net - Simple FormatString language using Irony -

.net - Simple FormatString language using Irony - i'm trying define simplistic language using irony. language usecases are dear {name}, it free text therein references fields enclosed in curly braces. double curly brace escapes field declaration. came next spec: var ortext = new freetextliteral("text", freetextoptions.alloweof | freetextoptions.allowempty); var orfieldname = new freetextliteral("fieldname"); //nonterminals var orfield = new nonterminal("field"); var orvalue = new nonterminal("value"); //rules orfield.rule = "{" + orfieldname + "}"; orvalue.rule = ortext | orfield; root = orvalue; however, irony grammarexplorer parses value has text element. field not recognized. missing here? i don't know much irony, think need create next changes: set terminator freetextliteral . otherwise, parser won't know when end parsing text or field name. set root non-terminal lets write seq

ruby on rails - Load Error with Hierarchy / Module -

ruby on rails - Load Error with Hierarchy / Module - i have directory construction looks this: \- app \- models \- services \- recommended_action |- base.rb |- other_recommended_action.rb |- random_service.rb in application.rb, i'm autoloading recommended_action directory via config.autoload_paths += %w( #{config.root}/app/services/recommended_action ) my base.rb file looks this: module recommendedaction class base of operations def initialize(attributes = {}) # assign attributes end end end however, whenever seek load rails console, i'm getting next error: unable autoload constant base, expected /users/justin/project/app/services/recommended_action/base.rb define (loaderror) what missing? ruby-on-rails ruby

3d - OpenGL: How to render 2 simple VAOs on Intel HD Graphics 4000 GPU? -

3d - OpenGL: How to render 2 simple VAOs on Intel HD Graphics 4000 GPU? - summary: original question , observations followed updated working opengl code intel hd graphics 4000 gpu. original question: 2 cubes shown on nvidia nvs 4200m gpu , 1 cube shown on intel hd graphics 4000 gpu. using opengl 3.2 forwards profile , opentk render 2 simple cubes on screen it shows first cube centered @ (0,0,0) on intel hd graphics 4000 latest gpu driver 7/2/2014 ver 10.18.0010.3621. should show 2 cubes. we're using vertex array object (vao), vertex buffer, index buffer, attributes, normals , glsl shaders rebinding element array buffer after activating vao , before gldrawelements() still shows 1 cube on intel , 2 cubes on nvidia (vao , element array buffer state) shaders the vertex , fragment shaders compile , link ok the vertex , fragment shaders read input variables , write output variables. not read , write input/output/uniform. https://communities.intel.com/thread/36284 glgeterro