Posts

Showing posts from March, 2011

sqlite - Binding List to a NSArrayController to use in an NSTableView -

i trying create simple window display list of items comes sqlite3 database. have generic list of objects, , want bind controls on windows. best way this? if .net windows forms, this, cocco equivalent? mybindingsource.datasource = new list<myobject>(); my viewcontroller.cs code looks this: list<myobject> datasource = datastore.getlibraries(); public override awakefromnib() { base.awakefromnib(); datasource = getmyobjects(); myarraycontroller.bind("contentarray", this, "datasource", null); // throws error } but throws error: class not key value coding-compliant key datasource. thanks! after linking libsqlite3.dylib framework (general:linked frameworks , libraries) , adding database-file project create sqlite accessor class, database connections , enable queries. if project should save database, on installation database must placed @ position have write-access, in "documents"-folder iphone app or in "

javascript - d3.event.translate contains NaN on zoom for touch devices -

i wrote custom zoom function svg using d3 so: //zoom behavior function myzoom() { xpos = d3.event.translate[0]; ypos = d3.event.translate[1]; vis.attr("transform", "translate(" + d3.event.translate + ") scale(" + d3.event.scale + ")"); } this works fine on non-touch devices, when zoom in on touch devices d3.event.translate array starts containing nan's. when occurs subsequent calls myzoom have issue , zooming stops working. this error receive is: error: invalid value <g> attribute transform="translate(nan,nan) scale(0.8467453123625244)" d3.v2.js?body=1:387 attrconstant d3.v2.js?body=1:387(anonymous function) d3.v2.js?body=1:3860 d3_selection_each d3.v2.js?body=1:509 d3_selectionprototype.each d3.v2.js?body=1:3859 d3_selectionprototype.attr d3.v2.js?body=1:3638 myzoom

java - getChildNodes() on org.w3c.dom.Node returns NodeLits of only nulls -

i'm trying parse configuration file, when call getchildnodes() on node excludes, returned nodelist contains 7 null values , nothing else. my code : public class minnull { private static final list<string> excludes = new arraylist<>(); public static void main(string[] args) throws parserconfigurationexception, saxexception, ioexception { file cfgfile = new file("ver.cfg"); documentbuilderfactory dbf = documentbuilderfactory.newinstance(); documentbuilder db = dbf.newdocumentbuilder(); document doc = db.parse(cfgfile); element rootelement = doc.getdocumentelement(); nodelist cfg = rootelement.getchildnodes(); parseconfig(cfg); } private static void parseconfig(nodelist cfg) { (int = 0; < cfg.getlength(); i++) { node node = cfg.item(i); string name = node.getnodename(); switch (name) { case "excludes": nodelist exc = node.getchildnodes(); f

asp.net - what is the function of HttpContext.Current.Request? -

1)when need use httpcontext (exclusively), please elaborate example if possible. 2)what following code do internal string querystring( string name ) { if ( httpcontext.current.request.querystring[name] == null ) return string.empty; else { return httpcontext.current.request.querystring[name].tostring(); } 3)is there other alternative way avoid using httpcontext q1: httpcontext object encapsulates http-specific information individual http request. so, if need information receiving http request (for example in order query string parameter values, referral urls, user's ip address etc), need use httpcontext object. further more, object contains information of current request, response, server, session, cache, user , etc. more information usage , examples get current session id: httpcontext.session.sessionid get timestamp of current request: httpcontext.timestamp.tostring() q2: in code sample, trying v

java - Use the main method of a .jar file inside a Matlab script -

i trying execute method "main" java class integrated jar file. tried follows: javaclasspath 'file.jar'; javamethod('main', 'javaclass') however, following error: error using javamethod no class democlient can located on java class path does know how can integrate jar matlab routine carrying out advanced matlab operation.

java - Read and Write Image file inside web-app in grails -

i reading image web-app/images , creating duplicate of same in same location different name. grails application. i getting real path of file using follwing code, def serveletcontext = servletcontextholder.servletcontext def filepath = serveletcontext.getrealpath( "web-app/images" ) def actfile= new file(filepath+ "myimg.png") final bufferedimage image = imageio.read(actfile) this working fine in devlopment environment. both read , write happening fine. when deploying war of application in tomcat i'm getting exception java.lang.reflect.undeclaredthrowableexception @ bootstrap$_closure1.docall(bootstrap.groovy:39) @ grails.util.environment.evaluateenvironmentspecificblock(environment.java:308) @ grails.util.environment.executeforenvironment(environment.java:301) @ grails.util.environment.executeforcurrentenvironment(environment.java:277) @ java.util.concurrent.executors$runnableadapter.call(executors.java:

r - draw two heatmap with the same cell size -

Image
i drawing 2 heatmaps using heatmap.2 separately different number of rows. there way set output of plots actual cell size same between 2 heatmaps? library(gplots) data(mtcars) x<-as.matrix(mtcars) ### heatmap has 32 rows heatmap.2(x,key=f) x1<-x[1:10,] ### heatmap has 10 rows heatmap.2(x1,key=f) this can done, albeit in of kludgy way, using lmat , lhei , , lwid arguments of heatmap.2 . arguments passed layout , lay out various parts of image. library(gplots) data(mtcars) x <- as.matrix(mtcars) ### heatmap has 32 rows heatmap.2(x = x, key = f, lmat = matrix(c(4,2,3,1), nrow=2, ncol=2), lhei = c(0.1,0.9), lwid = c(0.3,0.7)) as can see, matrix argument gives matrix looks like: [,1] [,2] [1,] 4 3 [2,] 2 1 the heatmap first thing plotted, followed row , column dendrogram. arguments lhei , lwid give relative size of each of layout column , rows desc

python - Finding closest three x,y points in three arrays -

in python, have 3 lists containing x , y coordinates. each list contains 128 points. how can find the closest 3 points in efficient way? this working python code isn't efficient enough: def findclosest(c1, c2, c3): mina = 999999999 in c1: j in c2: k in c3: # calculate sum of distances between points d = xy3dist(i,j,k) if d < mina: mina = d def xy3dist(a, b, c): l1 = math.sqrt((a[0]-b[0]) ** 2 + (a[1]-b[1]) ** 2 ) l2 = math.sqrt((b[0]-c[0]) ** 2 + (b[1]-c[1]) ** 2 ) l3 = math.sqrt((a[0]-c[0]) ** 2 + (a[1]-c[1]) ** 2 ) return l1+l2+l3 any idea how can done using numpy? you can use numpy's broadcasting features vectorize 2 inner loops: import numpy np def findclosest(c1, c2, c3): c1 = np.asarray(c1) c2 = np.asarray(c2) c3 = np.asarray(c3) arr in (c1, c2, c3): if not (arr.ndim == 2 , ar

c - Is manually requesting buffering necessary? -

is necessary call functions setbuf() , setvbuf() when open file streams adjust buffering? isn't i/o buffering handled automatically? no, buffering handled automatically, maybe not in fashion want or need . you might want flushing on each write, on newline, on full buffer, , default wrong case. or might want bigger buffer efficiency. in cases, adjust default. though, in general default sensible, , can left alone. here case automatic sniffer failed badly: printf statement not executing before scanf statement in netbean

scala - Why does Spark Cassandra Connector fail with NoHostAvailableException? -

i having problems getting spark cassandra connector working in scala. i'm using these versions: scala 2.10.4 spark-core 1.0.2 cassandra-thrift 2.1.0 (my installed cassandra v2.1.0) cassandra-clientutil 2.1.0 cassandra-driver-core 2.0.4 (recommended connector?) spark-cassandra-connector 1.0.0 i can connect , talk cassandra (w/o spark) , can talk spark (w/o cassandra) connector gives me: com.datastax.driver.core.exceptions.nohostavailableexception: host(s) tried query failed (tried: /10.0.0.194:9042 (com.datastax.driver.core.transportexception: [/10.0.0.194:9042] cannot connect)) what missing? cassandra default install (port 9042 cql according cassandra.yaml). i'm trying connect locally ("local"). my code: val conf = new sparkconf().setappname("simple application").setmaster("local") val sc = new sparkcontext("local","test",conf) val rdd = sc.cassandratable("myks","users") val rr =

related name in Django abstract model using python 3 -

when use %(app_label)s_%(class)s in related name using python3.4 got following error 'app_label': cls._meta.app_label.lower() typeerror: unsupported operand type(s) %: 'bytes' , 'dict' is there way ? edit class timestampmodel(models.model): modified = models.datetimefield(auto_now=true) created = models.datetimefield(auto_now_add=true) created_by = models.foreignkey(user, related_name = "%(app_label)s_%(class)s_created_by" ,) edited_by = models.foreignkey(user, related_name = "%(app_label)s_%(class)s_edited_by" , blank=true, null=true) class meta: abstract = true

xml - "Too many items" with XPath eq operator for assertion -

i having problem when validating following xml file against xml schema. error "too many items expected '1', '3' supplied. in assert want express following: whenever oid value equals boid value a_membership_degree should greater or equal b_membership_degree sample xml <document xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:nonamespaceschemalocation="gen.xsd"> <a oid="aa" a_membership_degree="0.7" d_membership_degree="0.5" > <a1>x1</a1> <a2>d1</a2> </a> <b boid="aa" b_membership_degree="0.2"> <b1>g1</b1> <b2>f1</b2> </b> <c coid="aa" c_membership_degree="0.3" > <c1>g2</c1> <c2>f2</c2> </c> <a oid="aaa" a_membership_degree="0.8" d_membership_degree="0.5" > <a1>x2</a1> <a2&

html - Can't align picture and text beneath each other -

i've been trying ridiculously basic task can't through. cannot figure how make second image right below first one. frustrating!! fiddle here: http://jsfiddle.net/dvir0776/v9v512tm/ <div class="comment"><img src="d.jpg" style="width:13%; margin-right: 12px; float:left;"> <div style="text-align:left; font-size:8pt;"> <h5 style="margin-bottom:0;">chris fanelli</h5> comment comment comment comment comment comment comment comment comment comment!</div> </div> <div class="comment"><img src="d.jpg" style="width:13%; margin-right: 12px; float:left;"> <div style="text-align:left; font-size:8pt;"> <h5 style="margin-bottom:0;">chris fanelli</h5> comment comment comment comment comment comment comment comment comment comment!</div> </div> any tweak fix great. line b

android - Click on Notification then finish TimerTask? -

i creating notification in activity (for example text.class ) , when active , click on it , return me in page( text.class ) in page have timertask , need when click on notification reset page or finish() timertask . how can ? i thought when click on notification reset page , finish timertask . this notification : notificationmanager nman; nman=(notificationmanager) getsystemservice(notification_service); long when=system.currenttimemillis(); notification n; n=new notification(r.drawable.chat_logo,"",when); context context=getapplicationcontext(); string title=g.context.getresources().getstring(r.string.statusm); string text=g.context.getresources().getstring(r.string.statusms); intent notifintent=new intent(context,conversationpage.class); pendingintent pending; pending=pendingintent.getactivity(context,0,notifintent,android.content.intent.flag_activity_new_task); n.setlatesteventinfo(context, title, text, pending); n.flags = notification.flag_auto_cancel

linux - The dynamic registeration of char devices assigns major number for my char device that doesn't correspond to Documentation/devices.txt. Why is that? -

concretely, use following function register character device: int alloc_chrdev_region(dev_t *first, unsigned int firstminor, unsigned int cnt, char *name); good enough. print major number assigned , gives me: 251. now move chapter 3 of linux device drivers , page 5. paragraph: some major device numbers statically assigned common devices. list of devices can found in documentation/devices.txt within kernel source tree. chances of static number having been assigned use of new driver small, however, , new numbers not being assigned. so, driver writer, have choice: can pick number appears unused, or can allocate major numbers in dynamic manner. picking num- ber may work long user of driver you; once driver more deployed, randomly picked major number lead conflicts , trouble. i go documentatio/devices.txt , search 251 , character device major number. isn't there. why that? missing something? as suggested barmar in comments: major numbers specific devices listed i

unity3d - How can i create a 2D 'curve' collider -

Image
i'm trying search smart way create curves next 1 (using unity3d 2d part (without using mesh collider))) , didn't found one any appreciated. seeing last answer (removed) doesn't fit want. have made myself beziercollider2d using bezier curves between 2 points , edgecollider2d. version 1 beziercollider2d.cs using unityengine; using system.collections; using system.collections.generic; [requirecomponent (typeof (edgecollider2d))] public class beziercollider2d : monobehaviour { public vector2 firstpoint; public vector2 secondpoint; public vector2 handlerfirstpoint; public vector2 handlersecondpoint; public int pointsquantity; vector3 calculatebezierpoint(float t,vector3 p0,vector3 handlerp0,vector3 handlerp1,vector3 p1) { float u = 1.0f - t; float tt = t * t; float uu = u * u; float uuu = uu * u; float ttt = tt * t; vector3 p = uuu * p0; //first term p += 3f * uu * t * handle

node.js - AMQPLib Detecting / Handling Channel Close -

i'm looking recommended way deal un-expected channel closures via library. i gather documentation there event emitted, it's not quite clear me how best detect event (i know simple, i'm not clear on event emitting in general, bear me), moreover, it's not obvious should that. should tracking subscribers use channel , re-subscribe them? others do? what's more - there no way examine channel (or confirmedchannel) object, , determine if it's still "good"? seem preferable event-trapping approach, can't seem find way (ok, that's not true - i've done things examining "accept" method on channel determine if it's gone bad, seems hackish). any guidance appreciated.

javascript - Hide DIV until its items are wrapped in its default height -

i not know question title enough or not, let me explain here on http://www.wholesalerhinestones.org/ there div class sj-responsive-listing when site loaded, products inside div on place on site , after second wrapped inside specified hight i want hide div until products wrapped inside div specified height. i have tried .sj-responsive-listing{ display:none; } and $('.sj-responsive-listing').load(function() { // when page has loaded $('.sj-responsive-listing').show(); }); immediately inside script after div sj-responsive-listing class not work. div not show. i tried $('.sj-responsive-listing').show(); but again products shown , after time wrapped inside height the things tried not on .load doesn't think does. try .ready , this: $( document ).ready(function() { // handler .ready() called. $('.sj-responsive-listing').show(); });

android - How To Use universal image loader offline caching? -

is possible catch offline using universal image loader? if possible, how use it? using configs? how set download directory manually? out of memory erroron load huge images : my codes : displayimageoptions defaultoptions = new displayimageoptions.builder() .cacheondisc(true).cacheinmemory(true) .imagescaletype(imagescaletype.in_sample_int) .displayer(new fadeinbitmapdisplayer(300)).build(); imageloaderconfiguration config = new imageloaderconfiguration.builder(g.appconfigs.context) .defaultdisplayimageoptions(defaultoptions) .memorycacheextraoptions(480, 800) // default = device screen dimensions .diskcacheextraoptions(480, 800, null) .memorycache(new weakmemorycache()) .memorycache(new lrumemorycache(2 * 1024 * 1024)) .memorycachesize(2 * 1024 * 1024) .disccachesize(300 * 1024 * 1024) .build(); imageloader.getinstance().init(config);

linux - Identifying Ifuncs in the VDSO -

i see in vdso functions marked stt_func instead of stt_gnu_ifunc. know "gettimeofday" ifunc. is true functions in vdso ifuncs aren't tagged such? if not - why aren't these functions tagged ifuncs? see following on ubuntu: root@host:# objdump -t /lib/modules/3.13.0-32-generic/vdso/vdso.so /lib/modules/3.13.0-32-generic/vdso/vdso.so: file format elf64-x86-64 dynamic symbol table: ffffffffff700354 l d .eh_frame_hdr 0000000000000000 .eh_frame_hdr ffffffffff700700 w df .text 00000000000005ad linux_2.6 clock_gettime 0000000000000000 g *abs* 0000000000000000 linux_2.6 linux_2.6 ffffffffff700cb0 g df .text 00000000000002e5 linux_2.6 __vdso_gettimeofday ffffffffff700fc0 g df .text 000000000000003d linux_2.6 __vdso_getcpu ffffffffff700cb0 w df .text 00000000000002e5 linux_2.6 gettimeofday ffffffffff700fa0 w df .text 0000000000000016 linux_2.6 time ffffffffff700fc0 w df .text 000000000000003d linux_2.6 g

html how to insert a clickable link into a text block with PHP -

my current code (line breaks added clarity): echo "['<div class=info><h4>$title</h4> <br><a><img src=$aimage></a> <p>$short_title</p> <p>location$short_title</p> <p>rate: $rate</p> <p>system: $system</p> <p>link: $link</p> </br></div>', $lapt, $longa],"; the link added text, though, , cannot clicked. i wonder if possible insert link in block? thank ! <p><a href=\"$link\">link</a></p>

Disabling the Maximize/Minimize trim space in Eclipse RCP 4 -

Image
in eclipse 3 , eclipse 4, editorsashcontainer looks when has 1 editorstack : in eclipse 4, adds trim (which i've colored red) when there multiple editorstacks , didn't in eclipse 3: i understand we're in e4, there's no such thing editor , editorstack , , editorsashcontainer , part , partstack , , partsashcontainer . there different between "root" partsashcontainer , "regular" partsashcontainer , because "root" 1 has maximize/minimize buttons , trim: my question this: what different between "root" , "regular" partsashcontainer (maybe 1 isn't partsashcontainer ?) how disable behavior? my custom rcp application has 1 "root" partsashcontainer , , it's unsettling trim come , go. have mucked application.css , , gone far forking org.eclipse.e4.ui.workbench.addons.swt , i'm stuck. welp, ain't pretty, found way. greg-449 crucial marea hint. you can set rendererfa

apache - Best approach to set up PHP and Java application on same host -

i have 2 web applications 1 in php , 1 in java (play framework). i want make both these applications available clients , have 1 server test environment. what best , easy maintain approach problem? i looking @ options of virtual hosts on apache server. best? there third party tools can me divert traffic php , java apps based on port in http request? port nos php app 80 , java app 9000. regards, suraj assuming both ports forwarded correctly , apache listening traffic on port 80 , java listening on 9000 going yourip:80 should take apache , yourip:9000 should take java app

ios - Suggestions for activating front facing camera within Safari on iPad -

i'm trying create kiosk-style customer registration process ipad, doing an entirely web-based environment, rather purpose-built app. during registration process, user required take photo of own face using ipad camera. i have been experimenting html5 media capture tools, unfortunately, defaults ipad's camera, rather front-facing camera. means user must switch front facing camera, isn't ideal part of user experience. i can't see way of forcing ipad default front camera in device settings, , searches haven't revealed way of doing html only. i've had @ apps such "picup", don't seem offer more achievable html5 regard camera control. can offer suggestions? know of other ios apps (like picup) might give ability activate camera uploading images in form, can configured use front facing camera default? or going have go down path of creating purpose-built app control need? any suggestions welcomed, , in advance reply. the media a

mysql - NOT IN missing results -

i've got pretty simple query, "i want user_ids don't have role_type of 'group'. following sqlfiddle gives correct result want http://sqlfiddle.com/#!2/0a9640/1 when run query on actual mysql db doesn't return 2 results user_id=13565 , i've no idea why. the subquery gives single answer 8301 , indeed if manually enter value brackets i.e. select * role role.user_id not in ( select role.user_id role role.role_type = 'group' ) , (group_id=1465 or group_id=6314) order user_id then 2 missing results somehow reappear. ideas why these results stripped out when use subquery not in? a known confusion not in rows filtered out if subquery returns null of elements. can fixed checking explicitly: select r.* role r r.user_id not in (select r2.user_id role r2 r2.role_type = 'group' , r2.user_id not null ) , r.group_id in (1465, 6314) order r.user

php - Edit Community builder login -

i facing problem.i have community builder in may joomla 3.3.3 website redirect me following url after filled credentials. example.com/~crnatoday27/joomla/index.php/component/users/profile. i want change login redirect example.com/~crnatoday27/joomla/index.php/course-list/97-clinical-anesthesia-part-3 different different courses. in page have change can changes. can me sought out it.

C++ Guess the number game crashing with while function -

i made guess number game class assignment based on code c++ random number guessing game i first tried make "goto" function , worked perfectly, teacher says need make using "while". the problem program keeps closing after "troppo basso!" , "troppo alto!" messages appear, can tell me why? #include <iostream> using namespace std; int main() { int nuovogioco = 0; if (nuovogioco == 0) { srand(time(0)); int numero = rand() % 100 + 1; int prova; int variabile; int periodo = 0; nuovogioco++; { while (periodo <1 ) { cout << "a che numero sto pensando da 1 100? "; cout <<endl; cout << "se vuoi uscire digita e quando vuoi!"; cout <<endl; c

c# - What does this regexp mean - "\p{Lu}"? -

i stumble across regular expression in c# port javascript, , not understand following: [-.\p{lu}\p{ll}0-9]+ the part have hard time of course \p{lu} . regexp websites visited never mention modifier. any idea? these considered unicode properties. the unicode property \p{l} — shorthand \p{letter} match kind of letter language. therefore, \p{lu} match uppercase letter has lowercase variant. and, opposite \p{ll} match lowercase letter has uppercase variant. concisely, match lowercase/uppercase has variant language: aabbccddeeffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz

custom AngularJS Directive won't draw properly -

i trying wrap angular select list simple directive allow me draw select list , label both together. i encountering 2 problems. 1.the select list options not populating 2.the ngmodel attribute try pass down directive not populate data indicate in directive tag attribute. var myapp = angular.module('myapp',[]); myapp.controller('ctrl', ['$scope', function($scope){ $scope.currentbusinessstructure = ''; $scope.businessstructure = ['monarchy', 'corporation']; }]); myapp.directive('specialselect', [function(){ return { restrict: 'a', transclude: true, template: '<label ng-transclude></label> \ <select ng-model="currentbusinessstructure" ng-options="{{ngoptions}}" class="form-control"> \ </select> \ <br>inside directive: {{ngmodel}} : {{ngoptions}}', scope: {

big o - Can an algorithm have a runtime of O(2n)? -

this question has answer here: which algorithm faster o(n) or o(2n)? 4 answers if algorithm iterates on list of numbers 2 times before returning answer runtime o(2n) or o(n)? runtime of algorithm lack coefficient? it may still slower implementation doesn't iterate twice, still o(n) , time complexity scales based on size of n .

php - AJAX: Display different SQL queries -

i've been developing site family member months , past month have been stuck on function of site filters sql results. here page working on: http://www.drivencarsales.co.uk/used-cars.php i trying let users filter php + mysql results listed on right of page form left of page. so here current setup: i connect database , table contains of vehicle data on site using php: <?php try { $db = new pdo("mysql:host=localhost;dbname=","",""); $db->setattribute(pdo::attr_errmode,pdo::errmode_exception); $db->exec("set names 'utf8'"); } catch (exception $e) { echo "could not connect database."; exit; } ?> have file includes of sql queries: <?php include('database.php'); try { $results = $db->query("select make, model, colour, fueltype, year, mileage, bodytype, doors, variant, enginesize, price, transmission, picturerefs, servicehistory, previousowners, options, fourwheeldriv

java - UIManager.put() not working? -

i'm using app jsliders , setting , feel platform default. i'm trying set slider's thumb size using code: uimanager.put("slider.thumbheight",5); uimanager.put("slider.thumbwidth",20); but size remains unchanged. i've tried this: uimanager.getdefaults().put("slider.thumbheight",5); uimanager.getdefaults().put("slider.thumbwidth",20); same result, thumb on slider remains default size. i've calling before/after setting style there no difference.

python - PyMC + Theano on Debian Backports -

i'm attempting run model in pymc3 takes advantage of theano.dot when performing dot product in multilevel model. however, when attempt import theano get: python model.py ... // there's huge output that's looks file problem occurred during compilation command line below: g++ -shared -g -o3 -fno-math-errno -wno-unused-label -wno-unused-variable -wno-write-strings -wl,-rpath,/home/thauck/miniconda/envs/data/lib -d npy_no_deprecated_api=npy_1_7_api_version -m64 -fpic -i/home/thauck/miniconda/envs/data/lib/python2.7/site-packages/numpy/core/include -i/home/thauck/miniconda/envs/data/include/python2.7 -o /home/thauck/.theano/compiledir_linux-3.14-0.bpo.2-amd64-x86_64-with-debian-7.6--2.7.8-64/tmpkxtyks/b4f7a60b7c9f9a250601326a9fe2016e.so /home/thauck/.theano/compiledir_linux-3.14-0.bpo.2-amd64-x86_64-with-debian-7.6--2.7.8-64/tmpkxtyks/mod.cpp -l/home/thauck/miniconda/envs/data/lib -lpython2.7 -lf77blas -lcblas -latlas /usr/bin/ld: cannot find -lf77blas /usr/bin/ld: ca

exception - org.hibernate.hql.internal.ast.QuerySyntaxException: User is not mapped [from User] where User is my bean class -

i using hibernate gwt want retrieve data table, have created dto class , simple java class in have initialized dto object. in server side storing result in array list , using each loop storing query result user type , calling private method using dto object. my code fine getting below exception...and while retrieving firing "from user" query user simple bean class this hibernate.cfg.xml file <?xml version='1.0' encoding='utf-8'?> <!doctype hibernate-configuration public "-//hibernate/hibernate configuration dtd 3.0//en" "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> <!-- database connection settings --> <property name="connection.driver_class">com.mysql.jdbc.driver</property> <property name="connection.url">jdbc:mysql://localhost:3306/rs</property>

What is the difference between return ModelAndView and return String in Spring MVC? -

i want know different between modelandview , string. @requestmapping(value="/") public modelandview mainpage() { return new modelandview("home"); } and second piece of code returning string: @requestmapping(value="/") public string mainpage() { return "home"; } you can return many things controller, , spring automatically try deduce there. when return modelandview information needs passed controller embedded inside it. no suprise there. if return string, assume name of view use. wrap in modelandview object string view , existing model embedded well. spring lot of 'magic' on return types, on parameter types. allows write code in style more intuitive you, i.e. following 2 examples same: @requestmapping(value="/") public modelandview mainpage() { model m = new model(); m.put("key", "value"); return new modelandview(m,"main"); } and @req

node.js - NodeJS gm model use to get information of image? -

any 1 tell me how image information using nodejs module 'gm' . here used below code re-size. if image smaller re-size size not re-size so, want validation image width , height purpose want image information. gm(main_url_path) .resize(size, size) .write(compress_path, function (err){ if(!err){ callback(compress_path); }else{ console.log("not compressed success !!"+err); callback(null); } }); // output available image properties gm('/path/to/img.png') .identify(function (err, data) { if (!err) console.log(data) }); edit if want know basic implementation of nodejs packages, visit npm website provides examples of essential functions within package: https://www.npmjs.org/package/gm

android - error while adding development keyhash in developer.facebook.com -

Image
i making demo app integrating facebook sso , made debug keyhash login via facebook when adding development keyhash in facebook developers site asking me release keyhash @ same time , dont want upload demo playstore , not allowing me finish process. please suggest me can proceed. public void generatehashkeyforfacebook(context context) throws exception { try { packageinfo info = context.getpackagemanager().getpackageinfo("com.yourpackagename", packagemanager.get_signatures); (signature signature : info.signatures) { messagedigest md = messagedigest.getinstance("sha"); md.update(signature.tobytearray()); log.d("fbkeyhash >>> ", base64.encodetostring(md.digest(), base64.default)); } } catch (packagemanager.namenotfoundexception e) { e.printstacktrace(); } catch (nosuchalgorithmexception e) { e.printstack

internet explorer - Worklight 6.1 : What is browser compatibility for mobile web app -

we build mobile web app in worklight version 6.1. site working on browser firefox , chrome , ie . we facing issue ie not working on ie version , din't checked on browser different version. error showing while launching mobile site appendchild dosn't support line no 6077 wljq.js is there browser compatibility list on ibm site can refer same. when building mobile web app (that runs in mobile browser application) or web app (for example android , ios environments in worklight), faced limitations of each browser's rendering engine capabilities per browser version (every browser version have different set of features, fixes , support web specifications, etc...). as such, there no available compatibility list. there is, however, minimum - browser support @ least ecmascript 1.8.1 in order able run worklight js framework, , supported in browsers now, mobile or desktop. if facing issues specific browser or browser version, need overcome in web development

javascript - Google Apps Script [Email Send] -

is there way make output of 'message' in email neater? right now, it's 1 line of long data sent user. tried using <br> didnt seem work. function sendemails() { var sheet = spreadsheetapp.getactivesheet(); var range = sheet.getdatarange(); var data = range.getvalues(); setupcalendar_(data, range); var message = ""; (i in data) { var row = data[i]; var subject = "compiled list " + row[0]; message += row[0] + row[1] + row[2] + row[3]; } mailapp.sendemail("emailgoeshere", subject, message); } as mentioned in comment above, has been explained few times... below example sends data in text format , in html format recipients reject html content still see readable ;-) function sendemails() { var sheet = spreadsheetapp.getactivesheet(); var range = sheet.getdatarange(); var data = range.getvalues(); setupcalendar_(data, range); var txt = ""; var html = '<table style=&qu

ios - XCode 6 and Ad-Hoc distribution without XC: provisioning -

Image
yesterday i've downloaded xcode 6 , have got problem can't solve. in member center i've got valid certificate , ad-hoc provisioning (distribution). till yesterday, in xcode 5 if wanted add .ipa testflight using archive , selecting valid ad-hoc profile. wasn't logged in in developer account in xcode. now - in xcode 6 - nothing working @ all. ok, i've logged in preferences, xcode downloaded provisionings on mac, whenever choose export says don't have matching provisioning profile , it's creating new provisioning profile xc: prefix - don't want use, because contains devices have in member center - don't want include in app! i trying threads: xcode 6 - how pick signing certificate/provisioning profile ad-hoc distribution? xcode 6 gm creating archive but nothing working me. maybe don't understand correctly how works , there trick have use provisioning profile defined me. trying create new provisioning profile, rename old one, remove

Excel Formula to SUMIF date falls in particular range of dates -

what i'm trying create excel file our company's stores can use track newspaper returns , sales. we further use file here @ hq reconciling invoices on monthly basis when sent us. the tables i'm using have following data: b c d 1) 07/30.....$1.90.....formula 2) 07/31.....$1.60.....formula 3) 08/01.....$2.10.....formula 4) 08/02.....$5.60.....formula 5) 08/03.....$4.70.....formula...... weekly total(=sum(b2:b?) etc etc etc etc in example, store managers track received papers , returned papers totaled cost give data (extended cost) in column b. excel file ongoing, never ending list of values organized date in form of weekly blocks, subtotal each week in column d. managers need column weekly totals, weeks don't necessary coincide nicely. (i.e. may have totals august , september in 1 week's block) i'm using following formula calculate monthly totals in hidden column e (these calendar month totals run 1st o