Posts

Showing posts from 2010

assembly - Is there a web app HLA assembler? -

hla easy enough language install on virtually platform, have friend attempting learn on machine on not have administrative privileges. i've bumped online compilers nasm (recognizing "compiler" not strictly right word), , i'm curious whether has bumped online hla? the answer might "no", in case nasm have do. suggestions appreciated. (she'll have raspberry pi around anyway in few months, or @ least cheap laptop.)

vb.net - Quadratic equation with complex roots -

i learning visual basic , have been trying write code solve quadratic equations complex number roots. pointer in right direction appreciated. public class form1 dim a, b, c integer dim x1, x2 double private sub label4_click(sender object, e eventargs) handles label4.click end sub private sub textbox4_textchanged(sender object, e eventargs) handles eqnrt1.textchanged end sub private sub button3_click(sender object, e eventargs) handles btnexit.click close() end sub private sub btnclear_click(sender object, e eventargs) handles btnclear.click txta.text = "" txtb.text = "" txtc.text = "" eqnrt1.text = "" eqnrt2.text = "" end sub private sub btncalc_click(sender object, e eventargs) handles btncalc.click dim a,b,c integer = txta.text b = txtb.text c = txtc.text dim x1 = (-b + math.sqrt(b * b - ...

python - TypeError: 'float' object is not callable -

i getting "typeerror: 'float' object not callable. here code: from matplotlib.pylab import * def f(x,t): return (exp(-(x-3*t)**2) )*sin(3*pi(x-t)) x = linspace(-4, 4, 8) y = zeros(len(x)) in xrange(len(x)): y[i] = f(x[i],0) plot(x, y) show() pi isn't function, since didn't use * indicate want multiply it, looks using one.

javascript - Angular watch on parent directive's controller with require -

i have parent , child directive controller each, both of required in child directive. want watch changes property on parent directive controller within link function of child directive. however, watch function fired on initialisation not subsequently when property changed button in parent directive's scope, or link function of parent directive. please explain why , how should resolve it? parent directive myapp.directive('parentdirective', function ($timeout) { return { restrict: 'e', scope: true, controlleras: 'parentctrl', controller: function () { var vm = this; vm.someproperty = true; vm.toggle = function () { vm.someproperty = !vm.someproperty; } }, link: function (scope, element, attrs, controller) { $timeout(function () { controller.toggle(); }, 1000); } } }); child directive...

How to upload massive amounts of files (up to 1000 photos) with php to website? PHP -

my website contains section users upload photo albums 1000 photos. currently, php upload script keeps crashing despite removing filesize , upload limits php.ini (i have removed restrictions against file uploading). how suggest going uploading many files? passing $_files array using move_uploaded_file function. ftp allow me upload smoother without interruptions, or should use new language together? these errors receiving: connection reset the connection server reset while page loading. site temporarily unavailable or busy. try again in few moments. if unable load pages, check computer's network connection. if computer or network protected firewall or proxy, make sure firefox permitted access web. --and-- request entity large requested resource /index.html/uploadanalbum.php not allow request data requests, or amount of data provided in request exceeds capacity limit. additionally, 413 request entity large error encountered while trying use errordocument handle request. th...

How to convert and use struct c++ to c# using dllImport? -

i haved tried using dllimport call c++ methods. déclaration of fonctions in c ++ : dword getreaderhandle (handle *handle); int getscandata (int *count,scn_etq *scandatabuf); int readbyate (byte *password,byte*ate,int atelen,int mr,byte *data,int datalen); struct scn_etq { int atelen; byte atebuffer[256]; }; please tel me how can convert in c# ?! how can initialise struct scn_etq use in main ? please need ! please need !

scala - Can we have an array of by-name-parameter functions? -

in scala have by-name-parameters can write def foo[t](f: => t):t = { f // invokes f } // use as: foo(println("hello")) i want same array of methods, want use them as: def foo[t](f:array[ => t]):t = { // not work f(0) // invokes f(0) // not work } foo(println("hi"), println("hello")) // not work is there way want? best have come is: def foo[t](f:() => t *):t = { f(0)() // invokes f(0) } // use as: foo(() => println("hi"), () => println("hello")) or def foo[t](f:array[() => t]):t = { f(0)() // invokes f(0) } // use as: foo(array(() => println("hi"), () => println("hello"))) edit: proposed sip-24 not useful pointed out seth tisue in comment this answer . an example problematic following code of utility function trycatch : type unittot[t] = ()=>t def trycatch[t](list:unittot[t] *):t = list.size match { case if > 1 => ...

Graph DB get the next best recommended node in Neo4j cypher -

i have graph using neo4j , trying build simple recommendation system better text based search. nodes created such as: album, people, type, chart relationship created such as: people - [:role] -> album roles are: artist, producer, songwriter album-[:is_a_type_of]->type (type pop, rock, disco...) people -[:popular_on]->chart (chart billboard might have been) people -[:similar_to]->people (predetermined similarity connection) i have written following cypher: match (a:album { id: { id } })-[:is_a_type_of]->(t)<-[:is_a_type_of]-(recommend) recommend, t, match (recommend)<-[:artist_of]-(p) optional match (p)-[:popular_on]->() return recommend, count(distinct t) type order type desc limit 25; it works however, repeats if has 1 type of music connected it, therefore has same neighbors. is there suggested way say: find me next best album has similar connected relationships starting album from. any recommendat...

c++ - Which example for a do-while loop? -

inside of do-while loop , if else statements in best interest @ end of statements change variables value , use create while boolean expression, or best set while expression being true, , use break statement in if else statements. to clarify, here 2 methods. do { cout << "what choice?" << endl; cin >> choice; if(choice == 1) { cout << "you chose 1" << endl; dowhilemodifier = 1; } else { cout << "that's not correct choice" << endl; dowhilemodifier = 0; } } while (dowhilemodifier == 0); vs do { cout << "what choice?" << endl; cin >> choice; if(choice == 1) { cout << "you chose 1" << endl; break; } else { cout << "that's not correct choice" << endl; } } while (true); i did first way, i'm leaning towards second example. input appreciated! both do-while loops job done pe...

javascript - Use ngModel on a custom directive with an embedded form, with working validation? -

i have commonly reused set of form inputs reused throughout application, trying encapsulate them in custom directive. want set ngmodel on directive , have split editable in several different inputs (some of them directives themselves) within main directive. at same time, need form validation results passed chain parent form can display appropriate messages , styles. what simplest , idiomatic way implement this? these (simplified) templates should give example of i'm going for... outertemplate.html <form name="outerform"> <my-directive ng-model="ctrl.mycomplexmodel" name="mydirectiveinstance" custom-required="ctrl.enablevalidateone" toggle-another-validation="ctrl.enablevalidatetwo"> </my-directive> <div ng-messages="outerform.mydirectiveinstance.$error"> <ng-message when="customrequired">this required.</ng-message> <ng-message whe...

best place to put javascript in wordpress function.php or function.js -

what best place put javascript function in wordpress? more appropriate in function.js or in function.php file? there difference in term of performance? i typically put custom functions in own js files easy organization enqueue in function.php file. https://codex.wordpress.org/function_reference/wp_enqueue_script this works if script has dependency such jquery. wp_register_script('script-name', get_template_directory_uri() . '/js/myawesomescript.min.js', array('jquery'), '1.0.0'); wp_enqueue_script('script-name'); // enqueue it! hope helps.

I am confused about expressions, side effects, types, and values in C++? -

my teacher handed me homework assignment. beginner, i'm not sure @ start, or chart asking for. can explain me simply? teacher wants fill in type, side-effect (if applicable,) , value: ( http://i172.photobucket.com/albums/w32/ravela_smyth/graph%201_zpslyxjgpde.jpg ) ( http://i172.photobucket.com/albums/w32/ravela_smyth/graph%202_zpskoo3upjw.jpg ) edit: why keep getting flagged down? don't understand did wrong? it simple: expression, part of code, something, + b type, asking, result type of expression, can tricky in c++ :). side-effects, statement has result type , result of sort expression can in same time update variables in process sife effects. here example: int = 0; int j = 0; int k = 1; auto rslt = cout << ++i << ( j += 2) << (k *= 5); //now type of rslt be? => &ostream, because &cout of type ostream // , used overloaded operators ostream , overloaded operator // returning ostream // hope know auto, auto leaving dec...

database - Like Command not working Oracle SQL -

i new databases , php. in code trying create table within php script, here have. create table booktable(bookid int primary key, bookname varchar(100), published date, price number(18,2), author1 varchar2(30), author2 varchar2(30)); insert booktable (bookid, bookname, published, price, author1, author2) values (1, 'fundamentals of digital logic vhdl design','14-apr-08', 190.25,'stephen brown','zvon ko g.vranesic'); insert booktable (bookid, bookname, published, price, author1, author2) values (2, 'distributed systems principles , paradigm','26-jul-13', 197.80,'andrew s. tanenbaum','maarten van steen'); insert booktable (bookid, bookname, published, price, author1, author2) values (3, 'eat real food solution permanent weight loss , disease prevention','1-apr-15', 29.99,'david gillespie',''); i...

postgresql - Postgres count with self referential join condition -

given following structure create table products ( id integer not null, subcategory_id integer, stack_id integer, ) create table subcategories ( id integer not null, name character varying(255) ) where products.stack_id self referential relationship products. i'm trying count of subcategories join products on products.subcategory_id = subcategories.id but limiting count once per distinct stack group. sample subcategories table id name 1 subcategory_1 2 subcategory_2 3 subcategory_3 sample products table id subcategory_id stack_id 1 1 null 2 1 1 3 2 1 4 3 1 5 2 null 6 2 5 7 2 5 8 2 null 9 3 8 10 3 8 sample desired output id n...

Racket : How can I turn a stream into a list? -

in racket, how can turn stream list? i assumed there'd common interface, seems list oriented functions map don't work on streams. how can turn them lists? there's procedure that: stream->list . example: (define s (stream 1 2 3 4 5)) (stream->list s) => '(1 2 3 4 5) make sure check documentation , there several procedures manipulating streams mirror ones available lists.

How to create a table of this given code in c? -

how can arrange in table address value , name appears in proper rows columns ? #include <stdio.h> #include <stdlib.h> #include <conio.h> int main() { int tuna = 20; printf("adress \t name \t value \n"); printf("%p \t %s \t %d \n",&tuna , "tuna", tuna); int * ptuna = &tuna; printf("%p \t %s \t %d \n", ptuna, "tuna", tuna); printf("%p \t %s \t %p \n", &ptuna, "tuna", ptuna); _getch(); return 0; } i modified program follows. here %-15 make sure data printed in 15 character field left indentation. of'course assumption took here data fit in 15 characters field. might want change per requirement. #include <stdio.h> #include <stdlib.h> #include <conio.h> int main() { int tuna = 20; printf("%-15s %-15s %-15s \n","address","name","value"); printf("%-15p %-15s %-15d \n",&tuna , "tuna", tuna...

html - Footer floating in the middle of the page -

i new coding , making first site on wp. have been bludgeoning wp submission using html 5 blank template. having trouble getting footer stay @ bottom of page rather floating in middle @ times. understand how on end, when in wordpress weird things happen. when make html height:100% in css or when make body position:absolute; content moves down page length of page. have been trying band-aid each individual page creates more , more problems. got ideas? the site (it's under random directory can build while it's not live). you have set height on html , body , on footer set position absolute. use below css html, body {padding:0; margin:0; height:100%;} footer{position: absolute; bottom: 0; left: 0; right: 0;}

r - sink() while simultaneously show ouput in console -

how can redirect output txt file in such way can see output simultaneously in console while generating step step? just use split=true argument of sink : sink(file="myfile",split=true)

ubuntu - Linux Command to Make Directory Tree in 1 command? -

hi there command make directorys in 1 command http://imgur.com/qarsaib would know struture thanks from manpage (try man mkdir ): synopsis mkdir [option]... directory... description create directory(ies), if not exist. -p, --parents no error if existing, make parent directories needed so can use: mkdir -p folder1/subfolder1 folder1/subfolder2 folder2/aap folder3/noot folder3/mies/piet and find return: . ./folder2 ./folder2/aap ./folder1 ./folder1/subfolder2 ./folder1/subfolder1 ./folder3 ./folder3/noot ./folder3/mies ./folder3/mies/piet

c# - SendKeys to another application without front -

i try link and want same when process not front, without setforegroundwindow is possible? seems no, can try use sendmessage function

javascript - How to extract month, day, year, hour in Unix Timestamp? -

in database insert date , time converted timestamp using strtotime, "1444600800" , have time duration service converted same process, "1443740700", using https://github.com/almasaeed2010/adminlte , its' http://fullcalendar.io/ , in calendar events, coded event: events: [ { title: 'all day event', start: new date(y, m, 1), end: new date(y, m, d, 13, 30), backgroundcolor: "#f56954", //red bordercolor: "#f56954" //red } ] i coded don't succeed: events: [ <?php $event_query = mysql_query("select *,time_format (`appoint_date`, '%h:%i') appointment inner join service,user appointment.user_id = user.user_id , service.service_id = appointment.service_id")or die(mysql_error()); while($event_row = mysql_fetch_array($event_query)...

r - plot mean of a continuous variable by a categorical variable and group by a factor -

Image
i'd think fundamental can't find how in introductory texts have nor googling. want plot mean of continuous variable categorical variable , group factor. continuous variable 'cd' (blood cd4 protein), categorical year (1 - 10 years), factor failure = 0 or 1. dataset 'f3' i've used aggregate mean cd year, can't find how group failure (0,1) no , yes. prefer use ggplot. the plot this: ggplot(f3, aes(factor(year), mean(cd), color = factor(failure))) + geom_line() + geom_point(size=2) is horizontal line or 2 lines overlaid, indicating group failure in legend. so, it's not plotting mean cd year, overall mean. please help. data : f3 <- structure(list(year = structure(c(6l, 7l, 8l, 9l, 10l, 1l, 2l, 3l, 4l, 5l, 6l), .label = c("1", "2", "3", "4", "5", "6", "7", "8", "9", "10"), class = "factor"), cd = c(555l, 511l, 540l, ...

c++ - Troubleshooting auto vectorize reason '1200' -

msvc 2013 ultimate w/ update 4 not understanding why getting error on seemingly simple example info c5002: loop not vectorized due reason '1200' which is 1200 loop contains loop-carried data dependences i don't see how iterations of loop interfere each other. __declspec( align( 16 ) ) class physicssystem { public: static const int32_t maxentities = 65535; __declspec( align( 16 ) ) struct vectorizedxyz { double mx[ maxentities ]; double my[ maxentities ]; double mz[ maxentities ]; vectorizedxyz() { memset( mx, 0, sizeof( mx ) ); memset( my, 0, sizeof( ) ); memset( mz, 0, sizeof( mz ) ); } }; void update( double dt ) { ( int32_t = 0; < maxentities; ++i ) <== 1200 { mtmp.mx[ ] = mpos.mx[ ] + mvel.mx[ ] * dt; mtmp.my[ ] = mpos.my[ ] + mvel.my[ ] * dt; mtmp.mz[ ] = mpos.mz[ ] + mvel...

Triggering Javascript Code from PHP Laravel Controller -

i'm using oauth login in laravel controller. working fine thing when user registered first time, wanna trigger html 5 geolocation api fetch user's current location , mixpanel stuff. earlier using ajax in js login there no such problem i've implemented complete server side solution, i'm stuck 1 problem. the laravel controller code looks : function callback(){ \\ fetch access token , graph data if($res = \auth::mjauthenticate('facebook', $fbdata)){ $user = \auth::scope()->getuser(); return \redirect::to('events'); } if (\auth::mjregister('facebook', $fbdata)) { $user = \auth::scope()->getuser(); return \redirect::to('events'); } return $this->handlefailure('some problem occured'); } ...

c# - i m not getting my insert query running in my sql database -

protected void button1_click1(object sender, eventargs e) { try { conn.open(); string idquery = "select top 1 pid post order pid desc "; cmd = new sqlcommand(idquery, conn); sqldatareader reader = cmd.executereader(); reader.read(); string p1id = (reader["pid"].tostring()); int pid = convert.toint32(p1id); textbox3.text = (reader["pid"].tostring()); conn.close(); sqlconnection conn1 = new sqlconnection(configurationmanager.connectionstrings["registrationconnectionstring"].connectionstring); string insertquery = "insert post (pid ,pidtype ,title ,question,creationdate) values (@pid,@ptype,@title,@question,@cdate)"; com = new sqlcommand(insertquery, conn1); datetime = datetime.now; ++pid; com.parameters.addwithvalue("@pid", pid); com.parameters.addwithvalue("@ptype", 1); com.p...

ubuntu - How to grant access to specific instances on amazon web services -

i have several ec2 instances on aws , wondering best way organize them in order keep order. far know, not possible group such instances e.g. of folder or similar. solution came stick naming convention. so, names of instances follows: examplecustomer-ubuntu-14.0.4-t2.micro-1 examplecustomer-ubuntu-14.0.4-t2.micro-2 examplecustomer1-ubuntu-14.0.4-t2.micro-1 examplecustomer1-ubuntu-14.0.4-t2.micro-2 now have several users/customers should see specific instances (e.g. customer1 should see instances starting examplecustomer1). therefore, created policy , attached user. idea use wildcard within arn-resourcepath, doesn´t seem work. have idea how achieve that? example policy: { "version": "2012-10-17", "statement": [ { "sid": "stmt1443859866333", "action": "ec2:*", "effect": "allow", "resource": "arn:aws:ec2:region:account-id:instance/cust...

html5 - How to put a map infowindow using html and angularjs -

hello newbie html , angularjs, making dmeo on google maps markers,i got marker on map,but want put infowindow on marker ,i have searched many things not fit in scenario,so me how put infowindow on map marker,my code below. html <div class="mapclass"> <ons-row class="app-map"> <ons-col> <map center="[{{lat}}, {{lng}}]"> <marker ng-model position="[{{lat}}, {{lng}}]" title= "{{tittle}}" animation="animation.bounce" visible="true" ></marker> </map> </ons-col> </ons-row> </div> js app.controller('listingdetailcontroller', function ($http, $scope, $compile, $filter, $sce,$timeout) { var searchtxt = 'cay'; var url = encodeuri("http://www.yahoo.com"); var page = gall...

prevent multiple form submission on keyup ajax post -

i working on form retail outlet in need submit form on enter keyup , redirect form same page. on enter keyup ajax post being submitted php function , on successful data insert doing page redirect. able currently, in few instances users hitting enter key multiple times (may 3 4 times in sec) because of being submitted multiple times. how prevent multiple submission. have tried generate random number , pass session token but, each submission generating new random number. here code $(document).keyup(function(e){ if (e.keycode == 13) { var postdata = $("#invoiceform").serialize(); $.ajax({ url: "addsale()", type: "post", data: postdata }); e.preventdefault(); return false; } }); use flag variable ignore new request if not completed previous , work lock. var isonway=false; $(document).keyup(function(e){ if (e.keycode == 13) { var postdata = $(...

printing - Jasper Report Print for LQ300+II -

i need create jasper report report size of 6' x 4' feed using tractor continuous paper. report printed 1st page.but second page printed close tear mark. 3 page started print end of second page. my page size in jasper 6'x4' page margins 0.278' sides. define paper size (user defined paper tab) in printing preferences, , set defined name under advanced option, paper size.

node.js - Uber API returns 404 'Invalid product' -

i have valid token , make request /products. take product_id response , send post /requests along body: { "product_id":"my-valid-product-id", "start_longitude":38.9, "start_latitude":-77.0, "end_longitude":"-77.0", "end_latitude":"38.9" } the response : {"message":"invalid product \"my-valid-product-id\". available: ","code":"not_found"} any idea what's up? edit issue has been resolved. wrong gps coordinates being sent uber rejected ride request. "available :" string means no ubers available @ incorrect gps location used.

linux - Redirect the output of watch command to a file with only one instance of the header printout -

i'trying measure memory usage of app smem reporting tool. want run memory measurement contimously every 5 seconds , output printout log file later investigation. want retain header in log file. far have concluded following command: watch -n 5 "smem -t -k | grep -e 'my_app | pid' | tee -a logfile.log" the printout succesfully redirected log file header line appears on every execution of watch command , looks : pid user command swap uss pss rss 8505 jim my_app 0 14.8m 16.7m 22.9m pid user command swap uss pss rss 8505 jim my_app 0 20.8m 23.7m 28.9m how can export 1 instance of header line in output file?

How to fix error with gradle appStart java web -

i have error starting gradle daemon (subsequent builds faster) exception in thread "thread-23" org.gradle.process.internal.execexception: problem occurred starting process 'command '/library/java/javavirtualmachines/jdk1.8.0_131.jdk/contents/home/bin/java'' when try run java web jroject gradle use gradle appstart my build.gradle file buildscript { repositories { jcenter() } dependencies { classpath 'org.akhikhl.gretty:gretty:+' } } apply plugin: 'java' apply plugin: 'war' apply plugin: 'org.akhikhl.gretty' gretty { httpport = 8080 contextpath = '/' servletcontainer = 'jetty9' } sourcecompatibility = '1.8' targetcompatibility = '1.8' repositories { mavencentral() } dependencies { compile ( 'org.springframework:spring-webmvc:4.1.5.release', 'org.slf4j:slf4j-api:1.7.10' ) providedc...

android - TextView not ellipsizing in LinearLayout inside TableRow -

i have tried make textviews ellipsize (they located in linearlayout inside tablerow), however, not ellipsize correctly unless manually set maxems (which not want do). note: entire xml (apart tablelayout) generated programmatically. i have tried fixes: messing (a bit) layout parameters, changing setmaxlines setsingleline, among other fixes still apologise if answer staring me in face! code generation: tablelayout tablelayout = (tablelayout) view.findviewbyid(r.id.table); // add text (int iter=0;iter<displayjson.summarydata.tasks.length;iter++) { tablerow tablerow = new tablerow(this); tablerow.setpadding(16,16,16,16); linearlayout container = new linearlayout(this); container.setorientation(linearlayout.vertical); tablelayout.layoutparams rowparams = new tablelayout.layoutparams( tablelayout.layoutparams.match_parent, tablelayout.layoutparams.wrap_content); tablerow.layoutparams layo...

c# - Navigating through a grid of panels -

Image
i'm trying make little project in c# using small grid of panels , 4 direction buttons shown here: but don't know how create easy navigation system using panels. "character" colored panel. panels named coordinates in front of them (p11 p66) there way kind of function take position of "character" , color panel on same position? example int coords = 21; private void up_click(object sender, eventargs e) { move(10); } void move(int coordchange) { pcoords.backcolor = color.white; coords = coords + coordchange pcoords.backcolor = color.black; } the pcoords part supposed panel on. part don't know how make. public class panels { public panel[, ] panelsarray=new panel[6,6] ; int xcoordinate; int ycoordinate; public panel currentpanel{get{return panelsarray[xcoordinate,ycoordinate];} public void moveup() { beforemove(); if(ycoordinate>0) ycoordinate--; onmove(); ...

ios - UIBezierPath Rotation around a UIView's center -

Image
i'm creating custom uiview , in implement draw(rect:) method drawing circle large width using uibezierpath, draw square on top (as shown in picture, don't consider colors or size). try creating rotated copies of square, match "settings" icon (picture 2, consider outer ring). last thing, need rotate square using cgaffinetransform(rotationangle:) problem rotation's center origin of frame, , not center of circle. how can create rotation around point in view? as demonstration of @duncanc's answer (up voted), here drawing of gear using cgaffinetransform s rotate gear tooth around center of circle: class gear: uiview { var linewidth: cgfloat = 16 let boxwidth: cgfloat = 20 let toothangle: cgfloat = 45 override func draw(_ rect: cgrect) { let radius = (min(bounds.width, bounds.height) - linewidth) / 4.0 var path = uibezierpath() path.linewidth = linewidth uicolor.white.set() // draw circ...

ios - How to run a Timer in connection the the display refresh rate? -

i have object calculate velocity of scrolling area. when user move finger off screen, object fire event every 10 ms update position of scrolling (regarding calculated velocity) , refresh screen (by calling setneedsdisplayinrect of glkview object). i m worry synchronize event actual display refresh rate (that 60 fps normally). under ios way fire event on each display refresh (so around every 16 ms) ? maybe must use cadisplaylink ? yes, sounds cadisplaylink best bet. designed sync screen refresh.

GitHub WebHooks triggered globally instead of per branch -

our product creates webhooks @ github. 1 each customer project. each such project, linked single branch. when push github performed, corresponding webhook triggered, in turn, making request endpoint on our side perform action. a common scenario customer have several projects, connected several different branches of same repository. hence, several different webhooks connected same repository. the problem when push performed 1 of branches, github triggers repository related webhooks. we expect when push made branch, single corresponding webhook triggered. i found 2 posts (one of them 2012) seem refer problem: web hooks - execute specified branches ability select specific branch in webhook a possible solution parse ref parameter sent inside webhook request , control when take action accordingly (haven't checked direction yet, , hope ref indeed exists , holds right branch path/name). "too late" - cause webhooks have been triggered then... but seem...

powershell - How to arrange values of different arrays in a tabular form? -

This summary is not available. Please click here to view the post.

c# - Cast from generic class property -

i want cast generic class of propertytype , dont know how it. i want this: var key = expression.property(generictype, rule.comparisonpredicate); type propertytype = typeof(t).getproperty(rule.comparisonpredicate).propertytype; var converter = typedescriptor.getconverter(propertytype); var value = expression.constant((propertytype)converter.convertfromstring(rule.comparisonvalue) ); but in line var value got error : 'propertytype' variable used type you cannot cast variable, should specify real type var value = expression.constant(( propertytype )converter.convertfromstring(rule.comparisonvalue) );

jquery - Tablesorter filter - multiple drop down in the same table header cell -

i using tablesorter filter widget in project. working fine 1 drop down list in table header. now want two(2) drop down list in same table header cell. my current code [edited] - <table> <thead> <th> <span class="filter-select filter-parsed" data-sorter="false" data-placeholder="option_1.."></span> <span class="filter-select filter-parsed" data-sorter="false" data-placeholder="option_2.."></span> </th> </thead> <tbody> <tr> <td> <span title="test">option 1 value</span> <span title="opt">option 2 value</span> </td> </tr> <tr> <td> <span title="test1">option 1 value1</span> <span title="opt1">option 2 value1</span> </td> </tr> <tr> <td> <sp...

How Hadoop manage load balancing -

i have started working on hadoop. want know how hadoop manage load balancing. if have 5nodes in 1 cluster how hadoop ensure each node have equal work load? there algorithm used hadoop load balancing? could please me learn hadoop? i'll assume mean yarn, resourcemanager, not hdfs, filesystem. yarn not ensure nor guarantee equal processing. in terms of mapreduce, if data heavily skewed towards particular key pairs, 1 process of 1 node bottleneck job. if instead meant hdfs, there's literally called hdfs rebalancer, that's ensure data spread within cluster jobs can become better distributed in terms of "data locality". however, still won't skewness of data.

java - Place elements in a spiral path without overlapping -

this similar question dont have enough rep comment on it, javafx position elements around central point except not know how modify create spiral path ends this . the example shows fixed radius objects rotating around point need objects not rotate. this code example have tried modify needs not work well. objects dynmaic in size purpose of hardcoded. public void start(stage primarystage) { pane pane = new pane(); double centerx = 300 ; double centery = 300 ; double earthradius = 30 ; double moonradius = 30 ; circle earth = new circle(centerx, centery, earthradius, color.web("blue", 0.5)); pane.getchildren().add(earth); int nummoons = 3 ; double gap = 10 ; double distance = 100 ; double angleincrement = 2 * math.asin((2 * moonradius + gap) / (2 * distance) ); (int = 0 ; < nummoons; i++) { double angle = math.todegrees(angleincrement * i) ; rectangle object = new rectangle (centerx + distance, ce...

c# - Rate of change with possible negative numbers -

Image
i feel stupid i'm having problems calculating change in % when working negative numbers. the calculation i'm using gives satisfying result when numbers > 0. decimal rateofchange = (newnumber - oldnumber) / math.abs(oldnumber); lets have 2 numbers 0.476(newnumber) , -0.016(oldnumber) that's increase of 0.492 , my calculation rate of change 3 075%. if instead have 0.476(newnumber) , 0.001(oldnumber) that's increase of 0.475 , my calculation give me rate of change of 47 500% wich seems correct. blue line represent example 1 , red line example two. in world blue line should have bigger % change. how write calculation give me correct % change when dealing negative numbers? want handle both increases , decreases in % change. i understand math issue , need work on math seems work me. decimal newnumber = 0.476m; decimal oldnumber = -0.016m; decimal increase = newnumber - oldnumber; // 0.492 true decimal rateofchange = increase / math.abs(old...

ios - View size is automatically being set to window size, when one of window's subview is removed -

Image
i have 2 views 1 of them mainvideoview (grey color) , other subvideoview (red color). both of them subviews of uiapplication.shared.keywindow . when try , minimise them (using func minimiseormaximiseviews , minimised (as shown in below image). after which, remove subvideoview window. moment try , remove subvideoview (using func removesubvideoviewfromvideoview() called func minimiseormaximiseviews ), mainvideoview enlarges full screen size, not sure why happening, want stay @ same size. could please advise/ suggest how achieve ? this how setting views func configurevideoview(){ videoview.backgroundcolor = uicolor.darkgray videoview.tag = 0 // identify view during animation // adding tap gesture maximise view when small let tapgesturerecognizer = uitapgesturerecognizer(target: self, action: #selector(handletap(gesturerecognizer:))) videoview.addgesturerecognizer(tapgesturerecognizer) // adding pan gesture recogniser make videoview movab...

Appending a string in python -

why statement produce error though string list of character constants? string_name="" string_name.append("hello word") the reason consider true because when use loop, allowed use statement- for in string_name: ...... i think string_name considered list here that's teach in algorithms , data structures class, deal algorithmic languages (unreal) rather real programming languages, in python, string string, , list list, they're different objects, can "append" string using called string concatenation: string_name="" string_name = string_name + "hello word" print(string_name) # => "hello word" or shorthand concatenation: string_name="" string_name += "hello word" print(string_name) # => "hello word" lists , strings belong type called iterable . iterable s they're name suggests, iterables, meaning can iterate through them key word in , doesn...

python - OSError unable to create file - invalid argument -

i using python , keras on top of tensorflow train neural networks. when switched ubuntu 16.04 windows 10, model not saved anymore when run following: filepath = "checkpoint-"+str(f)+model_type+"-"+optimizer_name+"-{epoch:02d}-{loss:.3f}.hdf5" checkpoint = modelcheckpoint(filepath, monitor='loss', verbose=1, save_best_only=true, mode='min') callbacks_list = [checkpoint] and later on: model.fit(x, y, batch_size=128, epochs=1, shuffle=false, callbacks=callbacks_list) i error: oserror: unable create file (unable open file: name = 'checkpoint-<_io.textiowrapper name='data/swing-projects100-raw/many-chunks/log-gamma-f3.txt' mode='a' encoding='cp1252'>2l128-adam-0.001-{epoch:02d}-{loss:.3f}.h5', errno = 22, error message = 'invalid argument', flags = 13, o_flags = 302) i have keras 2.0.8 , h5py 2.7.0 installed via conda. i tried filepath = "checkpoin...