Posts

Showing posts from July, 2012

python - Error connecting to SQL Server from Ubuntu+PYODBC -

i found many similar question none of solutions worked me. seems pretty simple matter still can't find solution. i'm using headless ubuntu server connect sql server on windows server 2008 using python script using pyodbc. script runs on local windows machines, when try on ubuntu server error: error: ('im002', '[im002] [unixodbc][driver manager]data source name not found, , no default driver specified (0) (sqldriverconnect)') the connection string i'm using is: connectionstring='driver={dbserverdsn};server=10.23.11.10;database=market;uid=usr;pwd=pwd;tds_version=7.2;port=1433' any thoughts ? in advance edit : adding main files odbc.ini [dbserverdsn] driver = freetds server = 10.23.11.10 port = 1433 database=markets tds_version = 7.2 odbcinst.ini [freetds] description = v0.91 protocol v7.2 driver = /usr/lib/x86_64-linux-gnu/odbc/libtdsodbc.so freetds.conf [global] # tds protocol version, use: ...

java - Intersection of multiple sets (as collections) -

how can find intersection of multiple (more two) sets in java? retainall wont work since need ability intersection between more 2 sets you can use set's retainall(other) method retains items in both sets. alters original set, may want take copy of set first (use appropriate constructor).

vb.net - ActiveX cannot create object error when trying to convert PDF file to text file -

when try convert pdf file text file, encounter following error: involving acrobat error 429 : activex cannot create object my code is: private sub commandbutton1_click() dim acroxapp acrobat.acroapp dim acroxavdoc acrobat.acroavdoc dim acroxpddoc acrobat.acropddoc dim filename string dim jsobj object dim newfilename string filename = "c:\users\boominathan\desktop\test.pdf" newfilename = "c:\file.txt" set acroxapp = createobject("acroexch.app") set acroxavdoc = createobject("acroexch.avdoc") acroxavdoc.open filename, "acrobat" set acroxpddoc = acroxavdoc.getpddoc set jsobj = acroxpddoc.getjsobject jsobj.saveas newfilename, "com.adobe.acrobat.plain-text" acroxavdoc.close false acroxapp.hide acroxapp.exit end sub and error in following line: set acroxapp = createobject("acroexch.app") can please me resolve it? t...

Bash: how do I pipe stdout and stderr of one process to two different processes? -

i have process myprocess1 produces both stdout , stderr outputs. want pipe 2 output streams 2 different downstream processes, myprocess2 , myprocess3 , massage data , dump results 2 different files. possible single command? if not, 2nd best running 2 separate commands, 1 process stdout , other stderr . in case, first run be: myprocess1 | myprocess2 > results-out.txt what similar command process stderr ? thx without fancy games should work: { myprocess1 | myprocess2 > results-out.txt; } 2>&1 | myprocess3 > results-err.txt with fancy games (which not work in /bin/sh , etc.) this: myprocess1 2> >(myprocess3 > results-err.txt) | myprocess2 > results-out.txt

android - Talk Back accessibility, requesting focus on a TextView -

we have requirment accessibility when given activity opens , user has talkback accessibility on, client wants talk not read activity name, text of our welcometext textview. text view dynamic in "welcome, " i tried doing in activity oncreate() saying: welcometext =(textview)getview().findviewbyid(r.id.authenticatednowishlistwelcometext); welcometext.setfocusableintouchmode(true); welcometext.requestfocus(); but not working.. can tell me how can talk read given textview upon launch without user interaction? the important thing realize here, focus , accessibility focus not same thing. you looking following: welcometext.sendaccessibilityevent(accessibilityevent.type_view_focused); be careful when this. doing in oncreate bad idea, happen when application activity loaded. want happen each time resumed. also, @ (talkback) creates connection activity @ point in lifecycle, , want sure don't have race condition. talkback must connect activity befo...

spark-scala: groupBy throws java.lang.ArrayIndexOutOfBoundsException (null) -

i started following rdd has string ((26468ede20e38,239394055),(7665710590658745,-414963169),0,f1,1420276980302) ((26468ede20e38,239394055),(8016905020647641,183812619),1,f4,1420347885727) ((26468ede20e38,239394055),(6633110906332136,294201185),1,f2,1420398323110) ((26468ede20e38,239394055),(6633110906332136,294201185),0,f1,1420451687525) ((26468ede20e38,239394055),(7722056727387069,1396896294),0,f1,1420537469065) ((26468ede20e38,239394055),(7722056727387069,1396896294),1,f1,1420623297340) ((26468ede20e38,239394055),(8045651092287275,-4814845),0,f1,1420720722185) ((26468ede20e38,239394055),(5170029699836178,-1332814297),0,f2,1420750531018) ((26468ede20e38,239394055),(7722056727387069,1396896294),0,f1,1420807545137) ((26468ede20e38,239394055),(4784119468604853,1287554938),0,f1,1421050087824) just give high level view on description of data. can think first element in main tuple (first tuple) user identification, second tuple product identification, , third element user's pref...

python - Imported two separate text files to organize into dict, does not reading 2nd file properly and get a KeyError for any data in the 2nd file -

i trying add branded , generic cereals under 1 dictionary , separate key named main_brand holding boolean value. this in file mainbrands.txt # brand name,company,founded apple jacks,kellogg's,1965 cheerios,general mills,1941 ... this in file genericbrands.txt apple jills,afirm,2011 cheery oats,bfirm,2015 ... this under main.py import os branded = open(os.path.join(os.getcwd(), 'mainbrands.txt'), 'r').readlines() generic= open(os.path.join(os.getcwd(), 'genericbrands.txt'), 'r').readlines() history = {'founded': {}, 'main_brand': {}} x in range(0, len(branded)): data = branded[x].strip().split(',') history[data[0]] = {'company': data[1], 'founded': data[2], 'main_brand': true} y in range(0, len(generic)): data = generic[y].strip().split(',') history[data[0]] = {'company': data[1], 'founded': data[2], 'main_brand': false} def history_ch...

jquery - add download function to a click event with Javascript -

i wondering if possible add download function click event purely in javascript, example, when user clicks on image, gets automatically downloaded. example have image tag <img src="filelocation" id="img"/> , want downloaded on click. (i can't use "download="myfile.png" . is there $('#img').on('click',function(e){ img.download="myfile.png"; }); all answers online suggest adding download="..." tag thanks! maybe this: document.getelementbyid('download').click(); <a id="download" href="https://assets.entrepreneur.com/content/16x9/822/20150721193719-solshero3.jpeg" download hidden></a> play it: here but if can't have download attribute: play then. good luck!!

python - S3ResponseError: 403 Forbidden using Boto -

i have permission problem on s3 bucket when try access files using boto in python. here bucket policy : { "version": "2008-10-17", "id": "policy1407346649831", "statement": [ { "sid": "stmt1407346646598", "effect": "allow", "principal": { "aws": "arn:aws:iam::029030651757:user/my_iam_user" }, "action": "s3:*", "resource": ["arn:aws:s3:::my_bucket/*", "arn:aws:s3:::my_bucket"] }, { "sid": "2", "effect": "allow", "principal": { "aws": "arn:aws:iam::cloudfront:user/cloudfront origin access identity efus443hmbyf" }, "actio...

PHP While Loop: Second While Loop not showing data -

i'm having trouble on while loop. here code: <?php //display's skill list $showitemlist = $con->query('select * items'); if ($showitemlist->num_rows > 0) { $x=1; // output data of each row while($row = $showitemlist->fetch_assoc()) { echo '<tr>'; echo '<td>' . $x++ . '</td>'; echo '<td>' . $row['item_id'] . '</td>'; echo '<td>' . $row['item_name'] . '</td>'; echo '<td>' . $row['item_category'] . '</td>'; echo '<td>' . $row['item_costprice'] . '</td>'; echo '<td>' . $row['item_retailprice'] . '</td>'; echo '<td>' . $row['item_tax'] . '%</td>'; echo '<td>'; $showinhouseqty =...

python - How to build a model with multiple sine waves -

so have data set need find model function for, sine or cosine waves. have been trying find guide on how model sine waves in python, seems examples find using 1 sine wave , need multiple waves map this. if knows how map multiple sine waves great. y-axis = [-0.67818604651162795, -0.6547391304347826, -0.64717777777777785, -0.7291399999999999, -0.76626470588235296, -0.73485714285714299, -0.74283333333333346, -0.7376538461538461, -0.7194799999999999, -0.75478571428571439, -0.75462857142857143, -0.6249473684210527, -0.62299999999999989, -0.66933333333333334, -0.71358823529411775, -0.73843589743589755, -0.76109803921568631, -0.81569230769230749, -0.74926470588235294, -0.70762857142857138, -0.7171923076923078, -0.68428, -0.71395454545454551, -0.74174999999999991, -0.7476666666666667, -0.69532727272727279, -0.64591836734693875, -0.68385294117647066, -0.60952941176470576, -0.63846666666666674, -0.72566666666666679] x-axis = [6040, 6080, 6120, 6160, 6200, 6240, 6280, 6320, 6360, 6400, 6440,...

android - How to place file in app directory via USB -

i'm writing app reads local file ... file fxmlfile = new file(file); documentbuilderfactory dbfactory = documentbuilderfactory.newinstance(); documentbuilder dbuilder = dbfactory.newdocumentbuilder(); document doc = dbuilder.parse(fxmlfile); ... i want place file app's directory can commence testing. outputting exception find out java.io.filenotfoundexception /data/data/com.blablabla.myapp/files/sample_file.xml: open failed. enoent (no such file or directory). i'm confused find directory /data/data/... i've connected phone via usb , did find /android , /data directories. i've created directory com.blablabla.myapp/files/ , added sample_file.xml there continue getting error. what doing wrong? appreciated. i tried looking file on internal storgage. turns out can see when connected via usb/mtp protocol external storage. such, unable place file read statement find it. making adjustment app looks file made difference.

Rendering a grails template outside of the application -

i have flexibility render templates emails , files not present underneath views/ directory or anywhere in application. the reason can package , deploy versions of templates independently of main application. so have template '_backup_email.gsp' defined under 'views/emails/'. if following: render groovypagerenderer.render(template: "/emails/backup_email", model: [servergroup: servergroup]) then renders fine. if copy template 'c:/templates/emails/_backup_email.gsp' execute following: render groovypagerenderer.render(template: "c:/templates/emails/backup_email", model: [servergroup: servergroup]) i blank screen. i missing here. how using property instead of hard coded paths templates? you can start application -dtemplatefolder=/home/user/grails/templates. i keep templates plain text files content of mails etc. can include rendered/merged templates in gsps reside in usual grails folders. since using grails, m...

c++ - Is there another way to call Base method from derived which is virtual -

i wondering if there way call virtual base method derived instead of: void y() //is virtual in base { base::y(); } if duplicate, i'm sorry. regardless of why want this, can achieve same thing using alternate syntax. add resolution syntax dereferencing of variable (the same can achieved non-pointers dereferenced . operator) #include <iostream> using namespace std; class { public: virtual void x( ) { cout << "a::x()\n"; } virtual void y( ) { cout << "a::y()\n"; } }; class b : public { public: virtual void x( ) { cout << "b::x()\n"; } virtual void y( ) { cout << "b::y()\n"; } }; void main( ) { b* xb = new b( ); a* xa = xb; xb->x( ); xb->y( ); xa->x( ); xa->y( ); xb->a::x( ); xb->a::y( ); system( "pause" ); }

c# - PetaPoco Query View Always Returns NULLS -

i have below view in sql server represented using petapoco in c# application: /// <summary> rep level keys. </summary> [tablename("vxpatreplevelkeys")] [explicitcolumns] public partial class vxpatreplevelkeys : dbo.record<vxpatreplevelkeys> { /// <summary> gets or sets replevelkey. </summary> public string replevelkey { get; set; } } however, when attempt select view using: var result = _database.fetch<xpat.vxpatreplevelkeys>("select * vxpatreplevelkeys").orderby(x => x.replevelkey); var asstrings = result.select(x => x.replevelkey).tolist(); i list of null values. asstrings has 33 items in list, being null. however, when run above view myself, 33 non-null results. i'm new petapoco (tbh, i'm not sure if petapoco related issue) , have inherited application, i'm attempting add new view appreciated. if use [explicitcolumns] attribute, must use [column] attribute on each property...

c# - Error populating dropdownlist from SQL Database -

so have add data connection vs project , i'm trying populate drop down menu created data tables coming database; however, when run code says, "login failed use 'username', on line: cmd.connection.open(); this c# code: using system.web; using system.web.security; using system.web.ui; using system.web.ui.webcontrols; using system.web.ui.webcontrols.webparts; using system.web.ui.htmlcontrols; using system.data.sqlclient; namespace test1234 { public partial class home : system.web.ui.page { protected void page_load(object sender, eventargs e) { populateddlist1(); //populateddlist2(); //populateddlist2_1(); } public void populateddlist1() { sqlcommand cmd = new sqlcommand("select * [history]", new sqlconnection(configurationmanager.appsettings["connection"])); ...

oracle11g - update a column based on whether another column was updated -

i have 2 columns in table - column_1 last_update_date so when column_1 updated, need update last_update_date. how should write update query? i'm using oracle database. update table_name set column_1 = 'column_1_value', last_update_date = sysdate

html - How to use Javascript to populate a select form (i.e. dropdown) based on elements in a class -

i have html unknown number of elements of particular class. for example: the point of using lorem ipsum has more-or-less normal <span ?class="star-pagination">*112</span> distribution of letters, opposed using 'content here, content here', making readable english. many desktop publishing packages , web page editors use lorem ipsum default model text, , search 'lorem ipsum' uncover <span class="star-pagination">*113</span> many web sites still in infancy. upon page load, populate list such user can select number corresponds instance of . end goal want list display associated page number (e.g. 112 or 113) rather instance number (e.g. 1, 2, 3). finally, event redirect user relevant instance (i.e. brought "page" have selected). i have following script working checks number of elements in class "star-pagination." right writes variable indicate if file has elements star pagination. <scr...

php - When going through Laracast Tutorials, the output I get doesn't match what they get. What am I doing wrong? -

i'm going through laracasts tutorials tinker not laracasts , won't i'm trying do psy shell v0.5.1 (php 5.5.12 ÔÇö cli) justin hileman >>> $article = app\article::create{['title' => 'new article', 'body' => 'new body', 'published_at' => carbon\carbon::now()]); php parse error: syntax error, unexpected '{' on line 1 >>> $article = app\article::create{['title' => 'new article', 'body' => 'new body', 'published_at' => carbon\carbon::now()]); php parse error: syntax error, unexpected '{' on line 1 >>> $name php error: undefined variable: name on line 1 >>> $article = new app\article; => app\article {#655} >>> $article => app\article {#655} >>> new app\user; => app\user {#648} >>> $article = new app\article; => app\article {#651} >>> this it's displaying know wrong? ...

HTML5 video poster image not scaling fullscreen on iPad retina -

Image
i have fullscreen video on website. on ipads want load poster image fullscreen well. markup , css have works on low-res ipad mini, doesn't display full-screen on ipad retina. html... <video autoplay poster="/images/styles/vid_home_screenshot.jpg" id="bgvid" loop> <source src="/video/globe_vid_main_1280x720_v4.mp4" type="video/mp4" /> <source src="/video/globe_vid_main_1280x720_v4.webm" type="video/webm" /> <source src="/video/globe_vid_main_1280x720_v4.ogv" type="video/ogg" /> </video> this css on video element... video {position: absolute; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -100; transition: 1s opacity; top: 0; left: 50%; transform: translate(-50%,0); -webkit-transform: translate(-50%,0); } position: ...

How to get the mp4 url for Youtube videos using Youtube v3 API -

how full mp4 url play video it's actual location in application using other source except youtube. gdata/youtube api has been deprecated having trouble. appreciated. thanks. just found useful online tool: https://weibomiaopai.com/online-video-downloader/youtube it has api free use (subject fair use policy). https://uploadbeta.com/api/video/?cached&video=https://www.youtube.com/watch?v=a4hnjwou-za returns: {"host":"youtube.com","url":"https:\/\/r7---sn-aigllnzz.googlevideo.com\/videoplayback?mime=video%2fmp4&key=yt6&nh=igpwcjazlmxocje0kgkxmjcumc4wlje&ratebypass=yes&dur=572.023&clen=50056536&ei=h4uswjwfd6jgigaznbkqag&source=youtube&initcwndbps=1032500&requiressl=yes&ipbits=0&sparams=clen%2cdur%2cei%2cgir%2cid%2cinitcwndbps%2cip%2cipbits%2citag%2clmt%2cmime%2cmm%2cmn%2cms%2cmv%2cnh%2cpl%2cratebypass%2crequiressl%2csource%2cupn%2cexpire&lmt=1449751349064477&ms=au&itag=1...

angularjs - $http.post().then vs $q library? -

it understanding when $http.post(...).then(...) in angularjs, returns promise. confusing part me $q promise library , if $http.post(...).then(...) creates promise me, $q library necessary? if dealing respose via $http.post(...).then(...) don't need use $q service directly. but angular uses $q internaly when calling $http . also note $q not separate library, module inside angular core.

node.js - VS2015 RTM can't build Cordova app on iOS with remotebuild -

i built apache cordova app using visual studio 2015 rc. on mac, had vs-mda-remote installed build ios app. worked great, until upgraded official release today. vs-mda-remote doesn't work anymore , from documenation understand call remotebuild . cleaned npm , installed tools according documentation, run these errors. when try build project visual studio, error message: 0:error:0b07c065:x509 certificate routines:x509_store_add_cert:cert in hash table:openssl\crypto\x509\x509_lu.c:346: if copy source code mac , build there, works fine. any ideas? first disable security executing "remotebuild --secure false" on os x , in visual studio under tools->options->tools apache cordova->remote agent configuration, switch "secure mode" false. have done sure there no addidtional error , ran problem: windows 10; visual studio 2015 community: cannot post //build/tasks?command=build&vcordova os x terminal: comnmand: remotebuil...

java - JRBeanCollectionDatasource prints only first bean's propery values -

i'm working on simple jrbeancollection example, trying print property values of javabean collection pdf report. the problem code prints of first bean of list create. here code have written, public static void main(string[] args) { string filename = "src/test/report2.jasper"; string outfilename = "test.pdf"; hashmap hm = new hashmap(); jrbeancollectiondatasource beancollectiondatasource = new jrbeancollectiondatasource(fundbeanfactory.createbeancollection()); try { jasperprint print = jasperfillmanager.fillreport( filename, hm, beancollectiondatasource); jrpdfexporter exporter = new jrpdfexporter(); exporter.setexporterinput(new simpleexporterinput(print)); exporter.setexporteroutput(new simpleoutputstreamexporteroutput(outfilename)); simplepdfexporterconfiguration configuration = new simplepdfexporterconfiguration(); configuration.setc...

javascript - Print range images get by query in MYSQL- ASP.NET -

Image
i require print range of images bring in query, range can large when printing mean choose whether want print range nose images if has javascript or asp. net. <button name="printbutton" id="printbutton" type="button" class="btn btn-default" onclick= "printdiv('printablearea');" runat="server"> <span class="glyphicon glyphicon-print"></span> </button> </div> </div> </div> <div class="panel-body"> <div class="panzoom"> <div id="printablearea"> <img src="img/descarga.jpg" alt="visualización del original de la forma migratoria" class="img-responsive" runat="server"> ...

Svn dont ignore files when add console -

i working in project svn , have file ".svnignore" list of folders ignore. when run command "svn add *", svn add files including folders in ".svnignore". there better way add files in console except folders inside ".svnignore" list? subversion not use .svnignore file. use svn:ignore properties: http://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.ignore.html

xml parsing - In Perl, extract text from related nodes, using XML::Twig -

following xml file want parse: <?xml version="1.0" encoding="utf-8"?> <topic id="yerus5" xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/"> <title/> <shortdesc/> <body> <p><b>ccu_cnt_addr: (address=0x004 reset=32'h1)</b><table id="table_r5b_1xj_ts"> <tgroup cols="4"> <colspec colnum="1" colname="col1"/> <colspec colnum="2" colname="col2"/> <colspec colnum="3" colname="col3"/> <colspec colnum="4" colname="col4"/> <tbody> <row> <entry>field</entry> <entry>offset</entry> <entry>r/w access</entry> <entry>description</entry> </row> <row> <entry>reg2sm_cnt...

django - Webpack chunk load at run time -

i'm writing template django app, inside load .js file built webpack: <script src="{{ root }}/material/build/app.js" type="text/javascript"></script> it found, can access in browser it's under: http://127.0.0.1:8000/my_app_static/personalization/js/app/material/build/ the problem webpack config creates chunk 0.0.js cannot found, understand app.js uses somehow it's not searching in same folder resides, instead searches @ url: http://127.0.0.1:8000/personalization/material/958cb30c8751ff63160d7b22a69a9ec6/build/0.0.js this url defined in urls.py, it's url i'm @ before trying render_to_response("api/js_app_material.html", context_data, c) causes 0.0.js file not found. my question is: can somehow configure webpack let know search chunks in folder app.js resides? or there else i'm doing wrong? thanks! i ran similar , issue me: if using require(['app.jsx'], function (app) { }); tr...

amazon web services - Access AWS CodeCommit from Jenkins running on EC2 (Ubuntu) -

i'm trying integrate jenkins aws codecommit. jenkins running on aws ec2 instance ubuntu 14.04. i followed blogpost: http://blogs.aws.amazon.com/application-management/post/tx1c8b98xn0af2e/integrating-aws-codecommit-with-jenkins the problem is, sudo -u jenkins aws configure isn't executed because jenkins user has no permissions. what do? the following commands aren't working well: sudo -u jenkins git config --global credential.helper '!aws codecommit credential-helper $@' sudo -u jenkins git config --global credential.usehttppath true sudo -u jenkins git config --global user.email "me@mycompany.com" sudo -u jenkins git config --global user.name "myjenkinsserver" what rights jenkins user need? thanks in advance. i able achieve integration using ssh. extent, followed these instructions: setting codecommit assuming jenkins home /var/lib/jenkins/ create ssh key on jenkins ec2 instance (/var/lib/jenkins/.ssh/id_rsa) ...

java - NotificationManager: cancel(id) DON'T work -

from service, show notification. have code: public final static int notification = 1; public final static int notification2 = 2; case notification2: builder.setsmallicon(r.drawable.ic_action_about); builder.setcontenttitle(context.getstring(r.string.app_name)); new thread(new runnable() { @override public void run() { // todo auto-generated method stub for(int i=0;i<10;i++) { builder.setcontentinfo(i+"/"+10); notificationmanager.notify(notification2, builder.build()); try { thread.sleep(1000); } catch (interruptedexception e) { // todo auto-generated catch block e.printstacktrace(); } ...

outlook - Flagged messages via Office 365 REST API? -

i'm looking way detect & set 'flagged' status of email using office 365 rest message api. don't see 'flag' listed property of rest message , though see listed under exchange web services . i've attempted make rest call adding flag filtered properties, singlevalueextendedproperties , multivalueextendedproperties like: /folders/inbox/messages?$top=50&$select=subject,...,flag /folders/inbox/messages?$top=50&$select=subject,...,singlevalueextendedproperties /folders/inbox/messages?$top=50&$select=subject,...,multivalueextendedproperties all of these have come form of: {"error":{"code":"requestbroker-parseuri","message":"could not find property named \\\'flag\\\' on type \\\'microsoft.outlookservices.message\\\'."}} any suggestions on how access outlook 'flag' property via rest api? update: there flag property on message on /beta endpoint. recomme...

javascript - Need help creating async function with callback -

i have json object entries (appointments) each thereof "location id". loop trough these entries , emit request nodejs server socketio data document location id. at end need array data of lat/lng create marker on map. here code: //controller showing map .controller('mapctrl', function($scope, socket){ socket.emit('getapp', staticuserid); socket.on('getapps', function (appdata) { var locarr = []; (var = 0; < appdata.length; i++) { if (appdata[i].locationid != '') { locarr.push(appdata[i].locationid); } } var latlngarr = []; (var j = 0; j < locarr.length; j++) { socket.emit('getlocation', locarr[j]); socket.on('getloc', function (locdata) { console.log('received lat/lng: ' + locdata.lat + ...

ios - App size with different iPhone models -

i have problem app, app simple , created in viewcontroller of iphone 5s size. but problem here, when run app on iphone 6 mode ore 6 plus or 4s, size doesn't change in proportion iphone size, fixed background problem dragging background image view , clicking "center horizontally in container", "center vertically in container", "equal widths", "equal heights". but when try same small round buttons, app destroyed , button deformed. seems you're hardcoding ui positions , sizes in app. take auto layout . name suggests, allows have same ui layout on devices support, without hardcoding frames.

c# - How to customize a specific code for pagination when working with datagridview virtual mode on -

i reading xml file instead of database table , doing pagination way xdocument document = xdocument.load(xmlfilepath); var query = r in document.descendants("orders") select new { orderid = r.element("orderid").value, customerid = r.element("customerid").value, employeeid = r.element("employeeid").value }; query = query.orderby(sortcolumn + " " + orderdirection); query = query.skip(lowerpageboundary - 1 * rowsperpage).take(rowsperpage); but problem lowerpageboundary value controller class got msdn link https://msdn.microsoft.com/en-us/library/ms171624.aspx?f=255&mspperror=-2147217396 i following same code msdn gave pagination routine not compatible below code , not working too. query = query.skip(lowerpageboundary - 1 * rowsperpage).take(rowsperpage); first time lowerpageboundary 0 skip has 0 value , take has 16 value , when same line execute second time lowerpageboundary 16-16=0 so request 1 please s...

How to send cURL/API requests in C# with webRequest Class Multible Commands -

this question has answer here: how send / receive curl/api requests in c# 1 answer i need send server: curl https://api.placetel.de/api/getrouting.xml \ -d 'api_key=xxxxxxxxxxxxxxxxxxx' \ -d 'number=068111111xxx' if try: webrequest request = webrequest.create("https://api.placetel.de/api/getrouting.xml"); request.method = "post"; string postdata = "api_key=xxxxxxxxxxxxxxx number=0685123xxxxxx"; byte[] bytearray = encoding.utf8.getbytes(postdata); stream datastream = request.getrequeststream(); datastream.write(bytearray, 0, bytearray.length); datastream.close(); webresponse response = request.getresponse(); datastream = response.getresponsestream(); streamreader reader = new streamreader(...

javascript - material design table component does not make dynamic row selectable -

i'm having problems material design lite's table component. defined class mdl-data-table--selectable should make rows selectable. if statically defined in html, when create nodes dynamically , add table, not become selectable. please see this fiddle i did add componenthandler.upgradeelement(tr); not solve problem , throwed exception went on without that. hi, since can't find answer this, i'm open new suggestions on how can refresh table. currently, removing contents , generating table again requires adding of elements dynamically. suggestions welcome. from project site: material design lite automatically register , render elements marked mdl classes upon page load. in case creating dom elements dynamically need register new elements using upgradeelement function. http://www.getmdl.io/started/index.html#dynamic

android - Cannot resolve symbol 'ImageView2' -

i trying create imageview in fragment refer imageview element have created in xml fragment: @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreateview(inflater, container, savedinstancestate); final view c = inflater.inflate(r.layout.activity_source, container, false); imageview view = (imageview) getview().findviewbyid(r.id.imageview3); view.setontouchlistener(this); return c; } but although thought work cannot resolve 'imageview3' instead of (imageview) getview().findviewbyid(r.id.imageview3); use (imageview) c.findviewbyid(r.id.imageview3);

node.js - What (in_memory) graph DB if modeling data is focused -

i out of ideas , hope useful input. using question compress experiences , share them, hoping inspire distributors go next step modeling graph databases first class question/way. i've been validating graph database solutions usable node.js few weeks. my use case save interactions of different social user network accounts . need use cpu , memory in efficient way . my important requirements are: in_memory (at least indexing) open source (and free use) same javascript/node.js performance first class citizen comfortable query , modeling language neo4j i cypher best choice neo4j. major issue neo4j javascript access non-native. uses rest-api about ten times (10x) slower direct java access. took @ node-neo4j-embedded , has been inactive more 2 years. looks author isn't active @ (bad sign). arangodb the nice core developers of arangodb answered my question internals. means javascript first class citizen because native queries can pushed out of js. lookin...

C, Python, ctypes exit code -1073741819 (0xC0000005) -

c code(dll) #include <math.h> #include <wchar.h> #include <stdlib.h> struct doc { wchar_t path[512]; int r; int g; int b; }; struct docs { struct doc docs[1000000]; }; struct color { int r; int g; int b; }; float distance(int a, int b, int c, int d, int e, int f) { return sqrt((a-b)*(a-b)+(c-d)*(c-d)+(e-f)*(e-f)); } struct doc main(long len, struct color c, struct docs ds) { long near = 1000000; long l; struct doc f_d; (l = 0; l < len; l++){ struct doc d = ds.docs[l]; float dist = distance(c.r, d.r, c.g, d.g, c.b, d.b); if (dist < near){ near = dist; f_d = d; } } return f_d; }; python code class doc(ctypes.structure): _fields_ = [("path", ctypes.c_wchar_p), ("r", ctypes.c_int), ("g", ctypes.c_int), ("b", ctypes.c_int)] class docs(ctypes.struct...