Posts

Showing posts from July, 2011

c# - Custom XML convert with mapping -

i have xml string below. <root> <row> <productname>peterson</productname> <productimageurl>gina henry</productimageurl> <ontop>false</ontop> <key/> <onscan>false</onscan> <productcode/> <brandname> <productbrand>annie jones</productbrand> </brandname> <productcategory>new category</productcategory> <productdescription>mcintyre jeanne lucas</productdescription> </row> <row> <productname>peterson</productname> <productimageurl>gina henry</productimageurl> <ontop>false</ontop> <key/> <onscan>false</onscan> <productcode/> <brandname> <productbrand>annie jones</productbrand> </brandname> <productcategory>new category</productcategory> <productdescription>mcintyre j

javascript - How to get data from RESTful API using GuzzleHttp and Laravel -

i have been on while, hope kindly out @ time. shown in below code, when directly point endpoint browser right response - meaning data endpoint. so, trying use guzzle query/consume api, surprise, not return based on documentation followed on guzzle website . how done? please help. public function create() { $client = new client([ 'base_uri' => 'http://localhost:8800', 'headers' => [ 'accept' => 'application/json; charset=utf-8', 'type' => 'get', 'crossdomain' => true, 'datatype' => 'jsonp' ] ]); $promises = [ 'dialects' => $client->getasync('/dialects'), 'languages' => $client->getasync('/languages'), ]; $results = promise\unwrap($promises); $results = promis

web applications - Hosting XSB Prolog in a Server -

i wanted host xsb prolog in server. can please tell me procedure is? following git link explains how host swipl on server, same not working xsb https://github.com/swi-prolog/swish your appreciated.

c++ - Why is in-class partial specialization well-formed? -

according [temp.class.spec] 5/ (emphasis mine) a class template partial specialization may declared or redeclared in namespace scope in corresponding primary template may defined this suggest partial specialization (just in case of explicit specialization) have appear in namespace scope. confirmed example below paragraph: template<class t> struct { struct c { template<class t2> struct b { }; }; }; // partial specialization of a<t>::c::b<t2> template<class t> template<class t2> struct a<t>::c::b<t2*> { }; //... a<short>::c::b<int*> absip; // uses partial specialization on other hand c++ standard core language active issues no 727 example suggests in-class partial specialization formed: struct { template<class t> struct b; template <class t> struct b<t*> { }; // well-formed template <> struct b<int*> { }; // ill-formed }; i'm sure core i

node.js - Install node module from own gitlab server -

i'd install node modules our gitlab server. link repository: http://abcd-gitlab/mygroup/mynodemodule.git according npm install guide install command should this: gitlabuser: me myproject: mynodemodule npm install gitlab:mygitlabuser/myproject i have no idea how reference my gitlab server url group project account name i tried commands failed: npm install gitlab:abcd-gitlab:me/myproject npm install gitlab:abcd-gitlab:me/myproject.git npm install gitlab:http://abcd-gitlab:me/myproject npm install gitlab:http://abcd-gitlab:me/myproject.git npm install gitlab:http://abcd-gitlab:me/mygroup/myproject npm install gitlab:http://abcd-gitlab:me/mygroup/myproject.git npm install gitlab:http://abcd-gitlab:me/mygroup/myproject.git what correct way reference npm dependency, clear structure great like npm install gitlab:<serverurl/>:<username/>/<groupname/>/<projectname/><gitsuffix>.git i try 1 of these: npm install git+ssh:

apache spark - How to get the difference between two RDDs in PySpark? -

i'm trying establish cohort study track in-app user behavior , want ask if have idea how can exclude element rdd 2 in rdd 1. given : rdd1 = sc.parallelize([("a", "xoxo"), ("b", 4)]) rdd2 = sc.parallelize([("a", (2, "6play")), ("c", "bobo")]) for exemple, have common element between rdd1 , rdd2, have : rdd1.join(rdd2).map(lambda (key, (values1, values2)) : (key, values2)).collect() which gives : [('a', (2, '6play'))] so, join find common element between rdd1 , rdd2 , take key , values rdd2 only. want opposite : find elements in rdd2 , not in rdd1, , take key , values rdd2 only. in other words, want items rdd2 aren't present in rdd1. expected output : ("c", "bobo") ideas ? thank :) i got answer , it's simple ! rdd2.subtractbykey(rdd1).collect() enjoy :)

ios - Handling HTTP redirects in AVQueuePlayer -

i have application can play audio playlist using avqueueplayer . the actual song's urls built dynamically , expires after period of time after being built. playlist constructed using permalink, song url permanent, , responds http status code of 301. say, example, song url http://myhost.com/song?id=1234 , , url responds 301 (moved permanently) , location header url looks http://realcontent.com/song?id=...&token= ... this works fine, music gets played, i'm experiencing delay of few seconds before audio starts playing. what see avplayer doing: a first request http header "range: bytes=0-1" permalink, responds redirect, a request redirected url same range a sencond request permalink full range, gets redirected a second request redirected url full range. i avoid third step, unnecessary. permalink responded moved permanently , following request respond same way. is there setting or can change avoid making request?

windows - Fastest way to get the PID of the current running terminal and save to a variable -

i need pid of each open terminal. i have in works right now. however, doesn't give correct pid, , it's little slow. @echo off rem note: session name privileged administrative consoles blank. if not defined sessionname set sessionname=console setlocal set instance=%date% %time% %random% title %instance% rem pid find /f "usebackq tokens=2" %%a in (`tasklist /fo list /fi "sessionname eq %sessionname%" /fi "username eq %username%" /fi "windowtitle eq %instance%" ^| find /i "pid:"`) set pid=%%a if not defined pid /f "usebackq tokens=2" %%a in (`tasklist /fo list /fi "sessionname eq %sessionname%" /fi "username eq %username%" /fi "windowtitle eq administrator: %instance%" ^| find /i "pid:"`) set pid=%%a if not defined pid echo !error: not pid of current process. exiting.& exit /b 1 echo here's pid: %pid% i'm not sure how explain it, whenever runs, doesn't

android - Async Task to Java equivalent -

i did in android year ago , wondering if possible convert java. code android: private void search() { class getusers extends asynctask<void, void, string> { progressdialog loading; @override protected string doinbackground(void... v) { hashmap<string, string> params = new hashmap<>(); params.put(config.key_search, search); requesthandler rh = new requesthandler(); string res = rh.sendpostrequest(config.url_search, params); log.d("aaaa", "doinbackground: " + res); return res; } /** * after response given database * @param s json string */ protected void onpostexecute(string s) { super.onpostexecute(s); loading.dismiss(); showresult(s); } @override protected void onpreexecute() { super.onpreexecute(); loading

portion of a raster cell covered by one or more polygons: is there a faster way to do this (in R)? -

Image
pictures better words, please have @ what have a rasterlayer object (filled random values here illustration purposes only, actual values don't matter) a spatialpolygons object lots , lots of polygons in you can re-create example data used image following code: library(sp) library(raster) library(rgeos) # create example raster r <- raster(nrows=10, ncol=15, xmn=0, ymn=0) values(r) <- sample(x=1:1000, size=150) # create example (spatial) polygons p1 <- polygon(coords=matrix(c(50, 100, 100, 50, 50, 15, 15, 35, 35, 15), nrow=5, ncol=2), hole=false) p2 <- polygon(coords=matrix(c(77, 123, 111, 77, 43, 57, 66, 43), nrow=4, ncol=2), hole=false) p3 <- polygon(coords=matrix(c(110, 125, 125, 110, 67, 75, 80, 67), nrow=4, ncol=2), hole=false) lots.of.polygons <- spatialpolygons(list(polygons(list(p1, p2, p3), 1))) crs(lots.of.polygons) <- crs(r) # copy crs raster polygons (please ignore potential problems related projections etc. now) # plot both plot(r

Create directory through C# using WinSCP on SFTP server -

we writing console application in c# upload files, through winscp .net assembly using sftp protocol, file server. able connect server , place files server not @ exact place want. please find code below: where path = \repository\scan\java\ant\uat zippath = c:\temp\uat_17-11-2016-19_40_05.zip sftppath = \repository\scan\java\ant\uat\uat_17-11-2016-19_40_05.zip zip file getting placed @ repository folder level name repositoryscanjavaantuatuat_17-11-2016-19_40_05.zip . if directories don't exist on server not getting created. using (session session = new session()) { session.open(sessionoptions); { if (system.io.directory.exists(path)) { console.writeline("that path exists already."); } else { directoryinfo di = system.io.directory.createdirectory(path); console.writeline( "the directory created @ {0}.", system.io.directory.getcreationtime

Javascript Exporting Table data to csv without html tags -

i trying export data table csv file without having use plugins found code: jquery("#exportbutton").click(function (e) { window.open('data:application/csv;charset=utf-8,' + jquery('#mytable').html()); e.preventdefault(); }); this code works it's saving html tags too. how can export data table in similar way without having html tags in file? your question interested me. try , it's possible : https://jsfiddle.net/ouvaztan/ html : <table id="customers"> <tbody><tr> <th>company</th> <th>contact</th> <th>country</th> </tr> <tr> <td>alfreds futterkiste</td> <td>maria anders</td> <td>germany</td> </tr> <tr> <td>centro comercial moctezuma</td> <td>francisco chang</td> <td>mexico</td> </tr> <tr> <t

java - How to mock property set in constructor -

let's have class following constructor: public class myimpl extends abstract<foo> { @autowired private fooclass foo; private final threadpoolexecutor executor; public myimpl(string name, int num) { super(name); this.executor = (threadpoolexecutor) executors.newfixedthreadpool(num); } somewhere class has following method: @override public void dothis() { (int = 0; < num; i++) { executor.execute(() -> foo.domethod()); } executor.shutdown(); super.dothis(); } now, want test foo.domethod has been called 4 times and executor.execute(any()) , executor.shutdown() have been called 4 times well. so far have @runwith(powermockrunner.class) @preparefortest(executors.class) public class myimpltest { private static final int num = 4; @mock private fooclass foo; @mock private threadpoolexecutor executor; @injectmocks private myimpl imyimpl

Laravel 5.2 Create function -

i've been building basic laravel crud system, i've made basic create funciton want make if record exists in database , u create same record again integer u put in create form add's existing record example: u have stock system product has ammount of 50, , u create same product ammount of 40, , 40 add's 50 in database 90. im not entirely sure how so. this store function i've made application: public function store(request $request) { // aantal = ammount (int) //producten_id = foreign_key producten database table //locaties_id = foreign_key locaties database table voorraad::create($request->only(['aantal', 'producten_id', 'locaties_id'])); //var_dump($request); return redirect(route('voorraad.index')); } if u need more information let me know , i'll add question assuming set default value field in database structure, simple as: $voorraad = voorraad::firstorcreate($request->only([&#

java - Android Intent not starting activity -

i'm having issues getting startactivity(intent) open next activity. when press associated button it's printing string debug console, new activity isn't starting. doing wrong. public class mainactivity extends appcompatactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); button cambtn = (button) findviewbyid(r.id.btncamera); cambtn.setonclicklistener(new view.onclicklistener(){ @override public void onclick(view view){ startcameraoption(view); } }); } public void startcameraoption(view view){ intent intent = new intent(mainactivity.this, cameraoption.class); intent.putextra("launcher","launched."); system.out.println("starting next activity,"); startactivity(intent); } } ther

unity3d - Multidisplay error on canvas in Unity 5.5.0b11 -

i'm in project right in i'm having trouble canvas multidisplay in unity 5.5.0b11. while testing in single display works when using multidisplay doesn't answer orders ask should (by clicking somewhore, clicks somewhere else or copy something....). tried work v5.4 canvas didn't work @ all, made research , found in v5.5b solved. idea how make multidisplay work in unity 5.5.0b11? thank attention,

ZFS: Rollback snapshot but keep newer snapshots -

i have following zfs snapshots: data/server/dev1@snap1 data/server/dev1@snap2 data/server/dev1@snap3 if want rollback snap1 , following: zfs rollback data/server/dev1@snap1 but zfs returns: more recent snapshots or bookmarks exist use '-r' force deletion.. i know there possibility copy files out of /data/server/dev1/.zfs/snapshot/snap1 /data/server/dev1 takes longer zfs rollback . is there way rollback and keep newer snapshots snap2 & snap3 ? update 21/11/2016 it looks there way this. read working zfs promote , zfs clone not figure out how works. i think comment pretty close getting want. however, rename file system before cloning clone name of original file system. example: zfs rename data/server/dev1 data/server/dev2 zfs clone data/server/dev2@snap1 data/server/dev1 you don't have worry promoting until need delete data/server/dev2@snap1 the zfs man page has more complete example may or may not address needs more specifical

c# - How to remove queue in Azure Service Bus automatically if no one subscriber do not retrieve messages during month? -

i'm using azure service bus transport masstransit. need remove queue automatically if no 1 subscriber not retrieve messages during month. know autodeleteonidle property, how can set time deleting queue if no 1 subscribers retrieve messages? may it's possible using azure portal(i need set namespace) or when create new queue code? autodeleteonidle remove entity if there's no messages sent/received, not if there's not subscribers. if worry queue accumulating messages, perhaps switching topic/subscription better (no subscribers, no messages stored). as specifying value, portal, i'd first try through masstransit api if possible.

Why does the file glob **/*.cs in git grep not show me all *.cs hits? -

so wanted find use of nlog in project, , employed git grep me, found few more cases needed: git grep nlog geta.seo.sitemap/geta.seo.sitemaps.csproj: <reference include="nlog, version=2.1.0.0, culture=neutral, publickeytoken=5120e14c03d0593c, processorarchitecture=msil"> geta.seo.sitemap/geta.seo.sitemaps.csproj: <hintpath>..\packages\nlog.2.1.0\lib\net45\nlog.dll</hintpath> geta.seo.sitemap/services/cloudinaryservice.cs: nlogger.exception("could not transform image", exception); geta.seo.sitemap/services/cloudinaryservice.cs: nlogger.warn("url cloudinary id null"); geta.seo.sitemap/services/cloudinaryservice.cs: nlogger.warn("could not locate file object cloudinary id in episerver"); .... etc granted, found looking for, wanted filter down only files ending in .cs . tried doing this: git grep nlog **/*.cs web/global.asax.cs: nlogger.info("meny applic

gtk - GdkPixbuf can be created with `new_from_data` and `new_from_stream`. Why doesn't the latter require the resolution? -

i trying understand basics behind pixbuf , factory methods new_from_data , new_from_stream . new_from_data requires string of bytes containing image data, , other information such bits per sample, , height of image. what don't understand why new_from_stream not require additional image information. then, how can pixbuf know how render image new_from_stream not provide additional information other gio.inputstream ? new_from_stream() expects stream of supported image file, equivalent new_from_file() . image formats contain metadata height , width. new_from_data() on other hand expects pixel buffer, array of pixels without metadata.

javascript - Android Post to API Doesn't Work, Ajax Post Works OK. Required String parameter 'firstname' is not present" -

i have spring framework api setup receive get/post request works fine on web when trying post android, "required string parameter 'firstname' not present". i've tried post using different iterations continually same error. java spring framework @requestmapping(value = "/adduser", method = requestmethod.post) public string adduser(@requestparam(value="firstname") string firstname, @requestparam(value="lastname") string lastname, @requestparam(value="username") string username, @requestparam(value="password") string password) throws exception { string success = add.adduser(firstname, lastname, username, password); return tojson(success); } javascript version var data = { firstname: firstname, lastname: lastname, username : username, password : password }; $.ajax({ type: 'post

asp.net - Having problems using SSRS custom authentication and jasig CAS -

i'm trying set ssrs use dotnetcasclient.dll. when try merge these 2 instruction sets, 1 shows how use cas authentication while using iis .net framework. other how use custom forms authentication. has ever got work? https://msdn.microsoft.com/en-us/library/cc281383.aspx?f=255&mspperror=-2147217396 and https://wiki.jasig.org/display/casc/.net+cas+client yes, have create custom assembly override authenticate , authorize methods of ssrs security. need complete authorizations because new class used ssrs , ssrs manager authorize user's access report item collections. authenticate use dotnetcasclient grant access, used inside new custom assembly. once done need configure ssrs , ssrs manager applications use new customsecurity module via web config files.

Creat Another Independent Powershell Script through first Powershell Script -

so wanted know how make powershell script a can create powershell script b the main goal have script b independent of script a (for security purposes). have keys script a , hash them. i want have script create script b , script b action , taken other separate environments. so how can i: a: make new script via first? b: have, $hash1 (hash of key1), pass on script b , when script b runs in separate vm or pc environment, not require script a use $hash1 thanks a: powershell script saved text. (=script a) can print text file (for example scriptb.ps) , file can executed. b: can use "return statement" in script a. , if don't need hash, have write code run without input parameter or use default parameter. , how? if statements probably.

vb6 - MySQL Run-time error '-2147217865 (80040e37)' -

windows 7 (x64), vb6.0 - sp6 , mysql 5.2 odbc connectors , xammp server that works on local host trying connect remote mysql database same tables after successful connection gives me run-time error '-2147217865 (80040e37)' , says table mydatabase.tblusers doesn't exist exist in database. searched on internet possible solution still not working me here connection string option explicit public function connected2db() boolean dim isopen boolean dim ans vbmsgboxresult dim dbpath string isopen = false on error goto err until isopen = true cn.cursorlocation = aduseclient cn.connectionstring = "provider=msdasql;driver={mysql odbc 5.2 ansi driver};dsn=mydsn;server=myipaddress;database=mydatabase;uid=dbusername;pwd=mypassword;port=3306;" cn.open isopen = true loop connected2db = isopen exit function err: ans = msgbox("error number: " & err.number & vbcrlf & "desc

mechanize - Error 403: Request disallowed by robots.txt on Python -

i trying fill form using mechanize on python. when run code, error: error 403:request disallowed robots.txt. i went through previous answered questions similar issue , saw adding br.set_handle_robots(false) should fix it, still getting same error. missing here? import re import mechanize mechanize import browser br = mechanize.browser() br.set_handle_equiv(false) br.set_handle_robots(false) br.addheaders = [('user-agent','mozilla/5.0 (x11; linux x86_64; rv:18.0)gecko/20100101 firefox/18.0 (compatible;)'),('accept', '*/*')] text = "1500103233" browser = browser() browser.open("http://kuhs.ac.in/results.htm") browser.select_form(nr=0) browser['stream']=['medical'] browser['level']=['ug'] browser['course']=['mbbs'] browser['scheme']=['mbbs 2015 admissions'] browser['year']=['ist year mbbs'] browser['examination']=['first professiona

android - Use remote fonts (typeface) -

i need use external fonts android app. receive urls fonts in json object on app start, , have use these fonts textviews , buttons. what's best way proceed? assume have download *.otf files, can download them? possible store them in internal storage don't have request external write permissions? where can download them? internal storage ( getfilesdir() or getcachedir() , depending on preference). is possible store them in internal storage don't have request external write permissions? sure. other apps not need access fonts use them in widgets. i not know choosing fonts, make sure adequate testing: fonts on android os versions supporting. android's font support has changed on years, , while better now, on older devices fonts quietly ignored, system has problems loading font.

java - How to close a Stream of a REST Service? -

i need make java rest service return inputstream response. problem don't know how close stream after client receives entire stream. i'm using java , cxf. thanks @get @path("/{uuid}") @produces(mediatype.application_octet_stream) public response getattachmentbyuuid(@pathparam("uuid")string uuid) { //getting inputstream aws s3 inpputsream is=getstreamfroms3(uuid); return response.status(response.status.ok).entity(is).build(); // "is" stream causes memory leak,, have close it. client side not controlled me } jax-rs implemented using java servlets. in case of cxf used cxfservlet . stream sent client using httpservletresponse of servlet interface public void doget(httpservletrequest request, httpservletresponse response) you should not close stream source ( httpservletresponse ) if have not created it. responsability of container, , can interfere life cycle of request see is necessary close input stream returned httpservletr

c# - How do I get customer list into a winforms app? -

i trying customer list customers.cs mainform.cs . there way list customers.cs without using sql server? want show first name under column name colfirstname , last name under column name collastname on mainform.cs . have code used mainform.cs sql customer list, required customer list without using sql connection. customers.cs code using system; using system.collections.generic; using system.componentmodel.dataannotations; using system.linq; using system.text; using system.threading.tasks; namespace classproject2.data { public class customers { public customers() { _customers = new list<customer>() //customer list { new customer(_ids.next()) { firstname = "bob", lastname = "miller" }, new customer(_ids.next()) { firstname = "sue", lastname = "storm" }, new

The Height of my Image is 0 on First Load - Javascript -

summary code news page loads articles database using php, in 3x3 box format. uses both images , text, , way works takes info php database, places inside array, , posts on page depending on if first letter 'i' or 't'. if it's 't', posts <p> , if it's 'i', however, there more complications. later in script, takes clientheight of each <p> or <img> , uses them create div height, finds row of 3 , sets div around height of biggest div. text works fine, images have minor issue. the problem after loading of page, alert tells me height of pictures are, , number returns first after loading page 0. code: for (var = 0; < panels.length; i++) { if (panels[i][ten].slice(0, 1) == "i") { //ten article number var img = new image(); img.id = 'text'+i+id[ten]; img.src = panels[i][ten].slice(2, panels[i][ten].length); document.getelementbyid('column'+i+id[ten]).appendchi

javascript - User Authentication for API from React App -

i have simple api built in nodal allows user create new job (essentially work order service business). api using oauth, in order create new job, user has first obtain token authenticating via username , password. the frontend going built in react. in order access site, user have log in username , password, @ point they'll given token make api calls. 2 questions: 1) how securely store api token such user doesn't have log in every time page refreshes? 2) how use same login step determine if have access given page within frontend app? this process have used in current project. when user logs in, take token , store in localstorage. every time user goes route, wrap component route serves in hoc. here code hoc checks token. export function requireauthentication(component) { class authenticatedcomponent extends react.component { componentwillmount () { this.checkauth(this.props.user.isauthenticated); } componentwillreceiv

javascript - Difference between binding using [] syntax and without -

i have custom my-table property row bound host component. can put html in 2 ways: <my-table [rows]="displayentriescount"></my-table> and this: <my-table rows="{{displayentriescount}}"></my-table> what's difference? <my-table [rows]="displayentriescount"></my-table> binds value in displayentriescount is <my-table rows="{{displayentriescount}}"></my-table> does string interpolation. means assigned value stringified value of displayentriescount . don't use if want assign object values.

node.js - How to save the ID of a saved file using GridFS? -

i trying save id of file send via gridfs mongodb (working mongoose). cant seem find out how created id in fs.files code? var writestream = gfs.createwritestream({ filename: req.file.originalname }); fs.createreadstream(req.file.path).pipe(writestream); writestream.on('close', function (file) { // `file` console.log(file.filename + 'written db'); }); i cant seem able save id of file wrote via writestream. the file created in lists etc. how manage save file can save in 1 of other mongodb documents? this old , think solved problem. if correctly understood, trying id of saved file. can this: console.log(writestream.id);

SQL Server order by with max rows in subquery -

the following query works postgresql , i'd know why doesn't work sql server 2016. select * (values (1),(2)) a(a) union ( select * (values (1),(2)) a(a) order 1 desc offset 0 rows fetch first 1 rows ) order 1 desc offset 0 rows fetch first 1 rows can explain me why order not supported here? funny following, way express this, works charm select * (values (1),(2)) a(a) a.a in( select * (values (1),(2)) a(a) order 1 desc offset 0 rows fetch first 1 rows ) order 1 desc offset 0 rows fetch first 1 rows is bug? the query after union needs presented select, so: select * (values (1),(2)) a(a) union select * ( select * (values (1),(2)) a(a) order 1 desc offset 0 rows fetch first 1 rows ) b order 1 desc offset 0 rows fetch first 1 rows

java - Error: UnsupportedCharsetException when upload file with MultipartEntity entity -

i send form server, text field , file edittext. think send wrong shape. form of sending browser: post /wp-content/themes/reverie-master/contacts.php http/1.1 host: ukp.mogilev.by connection: keep-alive content-length: 47504 origin: http://ukp.mogilev.by user-agent: mozilla/5.0 (windows nt 10.0; wow64) applewebkit/537.36 (khtml, gecko) chrome/54.0.2840.99 safari/537.36 content-type: multipart/form-data; boundary=----webkitformboundaryh00meqz9l5bbl7bz accept: */* dnt: 1 referer: http://ukp.mogilev.by/elektronnye-obrashcheniya-grazhdan/ accept-encoding: gzip, deflate accept-language: ru-ru,ru;q=0.8,en-us;q=0.6,en;q=0.4 cookie: _ym_uid=1478194399500303049; _ym_isad=1; _ym_visorc_28369546=w request payload ------webkitformboundaryh00meqz9l5bbl7bz content-disposition: form-data; name="nameff" отправка с пк,тест ------webkitformboundaryh00meqz9l5bbl7bz content-disposition: form-data; name="gorodff" отправка с пк,тест ------webkitformboundaryh00meqz9l5bbl7bz con

sql server - How to use multiple SQL statement in Google Search Appliance Connector for Database(V 4.1.1)? -

Image
i have installed windows connector database(v 4.1.1) http://googlegsa.github.io/adaptor/index.html . i want use 11 sql statements crawl using connector. when deployed connector, filled 1 form looks this: there 1 option add sql query. do have installed 11 instances of connector on server in different directories use every sql statement 1 one or can use multiple sql statements crawl in single installation? there support 1 sql statement per connector instance. need modify original connector if wish in one. alternatively, can deploy 11 instances of connector.

c# - Using woeid to List Twitter Local Trends with csharp -

i .net developer.i want list twitter local trends using woeid many turkish cities(for example:2347260,2347259...) response null.what should do? using tweetsharp.is problem tweetsharp?are there csharp library list twitter local trends ?can use latitude , longtitude instead of yahoo woeid?

python - Strange test-case result in CodeWars Kata -

i need solving codewars kata i'm kind of stuck with. reason receiving false in 1 of test-cases , can't find real reason behind it. the instructions validate string(ping) . requirements string needs have length of 4 or 6 , can consist of digits. this code: def validate_pin(pin): if (len(pin) != 4 or len(pin) != 6): return false print(pin.isdigit()) if(pin.isdigit()): return true else: return false it passes 9/10 tests. input / output failed test: i recieve false on validate_pin('1234'): wrong output '1234': false should equal true if (len(pin) != 4 , len(pin) != 6):

xcode - Missing Swift files -

Image
i don't understand what's hapening i'm not able see swift files on xcode project navigator, when open project directory see them all, looks reference problems. i'm receiving invalid redeclaration problems. are using 1 of xcode-beta builds? seem have problems file handling every , then. restarting fixes me of times.

vb.net - WPF load background image on form -

Image
hey have following code supposed take jpg image , place on background of form. however, see black background. dim mybrush new imagebrush() dim image new image() dim grid new grid() image.source = new bitmapimage(new uri("pack://application:,,,/wpfapplication1;component/resources/1680-logoless.jpg")) mybrush.imagesource = image.source grid.background = mybrush and current xaml: <window x:class="mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:wpfapplication1" mc:ignorable="d" title="mainwindow" height="350" width="525"> <grid> <textbox x:name=&q

Can I have a dynamic url with the Google oAuth API? -

i use oauth api login on sites. right if user needs site based on subdomain (user.mysite.com) have manually add in console login button work @ new domain. console says can't use wildcard such *.mysite.com . there way way make dynamic or way add site programmatically? i use tool create subdomains , if add list of approved domain when upon creation great.

entity framework - ASP.NET Core get WebRootPath in class to seed database -

using asp.net core mvc , entity framework 6 , want seed code-first database data csv file have placed in wwwroot\data i trying access webrootpath value in class performs seed cannot work. understand solution based on dependency injection though being new asp.net core , dependency injection haven't got work. startup.cs - standard code, dbcontext setup found via question. public class startup { public startup(ihostingenvironment env) { var builder = new configurationbuilder() .setbasepath(env.contentrootpath) .addjsonfile("appsettings.json", optional: true, reloadonchange: true) .addjsonfile($"appsettings.{env.environmentname}.json", optional: true) .addenvironmentvariables(); configuration = builder.build(); } public iconfigurationroot configuration { get; } // method gets called runtime. use method add services container. public void configureservices(iservicec

android - FCM add Instance Id to topics after removing from batch remove -

i subscribing events fcm android client , removing server side code when happens in backend database. based on have ome around situation if subscribe event event123 , based on factors instanceid api call batchremove call node backend remove person stop receiving pushes id. again client can re-join event android device. not work. i tried call api rest client unable add person event group. 200 ok, still unable join group. when query instance id, doesn't give me event tried re-subscribe. what's issue? missing something? or no instance id can rejoin topic? update : have contacted firebase support , bug @ moment. not sure if has been released or not, have not been updated release status.

android - Hide ImageView on horizontal -

i have imageview in program, limits viewing area. <imageview android:layout_width="match_parent" android:scaletype="centerinside" app:srccompat="@drawable/log_t" android:id="@+id/imageview4" android:layout_alignparentstart="true" android:layout_marginbottom="10dp" android:layout_height="100dp" /> how make invisible @ screen horizontal orientation , again visible in vertical? can in 1 xml layout? or must separate layout horizontal view , vertical view? in container activity can add: @override public void onconfigurationchanged(configuration newconfig) { super.onconfigurationchanged(newconfig); // checks orientation of screen if (newconfig.orientation == configuration.orientation_landscape) { imageview.setvisibility(view.invisible) (or gone instead of invisible) } else if (newconfig.orientation == configuration.

java - Why does this matrix-multiplication function produce incorrect outputs? -

my current implementation follows, taken this question , modified use exclusive or instead of addition per comments here. assumption made (and, goal of implementation, acceptable) input matrices 4x4. /** * produces product of 2 matrices, treating first parameter "left" matrix. */ public static int[][] multiplymatrices(int[][] a, int[][] b) { int[][] resultmatrix = new int[4][4]; (int = 0; < 4; i++) { for(int j = 0; j < 4; j++) { for(int k = 0; k < 4; k++) { resultmatrix[i][j] = resultmatrix[i][j] ^ multiplypolynomials(a[i][k], b[k][j]); } } } return resultmatrix; } the multiplypolynomials function described here . /** * multiplies 2 polynomials (mod 2) represented integers. * first converted binary string, used * select number of appropriate bit shifts of * second, added together. */ public static int multiplypolynomials(int n, int m) { int result = 0x00000

python - Django: failed to overwrite handler404 -

part urls.py (for testing): old_handler404 = handler404 def custom_page_not_found(request, *args, **kwargs): django.http import httpresponsenotfound if request.path.startswith('/myapp/api'): try: return httpresponsenotfound( json.dumps( {'info': 'page not found'} ), content_type='application/json') except exception e: print 'exception:', e #return httpresponsenotfound('page not found', content_type='text/html; charset=utf-8') try: res = old_handler404( request, *args, **kwargs ) except exception e: print 'exception:', e return res handler404 = custom_page_not_found trying overwrite existing 404handler, rest apis (urls starting /myapp/api ), return 404 , error messages in json if urls not matched, remainings, return 404 , existing not found pages if url not matched. for /myapp/api , works fine. remainings, retu

python - Counting how many times a value occurs in a json file -

how read count how many times each "type" , "key" occurs in json file data below {"method":"get","udid":"26:90:a4:46392970","dataset":"decarta","production":true,"type":"reversegeocode","path":"/v1/04track12netics2015/reversegeocode/-28.45818,24.39608.xml?returnspeedlimit=true","key":"04track12netics2015","cost":1,"vendorcost":{"dataprovider":1,"trafficprovider":0},"roundtriptime":5,"noncompquery":0,"level":"request","message":"processing request","timestamp":"2016-08-12t23:59:52.975z"} {"method":"get","udid":"26:90:a4:46392915","dataset":"decarta","production":true,"type":"reversegeocode","path":"/v1/04track12

python 3.x - Get rid of some output -

#the program below. the program allows user try 2 times guess 2 lottery numbers. if user guesses number correctly,user gets $100 , 1 more chance play. if in second chance user guesses 1 number again, user gets nothing more. import random guessed=false attempts=2 while attempts > 0 , not guessed: lottery1= random.randint(0, 99) lottery2= random.randint(45,109) guess1 = int(input("enter first lottery pick : ")) guess2 = int(input("enter second lottery pick : ")) print("the lottery numbers are", lottery1, ',', lottery2) if guess2==lottery2 or guess1==lottery1: print("you recieve $100!, , chance play again") attempts-=1 if (guess1 == lottery1 , guess2 == lottery2): guessed=true print("you got both numbers correct: win $3,000") else: print("sorry, no match") the output below: enter first lottery pick : 35 enter second lottery pick : 45 lotte

Open a new tab in browser with custom html code. Javascript -

this question has answer here: open url in new tab (and not new window) using javascript 25 answers how have function opens new tab in browser custom html generated in root tab? you can this var x=window.open(); x.document.open().write('<h1>test</h1>'); x.close(); note cannot force new tab user preference (of new window / new tab)