Posts

Showing posts from May, 2013

Generate odd number to be added as parameter into sql statement vb.net -

i working in vb.net windows form applications sql end. trying use loop write odd numbers sql column starting 1 , moving amount of rows in datagridview. however, statement not giving me next step , depending on loop placements either miss loop write rows sql database or miss odd number. here code: cn integer = 0 datagridview1.rowcount - 1 dim starttime date = datagridview1.rows(cn).cells(1).value integer = 1 cn 'sql code try using conn1 new sqlconnection(connstring) conn1.open() using comm1 new sqlcommand("insert table1 (col1, col2, col3, col4, col5) values (@col1, @col2, getdate(), 5, @col5)", conn1) comm1.parameters .addwithvalue("@col1", starttime) .addwithvalue("@col2", combobox1.selectedvalue) .addwithvalue("@col5", i)

Java: Method signature -

i want make interface mergeable declares method merge() . class implements have implement method follows: someobject.java public class someobject implements mergeable @override public someobject merge(someobject other) {...} see return , parameter type set implementing class. there way enforce , how set method signature in interface? look @ comparable interface example. you'll have write like interface mergeable<t> { t merge(t other); } ...and anytime want accept mergeable , write <t extends mergeable<t>> void somethingwithmergeables(t merge1) { ... }

java - br.readLine() for non terminating streams? -

i writing small utility displays list of running/stopped services.it reads console output , uses output after further processing. program hangs @ br.readline() possibly because not able find terminating character in stream. here excerpt code. try { string mainfile=""; string temp=""; process p = runtime .getruntime() .exec(system.getenv("windir") + "\\system32\\windowspowershell\\v1.0\\" + "powershell.exe get-service | format-list name , status , displayname "); p.waitfor(); inputstream = p.getinputstream(); inputstreamreader isr = new inputstreamreader(i); bufferedreader br = new bufferedreader(isr); while ((temp = br.readline())!=null) { mainfile = mainfile + temp + "\n"; } } catch (excepti

c# - Intercept MS Windows 'SendTo' menu calls? -

Image
scenario i manage , organize many files during day, sendto used feature use on windows. problem by default, when user clicks item/link of contextmenu send files, o.s not show kind of advise/notifier indicating files copying selected destination. i consider wrong design issue because big files ok ...a progressbar shown, if files small not show progressbar/visual indicator not possible ensure files copied (without manual effort) because i'm human , click outside sendto contextmenu error. so, develop personal mini-tool me optimize time showing me notifier window wherever on screen when send/copy files using sendto feature contextmenu, , sendto feature. question in simple words, want detect copy/send operation sendto menu ensure click done on menu item (and not outside menu), providing additional basic info such source folder, destination folder, , amount of files or filepaths. any ideas start developing tool in right direction?. i grateful code example in c

How to secure a web application with multiple realms using Spring's Java Config? -

i have web application 2 types of resources. web pages web services i want secure web pages using 1 authentication provider (i.e. cas) , web services using authentication provider (i.e. basic authentication). i found solution work here , uses xml, , prefer not use xml configuration if possible. is there java config solution this? well took while figure out how it... basically split original security configuration class 3 separate configuration classes. this how did it... the main security configuration... @configuration @import({webpagesecurityconfig.class, webservicesecurityconfig.class}) public class securityconfig { } the security configuration web pages... (url not begin /service/**) @configuration @order(200) @enablewebmvcsecurity public class webpagesecurityconfig extends websecurityconfigureradapter { @autowired public void configureglobal(final authenticationmanagerbuilder auth) throws exception { auth.authenticationprovider(c

java - What are the tradeoffs for different approaches when creating a comparator? -

suppose have record class string name (could other type) attribute. in class have method order(list<record>) needs sort list name . this, want create custom stateless comparator . have seen 3 options commonly used: static comparator private static final comparator<record> static_comparator = new staticcomparator(); private static class staticcomparator implements comparator<record> { @override public int compare(record m1, record m2) { return m1.getname().compareto(m2.getname()); } } void order(list<record> records) { records.sort(static_comparator); } singleton comparator private static enum singletoncomparator implements comparator<record> { instance; @override public int compare(record m1, record m2) { return m1.getname().compareto(m2.getname()); } } void order(list<record> records) { records.sort(singletoncomparator.instance); } use comparator.comparing() void order(list<

php - How to retrieve a chat msg with sender and receiver username in mysql -

chat table ------------------------------------------------------- msg_id msg(description of msg) sender(id) receiver(id) ------------------------------------------------------- 1 hello 2 1 1 how 1 2 ---------------------------------------------------------- user table ----------------------- u_id username ----------------------- 1 usman 2 ali --------------------- here see 2 tables 1 chat , 1 table user make relationship between these 2 table feel difficulty how extract data these table. what want.. i want extract each sender msg username , each reciver name username facebook chat make query i put query in database select u.user_name username,msg.msg user u,messages msg (msg.sender or msg.receiver)=(select u_id user u_id= 1 ) , msg.sender=1 order msg.msg_id desc but query repeat sender message receive name , receiver msg sender name i want show sender , reciver msg show

c++ - Parsing a list of doubles with boost::spirit::qi -

i'm getting familiar boost::spirit , want parse strings below: double_1 | double_2 | ... | double_n | double_1% | double_2% ... | double_m% where m>=0, n>=0. for example, lines below should parse ok: 91.3 | 44 | 5e-3 | 12% | 11% 91.3 | 44 | 5e-3 12% | 11% i want use boost::spirit::qi . so, i've written 2 parsers below: namespace client { namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; template <typename iterator> bool parse_numbers(iterator& first, iterator last, std::vector<double>& v) { using qi::double_; using qi::phrase_parse; using ascii::space; bool r = phrase_parse(first, last, // begin grammar ( // double_ % '|' double_ >> *('|' >> double_ >> '|') ) , // end grammar space,

PHP PDO file upload and save to MySQL database results in obscure file breakage -

after lot of testing have realised going wrong file upload process, , resulting file(s) become mangled despite displaying correct file details - size, name, mime type etc. after lot of testing , trying different options i've realised problem not extraction/display error had first thought. breaking somewhere subtly during upload/db insertion process. file saved medium blob mysql field has binary attribute. can tell me i'm going wrong in code handling upload/storage process? no errors @ all. <form action="./app.fileupload.php?lnk=<?=$lnk?>" method="post" enctype="multipart/form-data"> <input type="hidden" name="max_file_size" value="5632000"> <label for='file'>filename:</label> <input type="file" name="file" id="file" style="cursor: pointer;"> <input class="button" style="margin-top: 12px;" type="subm

java - Problems while displaying path between two points in google maps -

this problem may sound little weird, whenever run app crashes , when change name of latlang variable in function private latlng getcurrentlocation(), starts working. when change anything(even in other file) crashes , have keep changing variable names keep running. sure of problem, related latlang variable. getapproxtimemaps.java public class getapproxtimemaps extends fragmentactivity { private static double destilatitude; private static double destilongitude; googlemap mmap; gmapv2direction md; latlng userlocation; latlng destination; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_get_approx_time_maps); if (android.os.build.version.sdk_int > 9) { strictmode.threadpolicy policy = new strictmode.threadpolicy.builder().permitall().build(); strictmode.setthreadpolicy(policy); } userlocation = getcurrentlocation();

bash - Merge two columns of a text file in Linux -

i have text file several columns of text , values. structure: car 38 dog 42 cat 89 car 23 ape 18 if column 1 has string, column 2 doesn't (or it's emptry string). , other way around: if column 1 empty, column 2 has string. in other words, "object" (car, cat, dog etc.) occurs in either column 1 or column 2, never both. i'm looking efficient way consolidate column 1 , 2 file looks instead: car 38 dog 42 cat 89 car 23 ape 18 i can in bash script using while , if, i'm sure there simpler way of doing it. can help? cheers! z try this: column -t file output: car 38 dog 42 cat 89 car 23 ape 18

java - Hibernate Inconsistent generated Id -

i have main method sequentially call 2 web-services. first web service first insert data request table have primary key sequentially generated using hibernate. table have 1 status field initial status "received". first web service,process request , change status "processed". now main method call second web-service fetch request status "processed". calling main method sequential, second web-service call can have 1 entry in status "processed". after this, main method sleep 5 second , process repeat infinitely. when fetch record changing status "completed". also web-service's accessing db remotely. data consist 1 requestid(this not primary key). so problem when process continue 1 hour see there inconsistency in requestid send , receive. these id didn't match. , can see there multiple entries status remain processed . using hibernate id generator increment while testing system in multiple cluster faced uniqueconstraint e

Safe way to purge history - Mercurial -

i cloned project local directory , made lot of changes. current goal push changed code new branch in remote repository. , new branch merged default. my problem is, because of stupid effort in past few weeks try recover missing files, end few branch names don't want being shown in public. here's have: $hg branches dev-v02 197:xxxxx dev2 194:xxxxx dev 183:xxxxx qa 189:xxxxx $hg branch dev-v02 my question is, if push current branch dev-v02 remote repository "hg push --new-branch", , branch later merged default, unwanted branches show in history of default? , if so, there safe way purge them? not want discard changes. don't want unwanted branches showing in "hg branches" or "hg his" commands whoever later clones project remote repository. searched online , found "hg strip" couldn't tell article if remove changes i've made. thanks. edit: cloned local repository "hg clone -r 197 origin

c# - Google Geocoding API Licensing -

i'm building application , need coordinates based on address, i'm planning use google geocoding api. read in geocoding reference https://developers.google.com/maps/articles/geocodestrat may store data avoid exceed limit. however, application it's not map based, mean, has no map in application , need coordinates (latitude , longitude) fulfill own system store information within radius coordinates. could use google geocoding api purpose? allowed licensing? 10.1.1 (h) no use of content without google map. must not use or display content without corresponding google map, unless explicitly permitted in maps apis documentation. in event, must not use or display content on or in conjunction non-google map. for example, must not use geocodes obtained through service in conjunction non-google map. example, must not display street view imagery alongside non-google map, may display street view imagery without corresponding google map because maps apis documentat

CKEditor Turn Off Advanced Content Filter -

i'm having difficulty deactivating advanced content filter (config.allowedcontent = true; dosen't seem work). i've tried i've read on forums, including clearing cache, , making external file. ckeditor 4.2.2 - allowedcontent = true not working i've added config.protectedsource.push lines, , work point. ckeditor still adds div tags , partially deletes other tags. i'm creating set of designed templates clients use, in end don't want ckeditor touch code @ all. here have in config.js. if can see did wrong, or knows of way make work, please stressed web guy. thanks, rusty ckeditor.editorconfig = function( config ) { config.toolbargroups = [ { name: 'document', groups: [ 'mode', 'document', 'doctools' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ] }, { name: 'insert'

smartface.io - Audio file works with smartface 4.3 -

i trying play audio mp3 file. works ios device emulator if export xcode gives error "no rule proccess file..." problem mp3? format support? or bug of smartface 4.3? can try build project after publishing ? http://www.dorukcoskun.com/audiotest.rar i can build project. maybe related xcode version ?

indexing - How to/ Where to delete/edit an index from MySql which prevents duplicates row -

i'm using sugarcrm , few weeks ago executed a query on mysql created index prevent duplicate rows. can see or find , edit or delete ? i'm not able remember exact query it's needed add more columns. using mysql few weeks. mysql error 1062: duplicate entry 'example-dyplicate' key 'idx_name' to see structure of table, including indexes, use: show create table tablename; you can delete index with: drop index indexname on tablename; there's no way edit index. if want change index, drop , add new index new columns want. however, can both in single query using alter table : alter table tablename drop index indexname add index indexname (col1, col2, ...);

php - mysqli no result from prepare statement? -

i have prepare statement user login. works fine, return 1 if login correct. after need user id , user name (from bd, think better put input direct session). but have no result in $rst["id"]; , $rst["user"]; what problem? $stmt = $mysqli_link->prepare("select id, user cadastro binary user = ? , binary senha = ?"); $stmt->bind_param('ss', $user, $senha); $stmt->execute(); $stmt->store_result(); $num = $stmt->num_rows; if($num > 0) { //retorna os dados banco $rst = $stmt->fetch(); $id = $rst["id"]; $user = $rst["user"]; $sessionid = md5(time()); echo"$user - $id - $sessionid"; } ?> thank you! you need use $rst = $stmt->fetch_assoc . $stmt->fetch() used after using $stmt->bind_result() , fetches results variables named in call. note

css - Pelican on S3: theme not rendering properly -

i've installed pelican in virtual environment following instructions in http://docs.getpelican.com/en/3.5.0/quickstart.html#installation . running make html , make serve produce expected result on localhost:8000 : content , theme rendered expected. there warning local server however: warning:root:unable find file /favicon.ico/index.html or variations. i run make s3_upload , without --guess-mime-type option. in either case make sure css files in s3 bucket have right mime type (text/plain) css files must have text/css mime-type : done: processed 1 article(s), 0 draft(s) , 0 page(s) in 0.35 seconds. s3cmd sync /home/theuser/virtualenvs/pelican/theblog/output/ s3://theuser.com --acl-public --delete-removed --guess-mime-type files upload s3 blog isn't rendered (apparently css directives aren't recognized). did not add inline css in test markdown document. why isn't blog rendering s3? should looking error logs? thanks. edit: i ran blog through http

python - Using gspread with proxy -

i trying access google spreadsheets through gspread api in python. have imported gspread . getting socket. error: [errno 10061] no connection made because target machine actively refused it @ gc = gspread.login('pan*******@gmail.com', '********') here code: import urllib2 import urllib import gspread pil import image pil import imagedraw pil import imagefont w = 420 gc = gspread.login('pan******@gmail.com', '*******') wks = gc.open("spreadsheet").sheet1 i have checked username , password correct. have added 2 environment variables 'http_proxy':'host:port' , 'https_proxy':'host:port' doing wrong? thank you. for might have problem, found out gspread library doesn't support proxy connections. ran through normal connection , worked.

how to import .mysql file into the MySQL database? -

i have import data file news120m_stanford_lemma_np_pruned.mysql new database on mysql 5.5 getting error : mysql> mysql -u username -p -h localhost jobim_stanf < c:\program files\mysql\mysql server 5.5\data\jobim_stanf.mysql error: unknown command '\p'. error: unknown command '\m'. error: unknown command '\m'. what correct command importing such file? the command correct : mysql -u {username} -p {databasename} < file_name.sql the problem spaces in path of sql file. you'll have add quotation marks "" around : mysql -u username -p -h localhost jobim_stanf < "c:\program files\mysql\mysql server 5.5\data\jobim_stanf.mysql"

Python's AttributeError: 'module' object has no attribute 'require_version' -

i using python3.4 . trying open application supposedly uses python , can't seem working. receive following error: traceback (most recent call last): file "pychess", line 24, in <module> gi.require_version("gtk", "3.0") attributeerror: 'module' object has no attribute 'require_version'

ruby - Parsing a heredoc with Nokogiri -

i have ruby method uses nokogiri parse heredoc. looks , passes specs: def html_headers nokogiri::xml::documentfragment.parse(<<-html) .... html end however, when change following, fails specs. i'm new ruby, i'm not sure how might change result. tests in console suggest shouldn't change anything, str should contain equivalent string previous version of method. def html_headers str = <<-html ... html nokogiri::xml::documentfragment.parse(str) end rather deleting question, i'll leave record of shame. original code actually def html_headers nokogiri::xml::documentfragment.parse(<<-html) <div>...</div> html end and code failing was def html_headers str = <<-html <div>...</div> html nokogiri::xml::documentfragment.parse(str) end i thought indenting heredoc bring inline rest of method wouldn't have effect. silly me.

java - Why isn't my background image being displayed in FXML -

Image
i decided wanted start learning fxml , first thing wanted create background image. i've added background images in javafx before , thought process of adding background images in fxml similar in javafx. missing? here fxml file <?xml version="1.0" encoding="utf-8"?> <?import java.lang.*?> <?import java.util.*?> <?import javafx.scene.image.*?> <?import javafx.scene.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <vbox fx:id="menu" spacing = "20" alignment="top_center" xmlns:fx="http://javafx.com/fxml/1" fx:controller="millionairetriviagame.menulayoutfxmlcontroller"> <stackpane> <imageview> <image> <image url="@imagefiles/bluebackgroundcolor.jpg" /> </image> </imageview> </stackpane> </vbox> my main class in javafx public class millionair

html - One img aligned on the left, and one on the center, both vertically aligned, inside same div -

i struggling aligning 2 imgs in same div. want 1 aligned on left, , other in center. suggestion? div { background: red; text-align: center; } div img{ vertical-align: middle; } .left { float:left; } <div> <img src="//placehold.it/50x50" class="left" /> <img src="//placehold.it/50x50" /> </div>

matrix - Diagonalization of symmetric matrices in julia yields strange results -

i understand going on program in julia. issue following: have symmetric non-negative matrix diagonalize using egvals, egvecs = eig(h_mat) by theorem, matrix should have maximum eigenvalue associated non-negative eigenvector. h_mat has further trick, first column , row has entry filled zeros. diagonalization yields maximum positive eigenvalue e_max, in fact last eigenvalue because julia arranges eigenvalues in order biggest, eigenvector associated e_max not have entries 0 or positive (i.e. have negative entries) egvecs[:,end] # or several components ii, egvecs[ii,end]<0 this matrix don't proper results, instance: [0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 2.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0 0.0 0.0 1.414213562373095 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 3.0 0.0 0.0 1.7320508075688774 0.0 0.0 0.0 0.0 0.0 1.7320508075688774 0.0

asp.net mvc 4 - Splitting an Existing MVC4 app into Areas -

we have mvc4 app picking significant new features. split project areas in order separate new functional areas old ones. steps know are: create area (right-click on project -> add -> area) drag models, controllers, , views didn't come microsoft out of "root" area & appropriate folders within new area. create additional areas other major features want add. what else needs done here? i'm guessing both routeconfig.cs , various arearegistration.cs files need changes, if want redirect actions of controllers still residing @ root level. thanks, b

android studio - TTS Task Option -

i have activity signals service (intentservice) various operations. activity might stop running service carries on until data processed. @ various points, service needs tts speak. service cannot tts speak initialization intentservice , cannot safely register listeners task needs written. my question is, form should new task take? needs to: process tts speak requests service do tts.shutdown release tts resources when nothing remains done safely register tts oninit listener the first 2 requirements indicate task should have message handler. one option can think of use thread. not sure if thread can support handler , not know how run() method should handled. i relatively new android. have programed thread, intentservice , activities in project, unsure go these requirements. i wrote bound service gets messages intentservice. achieves requirements without message handler.

r - Non-equidistant axis labels -

Image
does know how adjust labels in base plot not equidistant? have tick marks @ different distance each other , want labels center between these. axis function's hadj argument takes 1 value. just question has spelled-out answer (albeit different 1 suggested in comments): ticks <- c(0, 1, 3, 6, 10) labels <- c("one", "two", "three", "four") # 1 fewer ticks label.positions <- ticks[-1] - diff(ticks) / 2 plot(1:10, 1:10, xlim=c(-1, 11), axes=false, ann=false) axis(1, at=ticks, labels=false) axis(1, at=label.positions, labels=labels, tick=false)

c - Why does this dynamic allocation of type char** and char* using malloc segfault? -

i don't understand why code segmentation faults. can work if define char** inside of function, allocate char**, point *commandsarray @ char**. can explain not understanding? in advance. #include <stdio.h> #include <stdlib.h> #include <string.h> void input_str_to_sngl_commands( char*** commandsarray ); int main() { char** commandsarray_var; input_str_to_sngl_commands( &commandsarray_var ); return 0; } void input_str_to_sngl_commands( char*** commandsarray ) { *commandsarray = (char**) malloc(2*sizeof(char**)); *commandsarray[0] = (char*) malloc(30*sizeof(char)); *commandsarray[1] = (char*)malloc(30*sizeof(char)); } you got precedence wrong: [] has higher precedence * , *commandsarray[1] accesses wrong address. use parentheses force evaluation order, this *commandsarray = malloc(2*sizeof(char*)); (*commandsarray)[0] = malloc(30*sizeof(char)); (*commandsarray)[1] = malloc(30*sizeof(char)); or use temporary variable

html - Align text next to an image that has "top" set -

my first question is: why isn't this working? the text should in middle of image, not in bottom, since used vertical-align: middle; . there should space between image , top, since used top: 10%; . .card { text-align: right; background-color: blue; color: white; } .card .inline-container { display: inline-block; vertical-align: middle; } .card #person-photo { display: inline-block; } .card .photo{ top: 10%; } .card #person-photo, .card #details { position: relative; } <div class="card" dir="rtl"> <div id="person-photo"> <img src="http://tinyurl.com/mwy4v3h" class="photo"/> </div> <div class="inline-container"> <div id="details">hello</div> </div> </div> and second question how to: make text near image (to left of it), vertically aligned middle of image w

Java Error after program runs -

my program want do, after it's done running error pops up. looking through code cannot find error occurs. exception in thread "main" java.lang.illegalstateexception: scanner closed @ java.util.scanner.ensureopen(scanner.java:1070) @ java.util.scanner.next(scanner.java:1465) @ java.util.scanner.nextint(scanner.java:2117) @ java.util.scanner.nextint(scanner.java:2076) @ simplestatistics.simplestatistics.main(simplestatistics.java:102) input -> java result: 1 package simplestatistics; import java.util.*; import java.lang.*; import java.util.inputmismatchexception; public class simplestatistics { public static double[] getuserinput(scanner sc) { list<double> inputlist = new arraylist<double>(); system.out.println("please enter how many numbers inputing"); int numberofinputs = sc.nextint(); (int = 0; < numberofinputs; i++) { system.out.println("please enter number"); double userinput =

Is it possible navigate to a certain screen after open a push notification toast on windows phone app? -

i´m doing app push notifications on mfp 7 , want open screen specific information after tap on toast push notification, have found information don´t know how pass parameters of screen , others need. i´m using http adapter send notifications if you're using event source notifications send specialized parameter payload , check value app loading (or when push displayed, doesn't matter). then, change specific page content based on payload value. for example, here i'm sending payload "foo" value "bar": wl.server.notifyalldevices(usersubscription, { badge: 1, sound: "sound.mp3", activatebuttonlabel: "clickme", alert: notificationtext, payload: { foo : 'bar'     } }); and in app logic check value: function pushnotificationreceived(props, payload) {     if (payload.foo == "bar") { // change page, etc , display message     }   } you can use tag-based no

Scheme function that returns the index of the first location where an element occurs in the list -

this question has answer here: how find index of element in list in racket? 3 answers the last line of code should returns index of first location atm occurs in list. example (list-memeber? 9 '(4 9 3 6 8)) should return 2, gives me length + 1. length + 1 should work when atm doesn't occur in list. how that? (define (list-length l) (if (null? l) 0 (+ 1 (list-length (cdr l))))) (define (list-memeber? atm lst) (cond ((null? lst) '() ) ;returns null if list empty (this part works fine) ((not (eq? atm (car lst))) (+ 1 (list-length lst))) ;if atm not occur in list, function returns length + 1 ((this works fine) ((eq? atm (car lst)) 1) ;if fisrt element equals atm, function returns location 1 (this works fine) (else (+ 1 (list-memeber? atm (cdr lst)))))) ;here i'm having problem. should ret

ruby - How can Enumerator stop in the middle of method execution? -

(example ruby tapas episode. 59) @names = %w[ylva brighid shifra yesamin] def names yield @names.shift yield @names.shift yield @names.shift yield @names.shift end enum = to_enum(:names) enum.next # => ylva @names # => ["brighid", "shifra", "yesamin"] names method execution seems stop after first line. if names executed entirely, @names should become empty. how can magic (= calling method partially) happen? it working expected. on invocation enum.next calls first line in names method , yields caller, i.e. stops flow of execution of names method @ point. on next invocation enum.next flow of execution picked point left off. ruby has object called fiber might demonstrate more succinctly: http://apidock.com/ruby/fiber allow 'pause execution' @ arbitrary point in program calling fiber.yield , resume left off @ later time. for example, example above: @names = %w[ylva brighid shifra yesamin] fiber = fiber.n

javascript - Merge Multiple Canvases and Download as Image -

i'm attempting merge 2 html canvases single canvas , download image. code below: function downloadcanvas() { var bottlecanvas = document.getelementbyid('bottlecanvas'); var designcanvas = document.getelementbyid('editorcanvas'); var bottlecontext = bottlecanvas.getcontext('2d'); bottlecontext.drawimage(designcanvas, 69, 50); var dataurl = bottlecanvas.todataurl("image/png"); var link = document.createelement('a'); link.download = "bottle-design.png"; link.href = bottlecanvas.todataurl("image/png").replace("image/png", "image/octet-stream"); link.click(); } my problem here seems following line: bottlecontext.drawimage(designcanvas, 69, 50); this supposed draw contents of 1 canvas onto other, does, prevents latter part of code running , downloading image. when remove particular line download function works fine, unfortunately downloads 1 of canvases. m

Can a Python class differentiate input types? -

for example in python class can have 2 different add methods can detect whether adding object integer, or object object, or object , string, etc? yes, can use isinstance check if object of particular type.

How to redirect to another wiki page in GitHub flavored Markdown? -

i create alias pages on github wiki. there similar wikipedia feature redirects wp:r , wp:rdr wikipedia:redirect page?

HTML/javascript page jumping to different div -

i have simple nav menu page toggles pages when clicked. i'm having issue when selecting menu content seems retain hover attributes. when hovering content , clicking or anywhere on page jumps 'pg11' 2.3 events div. when performing example on page @ bottom clicking try me button completing alert messages again jumps 'pg11' 2.3 events div. solutions problem? i've included content 1.1 variables click item view problems. thanks <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>final project</title> <style type="text/css"> body { } .nav { list-style-type:none; padding-left:0px; padding-right:0px; text-align:center; } .nav li { float:left; width:450px; border:solid 1px black; margin-right:-1px; } .nav { text-decoration:none; display:block; color: black; } .submenu { display:none; list-style-type:none; padding-left:0px; padding-right:0