Posts

Showing posts from June, 2014

datastax - Cassandra NoHostAvailableException; How to set up Native protocol Cassandra cluster? -

i know question has been asked around internet lot, including stackoverflow, far none of solutions have worked me. i'm thinking might weird error .yaml file 1) know not firewall issue, i've tested connection between 2 nodes 2) i've increased timeouts 3) i've set rpc address 0.0.0.0 , public ip 4) i've set broadcast address public ip couple irregularities 1) noticed on first cluster (which works) output cqlsh: connected cas1 @ 127.0.0.1: 9042 . [cqlsh 5.0.1 | cassandra 2.1.3 | cql spec 3.2.0 | native protocol v3] now, on new cluster is: connected test cluster @ localhost: 9160 . [cqlsh 4.1.1 | cassandra 2.0.16 | cql spec 3.1.1 | thrift protocol 19.39.0 is normal? set process wasn't different. 2) when put in listen address in cas1 cluster, ip address white. when put in listen address in test cluster, ip address becomes red 1 of "." white. i'm not expert on stuff, know isn't normal. i've tried c/p , hasn't helped

javascript - How to update an arrays (angularjs) element without splice? -

i having situation in post here not need fetch element, change e.g. name value. i found out 1 that: datalist.splice(index, 1); datalist.splice(index, 0, newitem); but there several problems. know id if manipulating array time time loose track of index <=> id correlation because method take out items, change them , push them "new" one, right? kind of not elegant , cause problems think. basically want toggle visible attribute should change in array. here array: $scope.clines = [{ id: 1, ccolor: 'red', cname: 'entryline right', visible: true }]; of course there more elements inside, left 1 simplicity reasons. the visible toggler should working (naiv "pseudocode" awesome if work simple :) ) $scope.clines[id === id].visible = !$scope.clines[id === id].visible; second best thing if access element directly filter, possible? thank in advance. there several ways go it. 1 use filter() . var id = 1; var visibility = tru

How does this While loop exit ? (java) -

i tried figure out how program works, , got stuck @ while loop, don't understand how second loop exit, since v never end equal 0 or negative. since it's conditions exit loop, or missing deeper? code converts integers (>0) binary. public class binary { public static void main(string[] args) { // read in command-line argument int n = integer.parseint(args[0]); // set v largest power of 2 <= n int v = 1; while (v <= n/2) { v = v * 2; } // check presence of powers of 2 in n, largest smallest while (v > 0) { // v not present in n if (n < v) { system.out.print(0); } // v present in n, remove v n else { system.out.print(1); n = n - v; } // next smallest power of 2 v = v / 2; } system.out.println(); } } v int, , in java 1/2 int gives 0. loop goes through powers of 2 reach one, , 0. run in debugge

Polymer 1.0 - Add custom style properties and a cursor to paper-inputs -

i working polymer , paper-input. i'm novice, first big html project. i'm trying change few things these inputs, because when focused, give no indication whether they're indeed selected or not. here's paper-input demo . 1) i'd make label , underline change color when focused 2) i'd blinking cursor i tried add custom style property inside paper-input.html (the doc here ) <dom-module id="paper-input"> <style> ... :host{ --paper-input-container-focus-color : blue; } </style> i checked this thread , adding head section of html: <!-- custom style applied elements --> <style is="custom-style"> paper-input{ /* label , underline color when input focused */ --paper-input-container-focus-color: blue; } </style> but paper-inputs did not change @ both these solutions. misunderstood... now don't know how bring blinking cursor field. neither doc

perl - Installing cpan Modules in cygwin fails -

i trying install different perl modules cpan in cygwin-32bit enviroment , errors of same kind. 1 trying install net::ssleay, did make, install , tried force install too, nothing seemed work. drmariad@drmariad-mobl ~/.cpan/build/net-ssleay-1.70-edszrw$ make install files found in blib/arch: installing files in blib/lib architecture dependent library tree chmod 755 /usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto//net/ssleay/ssleay.dll /bin/find /usr/lib/perl5/site_perl/5.14/i686-cygwin-threads-64int/auto/ -xdev -name \*.dll /bin/rebase -sot - /bin/find: paths must precede expression: /bin/rebase usage: /bin/find [-h] [-l] [-p] [-olevel] [-d help|tree|search|stat|rates|opt|exec] [path...] [expression] makefile:731: recipe target 'pure_install' failed make: *** [pure_install] error 1 most of time bin/find fails message in installations, don't know how change behaviour. got errors , failures of modules tryed install. my update-to-date cygwin comes

python - Pyramid's auth_tkt -

when using pyramid's authtktauthenticationpolicy there way obtain value of "auth_tkt" cookie set in headers returned pyramid.security.remember() function. i'm trying in order return cookie's value in body of response. lastly, bad idea begin with? i'm trying leverage pyramid's pre-buil authtktauthenticationpolicy return auth_tkt cookie set in response header in body used , set ios client.

php - How could I achieve sending emails in Symfony2/SwiftMailer service with the following criteria? -

i'm trying achieve task killing me! can ugly message without success! below 2 simple classes....which pretend through form in app send emails selecting persons in db according 2 criterias inserted through metioned form(products , city). what should possible reasons of error: exception occurred while executing 'select u0_.email email0 userinfo u0_ u0_.city = ? , u0_.products = ? limit 1' params [{}, {}]: catchable fatal error: object of class quotera\emailbundle\entity\email not converted string public function emailaction(request $request){ $email = new email(); $form = $this->createform(new emailtype()); if ($request->ismethod('post')) { $form->submit($request); if ($form->isvalid()) { $city = $email->setcity($form->get('city')->getdata()); $product =$email->setproduct($form->get('product')->getdata()); $user = $this-&g

HTML5 Access Camera on Android device fails -

i trying print camera input canvas element in html5. on desktop works fine, building android devices cordova, cannot access camera , don't know wrong. tried crosswalk, there no error, camera isn't shown either. want cordova, becuase have use cordova plugins. here code: navigator.getusermedia = (navigator.getusermedia || navigator.webkitgetusermedia || navigator.mozgetusermedia || navigator.msgetusermedia); navigator.getusermedia(options, onsuccess, onfail); var options = { audio: false, video: { mandatory: { maxwidth: window.innerwidth, maxheight: window.innerheight }, optional: [{ facingmode: "user" }] } } var onfail = function(e) { alert('failed camera'); }; var onsuccess = function(stream) { var video = document.getelementbyid('my-webcam'); if(navigator.mozgetusermedia) { video.mozsrcobject = stream; console.log("videowidth" + video.width); } else {

How can I save my vim split windows layout? -

i split window(about 10 lines, top of screen) when i'm writing something, in order reference other files easily. i want save windows layout(just splitting layout without editing files), can start working quickly. i tried put set sessionoptions-=blank set sessionoptions-=tabpages set sessionoptions-=winsize in .vimrc , then :mksession file.vim but when try vim -s file.vim , can't see layout new windows, why? thank you try this: :set sessionoptions=blank,winsize,tabpages,resize when -=, removing options sessionoptions. assume want use += instead. default, sessionoptions set buffers,winsize,options,help,blank. using =, getting rid of options don't want.

haskell - Generalising ($) like Control.Category generalises (.) -

i had thought generalise ($) control.category generalises (.) , , i've done code @ end of post ( also ideone ). in code i've created class called functionobject . class has function ($) following signature: ($) :: f b -> -> b naturally make (->) instance of class $ continues work ordinary functions. but allows make special functions that, example, know own inverse, example below shows. i've concluded there's 1 of 3 possibilities: i'm first think of it. someone else has done , i'm reinventing wheel. it's bad idea. option 1 seems unlikely, , searches on hayoo didn't reveal option 2, suspect option 3 likely, if explain why good. import prelude hiding ((.), ($)) import control.category ((.), category) class functionobject f ($) :: f b -> -> b infixr 0 $ instance functionobject (->) f $ x = f x data invertiblefunction b = invertiblefunction (a -> b) (b -> a) instance category invertiblefunctio

amazon web services - How to force a "sync CodeDeploy" on EC2 machine with agent? -

i have machine cloud-init initialization script installing codedeploy agent. during initialization start services deployed package. there way ? if launch instance autoscaling, can configure codedeploy automatically deploy them. still need doing , install codedeploy agent. http://docs.aws.amazon.com/codedeploy/latest/userguide/auto-scaling-integ.html

ios - Memory management in Xcode -

i try allocate , release mutable array in xcode nsmutablearray *inventory = [[nsmutablearray alloc] init]; [inventory addobject:@"one"]; [inventory release]; does me explain why after "inventory" released, still store 1 objects? assuming working without automatic reference counting (arc): when release object, marks memory object occupying free. however, not destroy in memory. if try (improperly) access @ array's memory address, may find array members still there. warned, not safe, , array , members can (and will) overwritten @ time. you should use arc production code avoid dangers of memory mismanagement. works well.

c++ - SQLite - Database file stops growing -

i'm using srombauts sqlite wrapper c++ sqlite version 3.8.10.2 on debian jessie machine. can insert or select data without problems, strange thing is, database stops growing @ 56852480 bytes (i've got information ls -l database.db command). what i'm trying accomplish insert data of big (around 280'000 lines) csv file database. well, simplified version of code: #include <iostream> #include <csv.h> //small csv class of mine #include <sqlitecpp/sqlitecpp.h> #include <string> int main() { sqlite::database db("database.db", sqlite_open_readwrite | sqlite_open_create); db.exec("drop table if exists bernd"); //simplified version of table, there more columns db.exec("create table bernd(id integer primary key, loads_of_data text)"); sqlite::transaction tr; sqlite::statement stmt("insert bernd(loads_of_data) values(?)"); csv csv("file.csv"); while(csv.g

javascript - how to get id of next div using previous id using jquery -

i want id of next element using jquery . html code is follow. <div id="sms_message-0"><div id="nl-form-0" class="nl-form"></div> i have tried this, y= $('#sms_message-0').next().find('div').attr("id"); console.log(y); here nl-form-0 dynamic . want it's id using static id sms_message-0 . that's not next element, it's first child var y = $('#sms_message-0').children().first().attr('id');

jasmine - how to get the text of bootstrap alert message for testing with protractor -

this spec it('should save edited majorobject', function () { var description = element(by.id('objectdescription')); description.clear(); description.sendkeys('edited'); var add = element(by.id('saveobject')); add.click().then(function () { expect(element(by.css('.alert-success')).isdisplayed()).tobe(true); expect(element(by.css('.alert-success')).totext()).tobe("saved successfully"); }) }); i used expect(element(by.css('.alert-success')).totext()).tobe("saved successfully"); but showing undefined , alternative way this? you meant use gettext() instead of totext() : expect(element(by.css('.alert-success')).gettext()).tobe("saved successfully");

c# - If Else in linq with anonymous object -

how if else conditional in linq query? cashierdata.usedenominations boolean type, i'm doing casting same object . like iqueryable<cashierbalance> icashierbalance = _cashierdatamanagement.getiqueryablecashierbalance(); var currencies = icashierbalance.select(a => new { id = a.currency.id, name = a.currency.name, simbol = a.currency.symbol, shorname = a.currency.shortname, roundingup = a.currency.roundingup, roundingdown = a.currency.roundingdown, denominationmin = a.currency.denominationmin, denominations = cashierdata.usedenominations ? (denomination) a.currency.denominations.select(q => q ) : (denomination) null }); the response api unable cast type 'system.collections.generic.ienumerable`1[[tellers.denomination, dynamicfieldsdiagramlib, version=1.0.0.0, culture=neutral, publickeytoken=null]]' type 'tellers.den

ios - Paging using UIScrollView -

i'm trying display multiple images using uiscrollview , page control, think screenshots of apps on app store. yet reason, uiscrollview not scrolling. checked, , uiscrollview's contentsize's width larger uiscrollview's width. might worth noting put page control in uiscrollview , displays on top of pictures. code follows: import uikit class itemdetailviewcontroller: uiviewcontroller, uiscrollviewdelegate { @iboutlet weak var scrollview: uiscrollview! @iboutlet weak var pagecontrol: uipagecontrol! var itemselected: item! var pageviews: [uiimageview?] = [] var pagecount: int! override func viewdidload() { super.viewdidload() // additional setup after loading view. pagecount = itemselected.images.count pagecontrol.currentpage = 0 pagecontrol.numberofpages = pagecount _ in 0..<pagecount { pageviews.append(nil) } scrollview.frame.size = cgsizemake(view.frame.width, view.frame.height/2.0) let pagesize = scrollvie

python - How to send request to url that is set to 'login:admin' in google app engine? -

in app.yaml, url defined be: - url: /api/.* script: main.app login: admin secure: i tried following code talk api import requests def main(): r = requests.get("https://test.appspots.com/api/get_data", auth=('me@me.com', 'password')) print r.status_code, r.text if __name__ == '__main__': main() but authentication has failed and, judging output, redirect login page. how can use python authenticate , access url? login: admin instructs google app engine restrict urls matching given pattern users authenticated google and administrators of google app engine project. there no way use standard http basic authentication restriction. if have valid oauth bearer token can pass in header in requests.get handle required authentication. see article on appidentity possible options: https://cloud.google.com/appengine/docs/python/appidentity/

Initializing Error: How to create a multi dimensional zero array in C++ -

this code written in c++ make multi dimensional array gives initializing error. size of array should given input console user , not constant value. problem , solution? lot. #include <iostream> using namespace std; int main() { int , b ; cout << "a: " << endl; cin >> ; cout << "b: " << endl; cin >> b ; int data[a][b] = {{0}}; return 0; } the size of array should given input console user , not constant value. this not possible in c++. suitable replacement using arrays using std::vector . can use: int = 10, b = 4; std::vector<std::vector<int>> data(a, std::vector<int>(b, 0)); if using pre-c++11 compiler, you'll need have space between 2 >> . std::vector<std::vector<int> > data(a, std::vector<int>(b, 0));

amazon web services - Use hardware in a aws cloud infrastructure -

hello created complete application , hosted in aws, right have use device application , should connected server, problem server amazon ec2 instance. question how can solve problem?, thought connect vpc company vpn , here use dedicated server , connect device there, i'm not sure if there better solution solve problem. placing device in same vpc (via vpn) right solution trying if want move forward aws. need physical server somewhere can connect hardware too. minor suggestion: don't connect whole company vpn vpc. create separate 1 application (at least initially).

Marklogic semantics: treatment of rdf:about attribute values -

i trying import rdf data source (rdf/xml) marklogic 8.02 mlcp 1.3.3. during import, swamped warnings one: 15/06/29 15:03:58 warn contentpump.rdfreader: 57fad317-4744-4f88-a8f7-6c21c662ad08.rdf: {w107} bad uri: code: 45/unregistered_nonietf_scheme_tree in scheme: scheme name has "-" in it, not start in "x-" , prefix not known prefix of alternative tree uri schemes. looking @ source data (rdf/xml), caused statements this: <rdf:description rdf:about="rvr-jurisprudentie:http%3a%2f%2flinkeddata.overheid.nl%2fterms%2fjurisprudentie%2fid%2fecli%3anl%3arvs%3a2013%3a549:http%3a%2f%2flinkeddata.overheid.nl%2fterms%2fbwb%2fid%2fbwbr0005181%2f2986364%2f2015-01-01%2f2015-01-01"> so looks ml thinks rdf:about attribute contains uri , complains not valid one. so 3 questions: why ml think has uri. haven't encountered problem other toolsets. is there switch ignore warnings (piping output in terminal doesn't seem work)

java - Image and Text View errors on Android XML -

https://lh4.googleusercontent.com/hn3fw3mfqlcokpsqmrvb2dzkmo4fgpsrrsikyfnlitsnmg2rldfc7d8rbjt7kbkudin7rp2awrjhh-8=w1340-h587-rw i'm making app (in android studio) , weird errors occurring, such large space left before image , text appearing on top of image. have researched no solutions helped. content.xml: <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview01" android:layout_width="fill_parent" android:layout_height="fill_parent"> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin&qu

microcontroller - Direct memory access RX for the STM32L1 -

Image
i've been trying while transmit block of data computer stm32l100c-disco on usart. performance reasons, done using dma. far, however, have not been able work. cannot seem figure out might doing wrong, figured i'd ask here. i'm using libopencm3 , unfortunately, otherwise excellent repository of examples not appear contain 1 dma on stm32l1xxx . checked covered bases when comes configuration options available in common dma header file , though. naturally, i've referred reference manual stm32l1xxx, mentions following requests table dma1, leading me believe channel 6 need using.. as unsure size of memory , peripheral (i.e. usart2), varied across combinations of 8, 16 , 32 bit both, no avail. without further ado; minimal working (well, not working..) excerpt of i'm trying do. feel i'm overlooking in dma configuration, usart works fine. at point, appreciated. the idea behind code loop forever until data in buffer replaced entirely, , when is, output

javascript - how to dynamically load html into div in using jquery? -

i have 2 files mypage.html , pagelogic.js html page contains multi-step form in first step based on user selection interest(drop-down/radio buttons) step_2 div visible(step 2 form different each interest topics) step_2 structure like <div id="step_2"> <div id="interesttopic_1"> long html different form fields...... </div> <div id="interesttopic_2"> long html different form fields...... </div> <div id="interesttopic_3"> long html different form fields...... </div> <div id="interesttopic_4"> long html different form fields...... </div> <div id="interesttopic_5"> long html different form fields...... </div> </div> i want add "interesttopic" div step_2 div dynamically based on values selection step_1 , each interesttopic may contains different text fields/input controls.how can add div d

Creating Clickable MAP for Android -

Image
i creating app going have map of areas/block shown in picture. want whenever click on block of map specific information block shown in separate layout. may use google maps how add events against given blocks on map? here sample pictures.

php - Updating user information -

i know can't use 2 session start codes in same php page sake of updating user account, need below code , need use session_start twice. one, check if user not logged in, redirect them , banned them seeing update info page , other session start has there session variables set automatically in update info page if user logged in. anyways, getting error can guys please show me work around way? if there's any? thanks. notice: session had been started - ignoring session_start() in .... <?php session_start(); if(isset($_session['userid'])) { } else { header('location: login.php'); } ?> <?php $user = $_session['userid']; $myquery = "select * our_users `userid`='$user'"; $result = mysqli_query($conn, $thequery); $row = mysqli_fetch_array($result, mysqli_both); session_start(); /* right here gets ignored. */ $_session["user_first_name"] = $row['fn']; $_se

vb.net - Creating a Variable with StreamReader Split Results -

i've been exposed vb.net scripting , having trouble figuring out how accomplish task. i'm supposed create program automate end user process right works 1 specific id(because i've hardcoded value make script run). i've scripted use of streamreader loop through possible entries, can't figure out how put result variable program automatically read id selected , proceed through steps, loop until id's identified via streamreader have been processed. apologize if has been asked before, not familiar terminology. private sub form1_formclosed(byval sender object, byval e system.windows.forms.formclosedeventargs) handles me.formclosed application.doevents() end end sub private sub form1_formload(byval sender object, byval e system.eventargs) handles mybase.load uxnote.text = "starting" me.update() runapp() me.close() end sub sub runapp() dim b new bostonworkstation dim myhandle long b.shell_("c:\software\appl

google maps api 3 - Cannot get my polyline drawn or visible -

i try draw polyline according example: https://developers.google.com/maps/documentation/javascript/examples/geometry-encodings . my map displayed, markers displayed polyline not drawn, or not visible. don't see what's wrong. my javascript is: <script src="https://maps.googleapis.com/maps/api/js?v=3.exp&signed_in=true&libraries=geometry"></script> $( document ).ready(function($) { var map; var poly; var iconbase = 'https://maps.google.com/mapfiles/kml/shapes/'; var ndgiconbase = 'http://example.com/img/'; var clickmarker; nextwaypoint = parseint(document.getelementbyid('agpoiwaypoints_size').innerhtml, 10); countwaypoint = nextwaypoint; function initialize() { var mapcanvas = document.getelementbyid('map-canvas'); var content; content = document.getelementbyid('agpoi-0-lat').innerhtml var lat0 = parsefloat(content.substr(content.i

android - How to get Json Array Content to ArrayList<String> in Java? -

i have json file in android "assets" folder. json file have more 5 arrays how store java arraylist or how directly json array forloop. try way public static string assetjsonfile (string filename, context context) throws ioexception { assetmanager manager = context.getassets(); inputstream file = manager.open(filename); byte[] formarray = new byte[file.available()]; file.read(formarray); file.close(); return new string(formarray); } public void getjson() { arraylist<hashmap<string, string>> formlist = new arraylist<hashmap<string, string>>(); context context = null; hashmap<string, string> hashmap; try { string jsonlocation = assetjsonfile("yourjson.json", context); string id; string question; jsonarray jsonarray = jsonobject.getjsonarray("arjuna"); { (int k = 0; k < jsonarray.length(); k++)

attributerouting - Forward slash in attribute routing regex -

i trying write regex matches route action. there seems problem forward slash. this works: [route("{url:regex((da|en))}")] www.mydomain.com/products/en [route("{url:regex((da|en)something)}")] www.mydomain.com/products/ensomething this not: [route("{url:regex((da|en)/something)}")] www.mydomain.com/products/en/something it looks regex lets match single segment of url, while presence of forward slash makes en/something 2 separate segments, i.e. en , something . try attribute instead: [route("{url:regex((da|en))}/something")]

javascript - How to create a form field and update the record dynamicaly in table using java script -

example: i created field name in html . want update field in table , want delete record whenever want to. below example creation , deletion rows don't know how values whenever click submit , add in table using `javascript'. <html> <head> enter code here <title> create/delete rows </title> <script language="javascript"> function addrow(tableid) { var table = document.getelementbyid(tableid); var name=document.getelementbyid("mtext"); document.getelementbyid("mtext").value = name; var rowcount = table.rows.length; var row = table.insertrow(rowcount); var cell1 = row.insertcell(0); var element1 = document.createelement("input"); element1.type = "checkbox"; element1.name="chkbox[]"; cell1.appendchild(element1); var cell2 = row.in

javascript - Replace is not a function, no result -

no result on output textarea, on console log says, typeerror: newarr.replace not function, jsfiddle: http://jsfiddle.net/ehillanichole/woykv768/1/ $('#generatebutton').on('click', function(){ var arr = $('#input').val(); arr = arr.replace(/\n/g, ', '); arr = arr.split(','); var newarr = []; check = 0; count = 0; for(i=0; i<arr.length; i++){ if(check != arr[i]){ count = 1; check = arr[i]; } else { count++; } newarr.push(check + '.' + count); } newarr = newarr.replace(/, /g, '\n'); $('#output').val(newarr); }); my expected result is: 8000.1 8000.1 8000.2 8001.1 8001.2 8002.1 8003.1 8004.1 8004.2 8005.1 note : mentioned in comments other fellow people, newarr array , array not have replace method. you have update code from newarr = newarr.replace(/, /g, '\n'); to newarr = newarr.join().replace(/, /g,

testing - Jenkins multiconfiguration project handle concurrent device usage -

Image
case i have jenkins slave witch run's calabash tests on mobile devices (android, ios). separate on machines (the mac ios or linux android) tests run, use throttle concurrent builds plug-in . way separate between android or mac jenkins slaves devices hooked to. i use mapping table , self written bash script call device name , execute test on specific slave. mapping table map's name device id (or ip ios). the architecture follows: [master]--(slave-ios)---------iphone6 | |--------------iphone5 | |--------(slave-android)-----htcone |--------------nexus |--------------g4 to hand on device bash script use jenkins matrix project plugin , lets me create list of devices , test cases like: htcone nexus g4 run x x x delete x x x createuser x x x sadly list can executed sequentially. want build tests on multiple devices in parallel , cross vice versa. question i

forms - How to sort textboxes and buttons selection order in C# -

Image
i have program : when user filling form pressing tab button in keyboard, should go next button or textbox shown in image red numbers. but after filling number 2, when press tab, select row in gridview! after ... how can sort ? with form open, go menu view -> tab order : this displays current tab ordering on form: by clicking on controls, can define new tab ordering:

java - Get SoapBody Element value -

here response server, although can take mm7version element value, cannot status element value. returns null. soapmeesage xml response: <?xml version='1.0' encoding='utf-8'?> <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <soap-env:header> <mm7:transactionid soap-env:mustunderstand="1" xmlns:mm7="http://www.3gpp.org/ftp/specs/archive/23_series/23.140/schema/rel-5-mm7-1-2">tid.bip_trasnid.20041103.135200.001</mm7:transactionid> </soap-env:header> <soap-env:body> <mm7version>5.6.0</mm7version> <status><statuscode>2602</statuscode><statustext>invalid status</statustext></status> <messageid></messageid> </soap-env:body> </soap-env:envelope> java code: soapmessage respons

c# - I can open SqlConnection once, but I can't do it again -

my program runs, , connects database successfully. can run queries , works fine. however, cant seem disconnect , reconnect database. output says: "a first chance exception of type 'system.invalidoperationexception' occurred in system.data.dll" here connection method: using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; using system.threading; using system.data.sqlclient; namespace windowsformsapplication1 { class tcninteraction { static string connectionstring = "server=localhost\\sqlexpress;database=tcn;trusted_connection=true"; button thebutton; textbox thetextbox; bool currentlyconnectedtoadatabase = false; sqlconnection cnn = new sqlconnection(connectionstring); /* *uses existing sql connection string , attempts establish con

install - ImportError: cannot import name porter python -

i importing nltk library in project , giving following error. if has same error, please help. traceback (most recent call last): file "/home/nitai/dropbox/thesis/pycharmprojects/auto_tagger2/tagger.py", line 4, in <module> import buildvocab file "/home/nitai/dropbox/thesis/pycharmprojects/auto_tagger2/buildvocab.py", line 4, in <module> import nltk file "/usr/local/lib/python2.7/dist-packages/nltk/__init__.py", line 126, in <module> nltk.stem import * file "/usr/local/lib/python2.7/dist-packages/nltk/stem/__init__.py", line 29, in <module> nltk.stem.snowball import snowballstemmer file "/usr/local/lib/python2.7/dist-packages/nltk/stem/snowball.py", line 25, in <module> nltk.stem import porter importerror: cannot import name porter i have installed nltk packages. don't know. if have downloaded data packages nltk, i.e. >>> import nltk >&

Symfony Forms: HTML5 datalist -

how can implemented html5 datalist values database (doctrine)? purpose: replace selects many options inputs autocompletion. first, add new formtype field:. <?php // src/acme/form/type/datalisttype namespace acme\form\type; use symfony\component\form\abstracttype; use symfony\component\form\forminterface; use symfony\component\form\formview; use symfony\component\optionsresolver\optionsresolverinterface; class datalisttype extends abstracttype { public function getparent() { return 'text'; } public function setdefaultoptions(optionsresolverinterface $resolver) { $resolver->setrequired(['choices']); } public function buildview(formview $view, forminterface $form, array $options) { $view->vars['choices'] = $options['choices']; } public function getname() { return 'datalist'; } } in services.yml : form.type.datalist_type: class: acm

linux - From where in libc source code, is open() getting linked? -

i need customize few linux system call interfaces (say sys_open ) purpose. aware of gnu linker ld --wrap= symbol option , use logic alter open() libc wrapper. although serves purpose, want know in libc source codes, actual implementation comes play. the following 2 places major suspects (note fcntrl.h has declarations) glibc_dir/io/open.c glibc_dir/ports/sysdeps/unix/sysv/linux/generic/open.c sample driver: #include <stdio.h> #include <stdlib.h> #include <fcntl.h> int main(int argc, char *argv[]) { int fd; if ((fd = open("sample.c", o_rdonly)) == -1) { fprintf(stderr, "file not found\n"); exit(1); } return 0; } concerned snippet: main: 401dd1: bf 44 90 48 00 mov $0x489044,%edi 401dd6: b8 00 00 00 00 mov $0x0,%eax 401ddb: e8 10 03 03 00 callq 4320f0 <__libc_open> ...... ...... __libc_open: 4320f0: 83 3d 69 8e 28 00 00