Posts

Showing posts from June, 2015

orm - Sails.js + Waterline: Many-to-Many through association -

i'm new sails.js (v0.10.5) , waterline orm. have 3 tables in database: users (id, name), roles(id, alias) , join table users_roles(user_id, role_id). it's important not change table names , field names in database. want policy entity join entity between user , role. here mapping code: //user.js module.exports = { tablename: 'users', autocreatedat: false, autoupdatedat: false, attributes: { id: { type: 'integer', required: true }, name: { type: 'string' }, roles: { collection: 'role', via: 'users', through: 'policy' }, } } //role.js module.exports = { tablename: "roles", autocreatedat: false, autoupdatedat: false, attributes: { id: { type: 'integer', required: true }, alias: { type: 'string&

html - Can't use input type text from iframe iPad iOS 8 Safari -

currently facing following problem: have page iframe, loads page form. site runs on browsers no error message. in safari under ios8 on ipad, there problem. (only on ipad ios8, on iphone , ipad ios7 works) when select input field of type text , try write complete page reloaded. error message "the website has been reloaded, because there problem." iframe: <iframe src="[targetsite]" id="frame" scrolling="no" name="iframebox" seamless="seamless" ></iframe> form: <form action="[targetsite]" method="post"> <input name="ctextboxpsasword" type="password" id="textboxpsasword" tabindex="2" class="tboxlogin floatr" /> <input name="textboxusername" type="text" id="textboxusername" tabindex="1" class="tboxlogin" /> </form> i have not solved problem, have found r

Liquibase update with views -

following things have done: generated change log db.it given me set of views.following 1 mssql select isnull() table i have ran against oracle>is shows me exception replaced nvl in place of isnull.now want change log parameter works both mssql , oracle i have added following property="null" value="nvl" dbms=oracle property="null" value="isnull" dbms=mssql still views not updating.any can me out this

ios - ERROR : perhaps the designated entry point is not set? -

hello following this awesome tutorial didn't download stater project because want create different app have done want pop centerviewcontroller left side viewcontroller both in containerviewcontroller got in console: 2014-11-19 14:04:46.838 slidetable[3612:87749] failed instantiate default view controller uimainstoryboardfile 'main' - perhaps designated entry point not set? i tried this answer got same result. what error means have done required things auther provided @ start project didnt found solution this. this code may project. appdelegate.swift func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { window = uiwindow(frame: uiscreen.mainscreen().bounds) let containerviewcontroller = containerviewcontroller() window!.rootviewcontroller = containerviewcontroller window!.makekeyandvisible() return true } am missing something? provide further informatio

android - GridView stays empty -

i have gridview 1 imageview , 1 textview below in each cell. the logic works well. make reference gridview, set columns , set adapter. during have thread set's images , name list. (one drawable list images , 1 string list labels). satisfy users, want update gridview while thread adding images , labels lists. but update works if provide nasty static variables. (i hate them). or if set adapter new gridview everytime update has occured. (this nasty because not able scroll gridview during ist update..) this customadapter: public customadapter(dialogbox dialogboxactivity,list<drawable> imported_scaled_images, list<string> imported_labels, int position) { this.context = dialogboxactivity; this.scaledimage = imported_scaled_images.toarray(new drawable[imported_scaled_images.size()]); this.labels = imported_labels.toarray(new string[imported_labels.size()]); this.used_cells = position; inflater = (layoutinflater) context.getsystemservice(context.

kinect - How to run while(true) loop without freezing Windows form in C#? -

i writing application should show tracked skeletons 4 kinects. tracking , drawing on form should start when user presses start button. coming java background know little using delegates , eventhandlers in c#. far code looks this, freezes form completely. how fix that? private void mainwindow_load(object sender, eventargs e) { programloop(); } private void programloop() { int sensorcount = 0; foreach (kinectsensor connectedsensor in kinectsensor.kinectsensors) { if (connectedsensor.status == kinectstatus.connected) { connectedsensor.skeletonstream.enable(); connectedsensorsarray.add(connectedsensor); connectedsensor.start(); sensorcount++; } } } private void start_click(object sender, eventargs e) { trackskeletons(); } private void trackskeletons() { while (true) { foreach (kinectsensor sensor in connectedsensorsarray) { skeletonframe skeletonfr

javascript - Change value of array item when sorting -

i writing tests need check sort order of ng-grid table. values api call put table, sorting on table allows sort ascending , descending expected 'not set' shown @ either top or bottom of table. my protractor test grabs text value of items in list grab items api response array , sort using javascript check sorting working, 'n' isn't higher 'a' in alphabet, there way make when sort using javascript 'not set' goes top of list? i'v had search on google cant find maybe i'm using wrong search terms

javascript - Write to CSV file locally with HTML5 -

Image
i wondering whether html5 allows 1 save/write local file within user's file system. i'm asking know html5 can export data client , download csv file example. if not html5, best approach overwrite contents, or create csv (or other type of file matter) locally within client-side script? function: function exportdata() { var data = ''; (var i=1;i<=2;i++) { var sep = ''; (var j=1;j<=4;j++) { data += sep + document.getelementbyid(i + '_' + j).value; sep = ','; } data += '\r\n'; } var exportlink = document.createelement('a'); exportlink.setattribute('href', 'data:text/csv;base64,' + window.btoa(data)); exportlink.appendchild(document.createtextnode('test.csv')); document.getelementbyid('results').appendchild(exportlink); } markup: <input type="number" id="1_1" value="

led - RS485 bus on raspberry pi extension board to DMX 512 protocol -

for thesis need change brightness , color of led stripes. in case have use raspberry pi raspberry pi extension board, because board supports rs485 bus system. need reprogramm rs485 bus dmx512 protocoll. problem don't know how this. can please me? i have written dmx512 receiver raspberry baremetal. maybe helpful you. description : https://sites.google.com/site/rpidmx512/raspberry-pi-dmx512-rdm source code : https://github.com/vanvught/rpidmx512

apache - ProxyPass setup for multiple tomcat instances -

i tried implementing load balancing using mod_jk 2 tomcat instance. it holds except case of spring security check. when try using j_spring securitycheck. not working. upon googling, solution provided. loadmodule proxy_ajp_module modules/mod_proxy_ajp.so loadmodule proxy_module modules/mod_proxy.so proxypass /j_spring_security_check ajp://localhost:8009/j_spring_security_check proxypass /j_spring_security_logout ajp://localhost:8009/j_spring_security_logout when use above working. problem is, not able refer second tomcat instance. httpd.conf :configurations are loadmodule jk_module modules/mod_jk.so jkworkersfile conf/workers.properties jkloglevel info jklogstampformat "[%a %b %d %h:%m:%s %y]" jklogfile logs/mod_jk.log jkmount /restservice/* lb jkmount /images/* lb <location /jkmanager/> jkmount jkstatus order deny,allow allow </location> worker file : worker.list=lb worker.worker1.port=8009 worker.worker1.host=localhost worker.worke

How can I run my testing application immediately after a build in TFS? -

i have solution uses standard tfs build definition template. unit tests run when building solution, don't fail build. i have separate testing application runs suite of automated tests. these tests take long run part of main build (since need access built application in order manual testing), want kick off testing application automatically once build has completed, , want run against built application. don't know if matters, testing application part of solution, , references of application dlls. i utterly confused how best achieve this. need create new build process template? want have in separate build? i not recommend doing part of build , should instead part of release pipeline. automated integration tests should run in environment configured collect data under test rather compile code. release management visual studio 2013 provides ability push build output server , execute whatever want against it. http://nakedalm.com/execute-tests-release-management-vi

python - Failure to use adaptiveThreshold: CV_8UC1 in function adaptiveThreshold -

i have used opencv python , encountered error. img_blur = cv2.medianblur(self.cropped_img,5) img_thresh_gaussian = cv2.adaptivethreshold(img_blur, 255, cv2.adaptive_thresh_gaussian_c, cv2.thresh_binary, 11, 2) plt.subplot(1,1,1),plt.imshow(img_thresh_gaussian, cmap = 'gray') plt.title("image"), plt.xticks([]), plt.yticks([]) plt.show() but received: cv2.error: /home/phuong/opencv_src/opencv/modules/imgproc/src/thresh.cpp:1280: error: (-215) src.type() == cv_8uc1 in function adaptivethreshold do have install else? you should load file src.create(rows, cols, cv_8uc1); src = imread(your-file, cv_8uc1); and after adaptivethreshold(src, dst, 255, adaptive_thresh_gaussian_c, thresh_binary, 75, 10);

java - EhCache Write-Behind: Removing objects after writing to Db -

i'm using ehcache write-behind in order optimize writing db (through hibernate). question how configure ehcache remove cache element written db? tried several combinations of ttl , time idle couldnt make work. i need because found out if element x putwithwriter , written db, if cache.get() in case x in cache x unmanaged entity. know can set ehcache transnational comes cost, while in cases dont need it. reason i'm new ehcache , configuration , right hope fast solution. maybe can remove them cache.remove() in writer, i'd have explicitly lock , has costs right? so can configure ehcache remove elements cache right when writes them db? thanks!

Git installation RHEL Linux failing with "warning: zlib.h: No such file or directory" -

i installing git following document. but getting below error after running make command http://www.thegeekstuff.com/2011/08/git-install-configure/ [root@liaan17 git-1.8.2.3]# make cc credential-store.o in file included credential-store.c:1: cache.h:19:18: warning: zlib.h: no such file or directory in file included credential-store.c:1: cache.h:21: error: expected specifier-qualifier-list before ‘z_stream’

java - Object to Json including only fields not null -

i have object named item plenty of fields. i'm using java json (json-io) library serialize state in file: string json = jsonwriter.objecttojson(item); // write string file i'd make json string less verbose not include null values (if possible boolean false). possible somehow ? thanks i can recommend using jackson mapper if possible. check out these 2 questions: jackson serialization: ignore empty values (or null) how tell jackson ignore field during serialization if value null?

java - Not creating arraylist Object Class from JSON in fragment (Android) -

i have fragment class showed when element selected in navigation drawer: public class recibidosfragment extends fragment { public expandlistadaptermensaje expadapter; public arraylist<childmensaje> listchild=null; public arraylist<mensaje> listmensajes=null; public expandablelistview expandlist; public progressdialog dialog; public arraylist<arraylist<childmensaje>> listchildxxxxxxxxx = null; textview tv; context mcontext; /** * returns new instance of fragment given section number. */ public static recibidosfragment newinstance() { recibidosfragment fragment = new recibidosfragment(); return fragment; } public recibidosfragment() { } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_recibidos, container,

javascript - //Ball to ball elastic collision: ball bounces in an unequal proportion -

this first post :/ anyway, i've been working on game requires ball ball collision , can't seem find solution problem, collision balls going correct directions messes velocity. once balls hits each other, horizontal(x) bounces off hard while vertical(y) bounces off softly. have no idea cause or causes of this, tried reduce x-velocity dividing means won't in proportion y value. this code collision: function resolvecollision(b1, b2){ var dot = function(v1, v2) { return v1.x * v2.x + v1.y * v2.y; }; v1x = b1.vx/2 v2x = b2.vx/2 v1y = b1.vy v2y = b2.vy var length = function(v) { return math.sqrt(v.x * v.x + v.y * v.y); }; var delta = {x: b1.x - b2.x, y: b1.y - b2.y}; var d = math.sqrt((delta.x * delta.x) + (delta.y * delta.y)); var dn = {x: delta.x / d, y: delta.y / d} var dt = {x: dn.y, y: -dn.x}; if (d === 0){ b2.x += 0.01; } var m1

git - How to move my new branch to the latest commit in master branch? -

i created new branch master branch 2 days ago. 1 of team mates checked in few changes master branch, instead of new branch (it should in both master , new branch). now, want move origin of new branch latest commit in master. i have commits , branches shown below: c4 <-- new branch / c0 - c1 - c2 - c3 - c5 <-- master what want is: c4 <-- new branch / c0 - c1 - c2 - c3 - c5 <-- master i tried git merge , didn't work. you need git rebase #on new branch do: git fetch origin master git rebase origin/master

Grouping data in a certain way in mysql -

i have query fetches data table called supervisor_approvals, want group rows of department , leave other department ungrouped each labref supervisor approval structure looks ------------------------------------------------- labref department ab 1 ab 1 ab 0 ab 0 ab 0 xy 1 xy 0 xy 0 after query (result should be) labref department ab 0 ab 1 ab 1 xy 0 xy 1 instead not show other labref data first 1 shown a http://sqlfiddle.com/#!2/6fb86/9 ! my sql select distinct * supervisor_approvals department = 0 , assign_status='0' group department union select * supervisor_approvals department = 1 , assign_status='0' order department desc try: selec

asp.net mvc - Using MVC bundling to generate custom CSS from LESS files -

i have multiclient system whereby different clients have different brand colours. these colours stored in db , referenced throughout less files @color{1-3}. we used maintain colors.less file reference places these colours featured. in client-neutral situation render normal bundle our brand colours within client area inject stored css file generated when client colours changed in db. this worked fine maintaining colours.less file becoming bit unwieldy i'd render css "real time" no css file needs generated manually. can't every request because hammer server intensive css generation every page load. my question how can use bundling or other form of caching generate css on fly (i.e without storing css files) without hammering server? you can implement custom http handler: public class customhandler : ihttphandler { #region ihttphandler members public bool isreusable { // return false in case managed handler cannot reused reque

java - JavaFX Block the UI (and the code) until a server call is finished -

this topic around in countless articles of "not blocking javafx ui during long lasting call time consuming (server)". know , googled , tried lot. of "internet" explains long lasting calls caused javafx events need made in thread. after thread finished, update fx ui results via platform.runlater(). of fx libraries encapsulate sophisticated code constructs (really cool stuff). current problem is: migrating swing rich client javafx. huge one, have include/replace javafx ui it, until full fx client. there functionality in client server call , has wait before user can continue work. server uses jee6 stateless session beans , interfaces. interfaces known client , little library of our own, implemented little proxy hiding away communication layer client. client creates "remoteproxy" library calling remote interface , library propagates call server. method called , result or exception transported client. client appears local call. here problem. typical code fr

What is this code doing? C/C++ -

can tell recursive function doing. think nothing, returns 0 , program stops. for string: honolulu\0 int fun(char *string){ if(*string != 'u') return 0; return 1 + fun(string + 1); } it counts number of 'u's @ start of string. cout << fun("umbrella"); //prints: "1" cout << fun("uumbrella"); //prints: "2" note assumes string '\0' terminated. many old c string functions iterate off end of array until finds random '\0' somewhere in memory long keeps getting 'u's.

node.js - How to update elasticsearch field type -

i need update elasticsearch field type integer long tried following way , not works curl -xput 'http://localhost:9200/testwork/_mapping/message?ignore_conflicts=true' -d ' { "message" : { "properties" : { "status" : {"type" : "long"} } } } ' when tried without ignore_conflicts parameter getting error like {"error":"mergemappingexception[merge failed failures {[mapper [status] of different type, current_type [integer], merged_type [long]]}]","status":400} but not error while using ignore_conflicts parameter got response like {"acknowledged":true} but type not changed status field. please me this it not possible change data type if have data present. you'll have delete index, create mapping data type want, , re-index data. to re-index need export , re-import data - there tools (scan&scroll , bulk api) make e

maven - How to get all headers in a XWPFDocument -

Image
i'm trying extract headers in docx file have. code use: fileinputstream fs = new fileinputstream(new file("myfile.docx")); xwpfdocument doc = new xwpfdocument(opcpackage.open(fs)); list<xwpfheader> list = doc.getheaderlist(); and if do: system.out.println(list.size()); it prints out 0, have 4 headers in document. way have succeeded extract text document using following code: xwpfwordextractor wx = new xwpfwordextractor(doc); string text = wx.gettext(); system.out.println("text = "+text ); this structure of document: any ideas on problem might be?

c# - Get a list from an HttpContext.request object -

using jquery have serialized form , send server in format: object{ transactionid : "10779" itemlist : [{itemname:"ball", quantity: 5}, {itemname:"stuff", quantity:10}] } in custom asp.net modelbinder, this: httprequestbase request = controllercontext.httpcontext.request; list<item> itemlist = new list<item>(); foreach (var item in request.form.get("itemlist")) { itemlist.add(new transactionitemquantity { name = item.itemname quantity = item.quantity }); } return new transaction { transactionid = request.form.get("transactiontypeid"), itemlist = itemlist }; } however, foreach loop not work, ide doesn't yet know request.form.get("itemlist") returns array of objects. how make above code work? if char-array request. need deseria

algorithm - Predicting opening and closing of an organisation -

given training data of organisation meter reading recorded @ interval of 15 minutes each day .like n days provided data. and of data need tell on particular day organisation closed or open . need know if link can in matter if has worked field. by closed mean on day consumption of electricity constant,though single feature take account. so how predict in best way ? maybe use of threshold not suit different kind of organisation, sure there minimum consumption. maybe use information of past 15 minutes increase reliability. adding 1 more input classifier.

BigQuery - counting number of events within a sliding time frame -

i count number of events within sliding time frame. for example, know how many bids in last 1000 seconds google stock (goog). i'm trying following query: select symbol, start_date, start_time, bid_price, count(if(max(start_time)-start_time<1000,1,null)) on (partition symbol order start_time asc) cnt [bigquery-samples:nasdaq_stock_quotes.quotes] symbol = 'goog' the logic follow: partition window (by symbol) ordered bid time (leaving alone bid date sake of simplicity). each window (defined row @ "head" of window) count number of rows have start_time less 1000 seconds "head" row time. i'm trying use max(start_time) top row in window. doesn't seem work , error: error: max analytic function , must accompanied on clause. is possible have 2 analytic functions in 1 column (both count , max in case)? there different solution problem presented? try using range function. select symbol, start_date, start

apache - .htaccess 302 redirect url with php parametr to other website -

can tell me if gonna work correctly ? i need redirect 302 webpages: http://www.mysite.domain.net/?click=url http://www.mysite.domain.net/?url=anotherurl&version=1&reflink=base to webpage http:// othersite.otherdomain.com rewriteengine on rewritecond %{query_string} ^(.*&)?click=url$ rewritecond %{query_string} ^(.*&)?url=program&version=1&reflink=base rewriterule ^$http://othersite.otherdomain.com [l, nc] you need have [or] beween rewritecond lines. your syntax of rewriterule wrong. space before r flag cause 500. try rule: rewriteengine on rewritecond %{query_string} (^|&)click=url(&|$) [or] rewritecond %{query_string} (^|&)url=program&version=1&reflink=base(&|$) rewriterule ^/?$ http://othersite.otherdomain.com/? [l,nc,r=302]

csv - Using tabs spacing in php for text file -

i'm reading csv file , printing data csv file 2 .txt files. output of text files follows john georgina,sinclair,408999703657,cheque,"first national bank",fourways,275.00,12/01/2012 toby,henderson,401255489873,cheque,"first national bank",edenvale,181.03,12/13/2012 here code: $file_handle = fopen("debitorders.csv", "r") or die("can't open debitorders.csv"); $absafile = fopen("absa.txt", "w") or die("can't open absa.txt"); $firstnationalbankfile = fopen("first national bank.txt", "w") or die("can't open first national bank.txt"); while (!feof($file_handle) ) { $debitorders = fgetcsv($file_handle, 1024, ","); if ($debitorders[4] == "absa"){ print_r ($debitorders[4] . "<br />"); fputcsv($absafile, $debitorders); $absa_bank = "absa"

Scene does not appear when I go several times, as well erase the memory -

the first time entered scene comes quick , not occupy memory, second time enters takes longer, , next not let me in, nothing appears, scene black. i use these things clear memory when leave scene, erase , when come good, should not work: stopallactions(); removeallchildren(true); unscheduleallselectors(); ccspriteframecache.sharedspriteframecache().removeallspriteframes(); ccdirector.shareddirector().purgecacheddata(); cctexturecache.sharedtexturecache().removealltextures(); cleanup(); please !!!!!!!!!!

permissions - centos file creation won't work even tho 775 -

we having problem (taht have reproduced below on smaller scale), cant write file, when think should # ls -ld testdir drwxrwxr-x 2 user1 root 4096 nov 19 12:13 testdir # groups user1 user1 : user1 foo #groups foo foo: foo user1 but when log foo user , testdir start editor [foo@myhost testdir]$ nano tempfile and try save [ error writing tempfile: permission denied ] tho have - set parent folder 775 - added user group owns folder - relogged foo , user1 user (and if change folder 777 work, dont want on webserver (it leaves backdoor open hackers replace files) the group on testdir root not user1 . run chgrp user1 testdir , see if fixes problem.

New to HTML and CSS and I need help optimising my code. Also have a few issues with dynamic sizing of elements -

This summary is not available. Please click here to view the post.

sql server - SQL Select for create daily log data from more than one date column frrom a single table -

Image
i have table more 1 date column, each date column hold date or null value, want write sql query display each column have date new row new additional column named logdate contain same date of column. difficult explain, please referrer attached image. just use union all concatenate 3 result sets: select [receiveddate] logdate, * mytable [receiveddate] not null union select [closing date] logdate, * mytable [closing date] not null union select [lpodate] logdate, * mytable [lpodate] not null to sort logdate add following order clause end of query: order logdate

python - xml string is enclosed with b'<xml_string>' while generating from dictionary using dicttoxml module -

i using dicttoxml module converting dictionary xml. code: cfg_dict = { 'mobile' : { 'checkbox_os' : { 'status' : 'none', 'radiobutton_andriod' : { 'status' : 'none', 'combobox_andriod_brands' : 'lg'}, 'radiobutton_windows' : { 'status' : 'none', 'combobox_windows_brands' : 'nokia'}, 'radiobutton_others' : { 'status' : 'none', 'combobox_others_brands' : 'apple'}}, 'checkbox_screen_size' : { 'status' : 'none', 'doublespinbox_screen_size' : '5.0' }} } dicttoxml import dicttoxml xml

node.js - Mean.js, Mongoose , mongodb : How do I update/ insert data into a collection with Tree structure( nested arrays)? -

i new mean.js stack. so, please forgive semantic hiccups. have mongoose data model of following structure : var sectorschema = new schema({ name: { type: string, default: '', trim: true }, code: { type: string, default: '', trim: true }, subsectors: [{ name: { type: string, default: '', trim: true }, code: { type: string, default: '', trim: true }, industries: [{ name: { type: string, default: '', trim: true }, code: { type: string, default: '', trim: true }, inindustries: [{ name: { type: string, default: '', trim: tr

arrays - erro java, cannot find symbol -

well, i'm new in , dont know how can make program works, need write program calculates , returns sum of components of vector squared and got error: import java.util.*; public class cuadrado { public static void main(string[] args) { scanner teclado= new scanner (system.in); int n=0,i=0,y=0; system.out.println("ingrese el valor de el vector"); n=teclado.nextint(); int[ ]suma=new int[n]; for(i=0;i<suma.lenght;i=i+1); { system.out.println("ingrese el valor de un numero"); suma[i]=teclado.nextint(); y+=suma[i]; system.out.println(""+y); } } } cannot find symbol in line 16 remove ; end of line for(i=0;i<suma.lenght;i=i+1); edit also, @ankur-singhal said, suma.length instead of suma.lenght (nice catch).

c++ - Gstreamer appsrc: odd behaviour of need-data callback -

i'm implementing gstreamer media player own source of data using appsrc . works fine except 1 thing: when stream reaches it's end, callback emits "end-of-stream" signal. signals sending fucntion g_signal_emit_by_name(appsrc, "end-of-stream", &ret) returns gstflowreturn value gst_flow_ok . calls need-data callback again, returns "end-of-stream" signal again. , time gstflowreturn value (-3) gst_flow unexpected . assume not expect "end-of-stream" signal when recieved one, why requests more data than? maybe because didn't set size value iof steam? gstreamer version 0.10. callback function code ( appsrc type seekable btw): static void cb_need_data (gstelement *appsrc, guint size, gpointer user_data) { gstbuffer *buffer; gstflowreturn ret; appsrcdata* data = static_cast<appsrcdata*>(user_data); buffer = gst_buffer_new_and_alloc(size); int read = fread(gst_buffer_data(buffer), 1, size, data

scala - Relative module references -

i have multimodule sbt (0.13.2) project foo - foo-api - foo-web - ... foo , each subdirectory has build.sbt . toplevel file aggregator: lazy val fooapi = project("foo-api", file("foo-api")) lazy val fooweb = project("foo-web", file("foo-web")).dependson(fooapi) // ... lazy val foo = project("foo", file(".")). aggregate(fooapi, fooweb, ...) now absolutely need (not choice) able compile foo-web separately inside foo-web subdirectory , should still depend on foo-api . i endend adding following fragment foo-web/build.sbt : lazy val fooweb = project(id = "foo-web", base = file(".")) .in(file(".")) .dependson(project("foo-api", file("../foo-api")) which works cd $root/foo-web && play compile breaks cd $root && play compile since relative paths relative execution directory. how can reference project using relative path works regardl

ruby on rails - Best approach in testing geocoder gem with RSpec -

i know has been asked before since newer version came out , since last relevant post dated 2 years ago, wondering use , follow tdd t, what's approach in testing of it's functionality (geocode, near, within_bounding_box, distance, etc). currently, there a method doing that . my question is, how stub multiple results? because you'd need multiple data testing near, within_bounding_box, distance or other calculated functionality. thanks time reading , feedback may come! you pass more 1 address stub , call before tests: # create list of addresses addresses = [ ["new york, ny", [{ 'latitude' => 40.7143528, 'longitude' => -74.0059731, 'address' => 'new york, ny, usa', 'state' => 'new york', 'state_code' => 'ny', 'country' => 'united states', 'country_code' => 'us' }]], ["

java - Use boolean value in HQL -

i have product class attribute : boolean latest; public boolean islatest() { return latest; } public void setlatest(boolean latest) { this.latest = latest; } in database attribute bit type true/false value. i want select products have latest = true. hql is: from product latest = true i tried: from product p p.islatest true from product latest true but it's return products or failed. there way select products have latest attribute = true. great. when ran this, using jdbc on apache derby database. trying set value of boolean field , trying "=true", "=1", etc. in end, used named parameter shown below , that's how got situation work. session.createquery("select product latest = :latest").setboolean("latest", boolean.true); hopefully helps similar situation.

html - Why my SVG font is not working? -

i have created svg font , converted ttf font. ttf font works correctly, svg font not - tested in chrome & firefox. here files have created: myfont.svg: <?xml version="1.0" standalone="no"?> <!doctype svg public "-//w3c//dtd svg 1.1//en" "http://www.w3.org/graphics/svg/1.1/dtd/svg11.dtd" > <svg xmlns="http://www.w3.org/2000/svg"> <metadata>my font</metadata> <defs> <font id="myfont" horiz-adv-x="1024"> <font-face units-per-em="1024" ascent="960" descent="-64" /> <missing-glyph horiz-adv-x="1024" /> <glyph unicode="&#33" d="m513-64c513-64,124,320,124,576c124,789,298,960,513,960c727,960,901,789,901,576c901,320,513-64,513-64zm513,784c396,784,301,689,301,572c301,455,396,360,513,360c630,360,725,455,725,572c725,689,630,784,513,784z"></glyph> <glyph unicode="&#34;" d=&