Posts

Showing posts from August, 2015

c# - How to update List<string> column using Mapper.UpdateAsync in Cassandra? -

i newbie cassandra , current project called me create table following columns: id uuid primary key, connections list<text>, username text i using cassandra's imapper interface handle crud operations. while found documentation describes how use mapping component basic operations here: http://docs.datastax.com/en/developer/csharp-driver/2.5/csharp-driver/reference/mappercomponent.html i not find documentation outlines how add , remove items list column specific record using mapper component. tried retrieve record database, update entity , save changes record record not updated in database. remains same after update. however, insert operation works , mirrors entity down object in list. user user = await _mapper.singleasync<t>("where name = " + name); user.addresses = user.addresses.concat(new string[] { address }); await _mapper.updateasync<t>(user); how should scenario handled in cassandra? you can use plus (+) , minus (-) cql

php - Removing image from server -

i trying remove records database uploaded image record server.i have function in controller. public function delete(request $request) { if($request->ajax()) { $id=$request->get('id'); if($id) { $delete=category::where('id',$id)->first(); $delete->delete(); $imgfile='c:\xampp\htdocs\larapro\public\newuploads\<?php echo $delete->image;?>'; unlink($imgfile); echo json_encode(true);die; } } echo json_encode(false);die; } unlink(c:\xampp\htdocs\larapro\public\newuploads\<?php echo $delete->image;?>): result large if use $imgfile="c:\xampp\htdocs\larapro\public\newuploads\{$delete->image}"; it displays: unlink(c: mpp\htdocs\larapro\public\ ewuploads{1470667358.png}): invalid argument and wondering why x , n in link missing.

java - Why does ArrayIndexOutOfBoundsException occur and how to avoid it in Android? -

why arrayindexoutofboundsexception occur , how avoid in android? this exception thrown when try access array item doesn't exist: string [] myarray = new string[2]; myarray[2] = "something"; // throws exception myarray[-1] = "something"; // throws exception you should check index not negative , not higher array length before accessing array item.

esper - Property 'price' is not available for write access -

i getting following error while performing update operation: property 'price' not available write access. updatestatement : update istream faultystream set price = 100 id = 7; my event class implements java.io.serializable. still unable perform update. for pojo event classes, generate getter , setter methods. ide me. esper calls setter method , public void setprice(...) {...} .

node.js - Nodejs AWS SDK S3 Generate Presigned URL -

i using nodejs aws sdk generate presigned s3 url. docs give example of generating presigned url . here exact code (with sensitive info omitted): const aws = require('aws-sdk') const s3 = new aws.s3() aws.config.update({accesskeyid: 'id-omitted', secretaccesskey: 'key-omitted'}) // tried , without this. since s3 not region-specific, don't // think should necessary. // aws.config.update({region: 'us-west-2'}) const mybucket = 'bucket-name' const mykey = 'file-name.pdf' const signedurlexpireseconds = 60 * 5 const url = s3.getsignedurl('getobject', { bucket: mybucket, key: mykey, expires: signedurlexpireseconds }) console.log(url) the url generates looks this: https://bucket-name.s3-us-west-2.amazonaws.com/file-name.pdf?awsaccesskeyid=[access-key-omitted]&expires=1470666057&signature=[signature-omitted] i copying url browser , getting following response: <error> <code>nosuchbu

html - How to upload image from <image src> tag in javascript? -

i have image tag on webpage below. <image src='http://xxxxxx.jpg'/> now want image , upload remote http server in javascript. value of image url variable defined in javascript http api call. want upload image remote server below. how can set value on 'how_to_set_this_value' in case? axios({ url: backendserveraddress + '/user/upload_photo', method: 'post', timeout: 30000, headers: { 'access_token': token }, data: how_to_set_this_value, }).then(response => { console.log('update photo response '+ response) }).catch(response=>{ console.log('failed upload photo') }) var filedata = document.getelementbyid('#idofyourfileinputelement').files[0]; var formdata = new formdata(); formdata.append('name_offile_field_of_your_choice',filedata); formdata.append('some_field_other_than_file',valueofthatfield); var how_to_set_this_value = formdata

nightwatch.js - How to click at a certain location in div -

i want execute click on full-screen div underneath (non full-screen) modal dialog. seems click event automatically targets center of background div, thereby touching content that's on top of div (the modal dialog itself). how can specify click should happen? this verbose output of click command: element not clickable @ point (640, 436). other element receive click: <label class="btn btn-default ">... the root of problem selenium clicks sending mouseclick event not directly element screen coordinates. therefore cannot find clickable element point (as described in verbose output). there 2 possible workaround (for case): 1) click element position not overlapped modal dialog (applicaple fullscreen div): .movetoelement('.backdrop', 900, 10) // 900 x offset .mousebuttonclick(0) 2) better, universal solution. directily sending click event via injected javascript: .execute(function(selector) { document.queryselector(selecto

javascript - Is it possible to change the width of the counter? -

i have webix ui.counter control, , seems irresponsive width property: webix.ui({ view: "counter", value: 1234567, width: 300 }); it gives counter default width (maximum 5 digits visible). bug or did miss something? snippet: http://webix.com/snippet/e2d461a6 it's weird inputwidth don't work. but here work around : override default width 40px of selector .webix_el_counter .webix_inp_counter_value . check css adding more styles. <style> .webix_el_counter .webix_inp_counter_value{ width: 100px; } </style> working example : http://webix.com/snippet/47cbb6c9

php - Custom Pagination for Laravel API -

i have pull report uses groupby() , not using paginate() method in laravel. have created 1 manual pagination, has following code : public static function getpaginatedresults($results, request $request) { $rows = 2; $currentpage = lengthawarepaginator::resolvecurrentpage(); $collection = new collection($results); $currentpageresults = $collection->slice($currentpage * $rows, $rows)->all(); $paginatedresults = new lengthawarepaginator( $currentpageresults, count($collection), $rows, ['path' => $request->url(), 'query' => $request->query()]); return $paginatedresults; } this working fine unless next , previous url. getting next url /?page=2 , not showing previous url. how can complete url here , attach query string url passing from , to date along url.

datastax - DSE Graph Loader geospatial data -

the docs don't provide examples of importing geospatial data (e.g. points) using graph loader. possible? example, want load vertices, each of has property coordinates of type geo.point . what figured out can use wkt, e.g. point property, in json: // myvertex.json {"name": "foobar", "coordinates": "point (45, 45)"} with mapping file this: load(myvertexinput).asvertices { label "myvertex" key "name" } i think example coordinates property needs defined in schema.

android - CandleStick Chart:Replication of open and close displayed values while zooming -

Image
values getting replicated in candlestick chart. whenever zoom chart open , close values cloned without candlestickbar i.e values displayed, stuck many hours. lineandpointformatter lpf = new lineandpointformatter(color.blue, color.red, null, null); pointlabelformatter pointlabelformatterr=new pointlabelformatter(); pointlabelformatterr.gettextpaint().setcolor(color.parsecolor("#000000")); lpf.setpointlabelformatter(pointlabelformatterr); plot.addseries(openvals, lpf); lineandpointformatter lpf1 = new lineandpointformatter(null, null, null, null); pointlabelformatter pointlabelformatterr1=new pointlabelformatter(); pointlabelformatterr1.gettextpaint().setcolor(color.parsecolor("#000000")); pointlabelformatterr1.voffset=40; lpf1.setpointlabelformatter(pointlabelformatterr1); plot.addseries(closevals, lpf1);

wpf - C# Update UI In Task -

i new c# task , threading. i have code below:- public void updatesales(object sender, eventargs args) { task.run(() => { // code create collection ... // code business logic .. // below code update ui // safe update ui below saledatagrid.dispatcher.invoke((action) (() => { saledatagrid.itemssource = currentcollection; saledatagrid.items.refresh(); })); }); } i not sure if code correct or not. think in case deadlock can occur? can please point how can update ui task? not using async/await because updatesales event handler third party library. assuming updatesales called on ui thread, cleaner solution this: public async void updatesales() { var collection = await task.run(() => { // code create collection ... // code business logic .. return currentcollectio

python - tensorflow.train.import_meta_graph does not work? -

i try save , restore graph, simplest example not work expected (this done using version 0.9.0 or 0.10.0 on linux 64 without cuda using python 2.7 or 3.5.2) first save graph this: import tensorflow tf v1 = tf.placeholder('float32') v2 = tf.placeholder('float32') v3 = tf.mul(v1,v2) c1 = tf.constant(22.0) v4 = tf.add(v3,c1) sess = tf.session() result = sess.run(v4,feed_dict={v1:12.0, v2:3.3}) g1 = tf.train.export_meta_graph("file") ## alternately tried: ## g1 = tf.train.export_meta_graph("file",collection_list=["v4"]) this creates file "file" non-empty , sets g1 looks proper graph definition. then try restore graph: import tensorflow tf g=tf.train.import_meta_graph("file") this works without error, not return @ all. can provide necessary code save graph "v4" , restore running in new session produce same result? to reuse metagraphdef , need record names of interesting tensors in original

Posting on facebook via unificationengine -

hi i'd post facebook via unification engine. i've created user, added , tested facebook connection, when post following response: {"status":{"facebook":{"status":190,"info":"error validating access token: session not match current stored session. may because user changed password since time session created or facebook has changed session security reasons.: "}},"uris":[]} when use facebook token, used creating connection, post facebook directly (without unificationengine ), works fine. might problem here? status 190 neither documented on facebook nor on unificationengine . @unificatinengine developers: practical, if errors returned service passed on inside unificationengine response, way debugging such errors easier, , errors processed programmatically. additional info today seem not able reproduce response of yesterday. postfields use post message facebook (the same yesterday) follows: { "mes

php - What i do wrong with stdClass? -

var_dump($w); object(stdclass)#691 (2) { ["name"]=> string(4) "riga" ["weather"]=> array(7) { [0]=> object(stdclass)#535 (9) { ["w_ico"]=> string(3) "10d" ["dt"]=> int(1470650400) ["temp_day"]=> int(23) ["temp_night"]=> int(19) ["temp_eve"]=> int(23) ["temp_morn"]=> int(23) ["wind_speed"]=> int(8) ["wind_deg"]=> int(231) ["humidity"]=> int(81) } [1]=> object(stdclass)#536 (9) { ["w_ico"]=> string(3) "02d" ["dt"]=> int(1470736800) ["temp_day"]=> int(19) ["temp_night"]=> int(17) ["temp_eve"]=> int(20) ["temp_morn"]=> int(18) ["wind_speed"]=> int(9) ["wind_deg"]=> int(236) ["humidity"]=> int(88) } [2]=> object(stdclass)#537 (9) { ["w_ico"]=> string(3) "10d" ["dt&

asp.net - Loading part of web.config from other file -

rewriter section defined follows: <section name="rewriter" requirepermission="false" type="intelligencia.urlrewriter.configuration.rewriterconfigurationsectionhandler, intelligencia.urlrewriter" /> then <rewriter> element looks that: <rewriter> <if header="host" match="^example.com"> <redirect url="~/(.*)" to="http://www.example.com/$1" /> </if> <!-- other rules --> </rewriter> now, have 2000 urls need redirect other domain. web.config file big enough on own when i've put 2000 urls it, got: cannot read configuration file because exceeds maximum file size error message. if i'd put data other config file, how can reference web.config ? my app running on asp.net 2.0 , uses package: https://www.nuget.org/packages/intelligencia.urlrewriter url rewriting. as variant can change max size web.config tuning registry :) hklm\so

Post php form jquery ajax -

i have form input field generated loop, ie <form name="" method='post' action=''> <?php for($i=0;$i<10;$i++){ echo "<input type='text' name='data[]' class='data_cls' value='".$i."'>"; } ?> <input type='submit' id='btn' value='save'> i want submit form using jquery ajax. $('.btn').click(function(){ var datstring = "how these values"; $.ajax({ url: "data_process.php", type: "post", data: datastring, success: function(data) { alert('ok'); } }); }); you can use .serialize() jquery method form data. this, $('.btn').click(function(){ var datastring = $('#form_id').serialize(); //replace form_id id of form. $.ajax({ url

Json to XML conversion in mule data weave -

i have following json data , want convert xml is. there way simplest way in mule data weave { "header": { "date": "20160721145839", "utc_time": null, "transactiondatetime": "20160721145839", "eventtype": "test", "placeofevent": "aud", "refno": "shpl123123", "senderusername": "apinar" }, "body": { "number": "zzzz", "vfgt": 2000, "decwt": 0, "status": "f", "category": "e", "additionaldata": { "methodofweightcalculation": "sm2", "wtdata": { "country": "au" }, "declarant": { "declarantphone&q

javascript - electron ES6 code Unexpected token import -

development electron app. use zhe es6 code in html success. write es6 code in alone js fail error. package.json: { "name": "app", "version": "0.1.0", "main": "main.js", "dependencies": { "react": "^15.3.0", "react-dom": "^15.3.0" } } index.html in electron success <head> <meta charset="utf-8"> <title>stw</title> <script src="js/browser.min.js"></script> </head> <body> <div id="container"> </div> <script type="text/babel"> import react,{component} 'react'; import reactdom 'react-dom'; // import ff from'./foo.js'; class f1 extends component{ render(){ return <div>this react component</div> } }; reactdom.render(<f1/>,document.getelement

laravel - Component is not properly rendering in VueJs -

Image
i've been learning vue.js components , trying show data using vue.js , laravel. somehow can't rendered properly. show me doing wrong? my routes: my gulpfile: i'm posting code. main.js file: import vue 'vue'; import router 'vue-router'; import resource 'vue-resource'; import app './components/app.vue'; import homeview './components/homeview.vue'; // installing plugins vue.use(router); vue.use(resource); // registering filters globally // vue.filter(); export var router = new router({ history: true }); router.map({ '/': { name: 'app', component: app, }, 'test':{ name: 'test', component: homeview } }); // redirect 404 pages router.redirect({ '*': '/' }); router.start(app, 'app'); my index.blade.view : <!doctype html> <html> <head> <title>crud vue js</title>

Braintree - create customer with Paypal details -

we studying feasibility of using braintree payment gateway 1 of our client. one of our requirement create persistent customer specific payment method/s (paypal, credit/debit etc) using braintree java api. registered customer account debited , amount transferred client's account , when need arises. we have following queries. is there constraint/limitation country customer can belong to? example, can create customer in braintree resident of india or china? can braintree transfer amount customer's account in india client/merchant's account in usa , vice versa? in braintree sandbox account can create new customer credit card payment method. how can create customer paypal payment method in sandbox? i have gone through braintree customer.create() java api. using customer.create() api can create new customer credit card details. how can create new customer paypal details using api call? can provide customer's paypal account details while calling customer.create()?

Shell script to fetch value of a node appearing multiple times in an XML -

i have xml below: <artifact> <a>1.zip</a> <b>2-snapshot.zip</b> <c>3-snapshot.zip</c> </artifact> <artifact> <a>4.tar</a> <b>5.tar</b> <c>6.tar</c> </artifact> my requirement fetch value "5.tar" coming in 2nd appearance of node "artifact". able fetch value if node present once in xml. however, if same node appearing twice or multiple times in same xml, not able fetch it. please help. i break down answer tried using xmllint $ echo "cat //root/artifact/b" | xmllint --shell buildresult.xml | sed '/^\/ >/d' | sed 's/<[^>]*.//g' | tr -d '\n' | awk -f"-------" '{print $2}' 5.tar i have formatted original buildresult.xml file adding <root> nodes , adding proprietary header information, avoid parsing errors:- $ xmllint -format buildresult.xml <?xml version="1.0

c++ - QODBC SQL timeout -

i have c++ qt application running on many devices, needs communicate ms sql server. i'm using qodbc3 (unixodbc) driver. the sql connection once initialized , connected , used repeatedly. this, query runs fast (max 20ms). everythink works fine when there no connection issue. when network connection lost short time, sql connection can not "reconnect". i tried check if connection on before each query attempt, qsqldatabase::isopen() returns true unless close() called. not change after network issue. in oppinion, best way setting timer in odbc driver short time , try reconnect when timeout goes off. timeout in odbc set cca 15 minutes , not able set different value. sqlconnection.setconnectoptions("sql_attr_connection_timeout=5"); this command seems change nothing, tried complete nonsense in string, no error or something. my next try ping server every time before running query, if network connection on again, ping goes true , sql connection still br

redis - Should I use mysql or ssdb to store like/vote data? -

every user can vote videos, we're using mysql, have on 200 million lines in single table fields this: id user_id # voter video_id # voted video author_id # author of video state # 1 normal , 0 cancelled, maybe others created_at the common query voters of specific video, maybe voters of videos author, or videos voted user needed, ordered time. should shard table 100 shards (by video_id) or use ssdb instead? if choose former, in order query author_id or user_id, data have stored several times. if choose ssdb, think should use ordered set , store timestamp score sort, , have several keys each user or video in order query different fields , handle different states. , it's difficult change code , migrate data. had same confusion. using both of them together: redis caching hot data; mysql data persistent; no doubt more redis keys come more complexity, there must caching module reducing queries mysql. and because use redis cache, data in

multithreading - Rx .NET: Filter observable until task is done -

i´m learning rx .net , colleague send me simple example start there ugly don't like. the code: using system; using system.reactive.linq; using system.reactive.threading.tasks; using system.threading.tasks; using system.windows.forms; using system.collections.generic; namespace windowsformsapplication1 { public partial class form1 : form { public iobservable<content> contentstream; public static bool isrunning = false; public form1() { initializecomponent(); contentstream = observable.fromeventpattern<scrolleventargs>(datagridview1, "scroll") // create scroll event observable .where(e => (datagridview1.rows.count - e.eventargs.newvalue < 50 && !isrunning)) //discart event if scroll not down enough //or retrieving items (isrunning) .select(e => { isrunning = true; return 100; }) //transform 100--100--100--> stream, disc

asp.net - Internet Exporer 11 rendering table improperly -

Image
on page have table few elements in it, messes in internet explorer 11. appreciated here looks in vs: in chrome: and here ie: my code: <table> <tr> <td style="width: 50%; text-align: left"><br /><br /><br /> <asp:label id="lbl_dm_rvi" runat="server" text="sometext rvi"></asp:label><br /> <asp:label id="lbl_dm_odv" runat="server" text="sometext odv"></asp:label> </td> <td style="width: 50%; text-align: right; text"> <asp:label id="lbl_hochrechnung" runat="server" text="hochrechnung_rx_sm_kvbez"></asp:label><br /> <asp:label id="lbl_modul1" runat="server" text="modul 1"></asp:label><br /> <a

Python Terminal unexpected character after line continuation character -

i have file isqrt.py, containing following code: cmath import sqrt x = -1 y = sqrt(x) print(y) i getting following error in mac terminal: file "isqrt.py", line 1 {\rtf1\ansi\ansicpg1252\cocoartf1265\cocoasubrtf210 ^ syntaxerror: unexpected character after line continuation character do know causing error? your error showing file you're running not think is; it's got whole load of control characters. seems you've saved file rtf rather plain text. ideally, should use proper text editor write python code.

java - how group by having limit works -

can explain how construction group + having + limit work? mysql query: select id, avg(sal) streamdata ... group id having avg(sal)>=10.0 , avg(sal)<=50.0 limit 100 query without limit , having clauses executes 7 seconds, limit - instantly if condition covers large amount of data or ~7 seconds otherwise. documentation says limit executes after having after group by, means query should execute ~7 seconds. please figure out limited limit clause. using limit 100 tells mysql return first 100 records result set. assuming measuring query time round trip java, 1 component of query time network time needed move result set mysql across network. can take considerable time large result set, , using limit 100 should reduce time 0 or near zero.

java - Binary Search Map which hashes values -

the following code provides simple version of class tracks how string inputed (method addpv) , can output k strings highest count in order (method firstk). in simplified code below, binary seach tree (treeset) used track counts , keep order. secondary data structure (hashmap) used rapidly access elements in treeset. composite entry class containing string name , count used, count determines natural order , name hashcode. the elegant way use bst (e.g. treemap) entry have count key , string name value. internal hashmap used efficiently access entries in bst in constant time. there standard data structure in common libraries general objects? import java.util.*; public class mostvisitedpages { private hashmap<string,countentry> hm = new hashmap<>(); private treeset<countentry> ts = new treeset<>(); private static class countentry implements comparable<countentry>{ string page; int count; countentry (string page,

mvvm - Nativescript getViewById from ViewModel -

i used textfield using getviewbyid() apply native android filters it. how can viewmodel without breaking rules of mvvm architecture? you cannot access textfield viewmodel without breaking mvvm pattern. anyway, advice call getviewbyid() viewmodel set native android filter functionality, since mvvm implementation of nativescript not designated solving problem. doesn't have fear bad practice @ all.

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null .

php - Remote connect to database at demo.phpmyadmin.net? -

i teach little php , sql , students temporarily connect database have testet on demo.phpmyadmin.net, done using: $username = "root"; $password = ""; $hostname = "192.168.30.23"; if doesn't seem work me. :)

wordpress - PHP foreach loop to normal statements -

i doing website on wordpess , got problems foreach loop. got following code printing links on website providing know each status , want print them in different order how can destroy foreach loop , write 1 after other. there 3 different statuses , instead of showing them everytime first last, want order them in different ways depending on page on. help? understand how foreach loops work cant manage it <?php foreach ( $property_statuses $property_status ) { ?> <li><a <?php if($current == $property_status->name) { ?>class="current trianle"<?php } ?> href="<?php echo get_term_link($property_status); ?>?property_layout=<?php echo $property_layout; ?>&amp;status=<?php echo $property_status->name; ?>&amp;sort_by=<?php echo $sort_by; ?>"><?php echo $property_status->name; ?></a></li> <?php }

angularjs - Angular could not resolve from state -

i used jhipster generate app , tried add 2 different types of forms, both use same entity (one wouldn't use fields in entity , other use all). now, works alright for: .state('xyz', { parent: 'entity', url: '/xyz', data: { authorities: ['role_user'], pagetitle: 'xyzs' }, views: { 'content@': { templateurl: 'app/entities/xyz/xyzs.html', controller: 'xyzcontroller', controlleras: 'vm' } }, resolve: { } }).state('xyz.new', { parent: 'xyz', url: '/new', data: { authorities: ['role_user'] }, onenter: ['$stateparams', '$state', '$uibmodal', function($stateparams, $state, $uibmodal) { $uibmodal.open({ templateurl

java - IntelliJ debugger can't find a variable -

Image
i inside lambda debugger , intellij not able display variables. in example (the breakpoint below code): intellij not able find "bidrequest" object. idea of doing wrong? on intellij 15. i have updated java 1.8.0_25 1.8.0_102 , works !

selenium chromedriver - Not able to Run script, Error with parameter in TestNG, -

i trying execute script login webpage.can any1 me solve dis problem? i getting below error:- the data provider trying pass 7 parameters method efgh.datadriven#login takes 2 public class datadriven { public webdriver driver; @test(dataprovider ="testdata") public void login(string username, string password){ driver=new chromedriver(); driver.get("https://pos.lycamobile.es/login/login.aspx?lang=es"); driver.findelement(by.name("username")).sendkeys(username); driver.findelement(by.name("password")).sendkeys(password); driver.close(); } @dataprovider(name = "testdata") public object [] [] readexcel() throws biffexception, ioexception { file f =new file("d:\\users\\sarsiddi\\documents\\datasheet.xls"); workbook w = workbook.getworkbook(f); sheet s= w.getsheet("lycadata"); int rows = s.getrows(); int columns

PHP MySQL un identified character -

we have script receive data device. information contains device id , latitude , longitude etc. we getting other data except device id(which @ beginning of below string) in readable format. $$�1233oÿÿ™u095933.000,a,4949.4194,n,00839.0009,e,0.00,194,080816, i have set utf-8 in php code , mysql db (where stores data) , in php.ini character set .

c# - Custom control / UIView in Xamarin.iOS with design-time properties -

i creating user interface ios app , looking correct way create reusable custom control. got working when running app, @ design time setting "exported" properties has no visible effect in designer. think doing fundamentally wrong, perhaps give me guidance what doing: i have created subclass of uicontrol . in constructor call initialize method. in initialize method, add several subviews , constraints layout them within control here hollowed out code shows above: [register("rangedvalueselector"), designtimevisible(true)] public sealed class rangedvalueselector : uicontrol { public rangedvalueselector(intptr p) : base(p) { initialize(); } public rangedvalueselector() { initialize(); } public int horizontalbuttonspacing { { return _horizontalbuttonspacing; } set { _horizontalbuttonspacing = value; } } [export("labelboxverticalinse

sql - Error c# .net Operation must use an updateable query -

error there in cmd3.executenonquery(); for(int i=0; i<listview1.items.count;i++) { string query2 = "insert orderitems(order_id,item_id,oi_quantity,unit_price) values ('"+convert.toint32(textboxid.text)+"','"+convert.toint32(this.listview1.items[i].subitems[5].text.tostring())+"','"+convert.toint32(this.listview1.items[i].subitems[3].text.tostring())+"','"+convert.toint32(this.listview1.items[i].subitems[2].text.tostring())+"')"; oledbcommand cmd2= new oledbcommand(query2,con); cmd2.executenonquery(); string query3 = "update item set stock=(select stock item id='" + convert.toint32(this.listview1.items[i].subitems[5].text.tostring()) + "') - '" + convert.toint32(this.listview1.items[i].subitems[3].text.tostring()) + "' id='" + convert.toint32(this.listview1.items[i].subitems[5].text.tostring()) + "' "; oledbcomman

rules - Scrapy - target specified URLs only -

am using scrapy browse , collect data, finding spider crawling lots of unwanted pages. i'd prefer spider begin set of defined pages , parse content on pages , finish. i've tried implement rule below it's still crawling whole series of other pages well. suggestions on how approach this? rules = ( rule(sgmllinkextractor(), callback='parse_adlinks', follow=false), ) thanks! your extractor extracting every link because doesn't have rule arguments set. if take @ official documentation , you'll notice scrapy linkextractors have lots of parameters can set customize linkextractors extract. example: rules = ( # specific domain links rule(lxmllinkextractor(allow_domains=['scrapy.org', 'blog.scrapy.org']), <..>), # links match specific regex rule(lxmllinkextractor(allow='.+?/page\d+.html)', <..>), # don't crawl speicific file extensions rule(lxmllinkextractor(deny_extens

mysql - Laravel ORM/Query builder how get the next page result/content -

hi need on how make query return remaining data 10 using laravel pagination. i have 15 numbers of data on table, on first request returns first 10 data correct, need remaining 5. i doing using jquery infinite scroll i'm not showing pagination or links/urls on view public function index() { $query = task::wheredate('due', '<', date('y-m-d')) ->where('task_phase_id', '<>', 4) ->where('task_status_id', '<>', 9) ->paginate(10); dd($query); } thanks in advance, if convert $query json, you'll have object attribute called next_page_url (see doc here ). it looks http://laravel.app?page=2 . you can use has request url jquery. e.g : when scroll page bottom, call next_page_url

php - $_GET JavaScript and AJAX... -

i relatively new php , (trying to) developing first ajax code... i trying pass attribute select several options, each option own unique attribute "values" string. the php file gets value , (for instance prints out). , generated file returned main html page. here source code... here javascript : function showuser(myelement) { var str = myelement.options[myelement.selectedindex].getattribute("values"); if (str == "") { document.getelementbyid("myresponse").innerhtml = ""; return; } else { if (window.xmlhttprequest) { // code ie7+, firefox, chrome, opera, safari xmlhttp = new xmlhttprequest(); } else { // code ie6, ie5 xmlhttp = new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readystate == 4 && xmlhttp.status == 200) { document.gete

java - HWPF-POI:The table insert into doc with poi hwpf is not visible -

Image
i want insert table @ specific position poi, table generated, find table not visible. the generated table in doc visible when previewing or editing doc macos , text tool, poi can read table , content, too. plan upload 4 pictures display process, can post 2 images, sorry that. @test public void exportdoc() throws exception { fileinputstream readfile = new fileinputstream(new file(readdoc)); fileoutputstream replacefile = new fileoutputstream(new file(replacedoc)); hwpfdocument document = new hwpfdocument(readfile); table table = wordutil.insertnewtable(document,"${table}"); inserttableindoc(table); document.write(replacefile); readfile.close(); replacefile.close(); } private table insertnewtable(hwpfdocument doc, string sourcevalue) { range range = doc.getrange(); table table = null; (int = 0; < range.numsections(); ++i) { section s = range.getsection(i); (int x = 0; x < s.numparagraphs(); x++) {

html - How to create that background on my page with css -

Image
this question has answer here: css shape inset curve , transparent background 2 answers please me. want create shape on image, on page, should background of section. thank you. try this .yourtag { background: radial-gradient(circle @ 91% 50%, transparent 35%, red 15px); } fiddle - https://jsfiddle.net/p0ctco0m/1/

gpo - Azure, group policy on azure as on-premises -

is there way deploy policies client on azure on-premises? dig , found azure ad , intune some. need on-premises gpo does. you can deploy site-to-site vpn. vms on azure connected corpnet directly. able join these vms domain. to create site-to-site vpn, please follow article .

shell - Import-CSV cmdlet in powershell -

got problem powershell script. the import-csv cmdlet not working want it... what want do? - import single names out of 1 column header "name" create paths. name jack thomas john this code function: $users = import-csv -path "$csvpath" -header "name" $path = ("d:\users\" + $users) foreach ($user in $users) {write-host $path} but output i'm getting "d:\users\" i'm not pro in coding can't see failure :d new update: $users = import-csv -path "$csvpath" -header "name" changed : $users = import-csv -path "$csvpath" you can not $path, because $users not string. $path = ("d:\users\" + $users) instead, can this foreach ($user in $users) {$path = "d:\users\" + $user ; write-host $path} but think want this: foreach ($user in $users) {$path = "d:\users\" + $user.name ; write-host $path} ============================================

In depth Twitter Search API in tweepy -

i wanted search tweets "by keyword" "given screen name." example, tweets "bbcnews" "weather". looking tweepy library, found code: tweepy.cursor(api.search, q="weather", rpp=100, result_type="recent", include_entities=true, lang="en") however, how gonna filter tweets such bbcnews? thank in advance. the list of options can use filter tweets find can found here : https://dev.twitter.com/rest/public/search you can put them directly in query, without caring tweepy. in case, suggest tweepy.cursor(api.search, q="weather from:bbcnews", rpp=100, result_type="recent", include_entities=true, lang="en") you can add -filter:retweets request rid of retweets.