Posts

Showing posts from June, 2015

javascript - how to fire a controller method from another controller or directive? -

what need show values automatically when process data on controller, how can fire $scope.setoncontroller1 function on controller1 when controller2 have ended process data automatically. js fiddle http://jsfiddle.net/b2fce/228/ here html code <div ng-app="myapp"> <div ng-controller="mycontroller1"> <button ng-click="setoncontroller1()">force values(second)</button><br/> <ul> <li><b>mycontroller1</b> (values won't change)</li> <li>{{stringvalue}}</li> <li>{{objectvalue}}</li> </ul> </div> <div ng-controller="mycontroller2"> <ul> <li><b>mycontroller2</b> (values change when set values clicked or when 2-way binding textbox modified)</li> <li>{{stringvalue()}}</li> <li>{...

android - No artifacts found that match the file pattern "**/target/*.apk" -

i got output jenkins console while trying compile android project: notice didn't make change on main class jenkins console: [info] build success [info] ------------------------------------------------------------------------ [info] total time: 10.701s [info] finished at: thu may 29 17:56:45 cest 2014 [info] final memory: 24m/491m [info] ------------------------------------------------------------------------ [jenkins] archiving /var/opt/jenkins/workspace/android-project-app/trunk/pom.xml com.proj.android.project.mobile/project-android/0.0.1-snapshot/project-android-0.0.1-snapshot.pom [jenkins] archiving /var/opt/jenkins/workspace/android-project-app/trunk/assets/build/project-android.apk com.proj.android.project.mobile/project-android/0.0.1-20140529.155643-5/project-android-0.0.1-20140529.155643-5.apk [jenkins] archiving /var/opt/jenkins/workspace/android-project-app/trunk/assets/build/project-android.jar com.proj.android.project.mobile/project-android/0.0.1-20140529.155643-...

php - Mod_rewrite, trying to exclude images and css files -

i trying find way exclude image files , css files mod_rewrite permissions options +followsymlinks rewriteengine on #secfilterinheritance off errordocument 404 /fourohfour.php rewritecond %{http_host} ^(myurl\.com)$ [nc] rewriterule ^(.*)$ http://www.%1/$1 [r=301,l] rewritecond %{request_uri} !\.(?:css|png|jpe?g|gif)$ [nc,or] #my attempt @ excluding rewriterule ^articles/([^/]+)/([^/]+)/?$ /article.php?id=$1&articletopic=$2 [qsa,l] problem exclusion line isn't quite accurate , need it if go phpscript in directory isn't included in .htaccess rewrite.. isntance www.myurl.com/articlelinks.php redirected this: http://www./articlelinks.php to complicate things further: if go to: http://www.myurl.com/articles/1/dorsal+and+volar+intercalated+segment+instability+(disi+and+visi) css files don't load if go to: http://www.myurl.com/articles.php?id=1&articletopic=dorsal+and+volar+intercalated+segment+instability+(disi+and+visi) proper document loaded...

user interface - FLTK GUI not displaying (Dev-C++) -

i new c++ (since march) , learning gui's. have simple code runs without error, no window or gui displayed. here code: #include <fl.h> #include <fl_window.h> int main(int argc, char ** argv){ fl_window win(400, 400); win.show(); return(fl::run()); } there individual on here had same problem same code, using cygwin ( fltk applications in cygwin: gui doesn't show? ). answer given question following: if fltk-config --cxxflags , fltk-config --ldflags not output -mno-cygwin, fltk compiled work cygwin's x window system - want avoid. add -mno-cygwin makefile , fltk application should work. i liked mingw+msys more. to honest, don't understand means, let alone applying ide , compiler. i'm guessing talking using command prompt check something... far got. i running dev-c++ 5.6.3 mingw 'tdm-gcc 4.8.1 32-bit debug' option pull-down menu. in order build guis in dev-c++, downloaded fast light toolkit (fltk) 1.1.7 devpaks.org comm...

php - Laravel authentication with MongoDB -

i'm trying make authentication laravel , mongodb. the problem in controller. code not make authentication : if(!input::exists('username') or !input::exists('password')) { app::abort(403, 'forbidden request'); } $credentials = array( 'username' => input::get('username', null), 'password' => input::get('password', null), ); if(auth::validate($credentials)) { return 'success'; } else { return 'failed'; } but 1 works fine: if(!input::exists('username') or !input::exists('password')) { app::abort(403, 'forbidden request'); } $credentials = array( 'username' => input::get('username', null), 'password' => input::get('password', null), ); $users = user::all(); $found = false; foreach($users $user) { if($user-...

android - Buttons within a ListFragment not clickable -

i have activity lays out listfragments side side (as many user wants) in horizontalscrollview upon choosing option in actionbar. each listfragment item contains textviews , button. simpleadapter populates data each item in every listfragment. the issue facing buttons in each list item not respond clicks. layout can summarized follows: button inside listfragment inside fragmentactivity, going innermost child element parent @ root view. i have spent many hours on problem , unable arrive @ solution make buttons respond clicks. of approaches have used include obtaining button's view , attaching onclicklisteners, 2) implementing onclicklistener interface listfragment. aware of onintercepttouchevent method viewgroup class, lack of experience android prevents me arriving @ solution. guidance or direction towards solving problem appreciated. here code listfragment: package com.example.androidlistfragmenttest; import java.util.arraylist; import java.util.hashmap; import andr...

javascript - how to animate drawing lines on canvas -

i have created lines connecting each other on canvas. want animate these lines while drawing on canvas. can please help? here code , fiddle url: var c=document.getelementbyid("mycanvas"); var ctx=c.getcontext("2d"); ctx.moveto(0,0,0,0); ctx.lineto(300,100); ctx.stroke(); ctx.moveto(0,0,0,0); ctx.lineto(10,100); ctx.stroke(); ctx.moveto(10,100,0,0); ctx.lineto(80,200); ctx.stroke(); ctx.moveto(80,200,0,0); ctx.lineto(300,100); ctx.stroke(); http://jsfiddle.net/s4gwk/1/ i understand want lines extend incrementally along points in path using animation. a demo: http://jsfiddle.net/m1erickson/7farq/ you can use function calculate waypoints along path: // define path plot var vertices=[]; vertices.push({x:0,y:0}); vertices.push({x:300,y:100}); vertices.push({x:80,y:200}); vertices.push({x:10,y:100}); vertices.push({x:0,y:0}); // calc waypoints traveling along vertices function calcwaypoints(vertices){ var waypoints=[]; for(var i=1;i...

Apache Camel transform not working -

i have camel route: <route id="externalrestpushroute"> <from uri="jms:pushprocessedrecordstoexternal" /> <setheader headername="payload"> <simple>body</simple> </setheader> <marshal ref="jack"></marshal> <to uri="http://localhost/front/rest/karec/dummy-push"/> <transform> <simple>in.header[payload]</simple> </transform> <to uri="bean:noauthrecordpersistenceservice?method=deliverysuccess" /> </route> the idea this: want deliver object in json format rest endpoint(all headers set , rest endpoint receives json format)/ convert object json format use marshal , works. now, response http endpoint of type java.io.inputstream don't care. care converting body original object before marshaled. did save object in header before marshaling in hea...

c# - What is a NullReferenceException, and how do I fix it? -

i have code , when executes, throws nullreferenceexception , saying: object reference not set instance of object. what mean, , can fix error? what cause? bottom line you trying use null (or nothing in vb.net). means either set null , or never set @ all. like else, null gets passed around. if null in method "a", method "b" passed null to method "a". the rest of article goes more detail , shows mistakes many programmers make can lead nullreferenceexception . more specifically the runtime throwing nullreferenceexception always means same thing: trying use reference, , reference not initialized (or once initialized, no longer initialized). this means reference null , , cannot access members (such methods) through null reference. simplest case: string foo = null; foo.toupper(); this throw nullreferenceexception @ second line because can't call instance method toupper() on string reference pointing null ....

Kendo Grid doesn't display data if I use a function call for the data -

if use second read below commented out, grid displays data. if use first, can see data being returned in fiddler, grid doesn't display it. var $nisgriddatasource = new kendo.data.datasource({ transport: { read: function () { dataservice.newissuesstatistics(); } //read: { //url: "/api/poolapi/newissuessecurities" //} } ... this dataservice.newissuesstatistics method called sucessfully: newissuessecurities = function () { return $.ajax({ url: "/api/poolapi/newissuessecurities" }); can suggest why so? you have tell kendo ui datasource it's received data. how function dataservice.newissuesstatistics() implemented? return promise? let's illustrative purposes does, how it: var datasource = new kendo.data.datasource({ transport: { read: function(options) { dataservice.newissuesstatistics().done(function(stats) { options.success(stat...

.net - Force Visual Studio to Rebuild a Solution before Publishing -

i developing multi project solution in vs2102. 1 of projects has post-build event updates version numbers in main project (assemblyinfo.cs , project file) before compiling. means whole solution must rebuilt before clicking publish (vs doesn't build @ point since there may not changes). there way program vs automatically rebuild pre-publish?

php - I need help converting from mysql_query to PDO -

i want make site secure possible need convert have pdo. i've done few things ran road block on sign in page. heres code: <?php //signin.php include 'connect.php'; include 'header.php'; session_start(); echo '<h3>sign in</h3>'; //first, check if user signed in. if case, there no need display page if(isset($_session['signed_in']) && $_session['signed_in'] == true) { echo 'you signed in, can signout if want.'; } else { if($_server['request_method'] != 'post') { echo '<div class="formdivs" id = "logindiv"><form class = "homeforms" method="post" action=""> <label>username:<input class="forminput" id="smallinput" type="text" name="user_name" /></label> <label>password:<input class="forminput" id="smallin...

java - Is there a shortcut to execute something only if its not null? -

this question has answer here: avoiding != null statements 54 answers i find myself writing statement myobject myobject = something.getthatobject(); if( myobject !=null && myobject .somebooleanfunction()){ } in order prevent null pointer exception. there shortcut in java? i'm thinking myobject..somebooleanfunction() ? in java 8: static <t> boolean notnull(supplier<t> getter, predicate<t> tester) { t x = getter.get(); return x != null && tester.test(x); } if (notnull(something::getthatobject, myobject::somebooleanfunction)) { ... } if style new readers, 1 should keep in mind, full functional programming bit nicer.

html5 - Route Angular to New Controller after Login -

i'm kind of stuck on how route angular app new controller after login. have simple app, uses 'loginservice'... after logging in, routes /home has different template index.html(login page). i want use /home route displays partial views of flightforms controllers. best way configure routes after login, /home default , routes called particular templates view. seems easy keep getting /login page when click on link suppose pass partial view default.html template: var app= angular.module('myapp', ['ngroute']); app.config(['$routeprovider', function($routeprovider) { $routeprovider.when('/login', { templateurl: 'partials/login.html', controller: 'loginctrl' }); $routeprovider.when('/home', { templateurl: 'partials/default.html', controller: 'defaultctrl' }); }]); flightforms.config(['$routeprovider', function($routeprovider){ //sub pages ...

uibutton - iOS Create Button with two separate labels -

i create button 2 independent labels. want set in 1 button, 2 separate texts in different colors. e.g. [mybutton settitle: @"title" forstate: uicontrolstatenormal]; [mybutton settitle2: @"title2" forstate: uicontrolstatenormal]; is possible? maybe should need create new control? can me? grateful tutorial step step. also, can : uibutton *testbutton = [uibutton buttonwithtype:uibuttontypecustom]; testbutton.frame = cgrectmake(0, 0, 200, 40); [self.view addsubview:testbutton]; uilabel *firstlinetestbutton = [[uilabel alloc] initwithframe:cgrectmake(0, 0, 200, 20)]; firstlinetestbutton.text = @"first line"; firstlinetestbutton.font = [uifont systemfontofsize:12]; [testbutton addsubview:firstlinetestbutton]; uilabel *secondlinetestbutton = [[uilabel alloc] initwithframe:cgrectmake(0, 20, 200, 20)]; secondlinetestbutton.text = @"second line"; secondlinetestbutton.font = [uifont boldsystemfontofsize:12]; [testbutton addsubview:s...

sql - Informix cast Date to integer -

hi there way cast date integer 2014/05/29 => 20140509? because database @ work has such value, , need make comparison. searched internet thing found conversion milliseconds since 1970. i haven't used informix in ages, believe looking for. first format date string in format want, cast integer. to_char(mydatefield,'%y%m%d')::integer

response - How to set status code from service layer in Symfony 2? -

i have service helping me validate forms. want set http status code inside of when finds form invalid. is ok so? how do it? thanks! the way (probably there's lot more solutions) throwing (custom) exception in service in case form invalid. then create exception listener listen on kernel exception event. configuration of such listener ( services.yml ) kernel.listener.your_listener: class: acme\your\namespace\yourexceptionlistener tags: - { name: kernel.event_listener, event: kernel.exception, method: onexception } and onexception method in yourexceptionlistener class: public function onexception(getresponseforexceptionevent $event) { $exception = $event->getexception(); if ($exception instanceof yourcustomexceptioninterface) { $response = new response('', 400); $event->setresponse($response); } } this way nicely decoupled stuff, , form validation service independent of response.

java - Spring Hibernate not-null property references a null or transient value: com.klisman.model.Usuario.estadoId -

if try register new user in system getting exception @entity @table(name = "usuario") public class usuario implements serializable { private static final long serialversionuid = 1l; @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "id") private integer id; @column(name = "nome") private string nome; @column(name = "email") private string email; @column(name = "senha") private string senha; @joincolumn(name = "estado_id", referencedcolumnname = "id") @manytoone(optional = false) private estado estadoid; @joincolumn(name = "tipo_id", referencedcolumnname = "id") @manytoone(optional = false) private tipo tipoid; tipo @entity @table(name = "tipo") public class tipo implements serializable { private static final long serialversionuid = 1l; @id @ge...

javascript - Unexpected behaviour of String.fromCodePoint / String#codePointAt (Firefox/ES6) -

since version 29 of firefox, mozilla provides string.fromcodepoint , string#codepointat methods , published polyfills on respective mdn pages. so happens trying out , seems missing important, splitting string "ä☺𠜎" codepoints , reassembling these returns an, @ least me, unexpected result. i've built test case: http://jsfiddle.net/dcodeio/yhwp7/ var str = "ä☺𠜎"; ...split it, reassemble it... am missing something? this not problem of .codepointat , more of char encoding of character 𠜎 . 𠜎 has javascript string length of 2. why? because javascript strings encoded using 2-byte utf-16. 𠜎 ( charcode: 132878 ) greater 2-byte utf-16 ( 0-65535 ). means needs encoded using 4-byte utf-16. utf-16 representation 0xd841 0xdf0e consuming 2 characters in string. when using .charat() see correct values: var string = "𠜎"; console.log( string.charat(0), string.charat(1) ); // logs 55361 57102 (0xd841 0xdf0e) why doesn't displ...

php - is it possible creation of duplicate ip in this code? -

i have popup rotator count unic user's ip per day(no duplicate ip allowed user in same date) $userip = mysql_real_escape_string($_server['remote_addr']); $date = date('y-m-d'); $result = mysql_query("select `ip` `popupip` ip = '$userip' , userid = $secid , date='$date'"); $num = mysql_num_rows($result); if ($num > 0) { // **it duplicate not insert in popupip table** }else{ // **it not duplicate ip insert in popupip table** } above code example.i know full code. but when phpmyadmin popupip table there few duplicate ip user (the exact same ip address user on same date) how possible? extra information: in popupip userid int(11) , date "date type 2014-05-30" , ip varchar. page may opens "as fast possible @ same time" popup pages. there relation between openning page fast @ same time user , duplicate ip creation? there bug in mysql? (maybe big bug!!!!) yes, possible. it...

sql server - SQL Convert time in seconds into a local time zone -

i working on query time stored in seconds. right string have shows following. select schema.table.opendate_seconds, '19700101' open date that gets me sever time open. how can adjust central time? thanks in advance looking , helping.

flask - How can I call a specific function based on url in python web frameworks? -

this question has answer here: eve - define custom flask controllers [closed] 1 answer i have developed python application takes in post variables , inserts data postgresql. want call specific function when call url. for example if curl -i http://127.0.0.1:5000/abc/cde should call def aaa() if curl -i http://127.0.0.1:5000/pqr/xyz should call def bbb() is there way achieve in python flask web frameworks ? this 1 of main features of web framework. minimal example in flask be: # my_app.py flask import flask app = flask(__name__) @app.route('/abc/cde') def aaa(): return 'hello, aaa' @app.route('/pqr/xyz') def bbb(): return 'hello, bbb' if __name__ == '__main__': app.run() you can run this: $ python my_app.py like python script. suggest have @ flask's quickstart page...

overwrite a value inside a file in java -

i create matrix of integers inside file using this,and want overwrite value after creating it,this code: import java.io.file; import java.io.filewriter; public class main { public static void main(string[] args) { file file = new file("foo/file.txt"); filewriter writer = null; try { file.createnewfile(); writer = new filewriter(file); (int = 0; < 5; i++) { (int j = 0; j < 5; j++) { writer.write(string.valueof(0) + " "); } writer.write("\n"); } } catch (exception e) { e.printstacktrace(); } try { (int = 0; < 5; i++) { (int j = 0; j < 5; j++) { if (i == 3) writer.write(string.valueof(1) + " "); } } writer.close(); } catch (exception e) { e.printstacktrace(); } } } any suggestions? thanks. sadly there no way replace 1 value in ...

windows installer - WIX: The following application should be closed before continuing the install -

my application have tray icon. when uninstall have window proposal close "my_tray_app.exe" - text: (" the following application should closed before continuing install ") i'm use wix "closeapplication element (util extension)" close "my_tray_app.exe" win close app how avoid window?? i try play closeapplication attributes - don't have result... oo i'm use wxwidgets , use following method close "trayapp.exe": <util:closeapplication id="closeapp" closemessage="yes" target="trayapp.exe" rebootprompt="no" /> <custom action="wixcloseapplications" before="removefiles" /> but "trayapp.exe" stay on taskmanager , stay on system tray! if try close other tray app (for example "skype.exe") work fine , uninstaller closes "skype.exe" , remove system tray. may must add code project? i try use taskkill.exe - ...

javascript - lineto draws relative to window not canvas -

i'm experimenting using drawing function on canvas , curious see if can suggest solution i'm new ;) my main html pages have couple of canvases set up, in layers can manipulate , erase each without interfering others. have this: <div> <canvas id="mycanvas" width="450" height="450" style="border:1px solid #d3d3d3;"></canvas> <canvas id="layer1" width="450" height="450" style="position: absolute; left:0; top:0; z-index:1;"></canvas> <canvas id="layer2" width="450" height="450" style="position: absolute; left:0; top:0; z-index:2;"></canvas> <canvas id="layer3" width="450" height="450" style="position: absolute; left:0; top:0; z-index:3;"></canvas> <canvas id="layer4" width="450" height="450" style="position: absolute; left:0; ...

c++ - Cannot build avahi4j: avahi4j_Client.c:18:32: fatal error: avahi-common/error.h: No such file or directory -

per title of post i'm trying build avahi4j, run wall after downloading: https://code.google.com/p/avahi4j/downloads/detail?name=avahi4j-0.1.tar.gz&can=2&q= after extracting, , executing ant clean all within avahi4j-0.1 directory, receive following error: ant clean buildfile: /home/myuser/downloads/avahi4j-0.1/build.xml clean: [exec] make: entering directory `/home/myuser/downloads/avahi4j-0.1/src' [exec] rm -f avahi4j_client.o avahi4j_entrygroup.o avahi4j_avahi4jconstants.o thread-watch.o avahi4j_servicebrowser.o avahi4j_serviceresolver.o avahi4j_recordbrowser.o libavahi4j.so ./*~ [exec] make: leaving directory `/home/myuser/downloads/avahi4j-0.1/src' [delete] deleting directory /home/myuser/downloads/avahi4j-0.1/classes init: [mkdir] created dir: /home/myuser/downloads/avahi4j-0.1/classes jnilib: [exec] make: entering directory `/home/myuser/downloads/avahi4j-0.1/src' [exec] gcc -i. -i/usr/lib/jvm/java-6-sun/include -...

android - Galaxy S4 will not display borders in any browser -

i having problems displaying borders in chrome on galaxy s4. .border { width: 49vw; border-width: .25vw; border-style: solid; border-color: black; display: block; } i can't find problems code. know there problems border-radius, however, don't think these 2 things relate. update: learned border show in landscape mode, not in portrait. appreciated! thanks!

asp.net - convert "Thu May 29 2014 12:00:00 GMT-0700" to DateTime -

i'm having problem convert "thu may 29 2014 12:00:00 gmt-0700" datetime error: i'm sending value hidden field in js , code behind keep crashing error "string not recognized valid datetime". dim fromdate string = hfdatefrombylocation.value dim todate string = hfdatetobylocation.value dim retvalfromdate datetime = datetime.parseexact(fromdate, "ddd mmm dd hh:mm:ss kkkk yyyy", cultureinfo.invariantculture) dim retvaltodate datetime = datetime.parseexact(todate, "ddd mmm dd hh:mm:ss kkkk yyyy", cultureinfo.invariantculture) had work out, got work format string , using datetimeoffset.parseexact not datetime "ddd mmm dd yyyy h:mm:ss 'gmt'kkkkk" it's gmt bit doesn't like. wrapped in quotes , need k minus sign.. bit more investigation, can use datetime.parseexact lose time zone offset. datetime correct, in takes offset account, don't know how 'much' of offset. "ddd mmm dd yyyy...

Is there a succinct way in ruby to return the array itself when the array is not empty -

basically i'd check array , set variable if not empty @ same time: in same way can assign variable while checking boolean, i'd able array. e.g : bar = "hello world" if foo = bar.is_a?(string) puts foo end => "hello world" bar = [1,2,3] if foo = !bar.empty? puts foo end => 1 2 3 how about: my_array = array.empty? ? do_something(array) : array

dynamic data for ng-model in angularjs -

html <div ng-controller="main"> <input type="text" ng-model="rootfolders"> </div> js function main($scope) { $scope.rootfolders = '5'; } how dynamically add data in place of "5", i.e rootfolders. example adding count data or variable. were looking @ this? function main($scope) { var folders = ['foldera','folderb']; $scope.rootfolders = folders.length; } you can assign value form scope variable java script variable.

c++ - Why are my slots not called during runtime? -

Image
i'm pretty new qt , try add button (which emits signal on click) during runtime. added slot adding didn't work. testing-purposes i've put printf("hello world"); in code see when method called. strangely "hello world" when close program... testing purposes i've called add-method in main. if click on button nothing happens. remove main don't more... maybe can tell me did wrong? buttoncreator.h qt_begin_namespace class qaction; class qgroupbox; class qpushbutton; class qvboxlayout; class qgridlayout; qt_end_namespace class buttoncreator : public qwidget { q_object public: buttoncreator(); private: void creategridgroupbox(); unsigned int buttoncount; //number of current buttons qvboxlayout *mainlayout; //main window qgroupbox *gridgroupbox; //window buttons qgridlayout *layout; //button-layout qpushbutton* getaddbutton(); public slots: int addbutton(qicon *icon = 0); //add button }; buttoncrea...

c# - jqGrid: Help displaying current search to user. -

i have jqgrid , need able display current search that's being performed on grid. use navgrid give users options filter through what's been pulled , i'd able show users current filters being applied data. have label on page , javascript grabs current queries , displays onsearch: function setcurrentfilters () { var currentfilters = $('#datamanagementgrid').getgridparam("postdata").filters; document.getelementbyid("lblcurrentfilters").innerhtml = currentfilters; } it displays json: {"groupop":"and","rules":[{"field":"isactive","op":"eq","data":"true"},{"field":"lastmodifiedby","op":"cn","data":"cheese"}]} my question is, there better route? or should work json? you can parse json , read field name/value , show in html. idea, not solution though : function setcurrentfilte...

objective c - Setting default values for inherited property without using accessor -

i see people debating whether or not use property's setter in -init method. problem how create default value in subclass inherited property. have class called nslawyer -- framework class, can't change -- interface looks this: @interface nslawyer : nsobject { @private nsuinteger _numberofclients; } @property (nonatomic, assign) nsuinteger numberofclients; @end and implementation looks this: @implementation nslawyer - (instancetype)init { self = [super init]; if (self) { _numberofclients = 0; } return self; } @end now let's want extend nslawyer . subclass called seniorpartner . , since senior partner should have lots of clients, when seniorpartner gets initialized, don't want instance start 0 ; want have 10 . here's seniorpartner.m: @implementation seniorpartner - (instancetype)init { self = [super init]; if (self) { // attempting set ivar directly result in compiler saying, // "insta...

sqlite3 - how to make the inserted data 4 digits in decimal part? -

i have create db sqlite3 e:\\tmp.db and create table. create table test(value decimal(8,4)) when insert data , data contain many digits in decimal part 4. insert test select 89.56/3 ; select * test i got number : 29.853333333333335 ,how can insert 29.8533 test table? according sqlite documentation , decimal(m,n) datatype stored numeric , converted sqlite engine sees fit optimize storage. since inputting floating point value, sqlite storing such, , since floating point values cannot represent values exactly, ending approximation instead. if must store value precision, have 3 options: use round function: insert test select round(89.56/3, 4) , round 4 decimal places. use string datatype. sqlite automatically convert numeric mathematical operations. use integer datatype, , store of values multiplied 10 000, ie. 29.8533 => 298533. can divide again when retrieve value convert proper magnitude.

asp.net mvc 4 - Unit Testing to multiple RedirectToAction -

i'm new in of unit testing, , need code. it's working mvc 4.0 have call database, , don't understand how can start create unit testing if need open connection, hope can me. this code: [httppost] public actionresult add(user user, ienumerable<int> groups) { httpcookie cookie = request.cookies.get(securitymanager.cookiename); if (cookie != null) { if (securitymanager.haspermission(int.parse(cookie.values.get("id")),(int)permissionenum.adduser)) { list<group> gs = new list<group>(); if (groups != null) { foreach (int g in groups) { group gr = groupmanager.getgroup(g); gs.add(gr); } } user.groups = gs; if (usermanager.adduseremployee(user)) { return ...

java - Convert regular date and time to Julian date and vice versa -

i working on program calculate sunrise , sunset times. how convert yyyymmddhhmmss julian date? need date precise. it'll great if there can example such conversions. code julian date: calendar cnow = calendar.getinstance(); calendar cjan1 = calendar.getinstance(); double julianjan1_2014_12_00_00 = 2456659; cjan1.set(2014, 0, 0, 12, 0); date djan1 = cjan1.gettime(); date dnow = cnow.gettime(); long ljan1 = djan1.gettime(); long lnow = dnow.gettime(); double diffday = (lnow - ljan1) / 1000 / 60 / 60 / 24; double juliandate = diffday + julianjan1_2014_12_00_00; code sunrise , sunset (formula wikipedia): calendar cnow = calendar.getinstance(); calendar cjan1 = calendar.getinstance(); double julianjan1_2014_12_00_00 = 2456659; cjan1.set(2014, 0, 0, 12, 0); date djan1 = cjan1.gettime(); date dnow = cnow.gettime(); long ljan1 = djan1.gettime();...

ios - Post on friend's wall from october 2013 onwards -

i developing ios , android app in have give functionality user can post on app's wall account. have found in facebook developers forum functionality has been removed. can please suggest me how achieve same anyhow. please provide link if possible. thanks in advance :) apps don't have 'wall' since february of 2013 or - app can have page, there's nothing special page or how users can write posts on page's timeline via api - it's normal documentation posting /<page>/feed on behalf of app's users