Posts

Showing posts from April, 2010

android - How to control indeterminante ProgressBar which is not part of a ListView? -

android - How to control indeterminante ProgressBar which is not part of a ListView? - there , indeterminate progressbar rotates until listview content ready shown. both progressbar , listview part of same fragment . so coded progressbar made visisble , gone asynctask fetches content. mprogressbar = (progressbar) view.findviewbyid(r.id.progressbar); mprogressbar.getindeterminatedrawable() .setcolorfilter(getresources().getcolor(r.color.pink), porterduff.mode.multiply); new myasynctask().execute(); //then in asynctask private class myasynctask extends asynctask<void, integer, myadapter> { @override protected void onpreexecute() { mprogressbar.setvisibility(view.visible); } @override protected myadapter doinbackground(void... params) { //do stuff , homecoming loaded adapter homecoming adapter; } @override protected void onpostexecute(myadapter adapter) { mprogressbar.setvisibility(vie

javascript - Output file PDF with Jquery -

javascript - Output file PDF with Jquery - i need help or advice output file pdf jquery . have problem output file because pdf file don't out . script jquery , html: <script> $("#msg").hide(); $("button").click(function() { var subject = $("#subject").val(); var client = $("#client").val(); $.ajax ({ url: "http://localhost/report/fpdf_report.php", type: "post", data: { subject: subject, client: client }, success: function(data) { $("#msg").html(data); $("#msg").fadein("slow").delay(2000); }, error: function(xhr) { alert(xhr+"error"); } }); }); </script> <input type="text" id="subject" /> <input type="text" id="client" /> <input type="text" id="client" /> <button>pdf</b

String processing in Maxima -

String processing in Maxima - i new maxima. i've read of manual , 1 didn't find using function on how identify if variable nowadays in string or not. note: create function ables me mimic function augcoefmatrix() of maxima. i don't know you're trying do, string operations on stringified expressions wrong way go it. what, exactly, goal here? string maxima

mysql - Understanding Distribution -

mysql - Understanding Distribution - i have couple of questions. i know if need worry distribution in netezza while using select statements(not creating tables). trying create dataset in sas connecting netezza , selecting view has couple of joins. wondering how impact performance of netezza if creating table straight in sas. i creating table joining 2 tables on customer_id. however, output dataset not consist of customer_id column. can distribute table on customer_id? thanks. for first question, typically don't need worry distribution if aren't creating table. help understand distribution methods tables selecting from, it's not requirement. having distribution method supports particular joins doing can help performance during select (e.g. if bring together columns superset of distribution columns you'll co-located joins), if target of output sas, there's no effect on write of dataset sas. for sec question, table distributed either on colum

javascript - ExtJs 4 MultiSelect Edit Form doesn't load selections -

javascript - ExtJs 4 MultiSelect Edit Form doesn't load selections - i need help combo box multiple select in extjs 4. i need in forms simple manytomany relation splitted central table: user -< user_group >- group. where: user: id, name, year user_group: user_id, group_id group: id, name i have no problem in creation form of user , can save databse php groups i've associated combobox. now, have grid users, , when seek start edit 1 of them, selections of combobox not loaded, combobox's field show ids of corrected selections. for example: when seek edit user (json code) { "id": 86, "name": "tempname", "year": 1492, "groups_id": [1,2,3] } the edit form filled info , field of combobox shows 1,2,3 , nothing selected in dropdown menu. this combobox: { xtype: 'combobox', multiselect: true, name: 'groups_id', fieldlabel: 'group/s',

db2 luw - DB2 - Determine a future date based on two fields -

db2 luw - DB2 - Determine a future date based on two fields - i need calculate date in db2 unix. i have date field: contract_dt (examples: 2/7/2006, 8/25/2006, 11/16/2007, 2/25/2008, 12/29/2005) and type field prime (examples: c, i, e, z, v, k) i need calculate next date loan reviewed (review_dt). if prime = z every year contract_dt if prime = v every 3 years contract_dt if prime = k every 5 years contract_dt if prime = null or other letter, null an illustration loan 01 has contract_dt of 3/1/2004, , has prime of v. need count by/add 3 years 3/1/2004, until date greater mthly_close_dt. (options 2007, 2010, 2013, 2016, 2019,2022). right reply 3/1/2016. i realize construction case statement, have no thought how pick date based on year multiples , find 1 greater mnthly_close_dt. here's have far: create procedure "finance"."al_loop_test"(out r_rvdt date) begin atomic declare v_tmgi date; declare v_ctdt d

c# - How to skip wpf validation when the model is initialized? -

c# - How to skip wpf validation when the model is initialized? - i'm trying create wpf error validation textbox. looks pretty simple after days , trying many methods i'm still trying figure out proper way this. here code (this not real code, example): the textbox <textbox text="{binding model.name , updatesourcetrigger=propertychanged, validatesonexceptions=true}" style="{staticresource nametextboxstyle}" /> the style <style x:uid="style_81" x:key="nametextboxstyle}" targettype="{x:type textbox}"> <style.triggers> <trigger property="validation.haserror" value="true"> <trigger.setters> <setter property="tooltip" value="{binding relativesource={relativesource self},path= (validation.errors)[0].errorcontent}"/> </trigger.setters> </trigger> </style.trig

python - how do i create a two list from a list inside of an array? -

python - how do i create a two list from a list inside of an array? - so have next code: thing = [ ['promotion not applied', 'buy1, 1 for $4.50', '(', 'details', ')'], [], ['promotions applied:', 'buy 1, 1 $4.50', '(', 'details', ')'] ] so loops through list , want create 2 new lists promo_applied , promo_not applied: so homecoming be: promo_applied=["promotions applied", 'buy1, 1 for $4.50'] promo_not_applied = ["promotion not applied", 'buy1, 1 for $4.50'] thing = [ ['promotion not applied', 'buy1, 1 for $4.50', '(', 'details', ')'], [], ['promotions applied:', 'buy 1, 1 $4.50', '(', 'details', ')'] ] promo_applied, _, promo_not_applied = map(lambda s:s[:2], thing) python

c++ - Converting 4 raw bytes into 32-bit floating point -

c++ - Converting 4 raw bytes into 32-bit floating point - i'm trying re-construct 32-bit floating point value eeprom. the 4 bytes in eeprom memory (0-4) : b4 a2 91 4d and pc (vs studio) reconstructs correctly 3.054199 * 10^8 (the floating point value know should there) now i'm moving eeprom read 8-bit arduino, not sure if it's compiler/platform thing, when seek reading 4 bytes 32-bit dword, , typecast float, value isn't close. assuming conversion can't done automatically standard ansi-c compiler, how can 4 bytes manually parsed float? the safest way, , due compiler optimization fast other, utilize memcpy : uint32_t dword = 0x4d91a2b4; float f; memcpy(&f, &dw, 4); demo: http://ideone.com/ridffw c++ c floating-point floating-point-conversion

jquery - Get the classname of closest element matching specific criteria and apply to another element -

jquery - Get the classname of closest element matching specific criteria and apply to another element - ok, tricky one, , i'm in on head. can hack up, i'm trying avoid that. here visual reference of i'm trying accomplish: http://bit.ly/1vxum6i if click on "user administration" link in left nav, you'll see content alter in center area, , tab name , icon alter downwards below. when click link, grabs class of link , applies tab, changes it's icon. works great. need work if click sub-link. example, if click "subscribers" in "user administration" category, should little people icon in tab. here's current script: $(document).on( 'click', 'nav a', function( event ) { event.preventdefault(); $("nav a").removeclass("active"); $(this).addclass("active"); $('#nav-tabs .ui-tabs-panel:visible').load(this.href); $("#nav-tabs .ui-tabs-active a").text(this.text); $(&

asp.net mvc - Getting WebGrease exception while starting application -

asp.net mvc - Getting WebGrease exception while starting application - i getting system.web.razor version conflict exceptions after installed dotnetopenauth. so, reverted packages , uninstalled dotnetopenauth now. getting below exception since long time - could not load file or assembly 'webgrease, version=1.5.1.25624, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. located assembly's manifest definition not match assembly reference. (exception hresult: 0x80131040) why happening? , how resolve this? did tried re installing microsoft.aspnet.web.optimization through bundle manager console? should resolve dependencies. asp.net-mvc asp.net-mvc-4

web audio - How to fix changing sample rate bug -

web audio - How to fix changing sample rate bug - in app after play video, default sample rate changed , sound becomes chip-munk level. this answer shows clear problem: // play video sound encoded @ 44100 hz video.play(); // console log 44100 var ctx = new webkitaudiocontext(); console.log(ctx.samplerate); // play video sound encoded @ 48000 hz video2.play(); // console log 48000 var ctx = new webkitaudiocontext(); console.log(ctx.samplerate); i check in code when sample rate changed before sound starts cannot alter it. this sugests cannot that. refreshing whole page not alternative me. so there way play sound after video? edit: so i've encoded videos , sound same sample rate(44100). however, when app starts on ipad first video plays 24000 sample rate! although works fine, sound starts distorted. web-audio

javascript - Trouble adding Slick Carasel from kenwheeler to Foundation template -

javascript - Trouble adding Slick Carasel from kenwheeler to Foundation template - i having problem adding slick carousel foundation template. followed instructions here: http://kenwheeler.github.io/slick/ , read answeres question here: problems using kenwheeler slick carousel, , made requested changes. but, carousel still not working. i set slick folder referenced in local folder. here html: <!doctype html> <html class="no-js" lang="en"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>**** | welcome</title> <link rel="stylesheet" href="css/normalize.css" /> <link rel="stylesheet" href="css/foundation.css" /> <script src="js/vendor/modernizr.js"></script> <!--slick css--> <link rel="stylesh

php - how to use rewirecond for exclusion a special page from rewrite rule in htaccess file? -

php - how to use rewirecond for exclusion a special page from rewrite rule in htaccess file? - i utilize below rule in mvc project redirecting index.php : rewriterule ^(.*)$ index.php?url=$1 [qsa,l] but want exclude pages rule, how can this? for illustration don't want below page redirect: http://www.my_domian/public/checkeditor/kcfinder/browse.php?opener=ckeditor&type=images&ckeditor=des&ckeditorfuncnum=1&langcode=fa you can add together negative status before rewriterule : directoryindex index.php rewriteengine on rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewritecond %{the_request} !/public/checkeditor/kcfinder/browse\.php\?opener=ckeditor&type=images&ckeditor=des&ckeditorfuncnum=1&langcode=fa [nc] rewriterule ^(.+)$ index.php?url=$1 [qsa,l] also have added 2 conditions avoid routing real files , directories. php .htaccess mod-rewrite

ios7 - Check ios versions then call functions of uiviewcontroller accordingly -

ios7 - Check ios versions then call functions of uiviewcontroller accordingly - i stuck orientation issue in ipad versions. app designed in such way supports ios 6 till ios 8. according apple since willanimaterotationtointerfaceorientation: deprecated ios8, used viewwilltransitiontosize: ios8. when nail issue, first solution providing macros decide version either ios 8 or below , perform functions accordingly. #ifdef __iphone_8_0 // works on >= version 8.0 - (void)viewwilltransitiontosize:(cgsize)size withtransitioncoordinator:(id<uiviewcontrollertransitioncoordinator>)coordinator { [super viewwilltransitiontosize:size withtransitioncoordinator:coordinator]; // code go here ios 8 } #else // works on < version 8.0 - (void)willanimaterotationtointerfaceorientation:(uiinterfaceorientation)interfaceorientation duration:(nstimeinterval)duration { // code go here when version below 8.0 } #endif i checked , run it.. received output expected. but sa

math - Why using powers of 2 as the hash size makes a hash table considerably worse than using primes? -

math - Why using powers of 2 as the hash size makes a hash table considerably worse than using primes? - i'm implementing hash table supposed store pairs of 32-bit values. considering elements fixed size, i'm using simple hashing function: hash(a,b) = asuint64(a) + (asuint64(b) << 32) with that, index of element in hash table (that is, corresponding bucket) with: index(a,b) = hash(a,b) % hash_size where hash_size number of entries/buckets on table. i've realized, though, speed implementation little bit if replaced "modulus" operator bitwise mod of 2 , fixing hash_size powerfulness of 2. except, when that, of pairs end on first bucket! why happening? my guess info not evenly distributed in a . consider concatenation of a , b hash code: b31b30...b1b0a31a30...a1a0, ai, bi ith bit of a,b suppose have table 1000000 entries, hash index a9a8...a1a0 (as integer) worse, suppose a ever ranges 1 100. have less dependence on hig

list - How do I choose data structures in F#? -

list - How do I choose data structures in F#? - i have csv file has 10000000 rows ,the structures this: date , code , ret 2001-01-01,000001,0.1 2001-01-01,000002,0.01 2001-01-02,000001,0.05 2001-01-02,000002,0.02 the fields "date" , "code" 1 key. want subset file quickly, subset(code='000001') date , code , ret 2001-01-01,000001,0.1 2001-01-02,000001,0.05 or subset(date='2001-01-01') date , code , ret 2001-01-01,000001,0.1 2001-01-01,000002,0.01 how should take right info structures works efficiently? take @ csvtypeprovider f# info project: https://fsharp.github.io/fsharp.data/library/csvprovider.html you utilize base of operations info construction parse info more optimized info construction quick access @marcinjuraszek describes. list f# deedle

java - Rewriting the whole String Class methods -

java - Rewriting the whole String Class methods - my professor have given me challenging homework, thought rewrite methods in string classes without using string, stringbuilder, , wrapper classes. intro java class. have methods done having hard time other ones. main class no creation of string inside. what have: "data" char[] info "myownstring" object. compareto method: public int compareto(myownstring rhs){ if (this.data == rhs.data){ homecoming 0; } else if (this.data > rhs.data){ homecoming 1; } else { homecoming -1; } } this 1 shows error. guess rhs needs declare before beingness able compare string beingness assigned myownstring object. since there compareto method , comparetoignorecase, have add together line ignore comparsion? update: this code went compareto method creating own method using length of array. public int compareto(myownstring cts){ int word1 = data.length;

c# - WPF collection binding - Item with same key has already been added -

c# - WPF collection binding - Item with same key has already been added - i'm trying bind listbox collection of system.windows.points, textbox bound property of listbox selected item. displaying info works fine. listbox populated , desired property of selected bound item displayed in textbox. the problem when seek edit value via textbox. alter not made item in listbox, , modified property remains in textbox after select item in listbox. if reselect listbox item attempted modify argumentexception thrown "an item same key has been added". <listbox x:name="pointlist" horizontalalignment="left" height="74" itemssource="{binding mypointlist, mode=twoway}" issynchronizedwithcurrentitem="true" /> <textbox horizontalalignment="left" height="23" text="{binding selecteditem.x, elementname=pointlist, mode=twoway}"/> and in viewmodel.. i've tried i

Firebase Android Development, Update ListView -

Firebase Android Development, Update ListView - first off, i'm sorry if has been asked before. so partner , creating firebase linked app android. firebase looks this: + projects + <some project> +name: <name> +users +<a user> +<another user> + <another project> + users + <some user> + <another user> the problem in our app, user logins firebase, found in users child, , there listview populated projects part of (i.e. projects' users contains user logging in.) the login works fine, , listview works fine when hard code in projects, when have find projects, displays empty list, because info isn't returned before listview created. here code have far: our login activity code: public class loginactivity extends activity implements loadercallbacks<cursor> { /** * maintain track of login task ensure can cancel if requested. */ // private userlogintask mauthtask = null; priva

asp.net mvc - The correct way of showing data as HTML -

asp.net mvc - The correct way of showing data as HTML - i've used asp.net mvc5 in project. want show info recorded in database part of html page. simplest info in database recorded, have <div>this div.</div> and in cshtml file have <div> @html.displayfor(m => m.description) </div> but info not show html tag. how can explain browser info must interpreted html tag? use @html.raw instead of @html.displayfor . most of html helper functions in razor automatically encode values help prevent cross-site scripting attacks. if you're going render raw html user's browser hope you've sanitized prevent attacks. html asp.net-mvc razor asp.net-mvc-5

pyephem - Py Ephem Forumula for Local Sidereal Time for an Observer -

pyephem - Py Ephem Forumula for Local Sidereal Time for an Observer - i trying calculate uncertainty in calculation of local sidereal time using pyephem, when have many observation points longitudes , timestamps uncertainty. what forumula observer.sidereal_time() use? or in .c file in libastro-3.7.5 lst calculation found? thanks the sidereal_time() calculation calls now_lst() can find here: https://github.com/brandon-rhodes/pyephem/blob/master/libastro-3.7.6/misc.c#l162 it calls few other functions, of should described either straight in misc.c or in 1 of nearby .c files there in same directory. pyephem

android - Pass data efficiently across JNI as well as renderscript -

android - Pass data efficiently across JNI as well as renderscript - i intend read yuv frames jni level, process them in renderscript , render them. curious if there efficient way pass blocks of info without many re-create ops. right now, using newdirectbytebuffer() homecoming frames java bytebuffer . seems can't straight build allocation upon bytebuffer . so question can in 2 re-create operations or less? copy info allocation copy info surfaceview (i suppose there re-create operation @ rendering part, canvas.setbitmapy(bmp) ) android jni renderscript

google api php client - Gmail API - Users.labels get with a date range specified -

google api php client - Gmail API - Users.labels get with a date range specified - i've got gmail service running via php api: $client = new google_client(); $client->setclientid('{{client_id}}.apps.googleusercontent.com'); $client->setredirecturi('{{redirect_url}}'); $client->setclientsecret('{{client_secret}'); $client->setscopes(array('https://www.googleapis.com/auth/gmail.modify')); $client->setaccesstoken($credentials); i fetch (get - https://developers.google.com/gmail/api/v1/reference/users/labels/get) labels matching id: $service = new google_service_gmail($client); $labels = $service->users_labels->get("{{email}}", $gmail_label_id); which works perfectly. how can specify parameter get threads between date range? looking @ apis explorer see ability specify: userid id fields none of appropriate i'm trying do. i've looked @ google_service_gmail_userslabels_resource class, get meth

windows - Git mergetool with Perforce -

windows - Git mergetool with Perforce - i using perforce resolve file conflicts in git. set up, ran git config --global mergetool.p4merge.cmd 'p4merge.exe \"$base\" \"$local\" \"$remote\" \"$merged\"' git config --global merge.tool p4merge p4merge available in path. when run git mergetool after conflicts have arisen, p4merge issues next error message: errors: "./myfile.base.7132.example" invalid file "./myfile.local.7132.example" invalid file "./myfile.remote.7132.example" invalid file "myfile.example invalid file it not taking finish path of files c:\users\abc\project\path\myfile.example seems think in root directory. i working on windows. how can create perforce take right paths of files? windows git merge perforce

php - Include db entry in session data when logging user in (CodeIgniter) -

php - Include db entry in session data when logging user in (CodeIgniter) - what i'd on validating ci user, when setting session data, pull info field set in db. at moment have within controller; function validate() { $query = $this->model_auth->validate(); if ($query) // if user's credentials validated { $data = array( 'username' => $this->input->post('username'), 'is_logged_in' => true ); $this->session->set_userdata($data); redirect('dashboard/'); } else { $data['error'] = 'invalid user id , password combination'; $this->load->view('view_login',$data); } } and model function validate() { $this->db->where('username', $this->input->post('username')); $this->db->where('passwor

MySQL Database Using ASP.NET -

MySQL Database Using ASP.NET - i have website project developed in asp.net , using mysql database. i want develop page take info , image , store info in database. the same info should available on different webpage database. page contains layout picturebox , textboxes. want retrieve info mysql database , set specific location e.g. imagoe picturebox , info textboxes. i have managed finish insertion database stucked @ retrieval in info binding specific controls. please help illustration or refer me articles so. thanks in advance. mysql asp.net content-management-system

c# - Comparing Multivariable Boolean Functions -

c# - Comparing Multivariable Boolean Functions - an application i'm writing involved parsing plaintext boolean lambda expressions. for purposes of testing, need create sure parsing occurring correctly. so, wrote recursive look tree comparing routine, bool expressioncomparison.equvalentto(this look self, look other) . if self , other both logical operators, , share same set of operands, equvalentto should homecoming true. my current algorithm uses expressionvisitor . pass body of lambda look visitor , replaces operands (expressions aren't logical operators) boolean parameters. phone call on both lambdas, compare operands, reorder binary parameters sec lambda, if necessary, correspond same operands, compile 2 binary functions, , exhaustively compare results. is there more efficient way compare logical equivalence of 2 boolean functions? public static class expressioncomparison { public static bool equals(this look left, look right) { hom

java - Retrofit error handling -

java - Retrofit error handling - i wrapped retrofit code in class below. if it's not clear code i'm posting it's interacting restful service oauth. what way error handling? rest server returns error message in json format. deed on message throwing exceptions class. i'm trying below. design? mixing callbacks , exception throwing idea? there improve way? with approach below i18l messages within custom exceptions , toast them user. public class restclient implements irestclient { private irestapi api; /** * * @param accesstoken */ public restclient(final string accesstoken) { requestinterceptor requestinterceptor = new requestinterceptor() { @override public void intercept(requestfacade request) { request.addheader("authorization", "bearer " + accesstoken); } }; restadapter restadapter = new restadapter.builder()

html - How to make possible vertical scroll on popup and disable vertical scroll for page by using CSS? -

html - How to make possible vertical scroll on popup and disable vertical scroll for page by using CSS? - i'm developing responsive web site little devices. need show popup (pure div) , create possible vertical scroll due big content. instead scrolling popup main page scrolled. my question how disable main page scroll , scroll popup? you can set height of .popup , set overflow auto .popup{ height:50px; overflow:auto; } now, if popup has big contents doesn't fit in 50 pixels height , you'll scroll on it, contents in popup scrolled instead of whole document contents. html css

ios - UIviewcontroller - what time is the view property instantiated? -

ios - UIviewcontroller - what time is the view property instantiated? - i'm wondering time exactely created .view property of uiviewcontroller. i created viewcontroller, , in init(coder: adecoder) started set few variables. when tried set viewcontroller.view.backgroundcolor crashed. placed same line of code within viewdidload , worked. this code class webviewcontroller: uiviewcontroller { override func viewdidload() { super.viewdidload() println("didload") self.view.backgroundcolor = uicolor.redcolor() } required init(coder adecoder: nscoder) { println("init coder") super.init(coder: adecoder) self.tabbaritem.title = nil //self.view.backgroundcolor = uicolor.redcolor() // cause crash } } this error : terminating app due uncaught exception 'nsinternalinconsistencyexception', reason: 'could not load nib in bundle: 'nsbundle </users/mari/library/develope

git - Can't run a python file in Jenkins execute shell -

git - Can't run a python file in Jenkins execute shell - i found problem running python file in jenkins execute shell, run in ubuntu terminal. please tell me problem is? give thanks you! when seek in execute shell box: cd /home/anna/workspace/gitinspector/gitinspector gitinspector --format=html /home/anna/workspace/parser > /home/anna/workspace/report08.html it tells me gitinspector not found. when seek in execute shell box: cd /home/anna/workspace/gitinspector/gitinspector python gitinspector.py --format=html /home/anna/workspace/parser > /home/anna/workspace/report08.html it tells me there errors within gitinspector.py file. thank you! use absolute path when running python or other programme through jenkins or need set environment variable path . so, can run next command desired result: <location of python>/python <location of gitinspector>/gitinspector.py --format=html /home/anna/workspace/parser > /home/anna/works

How to configure MQTT-SN topic IDs in RSMB -

How to configure MQTT-SN topic IDs in RSMB - my question regarding configuration of rsmb using mqtt topic names , mqtt-sn topic ids on mqtt-sn gateway. using "getting started little message broker" info useful figure out how configure topic name mapping in case of connecting 2 little message brokers together. regarding mqtt-sn specification v1.2 in section "6.10 gateway's publish procedure", gateway (in case gateway included in rsmb, using broker_mqtts implementation) may send register message inform client topic name , assigned topic id value. now, configure mapping of mqtt topic names pre-defined mqtt-sn topic ids. is possible configure mapping in rsmb broker.cfg configuration tell mqtt-sn client pre-defined topic id after successful connection rsmb? unfortunately no. rsmb not back upwards predefined topics @ moment. can register topics client side. or can subscribe on real topics. i found rsmb near production ready. can experiment it

c# - Get updated polygon points after transformation -

c# - Get updated polygon points after transformation - i need retrieve new points coordinates of polygon(inside canvas) after rotatetransform. rotatetransform rotation = new rotatetransform(rotationangle); polygon.rendertransform = rotation; as rendertransform applied, polygon.points collection doesn't new values. i've read people trying bind pointcollection (that not observablecollection ), didn't find useful. you may transformed points sequentially applying transform points in polygon's points collection: using system.linq; var transformedpoints = polygon.points.select(p => rotation.transform(p)); c# wpf transform polygon shapes

python - Looping at a constant rate with high precision for signal sampling -

python - Looping at a constant rate with high precision for signal sampling - i trying sample signal @ 10khz in python. there no problem when seek run code(at 1khz): import sched, time = 0 def f(): # sampling function s.enter(0.001, 1, f, ()) global += 1 if == 1000: = 0 print "one second" s = sched.scheduler(time.time, time.sleep) s.enter(0.001, 1, f, ()) s.run() when seek create time less, starts exceed 1 second(in computer, 1.66s @ 10e-6). it possible run sampling function @ specific frequency in python? you didn't business relationship code's overhead. each iteration, error adds , skews "clock". i'd suggest utilize loop time.sleep() instead (see comments http://stackoverflow.com/a/14813874/648265) , count time sleep next reference moment inevitable error doesn't add together up: period=0.001 t=time.time() while true: t+=period <...> time.sleep(max(0,t-time.time()))

How to know if a message sended from Android wear is received from Android handheld? -

How to know if a message sended from Android wear is received from Android handheld? - here code, don't understand why success status message in not received handheld because handheld app off... how can know if message sended , recived on handheld? for (node node : nodes.getnodes()) { messageapi.sendmessageresult result = wearable.messageapi .sendmessage(mgoogleappiclient, node.getid(), start_activity_path, canalebyte) .await(); if (!result.getstatus().issuccess()) { homecoming false; } else { homecoming true; } } your app doesn't need "on" receive message, installed. if want see if message received, add together wearablelistener on handheld , add together specific behaviour overriding onmessagereceived() method. more infos here : https://developer.android.com/training/wearables/data-layer/messages.html , here : https://devel

xcode - AppCode targeted device families not valid (iPad iOS 8.1) -

xcode - AppCode targeted device families not valid (iPad iOS 8.1) - i maintain getting error in appcode, runs fine xcode: error:xcodebuild: error: run destination ipad mini not valid running scheme 'appname'. error:ipad mini doesn't match of appname.app's targeted device families. can expand appname.app's targeted device families back upwards ipad mini. error:build failed 2 errors , 0 warnings in 7 sec note:building 2 architectures. double click set 'only_active_arch=yes' speed compilation. target sdk 7.1 in appcode 3.0.6 (xcode 6.1) targeted_device_family = 2 (ipad) valid_archs = armv7 armv7s i386 arm64 architectures = standard architectures (armv7, arm64) i have problem both ipad mini ios 8.1 , ipad 4 ios 7.1. any thought why not work appcode? i had well: xcode builds fine, appcode not. there no evident reason - target etc looks fine. seems bug in appcode 3.0.6 seems fixed in 3.1 eap version. 3.1 project builds fine he

How can i add items to java text file through GUI combo box(netbeans) -

How can i add items to java text file through GUI combo box(netbeans) - i have defined items in combo box within gui. happens im trying add together entry programme text file , says: incompatible types int cannot converted string. having problems setlocation , setskills . private void buttonaddactionperformed(java.awt.event.actionevent evt) { resort p = new resort(); p.setname(nametextfield.gettext().replaceall("[^a-z.]", "")); p.setlocation(comboresortlocation.getselectedindex()); p.setskillsbyindex(comboresortskill.getselectedindex()); txtfile.addresort(p); addedconfirm confirmed = new addedconfirm(); confirmed.setvisible(true); this.setvisible(false); } and part of code other file. public void setskillsbyindex (string skills) { this.skills = skills; } got fixed already. had alter them strings , utilize getsel

r - How to find the sd of two columns of matrix? -

r - How to find the sd of two columns of matrix? - if have matrix contains 6 variable,if want find sd of (col1 , col1), (col1 , col2), (col1 , col6),......(col6 , col6), , homecoming 6*6 matrix. function should use? (sd: standard deviation) thanks much. first, create sample info set.seed(1) m <- replicate(6, rnorm(5)) # create matrix 6 columns you can utilize expand.grid possible combinations, loop through combinations using apply . finally, wrap result in matrix matrix(apply(expand.grid(1:6, 1:6), 1, function(x) sd(m[, x])), ncol=6) # [,1] [,2] [,3] [,4] [,5] [,6] # [1,] 0.9060766593 0.7805859575 1.187979366 0.7326776974 1.0258159472 0.8334359580 # [2,] 0.7805859575 0.6305829418 1.095413861 0.5692800481 0.9169484342 0.6960691132 # [3,] 1.1879793664 1.0954138606 1.413152368 1.0695148355 1.2806974048 1.1228262280 # [4,] 0.7326776974 0.5692800481 1.069514836 0.4382343292 0.8814506207 0.7057912762 # [5,]

Is it possible to be redirect to specific url instead of canvas after accepting the facebook App request -

Is it possible to be redirect to specific url instead of canvas after accepting the facebook App request - i using js sdk, when send friend app request , take request ,and canvas app open. possible redirect other page instead of canvas. please help. facebook facebook-graph-api facebook-apps facebook-canvas

c# - DotNetZip fails with "stream does not support seek operations" -

c# - DotNetZip fails with "stream does not support seek operations" - i using dotnetzip in c# unzip stream follows: public static void unzipfromstream(stream stream, string outdir) { //omit seek grab block using (zipfile zip = zipfile.read(stream)){ foreach (zipentry e in zip){ e.extract(outdir, extractexistingfileaction.overwritesilently); } } } stream obtained using webclient client = new webclient(); stream fs = client.openread(url); however, got next exception exception during extracting zip stream system.notsupportedexception: stream not back upwards seek operations. @ system.net.connectstream.get_position() @ ionic.zip.zipfile.read(stream zipstream, textwriter statusmessagewriter, encoding encoding, eventhandler`1 readprogress) on server side(asp.net mvc 4), returning filepathresult or filestreamresult both caused exception. should obtain stream differently on client side? or how create server homec

python - How to prevent overlap of cells in ipython notebook -

python - How to prevent overlap of cells in ipython notebook - i've been working on locally hosted notebook while no problems. however, re-opened notebook , found of cells overlapping, shown in image below: if move cells , downwards 1 time again seem re-align correctly. alter can think of may have caused updated anaconda package. of output console appears normal me. 2014-10-10 08:22:45.531 [notebookapp] using existing profile dir: u'/users/uname/.ipython/profile_default' 2014-10-10 08:22:45.535 [notebookapp] using mathjax cdn: https://cdn.mathjax.org/mathjax/latest/mathjax.js 2014-10-10 08:22:45.726 [notebookapp] serving notebooks local directory: /users/uname/cwd 2014-10-10 08:22:45.727 [notebookapp] 0 active kernels 2014-10-10 08:22:45.727 [notebookapp] ipython notebook running at: http://localhost:8888/ 2014-10-10 08:22:45.727 [notebookapp] utilize control-c stop server , shut downwards kernels (twice skip confirmation). 2014-10-10 08:23:00.197 [notebo

computer vision - Not sure what this 'histogram code' is doing in MATLAB -

computer vision - Not sure what this 'histogram code' is doing in MATLAB - i have next code given me, not sure @ logic here is. idea, believe, histogram/quantize data. here code: the input: x = 180.*rand(1,1000); %1000 points 0 180 degrees. binwidth = 20; %i want binwidth 20 degrees. the main function: % ------------------------------------------------------------------------- % compute closest bin center x1 less or equal x % ------------------------------------------------------------------------- function [x1, b1] = computelowerhistbin(x, binwidth) % bin index bin = floor(x./binwidth - 0.5); % bin center x1 x1 = binwidth * (bin + 0.5); % add together 2 1-based indexing b1 = bin + 2; end finally, final 'quantized' data: w = 1 - (x - x1)./binwidth here not get: not understand - @ - why x1 computed way is, , why/how w computed way is. in fact, of things, w confuses me most. literally cannot understand logic here, or intended. app

excel - MATLAB xlsread's cell range changing on each loop -

excel - MATLAB xlsread's cell range changing on each loop - i incorporate xlsread instruction loop running on list of different years. intention @ every loop cell range changes, in order import info respective year. cell range move column right of previous cell range. there way this? thank suggestions! it's not possible happen automatically. repeated calls xlsread slow. because each 1 opens instance of excel application. you're improve off reading of info in 1 go, stepping through resulting array in matlab. excel matlab loops xlsread

html5 - Editable text docment on webpage -

html5 - Editable text docment on webpage - how embed editable text document in webpage? wanted document on webpage ever opens can write , save it. you can utilize inline editing feature of ckeditor. or content editable feature of html5 <section contenteditable="true"> // markup here </section> html5

c# - MultiHandleSliderExtender: Error - Only one instance of a ScriptManager can be added to the page -

c# - MultiHandleSliderExtender: Error - Only one instance of a ScriptManager can be added to the page - i want develop multi handler slider can adjusted both sides. script <%@ page title="home page" language="c#" masterpagefile="~/site.master" autoeventwireup="true" codebehind="default.aspx.cs" inherits="webapplication4._default" %> <%@ register assembly="ajaxcontroltoolkit" namespace="ajaxcontroltoolkit" tagprefix="cc1" %> <asp:content id="bodycontent" contentplaceholderid="maincontent" runat="server"> <asp:scriptmanager runat="server" id="scriptmanager1" enablepartialrendering="true"/> <table> <tr> <td colspan="2"> <asp:updatepanel runat="server" id="updatepanel" updatemode="conditional">

list - How to speed up a search in a long document using python? -

list - How to speed up a search in a long document using python? - i wondering if possible search in vim using python in order speed search in long document. i have text document of 140.000 lines. have list (mysearches) 115 different search patterns. want set lines matches in list (hits) this now: in range(0,len(mysearches)-1) line in range(1, line("$")) allow idx = match(getline(line), mysearches[i]) if idx >= 0 phone call add(hits, line) endif endfor endfor "remove double linenumbers: allow unduplist=filter(copy(hits), 'index(hits, v:val, v:key+1)==-1') the problem search takes on 5 minutes. how can adapt above search python search? how this: let pattern=join(mysearches, '\|') allow mylist = systemlist('grep -n "'.pattern.'" '. shellescape(fnamemodify(@%, ':p')). ' | cutting -d: -f1') this works joining pattern \| (e.g. oring diff