Posts

Showing posts from March, 2010

java - Block after if(false) is executed -

Image
i hava java project , when try debug project have problem. blocks after if(false) condition executed , blocks after if(true) not. example: as can see in debug mode , line 65 executed , line 61 not executed. if do: boolean truevalue = boolean.true; boolean falsevalue = boolean.false; if(truevalue) { system.out.println("true"); } if(falsevalue) { system.out.println("false"); } both blockes executed. something strange happening. after build decompiled compiled classes , code ok(for fist example in compiled class have line "system.out.println("true");" , ok). i using glassfish server, java 7 , netbeans. reinstalled netbeans, restarted windows, build, clean project. if make new project in netbeans , copy paste examples above ok. can somenone advice me? the problem solved after installed again glassfish server.

PHP: Implode an array and use each array value multiple times -

what want achieve following: transform array: ['a','b','c']; into string like: "a a, b b, c c" is there other way foreach-loop (like implode) achieve this? if you're not looking loop through, use array_walk() function. try this: $input = ['a','b','c']; function test_alter(&$item, &$key) { $item = $item.' '.$item; } array_walk($input, 'test_alter'); echo implode(', ', $input); output: a a, b b, c c

ADFS login authentication sample on android using auth0 -

i trying develop adfs login authentication using auth0 in android app. am unable find proper document on adfs login.could please on this? not sure auth0 against adfs, can use ada sdk android work adfs 2012r2. 2012r2 supports auth code grant flow without id_token. .net client available pointer adal sdk android @ https://msdn.microsoft.com/en-us/library/dn633593.aspx on 2016, oauth support richer. examples (but .net client) available @ https://technet.microsoft.com/en-us/windows-server-docs/identity/ad-fs/ad-fs-development . can augment adal sdk android. thanks //sam (@mradfs)

javascript - Converting Image URL to base64 - CORS issue -

i'm trying embed images pdf using pdfmake. this, need use datauris images. this.getdatauri = (url) => { var defer = $q.defer(); var image = new image(); image.setattribute('crossorigin', ''); image.src = url; image.onload = function() { var canvas = document.createelement('canvas'); canvas.width = this.naturalwidth; canvas.height = this.naturalheight; canvas.getcontext('2d').drawimage(this, 0, 0); defer.resolve(canvas.todataurl('image/png')); }; image.onerror = function() { defer.reject(); }; return defer.promise; } i have function convert image url need, , working fine until recently, i'm getting error: image origin 'https://bucketeer-....s3.amazonaws.com' has been blocked loading cross-origin resource sharing policy: no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:3000' therefore not allowed access. here...

machine learning - Tensorflow Training and Validation Input Queue Separation -

i tried replicate convolutional network results using tensorflow. used marvin teichmann's implementation github . need write training wrapper. create 2 graphs share variables , 2 input queues, 1 training , 1 validation. test training wrapper, used 2 short lists of training , validation files , validation after every training epoch. printed out shape of every image input queue check whether correct input. however, after started training, seems images training queue being dequeued. both training , validation graphs take input training queue , validation queue never accessed. can explain , solve problem? here's part of relevant code: def get_data(image_name_list, num_epochs, scope_name, num_class = num_class): tf.variable_scope(scope_name) scope: images_path = [os.path.join(dataset_dir, i+'.jpg') in image_name_list] gts_path = [os.path.join(gt_dir, i+'.png') in image_name_list] seed = random.randint(0, 2147483647) image...

jquery - fnDraw is not redraw the datatable in ajax done request -

otable = $('#sldata').datatable({ "lengthmenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, 'all']], "order": [[ 0, "asc" ]], "pagelength": 10, 'processing': true, 'serverside': true, 'sajaxsource': '<?php echo base_url();?>dev.php/website/edit_categories_list', "columns": [null, null, null, null, null, {"orderable":false, "searchable": false}] }); this server side data table , trying redraw table after operation in ajax calling otable.fndraw(); in ajax done function not redraw datatable in advance first destroy datatable object , try initialize datatable in ajax done function otable.fndestroy(); $('#sldata').datatable(); try code, hope working.

sql - Optional Parameters in ABAP CDS VIEW? -

i'm trying create cds view consumption optional parameters. but, @ moment, optional parameters not supported. there workaround available somehow choose clauses executed/used based on input parameters ? did check consumption.defaultvalue annotation please have @ reference document

java - paintComponent method doesn't draw anything when I pass class's variable -

my java code: import java.awt.basicstroke; import java.awt.color; import java.awt.graphics; import java.awt.graphics2d; import java.awt.geom.ellipse2d; import javax.swing.jpanel; public class concentriccircles2d extends jpanel { double myx = 0; double myy = 0; int mywidth = getwidth(); int myheight = getheight(); public void paintcomponent(graphics g) { super.paintcomponent(g); graphics2d g2 = (graphics2d) g; g2.setpaint(color.blue); g2.setstroke(new basicstroke(5.0f)); g2.draw(new ellipse2d.double(myx, myy, mywidth, myheight)); } when use local variable inside paintcomponent method works fine. how can solve problem? (i create panel on separate class.) mywidth , myheight values set when concentriccircles2d object instantiated. has 0 weight , height @ point. so sentence ellipse2d.double(myx, myy, mywidth, myheight) is equal ellipse2d.double(0, 0, 0, 0) and paint no ellipse @ all. replace sentence g2.draw(ne...

Xcode git merged with master, cannot find any files -

i merged 1 of branches master through xcode. did, of files in project navigator disappeared. git in terminal has run me through loops trying revert previous commit. i relatively new git, please guide me through correct process of a) retrieving files, , (if feels being incredibly helpful) b) adding/merging branch master branch? edit the .xcodeproj file still intact , usable correct files, .xcworkspace file have been using (as result of cocoa pods ) no longer contains of appropriate files. so within .xcworkspace file, can no longer access scheme or find of files or utilize source control.

how can I get python's np.savetxt to save each iteration of a loop in a different column? -

this extremely basic code want... except regard writing of text file. import numpy np f = open("..\myfile.txt", 'w') tst = np.random.random(5) tst2 = tst/3 in range(3): j in range(5): test = np.random.random(5)+j = np.random.normal(test, tst2) np.savetxt(f, np.transpose(a), fmt='%10.2f') print f.close() this code write .txt file single column concatenated after each iteration of loop. what want independent columns each iteration. how 1 that? note: have used np.c_[] well, , will write columns if express each iteration within command. ie: np.c_[a[0],a[1]] , on. problem whit is, if both i , j values large? isn't reasonable follow method. so run produces: 2218:~/mypy$ python3 stack39114780.py [ 4.13312217 4.34823388 4.92073836 4.6214074 4.07212495] [ 4.39911371 5.15256451 4.97868452 3.97355995 4.96236119] [ 3.82737975 4.54634489 3.99827574 4.44644041 3.54771411] 2218:~/mypy$ cat myfile.t...

html - Make Looping Table PHP -

Image
i want make looping table in project. here code: <!doctype html> <html> <body> <table align="left" border="1" cellpadding="3" cellspacing="0"> <?php for($i=1;$i<=6;$i++) { echo "<tr>"; ($j=1;$j<=5;$j++) { echo "<td>$i"</td>"; } echo "</tr>"; } ?> </table> </body> </html> i want make looping table auto number in first column. response this: can 1 tell me how can make in first column? expected result: then move $i outside of inner loop , add empty table data. reduce inner loop iteration 1 count: <!doctype html> <html> <body> <table align="left" border="1" cellpadding="3" cellspacing="0"> <?php for($i=1;$i<=6;$i++) { echo "<tr>"; echo "<td>$i</td>...

highest frequency at which an ANSI C routine can run on an embedded system -

which of following correctly identify highest frequency @ ansi c routine can run on embedded system if execution time 18 miliseconds a 18 hz b 55 hz c 18 khz d 0.055 hz e 55khz what relationship between execution of routine , maximum frequency of , embedded system? the assumption here program piece of software running on embedded system. int main(void) { .... while(1) { ansi_c_function() } } if function takes 18 ms, frequency of calling function? the answer 1/18ms i.e. 55 hz

c++ - realloc() causes segmentation fault -

i have code: perro **obj = null; obj = (perro**)malloc(10*sizeof(perro*)); (int = 0; < 10; i++) { obj[i] = new perrito((char*)"d",i); } realloc(obj,12*sizeof(perro*)); (int = 9; < 12; i++) { obj[i] = new perrito((char*)"d",i); } (int = 0; < 12; i++) { perrito *p; p = (perrito*)obj[i]; cout << p->getedad() << endl; } when read object see memory dumped (segmentation fault) error. when comment out realloc line , reduce last length item works normally, need use realloc increase polifirmist object length. obj = realloc(obj,12*sizeof(perro*)); pointer change after realloc!

reporting services - How to disable parameters in SSRS after report execution -

what want once parameters set , view report pressed, want disable parameters.that is, once user has entered parameters , have ran report can not change parameters unless refreshes whole page. can done? thanks! there's not way directly, can accomplish using pair of reports @ cost of needing click users @ points: create "child" version of report has hidden parameters. create parent version of report no data elements has public parameters. add link-style textbox parent report action navigates child report using parent's parameters. for convenience, add link-style textbox child report go parent re-enter parameters. (optional) if desired, include read-only textboxes displaying parameters on child report. (optional) so user: enter parameters, click on link view report. if want change parameters, need click on link go back, force refresh.

One or more placement constraints on the service are undefined on all nodes that are currently up -

trying setup specific services deploy specific node types getting error using visual studio publish dialog (that breaks calling new-servicefabricapplication ps command) i using service manifest define placementconstraints this: <statelessservicetype servicetypename="visualobjects2.webservicetype" > <placementconstraints>(nodetype==node2)</placementconstraints> </statelessservicetype> how can define placement constraints on nodes? in azure portal, go sf cluster, select node types , each 1 can add key-value list of placement constraints. there put key-value: nodetype = node2. after this, deployment done in nodes attribute

javascript - CSS/Jscript height problems -

i trying make grid of squares updates size of window. using following js code this: $(window).ready(updateheight); $(window).resize(updateheight); function updateheight() { var div = $('.grid'); var width = div.width();; div.css('height', width); var ratio=14.3/126; div = $('.face'); width = div.width();; div.css('height', width+(ratio*width)); ratio=30.5/15; div = $('.cubie'); width = div.width();; div.css('height', width+(ratio*width)); }; the cubies nested inside faces, nested inside grid in html. first tried setting height with div.css('height', width) ..but reason didn't make faces , cubies square. ratio thing helps correct on screen size, smaller make window more noticeable error becomes, i'm searching different solution right now, , cant seem find one. appreciated. ps: if matters, .grid width 50% of body, .face 20% of .grid, , .cubie ~33% of that.

javascript - Rendering js.erb in rails -

i want try js.erb if working? here view posts/index trigger <%= link_to "like", {:controller => 'post', :id => post , :action =>'like'}, class: "btn btn-danger btn-xs", remote: true %> my post controller def @user = current_user @post.liked_by(@user) redirect_to posts_path respond_to |format| format.html {redirect_to posts_path} format.js { render :action => 'stablelike' } end end and js.erb test alert("working"); and error: when inspect chrome abstractcontroller::doublerendererror @ /post/like/85 render and/or redirect called multiple times in action. please note may call render or redirect, , @ once per action. note neither redirect nor render terminate execution of action, if want exit action after redirecting, need "redirect_to(...) , return". app/controllers/posts_controller.rb, line 83 ``` ruby 78 @user = current_user 79 @post.liked_by(@user) 80 ...

posix - Ignore data coming in to TCP socket -

some protocols http can specify message length, send (possibly long) message. no other messages can received while message being sent (something http/2.0 tried solve) if decide ignore message, can't continue waiting messages , not pull data. normally read() length of message repeatedly junk buffer , ignore bytes. involves copying possibly millions of bytes kernelspace userspace (at 1 copy per memory page, not millions of copies). isn't there way tell kernel discard bytes instead of providing them? it seemed obvious question, answer i've been able come oddly resource heavy, either using splice() dump bytes pipe , seeking pipe 0, or opening "/dev/null" , using sendfile() send bytes there. that, , reserve (single) file descriptor flushing data out of clogged connections, without reading, isn't there a... ignore(descriptor, length) function?

python - Unique items in list of sets -

if have list of sets: >>> lst = [{1, 2}, {0, 1}, {1, 2}] how return unique items? trying known set() not work: >>> set(lst) typeerror: unhashable type: 'set' if "unique items" mean unique sets, use frozenset , hashable immutable version of set . either build sets frozenset objects initially, or if need mutate them, like: uniques = set(frozenset(s) s in lst) then: >>> uniques set([frozenset([1, 2]), frozenset([0, 1])])

python - ploting and save multiple functions in the same file matplotlib -

Image
i want save 6 graphs in 1 page using matplotlib. graphs each call of a function , came code below test before saving it: def save_plot (output_df, path = none): fig = plt.figure(1) sub1 = fig.add_subplot(321) plt.plot(plot_ba(output_df)) sub2 = fig.add_subplot(322) sub2.plot(plot_merchantablevol(output_df)) sub3 = fig.add_subplot(323) sub3.plot(plot_topheight(output_df)) sub4 = fig.add_subplot(324) sub4.plot(plot_grtotvol(output_df)) sub5 = fig.add_subplot(325) sub5.plot(plot_sc(output_df)) sub6 = fig.add_subplot(326) sub6.plot(plot_n(output_df)) plt.show() the way is, create page 6 empty plots, create 6 separate plots every function call. plot_ba(output_df), example, function call read csv file , create plot (individually working). other similar functions , working well. seems missing put graphs in designated place of fig. here 1 of functions using. def plot_ba(output_df): ba = output_df.loc[:,['ba_aw',...

scala - An efficient structure in which to keep a hash key and a collection of values -

i developing stateful application. states need data structure has hash-key , collection of values related key. the collection should efficient , occupy least amount of memory possible. collection should mutable: items need removed or added. is there such collection in scala? the basic structure you're looking map nested collection: map[k, set[v]] normally, considered best practice use immutable values: val first_state: map[string, set[string]] = map("a key" -> set("alpha", "omega")) val second_state = first_state + ("another key" -> set("theta", "iota")) val third_state = second_state + ("another key" -> set("kappa")) the above results in following values: first_state: map[string,set[string]] = map(a key -> set(alpha, omega)) second_state: scala.collection.immutable.map[string,set[string]] = map(a key -> set(alpha, omega), key -> set(theta, iota)) third_state...

variables - Checking which lines of a file are not in another file time efficiently in perl -

i want compare file file , find out lines found in input file not file being compared to this script right now #!/usr/bin/perl $data_file = "file.txt"; @data; { open $fh, "<", $data_file or die qq{unable open "$data_file" input: $1}; while ( <$fh> ) { next unless /\s/; push @data, [ split ]; } } $found; while ( <> ) { $found=0; ($num, $spot, $sstart, $sstop, $name, $id, $start, $stop) = split; $item ( @data ) { ($unum, $uspotstart, $uspotstop, $uspot, $udontuse, $ustart, $ustop, $uname) = @$item; if ( $uname eq $name , $start == $ustart , $stop == $ustop , $unum eq $num ) { $found=1; last; } } if ($found==0){ print $_; } } the script works problem can never finish compiling because file.txt contains 200,000 lines , input file contains 20,000 lines this example of in file.txt 1 1729 1858 25 g 6600 6700 sam 15 9302 ...

java - Java8 slow compiling for interfaces with thousands of default methods with the same name -

Image
given interfaces (which large , generated out of language definitions): interface visitora { default void visit(asta1 node) {...} ... default void visit(asta2000 node) {...} } interface visitorb extends visitora { default void visit(astb1 node) {...} ... default void visit(astb1000 node) {...} // due language embedding visit methods of visitora // must overwritten @override default void visit(asta1 node) {...} ... @override default void visit(asta2000 node) {...} } interface visitorc extends visitora { default void visit(astc1 node) {...} ... default void visit(astc1000 node) {...} // due language embedding visit methods of visitora // must overwritten @override default void visit(asta1 node) {...} ... @override default void visit(asta2000 node) {...} } interface visitord extends visitorb, visitorc { default void visit(astd1 node) {...} ... default void visit(astd1000 node) {...} // due languag...

SharePoint 2013 Upload file to folder in document library -

i have following code places file in document library: public static void uploadfile(string siteurl, string libraryname, string file) { string filetoupload = file; string sharepointsite = siteurl; string documentlibraryname = libraryname; using (spsite osite = new spsite(sharepointsite)) { using (spweb oweb = osite.rootweb) { if (!system.io.file.exists(filetoupload)) throw new filenotfoundexception("file not found.", filetoupload); spfolder mylibrary = oweb.folders[documentlibraryname]; // prepare upload boolean replaceexistingfiles = true; string filename = system.io.path.getfilename(filetoupload); filestream filestream = system.io.file.openread(filetoupload); // upload document spfile spfile = mylibrary.files.add(filename, filestream, replaceex...

asp.net mvc - User Permissions in serene for visual studio -

i have created project mentioned in - https://volkanceylan.gitbooks.io/serenity-guide/content/tutorials/movies/creating_movie_table.html have ceated moviedb mentioned in guidelines. trying give role access movie table movie doesnt listed in userpermissions tab. has ever faced such problem or has worked serenity @ ? serenity permissions not based on tables. put on rows readpermission etc attributes used. in guide, didn't touch detail, rows has administration permission. if change permission movie rows else e.g. "moviedb", shown in permissions dialog.

date arithmetic - multiplication of doubles variables -

a question saw , didn't quite understand. first create arbitrary values: int x = random(); int y = random(); int z = random(); (int 32 bits) continue with: double dx = (double) x; double dy = (double) y; double dz = (double) z; (double 64 bits) the question tell if next statements always true (returns 1) or not. a. dx+dy+dz==dz+dy+dx b. dx*dy*dz==dz*dy*dx the answer (a) "yes, within range of exact representation double's" (so, or not always true? , if not always true, example of 3 values dx, dy, dz returns 0) the answer (b) "no, e.g dx=tmax, dy=tmax-1, dz=tmax-2" tried , turned out same result (but i'm wrong :-/ ) i understand why answers correct thanks! in floating point arithmetic, should never test equality. classic example 0.1 + 0.2 != 0.3 . (see http://0.30000000000000004.com/ more information, particularly see if language hides you. has nice explanation of how arises because 0.1 , 0.3 can't represented...

Is there a way to get rid of the annoying help messages in git status? -

changes not staged commit: (use "git add <file>..." update committed) (use "git checkout -- <file>..." discard changes in working directory) this of output when running git status . i don't mind "changes not staged commit:" message, don't want see "help" commands how "update committed" etc, add lot of noise. i know git status -s , that's not want. is there way of getting rid of messages? in git-config documentation can find variable statushints of subsection advice.* explained this: statushints show directions on how proceed current state in output of git-status(1), in template shown when writing commit messages in git-commit(1), , in message shown git-checkout(1) when switching branch. so assume setting $ git config advice.statushints off should rid of these messages (for local repository, use --global repositories of current user on machine)

Android/Java: Multiple similar classes needing a super class, not sure where to start -

let's have 2 similar classes: apple.java public class apple { public string getfruitname(){ return "apple"; } public string getfruitcolor(){ return "red"; } } banana.java public class apple { public string getfruitname(){ return "banana"; } public string getfruitcolor(){ return "yellow"; } } in application, have need global variable can dynamically generate global scope banana or apple anywhere. the catch is , don't know 1 of these generated, apple, or banana. i'm guessing need superclass, maybe fruit.java, , instantiate global variable called fruit. when call fruit.getfruitname , fruit.getfruitcolor expect returned apple or banana, whichever randomly generated. don't know how give of these guys parent class. example of application public class main extends appcompatactivity { fruit fruit; ... public void randomfruit() { frui...

swift - Get email and time stamp from sent emails saved on a tableview -

im using mfmailcomposeviewcontroller send emails, after sent email show email , time done on tableview. how can that? my table code basic //this empty, populate empty table var sentemails = [string]() //number of sections func numberofsectionsintableview(tableview: uitableview) -> int { return 1 } //number of rows func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { return sentemails.count } //cell configuration func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier(cellidentifier, forindexpath: indexpath) let row = indexpath.row cell.textlabel?.text = sentemails[row] //email here? cell.detailtextlabel?.text = "time stamp"//maybe? return cell } this code mail func contactpicker(picker: cncontactpickerviewcontroller, didselectcontactproperty contactproperty: cncontactproperty) { //ch...

javascript - Trigger mouse click on a button each 5 seconds -

how trigger mouse click on element (slider "next" button) each x seconds? i have built website in adobe muse, slider widget doesn’t have auto play function, , i’m trying make next button click each 5 seconds simulate autoplay. i’ve found class button <div class="fp-controlarrow fp-next"></div> maybe there chance trigger clicking somehow? thanks use setinterval() : setinterval(() => { element.click() }, 5000) where element reference dom element.

class - global variable not working python -

hello there developers, i writing code takes user input , initializes class depending on input in example code below: class x: def __init__(self): return def run(self): print("i x") def func1(cls): exec("global " + cls.lower()) exec(cls.lower() + " = " + cls + "()") def func2(mode_to_set): exec(mode_to_set.lower() + ".run()") but run code this: func1('x') func2('x') i keep getting error: traceback (most recent call last): file "/users/noahchalifour/desktop/test.py", line 16, in <module> func2('x') file "/users/noahchalifour/desktop/test.py", line 13, in func2 exec(mode_to_set.lower() + ".run()") file "<string>", line 1, in <module> nameerror: name 'x' not defined can me? a better way instantiate class based on user input use "factory pattern": http://python-3-...

ios - Center UICollectionViewCells -

Image
i need fix small issue uicollectionview, when on 6s device size layout this: however, want know best way either center them 2 lines, or should shrink them down bit can put 3 of them? think prefer center 2 columns instead i'm not cramming onto same screen. looked wasn't sure layout formatting. thank you! i believe 1 or both of these looking for. play values return , see happens. also, constraint inside each cell have effect can not predict without seeing them. func collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionview, minimuminteritemspacingforsectionatindex section: int) -> cgfloat { return 0 } func collectionview(collectionview: uicollectionview, layout collectionviewlayout: uicollectionviewlayout, insetforsectionatindex section: int) -> uiedgeinsets { return uiedgeinsetsmake(0, 0, 0, 0) }

gsm - How to send S@T Byte Code as SMS with kannel? -

i wrote simple code convert s@t ml files s@t byte code, have working kannel, can send sms via curl "http://localhost:13013/cgi-bin/sendsms?username=username&password=somepassword&text=%1b%06%01%ae%02%05%6a%00%45%c6%0c%03alicom%00%01%03yaali%00%01%01&from=xxx&to=xxx&udh=%06%05%04%0b%84%23%f0&priority=2" how can send byte codes , should udh be? the udh 0x70 0x00 however least of concerns. s@t byte code sent card via s@t gateway. gateway additional work in order secure message. if card has no security maybe bytecode can sent 99.9% sure need "encrypt" byte code according security settings of card. spi kic , kid values.

odata - Apache Camel-Oling2 read endpoint is not working -

i using apache camel , trying read odata using camel-olingo2 component got "serviceuri" error everytime. i've tried documentation implementation couldn't find success. please let me know way of connectivity odata using camel-olingo2 component. code: <bean id="parambean" class="org.springframework.beans.factory.config.mapfactorybean"> <property name="sourcemap"> <map key-type="java.lang.string" value-type="java.lang.string"> <entry key="serviceuri" value="http://services.odata.org/odata/odata.svc"/> </map> </property> </bean> <camelcontext id="camel" xmlns="http://camel.apache.org/schema/spring"> <route> <from uri="olingo2://read/persons?queryparams=#parambean" /> <to uri="file:d:\camel\output" /> </route> </camelcontext> exc...

What is the difference between Azure App Services API Apps and the Custom API of App Services Mobile Apps? -

azure app services mobile apps can provide custom api hosting service looks similar api apps. what real difference between two? is possible consume mobile services api apps node backend ? there mobile apps sdk available nodejs ? https://azure.microsoft.com/en-us/documentation/articles/app-service-mobile-node-backend-how-to-use-server-sdk/ azure api apps hosting apis consumed variety of clients, , acceptable codegen client, or make direct rest calls. azure mobile apps defines client , server sdk protocol communication adds additional functionality things such offline sync. offline sync not possible api apps, because there no actual client sdk, tools generating 1 different platforms.

oracle - PL/SQL recursive function return no value -

i got error message while running oracle pl/sql recursive function function returned without value anyone knows might issue? here's function function cgic (cnt in number) return varchar2 n_inv_code varchar2 (20); t_ic_chk number; begin select dbms_random.string ('x', 10) n_inv_code dual; select count(*) t_ic_chk inv_code inv_code = n_inv_code , rownum = 1; if t_ic_chk = 1 n_inv_code := cgic(cnt); else if t_ic_chk = 0 return n_inv_code; end if; end if; end cgic; in event t_ic_chk = 1 you assign value of recursive function variable: n_inv_code however, don't it. want return it. i recommend code in final section: if t_ic_chk = 1 n_inv_code := cgic(cnt); end if; return n...

html - Smart background div with circle but what if is background-image -

i have div , span. span circle border added on it. div has simple background , move - top. if background isn't color , background-image how so. sorry bad english html <div id="main"> <span class="circle"></span> <div class="div"> </div> </div> css #main { text-align: center; } .circle { background: #298eea; display: inline-block; width: 80px; height: 80px; margin-top: 30px auto; border-radius: 50%; border: 15px solid #f3f5f6 } .div { padding: 80px 80px 60px 80px; background: #282c39; border-radius: 3px; margin-top: -45px; } checkout jsfiddle you may use pseudo element , use shadow draw background-color. #main { text-align: center; } html { background: linear-gradient(45deg, white, gray, gold, purple, gray, white, gray, gold, purple, gray, white, gray, gold, purple, gray, white, gray, gold, purple, gray, white, gray, ...

Convert a regex struct in to a string in elixir -

is there simple way string representation of regex? passing regex io.inspect prints out string representation assume must possible in way you can use regex.source/1 . regex.source(regex) returns regex source binary. demo: iex(1)> regex.source(~r/[a-z]/) "[a-z]"

Google BigQuery Internal Error -

all of sudden morning i've been unable run bigquery queries. i try running "select 1" , response: query failed error: internal error occurred , request not completed. job id: remilon-study:bquijob_1c8abe36_156b86c9942 this happening queries. google's cloud status page shows fine. thanks. i engineer on bigquery team. looked @ job id have provided, , affected temporary internal error morning affected subset of queries short amount of time. had nothing query - sorry inconvenience caused you. edit: typo

c++ - Why do I get a segementation fault while calculating the one's complement of a binary number? -

i have written c++ code store binary number using doubly linked list lsb stored in head node. whenever enter '0' in head node segmentation fault while calculating one's complement, not have problem when enter '1' in head node. my code: #include<iostream> using namespace std; class node { int bin; node *prev,*next; public: node(int b) { bin=b; prev=null; next=null; } friend class ii; }; class ii { node *head,*tail; int digits; public: ii() { head=null; tail=null; } void dig() { cout<<"enter number of digits: "; cin>>digits; if(digits<2) { cout<<"please enter more digits: "; cin>>digits; } else{} } void create() { int y; if(head==null) { node *q; cout<<"enter binary digit: "; cin>>y; if(y<0||y>1) { cout<<"enter again: "; cin>>y; } q=new node(y); head=q; h...

javascript - jquerymobile. double execute function -

i have such code: function getdata(){ $.ajax({ url: 'http://pechati.ru/extdata/baseparts/filialswsunsec.php', contenttype: "application/x-www-form-urlencoded;charset=utf8", datatype: 'json', success: function(jsondata){ //alert('load performed.'); console.debug('data received.'); //jsondata = win2unicode(jsondata); console.debug(jsondata); $.each(jsondata,function (filial,datafilial) { // //console.debug(filial); var option = '<option value="'+filial+'" data-phone="'+ datafilial.phone+ '" data-email="' + datafilial.email + '"> ' + filial + '</option>'; //filial active var activefilial = 0; if (parseint(datafilial.mainlist)>0){ ...

html - Css - make drop down scroll down -

here css code: .sub-menu li { float: none !important; border-right: none !important; } .sub-menu { z-index: 1000; position: absolute; background: #222; padding: 15px; border-right: 2px solid white; display: none; } .menu ul li:hover .sub-menu { display: block; } here html code: <div class="menu"> <ul> <li><a href="#">home</a></li> <li><a href="#">watch live</a></li> <li><a href="#">programs</a> <ul class="sub-menu"> <li><a href="#">films</a></li> <li><a href="#">documentary</a></li> <li><a href="#">comedy</a></li...

c++ - "no operator "!=" matches these operands" for Iterator comparison after migration to VS2015 -

i upgrading vc++6 project vs2015. have if statement checking iterator against being null (actually 0). code building in vc++6 , vs2003 without error in vs2015 throws error. here code: here type definitions: #define null 0 typedef std::list <bsctrk *> bsctl; typedef bsctl::iterator bsctli; // data type of iterator trunk linked list typedef struct { int tsnum; bsctli tli; // iterator of trunk reset } tnkreset; extern tnkreset gtnkreset; here piece code throwing error in vs2015: if (gtnkreset.tli != null) resetradtnk (gtnkreset.tli); error: severity code description project file line column suppression state detail description error (active) no operator "!=" matches these operands bscc operand types are: bsctli != int i have tried nullptr didn't help.what problem here? you should never compare iterators else other iterators same container. proper way init...

java - Vertx: Why is there no clustered verticle? -

im messing around 2 verticles , want start in clustered mode. here start-methods of 2 verticles: first verticle: public static void main(string[] args) { vertxoptions options = new vertxoptions(); options.setclustered(true); options.setclustermanager(new hazelcastclustermanager()); vertx.clusteredvertx(options, res -> { vertx vertx = res.result(); vertx.deployverticle(new walzenschnittblmock()); }); } second verticle: public void start() { vertxoptions options = new vertxoptions(); vertx.clusteredvertx(options, res -> { vertx = res.result(); vertx.deployverticle(serviceverticle, this::completeregister); }); } thhis 2 verticles reside on different machines, not "see" each other, although there in clustered mode....is there problem..have missed something? i found solution: i have 2 machines , each of them have 4 networkcards - , vertx seems choose wrong one. forced set ip-adres...

unit testing - CMake - run test as part of the build process and capture stdout output to file -

we have several unit tests run part of our build process. to achieve have helper script creates custom command runs test, , if successful, creates file "test_name.passed" . i add custom target "test_name.run" depends on "test_name.passed" . the idea if "test_name.passed" doesn't exist or older "test_name" , custom command run. builds continue run custom command until test passes. once passes, subsequent builds won't call custom command, test won't run when doesn't need to. so far works described here script: # create command runs test , creates sentinel file if passes add_custom_command( output ${test_name}.passed command $<target_file:${test_name}> command ${cmake_command} -e touch ${test_name}.passed depends ${test_name} ) # create test.run module depends on test.passed add_custom_target(${test_name}.run depends ${test_name}.passed ) the problem - noise on s...

grails - Missing table in database -

hello have domain class user , created myself controller register people.when run project , enter fields , press enter error by: org.springframework.jdbc.badsqlgrammarexception: hibernate operation: not extract resultset; bad sql grammar [n/a]; nested exception org.postgresql.util.psqlexception: error: column this_.id not exist i connected postgresql .i have other domain classes have own table in database, domain class doesn't have think reason error,how can fix it? class user { string login string password string name static constraints = { login size: 3..20 , unique: true, nullable: false password size: 3..20, unique: false, nullable: false name size: 3..20, unique: false, nullable: false } } class usercontroller { def scaffold = user def login = {} def authenticate = { def user = user.findbyloginandpassword(params.login, params.password) if(user){ session.user = user ...

css - "Filling Water" effect with infinite repeat wrapping -

i've been trying achieve effect seen here 1 wave in circle: http://www.jquery-az.com/css/demo.php?ex=131.0_1 unfortunately, i've been unable animation repeat smoothly own svg, seen here: http://jsbin.com/diserekigo/1/edit?html,css,output . you'll notice bottom "rectangle" part isn't filled either. my css follows: .circle { border-radius: 100%; border: 1px solid black; width: 200px; height: 200px; overflow: hidden; position: relative; perspective: 1px; } .liquid { position: absolute; left: 0; top: 0; z-index: 2; width: 100%; height: 100%; -webkit-transform: translate(0, 80%); transform: translate(0, 80%); } .wave { left: 0; width: 400%; position: absolute; bottom: 100%; margin-bottom: -1px; -webkit-animation: wave-front .7s infinite linear; animation: wave-front 0.7s infinite linear; } @-webkit-keyframes wave-front { 100% { -webkit-transform: translate(-100%, 0); transform: translate(-1...

R: Stanford CoreNLP returnning NAs for getSentiment -

i have following text data: i prefer old-school guy. have phd degree in science. not interested in finding same background, otherwise life gonna boring. and trying extract out sentiment scores of above text, nas. dating3 = annotatestring(bio) bio.emo = getsentiment(dating3) id sentimentvalue sentiment 1 1 na na 2 2 na na 3 3 na na i not know why occuring , googled around did not find relevant answers. in meantime, when tried sample data provided within corenlp package getsentiment(annohp) id sentimentvalue sentiment 1 1 4 verypositive it gives me answer, don't know why happening. appreciate if can offer insight. hopefully have found , else, known bug fixed on github version, see here: https://github.com/statsmaths/corenlp/issues/9

matlab - Display an image on the X-Z plane (instead of the default X-Y) -

Image
i can image plot on x-y plane using imagesc , have on x-z plane further usage. there way so? thanks! i'd use surface instead of imagesc : input = [3,4,5 4,5,6]; %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% figure(); zz = padarray(input,[1 1],0,'post'); % see note #2 [xx,yy] = meshgrid((1:size(input,2)+1)-0.5,(1:size(input,1)+1)-0.5); % imagesc subplot(3,1,1); imagesc(input); xlim([0 4]); ylim([0.5 2.5]); view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); grid on; title('imagesc'); % normal (x-y): subplot(3,1,2); surface(xx,yy,0*xx,zz,'edgecolor','none','facecolor','flat'); view([-50 50]); xlabel('x'); ylabel('y'); zlabel('z'); axis ij; box on; grid on; title('x-y surface'); caxis([min(input(:)),max(input(:))]); % rotated (x-z): subplot(3,1,3); surface(xx,0*zz,yy,zz,'edgecolor','none','facecolor',...

sql - Why would Access spontaneously start displaying a non-existant table in a query? -

Image
i updated simple access select query, adding 4 fields single table query uses. when attempted edit data in form references query, access did not allow edits. after poking around @ other possible edit rights problems went query design, , saw this: the table cc_tracker_1 not exist in database, nor there query name, can see in object list: in design view, cc_tracker_1 displays exact copy of cc_tracker. additionally, 4 fields added had cc_tracker_1 listed table of origin. deleting cc_tracker_1 query , re-adding fields cc_tracker fixed problem, i'm curious how happen. edit add: sql access generated. can see alias created isn't used anywhere in code except in variable list. why still question: select cc_tracker.last_name, cc_tracker.first_name, cc_tracker.mrn, cc_tracker.rin, cc_tracker.subscriber_id, cc_tracker.assigned, cc_tracker.letter, cc_tracker.[1stcall], cc_tracker.chra, cc_tracker.[icp/review], cc_tracker.f2f, cc_tracker.ictcont, cc_tr...

Why we use laravel seed, if there is migration and eloquent that plays the role for database concept? -

i confused laravel seed concept. let me clear, in laravel there eloquent , migrations use crud operation database use in our controllers. in seed uses storing information in database table. why important instead of have 2 eloquent , migration database. migrations nothing more laravel's way of maintaining database in friendly way. exporting , importing .sql files on every team member's computer everytime makes change database gets old , annoying fast. migrations make sure have type artisan migrate , you're date. eloquent laravel's "object relational mapper" defines how app communicates database (in case model since laravel uses mvc architecture). models in laravel written in php , don't direct actions on database, act sort of facade makes easy stuff in database. seeds little files let push in database, can test app. example, if need 3 different users different user roles, running command artisan db:seed lot faster making users manually in...

sql - SSRS - Line break in Matrix cell -

in ssrs matrix cell want able have line break between each output given. i have following code in ms sql server stored procedure point ssrs report select customer, hostname, (qname + qhostname + qtag + qserial + qcategory + qtype + qitem + qmanu + qmodel + qversion) additionalinfo1 tableq at moment in additionalinfo1 cell when 1 of options returned separated comma e.g. qname, qhostname, qtag. instead them separated line break within same cell e.g. qname qhostname qtag i have tried putting + char(13) + between each q... in additionalinfo1 didn't work. for ssrs, want use chr(10), not chr(13). i've used in expressions , join delimiter argument , produced desired effect: line breaks within textbox. edit: below expression include fields line breaks if value present, or omit both if field null. =fields!qname.value + iif(isnothing(fields!qhostname.value),"", vbcrlf + fields!qhostname.value) + iif(isnothing(fields!qtag.value),...

Dynamically deleting a rails model -

i'm trying dynamically create , delete rails models. creation works not deletion. i've tried deleting constant still present rails subclass: object.send(:remove_const, :modeltobedeleted) # check it's gone object object.constants.include? :modeltobedeleted # => false # still in rails: activerecord::base.subclasses # returns [modeltobedeleted(....)] i've tried using callback in finisher, when reloading in development: activesupport::descendantstracker.clear activesupport::dependencies.clear but has no effect. can me on how this? nick classes garbage collected same way regular objects - when there's no references them. most common references constants , instances, there may regular references. make sure references class gone class cls; end c = class.new(cls) cls.subclasses # => [#<class:0x007fd64772dc68>] obj = c.new c = nil gc.start cls.subclasses # => [#<class:0x007fd64772dc68>] obj = nil gc.start cls.subclasses # ...

ibm midrange - JT400 - Replying to MSGW Job -

is possible reply msgw job in as400 jt400? i've got job element , can know if it's in msgw status job.message_reply_waiting ex: use "c" via wrkactjob david's correct...but missing couple steps think..and note i've not tried either.. get joblog: job.getjoblog() get queued messages joblog.getmessages get message queue queuedmessage.getqueue() then reply messagequeue.reply()

Bootstrap display errors on input-group wrapper? -

Image
i'm trying add input-addon form input using bootstrap 3 doesn't display errros correctly. html code: <label for="inputemail3" class="col-sm-2 control-label">email</label> <div class="input-group"> <input type="text" id="addtax_rate" class="form-control"> <span class="input-group-addon">%</span> </div> the input group displays correctly without errors, when add has-errors class it, comes this: what doing wrong? thanks

bash - Can't match regex with sed -

i'm trying match pattern (\^|\~?)(\d|x|\*)+\.(\d|x|\*)+\.(\d|x|\*)+ sed without luck. file i'm running through this: { "name": "something", "version": "0.0.1", "description": "some desc", "main": "gulpfile.js", "directories": { "test": "tests" }, "dependencies": { "babel-polyfill": "^6.7.4", "babel-preset-es2015": "^6.6.0", "babel-preset-react": "^6.5.0", "gulp-clean": "^0.3.2", "jquery": "^2.1.4", "lodash": "^4.0.0", "moment": "^2.13.0", "moment-timezone": "^0.5.0", "radium": "^0.16.2", "react": "^15.1.0", "react-bootstrap-sweetalert": "^1.1.10", "react-dom": ...