Posts

Showing posts from January, 2012

java - Finding the same value in the list<Object>? -

here many customizablemenus objects in list, want find if 2 customizablemenus objects contains same cust.getcomponentstate(); want find getcomponentstate(); here posting code.how can value list. for(customizablemenus cust : ra.getaction().getcustomizablemenu()){ cust.getcomponentid(); cust.getcomponentidentification(); cust.getcomponentname(); cust.getcomponentstate(); custlist.add(cust); system.out.println("cust menus in ctrl custid "+ cust.getcomponentid()+"component name "+cust.getcomponentname()+"identification "+cust.getcomponentidentification()); } you have compare n items n items run loop complexity o(n^2) plus complexity of if statements: whatever using array , list , map ,.. logic same. general code: for(item item1:yourlist.getitems()){ for(item item2:yourlist.getitems()) if(item2!=item1) //not compare item it's self //if have same component state if(item2.getcompo

c# - Xamarin - Deployment on laptop without hardware acceleration support -

i'm using msvs2015pro c#/xamarin . i have laptop doesn't support hardware acceleration . then have question : can develop mobiles without having spend time when deploying?. i deploy real android phone, don't know if that's slower deploying avd . it? what can do? don't wanna things in slow manner. do have buy laptop supports hardware acceleration ? if that's case, other requirements need other laptop? we running windows 10 vs 2015 pro , no hardware acceleration available on cpu. there indeed solid state drive , 16gig ram (the ram doesn’t assist in running emulator though. more ram doesn't make emulator faster. rather processor , or gpu. ram assist running multiple emulator instances.) doing both xamarin.ios , xamarin.android development. agree hardware acceleration things faster possible dev on enterprise level without it. deployment emulator (once emulator has started , running) vs actual device same. indeed faster running app on

rest - SAS proc http to get attachement from cloud server -

i have written simple proc http connect 1 of cloud server instance. did 200 ok response. how download file present @ server via post(or in matter via get) proc http? i new web service connection part. can guide me on this? code comments: %let workdir = /*local dir name*/; filename rich "&workdir\temp"; filename respns "&workdir\respns"; filename hdrout "&workdir\hdrout"; data _null_; file rich; infile datalines4; input; put _infile_; datalines4; payload={ "grant_type": "password", "username": "username", "password": "password" "text": "sample" } ;;;; run; proc http url="/*my url*/" method="post" ct ="application/x-www-form-urlencoded" in=rich headerout=hdrout out=respns; run;

ios - How to know the viewController already visited or not? -

i've multiple view controllers in iphone application, , i'm using navigation controller starting. my question is: when going first viewcontroller. go second viewcontroller, , go first viewcontroller. here how can know have seen first view. means want know whether visited first viewcontroller or not? how can know this? because have 1 functionality in 1 viewcontroller in want functionality should run 1 time not again , again. anyone can please me problem. thanks, there stack managed uinavigationcontroller of uiviewcontroller there in navigation controller, as have not mentioned language tag, posting code in objective-c nsarray *viewcontrollers = [[self navigationcontroller] viewcontrollers]; for( int i=0;i<[viewcontrollers count];i++){ id obj=[viewcontrollers objectatindex:i]; if([obj iskindofclass:[yourviewcontroller class]]){ // view controller visited user , in stack } }

openerp - How to activate the developer mode in Odoo version 10? -

Image
i've installed odoo version 10 module didn't see activate developer mode under section. developer mode has moved user screen settings. click on link "active developer mode" or "active developer mode (with assets)"

javascript - I am new to Angularjs, just tried populating multiple json value but it's not working -

<div ng-controller="studentcontroller" ng-repeat = "student in students | unique = 'rollno' " > <table class="profile-info"> <tr> <th>roll no</th> <td>{{ student.rollno }}</td> </tr> <tr> <th>class</th> <td>{{ student.class }}</td> </tr> <tr> <th>section</th> <td>{{ student.section }}</td> </tr> <tr> <th>sports</th> <td>{{ student.sports }}</td> </tr> <tr> <th>other interests</th> <td>{{ student.otherinterests }}</td> </tr> </table> </div> <---- angular

node.js - Log error using a custom formatter in winston -

i have custom formatter added in winston. code looks below:- 'use strict'; const winston = require('winston'); winston.transports.dailyrotatefile = require('winston-daily-rotate-file'); var timestampformat = "yyyy-mm-ddthh:mm:ss.sssz"; var moment = require('moment'); function logtemplate(level, meta, message){ return "{" + "\"timestamp\" : \"" + moment().format(timestampformat) + "\" ," + "\"level\" : \"" + level + "\"," + meta + "\"content\" :" + message + "}"; } function formatter(args) { var message = ""; var metastring = ""; message = json.stringify(args.message); var reqid = "1212121211"; var metastring = "\"reqid\" : \"" + reqid + "\", "; console.dir(json.stringify(args))

javascript - Web page[Gmail]: content does not match page source -

just curiosity, going through page source of gmail inbox: https://mail.google.com/mail/u/0/#inbox , in view, see items such inbox, starred, drafts etc. when tried searching terms in page source, didn't show up. not find ajax functions dynamically updates content. can shed light on why code doesn't match view? or going great lengths obfuscate code?

jsf - commandButton/commandLink/ajax action/listener method not invoked or input value not set/updated -

Image
sometimes, when using <h:commandlink> , <h:commandbutton> or <f:ajax> , action , actionlistener or listener method associated tag not being invoked. or, bean properties not updated submitted uiinput values. what possible causes , solutions this? introduction whenever uicommand component ( <h:commandxxx> , <p:commandxxx> , etc) fails invoke associated action method, or uiinput component ( <h:inputxxx> , <p:inputxxxx> , etc) fails process submitted values and/or update model values, , aren't seeing googlable exceptions and/or warnings in server log, not when configure ajax exception handler per exception handling in jsf ajax requests , nor when set below context parameter in web.xml , <context-param> <param-name>javax.faces.project_stage</param-name> <param-value>development</param-value> </context-param> and not seeing googlable errors and/or warnings in browser's jav

bitbake - Yocto: how to remove/blacklist some dependency from RDEPENDS of a package? -

i have custom machine layer based on https://github.com/jumpnow/meta-wandboard . i've upgraded kernel 4.8.6 , want add x11 image. i'm modifying image recipe ( console-image.bb ). since wandboard based on i.mx6, want include xf86-video-imxfb-vivante package meta-fsl-arm . however, fails complaining inability build kernel-module-imx-gpu-viv . believe happens because xf86-video-imxfb-vivante depends on imx-gpu-viv in turn rdepends on kernel-module-imx-gpu-viv . i realize dependencies have been created meta-fsl-arm bsp , vanilla poky distribution. things way outdated wandboard, hence using custom machine layer modern kernel. kernel configured include vivante drm module , don't want kernel-module-imx-gpu-viv package built. is there way exclude rdepends? can somehow swear health build system take care of specific run-time dependency myself? i have tried blacklisting 'kernel-module-imx-gpu-viv' setting pnblacklist[kernel-module-imx-gpu-viv] in local.conf,

lua - How to require multiple modules in a single statement? -

i want require several lua modules @ once, similar asterisk signifier java ( import java.awt.* ). structure organized modules in subdirectories: <myapp> -- calculations -- calc1 -- calc2 -- calc3 -- helper -- help1 -- help2 -- print --graphprinter --matrixprinter my client requires each module of subpath: local graphprinter = require("myapp.helper.print.graphprinter") local matrixprinter = require("myapp.helper.print.matrixprinter") i prefer automatic multi-require, derives local table names module path , requires whole subpath @ once. format: require("myapp.helper.print.*") . automatically local table names should created each module of subdirectory, there isn't difference have required them module module. the module env partially achieves looking for, though far perfect. it allows grouped / named imports, caveats - main 1 being must manually manage environments. in add

asp.net mvc 4 - Html element <time> date format without HH MM SS -

i using html <time> element display date.i have display date-part.from back-end getting date "13/07/2016 00:00:00" hh mm ss. i used below line convert date-time date. <time class="meta" datetime="dd/mm/yyyy">13/07/2016 00:00:00</time> but still output same "13/07/2016 00:00:00". i referring :- html time tag - correct date format i think there confusion regarding tag. according mdn : this element intended used presenting dates , times in machine readable format. can helpful user agents offer event scheduling user's calendar. in code, <time class="meta" datetime="dd/mm/yyyy">13/07/2016 00:00:00</time> , output not change format specify datetime attribute, because meant machine reading, text part of tag 13/07/2016 00:00:00 visible on page humans. if want change format of output of this. think should use sort of javascript format value, or hackish way, can spl

encryption - Decrypting a Password Protected Zipped File using DotNetZip C# -

i m trying extract zipped file through dotnetzip . file encrypted password , needs either reset or removed. used extractall method received exception: badpasswordexception unhandled, password didnot match. my code below: using (ionic.zip.zipfile zip = ionic.zip.zipfile.read(source_file)) { zip.password = "1234"; zip.extractall(dest_path, ionic.zip.extractexistingfileaction.overwritesilently); } any appreciated. according documentation use using (zipfile zip = zipfile.read(existingzipfile)) { zipentry e = zip["taxinformation-2008.xls"]; e.extractwithpassword(basedirectory, password); } http://dotnetzip.herobo.com/dnzhelp/index.html

c# - Multi column index search Microsoft.Isam.Esent -

i facing following issue: have composite index on database index1 {binarycolumn1, binarycolumn2}. using following set index use: api.jetsetcurrentindex(_session, _table, index1); to create key: api.makekey(_session, _table, binaryvalue, makekeygrbit.newkey); and try perform search with: api.tryseek(_session, _table, seekgrbit.seekeq); this works , seek returns true correctly if index1 1 column. if have multiple columns , try search value single column (ex. binarycolumn1 = {0x01, 0x23}) returns false. how can search 1 value? (ps. cannot change index nor create new ones.) possible? thank you what did work {0x01, 0x00} . can't single call, because value of second column mixing seekeq grbit. you seekge , you'll need retrieve column make sure value correct (and not {0x22, 0x23} ). you'll have like: setcurrentindex() makekey( ..., binaryvalue1, makekeygrbit.newkey | makekeygrbit.fullcolumnstartlimit); // appends rest of search buffer 0x00's. s

java - How to create an object factory method for gson method? -

i generating student object json object problem when create object want update "studentclass" field. update setstudentclass() method think gson doesn't use setter fields. how can create factory method fromjson() method? student student = gson.fromjson(studentjson.tostring(), student.class); student.updateclassinfo(); public class student{ private string name; private string studentclass; //getters , setters public void updateclassinfo(){ if(studentclass.equals("1")) studentclass = "starter"; else if ..... } } this requirement can fulfilled using custom deserializer. sample code below:- main method:- public static void main(string[] args) { string jsonstring = "{\"name\":\"john\",\"studentclass\":\"1\"}"; //string jsonstring = "{\"name\":\"john\"}"; gson gson = new gsonbuilder()

html - Vertical alignment in css responsive -

this question might answered 1 , may sound silly. align element whether text, image or div align in center vertically , should work in responsive screens. did try adding margin-top manual percentages. know if there simple , best way make vertical alignment responsive. i did research in google it, of them suggested change display property of container table , div table cell , use vertical alignment middle. sounds simple effects other elements in page don't want table. hence i'm looking best alternate option. please help. thank in advance :) .in-middle{ width:100%; margin-top: 25%; } <body> <div class="in-middle"> <h1>this should aligned in center</h1> <p>paragraph should centered</p> </div> </body> use following solution using tranform property: .in-middle{ position: absolute; top: 50%; transform: translatey(-50%); } <body> <div class=&q

node.js - javascript - Why is there a spec for sync and async modules? -

i have finished reading article on javascript modules. can understand commonjs modules synchronously loaded while amd modules asynchronously loaded. what don't understand how can module become magically synchronous if write in commonjs format, or how becomes magically async if write in amd format . mean javascript not have define or require keyword even. are specs not libraries. i mean behaviour of module loading dependent on module loader , not how module structured. , if case why follow coding pattern different types of modules ? am right in assuming libraries in nodejs world synchronously loaded, regardless in format written. , modules in browser space asynchronously loaded. if above assumption correct why there spec umd ? mean if script loads based on environment present in why make spec universal module loading ? can me confusion ? this question. it's subject caused lot of heated discussion in node community. have understanding of it's shoul

c# - Change Value in JSON -

i have following json: { "sonos": [ { "192.168.10.214": [ { "volume": "5", "extension": null, "name": "wohnzimmer" } ] }, { "192.168.10.204": [ { "volume": "5", "extension": null, "name": "büro" } ] } ] } on click want change volume, try snippet: string[] address = ip.text.split(new string[] {" | "}, stringsplitoptions.removeemptyentries); //ip listviewitem ... dynamic jsonobj = jsonconvert.deserializeobject(config); jsonobj["sonos"][address[0]]["volume"] = "10"; now last line throws accessed jarray values invalid key value: "192.168.10.214". int32 array index expected. how update volume specified ip? using newtonsoft.json; any hint appreciated! edi

xml - php str_replace() for / and & -

Image
we have created xml feed in magento products different categories. products have name &, or name of brand /. when generate feed, feed gives error. in previous feeds we've used line of code: <name><? return str_replace("&", "&amp;", "{name}"); ?></name> to turn & &amp; , worked. need same thing / . need turn / 'and' or that. there 2 (different) lines of codes in our xml feed can paste str_replace: <? if ("{name}" != "") return "<li><b>name:</b> {name}</li>"; ?> and <name>{name}</name> where should str_replace pasted? i got xml working. <serie><? return str_replace(array('&', '/') , array('&amp;','and'), "{serie}"); ?></serie> did trick me. the {serie} on end of code problem. don't understand why worked in previous feeds, u don&#

sign - Marking unsinged mails in Outlook -

outlook 2013 shows small badge singed mails. have reverse behaviour: show nothing singed mails , show warning badge unsigened mails. motivation this: want not distracted in ok case, , want warned in dangerous case. is somehow possible? if not thought workaround creating category "unsinged" , assinging unsigned mails. i've not found way set rule "apply unsingned mails". there no rule conditions available signature status?

Exclude blank values from csv file for JSON array in Jmeter -

i have jsonarray [foodid1,foodid2,foodid3] .the values of these reading csv file csv file content foodid1,foodid2,foodid3 10,12,14 if don't want pass value foodid2, json array being passed [10,,14] instead, wanted passed [10,14] . following json body: customerdetails={ "regdate":${regdate}, "regno":"${regno}", "firstname":"${fname}", "lastname":"${lname}", "dateofbirth":"${dob}", "bloodgroupid":0, "mobileno":"${mobile}", "residenceno":"${resdno}", "officeno":"${officeno}", "email":"${email}", "address1":"${adr1}", "address2":"${adr2}", "pincode":"${pin}", "stateid":${stateid}, "city":"${city}"} &customerhistory={ "historyid"

i want to use a toggle switch for active inactive status, i want to use in yii2 curd index page, i have added a widget toggle -

i want use toggle switch active inactive status, want use in yii2 curd index page, have added widget toggle [ 'class' => 'yii\grid\actioncolumn', 'template'=> toggle::widget( [ /* 'attribute'=>'company_status',*/ 'clientevents'=>['validate()'], "id"=>"stat", 'name' => 'stat', // input name. either 'name', or 'model' , 'attribute' properties must specified. //'checked' => 'true', 'options' => [], // checkbox options. more data html options [see here](http://www.bootstraptoggle.com) ] how change checked status

node.js - Angular2+Express+Mongoose error TS2307: Cannot find module 'mongoose' -

i'm learning angular2 start writing application angular2-express-starter, yesterday compiler can't find mongoose module. server/shemas/product.ts(4,27): error ts2307: cannot find module 'mongoose'. app.ts import * express 'express'; import { json, urlencoded } 'body-parser'; import * path 'path'; import * cors 'cors'; import * compression 'compression'; import { loginrouter } './routes/login'; import { protectedrouter } './routes/protected'; import { publicrouter } './routes/public'; import { feedrouter } './routes/feed'; import {listrouter} "./routes/list"; const app: express.application = express(); app.disable('x-powered-by'); app.use(json()); app.use(compression()); app.use(urlencoded({ extended: true })); // allow cors local dev app.use(cors({ origin: 'http://localhost:4200' })); // app.set('env', 'production'); //mongodb

mongodb - How to deploy my APL to cloud such as heroku? -

i have mobile apl using react native(ios , android), mongodb, node express, apl come f8app open sourced facebook. i want deploy apl cloud such heroku, cloud foundry, mlab, firebase, aws cloud. how debug , how deploy it? if deploys kind apl cloud environment, please let me know? it appreciated if answer question. thanks shoji itagaki for heroku, create file in project root named procfile , inside put web: command_to_run_apl then git init git add -av . git commit -m "initial heroku push" create app appname in heroku ui heroku git:add --app appname git push heroku master

angular - Does Angular2 impact the SEO of my website? -

like title says, if use angular2 website, negatively affect seo? since didn't specify details, i'm assuming asking spa (single page applications) use angular. for spa's, if can routing right using angular routes , enabling clean routes on server using (ex: .htaccess on apache), seo should not affected. however there other things need pay attention to. some search engines not play ajax type page navigation , loading. since, don't see data loaded @ once, may index partially loaded webpages (though google has changed crawling accommodate this) you should ensure meta , other keywords , stuff search engines specific each page if want seo. little challenging when doing spa's.

azure - Renew Sas for BlockBlob with Upload from Stream -

tl;dr; renewing of sas needed when using cloudblockblob.openwrite() ? if yes, how? this follow-up-question to: upload big ziparchive-memorystream azure i managed upload zip-archive blob using blob.openwrite() : cloudblockblob blob = container.getblockblobreference(sas); using (ziparchive zarch = new ziparchive(blob.openwrite(), ziparchivemode.create)) { ziparchiveentry entry = zarch.createentry("bigfile", compressionlevel.optimal); using (stream stream = entry.open()) { savebigfiletostream(stream); } } the shared access signature supposed short-lived possible my question is, how ensure sas not expire? upload validate sas once? you need make sure sas doesn't expire during uploading, since uploading of 1 huge file azure blob service consist of many http requests authenticated individually.

c - Comparing object files generated from two build systems - Gradle and GNUMake -

i trying compare 2 build systems - gnumake , gradle , trying find out best fits software development. same git commit, if try compile c sources on 2 build systems using same version of gcc compiler , linker, generated object files alike? i generated 2 sets of objects , ran command this: diff gnumake_file.o gradle_file.o and got output as: binary files gnumake_file.o , gradle_file.o differ i did cmp -l 2 sets , huge number of lines similar this: 13699 11 21 13700 4 363 13704 346 302 13707 15 12 13711 0 22 13712 0 13 13715 0 7 13716 6 317 13719 6 14 i think means 2 object files different @ many places. comparison correct? there way in finding out if different , if why? have tried best of abilities make compiler flags , command alike on both systems. comments have done before or have fair idea on welcome. also attached compiler commands arbitary c source file directory: with gnumake sp

javascript - array.push adding key named push -

what missing here? shouldn't push 'hi' [4] instead of naming key named 'push'? <script> array = ["banana", "orange", "apple", "mango"]; array.push = ('hi'); console.log(array); </script> you should - var samplearr = ["banana", "orange", "apple", "mango"]; samplearr.push('hi'); console.log(samplearr );

Inflate (decompress) PNG file using ZLIB library C++ -

i'm trying use zlib inflate (decompress) .fla files, extracting contents. since fla files use zip format, able read local file headers( https://en.wikipedia.org/wiki/zip_(file_format) ) it, , use info inside decompress files. it seems work fine regular text-based files, when comes binary (i've tried png , dat files), fails decompress them, returning "z_data_error". i'm unable use minilib library inside zlib, since central directory file header inside fla files differs normal zip files (which why im reading local files header manually). here's code use decompress chunk of data: void decompressbuffer(char* compressedbuffer, unsigned int compressedsize, std::string& out_decompressedbuffer) { // init decompression stream z_stream stream; stream.zalloc = z_null; stream.zfree = z_null; stream.opaque = z_null; stream.avail_in = 0; stream.next_in = z_null; if (int err = inflateinit2(&stream, -max_wbits) != z_ok)

django - How to use a different database for Heroku review apps? -

i have deployment pipeline on heroku started using review apps. means have app - let's call ci-app -- being created master branch. every time pull request made, review app created. using django in our project , added migrate command release phase in project, database migrations can done automatically. today, coworker submitted pull request contained database changes. problem migration ran, , since review apps seem using the same database app suppose merge to, migration applied , app ci-app stopped working...since code base no longer matches database structure. i searched lot how use completely different databases review apps compared parent app, no avail (there resources mentioning how can copy db contents, not need). any suggestion ? update ok, seems heroku create new database review app, however: review app copies of environment variables parent, including database_url (this seems way create review app : https://s3.amazonaws.com/heroku-devcenter-files/article-

php - Why is this JSON refusing to get a response? And fails on a curl http://.... response.json command -

i having trouble getting json output correctly. have been struggling number of days now. the initial error receiving was: error domain=nscocoaerrordomain code=3840 "invalid value around character 0." userinfo={nsdebugdescription=invalid value around character 0.} this output in browser when using request: http://www.quasisquest.uk/keepscore/gettotalsstats.php?player_id=2 {"stats":{"totalwins":10,"totaldraws":6,"totallosses":3,"winpercentage":"52.63%","goalsscored":40,"goalsconceded":30,"goaldifference":10}} after discussion on here mentioned problem may php side @ loss since simple echo json_endcode ("test") , taking out mysql interference has not worked. i have spoke hosting company have said fine server-side. this swift function: override func viewdidappear(_ animated: bool) { //communitiestableview.reloaddata() let isuserloggedin = user

javascript - backspace working in firefox after the alert windows is shown even if e.preventdefault() is used -

i need disable backspaces webpages in project , have done using e.prevent default method, when alert shown e.prevent default not working ,the webpage goes previous page when pressed backspace. solutions ? if(input){ alert("wrong input"); } function disablebackspace(e){ var doprevent = false; if (e.keycode === 8) { var d = e.srcelement || e.target; if ((d.tagname.touppercase() === 'input' && ( d.type.touppercase() === 'text' || d.type.touppercase() === 'password' || d.type.touppercase() === 'file' || d.type.touppercase() === 'search' || d.type.touppercase() === 'email' || d.type.touppercase() === 'number' || d.type.touppercase() === 'date' ) ) || d.tagname.touppercase() === 'textarea') { dopre

list - Python: Get unique tuples such that elements across all tuples are disjoint -

there's list of tuples: all_tups = [(1, 2), (2, 1), (3, 4), (3, 5), (4, 3), (6, 8), (6, 7), (7, 9)] what wish do: tuples such if in tuple, element has appeared, other tuple element should discarded (regardless of position of element in tuple). so, there several desired outputs possible: [(1,2) (3,4) (6,8) (7,9)] or [(2,1) (4,3) (6,8) (7,9)] and on. originally, first element of each tuple comes 1 column of pandas dataframe , second element of each tuple comes column of same dataframe. c1 c2 0 1 2 1 2 1 2 3 4 3 3 5 4 4 3 5 6 8 6 6 7 7 7 9 in actual problem, there millions of rows in dataframe. therefore, not looking for-loop based solution. approach works on dataframe or millions of tuples fine except for-loop based solution. what have tried far: have been able obtain list of unique tuples using frozen sets: uniq_tups = {frozenset(k) k in all_tups} (admittedly using list comprehensions ideally avoid). gives me: {frozen

SAPUI5 component ChartContainer property autoAdjustHeight not working -

Image
i using own component places chartcontainer in flexbox (also trying use fixflex). chartcontainer property autoadjustheight not working correctly. in chrome version 54.0.2840.71 m (64-bit) did not stretch chartcontainer height till end of screen. in ie version 11.633.10586.0 property behaves stranger. chartcontainer height increasing few pixels per second , did not stop (so runs out of screen , continue increase height). in fiori design guidelines written: property autoadjustheight = true works correctly if page property enablescrolling set false. set recommended. did anybode has similar problems having autoadjustheight property, when using in component? if yes glad not alone. when use autoadjustheight in xml code without component works should. problem when trying implement in own component. here pieces of code. page component loaded: <core:view controllername="abc.controller.test" xmlns:core="sap.ui.core" xmlns:mvc="sa

schema - Database design of a record keeping system -

i in process of designing database of record keeping system. system has 4 types of record / forms. here design. first, 4 forms has common input fields such name, age , address. separate common input fields in table , add foreign key. for example: common_fields id name age address form_fk_id (foreign key form) form_type_number(this define kind of form user used) form1 id birthdate occupation etc.. form 2 id mother_name father_name etc.. form 3 id school_address school_name etc.. basically, that. form_fk_id - foreign key connect common input fields table , form table form_type_number - useful knowing form retrieve. i unsure of design. dont know if best way design in. you don't want fk reference in common table. common table have key , type indicator detail tables reference their fks. common_fields id form_type (defines kind of form) must contain 1, 2 or 3 name age address constraint uq_common_fields_id_type unique( id, for

intellij idea - Criteria Builder - Filter a query list by "java.util.Date" NO java.sql.date -

i need query filters list date record. query must show alle record current date don't want delete in db. ty! ps: sorry bad english :d public list<book> listall() throws exception { try { criteriabuilder cb = entitymanager.getcriteriabuilder(); criteriaquery<book> q = cb.createquery(book.class); root<book> c = q.from(book.class); arraylist<predicate> predicates = new arraylist<predicate>(); q.select(c).where(predicates.toarray(new predicate[]{})).orderby(cb.asc(c.get("bookdate"))); query query = entitymanager.createquery(q); list<book> list = (list<book>) query.getresultlist(); return list; } catch (exception e) { log.error("fail" + e.getmessage()); throw new exception(); } }

How to add Date in crystal Report c# -

in app showing date in crystal report , have column number of months text in database. so, create formula field addition of date , month in order new value of date got error telling me field not numerical. here code add date cdate(dateadd ("m",tonumber({tablename.interval}) ,{tablename.date} )) tablename.interval of type text , tablename.date of type date in database. try remove cdate function guess work. final fomrula must like: dateadd ("m",tonumber({tablename.interval}),{tablename.date} )

aspose.pdf - Underline text in PDF on Mouse Text Selection in Asp.net -

can guide me how can achieve in web application ? using aspose.pdf third party dll in order achieve this.i want select text in pdf using mouse , want underline selected text. once have selected string on pdf file, may selected string , parse selected string aspose.pdf .net api , have tried updating formatting underlined text. please take on following code snippet underline searched string. // open document document pdfdocument = new document("c:/pdftest/table_abc.pdf"); // create textabsorber object find instances of input search phrase textfragmentabsorber textfragmentabsorber = new textfragmentabsorber("employee_name"); // accept absorber pages pdfdocument.pages.accept(textfragmentabsorber); // extracted text fragments textfragmentcollection textfragmentcollection = textfragmentabsorber.textfragments; // loop through fragments foreach (textfragment textfragment in textfragmentcollection) { // underline selected string textfragment.textst

android - Base Adapter Position on Scroll -

i have adapter shows items list retrieved web service, upon scrolling it's inflating first position layout (it's considering first visible item having position 0 not right), please help. here's adapter: private class hwlistarrayadapter extends baseadapter { private arraylist<homework> items; private final activity context; public hwlistarrayadapter(activity context, arraylist<homework> items) { this.context = context; this.items = items; } @override public int getcount() { return items.size() + 1; } @override public object getitem(int position) { return items.get(position); } @override public long getitemid(int position) { return position; } @override public view getview(int position, view view, viewgroup viewgroup) { view v = view; textview desc, date, course; if (position == 0) { layoutinflater vi;

How do i get absolute values for a series set in bosun? -

i have following series set has negative values, how convert them positive values? not values in series negative multiplying -1 may option if using master can following: $q = q("avg:rate:os.cpu{host=*bosun*}", "5m", "") map($q, expr(abs(v()))) since 0.6.0 not released yet, hasn't been published our documentation. can find documentation map in https://raw.githubusercontent.com/bosun-monitor/bosun/master/docs/expressions.md .

Forcing driver to run on specific slave in spark standalone cluster running with "--deploy-mode cluster" -

i running small spark cluster, 2 ec2 instances (m4.xlarge). so far have been running spark master on 1 node, , single spark slave (4 cores, 16g memory) on other, deploying spark (streaming) app in client deploy-mode on master. summary of settings is: --executor-memory 16g --executor-cores 4 --driver-memory 8g --driver-cores 2 --deploy-mode client this results in single executor on single slave running 4 cores , 16gb memory. driver runs "outside" of cluster on master-node (i.e. not allocated resources master). ideally i'd use cluster deploy-mode can take advantage of supervise option. have started second slave on master node giving 2 cores , 8g memory (smaller allocated resources leave space master daemon). when run spark job in cluster deploy-mode (using same settings above --deploy-mode cluster). around 50% of time desired deployment driver runs through slave running on master node (which has right resources of 2 cores & 8gb) leaves original sla

r - Reorder all the columns in a data table based on Other files rows -

i have 1 data.table(dt1) has ids sorted criteria. 1. id10 2. id7757 3. id75340 4. id999 5. id5498 and 2nd data.table(dt2) id's of first data.table column names. source id7757 id8948 id5498 id999 id10 id75340 source1 32 87 643 8676 34 10 source2 65 32 876 9457 8 777 source3 64 666 99 222 66 222 how can short columns of 2nd data.table based on order of 1st data.table ? meaning id on 1st position should 1st column, 2nd position~2nd column etc... the output file should follows: source id10 id7757 id75340 id999 id5498 source1 34 32 10 8676 643 source2 8 65 777 9476 32 source3 66 64 222 222 666 how can done in r? it's straight forward this. turns out dataset faulty. so first sanitize datasets people! the solution following: all.sorted <-