Posts

Showing posts from May, 2011

Automatically connect signals to custom Django model fields -

i've created custom image field django automatically creates thumbnails , other stuff. from django.db.models.fields.files import imagefieldfile class imagewiththumbsfieldfile(imagefieldfile): def __init__(self, *args, **kwargs): ... now automatically connect post_delete signal whenever such field defined in model. know how connect post_delete signal manually when model defined. there way automatically whenever custom field used? you can in contribute_to_class() method: class imagewiththumbsfieldfile(imagefieldfile): ... def contribute_to_class(self, cls, name, **kwargs): super(imagewiththumbsfieldfile, self).contribute_to_class( cls, name, **kwargs) post_delete.connect(on_delete_callback, sender=cls)

Issue with GMail - Wrapping up Html email with unwanted PRE tag -

i trying send html email gmail. gmail internally wrapping html of email pre tag. for ex: email contains below html <html> <body> <table> <tr> <td> test 1 </td> <tr> </table> <table> <tr> <td> test 2 </td> <tr> </table> </body> but gmail translates html in different way shown below <pre><table> <tr> <td> test 1 </td> <tr> </table> <table> <tr> <td> test 2 </td> <tr> </table></pre> can me, how pre tag gets added in gmail? problem pre tag has got styles coming gmail breaks , feel of email. below css. .gs pre { white-space: pre-wrap; } also, there way override above css change value of 'white-space' 'initial' instead of 'pre-wrap'? if possible, issue resolved.

algorithm - Maximum sum by splitting given string -

given string s consisting of digits. need divide string 4 integers such sum maximum. how can solved ? please help note : each integer should ≤ 10^12 , should not contain leading zeroes. also size of each string can 20. example : let s=52310 answer 56 4 integers 52,3,1,0. maximum sum 56 (52 + 3 + 1 + 0). how can done efficiently don't want go brute solution because of high complexity splitting @ each available 4 positions lead ineffective approach. try , in java private void method() { string value = "52310"; string sortedstring ; int stringlength; long total = 0; char[] arr = value.tochararray(); list<string> seperatedintegers = new arraylist<string>(); if(arr.length > 3) { sortedstring = sort(arr); stringlength = sortedstring.length(); for(int m = 0 ; m < 3 ; m ++) { seperatedintegers.add(sortedstring.substring(stringlength - 1, stringlength));

css - Is there any way to make checkbox browser independent? -

is possible make checkboxs plain , consistent across browsers. means don't want browsers apply native style checkbox element. also don't want use plugin replaces checkbox image , stuff. is possible achieve overriding default css or something? if understand right , can mimic checkbox this: jsfiddle example here i'm using font awesome present v symbol inside checkbox when checked. first of hide real checkbox, define label , associate our checkbox using for="simplecheckbox" attribute of label, need in order able click on label focus , send real checkbox checked , using :before pseudo-element define our custom looking checkbox . html: <div class="visual-checkbox-container"> <input type="checkbox" class="simple-checkbox" name="simplecheckbox" id="simplecheckbox" /> <label class="visual-checkbox" for="simplecheckbox"> check m

How to call JSON filesystem structure in HTML file and javascript -

i have following json file. wondering how can call files in html file specially there documents in documents. { "d_type": "directory", "name": ".", "size": 1020, "subdirectory": [ { "d_type": "file", "name": ".ds_store", "size": 15364 }, { "d_type": "file", "name": "animation.py", "size": 928 }, { "d_type": "file", "name": "cat.png", "size": 12574 }, { "d_type": "file", "name": "courses.json", "size": 714 }, { "d_type": "file", "name": "courses.py", "size": 827 }, { "d_type": "file", "name": "courses.xlsx", "size": 37894 }, { "d_type": "file",

Database Page Cache Error in Windows 8 -

following error comes in windows 8 machine, because of times machine restarted, how can fix issue. svchost (1348) srujet: database page read file "c:\windows\system32\sru\srudb.dat" @ offset 606208 (0x0000000000094000) (database page 147 (0x93)) 4096 (0x00001000) bytes failed verification due page checksum mismatch. stored checksum [0000000000000000] , computed checksum [000000932ef3cde9]. read operation fail error -1018 (0xfffffc06). if condition persists please restore database previous backup. problem due faulty hardware. please contact hardware vendor further assistance diagnosing problem.

java - Securing a jsp page -

i developing web application in jsp. in application here page direction flow-> page -> page b -> page c final page c should seen if user visits b , b can seen if user visits a. how make possible in jsp. should use session-cookie or there other way? new in servlet. ideas or links helpful me. nb: if cookie generated can request c page cookie in headers . how make more secure? there many ways tell if user visited page a, and/or b. if want reinforce security of current system, recommend using hashing algorithm, such sha256 or md5, , hash user's ip address before storing it, , hashing user's ip address next time visit. also if have php server set up, can use store weather user has visited page yet, either via database, or file containing ip addresses. another way can put of html in 1 file, , use javascript swap them out, , have full control of page user sees first. think of option settings app of phone; has list of buttons, each of bring page, o

ssh - BitBucket - Git - Permission denied (publickey) -

first of all, know have read thoroughly 20+ posts on topic. however, still not working after 2 days, so... give , acknowledge cannot set ssh connection... ok, painful enough. here did (at least 3 times) : i generate set of ssh keys command : ssh-keygen -t rsa here permissions both .ssh folder , rsa keys : $ ls -al | grep .ssh drwx------ 2 local local 4096 mars 28 11:17 .ssh $ ls -al .ssh/ -rw-r--r-- 1 local local 802 mars 11 17:11 authorized_keys -rw-r--r-- 1 local local 61 mars 28 11:17 config -rw------- 1 local local 1675 mars 28 11:14 id_rsa -rw------- 1 local local 396 mars 28 11:14 id_rsa.pub -rw------- 1 local local 1326 mars 25 17:38 known_hosts i copied content of id_rsa_.pub bitbucket account. sure done flawlessly, triple checked. i edited .ssh/config looks : $ cat .ssh/config host bitbucket.org identityfile /home/local/.ssh/id_rsa.pub and here output of ssh -v git@bitbucket.org : $ ssh -v git@bitbucket.org

How my react js code can interact with existing Obj-C logic? -

i have existing obj-c project rich business logic. wanna try using react native on particular screen (i mean view controller in terms of cocoa), every example see in repo contains logic in javascript. how can treat react native rendering, pass user actions objective-c code? edit 31 march 2015: native view module not seem solution, because native modules instanciated react code. if want use created view model view controller, need have singleton, shared state on side. think bad. it's not possible react views call native methods directly without going through javascript, unless create custom native view plugins literally onscreen. your best bet create custom native module exports native methods want call, write minimal react javascript application nothing except forward touch events views module calling methods. if need communicate js application, module can either use callbacks passed exported methods, or broadcast events js code can observe. to out of react n

File input output read text file c++ -

my task write program reads text file, prints statistical results contents output file. start asking user input name of input file, , input name of output file. input file can file containing plain text. want read contents of input file, , print output file following information contents of input file. using ms visual studio assignment , don't know if doing right far think have create .cpp input text file , 1 .cpp output file , 1 execution. kinda lost on creating , using text files too. here got: #include <iostream> #include <fstream> #include <cctype> #include <cstring> using namespace std; int main() { char filename[100]; // string filenames ifstream input; // file input stream ofstream output; // file output stream { input.clear(); // clear status flags in stream cout << "please enter name of input file.\n"; cout << "filename: "; cin >&g

objective c - Simultaneous iAD's results in only one getting served -

i seem have peculiar problem, follows. have 2 views in ios app 1) tableviewcontroller view table , click on particular row of table land me in new uiview. using iad serve banner ads on 2 views. now problem : iad not serving ads on second view after had served on landing table view. if disable ads on first view i.e table view controller can see ads being served on second page i.e uiview. i have checked these against admob , found above doesn't seem happen them. any appreciated !

assembly - Store Strings in MIPS -

i short. i making program in mips intake strings of 15 chars user. unable save string on stack. note using 2d matrix [20][15] 20 string , each string have 15 character. please guide me. have been trying on past 10 hours. loop: bgt $t2,20,xyz li $v0,8 #take in input la $a0, buffer #load byte space address li $a1, 15 # allot byte space string syscall move $t3,$a0 #save string t0 #transfering data onto stack! #num = $t2 #$base address of matrix = $t1 #colums of matrix = 15 mul $s0,$t2,15 #num * colums li $s1,4 #string have 4 bit! mul $s0,$s0,$s1 add $s0,$s0,$t1 #$t1 base address! #storing data onto stack! sw $t3,0($s0) add $t2,$t2,1 add $s0,$s0,-15 j loop you're storing address of string on stack, not string itself t3 set by: la $a0, buffer #load byte space address move $t3,$a0 #save string t0 storing instruction: sw $t3,0($s0) this next instruction assumes 15 bytes written: add $s0,$s0,-15 you wrote

ruby - Sorting/accessing through an array of nested hashes -

i have array of hashes names , ages: array = [ {"bill" => 12}, {"tom" => 13}, {"pat" => 14} ] i realize that, calling first method, happens: array.first # => {"bill" => 12} without defining class, i'd do: array.first.name # => "bill" how can that? doing: def name array[0].keys end will define private method, can't called on receiver. since array array consists of hashes, when array.first hash returned {"bill" => 12} . you can define method hash#name can applied array.first (a hash) here: class hash def name self.keys.first end end array.first.name # => "bill" #to print names array.each{|a| puts a.name} # bill # tom # pat # or collect them in array array.map(&:name) # => ["bill", "tom", "pat"]

migrate to git from svn -

i want migrate svn server git , move git. my svn repository contain several folder each 1 contain difference project. i cloned svn repository git using git svn tried split each of folders difference branch using command: git subtree split -p name-of-folder -b name-of-new-branch. the problem in part of history mvoed 1 of folder other location , history in git repository keeped position. i can not see history after run git svn clone my svn layout this: svnrepo/ foldera/ projecta files(.sln,.cpp) folderb/ projectb files(.java) folder/ folderc/ folderc files(.cs) folderd/ folderd files(.cs) i want branch folder branch folderb branch folderc , branch folderd. edit: in point of project moved folderc , folderd this: folder/ web/ folderc/ folderc files(.cs) folderd/ folderd files(.cs) then when try clone url of folderc history point moved folderc web although th

in app purchase - Persisting a Receipt in iCloud using CloudKit in iOS -

#1 i'm developing ios app non-renewing subscription in it. want make subscription available on of user’s devices , let users restore purchase. as said in apple's docs: for non-renewing subscriptions, use icloud or own server keep persistent record. i not use own server because app available ios now. icloud seems easer solution. after watching , reading lot of wwdc videos , docs icloud seems best solution me cloudkit because key-value storage limited 1mb , have big chances total data size bigger per 1 user (after year of different purchases ex.). question is: am right far? #2 i'm using rmstore library purchases. said in docs rmstore doesn't have reference implementation of transaction persistence icloud , couldn't find examples in internet i'll have own scratch. the first problem staring me in face is: what if there problem syncing receipt icloud after user has purchased subscription? example: user bought subscription, got error synci

c++ - Return class instance from class -

i have code, want fill vector of strings class class { public: b foo(const string & name) const; } class b { public: void add(const string & name); vector<string> list; } void b::add(const string & name) { list.push_back(name); } b a::foo(const string & name) const { b tmp; tmp.add(name); return tmp; } i know doesnt work because tmp gets destructed, dont know how fix it, should return pointer tmp in foo()? i know doesnt work because tmp gets destructed it's destroyed after it's copied give function's return value, there's no problem there. there problem if returned pointer or reference local variable; you're not doing that. i dont know how fix it it's not broken, there's nothing fix. should return pointer tmp no, introduce problem you're thinking of. returning value avoids problem.

mysql - How to automate backups in mysqldump from one server to an external disk -

i need in configuring mysqldump in order automatically download backups 1 server external disk in fixed time (everyday @ 6:00 pm). if mysqldump unable that, can suggest software? you can use operating system's scheduler automatically run mysqldump command @ desired times, e.g. cron on linux , task scheduler on windows. to have mysqldump write external disk, can mount disk destination path reachable mysqldump , use in output path. specify output path, can either use > redirection or --result-file option. both approaches work on linux/unix distinction important windows redirection won't work using powershell. because redirection on powershell produces utf-16 using redirection cannot read. --result-file option provide ascii output can read. windows examples c:\> mysqldump.exe –e –u[username] -p[password] -h[hostname] [dbname] > [c:\path\to\mybackup.sql] c:\> mysqldump.exe –e –u[username] -p[password] -h[hostname] [dbname] --result-file [c:

Can't automatically run simple Go web server with Docker container (func (*Template) Execute) -

so trying automatically run simple "hello world" web server in docker container on coreos. error when app tries exectute html template. here offending code: func gatehandler(w http.responsewriter, r *http.request) { fmt.println("entered gatehandler.") t, _ := template.parsefiles("templates/helloworld.html") fmt.println("passed parsefiles.") err := t.execute(w, nil) fmt.println("passed execute statement.") if err != nil { fmt.println(err) } } here dockerfile: from ubuntu:14.04 run mkdir app add assets /app/assets add templates /app/templates add web /app/web env port 80 expose 80 entrypoint ["/app/web"] when run docker container , navigate appropriate url in browser, see following error: entered gatehandler. passed parsefiles. 2015/03/28 00:10:53 http: panic serving 10.0.2.2:56292: runtime error: invalid memory address or nil pointer dereference goroutine 5 [running]: net/htt

angularjs - Getting the subject line in gmail api - javascript -

i'm trying subject line email using gmail api. have email , tried following documentation. array of headers place holder subject line different in each email. how can subject header back? right i'm specifying element in array so: var parsed5 = resp.payload.headers[1].name; however don't want have specify element of area, there way right stuff based on header name instead of element? you can find subject : for (var headerindex = 0; headerindex < resp.payload.headers.length; headerindex++) { if (resp.payload.headers[headerindex].name == 'subject') { relatemaildetail.openmailsubject = msg.payload.headers[headerindex].value; } if (resp.payload.headers[headerindex].name == 'from') { relatemaildetail.from = msg.payload.headers[headerindex].value; } if (resp.payload.headers[headerindex].name == 'date') {

Random list, SecretPhrase Java Project -

my school project requires me modify last assignment (code below) pull random phrase list of @ least 10 user guess. drawing blank on this. appreciated. understand have add class import text file or list, need modify loop in order randomly select? import java.util.scanner; // allows user read different value types public class secretphrase { string phrase; // scanner scan = new scanner(system.in); secretphrase(string phrase){ this.phrase = phrase.tolowercase(); } public static void main(string args[]){ secretphrase start = new secretphrase("java great"); // phrase user have identify start.go(); // starts program } void go(){ string guess; string word=""; string[] words = new string[phrase.length()]; // array store charachters arraylist<string> lettersguessed = new arraylist(); for(int i=0;i<phrase.length();i++){ if(phrase.charat(i)=

php - I want to select same word from database. table -

i want select same words database database name: username ==================================================== | id | name | fathername | ip | datetime | | 1 | ali | imran |192.168.1.1 | 12-12-2015| | 2 | asd | hafiz |142.150.8.9 | 12-12-2015| | 3 | sef | warya |100.178.3.7 | 12-12-2015| | 4 | qasim | zaheer |192.168.1.1 | 12-12-2015| | 5 | zulfi | zahid |192.168.1.1 | 12-12-2015| | 6 | jamel | hasan |192.168.1.1 | 12-12-2015| | 7 | wasif | junaid |192.168.1.1 | 12-12-2015| ==================================================== when use counter (select count(*) number from...... ) result echo ( 7 ) wanna select same ip 1 ip. (id: 1,4,5,6,7) 5 same ip wanna show 5 same ip 1 ip total record-3 select count(*) `username` group `ip`; or select distinct(`ip`) `username`; or select count(*) `username` `ip` in (select distinct(`ip`) `username`) ;

ruby - NoMethodError: undefined method `ActiveSupport' in rails test file -

i upgraded ruby & rails today (2.2.0, 4.2.1). in `app/test/models/user_test.rb' require 'test_helper' class usertest < activesupport:testcase test 'the truth' assert false end end i ran rake db:test:prepare rake test . rake aborted! nomethoderror: undefined method `activesupport' main:object /users/quantum/sonar/app/test/models/user_test.rb:3:in `<top (required)>' brand new rails project. missing? app/test/testhelper: env['rails_env'] ||= 'test' require file.expand_path('../../config/environment', __file__) require 'rails/test_help' class activesupport::testcase # setup fixtures in test/fixtures/*.yml tests in alphabetical order. fixtures :all # add more helper methods used tests here... end try command. hope helps. rake db:migrate rails_env=test

image - stationary wavelet transform (MATLAB) -

anyone please explain being done following code. code performs image fusion using stationary wavelet transform. %image decomposition using discrete stationary wavelet transform [a1l1,h1l1,v1l1,d1l1] = swt2(im1,1,'sym2'); [a2l1,h2l1,v2l1,d2l1] = swt2(im2,1,'sym2'); [a1l2,h1l2,v1l2,d1l2] = swt2(a1l1,1,'sym2'); [a2l2,h2l2,v2l2,d2l2] = swt2(a2l1,1,'sym2'); % fusion @ level2 afl2 = 0.5*(a1l2+a2l2); **what these equations ?** d = (abs(h1l2)-abs(h2l2))>=0; hfl2 = d.*h1l2 + (~d).*h2l2; d = (abs(v1l2)-abs(v2l2))>=0; vfl2 = d.*v1l2 + (~d).*v2l2; d = (abs(d1l2)-abs(d2l2))>=0; dfl2 = d.*d1l2 + (~d).*d2l2; % fusion @ level1 d = (abs(h1l1)-abs(h2l1))>=0; hfl1 = d.*h1l1 + (~d).*h2l1; d = (abs(v1l1)-abs(v2l1))>=0; vfl1 = d.*v1l1 + (~d).*v2l1; d = (abs(d1l1)-abs(d2l1))>=0; dfl1 = d.*d1l1 + (~d).*d2l1; % fused image afl1 = iswt2(afl2,hfl2,vfl2,dfl2,'sym2'); imf = iswt2(afl1,hfl1,vfl1,dfl1,'sym2');

Erlang Binary Split -

i need split binary so <<"one|two|three|four|five">> into [<<"one">>,<<"two">>,<<"three">>,<<"four">>,<<"five">>] i'm there binary:split(<<"one|two|three|four|five">>, <<"|">>, []). but need make scope global split entire binary , not first item. answer staring me in face here http://www.erlang.org/doc/man/binary.html#split-3 i'm having trouble working out documentation how specify scope global? as usual, blindingly obvious once have worked out: binary:split(<<"one|two|three|four|five">>, <<"|">>, [global]).

apache - Redirect subdomains to different paths while using separate SSL certificates -

i have website several different subdomains, , want have parts of site higher levels of security others. such admin areas. know can create many certificates want. issue having whatever subdomain listed first, it's documentroot applied other subdomains redirecting https:// . here code in httpd-vhosts.conf : # http configuration <virtualhost *:80> servername account.example.com rewriteengine on rewritecond %{https} !=on rewriterule (.*) https://%{http_host}%{request_uri} documentroot "/applications/mamp/htdocs/website/account" </virtualhost> # ssl configuration <virtualhost *:443> servername account.example.com sslengine on sslcertificatefile /applications/mamp/conf/apache/account.crt sslcertificatekeyfile /applications/mamp/conf/apache/account.key documentroot "/applications/mamp/htdocs/website/account" </virtualhost> #secure

perl - how to expand the file based on the numbers which have given in the input file? -

i have 1 input file mod_glcnhglycan 264-268 dtsgt i have output follow mod_glcnhglycan 264 d mod_glcnhglycan 265 t mod_glcnhglycan 266 s mod_glcnhglycan 267 g mod_glcnhglycan 268 t my $str = 'mod_glcnhglycan 264-268 dtsgt'; ($name, $range, $chars) = split ' ', $str; ($start, $end) = split '-', $range; @chars_arr = split '', $chars; @results = (); foreach $char ( @chars_arr ) { push @results, $name, ' ', $start++, ' ', $char; } results in array containing: mod_glcnhglycan 264 d mod_glcnhglycan 265 t mod_glcnhglycan 266 s mod_glcnhglycan 267 g mod_glcnhglycan 268 t

php - Sending pdf attachment with form using mail() function -

i trying send pdf attachment php mail() function. not getting how can it. message field in form user editable html editor. without attachment works fine. here code <?php include("../connect.php"); include("../admin_auth.php"); ?> <?php if($_post['submit'] == "submit") { $sql = mysql_query("select email users username='admin'"); $row = mysql_fetch_array($sql); $email = $row['email']; $path = $row['path']; $messagealert = "email send successfully!!"; $to = $_post['email']; $from = $email; $headers = "from: " . strip_tags($from) . "\r\n"; $headers .= "reply-to: ". strip_tags($from) . "\r\n"; if($_post['type'] == 2) { $headers .= "mime-version: 1.0\r\n"; $headers .= "content-type: text/html; charset=iso-8859-1\r\n"; } mail($to, $_post['subject'],

Python 2.7: read from stdin without prompting -

i'm trying make arduino yun alarm system. needs make requests web server update stats. needs monitor button , motion sensor. linux side running python script make web requests. need have arduino send status python script. in python script, need read arduino side. can print raw_input() , want read if there available, don't want block if nothing available. example: import time while 1: print "test" time.sleep(3) print raw_input() time.sleep(3) if run it, want print: test (6 seconds later) test instead of test (infinite wait until type in) i've tried threads, they're little hard use. simple solution waits single line of data. uses file-like sys.stdin object. import sys while true: print "pre" sys.stdin.readline() print "post"

c# - How to connect to base from sub domain? SQLiteConnector, connectionString -

my web site c# asp.net , sqlite. in main domeine www. mysite. com work fine in web.config... <connectionstrings> <add name="sqliteconnector" connectionstring="data source=|datadirectory|mybase.db3;" providername="system.data.sqlite"/> </connectionstrings> mybase.db3 in app_data folder. have web site in domain www. newsubdomain . mysite .com , don't know how make connecton base in main domeine www.mysite.com must put in web.config need more or else make connection? help!!! since web.config file common sites, can add multiple connection strings each sub domain : <connectionstrings> <add connectionstring="" name="subdomain1"/> <add connectionstring="" name="subdomain2"/> </connectionstrings> then can check current url using httpcontext.current.request.url.absoluteuri

laravel 5 - Heroku : Sync file from heroku to local -

this may stupid question, didn't find answer question. i in heroku bash : php artisan make:controller user/edit . it's there, in cloud, not in computer. please note not make:controller can anything. for example, pull databse easy, heroku db:pull . how pull file? i tried git pull , , already up-to-date. answer. i can't play files, , not awesome. thanks you can't, , that's intentional. see e.g. https://stackoverflow.com/a/28463836/162354 , https://stackoverflow.com/a/28083271/162354 answers same question. you run stuff php artisan make:controller user/edit on local computer, test there, , when stuff works, push up. that's correct workflow. heroku not development sandbox.

My server wont start,ruby on rails mac -

blockquote when try run bin/rails server,my server wont start display connection errors or whatever.i tried bundle exec rails server didnt work either. warning: you're using rubygems 2.0.14 spring. upgrade @ least rubygems 2.1.0 , run `gem pristine --all` better startup performance. => booting webrick => rails 4.2.1 application starting in development on http://localhost:3000 => run `rails server -h` more startup options => ctrl-c shutdown server exiting /users/i/blog/config/routes.rb:7:in `<top (required)>': undefined method `resources' main:object (nomethoderror) /library/ruby/gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load' /library/ruby/gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load' /library/ruby/gems/2.0.0/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency' /library/ruby/gems/2.0.0/gems/activesupp

Spring Liquibase tries to resolve file path to URL -

i configured liquibase this: @bean public springliquibase liquibase() { springliquibase liquibase = new springliquibase(); liquibase.setdatasource(getconfigureddatasouce()); liquibase.setchangelog("classpath*:config/liquibase/master.xml"); liquibase.setcontexts("development,test,production"); log.debug("configuring liquibase"); return liquibase; } my master.xml file: <includeall path="classpath*:/config/liquibase/changelog/" relativetochangelogfile="false"/> when run application on tomcat (7.0.50 , 8.0.20) prints exception: caused by: java.io.filenotfoundexception: class path resource [d:/proiecte/ale mele/rezervari/target/rezervari/web-inf/classes/config/liquibase/changelog/20150329182213.xml] cannot resolved url because not exist @ org.springframework.core.io.classpathresource.geturl(classpathresource.java:178) @ liquibase.integration.spring.springliquibase$springresourceopener.getresourc

How to process latex / tikz-timing diagrams in a PowerShell pipe? -

i have several tikz-timing diagrams compile wrapper latex file. wrapper uses latex package standalone produce pdf , png file. spare these wrapper files , replace them one. additionally, pipe list of filenames powershell function, processes each waveform tex file general wrapper file. i uploaded files gist. more in detail: waveform.tex wrapper tex file, has placeholder in \input{...} macro. placeholder replaced powershell script. \documentclass[convert={density=600,size=2000x800,outext=.png}]{standalone} \usepackage[utf8]{inputenc} % utf-8 tex file input incoding \usepackage[t1]{fontenc} % type1 font encoding \usepackage[ngerman]{babel} % new german writing rules; must loaded before microtype \usepackage{courier} % set courier font default teletype writer (texttt, ttfamily, ...) \usepackage[usenames,svgnames,table]{xcolor} % load colors , color-names \usepackage{pgf} % primitive dr

random - How to change timeInterval NSTimer in Swift -

i'm new swift, , i'm creating random generated game using nstimer used function timer https://github.com/yuzixun/swift-timer/tree/master/example my game working fine until got problem speeding game depending on player score using timer, can't change speed of game my gamescene class : let mygame = timer.repeat(after: 1) { //my generated game code here } mygame.start() mygame : function generate random object game every second using timer.repeat(after:1). let levelupdate = timer.repeat(after: 0.1) { //update game , verify player score if(self.score >= 1000 && self.score <= 2500){ // speedup time of game } } levelupdate : function update variable game , verify player score every 0.1 second. my objectif : able change timer of mygame if player reached more 1000 point , speedup mygame 0.8 second, , question possible change time interval of mygame? please need find way of speeding game player score. ok, have enough information answer

Python and Flask - Trying to have a function return a file content -

i struggling return file content user. have flask code receives txt file user, python function transform() called in order parse infile, both codes doing job. the issue happening when trying send (return) new file (outfile) user, flask code working ok. don´t know how have python transform function() "return" file content, have tested several options already. following more details: def transform(filename): open(os.path.join(app.config['upload_folder'],filename), "r") infile: open(os.path.join(app.config['upload_folder'], 'file_parsed_1st.txt'), "w") file_parsed_1st: p = ciscoconfparse(infile) ''' parsing file uploaded user , generating result in new file(file_parsed_1st.txt) working ok ''' open (os.path.join(app.config['upload_folder'], 'file_parsed_1st.txt'), "r") file_parsed_2nd

c# - How to publish a ASP.NET MVC project with separated DbContext -

i have these 5 projects: dataclass, datalayer, servicelayer, viewmodel, viewlayer. viewlayer project asp.net mvc project , it's project going published. my problem visual studio used detect dbcontext in datalayer , ask me connectionstring doesn't recognize anymore , i'm having problem (i've tried put connectionstring in web.config file in server didn't work.) so problem published project doesn't work since doesn't have connectionstring. how can publish project specifying it's connectionstring? p.s. i've tried putting connectionstring in viewlayer->properties->package/publish sql doesn't work either. p.s. 2 i've tried vs2013 community , vs2015 ultimate preview (the earliest version) you have set proper config transformation , update see below links https://msdn.microsoft.com/en-us/library/vstudio/dd465318(v=vs.100).aspx the following link has options setting connection string outside web config http://sedo

javascript - Regularly signed out when using firebase authWithPassword -

Image
i have phonegap app on ios using firebase authentication. logging in done so: var afterlogin = function(error, authdata) { if (error) { console.log(error); messenger.error(error.message); return; } $scope.loggedin = $auth.check(); $scope.$apply(); $sync.sync(); messenger.success('logged in'); }; $scope.dologin = function() { mixpanel.track('login'); if (!$scope.loginform.email && !$scope.loginform.password) { messenger.error('enter email , password tap login'); return; } else if (!$scope.loginform.email) { messenger.error('enter email tap login'); return; } else if (!$scope.loginform.password) { messenger.error('enter password tap login'); return; } ref.authwithpassword({ email : $scope.loginform.email, password : $scope.loginform.password }, afterlogin); } i check user's status this: ch