Posts

Showing posts from September, 2013

Google Sheets: generating a filtered array and doing a sumif in the same formula -

i have document column ( 'source'!d:d ) built formatting: country → name → id country → name → id country → name → id country → name → id in same document, there's column ( 'source'!aa:aa ) numbers. i'd sum numbers if country in cold example usa. can't add columns in source document, need generate array countries "polished" inside formula. i've tried this, it's not working. arrayformula , regextract work (the standalone bit indeed generates array country names), think 2 criteria "don't talk each other", they're separated bits, not referring same row anymore. =sumifs('source'!$aa$100:$aa,arrayformula(regexextract(arrayformula('source'!$d$100:$d), "^(.+?)→")),"usa") how can change formula above work? the logic of formula correct (the inner arrayformula unnecessary, not harm). works correctly sample data in spreadsheet. problem has in data; perhaps country names follo

Using a batchsize greater than 1 when using Tensorflows c++ API -

i have tensorflow model trained in python , frozen freeze_graph script. i've succesfully loaded model in c++ , made inference single image. however, seems freeze_graph sets batchsize single image @ time, since unable pass model tensor more 1 image. does know way of changing this? haven't been able locate in script happens. thanks! edit: okay, scrapped keras eliminate black magic might doing, , set batch size of 16 when defining network tensorflow. if print graph def, placeholder has shape: node { name: "inputs" op: "placeholder" attr { key: "dtype" value { type: dt_float } } attr { key: "shape" value { shape { dim { size: 16 } dim { size: 50 } dim { size: 50 } dim { size: 3 } } } } } however, when attempt load , run model in c++ tensor of shape 16 x 50 x 50 x 3, er

vb.net - Syncfusion barcode control text doesnt appear at printing BMP VB NET -

i have code: private sub buildcode() dim barcode string = textbox1.text + "%" + textbox2.text + "&" + textbox6.text + "*" 'textbox3.text = barcode sfbarcode1.text = barcode end sub private sub button1_click(sender object, e eventargs) handles button1.click bmp = new bitmap(groupbox1.width, groupbox1.height, system.drawing.imaging.pixelformat.format32bppargb) 'bmp.setresolution(300, 300) groupbox1.drawtobitmap(bmp, new rectangle(0, 0, groupbox1.width, groupbox1.height)) dim pd new printdocument dim pdialog new printdialog addhandler pd.printpage, (sub(s, args) args.graphics.drawimage(bmp, 0, 0) args.hasmorepages = false end sub) pdialog.showdialog() pd.printersettings.printername = pdialog.printersettings.printername pd.print() end sub private sub textbox1_textchanged(sender object, e eventargs

ruby - Rails 4 does not render my Layout -

Image
i mindblown regarding layouts in rails 4, of now, created layout controller , being called in controller using layout "layout_name" but problem is, whenever redirect_to controller renders page not layout on top of it. here snipper of code: class logincontroller < applicationcontroller layout "login_layout" def index user = user.new end def login_user validate_credential = user.login(params[:user]) if validate_credential[0] == true session[:user_firstname] = validate_credential[1][0]["firstname"].capitalize session[:user_lastname] = validate_credential[1][0]["lastname"].capitalize session[:user_id] = validate_credential[1][0]["id"] session[:advisory_class] = validate_credential[1][0]["advisory_class"].capitalize redirect_to :controller=> 'dashboard', :action=> 'home' else redirect_to :action=>'index' end end take n

c++ - Is it possible to load/read shape_predictor_68_face_landmarks.dat at compile time? -

i trying build c++ application in visual studio using dlib 's face_landmark_detection_ex.cpp . build application run command promt , trained model , image file passed arguments. face_landmark_detection_ex.exe shape_predictor_68_face_landmarks.dat image.jpg this shape_predictor_68_face_landmarks.dat trained model 68 landmarks perform detection on input image , needs load @ run-time every time perform detection. trying following things. load shape_predictor_68_face_landmarks.dat @ building application or compile time. read shape_predictor_68_face_landmarks.dat inside code every time application strarts execution, not take more amount of memory. is there way pack file inside application take less physical memory run. update: how can store shape_predictor_68_face_landmarks.dat file in static buffer every time shape_predictor can read buffer. yes, possible, depends on visual studio , not cross-platform you should create resource file , include hap

r - Contingency table with name of factors instead of counts -

i have dataframe 3 columns. first has names of categories, second (q2) , third (q3) columns contain other factors. es: q1 q2 q3 w y g x x f y z i'm using t1 <- xtabs(~q2+q3, data=db) to create contingency table , know how many combo categories there are. how can obtain in itersection cells names of factors that're in column q1? x y z w 0 1 0 x 1 0 0 y 0 0 1 in example, instead of 1, want a, g or f. an option assign q1 t1 using q2 , q3 indices. > dn <- lapply(db[2:3], levels) > t1 <- array(na, lengths(dn), dn) > t1[cbind(db$q2, db$q3)] <- levels(db$q1)[db$q1] > t1 q3 q2 x y z w na "a" na x "g" na na y na na "f"

xamarin.ios - Unable to load solution after upgrading to Xamarin Studio 6 -

Image
i upgraded xamarin studio latest version, , unable load solution! upon opening solution, below error displayed: i have looked logs, , see following: system.invalidoperationexception: bound project has seen similar error, or have solution? thanks! this error appear associated following xamarin bug report: https://bugzilla.xamarin.com/show_bug.cgi?id=41565 if able try following workaround, should allow open project. back solution open each .csproj file associated extension (such watchkit or today) find section "projecttypeguids" remove key "feacfbd2-3405-455c-9665-78fe426c6842" save file attempt open solution this should solve ios this appears impact android projects contain bindings. example: given test project (test.csproj) 2 projecttypesguid: {efba0ad7-5a72-4c68-af49-83d382785dcf} , {10368e6c-d01b-4462-8e8b-01fc667a7035} project fail load. because first id corresponds regular android project. second 1 android binding libr

mysql - How to only include result if all related values exist in input list -

i've got object product has many tag s. want write query that, given list of tag ids, returns product if product's tags included in input list. input list may have tag ids not part of product, that's ok, product can still returned (i.e. of product's tags must exist subset of input list included in result). i able write 1 query accomplish this, i'd able without sub-query in join. i've got: select * product left join product_tag on product_tag.product_id = product.id left join ( select product.id, count(*) record_count product left join product_tag on product_tag.product_id = product.id group product.id ) inner_q on inner_q.id = product.id product_tag.id in (1, 2, 3) -- sample tag ids group product.id having count(*) = inner_q.record_count does required result? select * product id in (select product_id product_tag group product_id having sum(case when id in (1, 2, 3) 1 else 0 end) >= 3)

Prevent a user control from closing WPF C# -

i have application in user fills out form, if user doesn't press save , loads control/button need stop user leaving , destroying user control. there isn't closing event on user control. tried unloaded has disconnected visual tree. have have create variables throughout check? there event use situation? update so have 1 window application , many user controls load in grid, example if client press contact new contact user control occur child of window. if user hasn't pressed save want user control not removed , prompt message. hope explains bit more. so, far understand question, swap user controls in main window's code. don't want 1 of controls swapped if inputs incomplete. you have code yourself. have method following in main window's code switch usercontrol : private void swapview(usercontrol newview) { // remove old user control ... // show new user control ... } what need flag in usercontrol derived class indicates whe

wordpress behind proxy pass - admin authentication does't work -

i in trouble... i have wordpress blog behing ssl reverse proxy. wordpress lives inside docker. everything works fine, except admin panel. when try login, got message "you not have sufficient permissions access page" i got 2 cookies, "wordpress_loggedin_xxxxx" , "wordpress_sec_xxxxx" because on ssl connection. on docker local machine works, not database prefix issue. here screenshot of admin panel, cookies please me! thx in advance guys!! ok, got solution! ... write here, maybe can helpful. in wp-config.php , i added these lines: if (strpos($_server['http_x_forwarded_proto'], 'https') !== false) $_server['https']='on'; before in code. previously, pasted code above fix admin infinite auto-loop @ end of file. hope helps!!!

c# - Selenium WindowHandles not detect all opened popups -

i'm trying switch between 2 opened popups. driver.windowhandles return 1 handle(id). don't know how switch second popup. command driver.switchto().activeelement doesn't work. readonlycollection<string> currenthandleslist = driver.windowhandles; console.writeline(currenthandleslist.count); result of : 1 why returns 1. why not 2 ? thanks lot. you should use below approach :- string currenthandle = driver.currentwindowhandle; //save currently-focused window handle variable can switch later. readonlycollection<string> originalhandles = driver.windowhandles; //get list of opened window handles. // work here open popups // webdriverwait.until<t> waits until delegate return popup window handle. webdriverwait wait = new webdriverwait(driver, timespan.fromseconds(5)); string popupwindowhandle = wait.until<string>((d) => { string foundhandle = null; // subtract out list of known handles. in case of single // popup,

ruby - Is it possible to pass a value to a YAML list? -

i'm looking way pass value list enumerable, produce set of list items <ul>. value should displayed item allows it. new favorites (15)           <-- 15 being value want displayed. archived deleted the following not work is, should illustrate goal achieve. haml %ul =list_of t('.menu', favorites_count: 15) |item| #{item} yaml menu: - new - favorites ('%{favorites_count}') - archived - deleted note: had yaml include <li> tags in dictionary form, inside strings, 1 of includes count value. find bit clumsy mix html , yaml, so: menu: first_item: <li>new</li> second_item: <li>favorites %{favorites_count}</li> third_item: <li>archived</li> fourth_item: <li>deleted</li> hence looking cleaner option, render tags on haml side , not litter them in yaml. i18n.t uses interpolation syntax similar sprintf 's, can use advantage: %ul = list_of t(&qu

angularjs - Angular method returns as undefined rather than JSON object -

i have getuser method within authentication provider (working in ionic 2): getuser(uid: string): { var toreturn; firebase.database().ref('/userprofile').orderbykey().equalto(uid).once("value", function(snapshot){ toreturn = snapshot.val(); console.log("getuser = " + json.stringify(toreturn)); }); return toreturn; } it retrieves user object firebase. gets output correctly console.log providing exists , saved in toreturn variable. below itemdetailpage class when log value of same method, returns undefined. import { component } '@angular/core'; import { navparams} 'ionic-angular'; import { auth } '../../providers/auth/auth'; @component({ templateurl: 'build/pages/item-detail/item-detail.html', providers: [auth] }) export class itemdetailpage { private title; private description; private author; constructor(private navparams: navparams, private _au

ios - Tableview reload data not working when using afnetworking 2? -

this question exact duplicate of: tableview not reloading new data afnetworking response object 1 answer afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; manager.requestserializer = [afjsonrequestserializer serializer]; manager.responseserializer.acceptablecontenttypes = [nsset setwithobject:@"text/html"]; [manager get:[nsstring stringwithformat:@"%@%@",tic_url,@"list_messages.php"] parameters:params success:^(afhttprequestoperation *operation, id responseobject) { nslog(@"responseobject %@",responseobject); if (![[responseobject valueforkey:@"status"] isequaltostring:@"0"]) { marrchat = [responseobject valueforkey:@"data"]; [self.tblchat reloaddata]; if (marrchat.count > 0) { [self.tblchat scrolltoro

javascript - Selecting row does not show correct amount of selected rows in IE -

Image
goal: if select main checkbox (id="bbbbbb") whether have selected 1 or many row, <div id="selectionrows"></div> should show selected row. problem: function doesn't work in ie , have tried thinking how solve failed. thank you! $(document).ready(function() { $("#candy input[type=checkbox]").on("change", function() { if (this.checked) { $(this).parents('tr').addclass('selected'); $('#dd').removeclass('selected'); updateselectioncounter(); } else { $('#bbbbbb').prop('checked', false); $(this).parents('tr').removeclass('selected'); $('#dd').removeclass('selected'); updateselectioncounter(); } }); $('#bbbbbb').click(function() { var checked = $("#bbbbbb").is(':checked'); $(".asdf").each(function() { $(this).pr

r - Preventing a Gillespie SSA Stochastic Model From Running Negative -

i have produce stochastic model of infection (parasitic worm), using gillespie ssa. model used "gillespiessa"package ( https://cran.r-project.org/web/packages/gillespiessa/index.html ). in short code models population of discrete compartments. movement between compartments dependent on user defined rate equations. ssa algorithm acts calculate number of events produced each rate equation given timestep (tau) , updates population accordingly, process repeats given time point. problem is, number of events assumed poisson distributed (poisson(rate[i]*tau)), produces error when rate negative, including when population numbers become negative. # parameter values sir.parms <- c(deltahinfinity=0.00299, chi=0.00586, deltah0=0.0854, ah=0.5, muh=0.02, sigmaw=0.1, sigmam =0.8, sigmal=104, phi=1.15, f = 0.6674, deltavo=0.0166, cvo=0.0205, alphavo=0.5968, beta=52, mbeta=7300 ,muv=52, g=0.0096, n=100) # inital population values sir.x0 <- c(w=20,m=

how to know whether a point is on land or water using google maps api -

i want know whether point on land or water using google maps geocoding api. if give coordinate point (40,-74) on water body, still getting address shown below. the address is:1416 highland ave, cinnaminson, nj 08077, usa results[0].geometry.locationtype:rooftop results[0].types[0].tostring():street_address(which has "natural_feature") i using java client library this. me because have strucked here , has submit assignment soon. in advance. you can filter results of reverse geocoding result type , location type. in result type can natural_feature , location type should geometric_center or approximate exclude rooftop address can close given point on land. please have @ following request: https://maps.googleapis.com/maps/api/geocode/json?latlng=40%2c-74&result_type=natural_feature&location_type=geometric_center%7capproximate&key=your_api_key the first 2 items in response are: north atlantic ocean (type: natural_feature, place id: chijeq3jds

Reading the sheet name of a .xls file with Matlab -

i have got 30 files named data1.xls data30.xls. in each file, there 2 sheets i'm interested in. first called 'ergebnisse' name of second sheet, important me. sheet changes name. problem here don't know how tell matlab use changing sheet name. what got far: liste = dir('*.xls'); % how many files in folder liste=struct2cell(liste); liste=liste(1,:)'; i=1:length(liste) % i=number of files filename=['data' num2str(i) '.xls']; [num,txt,raw]=xlsread(filename,'ergebnisse'); sheet=txt(3,1); [num,txt,raw]=xlsread(filename,sheet); end the answer sheet 't4_quer_3' write next xlsread doesn't work. help you dont need cell txt(3,1), content. either go sheet=txt{3,1};%notice other brackets or go [num,txt,raw]=xlsread(filename,sheet{:}); %{:}content of cell

php - How to find unique values in array -

here want find unique values,so writing code can't answer,for me don't want array format.i want string <?php $array = array("kani","yuvi","raja","kani","mahi","yuvi") ; $unique_array = array(); // unique array $duplicate_array = array(); // duplicate array foreach ($array $key=>$value){ if(!in_array($value,$unique_array)){ $unique_array[$key] = $value; }else{ $duplicate_array[$key] = $value; } } echo "unique values are:-<br/>"; echo "<pre/>";print_r($unique_array); echo "duplicate values are:-<br/>"; echo "<pre/>";print_r($duplicate_array); ?> you can use array_unique() in single line below:- <?php $unique_array = array_unique($array); // unique value initial array echo "<pre/>";print_r($unique_array); // print unique values array ?> output:- htt

jquery - How to get certain cell of datatables when every row comes from foreach? -

i want update cell dynamiclly ajax,here table. <table id="datatable"> <thead> <tr > <th hidden> id</th> <th>custname</th> <th>custaddress</th> <th>custcity</th> <th>custcontact</th> </tr> </thead> <tbody> @foreach($customers $customer) <tr> <td class="cust_id" hidden> <div contenteditable="true" class="text" >{!! $customer['cust_id'] !!}</div> </td> <td class="cust_name"> <div contenteditable="true" class="text" onblur="alert_value()">{!! $customer['cust_name'] !!}</div> </td> <td class="cust_address" > <span contenteditable="true" class="text">{!! $customer['cust_address'] !!}</span&g

id3v2 - Write / change raw ID3 tags? -

i have mp3 file: b{ 255 251 144 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 73 110 102 111 0 0 0 15 0 0 30 161 0 50 3 66 0 3 5 8 10 13 15 18 20 24 26 28 31 33 36 38 41 43 47 49 52 54 56 59 61 64 66 69 72 75 77 79 82 84 87 89 92 95 98 100 103 105 107 110 112 115 118 ~3277535 more~ } and have metadata want put in it: h{ { "title" "superstar (feat. krewella)" } { "artist" "pegboard nerds & nghtmre" } { "num" 1 } } factor doesn't have vocabulary write id3 tags (yet), have raw file data , data i'd write. wikipedia isn't help, , mpg123 source doesn't clear either. how put data hashtable id3v2 header? we don't have support writing id3 tags yet. python has , have support wrapping python modules. if willing pragmatic first sudo pip install mutagen then: using: kernel python python.syntax sequences ; in: examples.python.mutagen py-qu

typescript - Difference between using `--save` and without it when using typings -

i using typescript definition manager version 1.0 . i read commands document . but still not clear difference between using --save , without it. for example, typings install dt~aws-sdk --global typings install dt~aws-sdk --global --save i tried both, seems doing same thing. does typings use --save default? got @unional, , thanks! when use --save , add info typings.json file.

c - why this function always crashes? -

can tell me why fillpool crashes? maybe there infinite recursion, where? #include <stdio.h> #include <stdbool.h> #define n 5 bool isnotvalidindex(int row , int column) { if((row >= n || row < 0) || (column >= n || column < 0)) return true ; return false ; } void fillpool(int row , int column , int picture[n][n]) { if(isnotvalidindex(row , column)) return ; if(picture[row][column] == 0) return ; picture[row][column] = 2 ; fillpool(row + 1 , column , picture) ; fillpool(row - 1 , column , picture) ; fillpool(row ,column + 1 , picture) ; fillpool(row , column -1 , picture) ; } you have infinite recursion because you're setting value of row/col "2" check "0". you're setting values 2 on , on again. infinite recursion happens because you're calling fillpool "row+1" fillpool "row-1" , infinite recursion (and same thing happen column+1 never reach there).

sql - How to select SHA1 hash values correctly? -

i need extract sha1 passwords microsoft sql server database in order use them in external system. when simple select query known password, result (password "password"): "{sha1=5b9febc2d7429c8f2002721484a71a84c12730c7}" but should 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 . any idea how select expected value 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 ? sha1 hashing done on bytes, not on characters, therefore it's important make sure conversion characters bytes done agreed upon encoding. 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 sha1 hash of password encoded in ascii/utf-8. 5b9febc2d7429c8f2002721484a71a84c12730c7 sha1 hash of password encoded in utf-16-be. to fix this, pick 1 encoding, , change whatever code using other encoding match.

web - Why would one use a POST-based search engine on their website? -

i'm aware of differences between , post (security , caching, in particular). additionally, when search question using google, i'm greeted results telling me how hack site search in google analytics post-based engines. know how that. what i'm wondering why employ post-based search engine in first place? salient advantages? can't imagine why site search queries need secure. maybe has caching? thanks in advance can shed light on this. no real "answer" 1 - it's entirely site owners choice and/or options software use on website. i there are valid reasons search terms secure. if searching personal private medical conditions example, or perhaps own sexual preferences you'd prefer not known. , there's search terms used in more restrictive countries you're used having history of search terms on computer in serious trouble. google has long restricted search terms being passed on next website in referrer field reasons . advantages

java - How reliable socket stream's flush() is? -

consider (simplified) piece of code: public class test { // assigned elsewhere inetsocketaddress socketaddress; string sockethost; int socketport; socket socket; int command = 10; int connection_timeout = 10 * 1000; int socket_timeout = 30 * 1000; dataoutputstream dos; datainputstream dis; protected void connect() throws ioexception, interruptedexception { socket.connect(socketaddress != null ? socketaddress : new inetsocketaddress(sockethost, socketport), connection_timeout); socket.setsotimeout(socket_timeout); socket.settcpnodelay(true); } void initializedatastreams() throws ioexception { dos = new dataoutputstream(new bufferedoutputstream(socket.getoutputstream(), socket.getsendbuffersize())); dis = new datainputstream( new bufferedinputstream( socket.getinputstream(), socket.getreceivebuffersize())); } void run() { try { connect(); initia

c# - Why the LINQ method `Where` in my code is wrong for string[]? -

Image
.net 3.5 i simple linq operation: using system.linq; ... /* extract product key. i.e. "acad-7001: * 409" "software\autodesk\autocad\r17.2\acad- * 7001:409". ignore last '\' char if * exists. */ string product_code = subkey_name.split('\\').where (n -> n != string.empty).last(); but compilation error: hm... in code use linq-method where . whot wrong? instead of where (n -> n != string.empty) use where (n => n != string.empty) (so replace -> => correct syntax) but i'd prefer this: .where(n => !string.isnullorempty(n))

google chrome extension - Read local file with known path in chunks with Javascript -

i'm trying read file known path javascript. @ moment i'm using xmlhttprequest local files problem loads whole file memory. presents problem when you're trying read huge files want read files in chunks. this answer on so deals it, uses filereader api , file object. since have file path, seems unnecessary ask user again choose file hand. there way read file in chunks knowing it's path?

php - How to query Products according to the size? -

so have model product must filtered color, price, , size. here relationships. class product extends model { public function color() { return $this->belongsto('app\color'); } public function sizes() { return $this->belongstomany('app\size', 'product_size')->withtimestamps(); } } here size model: class size extends model { public function products() { return $this->belongstomany('app\product', 'product_size')->withtimestamps(); } } here form: <form id="filteroptions" method="get" action="{{ url::current() }}"> <button type="submit" class="btn-color">filter</button> <div class="clearfix space20"></div> <h5>color</h5> <ul class="color-list"> @foreach($availablecolors $color) <li><input type="chec

shell - Command not found error in Bash variable assignment -

i have script called test.sh: #!/bin/bash str = "hello world" echo $str when run sh test.sh this: test.sh: line 2: str: command not found what doing wrong? @ extremely basic/beginners bash scripting tutorials online , how declare variables... i'm not sure i'm doing wrong. i'm on ubuntu server 9.10. , yes, bash located @ /bin/bash . you cannot have spaces around '=' sign. when write: str = "foo" bash tries run command named str 2 arguments (the strings '=' , 'foo') when write: str =foo bash tries run command named str 1 argument (the string '=foo') when write: str= foo bash tries run command foo str set empty string in environment. i'm not sure if helps clarify or if mere obfuscation, note that: the first command equivalent to: str "=" "foo" , the second same str "=foo" , and last equivalent str="" foo . the relevant section of

java - Save image taken to a specific directory with specific name -

i having trouble saving image taken specific directory specific name. have no idea how it. below code. cameracaptureimage.java public class capturecameraimage extends activity { public static int cameraid = 0; public static boolean isblack = true; public static imageview image; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activitycapturecameraimage); image = (imageview) findviewbyid(r.id.imgview); } public void onbackclick(view v){ cameraid = 0; intent = new intent(capturecameraimage.this,cameraview.class); startactivityforresult(i, 999); } } cameraview.java public class cameraview extends activity implements surfaceholder.callback, onclicklistener{ private static final string tag = "cameratest"; camera mcamera; boolean mpreviewrunning = false; @suppresswarnings("dep

.net - Is it possible to store some Install Privileges without storing the password? -

i have application , upgrade itself. storing windows user name & password , launching elevated session install setup. although user name & password encrypted, clients not @ ease this, can understand. is there way can use sort of token elevates session admin rights without storing user name & password , token valid on specific machine? regards jp

Change Bootstrap datepicker format -

i using bootstrap datepicker , want change format 'dd-mm-yyyy' nothing seems work. $(document).ready(function () { $('#datepicker').datepicker({ format: 'dd-mm-yyyy' }); }); is script wrong? <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link href="site/css/bootstrap.min.css" rel="stylesheet"> <link href="site/css/style.css" rel="stylesheet"> <link href="site/bootstrap-datepicker/dist/css/bootstrap-datepicker3.css" rel="stylesheet"> <script src="site/js/jquery-1.12.3.js"></script> <script src="site/js/bootstrap.js"/></script> <script src="site/bootstrap-datepicker/dist/js/bootstrap-datepicker.js"/></script> <script src="site/js/script.js"></script> &l

java 8 - How select a given JDK in CentOS -

i want update java version in centos machine, actually when java -version gives me : $java -version java version "1.7.0_79" openjdk runtime environment (rhel-2.5.5.3.el6_6-x86_64 u79-b14) openjdk 64-bit server vm (build 24.79-b02, mixed mode) i'm using alternatives configure java interpreter should used : sudo alternatives --config java it gives me : there 3 programs provide 'java'. selection command ----------------------------------------------- * 1 /usr/lib/jvm/jre-1.7.0-openjdk.x86_64/bin/java 2 /usr/lib/jvm/jre-1.6.0-openjdk.x86_64/bin/java + 3 /usr/lib/jvm/jdk1.8.0_91/bin/java enter keep current selection[+], or type selection number: and selected number 3 (which jdk1.8.0_91) however when redo java -version still openjdk 1.7 selected !!! $java -version java version "1.7.0_79" openjdk runtime environment (rhel-2.5.5.3.el6_6-x86_64 u79-b14) openjdk 64-bit server vm (

javascript - Perform an action when input meets requirements -

this question has answer here: how watch form changes in angular 2? 4 answers i'd perform action (submit form, basically) when string entered in input field reaches given length, using angular2 . tried using angular2's controls didn't seem meant that. i using jquery or vanilla javascript wondering if there more "angular2" way it. <input type="text" value="{{userinput}}" class="form-control"> // when userinput > 3, submit form this framework being relatively new, cannot find solution on internet, although simple. have idea ? thank you. you associate control on input , subscribe on valuechanges property. here sample: @component({ (...) template: ` <input type="text" value="{{userinput}}" class="form-control" [ngformcontrol]=&

excel vba - VBA to import and transpose multiple sheets data -

i have been working on below code, looking edit further: 1) instead of setting 'set range1' via input box, should cell range of 'b2:p65' when looping through sheets in folder. 2) when pasting data want fill starting @ column b of 'database' tab in workbook , subsequently c, d, e etc.. rest of workbooks in folder loop. sub loopfileupload_base() dim wb workbook dim mypath string dim myfile string dim myextension string dim fldrpicker filedialog dim range1 range, range2 range, rng range dim rowindex integer application.screenupdating = false application.enableevents = false application.calculation = xlcalculationmanual set fldrpicker = application.filedialog(msofiledialogfolderpicker) fldrpicker .title = "select target folder" .allowmultiselect = false if .show <> -1 goto nextcode mypath = .selecteditems(1) & "\" end nextcode: mypath = mypath if mypath = "" goto res

c++ - Eclipse CDT (4.5.1) works slow with pretty printing -

i have problem huge nested data structures (from json spirit). while debugging, when structure filled data, eclipse starts work slow, after every step waits printed data gdb. thing eclipse gathers lot of information local variables when not expanding data structure. when pretty print off, works, of course can't see inside stl containers. i using printers gdb svn here little piece of code can make similar problems: #include <iostream> #include <string> #include <map> int main() { std::map<std::string, std::map<std::string, std::map<std::string, std::string>>> mega_map; const int factor = 50; (int c = 0; c < factor; ++c){ std::map<std::string, std::map<std::string, std::string>> b_map; (int b = 0; b < factor; ++b){ std::map<std::string, std::string> a_map; (int = 0; < factor; ++a){ std::string a_str = "a"; a_str += (s

VSTS: Deploy Azure SQL DACPAC Release Management throwing an error -

i trying setup vsts release management azure sql database. using "deploy azure sql dacpac" task. path dacpac file setup $(system.defaultworkingdirectory)\**\*.dacpac while database updates correctly error in end causes task fail. "system.management.automation.parentcontainserrorrecordexception: *** not deploy package" it looks updates applied database task still throws error. log below 2016-07-07t07:50:44.6118522z publishing database 'mydb' on server 'myserver.database.windows.net'. 2016-07-07t07:50:45.7587428z initializing deployment (start) 2016-07-07t07:50:52.5825349z initializing deployment (complete) 2016-07-07t07:50:52.5835341z analyzing deployment plan (start) 2016-07-07t07:50:52.7085342z analyzing deployment plan (complete) 2016-07-07t07:50:52.7085342z updating database (start) 2016-07-07t07:50:53.7000358z altering [dbo].[usp_products_list]... 2016-07-07t07:50:53.7170379z creating [dbo].[usp_products_getbyid]... 2016-07-07t07:50

I want to start GWT "Entry module" compilation from command prompt -

i want create batch file, need start gwt compilation batch file (ie) command prompt. 1 please me in the gwt compiler standard java program. need add app's dependencies and source folders classpath , pass module name argument. details in documentation: http://www.gwtproject.org/doc/latest/devguidecompilinganddebugging.html#devguidejavatojavascriptcompiler

javascript - React d3 - How to: Several ares on one line chart -

Image
i using d3 library in react.js. i have line chart, divide in 3 different colored areas, shown in picture. example if set treshold of 2000, should painted in green. same goes blue , treshold. once paint hard coded values, need implement slider , bit more dynamic, guess easy soo figure out how implement area coloring. this initial code have: <div style={{marginleft: '20px', width: (this.state.xwidth + 160)}}> <loader style={{float: 'left'}} loaded={this.state.loaded}> <chart width={this.state.xwidth + 160} height={this.state.height} data={this.state.parts} title={this.state.title} chartseries={this.state.chartseries} x={this.state.xaxis} > <line chartseries={this.state.chartseries} /> <area chartseries = {this.state.redzone} /> <area ch

how to maintain count value over a Browser using HttpSession in java? -

i want maintain onw count value on http browser. example : if browser once open , click on submit button make count one. again click on button make count two. , want count should less two. consider count : private static int count & maxcount : private int maxcount = 3 code: protected void processrequest(httpservletrequest request,httpservletresponse response) throws servletexception, ioexception { httpsession session = request.getsession(); session.setattribute("count", ++count); if(session.getattribute("count") <= maxcount){ //proccess stuff }else{ //give maxcount completed message } } it work fine when open browser first time if open browser in window showing me maxcount completed message i recognize count static variable , gets memory once , can this. want count value again 0 when open in window of browser? you can change this. protected void processrequest(httpservletrequest re

javascript - How to create "credential" object needed by Firebase web user.reauthenticate() method? -

the (unclear) example in new docs : var user = firebase.auth().currentuser; var credential; // prompt user re-provide sign-in credentials user.reauthenticate(credential).then(function() { with v3 firebase client, how should create credential object? i tried: reauthenticate(email, password) (like login method) reauthenticate({ email, password }) (the docs mention 1 argument only) no luck :( ps: don't count hours wasted searching relevant info in new docs... miss fabulous firebase.com docs, wanted switch v3 firebase.storage... i managed make work, docs should updated include not want spend time in exhaustive-but-hard-to-read reference. the credential object created so: const user = firebase.auth().currentuser; const credential = firebase.auth.emailauthprovider.credential( user.email, userprovidedpassword );

c++ - Error compiling fragment shader on GLSL 1.30 -

what wrong following fragment shader? compiles ok under glsl 4.0 fails on glsl 1.30. this code: // fragment shader "uniform sampler2d texture;\n" "uniform sampler1d cmap;\n" "uniform float minz;\n" "uniform float maxz;\n" "\n" "void main() {\n" " float height = texture2d(texture,gl_texcoord[0].st);\n" " float lum = (height-minz)/(maxz-minz);\n" " if (lum > 1.0) lum = 1.0;\n" " else if (lum < 0.0) lum = 0.0;\n" " gl_fragcolor = texture1d(cmap, lum);\n" "}" these errors: fragment glcompileshader "" failed fragment shader "" infolog: 0:7(2): error: initializer of type vec4 cannot assigned variable of type float 0:8(2): error: initializer of type vec4 cannot assigned variable of type float 0:9(6): error: operands relational operators must scalar , numeric 0:9(6): error: if-statement condition must scalar boolean 0:9(17)