Posts

Showing posts from January, 2013

Hadoop - Getting input paths, java api -

i passing file pattern: fileinputformat.addinputpath(job, new path("/path/to/file*")); and wish know files matches after job finished running, provided successful. i have tried: job.getconfiguration().get("mapreduce.input.fileinputformat.inputdir") but returning same thing: "/path/to/file*" i wondering if there's method matching paths without resorting creating routine scanning of directories. your enlightenment appreciated. try link, has few ways path in mapper. but, sure talking few more ways. :) how input file name in mapper in hadoop program?

java - Verify ECDSA signature using SpongyCastle -

i'm trying verify ecdsa digital signature on android using spongycastle. have x509certificate contains public key need use verify can't quite figure out how publickey (down cast ecpublickey ) use ecdsasigner class. i've done using c# version of bouncycastle looks this: ecdsasigner signer = new ecdsasigner(); signer.init(false, cert.getpublikey()); in java version of apis, x509certificate.getpublickey() method returns publickey class instead of asymmetrickeyparameter . however, ecdsasigner.init() method needs cipherparameters object. can't figure out how ecdsa. for rsa signatures manually reconstructed new rsakeyparameters object: rsaengine engine = new rsaengine(); engine.init( false, new rsakeyparameters( false, ((rsapublickey) pubkey).getmodulus(), ((rsapublickey) pubkey).getpublicexponent() ) ); this doesn't seem ideal think should work. can't figure out how equivalent ecdsa. think there's b...

How to debug the issue Unable to install the app from APK in Android -

i have android application. my qa reported when try deploy build apks in various emulators, apk not getting installed in os versions less 4.3.3. however, it's installing in emulator or device versions greater 4.3.3 but try , debug issue, ran application "android studio" on emulators of version less 4.3.3, application gets deployed properly. does mean it's not programming issue, build file or packaging issue? here's gradle snippet android { compilesdkversion 21 buildtoolsversion '21.1.2' defaultconfig { applicationid 'com.intuit.qm2014' minsdkversion 14 targetsdkversion 21 } how debug/fix these type of issues? try install on problem devices command adb install path_to_apk and see output. also see logcat output on problem devices (possibly filter tag "package manager") , you'll see info installation failed.

Connection refused error in SOAP while sending request to WSDL -

org.apache.axis.client.call _call = createcall(); _call.setusername("nehalp"); _call.setpassword("sap@123"); _call.setoperation(_operations[0]); _call.setusesoapaction(true); _call.setsoapactionuri("http://sap.com/xi/webservice/soap1.1"); _call.setencodingstyle(null); _call.setproperty(org.apache.axis.client.call.send_type_attr, boolean.false); _call.setproperty(org.apache.axis.axisengine.prop_domultirefs, boolean.false); _call.setsoapversion(org.apache.axis.soap.soapconstants.soap11_constants); _call.setoperationname(new javax.xml.namespace.qname("", "unlock")); setrequestheaders(_call); setusername("nehalp"); setpassword("sap@123"); setattachments(_call); try { java.lang.object _resp = _call.invoke(new java.lang.object[] {unlock_...

jquery - wrap image with next link -

i'm working on slideshow upcoming events. slides suppose link corresponding event page. but, not slides suppose have link if don't have event page. here html i'm able output: <ul> <li><img><a href="/link1">link1</a></li> <li><img><a href="/link2">link2</a></li> <li><img></li> // 1 doesn't have link </ul> then jquery i'm trying change html this: <ul> <li><a href="/link1"><img></a></li> <li><a href="/link2"><img></a></li> <li><img></li> // 1 doesn't have link </ul> here jquery i've been working on: $(function() { $(' ul li img').each(function() { // each image if($(' ul li img').next('a').attr("href").length) // check if banner has link var = $(this).next(...

python - How to add a repeated column using pandas -

i doing homework , encounter problem, have large matrix, first column y002 nominal variable, has 3 levels , encoded 1,2,3 respectively. other 2 columns v96 , v97 numeric. now, wanna group mean corresponds variable y002. wrote code group = data2.groupby(by=["y002"]).mean() then index each group mean using group1 = group["v96"] group2 = group["v97"] now wanna append group mean new column original dataframe, in each mean matches corresponding y002 code(1 or 2 or 3). tried code, shows nan. data2["group1"] = pd.series(group1, index=data2.index) hope me this, many :) ps: hope makes sense. r language, can same thing using data2$group1 = with(data2, tapply(v97,y002,mean))[data2$y002] but how can implement in python , pandas??? you can use .transform() import pandas pd import numpy np # data # ============================ np.random.seed(0) df = pd.dataframe({'y002': np.random.randint(1,4,100), 'v96': ...

ios - GCDAsyncSocket: [socket acceptOnPort: error:] not accepting -

so have been trying create 2 gcdasyncsocket 's in project, 1 ( socket ) uploads file server , other ( listensocket ) waits process server communicate it. in viewcontroller have initialized them in viewdidload method , setup delegate self both sockets. socket = [[gcdasyncsocket alloc] initwithdelegate:self delegatequeue:dispatch_get_main_queue()]; listensocket = [[gcdasyncsocket alloc] initwithdelegate:self delegatequeue:dispatch_get_main_queue()]; i made listensocket start listening by nserror *err = nil; if (![listensocket acceptonport:19920 error:&err]) { nslog(@"listensocket failed accept: %@", err); } i made socket connect remote server , start uploading files. the problem socket works fine , can upload , read response server, seems can't access accepting listensocket way. not other process on server, nor using telnet or typing ip address , port number browser. why , how fix it? edit: here's doing app: i working on app pr...

php - How To Get Data from JSON Into Unordered List? -

i have json file contain this: "menus": [{ "menuid": "1", "menuname": "perencanaan dan pengadaan", "menuparent": "", "menulink": "" }, { "menuid": "1-1", "menuname": "rka / dpa", "menuparent": "1", "menulink": "" }, { "menuid": "1-1-1", "menuname": "daftar rka / dpa", "menuparent": "1-1", "menulink": "rkbu" }, i want put data unordered list dynamically. output want (with 3 level list): perencanaan dan pengadaan rka / dpa daftar rka / dpa i have tried code: echo "<ul>"; foreach($get_data['menus'] $node){ if(strlen($node['menuid']) == 1){ echo "<li>" . $node['menuname']; echo "</li>...

python - Why does printing a variable in global scope work, but modifying it does not? -

x = 1 def fn(): print x fn() this prints "1": x = 1 def fn(): x += 1 print x fn() this raises "unboundlocalerror: local variable 'x' referenced before assignment" what going on here? in python, assigning variable implicit local declaration, resolved during bytecode compilation. so x += 1 will create local variable x , compile byte code: 0 load_fast 0 (x) 3 load_const 1 (1) 6 inplace_add 7 store_fast 0 (x) the command load_fast try load local variable x not yet defined, that's why fails. however, if define x global explicitly, use load_global / store_global instead. in case of print in first function, compiler assumes since no local variable declared (assigned) ever in function body, should mean global variable.

iptables unable to use same target -

i unable use same target under iptables. can please? iptables v1.4.21 kernel: 3.16.7 iptables -t nat -a postrouting -o eth0 -j same --to 1.2.3.4-1.2.3.7 iptables: no chain/target/match name. according iptables-extensions 's man page , same target superseded --persistent flag of dnat target: --persistent gives client same source-/destination-address each connection. supersedes same target. support persistent mappings available 2.6.29-rc2 .

ckeditor - Wrap multiple lines in one div -

currently in ckeditor, style drop-down let wrap content block or inline tags. if select multiples lines in editor , chose div element in style menu, each lines wrapped individually in div element. is possible select multiple lines , wrap them in 1 div?

node.js - How do I edit a Meteor package from Atmosphere that's not on GitHub? -

i have twitter functionality i'm working on , want use "application-only authentication" needs twitter application credentials perform gets in app (e.g. random tweet searches based on user inputted tags, etc. - no actual user posting.) twitter supports of twitter packages on atmosphere , npm not. force pass both application credentials , oauth tokens, if don't, requests come invalid. popular meteor twitter api package called mrt:twit wraps npm package ttezel/twit implements application-only authentication correctly, wrapper package meteor mrt:twit forces use full authentication requiring user's oauth tokens don't want or need use. i'd edit mrt:twit follow ttezel/twit's interface. however, mrt:twit package not on github. how figure out lives and/or if can access locally , modify and/or find repository online lives? atmosphere doesn't offer providing no links package downloading? link mrt:twit : https://atmospherejs.com/mrt/twit ...

javascript - Stop app from crashing when submitting order with empty EditText -

i have started learn programming , writing coffee ordering app. have "price" field enter basic price cup of coffee , other options. right if click "order" button when price field empty app crashes. tried add line of code question possible have both default value , hint in edittext. here bit of code of method calculates price, check boxes check boxes toppings on coffee , function well: // calculates price private int calculateprice(int quantity) { // price per cup in field edittext pricepercupf = (edittext) findviewbyid(r.id.basic_price); boolean whippedchecked = ((checkbox) findviewbyid(r.id.whipped_cream)).ischecked(); boolean chocolatechecked = ((checkbox) findviewbyid(r.id.chocolate)).ischecked(); int pricepercup = integer.parseint(pricepercupf.gettext().tostring()); if (whippedchecked) { pricepercup += 1; } if (chocolatechecked) { pricepercup += 1; } if (pricepercupf.gettext().tostring().equals("...

jquery - Configure Session Timeout Dialog without Logout Now button -

i using jillelaine's jquery session timeout dialog pop out displaying timeout alert on .aspx page. working fine, don;t wanna give user option of logging out , remove log out button of control. its not listed in configurable variables plug in . know how use that. here github link plugin itself. to remove 'log out now' button, can directly edit unminified .js code file: jquery-idletimeout.js or jquery-idletimeout-iframes.js . in code section commented with //----------- warning dialog functions --------------// replace openwarningdialog = function () { var dialogcontent = "<div id='idletimer_warning_dialog'><p>" + currentconfig.dialogtext + "</p><p style='display:inline'>" + currentconfig.dialogtimeremaining + ": <div style='display:inline' id='countdowndisplay'></div></p></div>"; $(dialogcontent).dialog({ buttons: [{ text: cu...

python - Django form fields dynamic subclassing -

i'm trying develop mechanism dynamically create set of django form fields. while experimenting, encounter strange behavior, , i'd know, if worth worry about. here code: in [139]: django import forms in [140]: myfielddynamic = type('myfielddynamic', (forms.charfield,), {}) in [141]: 1 class myfield(forms.charfield): 2 pass in [142]: myfielddynamic.mro() out[142]: [django.utils.deprecation.myfielddynamic, django.forms.fields.charfield, django.forms.fields.field, object] in [143]: myfield.mro() out[143]: [__main__.myfield, django.forms.fields.charfield, django.forms.fields.field, object] as see if class created using type , first superclass django.utils.deprecation.myfielddynamic . what's wrong thing? and bit more broader question - possible @ all, i'm trying - create form fields @ runtime? maybe there resources, skipped? edit: python: 2.7.6 (default, mar 22 2014, 22:59:56) \n[gcc 4.8.2] django: (1, 8, 3, 'f...

Modifying labels in gnuplot -

Image
i able create following boxplot using gnuplot . however, want xtic labels of form log(x) . for instance, label 2 written log(100), 3 log(1000) , on. is there way can this? you must manually using set xtics (...) : set xtics ('log(1)' 0, 'log(10)' 1, 'log(100)' 2, 'log(100)' 3) to have automated bit, can loop on x-values: set xtics ('log(1)' 0) set [i=1:5] xtics add (sprintf("log(%d)", 10**i) i) something like set xtics format "log(...)" doesn't work. uses same syntax gprintf , allows extract several information of given tic values (like mantissa, power, scientific power, hex, octal, multiple of pi etc), not perform mathematical operations on values ( 10**(ticvalue) ) , use result visualization.

Webpack output files to different directories -

after building project, have index.html, bundle.js , .css files, them placed in dir structure this: dist/ - css/all.my.css - js/bundle.js - index.html here did .js , .css: entry: { app: path.resolve(__dirname, 'app/src/index.js'), }, output: { path: path.resolve(__dirname, 'dist', 'css'), filename: '../js/[name].js' }, here corresponding module config: module: { loaders: [{ test: /\.jsx?$/, loaders: ['react-hot', 'babel-loader'], exclude: /node_modules/ }, { test: /\.css$/, loader: extracttextplugin.extract("style-loader", "css-loader") }, { test: /\.woff(2)?(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "url-loader?limit=10000&mimetype=application/font-woff" }, { test: /\.(ttf|eot|svg)(\?v=[0-9]\.[0-9]\.[0-9])?$/, loader: "file-loader" }] }, i have no idea how copy index.ht...

angularjs - Go to particular carousel slide in angular js -

Image
i doing basic angular carousel slider. here want separate section, slide slider particular one. how achieve this. have shown sample in image. if click on 1 should go 1st slide , so. check angular-carousel , see example here

directive angularjs to check mail used or not -

i want check if email used or not (communication back-end) error message not shown in screen. the verficiation function service : demoapp.factory('verifyemail', function($http) { return function(mail) { var test=mail; var urll="http://localhost:8080/app/personne/verifmail?msg="; var aplrest=urll+test; var ch3=aplrest; return $http.post(ch3) };}); the directive (with of @jsonmurphy) demoapp.directive('existto', ["$q","verifyemail",function ($q, verifyemail) { return { require: "ngmodel", scope: { othermodelvalue: "=existto" }, link: function(scope, element, attributes, ngmodel) { // note change $asyncvalidators here <------------- ngmodel.$asyncvalidators.existto = function(modelvalue) { var deferred = $q.defer(); verifyemail(modelvalue).then(fu...

sql - How to SELECT [header text w. dot] AS xxx FROM an Excel table? -

Image
summary: using jet.oledb provider , sql query, not know how access column header text of contains dot. there way escape dot in select query? details: using connection string provider=microsoft.jet.oledb.4.0;data source=test.xls;extended properties="excel 8.0;hdr=yes;" when header text of column of excel sheet contains dot (notice dot column named abbrev. packing )... ... select query this... select [date] d, [code] code, [abbrev. packing] packing, [price] price [sheet1$] ... fails error 80004005. when remove dot header text , select command, works smoothly, , data extracted. however, excel table comes third party, , cannot change text of header. how can escape dot in select command , or way fix it? it appears ssis replaces period (.) number sign (#) when tried load similar spreadsheet provided through ssis package. so, guessing need either load through ssis if have option available, otherwise try querying directly this: select [dat...

swift - iOS locale notification pop-up doesn't appear -

i'm newbie in ios programming , in app i've uilocalenotification have appear @ time. so first setup parameters : let notificationsettings: uiusernotificationsettings! = uiapplication.sharedapplication().currentusernotificationsettings() if (notificationsettings.types == uiusernotificationtype.none) { var notificationtypes: uiusernotificationtype = uiusernotificationtype.alert | uiusernotificationtype.sound // bouton d'envoi var sendaction = uimutableusernotificationaction() sendaction.identifier = "send" sendaction.title = "send" sendaction.activationmode = uiusernotificationactivationmode.foreground sendaction.destructive = false sendaction.authenticationrequired = true // bouton de non-envoi var dontsendaction = uimutableusernotificationaction() dontsendaction.identifier = "dontsend" dontsendaction.title = "don't send" ...

vim - run :!command in a real terminal -

i can use pudb (an ncurses python debugger) in vim, because, instance, :!python % runs in actual terminal window. prefer use gvim, gvim runs :!python % in vim "dumb terminal." is there way change behavior gvim opens separate terminal commands? think recall having work way in past. you can tell vim run terminal, , run python in terminal: :!xterm -e 'python %; read' read there let see output of script before exiting terminal.

javascript - How to scroll to top of element with collapsible panels with Jquery -

i have series of divs on click, toggle state of collapsible div (like accordion widget). working fine, want able scroll top of trigger div (the div class name 'paneltab') when user clicks. problem when panels hidden, take no space jquery doesn't automatically 'know' size of page, , isn't able calculate top of element automatically. happens on click scrolls, 'overshoots' top of window , lands in middle of paragraph content. i'm stuck - know simple solution? in advance. <div class="paneltab first holder"> <div class="text-block"> <h3>lorem ipsum</h3><p class="sub-title">lorem ipsum dolor</p> </div> <div class="clearfix"></div> </div> <div class="animatedpanel"> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. fusce ornare ornare lectus in pulvinar. donec tempor odio sit amet phare- tra commodo. suspendisse sem lib...

c++ - pointers and increment operator -

i have following simple code: #include<iostream> const char str[]={'c','+','+'}; int main() { const char *cp=str; std::cout<<*str<<std::endl; while (*cp++>0) std::cout<<*cp; } can't understand why prints c ++ shouldn't postfix increment operator evaluate expression return value unchanged? (i double checked precedence of increment, dereference , relational operators , should work) your problem here: while (*cp++>0) std::cout<<*cp; the postfix operator increments value after the expression used in evaluated. there 2 different expressions referring cp in while statement though: first 1 tests , increments, second 1 prints. since second 1 separate statement, increment has happened then. i.e. test against 'c' , then increment regardless of result , print '+' through now-incremented pointer. if iterating string literal, code increment o...

xml - "Unique Particle Attribution" violation -

i wrote following (simplified) schema validate xml files receive: <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" elementformdefault="qualified"> <xs:element name="param"> <xs:complextype> <xs:sequence> <xs:element name="radioaddr" type="xs:string" /> <xs:element name="datatoread" type="xs:integer" minoccurs="0" maxoccurs="1" /> <xs:choice minoccurs="0" maxoccurs="1"> <xs:group ref="group1" /> <xs:group ref="group2" /> <xs:group ref="group3" /> </xs:choice> </xs:sequence> </xs:complextype> </xs:element> <xs:grou...

php - Matching multiple similar strings in SQL -

so here situation: i need find way match 2 similar strings, example: a - samsung galaxy s5 white b - mobile phone samsung galaxy s5 white i have string a in database field, have , equivalent string coming outside source. is, same product, if straight search title field, search not yield desired results. any ideas how make lookup, similar strings? maybe break string tokens? there query write according tokens? ngram lookup feature introduced in mysql 5.7.6 useful in scenario? any other suggestions? using like being described in other answers won't work, because text you're searching not substring of what's in database (given example). there couple of ways handle this, depending on situation. if know in advance different varying strings might supplied with, can create table aliases store strings , link them primary table foreign key. if don't know them in advance, perhaps because user-supplied search terms, need dynamically build query bre...

angular directive - AngularJS : Why is my field invalid? -

i have custom validation password app.directive('userpassword', function() { return { restrict: 'a', require: 'ngmodel', link: function(scope, elm, attrs, ctrl) { ctrl.$validators.myvalidator = function(modelvalue, viewvalue) { var msg = helper.validation.user.localpassword(modelvalue) ctrl.$error.message = msg ctrl.required = helper.validation.user.localpassword() return ! msg } } } }) this password html: <div class="my-form-group"> <label for="signup_password">password:</label> <input ng-model="password" type="password" name="password" id="signup_password" placeholder="enter password" user-password ng-required="signupform.password.required" class="my-form-control"> </div> when ent...

oop - explicitly mark parameter as mutating in c# -

i have large amount of code dependent on list of objects. list modified lot while being passed around parameter various methods. even though i understand workings of code, feel uneasy letting such easy opportunity make mistake exist. there way handle situation in c# outside of goofy comment or refactoring? if passing list<something> around in code, "mutable" default, , there no way signal explicitly. if language background issue (haskell?), in c# should looks things different perspective: if wanted pass around immutable collection, need use different type (maybe ienumerable<something> , if it's not same list); if you're passing around list, instead, can modified every method receives it.

lotusscript - Cannot enable folder references in Lotus Notes database -

in external program accesses various lotus database following error: error 4386 occured in line 43: database not support folder references usually program supposed enable folder references doesn't seem work. asked support , gave me following script enable folder references: dim session new notessession dim db notesdatabase set db = session.currentdatabase if db.folderreferencesenabled if messagebox ("folder references enabled." & chr(10) & chr(10) _ & "do want disable folder references?" ,1 + 32,db.title) = 1 db.folderreferencesenabled = false messagebox "disabled folder references now.....", 64, db.title else exit sub end if else if messagebox ("folder references disabled." & chr(10) & chr(10) _ & "do want enable folder references?" ,1 + 32,db.title) = 1 db.folderreferencesenabled = true messagebox "enabeled folde...

ios - Twitter API Authentication -

i'm trying pick ios development. i'm creating app myself (will not release) that, dumbed down, takes query input user , searches through twitter using query. i can use uiwebview , want use twitter's rest api instead, familiar how apis work. however, can't work because twitter's api requires authentication (something seldom understand). how authentication work, , can authenticate app use myself? twitter uses oauth2. this: +--------+ +---------------+ | |--(a)- authorization request ->| resource | | | | owner | | |<-(b)-- authorization grant ---| | | | +---------------+ | | | | +---------------+ | |--(c)-- authorization grant -->| authorization | | client | | server | | |<-(d)----- access tok...

Create custom action in Yii2 Rest API -

i working yii2 , , want create rest api. read yii2 rest api quick start documentation, in there can use default actions(index/view/create/delete/list...). working fine but want create action example public function actionpurchasedcard(){ //some code } but couldn't it. me please, how create custome action in yii2 rest api. config.php 'urlmanager' => [ 'enableprettyurl' => true, 'enablestrictparsing' => true, 'showscriptname' => false, 'rules' => [ [ 'class'=>'yii\rest\urlrule', 'controller'=>[ 'v1/resource', ] ], ] ] document root: htdocs/myapi/api/web/ i calling : http://myapi/v1/resource/purchasedcard thanks.(sorry english not good) you may set extrapatterns key in rule add new actions, so: 'rules' => [ [ 'class'=>'yii\rest\url...

android - adb server is out of date. killing... cannot bind 'tcp:5037' ADB server didn't ACK * failed to start daemon * in ubuntu 14.04 LTS -

i not run android application never on laptop. eclipse gives same error constantly, "adb server didn't ack" when manage start adb server , re-open eclipse, run android application, same error comes console; adb server didn't ack. could give idea except restarting adb you need set path of sdk's adb genymotion. default, genymotion uses own adb tool (for many reasons). if both binaries not compatible (if android sdk platform tools or genymotion has not been updated while) problem happens. to solve can define specific 1 android sdk. specify custom adb tool: open genymotion > settings > adb. check use custom android sdk tools. specify path android sdk clicking browse. click ok.

java - How to upload images from client side to server side and retrieve them dynamically -

i new uploading files. there way upload image user on website , when other users view website images shown them. various websites user post ad images , when other users view post can view images. tried store , retrieve them into/from database, loading of images slow. want store them in folder on server, , when particular post viewed images should retrieve. can me solve this? index.php: <form action="upload.php" method="post" enctype="multipart/form-data"> <lable>select file upload ... </lable> <input type="file" name="imageupload" required> <br> <input type="submit" value="upload"> </form> upload.php: <?php if (isset($_files['imageupload'])) { $imagename = $_files['imageupload']['name']; $imagetemp = $_files['imageupload']['tmp_name']; } if (!$imagetemp) { echo "you...

perl - Leave only Nth text between two marker strings -

i working on mac os , looking elegant solution below problem. since purely text related thought perl best choice? i have data file on disk eg data.html (does not matter html) it contains chinese characters (so file utf8 encoded believe) its structure this: some top text text top styles text <h1>topic 1 text</h1> text applicable topic 1 formatting... <h1>topic 2 title</h1> text applicable topic 2... i want write file each topic contains top text , styles. input os data.html output topic1.html, topic2.html... assuming file simple , doesn't have other h1 tags, should work: use strict; use warnings; use open qw(:std :encoding(utf8)); open $input, '<', 'data.html'; $content = join '', <$input>; close $input; @parts = split /<\/?h1>/, $content; $top_text_and_styles = shift @parts; $count = 0; while (my ($topic, $body) = splice @parts, 0, 2) { $topic_content = join "", $top_text_and_sty...

android - How to post multiple image files using ion library? -

i using code upload single image file on server. but need upload multiple 'n' number of files @ once ion.with(mainactivity.this) .load(constant.upload_img) .setmultipartfile("uploadform[imagefiles]", imgfile.getname(), imgfile) .asjsonobject() .setcallback(new futurecallback<jsonobject>() { @override public void oncompleted(exception e, jsonobject result) { } }); i tried multipartbodybuilder separately. multipartbodybuilder body = ion.with(mainactivity.this) .load(constant.upload_img); body.setmultipartfile("uploadform[imagefiles]", imgfile.getname(), imgfile); use addmultipartparts add list of filepart or stringparts. https://github.com/koush/ion/blob/master/ion/src/com/koushikdutta/ion/builder/multipartbodybuilder.java#l55

delphi - COM and Services -

i'm trying create service communicate com object controls on barcode scanner (model motorola symbol ls9208). i created tlb unit ocx installed scanner driver application. in delphi, i had create datamodule make work put start , stop code of scanner in serviceexecute procedure: initialize tscanner com object (declared in tlb) set scanner properties, "claim" control , set 1 tscanner event 1 of procedures in datamodule service fire when barcode readed after all, before close, release , free tscanner object procedure tintelipedcheckservice.serviceexecute(sender: tservice); begin debuglog( 'initialization of service thread...' ); checkinitparams; //datamodule_create; startscanner; //loopback while (not terminated) begin sleep(100); servicethread.processrequests(false); end; debuglog( 'end of service loop...' ); //only reached if stop service before read codbar stopscanner; //datamodule_free; debuglog( ...

oracle - inconsistent datatypes expected DATE got BINARY Hiberante Spring Data JPA -

<named-query name="category.getids1"> <query> <![cdata[ select spov.versionid specificationcategoryversion spov ?1 null or spov.releasedate null]]> </query> </named-query> <named-query name="category.getids2"> <query> <![cdata[ select spov.versionid specificationcategoryversion spov ?1 null or spov.releasedate <= ?1 ]]> </query> </named-query> <named-query name="category.getids3"> <query> <![cdata[ select spov.versionid specificationcategoryversion spov ?1 null or spov.releasedate null or spov.releasedate <= ?1 ]]> </query> </named-query> @repository("specificationcategoryrepository") public interface specificationcategoryrepository extends jparepository<specificat...

timeout - Limit execution time of function in c -

i limit execution of function in pure c, without stopping whole program. i believe closest thing on stackoverflow.com on last comment of thread: how limit execution time of function in c/posix? there talk of using setjmp , longjm placed after function limit in time, thread died. is there knows if indeed possible? cheers i can see 2 options, first 1 check time every few lines of code , return if it's much, don't think it's idea. second, use threads. run 2 functions @ same time, 1 timing other, if time big kills first one. i'm pretty sure windows , linux have different libraries create threads try , use library works across platforms 1 maybe http://openmp.org/wp/ . i'm not familiar library , threads in general hope helps

bootstrap btn-toolbar pull-right in navbar not working -

i using bootstrap 3 , trying keep buttons @ right on screens , browsers. on ie, buttons stay right, on chrome, on right on small screens. how make them stay right on screens. have tried pull-right buttons indiviudally no luck , have applied the btn-toolbar , still no luck. ideas on issue? <nav class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <a class="navbar-brand" href="#">grid</a> <p class="navbar-btn"> <div class="btn-toolbar pull-right"> <a href="d.htm" target="_blank" id="info" class="btn btn-primary"><i class="glyphicon glyphicon-info-sign"></i></a> <a href="b.html" class="btn btn-primary"><i class="glyphicon glyphicon-refresh">...

php - Routing requests to laravel from angular under Grunt config -

we on project angular , laravel 5 our environment frameworks , implementing using api workflow. using grunt bower configure dependencies project. project structure below. --projectdir |_angulardir |_start |_bower_components |_node_modules //front end dependencies |_gruntfile.js |_public //laravel public dir we have kept laravel , angular code independent complete mvc architecture , api benefits. issue: we start app using grunt serve , application loads first angular route , loads on localhost:9000 configured port. this has login screen.after entering username , password , call route http://localhost:projectdir/public/login laravel grunt server not have access laravel code localhost:9000 won't work. authenticates user against database. route::post('login','logincontroller@auth'); logincontroller.php public function auth() { $rowinput =request::all(); $input =...

Android SlidingTabs style tabs with round corners -

Image
i using slidingtabs create 2 tabs. ui of tab should appear - when first tab selected when second tab selected. (please note straight corners of blue rectangle) i using following selector create ui shown above. <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- active tab --> <item android:state_selected="true" android:state_focused="false" android:state_pressed="false" android:drawable="@drawable/round_corner_rectangle" /> <!-- inactive tab --> <item android:state_selected="false" android:state_focused="false" android:state_pressed="false" android:drawable="@android:color/transparent" /> <!-- pressed tab --> <item android:state_pressed="true" android:state_selected="true" android:drawable="@drawable/round_corner_rectangle" /> <item androi...

java - Android retrieving data from database error -

i totally new android ..and trying tutorial found online.basic aim retrieve data database , display it. not able execute .i have attached code , error log.it great if can rectify error. <package com.example.androidhive; import java.util.arraylist; import java.util.hashmap; import java.util.list; import org.apache.http.namevaluepair; import org.json.jsonarray; import org.json.jsonexception; import org.json.jsonobject; import android.app.listactivity; import android.app.progressdialog; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.util.log; import android.view.view; import android.widget.adapterview; import android.widget.adapterview.onitemclicklistener; import android.widget.listadapter; import android.widget.listview; import android.widget.simpleadapter; import android.widget.textview; public class allproductsactivity extends listactivity { // progress dialog private progressdialog pdialog; // creating json...