Posts

Showing posts from January, 2010

Android acceleration direction -

after searching while did not find way isolate translation acceleration direction rotation. im looking yo find way acceleration direction independently of how mobile phone rotated (and of course independently of how rotated). basically allow me make difference among acceleration, deceleration , change of direction. i tried compensate acceleration sensor angles ones obtained getorientation experimented getorientation angles (azimut, pitch, , roll) not same when device has translation movement (acceleration). i need 1 of both: acceleration direction no matter how device rotating or orientation values no matter how device being accelerated. is possible? finally found it! after android documentation can rotation matrix (getrotationmatrix) change coordinates system of mobile: rotation matrix r transforms vector device coordinate system world's coordinate system. but in parameters documentation says (and here quiz): gravity -is array of 3 floats containin...

mysql - DBUnit ignores column aliases, when creating dataset from query? -

i have 2 datasets, want compare dbunit: 1 defines xml file, other trying create using query: dbconnection.createquerytable("my_table", "select ..."); select goes on couple of tables, few of them has same column names, using aliases distinguish between them. query runs fine, seems while creating dataset, dbunit ignores column aliases , uses original names instead. seen in debug log: 01.03.13 14:18:43,228 [ debug] abstractdatabaseconnection - createquerytable(resultname=my_table, sql= select `table1`.`name` , `table2`.`label` `table2_label` , `table3`.`label` `table1` , `table2` , `table3` `table1`.`id` = `table2`.`table1_id` , `table2`.`id` = `table3`.`table2_id` ) - start 01.03.13 14:18:43,228 [ debug] databasedatasourceconnection - getconnection() - start 01.03.13 14:18:43,228 [ debug] databaseconfig$configurator - statement fetch size set 100 01.03.13 14:18:43,240 [ d...

mysql - Physical lock on DB rows obtained from a JPA PESSIMISTIC lock -

according jpa 2.1 specification... the lock modes pessimistic_read , pessimistic_write , , pessimistic_force_increment used obtain long-term database locks. i assume pessimistic lock trigger select ... update sql on database, no matter lock-mode used. 3 questions on that: is assumption correct or there exceptions rule, if correct? given select ... update locked rows. locked rows cannot updated other transaction except transaction locked it? the lock can released performing commit or rollback on transaction. happens lock if application (and transaction locked rows) terminates without doing commit or rollback on transaction? for question 1 , 2, assumptions correct: yes - pessimistic lock uses select ... update , databases , jpa implementations support type of lock. in case there no difference between read , write block, , jpa specification allows long both behave write locks. yes - locked rows cannot modified other transaction. in case of write lock ...

c# - VS2015 can't build Windows Phone Silverlight app -

i have old siverlight windows phone 8.1 project tried build today. unfortunately there error: severity code description project file line suppression state error file 'makepri.exe' not found. see http://go.microsoft.com/fwlink/?prd=12560&pver=1.0&plcid=0x409&ar=msdn&sar=platformmultitargeting&o1=windows%20phone&o2=8.1 more information. sleeptracker the code worked before, no idea might cause. i use vs2015 update 1. tried vs2013 without success.. any idea?

angularjs - Encountering strictdi error for a controller where $inject is being used -

i have enabled strict-di on application trying prepare source code minification , working through resolving strictdi errors being thrown. i have following controller thats throwing strictdi error, correctly annotating using $inject (i using john papa style guide too) , cannot figure out going wrong: (function () { 'use strict'; angular .module('app.products') .controller('productspagecontroller', controller); controller.$inject = ['mytoolbarservice']; function controller(mytoolbarservice) { mytoolbarservice.gettoolbar('main').then(function (toolbar) { toolbar.settitle('general_terms.products'); }); } })(); error: [$injector:strictdi] productspagecontroller not using explicit annotation , cannot invoked in strict mode i have controller (below) works in same manner, , when view loads bound, no error thrown , toolbar service setting title: (functio...

javascript - Wrap text in td without breaking the word -

i have issue in word wrapping in css. have td have defined width 300px . have url inside td http://www.abc.com/testing/testdata/testurl/test/testing.html when use word-wrap: break-word , text wrapping http://www.abc.com/testing/testdata/tes turl/test/testing.html but want word break. /tes in 1 line , turl in line. want as, http://www.abc.com/testing/testdata/testurl/ test/testing.html kindly help. appreciated. thanks. updated : i have probability of getting text other url. means can't relay on '/' in data. can use javascript not jquery. i can't think of css-only solution. using javascript add word break opportunity tag <wbr> . tells browser - except internet explorer - can insert breaks: javascript (using jquery) $('#element').html( $('#element').html().replace(/\//g, '/<wbr>') ); demo http://jsfiddle.net/ekfur/ as of edit you edited question while writing fiddle. can of course use chara...

c# - SQL Server and EF Migration from local to remote database -

i'm working on entity framework (ef) project functions supplemental class library project within visual studio 2013 solution. had mock local database on client dev system , build out schema , other utilities there. data adapter i'm using uses sql authentication. once had validated stable build satisfied requirements, incorporated ef project solution. working off of local database, worked fine. re-aimed ef database remote sql server by: updating data adapter remote server successfully testing data adapter's connection updating app.config files in start-up project , ef project correct connection string ran t-sql script generated ef on remote server validated t-sql script worked observing database view , seeing new tables present once finished, re-ran solution. ef threw exception on first call framework: an unhandled exception of type 'system.data.entity.core.entityexception' occurred in entityframework.sqlserver.dll additional informat...

asp.net - Connect AngularJS app with local MS-Access database -

i need connect simple angularjs application local ms access database stored in same folder app. due firewall restrictions, cannot use npm , modules such express. hoping directly connect db using ado , asp.net. i have looked ado due lack of background asp.net & db knowledge, have gotten stuck. take example following code: function addrecord() { var adoconn = new activexobject("adodb.connection"); var adors = new activexobject("adodb.recordset"); adoconn.open("provider=microsoft.jet.oledb.4.0;data source='/\dbname.mdb'"); adors.open("select * tblname", adoconn, 1, 3); adors.addnew; adors.fields("fieldname").value = "quentin"; adors.update; adors.close(); adoconn.close(); } this taken stackoverflow question . have no idea put code, here plunkr existing code. can see, simple app. give me direction do?

AngularJS: How to only show items in json file that have a certain value(s) based on a nested array of a variable -

please note: first angular application apologize if i'm asking wrong or silly question. i'm using ng-repeat list data items present in json file. want able list data (ng-show) necessary different partials of spa. site personal website family recipes. upon button click want able list dessert foods, etc. have working, i'm using multiple json files duplicated data accomplish (dirty data?). goal have 1 json file whole site. here example of 1 variable or "dish" in data set: { "name": "pecan pie", "shortname": "pecan-pie", "type": [ "dessert", "holidaydish" ], "contributor": "mark", "totalt": "1h 5m", "ingredients": "1 cup light brown sugar", "steps": "preheat oven 400 degrees.", }, i'm trying show data based on nested array value: "type" html ...

php - Is there an array-to-callable function? -

Image
setting within someclass there f2member taking 2 integer arguments , producing sum. test passes showing call actualy works , retrieves expected result. calling $g with 2 parameters 1 , 1 returning 2 . important: works php 5.4.11 , upwards compatibility check class someclass extends phpunit_framework_testcase { function f2member($a,$b) { return $a + $b; } /** * @test */ public function test() { $g = array($this,'f2member'); $this->assertequals(2, $g(1,1)); // squiggle line under $g } } problem however, produces warning inside phpstorm on every method invocation , squiggle line under $g : function name must callable - string, closure or class implementing __invoke, array the origin of warning clear me , looking ways avoid these warnings. requirement is, dont want change style of calling function. thing don't want deactivate warning. rather prefer wrap around it, provides necessar...

sql - Require() php error when trying to include files -

hi i'm trying include functions in php script keep getting error i'm struggling figure out. i've gone through permissions , few other things no avail. here's php - code within test few things , don't think not effecting 'require()' call, maybe wrong obviously. #!/usr/bin/env php <?php require(__dir__ . "/../includes/config.php"); if ($argc !=2) { print("please specify file path \n"); return -1; } $file = $argv[1]; print($file); if (!file_exists($file)) { print("error: file " . $file . " doesn't exist\n"); //return -1; } if (is_writable($file)) { $copy = 'copy1.txt'; $handle = file_get_contents($file); file_put_contents($copy, $handle); } else { echo "the file $filename not writable \n"; } end; $test = query("insert `pset8`.`places` ( `id` , `country_code` , `post...

windows runtime - WinRT/XAML Changing an ellipse's fill color upon mouse over -

i'm new winrt/xaml dev. after hours of research on net , many trial , error attempts, still unable understand how use visualstatemanager change fill color of ellipse based on user input on object. following code not work. here code sits today: <ellipse stroke="white" strokethickness="5" width="90" height="90"> <visualstatemanager.visualstategroups> <visualstategroup x:name="commonstates"> <visualstate x:name="normal"/> <visualstate x:name="mouseover"> <storyboard> <coloranimation to="red" storyboard.targetname="ellipse" storyboard.targetproperty="fill.color"/> </storyboard> </visualstate> <visualstategroup.transitions> <visualtransition to="norma...

maven - Running both default and production profile during release -

my build follows: the first normal build (mvn clean install) other profile activated property (mvn clean install -dbuild=prod) the first deploys nexus. second profile deploys production server. how can run both builds during maven release cycle. i separate nexus-deploy out different profile , use multiple target execution: create different profile cater normal build , execute both targets on build server so: mvn clean install -dbuild=prod -pdeploy

html - Can I paste my google analytic code in .css file which is included on every page -

i have signed google analytics, , gave me code paste on every page want track, can paste in .css file have included file in every webpage? so, may expect that google analytic code included on every webpage? your google analytic code interpreted css, , largely discarded browsers. isn't read css, , fun things. you need toss own file (probably .js assuming it's javascript) , include on every page- or if it's widget (html rather js), you'll have insert widget onto each page. and uh... no offense but.... surprised managed give 1 straight-faced answer. css non-executable. microsoft had js in while (ie lte 7 woo) don't believe that's been has done since due being large of attack vector , extremely lagy.

yii2 advanced app - Connecting Frontend to backend when login -

i have code in yii2 advanced template, want make link when log in frontend connecting in backend , when logout backend frontend,how can make that? , comon/config/main.php file <?php return [ 'vendorpath' => dirname(dirname(__dir__)) . '/vendor', 'components' => [ 'cache' => [ 'class' => 'yii\caching\filecache', ], 'urlmanager' => [ //'class' => 'yii\web\urlmanager', 'enableprettyurl' => false, 'showscriptname' => true, 'baseurl' => '/backend/web', ], 'urlmanagerfrontend' => [ 'class' => 'yii\web\urlmanager', 'baseurl' => '/frontend/web', 'enableprettyurl' => false, 'showscriptname' => true, ] ], ]; and sitecontroller in frontend <?php namespace frontend\controllers; use yii; use common\models\log...

powershell v2.0 - Export content from ForEach-Object -

i attempting create powershell command finds , exports owner of each distribution list provided in cvs. [ps] c:\windows\system32>import-csv $path_import | foreach-object {get-qadgroup $_.identity | select managedby,name | export-csv $path_export} currently script output screen information trying capture export last line. any assistance appreciated. try this: import-csv $path_import | foreach-object {get-qadgroup $_.identity | select managedby,name } | export-csv $path_export -notypeinformation

oop - Can't delete object property in php -

i have code: class service { public function get_session($token) { foreach ($this->config->sessions $session) { if ($token == $session->token) { $session->last_access = date('r'); return $session; } } return null; } public function mysql_connect($token, $host, $username, $password, $db) { if (!$this->valid_token($token)) { throw new exception("access denied: invalid token"); } // throw exception if invalid $this->mysql_create_connection($host, $username, $password, $db); $session = $this->get_session($token); $id = uniqid('res_'); if (!isset($session->mysql)) { $session->mysql = new stdclass(); } $mysql = &$session->mysql; $mysql->$id = array( 'host' => $host, 'user' => $username,...

angularjs - Cordova Capture & Camera -

is possible using cordova camera , capture plugin initialise camera on page in 400x400 square rather loading full screen capture? reason being i'm after using front camera on tablet when member of staff clocks in during process takes quick photo of member of staff. is possible cordova camera , capture? if provide quick example or point me in right direction. thanks there great plugin that: cordovacamerapreview cordova plugin allows camera interaction html code. show camera preview popup on top of html. features: •start camera preview html code. •drag preview box. •set camera color effect (android , ios). •send preview box of html content. •set custom position camera preview box. • set custom size preview box. •set custom alpha preview box. •maintain html interactivity.

Unable to bulk create document using nest and elasticsearch Error reading string. "Unexpected token: StartObject. Path 'items[0].create.error'" -

i trying bulk create document exists in elasticsearch. descriptor.create<d>(op => op.document((d)basenotice)); _elasticclient.bulk(descriptor); i have got serializer exception there exception thrown: 'newtonsoft.json.jsonreaderexception' in elasticsearch.net.dll additional information: error reading string. unexpected token: startobject. path 'items[0].create.error', line 1, position 123. the index method works need use create operation descriptor.index<d>(op => op.document((d)basenotice)); may can go through list of bulk , remove ones exist , call create. can use multiget checking existence of docs going create.

jquery - Triggering event when clicked on <li> background, checkbox and label -

hello , know there few same problems around, couldn't find solution answers given on them, im first time posting here. i have simple li , label inside of it <li class="task"> <input type="checkbox" id="task-1" /> <label for="task-1">random text></label> </li> and jquery triggering "done" class is: $(".task").click(function (e) { var cb = $(this).find(":checkbox")[0]; if (e.target != cb) cb.checked = !cb.checked; $(this).toggleclass("done", cb.checked); }); this works fine when clicked on checkbox or on li background, doesn't work when clicked on label. my jquery works when clicked on checkbox , label, not on background is: $(".task input").change(function () { $(this).closest('.task').toggleclass('done', $(this).is(':checked')); }); how can create jquery activate event when clicked on check...

c# - Convert Simpleitk image into BItmap. System.ArgumentException -

i want read dicom image using simpleitk, convert bitmap , display result in picturebox. when i'm trying this, argumentexception thrown. how can solve this? here code: openfiledialog dialog = new openfiledialog(); dialog.title = "open"; dialog.filter = "dicom files (*.dcm;*.dic)|*.dcm;*.dic|all files (*.*)|*.*"; dialog.showdialog(); if (dialog.filename != "") { using (sitk.imagefilereader reader = new sitk.imagefilereader()) { reader.setfilename(dialog.filename); reader.setoutputpixeltype(sitk.pixelidvalueenum.sitkfloat32); sitk.image image = reader.execute(); var castedimage = sitk.simpleitk.cast(image, sitk.pixelidvalueenum.sitkfloat32); var size = castedimage.getsize(); int length = size.aggregate(1, (current, i) => current * (int)i); intptr buffer = castedimage.getbufferasfloat(); // declare array hold bytes of bitmap. ...

windows - Is it possible to set breakpoint condition as "break when called by another thread"? -

i'm investigating issue might caused multithread. data being read thread, i'd see if being read thread. i can set breakpoint , keep pressing f5 , check if breaking in other thread, it's little annoying. possible set breakpoint condition "break when called thread"? you can set filter (see using breakpoints ). filter can set on threadid , example. set filter, right-click breakpoint, select conditions... , , enter threadid!=<thread id aren't interested in> as filter expression. make sure there aren't whitespace characters in expression. otherwise greeted not-so-helpful error message.

python - Sub-dictionary erroneously repeated throughout dictionary? -

i'm trying store in dictionary number of times given letter occurs after given letter. example, dictionary['a']['d'] give me number of times 'd' follows 'a' in short_list . alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'] short_list = ['ford','hello','orange','apple'] # dictionary keep track of how given letter occurs tally = {} in alphabet: tally[a] = 0 # dictionary keep track of how given letter occurs after given letter # e.g. how many times 'd' follow 'a' -- master_dict['a']['d'] master_dict = {} in alphabet: master_dict[a] = tally def precedingletter(letter,word): ...

vb.net - Value of type 'Microsoft.TeamFoundation.VersionControl.Client.VersionControlServer' cannot be converted to 'System.Type -

i'm working on custom tfs build workflow based on code found in 2 blogs: http://www.theringworx.com/blog/?p=494 https://lajak.wordpress.com/2011/08/30/tfs2010-retrieve-associated-workitems-to-changesets-tfs-api/ when implement vb.net code within xaml workflow, i'm getting following errors on build runtime: the build process failed validation. details: validation error: private implementation of activity '1: dynamicactivity' has following validation error: compiler error(s) encountered processing expression "tfsservice". value of type 'microsoft.teamfoundation.versioncontrol.client.versioncontrolserver' cannot converted 'system.type'. validation error: private implementation of activity '1: dynamicactivity' has following validation error: compiler error(s) encountered processing expression "tfs.getservice(of versioncontrolserver)();". end of expression expected. i...

Configure DefaultMethodSecurityExpressionHandler using Spring Security Java Config -

i trying use role hierarchy feature provided spring security in spring boot application , found problems java config. in application, i've globalmethodsecurity enabled in order use @preauthorize annotations. because of that, need in order use role hierarchy support create new instance of defaultmethodsecurityexpressionhandler , set instance of rolehierarchyimpl instance configuration want (the role hierarchy itself). although, if try using websecurityconfigureradapter , configure(httpsecurity http) method, i'm not able because .expressionhandler() expecting securityexpressionhandler<filterinvocation> , defaultmethodsecurityexpressionhandler securityexpressionhandler<methodinvocation> . in order solve problem, found out solution create subclass of globalmethodsecurityconfiguration , override method creating expressionhandler bean it's described in docs globalmethodsecurityconfiguration - spring security docs by saying ...

c# - Serialisation error "The input stream is not a valid binary format" -

i'm writing program needs send data client server on tcp socket. i have following code serialises , desirialises object. public static byte[] serializeobjects(object obj) { using (memorystream ms = new memorystream()) { iformatter bf = new binaryformatter(); bf.serialize(ms, obj); byte[] bytes = ms.toarray(); return bytes; } } public static object deserialiseobject(byte[] bytes) { using (memorystream ms = new memorystream()) { iformatter bf = new binaryformatter(); ms.write(bytes, 0, bytes.length); ms.seek(0, seekorigin.begin); var obj = bf.deserialize(ms); return obj; } } the code sends the serialised data server client. while ((userinput = console.readline()) != null) { byte[] serialisedobject; serialisedobject = serializeobjects(userinput); byte[] ...

asp.net mvc - How to make an existing AngularJS SPA plugable to other projects -

i have angularjs app (myapp) used own asp.net mvc app. angularjs working in app. other mvc apps want add-on (plugin). possible without modifying original angularjs app, , been intrusive other apps? i thought this: distribute myapp.js in-house cdn included bundleconfig.cs other apps add <div data-ng-app="myapp"> in pages of other apps original angularjs can injected. far many unknowns how app configured precise answer module can dependency injected module. for simplicity sake assume have templates needed run app converted javascript strings , use $templatecache() register them , code app in 1 file able inject module theirs , use whatever components have available. all need script tag points @ location app file ... , location server, cdn or local download directory

javascript - SVG changing stroke after page loads -

when page loads javascript sets stroke color. after color set if javascript changes color not re-rendered browser. perhaps doing wrong? when page loads executed $(document).ready(function () { $("#mini-logo").attr('stroke', userselectedcolor); }); later user can change color , stroke needs change. $("#mini-logo").attr('stroke', userselectedcolor); using firebug html has changed, has not been re-rendered.

zsh completion cache security model broken? -

this may bug or misfeature in zsh, don't know , may misunderstanding. compinit (the function initializes completions) runs compaudit enforce security model whereby load completion functions directories in $fpath considered "secure" (owned root or me, not world-writable, etc.). warn user insecure paths , prompt either skip them or abort. that's , good. it creates cache of results @ ~/.zcompdump . afaict, invalidated (i.e., deleted) manually . i'm not entirely clear what's in cache, can't if big security issue. but, @ least, compinit consider cache valid if it's owned different user, thereby avoiding loading completion functions are valid current user weren't previous one. this happening me every time use sudo -s zsh installation owned me (os x homebrew). writes incomplete completion cache. next shell start, loads busted cache , doesn't see completions. is problem? zsh's? homebrews?

jquery - Checking element width with Javascript -

i'm working website did, , i'm having difficulties javascript. i'm trying current width of div, , not what's in css. when resize window, need new div width (resize jquery). i'm using code: if(document.getelementbyid("header").offsetwidth<1270){ alert("cheguei aqui"); } i thought if element width lower 1270, send alert. isn't working. this header div. <div id="header"> <div class="container"> <div class="two columns" id="logo-wrap"> <a href="index.html"> <div id="logo2"></div> </a> <select id="header-mobile-menu"> <option value="index.html">home</option> <option value="quem somos.html">quem somos</option> <option value="consulta.html">consultas</option> ...

mysql - Calculating overall total column for each row in a table with dynamic SQL statement -

Image
i have following tables: and query table show total payment based on location (which has dynamic values) every user + overall total follow: i able breaking locations point, thing not total column, here sql: use fypdb; set @sql = null; select group_concat( distinct concat('sum(case when attendance.location_id=''', attendance.location_id,''' format(position.pay_rate*time_to_sec(timediff(attendance.logout_time, attendance.login_time))/3600, 2) else 0 end) `', location.name,'`') ) @sql attendance join location on attendance.location_id = location.location_id; set @sql = concat('select user.user_name,', @sql, ' sum(format(position.pay_rate*time_to_sec(timediff(attendance.logout_time, attendance.login_time))/3600, 2)) total ', #this problematic attribute 'from attendance join user on attendance.user_id = user.user_id join posit...

html - How to get images I'm uploading to the wordpress menu section to resize? -

i'm adding img tags navigation label field in menus section in order create social media buttons. want them 25px 25px, want them ready retina screens, images i'm uploading 50 50px. the annoying thing is, managed 3 hours ago, since coming it, they're no longer re-sizing , i'm left massive icon. the code using scale them down was: <img src=“url here” height=“25” width=“25”> is there way of fixing this, or easier way achieve i'm trying do? thanks you using stylized quotation marks in code. <img src=“url here” height=“25” width=“25”> this invalid html. did copy , paste code ms word? that's reason. you need unformatted characters, basic text editors provide. keep quotation marks simple , basic: <img src="url here" height="25" width="25"> these ascii quote marks valid html. although quote marks optional in html5 , recommend using them best practice. here reasons why: do quote html5...

php - Monthly loop with missing rows -

i'm trying loop displays count of entries next month link, since count skips row when there no entries in query, count links not work. how work out since cannot simple array loop due missing rows. here i've been trying: query results count month 1 1 63 3 21 4 7 5 3 6 6 7 php // new month count public function new_month_count() { $year = $this->chosen_year(); $main_sql = $this->month_count_sql() . " , year(exp_date) = " . $year . " group month(exp_date) order month(exp_date), month"; $res = $this->conn->query($main_sql); $array = array(); $array[0] = 0; $i = 1; while ($row = $res->fetch_assoc()) { $array[$i] = ($row['month'] == $i ? $row['count'] : 0); $i += 1; } return $array; } // create monthly links public function monthly_links() { $count = $this->new_month_count(); $months = array('','january','february...

java - New Activity Goes to Blank Screen -

i'm pretty new android studio , i'm having difficulty starting new activity. i've triple checked code , can't figure out problem is. i've google searched couple of hours nobody seems have had same problem me. logcat isn't reporting problem, when run app, , click button, app goes blank screen. please help! public class originalfragment extends fragment { @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_original, container, false); return rootview; } } public class mainfragment extends fragment { private alertdialog mdialog; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view rootview = inflater.inflate(r.layout.fragment_main, container, false); //sets button view aboutbutton = rootview.findviewbyid(r.id.about_button); aboutbutton.setonclicklistener(new view...

math - Java - How to check of a point is inside a sliceof a circle -

i have circle drawn, , want make can have more slices four. can 4 quadrants because check if mouse in in circle , inside box. this how checking if point in circle. if( math.sqrt((xx-x)*(xx-x) + (yy-y)*(yy-y)) <= radius) { return true; } else { return false; } how can modify if circle divided more 4 regions? first can check point within circle did. woudln't combine check quadrant (is why have radius/2 ?) if( (xx-x)*(xx-x) + (yy-y)*(yy-y) > radius*radius) return false; now can see region point in using atan2 function. atan2 arctan except arctangent function returns value between -pi/2 , pi/2 (-90 , +90 degrees). need actual angle in polar coordinate fashion. assuming (x,y) center of circle , interested in location of point (xx,yy) have double theta = math.atan2(yy-y,xx-x); //theta in range -math.pi math.pi if(theta<0) theta = math.pi - theta; //now theta in range [0, 2*pi] //use value determine slice of circle point resides...

hadoop - Errors when using Sqoop action in Oozie editor (Hue) -

i trying use sqoop action in oozie editor in hue, can't work. here's have tried far. i put in arguments, instead of command ( http://alvincjin.blogspot.com.au/2014/06/create-sqoop-action-in-oozie-using-hue.html ) further, trying connect teradata, i've placed jdbc jars in hdfs , have added them in files. current workflow looks in editor: sqoop action . the workflow definition is: <workflow-app name="sqoop_test" xmlns="uri:oozie:workflow:0.5"> <start to="sqoop-b20d"/> <kill name="kill"> <message>action failed, error message[${wf:errormessage(wf:lasterrornode())}]</message> </kill> <action name="sqoop-b20d"> <sqoop xmlns="uri:oozie:sqoop-action:0.2"> <job-tracker>${jobtracker}</job-tracker> <name-node>${namenode}</name-node> <configuration> ...

android - My adapter show nullpointer exception even I can get text -

this question has answer here: what nullpointerexception, , how fix it? 12 answers here adapter: public class placeadapter extends baseadapter { private context mcontext; private arraylist<place> mplaceslist; private listitemclicklistener mclicklistener; public placeadapter(context mcontext, arraylist<place> mcategorylist) { this.mcontext = mcontext; this.mplaceslist = mcategorylist; // todo auto-generated constructor stub } @override public int getcount() { // todo auto-generated method stub return mplaceslist.size(); } @override public object getitem(int position) { // todo auto-generated method stub return mplaceslist.get(position); } @override public long getitemid(int position) { // todo auto-generated method stub return ...