Posts

Showing posts from February, 2015

Is the order of messages sent by SignalR constant on the client? -

i have simple question regarding signalr, possible signalr messages arrive in out of sync order. i.e if send messages a,b,c server, possible client might messages in order other a,b,c? thank in advance! there isn't guaranteeing equal performance of delivery client assuming independent message calls. need consider handling on client side. of course if running server async have impact well.

determining the sum of top-left to bottom-right diagonal values in a matrix with Ruby? -

i have square matrix of indeterminate row & column length (assume rows , columns equal befits square). i've plotted out example matrix follows: matrix = [ [1, 2, 3], [4, 5, 6], [7, 8, 9] ] my goal sum top-left bottom-right of diagonal values. obviously in example, i'll need: diagsum = matrix[0][0]+matrix[1][1]+matrix[2][2] #=> 15 i see pattern it's +1 incremental each row & column argument in matrix, code i've developed matrix of indeterminate length (supplied argument method diagsum preferably need implement sort of row_count method on matrix argument. if arr = [[1,2,3], [4,5,6], [7,8,9]] then: require 'matrix' matrix[*arr].trace #=> 15

javascript - Swap an image without flicker while showing the new one immediately -

tl;dr: there way swap images reliably while showing whichever image being loaded @ time without causing page flicker? i have 2 images , 2 buttons , when hover on 1 button shows 1 image. hovering on other button swaps second image. doing this: $('#button1').mouseover(function() { $('#image').attr('src', 'image1.png'); }); $('#button2').mouseover(function() { $('#image').attr('src', 'image2.png'); }); this works fine when first image has loaded , second hasn't, doesn't show second image until has completed loading. try give user indication of when new image loading (which they're expecting appear immediately), forced add null image before these swaps, this: $('#button1').mouseover(function() { $('#image').attr('src', '#'); $('#image').attr('src', 'image1.png'); }); $('#button2').mouseover(function() { $('#image...

objective c - Trying to add an image to subfolder in 'Albums' of iPhone Photos app 'Connection to assetsd was interrupted or assetsd died' -

i trying create folder 'temp folder' under 'albums' in photos iphone app , add image/images 'temp folder'. when image added saw no warning in debug pane, once in while saw on the debug pane 'connection assetsd interrupted or assetsd died' , image did not save. using phphotolibrary this. if has same problems please let me know. make sure have enough memory free/open; delete (all?) many background tasks , try again. if error doesn't show up, you're go.

r - Prevent scan() from removing quotations or quotes -

i have folder full of xml files powerpoint content this: <?xml version="1.0" encoding="utf-8" standalone="yes"?> i hoping scan files , replace 1 of these items stringr , cat() file: a <- scan(file="slide10.xml.rels",what = "raw",sep = "@") b <- str_replace_all(a,pattern = "1.0",replacement = "2.0") cat(b,file="testcat.xml.rels") the problem is, everytime scan contents of file r, of quotation marks dissapear , lines like: <?xml version="1.0" encoding="utf-8" standalone="yes"?> turn into: <?xml version=1.0 encoding=utf-8 standalone=yes?> which breaks xml file. can scan() or have start using xml reader? thanks.

python - Template not rendering properly with if user.is_authenticated for Django -

i'm trying incorporate template tag/inclusion tag sidebar site. main section of page updates when put: {% if user.is_authenticated %} <h1> hello {{ user.username }} {% else %} <h1> hello </h1> {% endif %} when try use same principle in template tag/sidebar, seems ignore user.is_authenticated , show 'login' , 'register', when should showing 'logout'. the body of html (main index page): {% load kappa_extras %} <body> <div class="container-fluid"> <div class="row"> <div class="col-sm-2" id="side_section"> {% block sidebar %} {% get_game_list %} {% endblock %} </div> <!--main section--> <div class="col-sm-10" id="main_section"> {% block body %} {% endblock %} </div> </div> </div> the get_game_list function 'kappa_extras': from django import tem...

git - GitHub Pull Requests Between Branches -

my organization making transition svn git (hosted on github) , have adopted git-flow branching model. we have been using pull requests merge between branches. use github web interface process merge , close request. pull requests merged --no-ff. merge commit occur in destination branch. so.... merge develop master - happens after merge develop branch both behind (due merge commits not being in master) , ahead (due new work being done in develop). over many iterations, end "develop branch both 23 commits behind , 7 commits ahead of master" - seems ridiculous. should not worry this? should merge manually , not through githuib web interface? if reason develop ever behind because of merge commits, should able routinely schedule sync. git fetch git checkout develop git merge --ff-only master git push if have hotfix branch went in, worst case above fail. you're going merge without --ff-only tag. that's perfectly acceptable , expected (...

javascript - What libraries have a zoom-to-fit rectangle selector for an image? -

i'm looking javascript/jquery library allow me use rectangle selector on image (like this ) , zoom selected area fit canvas. i've searched everywhere , can't find matches description. the rectangle selector need able retain specified aspect ratio well, point in right direction out immensely. like third example @ jcrop ? https://htmlpreview.github.io/?https://raw.githubusercontent.com/tapmodo/jcrop/master/demos/tutorial3.html

java - Parallel JUnit tests don't execute shutdown hook -

i running multiple junit tests in parallel classes using maven. have clean tasks need happen after junit tests run. handle clean up, adding shut down hook few tests. shut down hook correctly executes when not running parallel, don't see output (see example) shut down hook when run parallel. there doing wrong? jvm exit using system.exit when executing in junit tests in parallel? according surfire documentation documentation, parallel threads executed in same process, expect runtime.getruntime same process if called between different tests , threads. maven surfire plugin - fork options , parallel test execution the important thing remember parallel option is: concurrency happens within same jvm process. efficient in terms of memory , execution time, may more vulnerable towards race conditions or other unexpected , hard reproduce behavior. here example unit test: @test public void test() { runtime.getruntime().addshutdownhook(new thread() { @...

jquery - Isotope gutter/spacing on page load, no gutter/spacing on window resize -

Image
on page load, isotope adds gutter between isotope items. when resize window, 1px, fix layout. i've been racking brain why isotope adding spacing between images. on 1 page, , code identical other pages, exception being i'm loading in larger jpg images page. i've created codepen code/dependencies you'll see works there. if have tips on improving code, please let me know. here's isotope function: /** * item filter * */ itemfilter: function(isocontainer, $isoselector) { var itemgroup; var viewbyselect; var namefilter; var buttonfilter; var usednames = {}; var $isocontainer = $(isocontainer); var $win = $(window); // lazy load w/ sorting/filtering enabled var $imgs = $('.lazy'); // init isotope var $container = $isocontainer.isotope({ itemselector: $isoselector, layoutmode: 'fitrows', animationengine: 'best-available', getsortdata: { name: ...

Checkbox Array Validation Codeigniter -

on form each row has it's on submit button , need check check box before can delete else should through error. question: checkbox in_array if not check box , press submit not through codeigniter form_validation error. have used $this->form_validation->set_rules('selected[]', 'selected', 'required'); error not showing up. what best solution in making getting form_validation error work? view <?php echo form_open('admin/design/layout/delete'); ?> <?php echo validation_errors('<div class="alert alert-danger">', '</div>'); ?> <div class="table-responsive"> <table class="table table-striped table-bordered table-hover"> <thead> <tr> <td style="width: 1px;" class="text-center"> <input type="checkbox" onclick="$('input[name*=\'selected\...

Objective-C Struct problems -

i have student structure provides following code: #import <foundation/foundation.h> #import "grades.m" #import <stdio.h> struct student { nsstring *myname; struct grades *mygrades; }; void setname(struct student *s, nsstring *name); void ssetgrades(struct student *s, nsstring *gradelist); void setname(struct student *s, nsstring *name) { s->myname = name; } void ssetgrades(struct student *s, nsstring *gradelist) { printf("\n\nworking\n\n"); setgrades(s->mygrades, gradelist); printf("\n\nworking"); } i have grades structure provides following: #import <stdio.h> #import <foundation/foundation.h> #define null null struct grades { double sgrades[100]; int length; }; void setgrades(struct grades *grades, nsstring *gradelist); void setgrade(int spot, double grade, struct grades *grades); void setgrades(struct grades *grades, nsstring *gradelist) { nsstring *a = [gradelist substri...

hadoop - How to create a nested table in Hive for a FIX file format -

in research using ( fix 5.0 sp2 ) protocol format , ( cme datamine ) data. having problems creating table data (nested tables). example basic message format given msg#1 , starting @ (^a1128) , ending @ (^a10) . in case of msg#2 have same basic message starting @ (^a1128) , multiple messages starting @ (^a1023) , ending @ (^a346) . msg#1 msg#2 --------------------------------------------------------------------- ^a1128=9 ^a1128=9 ^a9=136 ^a9=1417 ^a35=x ^a35=x ^a49=cme ^a49=cme ^a34=578 ^a34=731 ^a52=20130714180133577 ^a52=20130714190005961 ^a75=20130715 ^a75=20130710 ^a268=1 ^a268=15 ^a279=0 ^a279=0 ^a22=8 ^a22=8 ^a48=111473 ^a48=28112 ^a64=20130712 ...

powershell java invalid thread stack size error -

i'm tasked converting windows scripts powershell versions. conversion going except minor issues. top issue involves java call use query database , generate xml or html files. when run windows script no problem: java -xss1m -cp ../lib/;../lib/jtds-1.3.1.jar;../lib/ojdbc6.jar dbdownloader tmpdbname ../sql/mtd_mttr_detail_v7.sql ../out/drilldown/%filename1% >> ..\logs\mtd.log 2>&1 but when run powershell script error: lastexitcode:1 error: not create java virtual machine. error: fatal exception has occurred. program exit. invalid thread stack size: -xss1m -cp the call made using & call operator. wrote library function script use , make call similar following: *$output = [string] (& $jvapp $jvarg1 $jvarg2 $jvarg3 $dbarg $sqlarg $lastarg >> $logarg 2>&1) the args call following: sqlname: mtd_mttr_detail_v7 jvarg1: -xss1m -cp jvarg2: ../lib/;../lib/jtds-1.3.1.jar;../lib/ojdbc6.jar jvarg3: dbdownloader dbarg: tmpdbname ...

node.js - Mongodb not returning specific fields -

i trying return 1 field sessions document. i'm using current query (it returns entire document): yield users.findone({ '_id': id // var id holds object id objectid("560ae1dc53cb3222679430f1") }, { '_id': 0, // <--- being ignored 'sessions': 1 // <--- being ignored }); i tried in mongo shell , works should: db.users.find({"_id":objectid("560ae1dc53cb3222679430f1")},{"sessions":1,"_id":0}).pretty() // <--- works i'm using co-monk based off of mongoskin . should work. not made clear in documentation, there explicit key name syntax "options" object : yield users.findone({ '_id': id }, { 'fields': { '_id': 0, 'sessions': 1 }}); so works bit differently mongodb shell api. same applies other options such sort .

c++ - Preprocessor directive for certain address space -

lets wanted define directive take int8_t , store specified memory location 0x0071. how this? i know say #define ddra 0xaa and make ddra = 0xaa, how make typing ddra = 0xbb; will write 0xbb in address location 0x0071? the avr-gcc headers define i/o ports using internal _sfr_io8 macro, e.g. in <avr/iom328p.h> : #define portb _sfr_io8(0x05) this macro defined in <avr/srf_defs.h> as: #define _sfr_io8(io_addr) _mmio_byte((io_addr) + __sfr_offset) which, in turn, resolved _mmio_byte macro in same file: #define _mmio_byte(mem_addr) (*(volatile uint8_t *)(mem_addr)) the definition of __sfr_offset is… little obscure. has 32-byte offset between avr i/o space , start of memory. tl;dr: #define ddra _sfr_io8(0x71) , standard headers part should doing if it's standard i/o port.

audio - Java How to wait for a clip to end -

i trying play few small sound effects, , i'm doing via method loads clip, plays it, , should close clip allow new 1 loaded later on without causing lineunavailable issues. here's method use: public void playclip(string filename){ clip clip = null; try{ audioinputstream inputstream = audiosystem.getaudioinputstream(getclass().getresource(filename)); audioformat format = inputstream.getformat(); dataline.info info = new dataline.info(clip.class, format); clip = (clip)audiosystem.getline(info); clip.open(inputstream); clip.start(); }catch(exception e){ e.printstacktrace(); } } right now, following clip.start() , clip remains somewhere, using line, until following error: javax.sound.sampled.lineunavailableexception: line format pcm_signed 44100.0 hz, 16 bit, stereo, 4 bytes/frame, little-endian not supported. @ com.sun.media.sound.directaudiodevice$directdl.implopen(directaudiodevice.java:513) ...

arrays - R - avoid nested for loops -

i have following function takes 4 vectors. t vector has given length , 3 other vectors (pga, sa5hz , sa1hz) have given (identical not equal t) lenght. the output matrix length(t) rows , length(pga) columns. my code below seems perfect example of not do, however, not figure out way optimize using apply function. can help? designspectrum <- function (t, pga, sa5hz, sa1hz){ ts <- sa1hz / sa5hz #by convention, if sa5hz null, set ts 0. ts[is.nan(ts)] <- 0 res <- matrix(na, nrow = length(t), ncol = length(pga)) (i in 1:nrow(res)) { (j in 1:ncol(res)) { res[i,j] <- if(t[i] <= 0) {pga[j]} else if (t[i] <= 0.2 * ts[j]) {pga[j] + t[i] * (sa5hz[j] - pga[j]) / (0.2 * ts[j])} else if (t[i] <= ts[j]) {sa5hz[j]} else sa1hz[j] / t[i] } } return(res) } instead of doing double for loop , processing each i , j value separately, use outer function process of them in...

c# - ASP.NET SQL Server connection alias -

probably amateur question, have taken on consulting application previous consulting used do. his asp.net connection strings appear work in way have never seen before. connection string points server, username, password usual yet when sql server account db doesn't exist nor appear in udl test file , account exists in database windows account. is there sort of aliasing happening, , if so, , how find it? if duplicate database testing using same credentials different db name, fails. thanks in advance! resolved. customer had hidden sql account (that being used application) our viewing though created account. because account did exist orphaned db copy, unable view database. once added, access database. i found interesting using udl file, not see hidden sql account. admin's (we aren't admin) , iis see account.

javascript - Add custom item to grid menu in ExtJS3 -

i'm trying make changes on cms, uses extjs 3. want add 2 buttons: show posts show posts (there column called "member") i've founded solution here , uses extjs 4 , incompatible older version. how can extjs 3? i know don't give enough information can suggest use filter on store make button works. something like: mystore.filter("member", true); and mystore.clearfilter(); i haven't create kind of button (on list of option) can't part. maybe can create button outside of grid? hope help

c++ - Comparison of string with the File data -

i m stuck in simple problem ,this code part of programme takes data user , reads data file(that contains name of movies , actors) , compare input gives wrong result.this code #include<iostream> #include<fstream> using namespace std; int main() { string name; getline(cin, name); string compare; ifstream myfile; myfile.open("movie.txt"); bool found = false; if (myfile.is_open()) { while (getline(myfile, compare)) { if (compare == name) { cout << "record found" << endl; found = true; } } myfile.close(); } if (found) cout << "not found" << endl; } any regarding appreciated . thanks for debug can use string_to_hex here on both compare , name

Can I use hot module replacement with webpack but not use react? -

i tried using hot module replacement never succeed. found repository , can use hot module replacement well. , uses react-hot loader, if remove loader, i'll error: [hmr] cannot find update. need full reload! i adjust project according above repository, i'm not using react, don't use react-hot loader, above error. can use hot module replacement webpack not use react? or need xx-hot loader make hot module replaceable? my structure: src entry.js index.html server.js webpack.config.js index.html: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>document</title> </head> <body> <script src="/static/bundle.js"></script> </body> </html> entry.js: document.write('hello'); server.js: var webpack = require('webpack'); var webpackdevserver = require('webpack-dev-server'); ...

java - How to sort map by calendar in string type? -

i have structure: map<string, string> map = new hashmap<string, string>(); and data looks this: ("10/11/2015", "a") ("10/12/2015", "b") ("10/13/2015", "c") ("10/14/2015", "d") ("10/15/2015", "e") i want sort map date (key), attempt convert string calendar type , move them treemap below: dateformat formatter = new simpledateformat("mm/dd/yyyy"); calendar calendar = calendar.getinstance(); treemap<calendar, string> tree = new treemap<calendar, string>(); for(map.entry<string, string> entry : map.entryset()){ string key = entry.getkey(); string value = entry.getvalue(); calendar.settime(formatter.parse(key)); tree.put(calendar, value); } but when print key, result looks below: 10/11/2015 10/15/2015 10/14/2015 10/12/2015 10/13/2015 what should sort map date (date in string type) correctly? based on examp...

c - Adding a library to my makefile -

i have set makefile takes sources main.c, word.c, , trim.c used library called linkedlist.a, after adding it not build keep getting undefined references functions within linkedlist. the following makefile code: shell = /bin/sh srcdir = . cc = gcc yacc = bison -y cdebug = -g compliance_flags = cflags = $(compliance_flags) $(cdebug) -i. -i$(srcdir) ldflags = -g library_files = linkedlist.a linkedlist.a: $(library_files).o $(rm) -f $(output) $(ar) cr $(output) $(inputs) ranlib $(output) ############################################################################################################ # list sources here. sources = main.c word.c trim.c ############################################################################################################ ############################################################################################################ # list name of output program here. executable = wordcounter ###############################################...

python - Decorate methods in derived classes of Flask MethodView -

i thought able require login derived views decorating __enter__ follows: from flask.views import methodview flask.ext.login import login_required class loggedinview(methodview): @login_required def __enter__(self): pass if add logging, turns out __enter__ not entered. similarly, __exit__ doesn't happen. what's going on here? i can modify style decorate other function, it's necessary call super() in derived views defeats point of doing begin with. how can enforce decoration without work in views beyond inheriting loggedinview ? to decorate methods of methodview instance have add decorators class variable list of decorators call. see documentation . for example, be: from flask.views import methodview flask.ext.login import login_required class loggedinview(methodview): decorators = [login_required] def get(self): pass def post(self): pass # ... note decorators applied methods defined. ...

Moving cursor c# (cursor.position/cursor.clip not working) -

i trying set cursor in region of screen. i using following method: this.cursor = new cursor(cursor.current.handle); cursor.position = new point(cursor.position.x - 50, cursor.position.y - 50); cursor.clip = new rectangle(this.location, this.size); however nothing happens when code executed. can tell me what's going on? you shouldn't write line this.cursor = new cursor(cursor.current.handle); //remove it here set region mouse cursor be. should first line if want "lock" mouse cursor in rectagle. if don't want comment line. cursor.clip = new rectangle(this.location, this.size); then can put cursor in position cursor.position = new point(500, 500); small example show how can work. // after first run uncomment line , see mouse "locking" in form ===> cursor.clip = new rectangle(this.location, this.size); (int = 0; < 600; i++) { //here move cursor. //we current position , shift 1. cursor.po...

html - Textarea returns empty value in PHP POST -

i facing problem in textarea content post via php. have form submits 2 values 1 in textarea , other radio button. while submitting radio button value posted textarea value showed empty. why happening? suggestion appreciated.. my snippet of html code <form action="" method="post" id="register_form"> <h2><img class="small_image" src="images/rsz_heart.png">describe yourself<img class="small_image" src="images/heart.png"></h2> <table id="register_table"> <tr> <td>describe yourself</td> <td> <textarea id="description" type="textarea" name="description" rows="5" cols="40" class="textbox" form="register_form" required>type</textarea> </td> </tr> <tr> <td>any disability</td> <td> <input type="radio" name="disab...

Delphi Datasnap send ClientDataSet to Server using tcp/ip -

i have simple datasnap tcp/ip based client server application. created clientdataset on client application , filled data. how can send clientdataset records server can process , save data server. edited so tried below code, problem @ server getting 1 less record sending client client code var cd: tclientdataset; begin cd:= tclientdataset.create(self); cd.data := cdscustomer.data; memo1.lines.add(inttostr( cd.recordcount )) ; servermethods1client.testdataset( cd); server code function tservermethods1.testdataset(ds: tdataset): string; begin try datasetprovidercommon.dataset := ds; if not datasetprovidercommon.dataset.eof tempclientdataset.open; if tempclientdataset.recordcount >0 form1.memo1.lines.add( inttostr( tempclientdataset.recordcount) ) else form1.memo1.lines.add( ' not records found' ) ; datasetprovidercommon.dataset.close; except on e: exception form1.memo1.lines.add(...

snap.svg - SVG pattern animation -

i have defined pattern in svg. want rotate continuously.... i'm not able apply animation on pattern definition. applied same animation symbol , works not working on pattern... <pattern id="gpattern" x="10" y="10" width="20" height="20" patternunits="userspaceonuse" patterntransform="rotate(35)" > <circle id="mycircle" cx="10" cy="10" r="10" style="stroke: none; fill: red" > </circle> </pattern> this pattern def. please me how can apply transform animation whole "pattern" individual contents of it.. in case circle... there doesn't seem stopping dropping <animatetransform> pattern definition: <svg width="200" height="200" viewbox="0 0 200 200"> <defs> <pattern id="gpattern" x="10...

how to create a specific date format in php -

this question has answer here: convert 1 date format in php 12 answers we have current date format 02-05-15 , output want 02/05/2015 in php. use datetime $mydatetime = datetime::createfromformat('d-m-y', "02-05-15"); echo $mydatetime->format('d/m/y'); // output : 02/05/2015 note: you may want set default timezone before using datetime , i.e.: date_default_timezone_set("europe/lisbon"); for date_and_time , other php best practices visit: http://www.phptherightway.com/#date_and_time

python - How do I tell which actual dll is being returned (x86 v x64)? -

let's focus on 1 dll: c:\windows\system32\wbem\wmiutils.dll. why? because it's file in discovered windows delivers different dll depending on process architecture. tldr; there way programmatically determine actual path of dll returned file system redirector? i understand if launched x86 process, c:\windows\syswow64\wbem\wmiutils.dll. and, if launched x64 process, c:\windows\system32\wbem\wmiutils.dll. i need determine wmiutils.dll i'm looking at. redirector makes system32\wbem\wmiutils.dll , feel identical it's not. if use parent path, c:\windows\system32\wbem though may/may not looking @ c:\windows\syswow64\wbem. any sweet python magic make happen? can't seem see other languages can port. based on use case, i've come couple hacks they're that. hoping has found solution easy parent path works in case. import ctypes, hashlib k32 = ctypes.windll.kernel32 oldvalue = ctypes.c_long(0) k32.wow64disablewow64fsredirection(ctypes.byref(oldvalue)...

php - Which table moodle session time out stored to? -

i know default session time out in moodle 2 hours . knowing session time out: site administration > server > session handling> timeout i need know in table in moodle time out getting stored? moodle version: 2.9.1 all moodle site-wide configuration stored in 1 of 2 tables. if name of configuration option displayed 'pluginname | settingname' (in small letters under human-readable name), stored in [mdl_]config_plugins, in record "plugin = [pluginname]" , "name = [settingname]". if name of configuration option displayed 'setting name' (without '|' symbol), stored in [mdl_]config, in record "name = [settingname]". so, in case, stored in [mdl_]config, "name = 'sessiontimeout'". you should use "get_config($pluginname, [$settingname])" function retrieve settings , "set_config($settingname, $value, [$pluginname])" function set settings. if wanting change setting in d...

sql server - MS SQL query to calculate link outage time and link up time -

following table, top few lines operational status of device, every poll: samplevalue = 2 operational status down, samplevalue = 1 operational status up source target sampletime samplevalue ------------------------------------------------------------------------------------------------ 128.42.196.11 se2/0/2(serial2/0/2) 9/30/15 11:10 2 128.42.196.11 fa3/0/0(fastethernet3/0/0) 9/30/15 11:10 1 128.42.196.11 gi1/0/0.10(gigabitethernet1/0/0.10) 9/30/15 11:10 1 128.42.196.11 se2/0/2.305(serial2/0/2.305) 9/30/15 11:10 2 128.42.196.11 se2/0/2.309(serial2/0/2.309) 9/30/15 11:10 2 128.42.196.11 gi1/0/0.20(gigabitethernet1/0/0.20) 9/30/15 11:10 1 128.42.196.11 se2/0/2.300(serial2/0/2.300) 9/30/15 11:10 2 128.42.196.11 gi0/0/0(gigabitethernet0/0/...

ios - clang: error: linker command failed with exit code 1 coming only on device -

when i'm trying test app on device below error. error not coming in simulator. i'm using xcode 7. can please help? undefined symbols architecture armv7: "_pkcs5_pbkdf2_hmac_sha1", referenced from: _sqlcipher_cipher_ctx_key_derive in sqlcipher.a(sqlite3.o) "_hmac_ctx_init", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_hmac_init_ex", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_hmac_final", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_hmac_ctx_cleanup", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_rand_bytes", referenced from: _sqlcipher_page_cipher in sqlcipher.a(sqlite3.o) _sqlcipher_codec_ctx_init in sqlcipher.a(sqlite3.o) "_hmac_update", referenced from: _sqlcipher_page_hmac in sqlcipher.a(sqlite3.o) "_evp_cipher_ctx_set_padding...

ios - How to change statusBar background color when search is active? -

Image
i've used uisearchcontroller. when click on search bar, navigation bar hides , search bar goes top of screen. but, shows space between top of screen , search bar how change statusbar color default searchbar gray color ? statusbar font colour white, hence when user click search bar, auto above status bar information becomes invisible.so need cover area default gray color too, user can see status bar.like this the space status bar lost in white background. func viewdidload() { super.viewdidload() edgesforextendedlayout = uirectedge.none }

c++ - How to get a running CMD terminal by name/id in Windows and passing commands to it programmatically? -

there external cmd window running. requirement handle/id of cmd , pass arguments @ run-time c++ application. is there direct way of doing it, ie running in system("....") , command redirects terminal addressed handle or winapi needs used in case.

c# - Creating a custom control in WPF -

having custom control's content defined this: <dockpanel> <listview x:name="tabcontrolmenu" dockpanel.dock="top" scrollviewer.verticalscrollbarvisibility="disabled" itemssource="{binding relativesource={relativesource findancestor, ancestortype={x:type usercontrol}}, path=items}"> <listview.resources> <style basedon="{staticresource listviewstyle}" targettype="{x:type listview}" /> <style basedon="{staticresource listviewitemstyle}" targettype="{x:type listviewitem}" /> </listview.resources> <listview.itemspanel> <itemspaneltemplate> <stackpanel orientation="horizontal"></stackpanel> </itemspaneltemplate> </listview.itemspanel> </listview> <border borderbrush="black" borderthickness="1,0,0,0" dockpanel.dock=...

python - Remove spaces in a string -

i have function: def cesar(): n = int(raw_input("introdueix la teva clau: ")) f = raw_input("introdueix la frase xifrar: ") ch in f: xifrat = int(ord(ch)+int(n)) textxifrat = chr(xifrat) print textxifrat, cesar() and want remove spaces output or string. problem if use .replace python says can't applied str , don't know other way remove spaces. the idea want this: m t q f % v z j % f x j become this: mtqf%vzj%fxj why can't use .replace() ? >>> = 'm t q f % v z j % f x j' >>> a.replace(' ', '') 'mtqf%vzj%fxj' >>>

ios9 - m4a audio files not playing on iOS 9 -

i have audio related app has multichannel mixer play m4a files @ time. i'm using audiotoolbox framework stream audio, on ios9 framework throws me exception in mixer rendering callback streaming audio files. interestingly apps compiled ios9 sdk continue stream same file on ios7/8 devices, not ios9. can't figure out if apple broke in ios9, or have files encoded wrong on our end, play fine on both ios 7/8 not 9. exception: malloc: *** error object 0x7fac74056e08: incorrect checksum freed object - object modified after being freed. *** set breakpoint in malloc_error_break debug it works other formats not give exception or kind of memory errors not work m4a format surprising. here code load files works wav,aif etc formats not m4a: - (void)loadfiles{ avaudioformat *clientformat = [[avaudioformat alloc] initwithcommonformat:avaudiopcmformatfloat32 samplerate:kgraphsamplerate ...

c# - Sort List with duplicate keys by custom comparer -

i have list inputcoll of type myvalue many duplicate keys: myvalue1.id=100; myvalue2.id=100; ...etc and have custom comparer compare 2 myvalue elements id : inputcoll.sort(myvaluecomparer); what doing wrong? comparer: public class myvaluecomparerbyid : icomparer<myvalue> { public int compare(myvalue x, myvalue y) { if (x.id == y.id) return 0; else if (x.id > y.id) return -1; else if (x.id < y.id) return 1; return 0; } } unless equality comparer not implemented badly, solution should work. but suggest easier approach, using linq: inputcol = inputcol.orderby(o => o.id).tolist();

iphone - on iOS device, open app and take screenshots -

i need "industrialize" screenshot taking on ios device lot of apps. everyday, have take these screenshots, it's boring. for each app, need : launch app wait few seconds sure app loaded emulate button clicking take screenshot close app after that, need send these screenshots macbook (but seems simple ..). this tool take screenshots : https://github.com/krausefx/snapshot but, don't have apps sources. moreover, can't open automator on iphone (it simple ..). if have ideas me ... thank much!

sql server - SQL Query - Query on Current Date but condition from the past -

i looking following scenario: i have sql server db, table stores historical data. example lets use following sample set. car, service date, findings 1234, 21/01/2001, fuel filter 1234, 23/09/2009, oil change 1234, 30/09/2015, tyres 3456, 30/09/2015, clutch i following sample bring result shows service of car brought in on give date, e.g. 30/09/2015 if had oil change in past. the query bring back: 1234, 30/09/2015, tyres since car on date services had oil change. any appreciated. use exists clause: select cur.car, cur.[service date], cur.findings tablename cur cur.[service date] = @mydate , exists ( select 1 tablename past past.car = cur.car , past.[service date] < cur.[service date] , past.findings = 'oil change' )

events - Jira escape button behaviour -

i working jira , stumbled on problem. if on browse page of issue , editing textfield, pressing escape discards changes. doing same editing comment field, doesn't discard changes on comment. want changes saved when pressing escape , losing focus on editing field content. same happens if click in empty area. of course not 1 searching solution problem: https://jira.atlassian.com/browse/jra-36670 https://jira.atlassian.com/browse/jra-41814 now not here discuss meaning of escape button. there several reasons behaviour wish (start reading comments on first link). is there way edit keyevent handling of jira? or overwrite event behaviour of standard fields? adding events via browser plugins or similar doesn't content lost then. i hope there elegant solution out there not searching one. suggestions? athlassian did esc-behavior. costs people nerves , money. esc shouldn't save imho should @ least offer possibility of retreiving lost work. jira-description migh...

ReactJS confusing 'JS code as text' and real JS code: Add javascript code as text in ReactJS div -

i have react js component, in want enter sample js code text inside div. code looks of sort render: function() { return ( <div id="sample_code_text"> <p> if( 1==1 ) { console.log(50) ; } </p> </div> )}; i error @ console.log(50); uncaught error: parse error: line 37: unexpected token ; react's div confuses 'code text' js code. how fix this? i think looking suggested @dev-null. try this: <p> if( 1==1 ) {'{'} console.log(50) ; {'}'} </p>

wordpress - woocommerce - Product page reviews error -

i facing weird error after working on woocommerce templates. issue seeing same reviews (reviews belonging 1 particular product) across products, ever product page open reviews same of 1 particular product.i tried trashing 1 product pattern has not changed , reviews caught product. what changed: initially aim load woocommerce templates custom plugin working based on woocommerce, have copied woocommerce templates plugin folder , used below code call each template file separately. function intercept_wc_template_meta($template, $template_name, $template_path) { if ($template_name == 'single-product/meta.php') { $template = um_product_path.'woocommerce/single-product/meta.php'; } return $template; } add_filter('woocommerce_locate_template', 'intercept_wc_template_meta', 20, 3); what came up: after doing files tried testing var_dump($template) , files loading plugin successfully. there error in reviews part of product page. for example i...