Posts

Featured post

java - Why does my date parsing return a weird date? -

here code using: string string = "08/07/2013".replace('/', '-'); date date = new simpledateformat("yyyy-mm-dd").parse(string); why date return: "wen jan 3 00:00:00 est 14"? not @ date format told use. edit: need format because database using requires format. the format use parse date string, not match it. using yyyy 08 . use following format: new simpledateformat("dd-mm-yyyy") and why @ replacing / - ? can build pattern original string only: string string = "08/07/2013" date date = new simpledateformat("dd/mm/yyyy").parse(string); and if want date string in yyyy-mm-dd format, can format date using dateformat#format(date) method: string formatteddate = new simpledateformat("yyyy-mm-dd").format(date); see also: change date format in java string simpledateformat java doc

android - Invite new users for my app using app notifications facebook -

my app logs in via facebook , friends of facebook user logged listed invited download app. want guests advised via facebook through notification. i've done test via "graph api explore" follows: post/{recipient_userid}/notifications? access_token = ... & template = john inviting learn new app. & href = ... " but noticed notification comes have application installed. {return: "(#200) cannot send notifications user has not installed app"} how send notifications facebook users still not have application installed? thks! because notifications not meant used invite friends. they're used notify app users of events happening in app (e.g. if high score beaten in game example). if want let user invite friends use app, i'd suggest use request & invite features of facebook sdk: https://developers.facebook.com/docs/tutorials/ios-sdk-games/requests/ that tutorial shows how user can select list of friends invite , write

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

Image
i've plotted data points , fitted exponential curve between them using 'fit' in matlab. problem fit-function got fitted line wanted plot, markers on top of regular markers. solved problem plotting wanted markers on top of unwanted couldn't seen. problem. when want show legends dots in there. how can remove markers legend without removing fitted line since both of them hidden inside fit-function? can stop 'fit' plotting unwanted markers? so, want remove blue dot called 'hoff' in picture below. you can leave out legend-entries manually leaving out handles of lines, dont want in legend. try this: %if plot something, want showing in legend, save handle: h_line = plot(x,y) %you dont want show line? dont anything, plot it: plot(mymarker) %then set legend-> can add text legend-entries %a cell-array containing strings want show up: legend([h_line another_line],{'text1' 'text2'}) with example (see comments) came solution:

Jruby converted ruby app problems -

i'm trying deploy ruby app our webserver , fit in other apps running there. this, need toss in war , run jetty. the app has been sitting on machine sometime gems out of date, in process of getting updated , transitioned jruby resolved number of old dependencies warbler bundle it. warbler bundling fine, deployed app dying unknown method. this the stack trace get: --- system jruby 1.7.4 (1.9.3p392) 2013-05-16 2390d3b on openjdk 64-bit server vm 1.6.0_27-b27 [linux-amd64] time: 2013-08-07 09:13:33 -0400 server: jetty/8.1.11.v20130520 jruby.home: file:/tmp/jetty-0.0.0.0-8085-webstat.war-_webstat-any-/webapp/web-inf/lib/jruby-stdlib-1.7.4.jar!/meta-inf/jruby.home --- context init parameters: public.root = / rails.env = production --- backtrace nomethoderror: undefined method `set_table_name' lockablestate(table doesn't exist):class method_missing @ org/jruby/rubybasicobject.java:1696 method_missing @ /tmp/jetty-0.0.

html - CSS: Combine Texture and Color -

Image
someone how combine texture use background-image , background-color above texture ? here texture : i want body background page : i'm struggling backroung-image , background-color : http://jsfiddle.net/87k72/ body{ background: #6db3f2 url('http://s13.postimg.org/j0qiscsw3/cream.png'); } you can use overlay div alpha channel on top of body under other elements. jsfiddle example <h1>i want blue color above texture</h1> <div id="cover"></div> body { background: url('http://i.stack.imgur.com/oslrb.png'); } h1{ position:relative; z-index:2; } #cover { position:absolute; top:0; bottom:0; left:0; right:0; background-color:rgba(109,179,242,0.5); z-index:1; }

Need help in packaging app using TideSDK on Windows -

i developed application using tidesdk on windows , when click launchapp works fine. moved package , installed imagemagick , wix 3.0 required packaging on windows. clicked on package runtime , cannot guess packaged app is? found file 'installer' in workspace when click on it says installer not find application path . think application not being packaged properly. here log see in tidesdk: preparing package desktop app runtime. 1 moment... staging trial -> copying contents d:\lab\tidesdk\trial d:\lab\tidesdk\trial\packages\win32\bundle\trial -> copying installer c:\programdata\tidesdk\sdk\win32\1.3.1-beta\installer d:\lab\tidesdk\trial\packages\win32\bundle\trial -> copying runtime d:\lab\tidesdk\trial\packages\win32\bundle\trial -> date: d:\lab\tidesdk\trial\packages\win32\bundle\trial\modules\app\1.3.1-beta -> date: d:\lab\tidesdk\trial\packages\win32\bundle\trial\modules\codec\1.3.1-beta -> date: d:\lab\tidesdk\trial\packages\win32\bundle\trial\mod

testing - How do I test Angularjs factory stubbing $http? -

i have factory called songs fetches songs each second api: angular.module('pearljam') .factory('songs', function($http, $timeout, config){ var response = {list: []}; var onsuccess = function(result){ response.list = result.data.data; $timeout(poller, config.pollingtimeout); }; var poller = function(){ $http.get('api/songs.json', config.httpoptions).then(onsuccess); }; poller(); return {all: response}; }); i test it, , tried shown bellow think inject service in wrong way. when try run test outputs error: no pending request flush ! .it it's not making http calls. describe('songs', function(){ var httpstub, localservice; beforeeach(module('pearljam')); beforeeach(inject(function(_$httpbackend_, songs){ httpstub = _$httpbackend_; localservice = songs; })); it('lists songs', function(){ var httpresponse = { data: [1]