Posts

Showing posts from September, 2013

office365 - How do i create an account to access the MS Graph API? -

i need access ms graph apis hit basic apis , need create account. have created free business account through https://www.office.com/ not have access mail box, calendar, contacts. need create separate account? or objects available in paid version? chaitanya, if have office 365 account can use microsoft graph api data in account. can start accessing basic set of requests using microsoft graph api explorer: https://graph.microsoft.io/en-us/graph-explorer . list of request can try in overview documentation: https://graph.microsoft.io/en-us/docs/overview/overview . after can register own app programmatic access data.

php - Two forms submit to the same controller update action in Laravel -

i have 2 form updating users table. each form update different columns , routes following: route::get('users/preferences', 'auth\authcontroller@pref'); route::get('users/profile/{id}/edit', 'auth\authcontroller@edit'); route::patch('users/profile/{id}', 'auth\authcontroller@update'); both form actions route: users/profile/{id} is there way can identify form submitted , therefore can apply validate or manipulate data before inserting? note: not need id in preferences because used current logged in id in case. public function pref() { return view('pages.users.pref'); } public function edit(user $id) { return view('pages.users.edit')->with('profile', $id); } public function update(request $request, user $id) { // want know of best way know form submitted /* if(this from) else */ return redirect('users/profile/'.$id->userid); } if ha

amazon web services - ansible ec2 ami module not working time out -

i'm trying implement playbook dealing amazon ec2 . came part want create new image( used role ), here did: --- - debug: msg="{{ id_image }}" - ec2_ami: instance_id: "{{ id_image }}" name: azzouz wait: no region: "{{ aws_region }}" tags: project: "{{ project }}" register: image i tried specifiy timeout 900 , it's still not working. changed wait: no , i'm still dealing same problem, here last part of error: ... return self._sslobj.read(len)\nssl.sslerror: read operation timed out\n", "module_stdout": "", "msg": "module failure", "parsed": false} could please me. you don't have set wait: no . use syntax , work. - ec2_ami: aws_access_key: xxxxxxxxxxxxxxxxxxxxxxx aws_secret_key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx instance_id: i-xxxxxx wait: yes name: newtest tags: name: newtest serv

html - CSS - form not well formatted on CPanel -

Image
im adding form website. when working on computer looks want when update on server gets unformated. this want like and how looks when on-line code i've tried: html subscreve nossa mailing list nome e-mail <div class="clear mc-field-group"><input type="submit" value="subscrever" name="subscribe" id="mc-embedded-subscribe" class="button "></div> <div id="mce-responses" class="clear "> <div class="response" id="mce-error-response" style="display:none"></div> <div class="response" id="mce-success-response" style="display:none"></div>

Voicemail using Twilio and Android -

i have implement functionality of voicemail using twilio. possible implement voicemail functionality using twilio? our twilio call working don't have idea how implement voicemail functionality. twilio developer evangelist here. you absolutely can use twilio implement voicemail. you'll want using twiml verb <record> records messages person on phone . it might best check out tutorial on phone screening , voicemail twilio voice , might give idea how update existing twilio setup. let me know if helps @ all.

html - white-space:nowrap expands div? -

i made code in css div .name width of 75% text truncate if doesn't fit. when resize window text stays same , whole site falls apart. this code: <tr> <td class="check_td"><input type="checkbox" name="products" value="<?php echo $row['id']; ?>"</td> <td class="product_td"> <div class="product"> <div class="thumbnail"> <img class="img" src="<?php echo $row['img_path'].'/'.$row['img_name']; ?>"> </div> <div class="name"> <?php echo $row['product_name']; ?> // problem </div> <div class="list"> <ul> <li>prodavač: <a href="" style="color:black;"><strong><?ph

javascript - I want to keep on storing and displaying the result I am getting from mysql -

i not expert @ php newbie not sure do.what trying keep on saving result getting textbox this textbox , shirt,color , price result getting table , keep on displaying on page. picture textbox attached. want keep on storing new result table , keep displaying old one. hope clear trying do. code has 3 files main file products.php has following code <!doctype html> <html> <head> <title>products</title> <p> scan barcode of product </p> <link href="mystyle.css" rel="stylesheet"> </head> <body> <input type="text" name="enter" required id="item" style="text-align:centre" placeholder=" barcode id" autofocus /> <div id="item-data"></div> <script src="js/jquery-2.2.0.min.js"></script> <!--jquery link--> <script src="js/global.js"></script> &

c# - How can I load an already existing database into a UWP using entity framework or any other framework -

i trying build uwp app loads existing database entity framework. way can create database if create different database each app installation want apps share same database. whenever run 'update-database' in package manager, error; update-database should not used universal windows apps. instead, call dbcontext.database.migrate() @ runtime. its little tricky yes sir can that. there called publisher cache folder. gives option create shared folder can accessed single publisher across multiple apps. trick here first create publisher cache folder app. create database in folder , once done, can access folder apps , have single database apps. good thing if have multiple apps uses folder, unless last 1 uninstalled, not deleted. if user uninstalls 1 of app , installs again, voila, old data stored in database there. you can read documentation here good luck

javascript - clearInterval() what happens with the last interval call -

var interval = setinterval(function() { function }, 1000); clearinterval(interval); what happens last interval call when clearinterval called? if interval 500 out of 1000 (.5 seconds) interval , clearinterval called, function called , interval cancelled? or function not called , interval cancelled? thanks if specified interval hasn't yet elapsed, callback not invoked again. standard isn't clear on happen if interval has elapsed callback has not yet been processed event queue, in case there 500 ms remaining before next invocation, shouldn't invoke callback again.

c# - Async methods in unhandled exception handler in Universal Apps -

i'm writing handler unhandled exception event dump exception file , send server further analyze. show crash had happen. subscribed event. in method called function handling errors. however, when wrote in method code: public async task handleexception(exception exception) { var dialog = new messagedialog(exception.message, "exception occurred"); await dialog.showasync(); } and run in debug mode visual studio shows visual studio just-in-time debugger. in first place thought problem i'm trying show message box when gui thread dying. changed function to: public async task handlemanagedexception(exception { await filestorage.writetofileasync("somefile.txt", exception.tostring()); } where function filestorage.writetofileasync looks like: public async task writetofileasync(string filename, string data) { var file = await this.storagefolder.createfileasync(filename, creationcollisionoption.replaceexisting); await fileio.writetext

hadoop - How to group bag in pig -

first have data , group a = load './test.txt' using pigstorage(' ') (id:int, time:int, value:float); b = group time; for example result have structure this. 1001 {(1,1001,0.2),(3,1001,0.3),(2,1001,0.3),(4,1001,0.6)} 1002 {(2,1002,0.5),(1,1002,0.3),(3,1002,0.1),(4,1002,0.6)} 1003 {(4,1003,0.2),(1,1003,0.8),(2,1003,0.4),(3,1003,0.5)} but want 1001 {(1,1001,0.2),(2,1001,0.3),(3,1001,0.3),(4,1001,0.6)} 1002 {(1,1002,0.3),(2,1002,0.5),(3,1002,0.1),(4,1002,0.6)} 1003 {(1,1003,0.8),(2,1003,0.4),(3,1003,0.5),(4,1003,0.2)} use nested foreach c = foreach b { sort_by_id = order id; generate group, sort_by_id ; };

sql - Could not allocate space for object 'dbo.' in database '' because the 'PRIMARY' filegroup is full -

i have sql db have maximum size of 10 gb(express edition) , has "2864.35 mb" size available. giving error on changing column datatype of column 'name' nvarchar(1000) nvarchar(400) . column don't require space , after want apply non clustered index on . ... error coming - "could not allocate space object 'dbo.' in database '' because 'primary' filegroup full. create disk space deleting unneeded files, dropping objects in filegroup, adding additional files filegroup, or setting autogrowth on existing files in filegroup." i have sql express edition size 2012 (max limit of 10 gb). have googled nothing working in solution... any appreciated. thanx in advance.

redis - C: string to milisecs timestamp -

i want return in function time_t value timestamp in string format don't it. need help. i read string key of redis database timestamp value form, example, "1456242904.226683" my code is: time_t get_ts(rediscontext *ctx) { redisreply *reply; reply = rediscommand(ctx, "get %s", "key"); if(reply == null){ return -1; } char error[255]; sprintf(error, "%s", "get_ts 2:",reply->str); send_log(error); freereplyobject(reply); return reply->str; } reply->str string value need return time_t value. how can it? thanks i assume 1456242904.226683 seconds past since 00:00, jan 1 1970. 46 years. 1456242904.226683 floating point value , time_t integral data type. can't convert 1456242904.226683 time_t exactly, can convert 1456242904. first use atof convert string floting point value, cast floating point value time_t : #include <stdlib.h> // atof time_t

angular - Pushing value of Var into an Array jquery -

i have array can contain number of values (car) depending on user has entered. want add variable array. <div class="demo"> <span id="cartabs1"></span> </div> <ion-input type="text" placeholder="add new tag" value=""></ion-input> <button (click)="addtag">add</button> file.ts cars = ["friends","oil","ford","peugeot","ferrari"]; ngafterviewinit() { jquery('#cartabs1').tabselect({ tabelements: cars, selectedtabs: [ ] }); } addtag() { cars.push(jquery("#cartabs1").val()); console.log(cars); }); you're missing this keyword: addtag() { this.cars.push(jquery("#cartabs1").val()); console.log(this.cars); }); please notice you're trying push value of span , not value entered in ion-input... intentionally?

symfony - Get multi data from one entity with one method -

how can multiple data entity data row public function findbyuser1id($userid) { $connections = $this->_em ->getrepository('appbundle:connectionslist') ->findby(array('user1id' => $userid)); foreach($connections $con) { $user = $this->_em ->getrepository('appbundle\entity\user') ->findoneby(array('id' => $con->getuser2id())); var_dump($user->getfirstname()); var_dump($user->getlastname()); var_dump($user->getemail()); var_dump($user->getid()); die; } } i need way data in 1 row in example: $user->get(array('firstname', 'lastname', 'email' ...)) i found solution, can't data in 1 row code here: public function findbyuser1id($userid) {

java - Last repeating character in a string -

i searching solution find last repeating character in string says "how doing today", supposed give y answer. have tried using linked hash map ordered insertions, getting d last repeated one. string teststring = "how doing today"; char[] teststringarray = teststring.tochararray(); map<character,integer> map = new linkedhashmap<>(); for( char : teststringarray) { if (!(i==' ')) { if(map.containskey(i) ) { map.put(i, map.get(i)+1); } else { map.put(i, 1); } } } system.out.println(map); list<entry<character, integer>> list = new arraylist<>(map.entryset()); listiterator<entry<character, integer>> = list.listiterator(list.size()); while(it.hasprevious()) { if(it.previous().getvalue() > 1) system.out.println(it.previous().getkey()); } } help appreciated. this code scans last character , checks if

sorting - cli C++ sort a objectlist on a certain property -

i want sort list on property. i've got linepiece object following properties: string^ type; int x, y, x2, y2; system::string^ text; now have list these linepieces , want sort them on x value . i found in list->sort(); need give information. don't know how tell sort list on x value. so how can sort list on x value of object? if read between lines of question, sounds want sort based on x value, , want sort based on y value. if case, i'd implement comparer object, , pass list->sort() specify how should sorted. public ref class comparebyx : comparer<linepiece^> { public: virtual int compare(linepiece^ a,linepiece^ b) override { return a->x.compareto(b->x); } }; int main(array<system::string ^> ^args) { list<linepiece^>^ list = ... list->sort(gcnew comparebyx()); } on other hand, if linepiece has single, innate, universal sorting order, i'd implement icomparable on class, , use

security - Replace Text using powershell -

i having text file following content: some text text text text somevariable=334,321; somevariable=234,234; text b = 34 text text i want replace line somevariable=334,321; with somevariable=10,20; i can using following way $content.replace("somevariable=334,321;", "somevariable=10,20;") but problem somevariable can , want replace values. $content.replace("somevariable=?,?", "somevariable=10,20;") can tell me how can update variable in text file? use -replace operator, takes regex pattern it's first rhs argument: $content -replace '(?<=somevariable=)\d+,\d+;','10,20;'

javascript - Full width fixed height content slider -

i looking content slider responsive full width , fixed height. every slider have scaling - don't want scale slider. found slider: http://www.jqueryscript.net/demo/responsive-jquery-full-width-image-slider-plugin-responsiveslides/ image slider - must have html content in every slide. don't need have controls or pager - autoplay. look @ this: jquery content slider you can have basic idea of can autoplay content slider

kettle - Any idea about this weird type error in Pentaho Data Integration? -

Image
i have : insertion des données dans table some_table.0 - some_auto_generated_db_key integer : there data type error: data type of java.lang.boolean object [true] not correspond value meta [integer] what boolean??? see boolean? have added trace writing step before failing inserting step, , see fine integer value of some_auto_generated_db_key . how can possible? new kettle, if have idea or tips awesome. here screenshot of transformation : just before failed insert, have filter splits stream. on 1 half of stream, looks have add constant step. if i'm reading right, 2 inputs insert step don't have same fields in same order. few steps earlier, there similar splitting of paths goes off right, have same effect. whenever remerge streams without being careful, strange errors can pop up. pentaho tries warn when create hop remerge streams, there ways miss warning. suggestion: each time stream remerges, right-click on each of 2 previous steps, , have show ou

node.js - Node container fails to run using docker for windows -

i unable container run after switching using docker toolbox docker windows. after starting container fails state exit 254 . setup working using virtualbox , quite stumped @ problem be. build completes successfully. this error: frontend_1 | npm info worked if ends ok frontend_1 | npm info using npm@3.8.6 frontend_1 | npm info using node@v5.12.0 frontend_1 | npm err! linux 4.4.15-moby frontend_1 | npm err! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "dev:no-debug" frontend_1 | npm err! node v5.12.0 frontend_1 | npm err! npm v3.8.6 frontend_1 | npm err! path /usr/src/app/package.json frontend_1 | npm err! code enoent frontend_1 | npm err! errno -2 frontend_1 | npm err! syscall open frontend_1 | frontend_1 | npm err! enoent enoent: no such file or directory, open '/usr/src/app/package.json' frontend_1 | npm err! enoent enoent: no such file or directory, open '/usr/

java - Passing a set of parameters to jsp include using jstl -

i'm having trouble this, , google wasn't helpful on particular subject. i have following want execute: <c:foreach var="block" items="${blocks}"> <jsp:include page="${block.blockjsp}"/ </c:foreach> the idea behind have set of "blocks". allows me create page in modular fashion. works fine, , i'm happy way works. now want customize content of blocks passing few key/value pairs while page being created: <c:foreach var="block" items="${blocks}"> <jsp:include page="${block.blockjsp}"> <c:foreach var="blockparam" items="${block.blockparameters}"> <jsp:param name="${blockparam.key}" value="${blockparam.value}"/> </c:foreach> </jsp:include> </c:foreach> this gives me nasty jasperexception: org.apache.jasper.jasperexception: /jsp/survey.jsp (line: 113, column: 24

swift - Core Data can not be saved using UIapplication as a delegate -

i trying use core data save data. created entity called newproject in xmodel. however, when try save data clicking start button. doesn't work, don't know wrong. func saveasinglenewproject(eventtitle: string, starttime : string) { let appdelegate = uiapplication.sharedapplication().delegate as! appdelegate let managedcontext = appdelegate.managedobjectcontext let entity = nsentitydescription.entityforname("newproject", inmanagedobjectcontext: managedcontext) let anewproject = nsmanagedobject(entity: entity!, insertintomanagedobjectcontext: managedcontext) anewproject.setvalue(eventtitle, forkey: "eventtitle") anewproject.setvalue(starttime, forkey: "starttime") { try managedcontext.save() //projectlist.append(anewproject) print ("reached part") }catch let error nserror { print ("could not save it") } } @ibaction func startbutton(sender: anyobje

spring batch - Listener problems with ItemWriteListener and ChunkListner -

i have nebulous problem concerning listeners within spring batch chunk process. my chunk configuration listed below: <batch:chunk reader="processmidxdbitemreader" processor="midxitemprocessor" writer="midxcompositeitemwriter" processor-transactional="false" reader-transactional-queue="false" skip-limit="${cmab.batch.skip.limit}" commit-interval="#{jobparameters['toprocess']==t(de.axa.batch.ecmcm.cmab.util.cmabconstants).type_postausgang ? '${consumer.global.pa.midx.readcount}' : '${consumer.global.pe.midx.readcount}' }" cache-capacity="20"> <batch:skippable-exception-classes> <batch:include class="de.axa.batch.ecmcm.cmab.util.cmabprocessmidxexception" /> </batch:skippable-exception-classes> <batch:retryable-exception-classes> <batch:include class=&quo

ctypes - Passing an array from python to shared DLL, seeing access violation error -

the c function dll: multi(double freq, double power, int ports[], int size) need pass 3rd parameter array python tried following different codes: a: import ctypes pyarr = [2,3] arr = (ctypes.c_int * len(pyarr))(*pyarr) lp = cdll(cdll_file) lp.multi(c_double(freq), c_double(power), arr ,c_int(size))` this code shows error ## exception :: access violation reading 0x00000000000 b: retarr = (ctypes.c_int*2)() retarr[0] =2 retarr[1] =3 lp = cdll(cdll_file) lp.multi(c_double(freq), c_double(power), retarr ,c_int(size))` this code shows error ## exception :: access violation reading 0x00000000000 c: same code using ctypes.byref tried ...... my understanding function expects array argument , tries passing array such address. both cases , didn't work sees mistake in understanding or other work out ?? specify argtypes . given test.dll source: #include <stdio.h> __declspec(dllexport) void multi(double freq, double power, int ports[], i

javascript - KnockoutJS with MVC, Model and functions -

i working on project includes mvc , knockoutjs. first time i'm working knockoutjs i'm running lot of issues. want put mvc viewmodel on webpage in tabbed interface. interface want call functions depending on button press. currently getting model load , show fine, cannot call functions trying create. have no clue way creating @ moment correct one. i have following model: public partial class ssosearchmodel { public string searchparameter { get; set; } public string searchvalue { get; set; } public string searchlabel { get; set; } public iqueryable<ssorecordresultviewmodel> searchresults { get; set; } public list<selectlistitem> parameterlist { get; set; } public list<selectlistitem> labellist { get; set; } } the searchresults this public partial class ssorecordresultviewmodel { [jsonproperty(propertyname = "first_name")] public string firstname { get; set; } [jsonproperty(propertyname = "

jdbc - Eclipselink and Postgresql batch writting -

i have been working on bulksms solution 1 of customers, , have decided use jpa (eclipselink) orm , underlying database postgresql 9.5.1. my problem issue whenever send request 65,000 records persisted takes around 27 seconds complete operation. decided implement sequence pooling, sequence preallocation =1000, , batch writing, managed remove 15 seconds operation. after investigating database logs noticed same queries being called before , after applying optimization. here optimized persistance.xml: <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="com.kw.ktt.sms.server" transaction-type="jta"> <jta-data-source>smsdb</jta-data-source> <non-jta-data-source>s

virtual machine - Multiple applications running simultaneously on a single Docker image -

suppose have webserver , database server installed on same common docker image, possible run them simultaneously, if running inside same virtual machine? is running docker run <args> twice best practice use case? you should not use single image web server , database. should use 1 image web server , 1 database. to run this, run database server , run webserver , link database server. there many examples on internet. i'll leave 1 here : https://github.com/saada/docker-compose-php-mysql

javascript - Animate using custom CSS on wordpress -

i have added slide-in-from-left animation definition wordpress's custom css, , want start upon html start/show/created event (i coming android java... not big html expert myself). can easily, without plugin? thanks! you can go site_admin, in left navigation bar, click plugins->editor, when can see css , php files wordpress theme.

ios - How can a client know that Server is sending some X bytes? -

let buffersize = 4096 var buffer = array<uint8>(count: buffersize, repeatedvalue: 0) var message = "" while inputstream.hasbytesavailable { let len = inputstream.read(&buffer, maxlength: buffersize) if len < 0 { bblogerror("error reading stream...") return self.closestreams() } if len > 0 { // message += nsstring(bytes: &buffer, length: len, encoding: nsutf8stringencoding) as! string reciveddata.appendbytes(&buffer, length: buffersize) message += nsstring(bytes: &buffer, length: len, encoding: nsutf8stringencoding) as! string } if len == 0 { bblogerror("no more bytes available...") break } } my situation: serv

ruby on rails - options_from_collection_for_select wont allow selection by variable -

the 2 snippets of code below, options_from_collection_for_select works setting :selected when use set value, when use @posts.user_id fails. why working? select_tag "user-dropdown", options_from_collection_for_select(@users, 'id', 'fname', **11**), :class =>'form-control' but not? select_tag "user-dropdown", options_from_collection_for_select(@users, 'id', 'fname', **@posts.user_id**), :class =>'form-control' select_tag "user-dropdown", options_from_collection_for_select(@users, 'id', 'fname', **@posts.user_id**), :class =>'form-control' what @posts.user_id trying display in options ? select_tag options_for_select example an example of using options_for_select select_tag select_tag 'user_id', options_for_select(@users.collect{ |u| [u.name, u.id] }) this generate like: <select id="user_id" name="user_id"> &

java - Extracting SFX 7-Zip -

i want extract 2 specific files .zip file. tried following library: zipfile zipfile = new zipfile("myzip.zip"); result: exception in thread "main" java.util.zip.zipexception: error in opening zip file i tried: public void extract(string targetfilename) throws ioexception { outputstream outputstream = new fileoutputstream("targetfile.foo"); fileinputstream fileinputstream = new fileinputstream("myzip.zip"); zipinputstream zipinputstream = new zipinputstream(new bufferedinputstream(fileinputstream)); zipentry zipentry; while ((zipentry = zipinputstream.getnextentry()) != null) { if (zipentry.getname().equals("targetfile.foo")) { byte[] buffer = new byte[8192]; int length; while ((length = zipinputstream.read(buffer)) != -1) { outputstream.write(buffer, 0, length); } outputstream.close();

ruby - displaying updated_at gives error in rails -

i´m trying display time when user updated post <%= current_user.hwaters(:updated_at).to_s %> user has_many :hwaters and hwaters belongs_to :user why not working? if understood right want do, think try: <%= current_user.hwaters.map(&:updated_at).join(', ') %> by way, read more rails active record associations here understand how works.

java - How to store a value for later use? -

i new user , have "noob" question. being taught java in school , have question 1 of our activities. 1 requirement take in student info (such course) , convert them single letter (i assume use .charat??) , later on count how many students enrolled course. have student info down here: import java.util.*; import java.lang.*; public class coursetallier { public static void main (string[] args) { string student = inputstudinfo(); } public static string inputstudinfo () { scanner kbd = new scanner(system.in); int limit = 0, idnum = 0; string college = ""; system.out.println("please input valid id number:"); idnum = integer.parseint(kbd.nextline()); if (idnum == 0) { system.out.println("thank using program."); system.exit(0); } while (idnum < limit) { system.out.println("invalid id number. please enter positive integer:"); idnum = integer.parseint(kbd.nextline(

mongodb - Database and item orders (general) -

i'm right experimenting nodejs based experimental app, putting in list of books , posted on forum automatically every x minutes. now question order of these things posted. i use mongodb (not sure if changes question or not) , add new entry every item posted. normally, things posted in exact order add them. however, web interface of experimental thing, made re-ordering interaction can drag , drop elements reorder them. my question is: how can reflect change database? or more in general terms, how can order stuff in general, in databases? for instance if drag 1000th item 1st order, below needs edited (in db) between 1 , 1000 entries. not seem valid , proper solution me. any enlightenment appreciated. an elegant way might lexicographic sorting. introduce string attribute each item. make initial length of values large enough accomodate estimated number of items. e.g., if expect 1000 items, let keys baa, bab, bac, ... bba, bbb, bbc, ... then, when item moved

c - MinGW printf padding ignored with c89/c99/c11 -

trying build+run simple c program in mingw produces strange results #include <stdio.h> void main() { printf("%03d", 7); }; if build standard-c compliance flags ( -std=c89/99/11 ) padding ignored: c:\>gcc -std=c11 a.c c:\>a 7 whereas in regular gnu c mode works fine: c:\>gcc a.c c:\>a 007 is bug in mingw? have missed something? or padding specifier not standard c feature? for reference, here 's output of gcc -v on system. as suggested 2501 , best workaround instead use mingw-w64 , separate project mingw. can still produce 32-bit binaries, despite "w64" label.

java - Number format exception when trying to read text between span in Selenium -

image i trying read numbers in brackets '()' using selenium the html code <span class="refinement-count"> (14)</span> i trying read numbers between span. using selenium, values in brackets stored in string. after reading values, want add these values. used split function , parsed integer integer.parseint() throwing following exception: exception in thread "main" java.lang.numberformatexception: input string: "" here code: public static void convert(string s){ int sum=0; string str[]=s.split("[()]+"); int[] numbers=new int[str.length]; (int = 0; < str.length; i++) { //system.out.println(str[i]); --checked here, printing normal integers numbers[i]=integer.parseint(str[i].trim()); sum=sum+numbers[i]; } system.out.println("the sum of products "+sum); } using try-catch() block exception can caught output not desirable.

.net - connection between the same software installed on two computers like superbeam using c# -

i developing software using c#.net file transfer between computers , laptops. , using iis hosting. in superbeam pc ask network interface on receiver connected , using 1 string if enter string in machine can able receive data. question how can make connection between 2 pcs? or there other way? thank you. in next time try make question more reading wikis , making researches on google anyway , understood , want make connection between 2 pcs need know how work sockets c# knowing how protocols work (tcp/ip in case) have know how open port in firewall give application rights after of answer string you've talked ip address mixed opened port , encrypted ... many possibilities :) :)

angularjs - How to define place where dynamic components would be injected? -

my components injected dynamical. how define place without wrapping? import { component, viewcontainerref, componentresolver } '@angular/core'; constructor( private apiservice: apiservice, private viewcontainerref: viewcontainerref, private componentresolver: componentresolver) { } create() { this.componentresolver.resolvecomponent(piechart).then((factory) => { this.viewcontainerref.createcomponent(factory); }); } and want inject them in div. <div class="someclass"> <!--how inject them here? --> </div> there 2 ways: injecting viewcontainerref in question, new components added below component using target element in components template template variable <div #target></div> , @viewchild('target', {read: viewcontainerref}) viewcontainerref:viewcontainerref; viewcontainerref of <div> . added elements again added below <div> createcomponent() allows pas

excel - count cells which have 10 or more characters when read backwards -

i have excel sheet follows: column 1 +491111961476 2 +9721111965783 i'd see whether above cells have 10 or more characters when read backwards . using following formula =countifs(a1:a2;'+49??????????') how modify suit need? i believe after =if(len(a2)>=10,"10 or more","less 10") correct forumla usage provided @dirkreichel you need drag down cells let me know if have issues

php - Structuring a MySQL table where the PLAYLIST table refers to multiple VIDEO id integers and a USER table id -

Image
i want retrieve 1 complete object videoplaylist contains complete user object , video objects related it. i understand need use left join merge them, cant understand how should setup playlist table , how query when comes multiple video id's. this current database eer diagram: should create many many relationship between playlist , video? should somehow store video id's in playlist table? , how able query it? this i'm stuck: select * videoplaylist left join user left join video on user.id = playlist.user_id , videos.... ps. won't querying 1 playlist @ time, need display them in list format. yes, should create many-to-many relationship between video , playlist table if want 1 video added multiple playlists , vice versa. so many-to-many relationship table combination of playlist_id , video_id primary key. playlist_has_video ------------------ playlist_id video_id if want able add video more once playlist have create id col in table too. id

asp.net mvc 4 - Unable to read word file in mvc 4 -

i'm using following code read word file uploaded on (local) website. list<string> readwordfile(string path) { application word = new application(); document doc = new document(); ((_document)doc).close(); ((_application)word).quit(); list<string> data = new list<string>(); try { object filename = path; // define object pass api missing parameters object missing = system.type.missing; doc = word.documents.open(ref filename, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing); string read = string.empty; (int = 0; < doc.paragraphs.count; i++) { string temp = doc.paragraphs[i + 1].ra

json - Laravel 5.1 Eloquent collection not returning correct results -

i have eloquent collection {{ $questions }} , when output inside blade template following results: [{"question_num":0,"survey_id":2,"question_text":"test","expected_answer":1}, {"question_num":1,"survey_id":2,"question_text":"test","expected_answer":1}] as can see there 2 objects. when apply filter {{ $questions->where('question_num','=', 0) }} , following results correct: [{"question_num":0,"survey_id":2,"question_text":"test","expected_answer":1}] but when apply following filter {{ $questions->where('question_num','=', 1) }} , empty result, why that, when collection has question_num value of 1? [] i've been scratching head day this! the problem here use operator, here collection signature where method is: where( string $key, mixed $value, bool $strict = true) s

Python doesn't see new methods in the module -

i'm stuck python learning. developing application consist of few modules , had no issues. after few days of break returned new method add app no longer visible, here error: (attributeerror: hand instance has no attribute 'calculate') this not true of course hand object has new method , can prove doing in console (it works) when in app files not picked compiler. what problem ? ok snippet causing issues: class atrifacts: ... def calculate(self): in range(len(self.cards)): self.value += hand.cards[i].getrankindex() return self.value when try use have error mentioned above missing attribute i assume console , app use different pythonpathes , loads different module files.

python - Sqlite records and kivy buttons -

im trying display records database buttons in kivy. but when click on them text (row[3]) text last record. want each button have own name. conn = sqlite3.connect('database.db') c = conn.cursor() row in c.execute('select * table'): row = button(text=row[3]) button.bind(on_press=self.display) layout.add_widget(button) def display(self,*args): print row.text did try with: print self.text also can change button's text display(self,*args): print self.text self.text='clicked!'

caching - android disk cache vs memory cache -

i didn't understand when should use memory cache (lrucache) , when pick disk caching. or should use them both together? looked here

makefile - Make: stop compilation on error -

i'm starting use gnu make frontend build tool, , things work great. thing annoying compilation doesn't seem stop when 1 of steps reaches error. relevant portion of makefile: js_files=$(filter-out $(ignore_js),$(wildcard \ js/ll/*.js js/ll/**/*.js)) ignore_js=js/ll/dist% js/ll/%.min.js %.min.js: %.js @echo ">>> uglifying $?" @$(babeljs) $(babeljsflags) $? | $(uglifyjs) --source-map $(uglifyjsflags) > $@ min_js_files=$(js_files:%.js=%.min.js) main.js: $(min_js_files) @echo ">>> concatenating javascript" mkdir -p $(dist_dir) cat $^ > $(dist_dir)$@ prod: main.js clean the output running make prod looks this: >>> uglifying js/ll/dateex.js syntaxerror: js/ll/dateex.js: invalid number (22:36) 20 | day = today.getdate(); 21 | } > 22 | return new date(year, month, day, 01, 0, 0); |

apache spark - Why one RDD count job takes so much time -

i used newapihadooprdd() method load hbase records rdd , simple count job. however, count job takes lots of time far more can imagine. checked codes, thinking may in hbase, 1 column family has data, , when load records rdd, data may cause executors memory overflow. is possible reason cause issue?

javascript - Converting ampersand (&) and blank space to a dash (-) in URLs using regex -

Image
with code below, have converted following names url such love & relationships http://domain.org/love-relationships career & guidance http://domain.org/career-guidance filter('amptodash', function(){ return function(text){ return text ? string(text).replace(/ & /g,'-'): ''; }; }).filter('dashtoamp', function(){ return function(text){ return text ? string(text).replace(/-/g,' & '): ''; }; }) however, have new set of names , can't figure out how both @ same time. being human http://domain.org/being-human competitive exams http://domain.org/competitive-exams filter('amptodash', function(){ return function(text){ return text ? string(text).replace(/ /g,'-'): ''; }; }).filter('dashtoamp', function(){ return function(text){ return text ? string(text).replace(/-/g,' '): ''; }; }) how combine

python xsd within soap response -

i'm using spyne generating web services in server side python communicate excel client (xmla plugin), , have difficulties generate soap response match client request, want soap response ( under root tag schema " xsd: " refer xmlns:xsd="http://www.w3.org/2001/xmlschema in root : <soap:envelope xmlns="urn:schemas-microsoft-com:xml-analysis"> <soap:body> <discoverresponse xmlns="urn:..."> <return> <root xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns="urn:schemas-microsoft-com:xml-analysis:rowset" ....> < xsd:schema targetnamespace="urn:schemas-microsoft-com:xml-analysis:rowset" xmlns:sql="urn:schemas-microsoft-com:xml-sql"> <xsd:element name="root"> <xsd:complextype> <xsd:sequen