Posts

Showing posts from April, 2013

node.js - Streaming an uploaded file to an HTTP request -

my goal accept uploaded file , stream wistia using the wistia upload api . need able add fields http request, , don't want file touch disk. i'm using node , express , request , , busboy . the code below has 2 console.log statements. first returns [error: not implemented] , second returns [error: form-data: not implemented] . i'm new streaming in node, i'm doing fundamentally wrong. appreciated. app.use("/upload", function(req, res, next) { var writestream = new stream.writable(); writestream.on("error", function(error) { console.log(error); }); var busboy = new busboy({headers: req.headers}); busboy.on("file", function(fieldname, file, filename, encoding, mimetype) { file.on("data", function(data) { writestream.write(data); }); file.on("end", function() { request.post({ url: "https://upload.wistia.com", ...

objective c - Changing collectionview button's image in Cocoa -

tools : xcode, objective-c, mac, cocoa purpose : creating collection view many buttons. each button opens file in folder , each of them has background picture of file (for example: jpeg file) looks see in folder. question : how make each button have different image? also, difficult beginner? p.s. : if did without collectionview option, drag button on xib , change background images, need window collapsable , scrollable, hence using collection view. i appreciate comments/help/answers. thanks! this should not difficult. collectionview holds collection of collectionviewitems. inside item can create views need. 1 of them nsimageview set @ runtime image like. suggest play around collectionview , f samples apple provides on it.

javascript - How to parse C# code then serialize it back to text file -

i found there c# antlr4 grammar. build antlr4 parser c# grammar. works. can walk parse tree , see there nodes have children. now generate c# source code parse tree. can somehow generate (out of grammar) inverse of antlr parser instead of parsing, when given parse tree generate source code result in parse tree? edit: my current attempt in coffeescript walk source tree decorating pieces of source code using original source , start , stop positions antlr puts in nodes, , walk again print source code. problem multiple nodes start @ same space in source code. deal have nasty logic put source pieces in deepest node: antlr = require 'antlr4' {csharp4parser} = require './csharp4parser' {csharp4lexer} = require './csharp4lexer' input = "namespace { class b {}; class c {} }" cstream = new antlr.inputstream(input) lexer = new csharp4lexer(cstream) tstream = new antlr.commontokenstream(lexer) parser = new csharp4parser(tstream) parser.buildparsetre...

Meteor + CodeShip + Modulus -

can recommend setup script deploy modulus after passing tests? right i'm using: nvm install 0.10.28 nvm use 0.10.28 curl -o meteor_install_script.sh https://install.meteor.com/ chmod +x meteor_install_script.sh sed -i "s/type sudo >\/dev\/null 2>&1/\ false /g" meteor_install_script.sh ./meteor_install_script.sh export path=$path:~/.meteor/ meteor --version which i've managed copy + paste around interwebz , have no idea i'm doing. finally test pipeline is: meteor --test the output codeship logs: i20150515-13:34:16.005(0)? [velocity] mocha starting mirror @ http://localhost:44995/. i20150515-13:34:16.006(0)? [velocity] takes few minutes first time. i20150515-13:34:16.006(0)? [velocity] can see mirror logs at: tail -f /home/rof/src/bitbucket.org/atlasshrugs/garden/.meteor/local/log/mocha.log passed mocha : server initialization => should have meteor version defined as gets client-side tests, hangs ever , fails build. any suggestions...

.net - C# async await using LINQ ForEach() -

i have following code correctly uses async/await paradigm. internal static async task addreferencsedata(configurationdbcontext context) { foreach (var sinkname in requiredsinktypelist) { var sinktype = new sinktype() { name = sinkname }; context.sinktypecollection.add(sinktype); await context.savechangesasync().configureawait(false); } } what equivalent way write if, instead of using foreach(), want use linq foreach()? one, example, gives compile error. internal static async task addreferencedata(configurationdbcontext context) { requiredsinktypelist.foreach( sinkname => { var sinktype = new sinktype() { name = sinkname }; context.sinktypecollection.add(sinktype); await context.savechangesasync().configureawait(false); }); } the code got work without compile error this. internal static void addreferencedata(configurationdbcontext context) { requiredsinktypelist.forea...

sql server - Add a column to table a, if the values exist in table a and table b -

i know how check if values exist in both table, how can add column indicate find something select name, id table_a ta exists (select 1 table_b tb ta.id = tb.id) result name id 1 123 2 234 3 345 what want name id exists 1 123 y 2 234 n 3 345 n you can use exists criteria in case statement: select name, id, case when exists (select 1 table_b tb ta.id = tb.id) 'y' else 'n' end [exists] table_a ta

list - Java Comparator removing values form String object -

i trying sort list using java comparator reference https://www.soapui.org/apidocs/net/java/dev/wadl/x2009/x02/resourcedocument.resource.html import java.util.comparator; import net.java.dev.wadl.x2009.x02.resourcedocument.resource; public class resourcecomparator implements comparator<resource>{ @override public int compare(resource o1, resource o2) { return o1.getpath().compareto(o2.getpath()); } } but getting wrong values , path has below values before sorting: /customer,/customer/{id},/order/{id},/order after sorting: /customer,/customer/{id},/order,/order i not sure why "{id}" missing after sort.

php - Call Different URL Form JavaScript on Different Radio button selected -

is there way can send data different php urls java script based on radio button selected. example: html html radio button selected call html.php javascript and css css radiobutton selected then call css.php html. <div>choose option:</div> <input type="radio" name="user_options" value="css" /> css <input type="radio" name="user_options" value="jquery" /> jquery <input type="radio" name="user_options" value="html" /> html <input type="radio" name="user_options" value="php" /> php script php <script type="text/javascript"> $(document).ready(function () { $("#submit").click(function () { var datahtml = $('input[type="radio"]:checked').val(); if ($('input[type="radio"]:checked').length == "0") { ...

stomp+activemq+perl+cannot sysread(): EOF -

i have simple stomp script connect activemq , when run script below error "cannot sysread(): eof" perl script code: #!/usr/bin/perl use net::stomp::client; $stomp = net::stomp::client->new(uri => "stomp://hostname:61616"); $peer = $stomp->peer(); printf("connected broker %s (ip %s), port %d\n", $peer->host(), $peer->addr(), $peer->port()); $stomp->connect(); printf("speaking stomp %s server %s\n", $stomp->version(), $stomp->server() || "unknown"); printf("session %s started\n", $stomp->session()); $stomp->disconnect(); printf("session ended\n"); could please let me know doing wrong ? saw similar post didnt see response regarding same. issue @ $stomp->connect(); debug you use net::stomp::client; $stomp = net::stomp::client->new( uri => "stomp://hostname:61616", debug => "conn...

Given a string, find out the highest repeated characters count in python -

i newbie python. trying solve of general programming questions. part of this, have tried many ways achieve following. example, have string s = "abbcddeeffffcccddddggggghhhiaajjjkk" i want find out maximum successive occurrence of each character in given string. in above case, output should like, a - 2 b - 2 c - 3 d - 4 e - 2 f - 4 g - 5 etc any appreciated, thanks!! >>> s = "abbcddeeffffcccddddggggghhhiaajjjkk" >>> x in sorted(set(s)): ... = 1; ... while x * in s: ... += 1 ... print x, "-", - 1 ... - 2 b - 2 c - 3 d - 4 e - 2 f - 4 g - 5 h - 3 - 1 j - 3 k - 2

java - JCEKS keystore no longer loading: com.sun.crypto.provider.SealedObjectForKeyProtector -

i have jceks keystore hold aes keys. has been working in dev environment , in gae runtime while. last night deployed update (nothing crypto cases) , loading keystore throws ioexception: com.sun.crypto.provider.sealedobjectforkeyprotector , subsequently none of crypto works (as you'd expect given can't keys). i've googled exception - 1 lead looked promising: convert key of jceks of provider store provider ... suggests keytore created 1 provider cannot read provider, doesn't seem case here working yesterday! https://access.redhat.com/documentation/en-us/jboss_enterprise_application_platform/6.2/html/administration_and_configuration_guide/sect-password_vaults_for_sensitive_strings.html suggests incompatible providers. i rolled app previous (working) version, same error. has gae changed default provider? should explicitly declare required provider in code? thanks steve update 20/05/2015 - root cause identified the problem ioexception thrown ks.load() ...

java - Delete row with confirmation from Oracle table -

i have sql query used delete users. delete users username = ? the problem don't know there row success row removal or not. success @ end. is there way example confirmation oracle row deleted in java code? executeupdate() method of preparedstatement gives number of rows deleted.if no rows have been deleted query 0.i think that's easiest solution. if need know rows have been deleted can user "returning" clause, give rows deleted. regards

sql server - SQL Recursive CTE 'where-used' / BOM explosion part 2 -

Image
hi carries on post, sql recursive cte 'where-used' / bom explosion which original requirement answered have realised have final requirement. data have after '1' i.e. description etc., want repeat each level description correctly identifies correct parent item. tried adding columns in again in final select repeated items level 1. how can done? * update * i'm struggling test data/query how want. want items relate each other through bomid. output img. the relationship between bom , bomversion 1 item has many bomid's in bom table each bomid has corresponding record in bomversion through bomid different itemid off of bomversion. itemid can exist in bom table multiple bomids. know confusing , difficult demonstrate test data. that's why i'm happy put on bounty. * update * through i've learnt i've redone query/test data. haven't been able want query/data may need tweaked or added. i'll output i'm expecting. when bom....

matlab - algorithm for Link between different view of Dicom images -

i working in matlab view dicom images pacs . have 3 different series of dicom image same patient download pacs. first 1 axial plane view , second 1 sagittal plane view , third 1 coronal plane view. want link between above series for example, if clicking axial image want refer other views point of axial image place in sagittal view , coronal view. by googling got points image position , image orientation , slice location tags used reference link between series.but not calculation how do? let assume input of above tags single image respective series , 1. axial view: image position = (-118.444 \ -168.443 \ -46.0727) image orientation = (0.996206 \ -0.0224615 \ -0.0840777 \ -0.0083926 \ 0.936831 \ -0.349683) slice location =-95.85758972 2. sagittal view: image position = (-63.5956 \ -159.015 \ 60.7561) image orientation = (0.0188908 \ 0.999809 \ -0.00509657 \ -0.0341498 \ -0.00445565 \ -0.999407 ) slice location =65.27085876 3. coronal ...

angularjs - Inteliji Idea does not recognize typescript -

Image
i use intellij idea , try run example of angularjs 2. install needed plugins (javascript support , node.js) seems not work me. see: who knows how solve problem? the code have in typescript 1.5. intellij don't support yet. see https://youtrack.jetbrains.com/issue/web-15585 your ide options right ms tools (vs/vs code) or sublime text.

c# - I have a code that show the barcode image but it will show only the image once -

i working show bar codes generated , stored in date base. right able bar code number data base , show image in html using code39.js. code billow show image once want show image , download label products. <div class="panel panel-info "> <div class="panel panel-heading"> bar codes </div> <table class="table table-striped"> <tr> <th>product name</th> <th>quantity</th> </tr> @foreach (var items in model.barcodeitems) { <tr> <td> @for (int = 0; <= @items.quantity;i++ ) { <div id="externalbox" style="width:4in"> <div id="inputdata">@items.barcode</div> </div> <br /> } </td> <td> @items.name ...

vba - How to select multiple cells and copypaste to another sheet? -

i want select multiple cells , after selecting multiple cells,i want copy , past values in other sheet. my code this: union(range("c4,c5,i4,i5,j7"), range("c4, c5, i4, i5, j7")).select selection.copy code selecting cells, whiles going "selection. copy" arguments gives run time error '1004' "that command cannot used on multiple selections." can me fix this? i 1 piece @ time: sub disjoint() dim rng range, r range, addy string set rng = sheets("sheet1").range("a1,b3,c5,d7,e11") each r in rng addy = r.address r.copy sheets("sheet2").range(addy) next r end sub

java - AspectJ compiler doesn compile *.aj files -

i have following project: root |---pom.xml src/main/java |---com.package |----app.java src/main/aspects |---com.package |----trace.aj now, pom.xml is <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelversion>4.0.0</modelversion> <groupid>com.package</groupid> <artifactid>aspectj-test</artifactid> <packaging>jar</packaging> <version>1.0-snapshot</version> <name>aspectj-test</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupid>org.aspectj</groupid> <artifactid>aspectjrt</artifactid> <version>1.8.2</version> </dep...

html - How to fix bootstrap dropdown z-index in the backside of a flipped div? -

Image
i have multiple divs can flipped on hover via css transformation. on each backside have bootstrap buttongroup dropdown button. if expand dropdown-menu list hiding behind next div. how can bring list front? http://www.bootply.com/3ugznosny2 just listen bootstraps dropdown events , adjust elements z-index. check snippet, should choose bit more precise selectors did though. $('.flip').hover(function(){ $(this).find('.card').toggleclass('flipped'); }); $('.btn-group').on('show.bs.dropdown', function () { $(this).parentsuntil($( ".face", ".back")).css('zindex', 200); }) $('.btn-group').on('hidden.bs.dropdown', function () { $(this).parentsuntil($( ".face", ".back")).css('zindex', 0); }) body{ padding-top:50px; background: #555; } .flip { -webkit-perspective: 800; perspective: 800; position: relative; text-align: ...

How to store java application metrics in shared database -

i have school project @ have created cpu benchmark. project made in java in eclipse. i want every time run project result benchmark gives written in online database can see. (it id: x , cpu_score: y) the point benchmark run many users , want have results of them. can recommend me tool use database? i have tried using derby have encountered problems , not sure derby solution need for connection use this... private connection connecttodb() { final string dbhost = "url"; try { string dbconnect = "jdbc:informix-sqli://" + dbhost + ":port/databasename"; class.forname("com.informix.jdbc.ifxdriver").newinstance(); return drivermanager.getconnection(dbconnect, "user", "passwort"); } catch (throwable e) { return null; } return null; } to values this... public void getdbcontent(connection conn) { final string str = ...

php - Yii 2: Unable to send log via mail -

this mailer component. can see, because of test purposes, i'm using email on file 'mailer' => [ 'class' => 'yii\swiftmailer\mailer', 'viewpath' => '@common/mail', 'usefiletransport' => true, ], this log component. 'log' => [ 'tracelevel' => yii_debug ? 3 : 0, 'targets' => [ [ // target, see http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html 'class' => 'yii\log\emailtarget', 'levels' => ['error'], 'categories' => ['yii\db\*', 'email_test'], 'message' => [ 'from' => eshop_email, 'to' => developer_email, 's...

sql - C# synonym -Joining two tables in two different databases -

hi have requirement join 2 table in 2 different databases. found following link make use of synonym task. https://msdn.microsoft.com/en-us/library/ms162582.aspx but when add synonym not recognized c#/visual studio. please suggest me solution. please tell me way join 2 tables in 2 different databases. use aliases this select t1.name t1_name, t2.name t2_name db1.your_table t1 join db2.your_table t2 on t1.id = t2.id

python - How can I include fields from Base serializer in django rest framework? -

i have code class baseserializer(serializers.modelserializer): unicode = serializers.serializermethodfield('get_unicode') class meta: fields=('unicode',) def get_unicode(self): return 'test' i want fields in base serializer come in sub classes of it class entryserializer(baseserializer): class meta: model = models.entry fields = ('id', 'start_time', 'end_time') but not contain unicode in output is there way fields added in base serializer gets automatically appended sub classes , without manually adding name. want o keep common fields in classes in base you can this. include field of base serializer. class entryserializer(serializers.modelserializer): base= baseserializer() class meta: model = models.entry fields = ('base','id', 'start_time', 'end_time')

prestashop - Changing on Subcategories Images -

Image
i having problem on changing 2 images (bracket in red border) or 1 piece i've tried modules, changing on category's thumbnail , doesn't seems work. this running on prestashop default-bootstrap theme. and prestashop version 1.6.0.9 i've resolved issue due i've disabled categories block module earlier on. make sure categories block module enable navigate modules > modules > search keywords "categories". and go catalog > categories > edit category, should able see thumbnails.

how to connect to FoxPro db in SSIS 2008 -

Image
recently got foxpro db using in ssis package connected ole db source. so, if open ole db source , click on columns gives bellow message well not have foxpro installed. so, have data foxpro db source. just download , install vfpoledb provider, try again.

android - Currency symbol not formatting correctly in a textView? -

in app i have message can customised user , displayed in app. if user enters "£100" shown "£100"? i tried use font contains symbol didn't fix problem. typeface font = typeface.createfromasset(getactivity().getassets(), "arial_unicode.ttf"); alerttextview.settypeface(font); alerttextview.settext(message); i tried use *arial unicode ms, verdana, arial, code2000... problem persits. any ideas? use codes \u00a3 (lira) or try change encoding of string this: byte[] mybytearray = message.getbytes(charsets.utf_8); string encodedmessage = new string(mybytearray, charsets.utf_8); alerttextview.settext(encodedmessage);

Maven compilation error : Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3. 0 -

i getting following error while running mvn compile [error] failed execute goal org.apache.maven.plugins:maven-compiler- plugin:3. 0:compile (default-compile) on project fitnessadmin: compilation failure: compil ation failure: [error] /d:/appfuse/fitnessadmin/fitnessadmin/src/main/java/com/igate/webapp/con troller/nameformcontroller.java:[24,34] cannot find symbol [error] symbol: class nameid [error] location: class com.igate.webapp.controller.nameformcontroller [error] /d:/appfuse/fitnessadmin/fitnessadmin/src/main/java/com/igate/webapp/con troller/nameformcontroller.java:[27,79] cannot find symbol [error] symbol: class nameid [error] location: class com.igate.webapp.controller.nameformcontroller [error] -> [help 1] [error] [error] see full stack trace of errors, re-run maven -e swit ch. [error] re-run maven using -x switch enable full debug logging. [error] ...

box api - View API thumbnail size -

currently in box view api docs says maximum resolution /documents/{id}/thumbnail can provide 768p. i wondering if somehow possible convert documents 4k images, or @ least 1080p. i think i've figured out :) non_svg: supporting users browsers don’t support svg, second image-based conversion can created. request second conversion, include non_svg parameter on upload. viewer automatically load correct version based on user’s browser. it's perfect use case, don't know resolution's going (i haven't tried yet, found thing in docs), it's wanted - able convert document collection of printable images

android - How to SELECT ALL in checkbox -

i have listview , checkbox, how can select checkbox given in listview, below getview() code. there property accomplish task? kindly send suggestions on current code. thanks. code : public class mainactivity extends activity { mycustomadapter dataadapter = null; private arraylist<checkbox> checkboxes = new arraylist<>(); private string[] application = { "aa", "bb", "cc"}; // dynamic application names private string[] device = { "ee", "ff", "gg"}; // dynamic // device // names private radiogroup radiogroup1; private radiogroup radiogroup2; private radiobutton btn; private radiobutton btn2; private string text1; private string text2; radiobutton button1; radiobutton button2; button selectall; @...

java - Semantic relations between set of words -

Image
if have set of words (dbpedia resources) storing in arraylist how can build sparql query find possible direct on indirect relation between these terms? major problem don't know what's relation type i'm searching for. suppose arraylist contains 3 words, france,paris, europe how can write query returns direct relation (or indirect relation of 2 hops) between france-paris ,paris-europe , france-europe hope clear i'm looking for what can use values set variable set of resources, twice , once each end of relation. use variable predicate find relation is. like: select ?resource1 ?p1 ?intermediary ?p2 ?resource2 { values ?resource1 { :paris :france :europe } values ?resource2 { :paris :france :europe } filter(?resource1 != ?resource2) { ?resource1 ?p1 ?resource2 } union { ?resource1 ?p1 ?intermediary. ?intermediary ?p2 ?resource2. } } the results are:

python - Delete UV Keyframes via Pythonscript -

i have given (used tutorial ) object (like cube) , uv mesh on it. set uv keyframes uv mesh (which connected texture) on it, move texture while moving frames forwar in blender (exactly it's done in video). after looks in video @ minute 3:00. have differente uv keyframes @ differente frames e.g. every 10 frames keyframe overall 100 frames, 10 keyframes overall. now problem want remove of uv keyframes have set via python script. doint htat hand work that: go grapheditor, press [a] selectiing uv keyframes , press x [x] 2 times delete them all. cannot transform stept python script @ all, can hand. so looking code 1 can use remove shapekeys on object: bpy.ops.object.shape_key_remove() does have idea how or if there command that?

html - Bootstrap3 cols not filling space of row in IE8 -

my bootstrap columns not filling entire width of row in ie8... second col-sm-6 comes short on right hand side. using respond , html5shiv already. ideas? code below. <header> <div class="container-fluid"> <div class="row"> <div class="col-xs-9 col-sm-6"> 1 </div> <div class="col-xs-3 col-sm-6"> 2 </div> </div> </div> </header> solved: bootstrap-ie7.css interfering columns. once delete this, started working nicely on ie8.

c# - Error in Json Serialization "There is already an open DataReader associated with this Command" -

json serialization command giving error. used newtonsoft.json avoid cyclic reference error on serialization. private iqueryable<study> getstudiesdata() { var curruser = usermanager.findbyid(user.identity.getuserid()); var curruserrole = curruser.roles.first(); iqueryable<study> studies; if (user.isinrole("superadmin")) { studies = db.studies; //all studies centers } else { var assignedstudies = db.studies.where(s => s.assigneduserid == curruser.id); studies = db.studies.where(s => s.user.centerid == curruser.centerid && s.roleid == curruserrole.roleid) .concat(assignedstudies); } return studies; } //ajax call function gives error public actionresult getstudies(int pagesize = 10, int pagenum = 1) { var studies = getstudiesdata(); var studiescount = studies.count(); var studiespaged = studies.orderby(s=>s.patientid).skip(pagesize*pagenum).take(pagesize); ...

ruby on rails - Capistrano Config symlink not working -

i doing rails 4.1 deployment capistrano 2. my script working fine in create_symlink task crashes. executing "rm -f /home/deployer/myawesomeproject/production/current; ln -s /home/deployer/myawesomeproject/production/releases/20150511102623 /home/deployer/myawesomeproject/production/current; true" the result got is rm: cannot remove ‘/home/deployer/myawesomeproject/production/current’ it working fine started crashing of sudden. any appreciated.

objective c - protobuf 3.0.0 in xcode with error: thread-local storage is unsupported for the current targe -

i trying use protobuf 3.0.0 in objective-c project, when compile protobuf project, there shows error : "thread-local storage unsupported current target." because protobuf uses "__thread" in code, maybe xcode compiler not support character. could tell me how solve problem? the protobuf source code compiled c++ in xcode, here settings: apple llvm 6.0 - language: c language dialect gnu99 [-std=gnu99] compile source according file type apple llvm 6.0 language - c++: c++ language dialect gnu++[-std=gnu++11] c++ standard library libc++(llvm c++ standard library c++11 support) here setting link: xcode setting snap

xcode - Crash in self.view after constructor on iOS 8.1 and 8.2 -

i'm trying simple spritekit action - adding view scene: uistoryboard *mainstoryboard = [uistoryboard storyboardwithname:@"levelseditorstoryboard" bundle:[nsbundle mainbundle]]; self.levelseditor = [mainstoryboard instantiateviewcontrollerwithidentifier:@"levelseditorid"]; [self.scene.view addsubview:self.levelseditor.view]; on ios 8.0 , 8.3 working fine , on ios 8.1 , 8.2 i'm getting following error: spbingo[75304:80943666] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[uitextselectionview name]: unrecognized selector sent instance i realised crash caused uitextfield. once i'm getting rid of it, replacing uitextfield uitextview ( not ideal whatever) view loading when try click on uitextview crashed. other input views work (switches, datapicker, tableview etc.) after deep dive figured out problem occur in contractor already. when put breakpoint on the second line in following code : -(insta...

php - Use array of delimiters -

i'm using fgetcsv read csv files in application. problem don't know if users use , , | , or ; delimiters. if tell fgetcsv nothing accept , if tell use specific delimiter accept that. what i'm doing is: while (($row = fgetcsv($filehandle, 4096)) !== false) { what want this: while (($row = fgetcsv($filehandle, 4096, array(',', ';', '|'))) !== false) { is possible in easy way? seems weird have limit delimiter 1 specific character, since csv not standardized. you cannot reliably determine delimiter of csv file if don't know it. take simple example: foo;bar,hello;world what delimiter? , or ; ? if pass array array(',',';') data expecting fgetcsv() return? if don't know delimiter need ask user it.

jpa - could not determine type for: com.model.User, for columns: [org.hibernate.mapping.Column(user)] -

although question asked many times , have used suggestion still getting error. not determine type for: com.model.user, columns: [org.hibernate.mapping.column(user)] , tn hibernate.cfg.xml configuration <?xml version="1.0" encoding="utf-8"?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd//en" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <property name= "connection.driver_class">com.mysql.jdbc.driver</property> <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/covoiturage</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.password"></property> <property name="hibernate connection.pool_size">1</pro...

c# - DIsable HardwareButton on Windows Phone 8.1 -

i have basic app on windows phone 8.1, , in have regular buttons, navigate or exit application. want disable hardwarebutton back/exit, if press it, application not exit. help? btw, tried: public void hardwarebuttons_backpressed(object sender, windows.phone.ui.input.backpressedeventargs e) { e.handled = false; } you have rewrite hardwarebuttons_backpressed method on app.xaml.cs file. also if have handled event, have set e.handled = true tell system have handled event , dont push event below in queue. for more , examples see msdn .

javascript - Make item slide back to 0 with Polymer -

i'm trying element go came from. drag stores how far has travelled, thought tell go towards 0 1 pixel @ time. not work (it triggered touchend). when in dev tools see {{drag}} value correct, if statement not triggered. any appreciated. function bouncetozero() { if({{drag}} != 0) { document.queryselector('pull-to-action').drag = {{drag}} - 1; if({{drag}} != 0) { settimeout('bouncetozero()',1000); } } } thanks help. edit: here full element <link rel="import" href="../bower_components/polymer/polymer.html"> <link rel="import" href="../bower_components/core-icons/core-icons.html"> <link rel="import" href="../bower_components/core-icon/core-icon.html"> <polymer-element attributes="action distance container color" name="pull-to-action"> <template> <style> :host { display: block; p...

What is the better API to Reading Excel sheets in java - JXL or Apache POI -

which of 2 apis simpler read/write/edit excel sheets ? these apis not support csv extensions ? using jxl file.xls , file.xlsx, exception like: jxl.read.biff.biffexception: unable recognize ole stream @ jxl.read.biff.compoundfile.<init>(compoundfile.java:116) @ jxl.read.biff.file.<init>(file.java:127) @ jxl.workbook.getworkbook(workbook.java:268) @ core.readxlsheet.contentreading(readxlsheet.java:46) @ core.readxlsheet.init(readxlsheet.java:22) @ core.readxlsheet.main(readxlsheet.java:72) both .xls , .xlsx extensions. java version using : jdk1.6 i have used both jxl (now "jexcel") , apache poi . @ first used jxl, use apache poi. first, here things both apis have same end functionality: both free cell styling: alignment, backgrounds (colors , patterns), borders (types , colors), font support (font names, colors, size, bold, italic, strikeout, underline) formulas hyperlinks merged cell regions size of rows , colu...

arrays - Why can't boost::shared_ptr dereference a T[] -

i noticed when writing following code boost::shared_ptr<int[]> ptr(new int[5]); int* deref = *ptr; that boost::shared_ptr<t>::operator*() requires t not array type. t & operator*() const; // never throws requirements: t should not array type. stored pointer must not 0. returns: reference object pointed stored pointer. throws: nothing. the compiler error (rightly) produced viewable here std::shared_ptr<t>::operator*() on other hand makes no such requirement, shared_ptr doesn't seem constructible t[] or t* this of course can remedied using scoped/shared_array instead of smart pointer array, or if nothing else using std::vector . but doesn't explain why shared_ptr couldn't have operator*() specified return t* when t array. can shed light on why t[] handled specially in boost::shared_ptr ?

angularjs - Reusing angular mocks in Jasmine tests using $provide -

i wish reuse mocks instead of having set them in every unit test has them dependency. i'm having hard time figuring out how inject them properly. here's attempt @ unit test setup, of course fails because configservicemockprovider doesn't exist. describe('loginservice tests', function () { var loginservice; beforeeach(module('mocks')); beforeeach(module('services.loginservice', function ($provide, _configservicemock_) { $provide.value("configservice", _configservicemock_); /* instead of having type e.g. everywhere configservice used * $provide.value("configservice", { 'foobar': function(){} }); */ }); beforeeach(inject(function (_loginservice_) { loginservice = _loginservice_; }); } configservicemock angular.module('mocks').service('configservicemock', function() { this.init = function(){}; this.getvalue = function(){}; } i realize have configservicemoc...