Posts

Showing posts from March, 2012

multithreading - Powershell Multithreaded math -

i'm working on self-inspired project learn powershell, , have been writing script generate prime numbers. stands, script works without issue, next goal increase it's processing speed. cls $primes = @() $primes += 3 $targetnum = 5 $primesindex = 0 $numofprime = 3 while(1) { if(($targetnum / 3) -lt 3) { $primes += $targetnum $targetnum += 2 $numofprime += 1 } else { if($primes[$primesindex] -le ($targetnum / ($primes[$primesindex]))) { if($targetnum % $primes[$primesindex] -eq 0) { $primesindex = 0 $targetnum += 2 } else { $primesindex++ } } else { $primesindex = 0 $numofprime += 1 $primes += $targetnum $targetnum += 2 if($targetnum -gt 100000){write-host $targetnum ", " $numofprime;break}

machine learning - Why does RSquared increase with # of folds in k-fold cross validation? -

i'm tuning model using k-fold cross-validation , noticed rsquared accuracy appears improve number of folds -- e.g. higher rsquared value when using 30 folds compared using 10 folds. two questions hoping insight on: why occur? is there reason believe rsquared k=10 better estimate of model accuracy using k=30? or both unrelated future error rate can expect on unseen test set? here's simple example of effect i'm referring to: ############### k = 10 ##################### > data(iris) > train_control <- traincontrol(method="repeatedcv", number=10, repeats=3) > train(sepal.length~.,data=iris,trcontrol=train_control,method="rf",metric="rsquared") random forest 150 samples 4 predictor no pre-processing resampling: cross-validated (10 fold, repeated 3 times) summary of sample sizes: 137, 135, 134, 134, 135, 136, ... resampling results across tuning parameters: mtry rmse rsquared rmse sd rsquared sd 2 0.

Shuffle records and sequential records in sql server -

Image
i have written sql query returns me shuffled data using newid() in sql server 2012. scenario: have table in have questions in table - "tblquest" whereas in "tblquestlinked" table have linked question related main question in "tblquest" table, below query outputs shuffled data correctly. select row_number() on (order newid()) sno,* (select q.id [qid], q.question, q.solution, isnull(q.islinked,0) islinked, ql.linkquestion tblquest q left join tblquestlinked ql on q.id = ql.qid) i want dataset returned query should have linked question in it, should not shuffled, instead should next row linked "main" question. edit as these set of questions presented online examination application, shuffling of questions must. one main question can have 0 many linked questions. , linked question appears next row corresponding 'main" question. passed ui , provide questions based on sno ( serial no) please find screenshot (desired result):

multithreading - How to start mutiple threads at the same time in C#? -

my project has 2 threads use system.timer thread t1, t2; t1 = new thread(timer_product); t2 = new thread(timer_money); t1.start(); t2.start(); when run application, starts t1, doesn't start t2. if change order to t2.start(); t1.start(); and run app again, t1 doesn't start, t2 starts. the order of thread execution doesn't matter demonstrated below. suspect issue lies in timer_money or possibly timer_product . examples: void main() { thread t1, t2; t1 = new thread(t => { console.writeline("t1 running");}); t2 = new thread(t => { console.writeline("t2 running");}); t1.start(); t2.start(); } results: t1 running t2 running now same threads reversed order of execution. void main() { thread t1, t2; t1 = new thread(t => { console.writeline("t1 running");}); t2 = new thread(t => { console.writeline("t2 running");}); t2.start(); t1.start(); } r

python - How to read lines of dictionary and write to a CSV file -

i have data file, format this {"name":"david","age":"14","score":[0,1]} {"name":"jason","age":"12","score":[0,0]} my question : 1) how read file , convert csv name,age,score david,14,0/1 jason,12,0 2) how convert [0,1] 0/1, [0,0] 0, means when denominator zero, result 0, otherwise, take 1st number divide 2nd number inside [] thanks!! for start data appears json encoded, can use json module read list of dictionaries: import json open('input') f: dicts = [json.loads(line) line in f] for sample data dicts set to: >>> pprint import pprint >>> pprint(dicts) [{u'age': u'14', u'name': u'david', u'score': [0, 1]}, {u'age': u'12', u'name': u'jason', u'score': [0, 0]}] update scores (assuming want perform division): for d in dicts: score = d['sc

Bootstrap Timepicker in Angularjs -

i new angularjs. have following directive bootstrap timepicker. directive('timepicker', function(){ return { restrict: 'ac', link: function(scope, el, attr) { if( ! jquery.isfunction(jquery.fn.timepicker)) return false; var $this = angular.element(el), opts = { template: attrdefault($this, 'template', false), showseconds: attrdefault($this, 'showseconds', false), defaulttime: attrdefault($this, 'defaulttime', 'current'), showmeridian: attrdefault($this, 'showmeridian', true), minutestep: attrdefault($this, 'minutestep', 15), secondstep: attrdefault($this, 'secondstep', 15) }, $n = $this.next(), $p = $this.prev(); $this.timepicker(opts);

Remote ssh server port 22 monitoring -

we having our windows servers in aws, have problems doing sshget cdn server, getting timeouts , dont know why. can put check in naemon(monitoring server) based on nagios nrpe in servers executes telnet remote host johndoetv.upload.cdn.com @ port 22 , gets critical after 30 seconds in case of connectivity. i tried check_tcp it's failing, or can use nrpe in case on remote server in windows eg. define service { service_description akamai_sshget hostgroup_name playready use generic-service check_command check_tcp -h ctv.upload.akamai.com -p 22 -w 15 -c 30 contact_groups admins } i've defined command ssh's box, runs check_ssh (a standard nagios thing) against server: define command { command_name ssh_check_ssh command_line /usr/lib/nagios/plugins/check_by_ssh -h $_hostgateway$ -c "/usr/lib/nagios/plugins/check_ssh $hostaddress$"

How do I get unique elements in my multidimensional array in PHP? -

this array: array ( [0] => array ( [entity_id] => 1 [value] => new [label] => new ) [1] => array ( [entity_id] => 3 [value] => pending_payment [label] => pending payment ) [2] => array ( [entity_id] => 4 [value] => pending_paypal [label] => pending paypal ) [3] => array ( [entity_id] => 5 [value] => processing [label] => processing ) [4] => array ( [entity_id] => 6 [value] => complete [label] => complete ) [5] => array ( [entity_id] => 7 [value] => canceled

bash - Replace Environment Variable in argument to shell script -

i've got shell script gets called arguments contain variable names. want variable replaced values. consider example below: solves problem, uses eval. want avoid eval security reasons. #!/bin/bash # # example: # $> replace.sh arg '$var' # arg value var=value args=$(eval echo $*) echo $args works me like: #!/bin/bash # # example: # $> replace.sh arg '$var' # arg value var=value args="" arg in "$@" arg="${arg/$/}" # remove preceding $ indirect variable expansion work args="${args} ${!arg}" done echo "$args"

python - Matplotlib: How do I have the xtick labels apear on the other side of the x-axis? -

Image
in bar chart: how make x-axis labels appear in bars of bar-chart , left-aligned x-axis? i tried ax.xaxis.labelpad() method not seem anything. you can set y location of ticks when call set_xticklabels . so, if set y small positive, should placed inside bars. for example: import matplotlib.pyplot plt fig,ax = plt.subplots(1) ax.bar([0,1,2,3],[7900,9400,8700,9990],facecolor='#5080b0',edgecolor='k',width=0.3) ax.set_xticks([0.15,1.15,2.15,3.15]) ax.set_xticklabels(['beek1','beek2','orbath','kroo'], rotation='vertical',y=0.05,va='bottom') produces following plot:

android - How to call the Gridview Activity from another activity -

i need idea on how call activity has gridview activity. basically, supposed main activity has 1 button , when click button directed activity following sample code public void onclick(view v){ if (v.getid() == r.id.button2) { intent intent = new intent(this, anotheractivity.class); this.startactivity(intent); } } but if activity i'm being redirected contains gridview layout, how call when press button? don't have time write code here. best if give me idea or make sample code in advance. your code should work on activity have regardless of layout have. replace intent intent = new intent(this, anotheractivity.class); intent intent = new intent(this, activitywithgridview.class); remeber cannot see gridview if not populated data.

ios - Objective-C: How to disable verticall scrolling in UIScrollView -

i going add uiscrollview uiview programmatically. tried use following code scrollview still not disabled. -(id)initwithframe:(cgrect)frame { ... _scrollview = [[uiscrollview alloc] initwithframe:cgrectzero]; [self addsubview:_scrollview]; ... } -(void)layoutsubviews { ... _scrollview.frame = cgrectmake(0, 0, self.frame.size.width, 40); [_scrollview setcontentsize:cgsizemake(self.frame.size.width * 2, 40)]; ... } i think should work it's not working now. please advise me problem is. thanks well, try set contentsize this: [_scrollview setcontentsize:cgsizemake(self.frame.size.width * 2, 0)]; let me know result. thanks.

javascript - Difference between String.prototype.includes/contains in ES6? What about .has? -

i wondering of these methods become standard. i've seen both methods yield similar results, yet i'm not sure why there 2 versions/aliases. there difference among them? also, why did es6 use .has when could've used .contains or .includes serve multiple purposes under 1 name. i aware .has isn't used on strings. support tests: | contains includes chrome | no yes firefox | yes yes nodejs | yes no

java - Wicket component to use for a step by step process -

i developing application in wicket has several pages.its step step configuration. application has around 6-7 pages of configuration connection information,table information,security information, etc. component use show step step progress , when complete it.for instance if complete connection information, tick mark or car reaching connection information in progress bar needs shown. please suggest ideas new wicket , want ui rich possible. also, how easy combine wicket bootstrap? check http://www.wicket-library.com/wicket-examples-6.0.x/wizard step-by-step component. works panel instead of page. for integration bootstrap see: https://github.com/l0rdn1kk0n/wicket-bootstrap . nice wizard bootstrap: http://ajoke.cz/wizard/examples

recursion - Command Line For Loop returns path that is missing last subdirectory -

i'm trying use loop recursively extract zip files in folder multiple levels , zips within zips. when run error message because last sub directory blank looks c:\users\johnsmith\desktop\testing\\ , says cannot create output directory. had thought had had working earlier guess missed something. , help! here i'm running: for /r "c:\users\johnsmith\desktop\testing\" %i in (*.zip) (7z x "%i" -aou -o\"%~dpi\" && del \"%~fi\") i guess there \" survivals of escaping sequences in command if call within program. no such need (and harmful) in pure cmd . as per 7-zip command line version user's guide use -o"%~dpi" (remove backslashes); same in del "%~fi" follows for /r "c:\users\johnsmith\desktop\testing\" %i in (*.zip) (7z x "%i" -aou -o"%~dpi" && del "%~fi")

html - Container being 'pushed' to centered position of body -

good day all. this maybe small thing, unable find solution this. my #body has right dimensions fill page, add .container class same dimensions, still gets 'pushed' few pixels. how fill body container? html issue add css body { margin:0; padding:0; }

android - How to allow users to add their own Category into the string Array? -

currently, i'm doing android app, stored categories inside string array , them spinner. now problem is, if user needs add own category, possible add categories inside string array? or need store these categories inside database? this string array: <string-array name="array_categories"> <item>food</item> <item>clothing</item> <item>transportation</item> <item>entertainment</item> <item>halls</item> <item>jewellery</item> <item>other</item> </string-array>` resources stored in application generated during compile-time , read-only during runtime. can't modify them. you try use sqlite database storing information. first time run application take data xml array , store in database. next time when update server can add/modify database.

hibernate - @GeneratedValue(strategy = GenerationType.IDENTITY) does not work with @EmbeddedId -

i new hibernate , need here. previously had 1 primary key , used @generatedvalue(strategy = generationtype.identity) create sequence in database. now, have changed composite primary keys using @embeddedid , below new employee.java . for reason, increment sequencing no longer works. stays @ 0 new entries. some clarification of appreciated. , how can go automatically incrementing value? thank you! employee.java - new @entity @table(name = "employee") public class employee implements serializable { @embeddedid private employeepk pk; private string name; private string username; public employee() { } public employee(string username, string name) { super(); this.pk = new employeepk(username); this.name = name; } @embeddable public class employeepk implements serializable { @generatedvalue(strategy = generationtype.identity) private int employeeid; private string usernam

C++ Logging api -

which efficient , configurable , portable c++ diagnostic logging api/ library. i working on multi threaded application multiple sub components. i should able enable/disable logging desired sub system needed should support logging severity within sub component. the api/library should write logging temporary storage (circular buffer) , save file on user request. most importantly have overloaded operator able print objects take @ pantheios , boost.log .

linux - what is "num_regions" returned by the ioctl (VFIO_DEVICE_GET_REGION_INFO) in vfio -

i trying understand how vfio works on pci. have read https://www.kernel.org/doc/documentation/vfio.txt , , writting test based on it. @ point,my code looks this: /* pci device information (number of regions , interrupts...) */ ret = ioctl(vfio_dev_fd, vfio_device_get_info, &device_info); if (ret) { printf(" %s cannot device info, " "error %i (%s)\n", pci_addr, errno, strerror(errno)); close(vfio_dev_fd); return -1; } printf ("found %d regions in device\n", device_info.num_regions); what not understand last printf shows 9 (nine) regions! looking @ config space of pci device can see: cat /sys/bus/pci/devices/0000\:06\:00.0/config | hd 00000000 e4 14 81 16 00 04 10 00 10 00 00 02 10 00 00 00 |................| 00000010 04 00 de f3 00 00 00 00 04 00 df f3 00 00 00 00 |................| 00000020 00 00 00 00 00 00 00 00 00 00 00 00 28 10 6e 02 |............(.n.| 00000030 00 00 00 00 48 00 0

commit - Add Flow Target on IBM-RTC -

Image
i need add target flow in ibm-rtc , have 2 streams are: stream x stream y and need modified / made commits on stream y received stream x, not vice versa. accessed stream x , added new flow target, indicating stream y. when test stream y of commits not received in stream x. some feedback me? thank you setting flow target in stream purely "documenting" relationship between 2 streams (mainly when compare 2 streams show pending changes ). not imply "automatic" operation when delivering in 1 (and automagically delivering in other). one automatic deliver aware of post-build deliver step , where: deliver made streama that trigger build (there buil definition using repo workspace accepting change sets streama) a post-build deliver will, if build succeeds, deliver stream.

c99 - Design a keylogger in standard C -

can keylogger created using functions defined in standard c, i.e in c89 or c99, without using api's provided compiler? the definitive answer no , assuming want know why : c described in terms of abstract machine . without going details, it's machine doesn't exist c implementation must expose same observable behavior abstract machine. properties of machine function calling "stack"(*) , access linear memory model. hosted environments , add input , output streams. things abstract machine notably doesn't include concepts of having operating system in place (it should possible implement on many devices possible) or until c11, concept of parallel execution. having concrete input device keyboard out of scope of c abstract machine, knows input streams, not caring data coming from. what need keylogger place hook code into, might os layer input buffering, keyboard driver or directly hardware (on simple machines old c64, controlling io-registers k

javascript - How can I avoid slow layout calculation on IE 11 when calling getBoundingClientRect()? -

Image
i having listener displaying tooltips on hover calculates position of using jquery $.offset function. on ie 11 getting horrible performance everytime listener triggered causing delay on showing tooltip or hover css class of element. the part target elements embed on angular app, if load directly performance fine in other browsers , can see call getboundingclientrect takes small time if interact other views on angular before going 1 performance goes bad shown in screenshot. (i know shouldn't use jquery inside angular pretty sure problem not because of since working first time load page , in other browsers too) how avoid layout recalculation or how find out causing issue ?

javascript - Promises basics. How to promisify async node code? -

i getting started promises , trying use them instead of callbacks avoid callback hell. async functions mix of functions mongodb, redis, bcrypt module, etc. able far: var insert = q.denodify(db.collection(users).insert); var createcollection = q.denodify(db.createcollection); var sadd = q.denodify(redisclient.sadd); var sismember = q.denodify(redisclient.sismember); var gensalt = q.denodify(bcrypt.gensalt); var hash = q.denodify(bcrypt.hash); // sanity check // "name" parameter required if(!req.body.name || !isvalidname(req.body.name)) return next(get400invalidnameerror()); // sanity check // "key" optional // if 1 supplied, must valid // key hashed later if(req.body.key){ if(!isvalidkey(req.body.key)) return next(get400invalidkeyerror()); } // steps: // 1. // check redis cache see if "name" taken // if yes, return error. if no, continue // 2. // construct "user" object name = req.body.name // 3. // req.body.key provi

windows 10 - How to add ListBox Item Contextmenu in UWP -

i searching add context menu in every item of listbox item. know easy in wp8 app using toolkit. however, toolkit not supported in uwp. how can add context menu in uwp listbox item? thanks! you can create listbox.itemtemplate menuflyout , example: <listbox.itemtemplate> <datatemplate> <grid pointerentered="grid_pointerentered" > <flyoutbase.attachedflyout> <menuflyout> <menuflyoutitem x:name="editbutton" text="edit" click="editbutton_click"/> <menuflyoutitem x:name="deletebutton" text="delete"

jquery - elasticsearch.js client connection refused: Access-Control-Allow-Origin not recognized? -

i've been trying ping locally running elasticsearch using elasticsearch.jquery.min.js , "no living connection" error each time. eta: in chrome see looks pretty low level "connection refused". i'm developing on macos x, , browser points @ page via http://localhost/~myuserid/sitename/ . i'm accessing localhost:9200 falls under cross domain cors requirements. i see following error in chrome console: xmlhttprequest cannot load http://localhost:9200/?hello=elasticsearch!. no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost' therefore not allowed access. per http://enable-cors.org/server_apache.html i've added following /etc/apache2/httpd.conf: <directory /> header set access-control-allow-origin "localhost:9200" allowoverride none require denied </directory> and run $ sudo apachectl -t $ sudo apachectl -k graceful but error persists. there

python - Numpy array of dicts -

in python, have dict has pertinent information arrowcell = {'up': false, 'left': false, 'right': false} how make array rows , j columns of these dicts? how make 2 dimensional & j explained on site @ this: how define two-dimensional array in python link. hope helps, cheers!

exchangewebservices - How to interpret EwsCutoffBalance in an Exchange throttling policy? -

i try figure out how throttling policies affect ews. for ews, have these values: ewsmaxsubscription: number of active subscriptions done impersonated user. ewsmaxconcurrency: how many concurrent connections or actions single client may take. ewsmaxburst: how far above standard resource limit client may go in shorts bursts (in milliseconds). comes effect when percentage of cpu/memory usage exchange exceeds defined threshold (depending of setup, suppose). ewsrechargerate: speed @ user’s resource budget recharges or refills (in milliseconds). i understand each of above throttling parameters. however, i'm not sure understand ewscutoffbalance . parameter defines resource consumption limits ews user before user blocked performing operations on specific component... my questions... how value used regarding ewsmaxburst , ewsrechargerate values? what unit of parameter? how can determine right value if need change throttling policy of specific user account (instead of u

javascript - how to redirect groceryCrud operation links with json_encode -

i have grammar problem that's why cannot deliver problem properly, ill try again clarify if may. have forms of crud oprations of grocerycrud put them in modal. inside datatable, theres button choose edit, view or delete records. inside of button functions code mentioned above. in codes above, when click edit button, display modal edit form , forth others. @ list.php, declare javascript variables below edit , view links grocerycrud. the problem is, cant id of selected data inside datatable when click edit , view button. , display latest inputted data/record in modal. there wrong on declaring javascript variables thats why cant link exact id of selected record performed crud operations? i have code @ datatables/view/list.php <table class="table table-striped table-bordered table-vcenter table-condensed table-responsive table-hover" id="example-datatable" style="height: 50px;"> <thead> <tr> <center> <?php forea

python - How to use nested subgraphs from graphml in igraph -

Image
the graphml specification provides possibility create graphs child of node element, .e.g. <graphml> <graph id="g" edgedefault="undirected"> <node id="n0"/> <node id="n1"> <graph id="n1::" edgedefault="directed"> <node id="n1::n0"/> <node id="n1::n1"/> <edge id="e0" source="n1::n0" target="n1::n1"/> </graph> </node> <edge id="e1" source="n0" target="n1"/> <edge id="e2" source="n1" target="n1::n0"/> </graph> </graphml> is possible use igraph interpret information these subgraph? (i using python igraph version 0.7.1) edges after subgraph declaration ignored, leads following graph: thank help! unfortunately, nested graphs not supported igraph.

bash - Removing 2 last characters from a string -

i'm trying make list of directories 2 sources. other directory has entries can have -1 or -2 after them , want rid of them. ls output example: something.something.anything-1 stuff.stuff.stuff.morestuff-2 st.uf.f the code how have now: echo -e "\tdata\t\t | \t\tsystem" system in `ls /system/app`; data in `ls /data/app | sed 's/-1*$//' | sed 's/-2*$//'`; echo -n "$data | " done echo "$system" done it works fine, i'm currious if there's better way of doing it, have use sed twice. , noticed there isn't many posts here remove characters strings using commands, place share ideas. update: the updated code: echo -e "\tdata\t\t | \t\tsystem" system in `ls /system/app`; data in `ls /data/app | sed 's/-[[:digit:]]*$//'`; echo -n "$data | " done echo "$system" done wich works perfectly! if want remove last 2 chars always: ech

How obfuscate python bytecode with Pyinstaller 3.0 -

Image
i trying figure out how can obfuscate python bytecode new pyinstaller . c:\anaconda32\envs\myenv\scripts\pyinstaller.exe --distpath=./dist/win32 --workpath=./build/win32 --uac-admin --uac-uiaccess --key=mykey app.spec however after building, still hack sources pyinstaller exe rebuilder shown here:

c# - Split string with specific requirements -

Image
let's have string string song = "the-sun - red"; i need split '-' char, if char before , after space. i don't want split @ "the-sun"'s dash, rather @ "sun - is"'s dash. the code using split was string[] songtokens = song.split('-'); but splits @ first believe. need split if has space before , after '-' thanks i need split '-' char, if char before , after space. you can use non-regex solution this: string[] songtokens = song.split(new[] {" - "}, stringsplitoptions.removeemptyentries); result: see more details string.split method (string[], stringsplitoptions) @ msdn. first argument separator represent string array delimits substrings in string, empty array contains no delimiters, or null . the stringsplitoptions.removeemptyentries removes empty elements resulting array. may use stringsplitoptions.none keep empty elements. yet there can problem if have

Twilio WebRTC vs DIY WebRTC -

Image
is webrtc going free web developers set video calls on web pages? why twilio having pricing 25c per mins video calls, going expensive small guy mange video calls on web hosting servers? any advice deep webrtc already? some of comments above not informed. wrote, since bandwidth needed in case of media relay higher well. not entirely true, transmission happens between peers(browsers), servers used signalling(relaying ip addresses of connecting peers , more info), can route transmission central server(for fail overs), can surely without free. webrtc free , can setup whole thing on own without having shell out penny. bit hard , mitigating fail-overs difficult, can free. tokbox or twilio charge money because these tools abstract rigid complexities of setting up, running , managing fail-overs in webrtc application. in tokbox's case: you don't need setup stun, turn servers, don't have worry integration android or ios clients, provide plugin ie too, out

webforms - Asp.Net not using the handler resolved in PageHandlerFactory -

i trying intercept calling of pages in asp.net, can change object before used. providing simplified code, illustrate problem. debugging, step custompagehandlerfactory, , see using base method instance of page. instance not seem passed forward. hashcode of gethandler's object , instance's hashcode of page differ. shouldn't same? the page: public partial class _default : page { public bool throw { get; set; } public _default() { throw = true; } protected void page_load(object sender, eventargs e) { throwexception(); } public virtual void throwexception() { if (throw) { throw new exception("non sense error!"); } } } the handlerfactory: public class custompagehandlerfactory : pagehandlerfactory { public override ihttphandler gethandler(httpcontext context, string requesttype, string virtualpath, string path) { var page = base.g

Flip animation while moving from one activity to another in android -

like in google api http://developer.android.com/intl/es/training/animation/cardflip.html instead of doing 2 fragment how 2 activity. take same xml in link you've posted , implement uses approach https://stackoverflow.com/a/5145226/2435402 startactivity(intent); overridependingtransition(r.anim.flip_right, r.anim.flip_left);

ios - Mix colour in Sprite Kit -

Image
i new sprite kit , want use implement simple game. i'd know if possible in sprite kit: assume draw 2 circles, 1 in red , other 1 in green . there overlap area between 2 circles , want colour of area can automatically set red + green = yellow , kind of picture below. is possible using sprite kit? if possible, how set up? any reply appreciated! you can play blending mode in conjunction skeffectnode : class gamescene:skscene{ override func didmovetoview(view: skview) { let effect = skeffectnode() //creating shapenodes let shape1 = skshapenode(circleofradius: 50) shape1.fillcolor = skcolor.redcolor() shape1.strokecolor = skcolor.clearcolor() shape1.zposition = 1 shape1.blendmode = skblendmode.add let shape2 = skshapenode(circleofradius: 50) shape2.fillcolor = skcolor.greencolor() shape2.strokecolor = skcolor.clearcolor() shape2.zposition = 2 shape2.blendmode

How to get rid of hairline between two divs in html/css? -

Image
i have 2 elements close possibly can them. if you're curious, first scroll-to-top script user can click, , below flat background. hairline annoying me. any appreciated! /*scroll top*/ .scroll-top-wrapper img{ width: 134px; display: block; margin-left: auto; margin-right: auto; cursor: pointer; } .border_background{ background: #162a53; height: 416px; } ... <!-- scroll top --> <div class="scroll-top-wrapper"> <span class="scroll-top-inner"> <img src="../images/misc/scroll_to_top.svg" onmouseover="this.src='../images/misc/scroll_to_top_hover.svg';" onmouseout="this.src='../images/misc/scroll_to_top.svg';" /> </span> </div> <!-- light-colored border --> <div class="border_background"> .... try adding reset file. or margin: 0; remember html tags have default style rules have rid of

ios - Update Custom Cell UIButton title when NSNotification is posted -

i have uitableviewcontroller bunch of custom cells have playbutton in them. in cellforrowatindexpath , assign tag is equal indexpath of button, when playbutton pressed, set title of button "stop". changes "stop", should, , when press "stop", changes "play". where i'm having difficulty when sound stops playing on own, absent user intervention. set observer listen mp3 player being done. added observer in viewdidload of mytableviewcontroller : here variables use facilitate changing title of playbutton in cells: // variables facilitate changing playbutton title var indexpathofplaybutton = int() var isplaying: bool = false in viewdidload of mytableviewcontroller , add observer: nsnotificationcenter.defaultcenter().addobserver(self, selector: "resetplaybutton", name: resetplaybuttonnotification, object: nil) here's playmp3 method on mytableviewcontroller : func playmp3(sender: anyobject) { if isplayi

Dealing with function call syntax outside of function -

i apologize if exceptionally elementary, started programming in school, have looked on solution , unfortunately nothing has helped me this. have piece of code: #define _crt_secure_no_warnings #include <stdio.h> int logic(int a, int b) { int c = % b; a++; b--; printf("==%d %d %d==\n", a, b, c); return b + + c; } int main() { int a, c; float d, f; = 10; c = 5; f = 2; d = logic(a, logic(c, f)); printf("%d %d %.2f %.2f\n", a, c, d, f); return 0; } now output is: '== 6 1 1== ==11 7 2== 10 5 20.00 2.00' now problem how line 'd = logic(a, logic(c, f));' compile in regards logic function above. assume first output, logic function takes value of 5 , 2 c , f , runs through function , b. totally stumped why next output '==11 7 2==' . return 'c + b + a;' exactly, when replace + operator comma first value in output (which 11 regardless of order place variables) emerges,

android - Transient dependencies with Gradle & Google Cast -

i updated android-app buildtoolsversion "23.0.1" , wanted update libraries required casting chromecast. those libraries are: dependencies { compile 'com.android.support:appcompat-v7:23.1.0' compile 'com.android.support:mediarouter-v7:23.1.0' compile 'com.google.android.gms:play-services-cast:7.8.0' } after testing while versions (play-services-cast:8.1.0 introduces proguard-problems), realized can this dependencies: dependencies { compile 'com.google.android.gms:play-services-cast:7.8.0' } so means, appcompat & mediarouter seem transient dependencies of play-services-cast. who can tell me happens , what's recommended way? declare appcompat, mediarouter + play-services-cast before because transient dependency omitted? just use play-services-cast , use transient dependencies appcompat & mediarouter? what version of appcompat & mediarouter used if declare them myself? or multiple versions used

dynamics crm - CRM Workflows keep failing when calling a child workflow -

when create crm workflow has actions fire child workflows, workflow keeps failing. the weird thing can run workflows no child workflows fine, happens when other workflows triggered within one. has encountered before , if so, know how fix it. getting errors this. error getting is: cannot set unknown member 'microsoft.xrm.sdk.workflow.activities.startchildworkflow.inputparameters'. the full stack error : unhandled exception: system.xaml.xamlobjectwriterexception: cannot set unknown member 'microsoft.xrm.sdk.workflow.activities.startchildworkflow.inputparameters'. @ system.xaml.xamlobjectwriter.writestartmember(xamlmember property) @ system.xaml.xamlservices.transform(xamlreader xamlreader, xamlwriter xamlwriter, boolean closewriter) @ system.activities.xamlintegration.funcfactory 1.evaluate() @ system.activities.dynamicactivity.oninternalcachemetadata(boolean createemptybindings) @ system.activities.activity.internalcachemetada

android - Gradle - build sass per productflavor (multi folder) -

we created android app webview shows local website assets folder. the project has different product flavors generate diffent apps different styles , content same codebas (native java , html / js). for each flavor want define diffent sass file colors , tweaks specific flavour. i know need create task in gradle builds css files have no idea start: how url of assets folder of specific flavour? can use special gradle plugin building sass or have create task executes "sass" command? when use gradle plugin compass, how configure right folders each flavour? plugin settings in top level , not in android plugin level. i finaly have solution! add build.gradle in main folder (not of app): buildscript { repositories { jcenter() mavencentral() maven { url 'http://dl.bintray.com/robfletcher/gradle-plugins' } } dependencies { classpath 'com.android.tools.build:gradle:1.3.0' classpath 'com.gi

iis - Can't PUT to my IHttpHandler, GET works fine -

i'm in process of writing ihttphandler. environment windows 7 enterprise, iis 7 (it appears). handler running application under default app pool running in integrated mode. currently handler's processrequest() method following (just testing @ point): public void processrequest(httpcontext context) { context.response.statuscode = 200; context.response.contenttype = "text/html"; context.response.output.write("file uploaded."); } i add handler via web.config follows: <configuration> <system.webserver> <handlers> <add name="httpupload" path="*" verb="*" type="httpupload, httpupload" resourcetype="unspecified"/> </handlers> </system.webserver> </configuration> i'm using curl test handler. when following: curl http://localhost/httpupload/foo it works. however, when attempt put follows: curl --upload

php - How to get validation when saving multiple records with newEntities() CakePhp 3.x? -

for reason not getting validation errors when saving multiple records. can grab errors using print_r($user->errors()); not automatically injected form when adding single user. according docs "validating entities before saving done automatically when using newentity(), newentities()." not sure if there specific way set form make return validation multiple records or if have special validation in model inputs have indexes or what? view: <div class="page-wrap"> <div class="form"> <h1>join now</h1> <?php echo $this->form->create(null, ['controller' => 'users', 'action' => 'addmultiple']); echo $this->form->input('1.full_name'); echo $this->form->input('1.username'); echo $this->form->input('1.email'); echo $this->form->input('1.password');