Posts

Showing posts from January, 2012

Having an inconsistent Performance of running a MATLAB/MEX file -

i have written mex file. file compiles no problem. reasons, baffled, mex file not work more. nothing has changed. using same mex code , same arguments executing mex file. fails. uninstalled , reinstalled matlab did not help. i tracked problem , seems when reaches mexcallmatlab , causes crash. mxarray *x_locations = ( cellcentered ) ? mxcreatedoublematrix( 1, nz-1, mxreal ) : mxcreatedoublematrix( 1, nz, mxreal ); mxarray *y_locations = ( cellcentered ) ? mxcreatedoublematrix( 1, ny-1, mxreal ) : mxcreatedoublematrix( 1, ny, mxreal ); mxarray *z_locations = ( cellcentered ) ? mxcreatedoublematrix( 1, nx-1, mxreal ) : mxcreatedoublematrix( 1, nx, mxreal ); // loop filling values x_locations, y_locations, z_locations // ... // end of loop // create meshgrid based on values stored in x_locations, y_locations, z_locations mxarray *in[3]; mxarray *out[3]; in[0] = x_locations; in[1] = y_locations; in[2] = z_locations; mexprintf("line before mexcallmatlab\n"); mexcal

php date stripping, covert one format to another -

this question has answer here: convert 1 date format in php 12 answers evening struggle moving dates between 1 format , another. simple struggling find answer on forums. i have date $date = "2013-08-12 00:00"; and want echo out 12th aug 2013 can please use date , strtotime : $date = "2013-08-12 00:00"; $newdate = date('js m y', strtotime($date));

pip - python, change user site directory or install setup.py --prefix with --user -

i'd want install python modules non-root user this $ pip install -i --install-option="--prefix=~/usr" scipy unfortunately not work unless specify --user . --user can't used --prefix . using --user (without --prefix ) installs ~/.local find ugly because have maintained ~/usr , don't want add more stuff env make ~/.local usable too. so questions: how can let --prefix , --user work setup.py or how else setup.py succeed without using --user ? or can change user site directory ~/.local ~/usr somehow env ? to answer first question: in installing python modules guide written greg ward read: note various alternate installation schemes mutually exclusive: can pass --user, or --home, or --prefix , --exec-prefix, or --install-base , --install-platbase, can’t mix these groups. to answer second question: in same guide there's section alternate installation: user scheme read: files installed subdirectories of site.use

objective c - Constant Rotation of a SceneKit Model -

i'm getting accelerometer data 10x/second external device , want have reflected on 3-d scenekit model. is, want model rotate in response accelerometer data. 3-d model .dae file built in sketchup i'm loading scenekit scene. i'm trying make rotation on scenekit scene's root node (here self refers custom scnview class): self.scene.rootnode.transform = catransform3dmakerotation(angle, x, y, z); there's couple problems this: it's not rotating specific amount along each axis, it's rotating fixed amount along vector. possible manipulate how many degrees axis rotates changing relative vector values? make sense implement transform 3 catransform3drotate s, 1 each axis? it creates new rotation every time instead of rotating difference in angles last reading. example, if accel data x: 60˚, y: 40˚, y: -30˚ last reading , x: 65˚, y: 45˚, y: -35˚ , model rotate full 65˚ along x-axis, not 5˚ difference last time (as should). seems fixable subtracting last r

r - Rcpp sugar for NumericMatrix -

for numericvector , can subset smaller numericvector using integervector contains positions subset. e.g. suppose x<-c(1,2,2,3,4,5) , idx<-c(1,3,4) , , xsub<-x[idx] 1 2 3 . within rcpp, can use xsub=x[idx] . is there similar way subset rows of numericmatrix using integervector ? for example, following code xmatsub=xmat(idx,_) didn't work me. there isn't way. have manually, not complicated. numericmatrix res( idx.size(), m.rows() ) ; for( int i=0; i<idx.size(); i++){ res.row(i) = m.row(idx[i]-1) ; }

c - Structs from one header into a struct in another header -

i'm having trouble on this... have header: #ifndef pessoa_h #define pessoa_h typedef struct pa{ int idade; int atend; }pessoa; void inicpessoa(pessoa *ps, int id); #endif and, in filac.h: #ifndef filac_h #define filac_h #include "pessoa.h" typedef struct pessoa elem_t; typedef struct no{ elem_t info; struct no *prox, *ant; } no; typedef no * fila; #endif but compiler says fiel info on filac.h has incomplete type. changing elem_t info; struct elem_t into; had no effect. you have no type called struct pessoa . have struct pa , , have pessoa (a typedef). so need change this: typedef struct pessoa elem_t; into 1 of: typedef struct pa elem_t; typedef pessoa elem_t;

sql - Postgres start table ID from 1000 -

before mark duplicate. found answer on thread , having difficulties making work. from psql see table: \d people table: column       |                   type                |                        modifiers ---------------+----------------------------------+----------------------------------------------------------------------- id                 |               integer                 |       not null default nextval('people_id_seq'::regclass) code tried seems nothing... alter sequence people_id_seq restart 1000 how make primary key start 1000? the following query set sequence value 999. next time sequence accessed, 1000. select setval('people_id_seq', 999); reference : sequence manipulation functions on postgresql manual

javascript - Setting jQuery plugin options from data attributes -

im having problem setting options array value in jquery plugin using data attributes. if reference data attribute using class selector $('.tm-input').tagsmanager( { prefilled: $('.tm-input').data('load') }) it works elements same values. if reference using "this" sets correct values comes across string not array. $('.tm-input').tagsmanager( { prefilled: $(this).data('load') }) i've tried using json.parse() error unexpected character. appreciated! have tried each $('.tm-input').each (function () { $(this).tagsmanager( { prefilled: $(this).data('load') }); }); explanation: when selector has more 1 element, applying method typically affect of elements, retrieving property typically return property 1st element. so when use .tagsmanager on $('.tm-input') selector, applying .tagsmanger of elements. when set prefilled:$('.tm-input').data('

Why Oracle would set a PCT_FREE value for MLOG$ when there will never be an update -

found pctfree on mlog table value 60 or 90 [or other 0, really, since entries in mlog table never updated, inserted , deleted]. don’t know if these delivered form oracle way. question why oracle set pct_free value mlog$ when there never update. can please update me here. thanks in advance . thanks,sm your assumption "the entries in mlog table never updated" might not right. according mos doc id 100498.1, oracle update materialized view log table under circumstances: during refresh phase, mlog$_xxx.snaptime$$ column of rows in satisfied refresh query updated current refresh timestamp . finally, wrap-up phase following: a. sets slog$.snaptime current refresh time. b. sets snap_reftime$.snaptime current refresh time. c. sets mlog$.oldest_pk current refresh time if current refresh time < min (slog$.snaptime). d. deletes rows mlog$_xxx snaptime$$ < current refresh time. from above explanation clear mlog$ tables c

url - Drupal: List Content of Content Type in Node -

how create node, list content content type(ex. basic page). allow user delete or edit content well. i see in node: admin/content can filter out basic pages. url filter apply. i want user click url filter list of basic pages. using drupal 7. thanks!

html - page jumps with <a href> adding websites randomly to links -

i'm trying make page jumps on page in blogger, using: <a href="#test">test</a> for source and <a name="test"></a> for target. and fine , dandy except when switch html mode compose mode...and html mode. when happens triggers above lines of sudden turn in these 2 lines: <a href="https://www.blogger.com/blogger.g?blogid=6870619294109194114#test">test</a> <a href="https://www.blogger.com/null" name="test"></a> where blogid site login blogger.com , null site gives error message. it's quite annoying and, while manually delete these added web addresses each time, hoping out there has solution stop happening have lot of jumps , updating page. does know why addition happens , how stop it?! actually problem occurs because link https://www.blogger.com/null generated automatically , cause re-routing of error page. solve problem, enter html tab post , link , r

sql - Error missing chunk number 0 in postgresql, I already figured out which field was corrupted -

i'm using postgresql 9.1.13 on x86_64-unknown-linux-gnu, compiled gcc (ubuntu 4.8.2-16ubuntu6) 4.8.2, 64-bit i have faced error many days, , thought found solution creating script check field in database table, update corrupted column in field null. it works fine while until found this. i found corrupted field script updated corrupted column null, got this. # select * comment id = 7228707; >> error: missing chunk number 0 toast value 149171568 in pg_toast_8070962 but, in same time can select table columns , got no error. # select id,comment,and,all,column,in,my,table comment id = 7228707; to make sure select table column this # select string_agg(column_name, ', ') information_schema.columns table_name ='comment' , table_schema='a1'; i select column name plus system column, still appear no error @ all. got error when select * table corrupted field. so, idea why being this? are there hidden column postgresql more ctid,cmax,xmax

javascript - How to make my horizontal Spry menubar vertical? -

i have horizontal menu bar @ top of page: i didn't code site , i'm unfamiliar spry. i need make vertical , on left of images. how can set spry make navbar vertical? i have dreamweaver, can't find horizontal or vertical setting. thanks. you can use css float property make vertical. for position nav bar left of image can use position property. css: #menubar { left: 316px; position: absolute; top: 201px; } .menubar .menuitemcontainer { display: block; float: none; margin: 0; padding: 0; position: relative; white-space: nowrap; } simply remove float or make none in menuitemcontainer

python - ARIMA out of sample prediction in statsmodels? -

i have timeseries forecasting problem using statsmodels python package address. evaluating using aic criteria, optimal model turns out quite complex, arima(27,1,8) [ haven't done exhaustive search of parameter space, seems @ minima around there]. having real trouble validating , forecasting model though, because takes long time (hours) train single model instance, doing repeated tests difficult. in case, need minimum in order able use statsmodels in operations (assuming can model validated somehow first) mechanism incorporating new data arrives in order make next set of forecasts. able fit model on available data, pickle it, , unpickle later when next datapoint available , incorporate updated set of forecasts. @ moment have re-fit model each time new data becomes available, said takes long time. i had @ this question address problem have arma models. arima case there added complexity of data being differenced. need able produce new forecasts of original timeseries (c.f. ty

python - using re.split() to separate a string into list -

i using code separate words list. while loop used remove blank spaces come up, elements ''. problem after run while loop there still elements ''. believe due whitespaces , indentations. while loop rid of 2/3 of these spaces. there way words separated? don't want blank elements because when run loop on them later string index out of range when reference mylist[i][0] . str = fpin.read() mylist = re.split('[ \n]', str) = 0 while(i < len(mylist)): if mylist[i] == '': del mylist[i] = + 1 unless i'm misunderstanding specifications, don't need regex here. can use string's split method. >>> mystr = 'this \n awesome \nstring' >>> mystr.split() ['this', 'is', 'my', 'awesome', 'string']

android - dll for face recognition -

i started creating face recognition application. nothing works fine. dll available can decode source , implement ? reference or source appreciated. you can try opencv . , list may you.

find text in XML node using vbscript -

i have xml : <ecsc> <script> <etxml_line_tabtype> <item>*******************************************************************************.</item> <item>* information.</item> <item>********************************************************************************.</item> <item>* script test case 'tf_fi_fp_fi_0569_ms07_co_search_help_internal_orders_vtd0_1_en.x'</item> <item>*</item> <item>* sub script:</item> <item>* 'test case 3: choose internal order in one.fi using external order number while transaction posting (positive case)'.</item> <item>*</item> <item>* script display internal order using external order number while transaction posting 'fb01'</item> <item>* gettab command being used fetch data table 'coas'.</item>

javascript - How to remove nested collection when destroying model? -

i'm initializing nested collection te following: var post = { id: 123, title: 'sterling archer', comments: [ {text: 'comment text', tags: ['tag1', 'tag2', 'tag3']}, {text: 'comment test', tags: ['tag2', 'tag5']} ] }; var postmodel = backbone.model.extend({ parse: function (response) { if (response.comments) { response.comments = new backbone.collection(response.comments); } return response; } }); var post = new postmodel(post, {parse: true}); how should remove nested 'comments' collection when removing model? post.destroy(); you can override destroy method of postmodel instead of sync (which not called in case of new model without id attribute): destroy: function(options) { this.get('comments').each(function(mdl) { mdl.destroy(); }); backbone.model.prototype.destroy.call(this, options) }

python - Failed to crawl element of specific website with scrapy spider -

i want website addresses of jobs, write scrapy spider, want of value xpath://article/dl/dd/h2/a[@class="job-title"]/@href, when execute spider command : scrapy spider auseek -a addsthreshold=3 the variable "urls" used preserve values empty, can me figure it, here code: from scrapy.contrib.spiders import crawlspider,rule scrapy.selector import selector scrapy.contrib.linkextractors.sgml import sgmllinkextractor scrapy.conf import settings scrapy.mail import mailsender scrapy.xlib.pydispatch import dispatcher scrapy.exceptions import closespider scrapy import log scrapy import signals myproj.items import aditem import time class auseekspider(crawlspider): name = "auseek" result_address = [] addresscount = int(0) addressthresh = int(0) allowed_domains = ["seek.com.au"] start_urls = [ "http://www.seek.com.au/jobs/in-australia/" ] def __init__(self,**kwargs): super(auseekspider

covariant virtual function in C++ -

i tried following program, compiler shows error. #include <iostream> class base { public: virtual base& fun() const { std::cout<<"fun() in base\n"; return *this; } }; class derived : public base { public: derived& fun() const { std::cout<<"fun() in derived\n"; return *this; } }; int main() { base* p=new derived(); p->fun(); delete p; return 0; } compiler errors: [error] invalid initialization of reference of type 'base&' expression of type 'const base' [error] invalid initialization of reference of type 'derived&' expression of type 'const derived' why getting these errors? when write following in both class' function program works fine. return (base&)*this; // write line in base class function return (derived&)*this // write line in deriv

java - How to close IEDriverServer.exe in selenium? -

i have program opens desired url in ie using selenium driver. want close driver exe after url loading. i used driver.quit(); results cleaning exe , closing browser. don't want close opened browser there way achieve without using runtime.getruntime().exec("taskkill /f /im iedriverserver.exe"); ? helium automatically - if haven't called driver.quit(); when jvm terminates, helium leaves browser window open cleans driver exe. here's how implementation works: selenium class driverservice manages driver.exe process. need manipulate fields of correct driverservice instance shut down exe. fields not accessible default, need use java reflection access them. first, when starting ie, need manually pass in driverservice instance: internetexplorerdriverservice.builder servicebuilder = new internetexplorerdriverservice.builder().usinganyfreeport(); internetexplorerdriverservice service = servicebuilder.build(); webdriver ie = new internetexplorerdrive

cq5 - Logo component - In design mode unable to see the edit toolbar for this component -

<%@include file="/libs/foundation/global.jsp" %> <div class="container_16"> <div class="grid_8"> <cq:include path="logo" resourcetype="/apps/traningcq5/components/logo" /> </div> <div class="grid_8"> <div class="search_area"> <div> userinfo </div> <div> toptoolbar </div> <div> search </div> <div class="clear"></div> </div> </div> </div> the above code includes logo component. added in header.jsp however, if add component anywhere else works not in header. could please me in ?

sql - Issue with check constraint -

i want create check constraint allow session of date end session greater date begin session : alter table sessionn add constraint checkdate_ck check ( sessionn.datebeginsessionstage <sessionn.dateendsessionstage) but have probleme message : msg 547, level 16, state 0, line 1 alter table statement conflicted check constraint "checkdate_ck". conflict occurred in database "v12013", table "dbo.sessionn".

strpos - Get value from file - php -

let's have in text file: author:mjmz author url:http://abc.co version: 1.0 how can string "mjmz" if string "author"? i tried solution question ( php value text file ) no success. the problem may because of strpos function. in case, word "author" got two. strpos function can't solve problem. split each line @ : using explode , check if prefix matches you're searching for: $lines = file($filename, file_ignore_new_lines); foreach($lines $line) { list($prefix, $data) = explode(':', $line); if (trim($prefix) == "author") { echo $data; break; } }

Performance impact when creating Audit trail using trigger in MS SQL Server 2012 -

in sql server 2012 database want create audit trail major tables on update , delete operations.noramally creating audit trail using trigger on each table , store on shadow table. there performance impact ? if huge records updated or deleted on table. there anyother way implement audit trail? typically, when implement , audit trail db tables, implement via code, not in triggers. when implemented in code, can provide additional context information, such reason change made, made change, reason behind change, etc., common business requirement. in typical multi-layer application design, have daos each table , business services implement updates responsible calling separate daos core table update , history entry insert. approach no if want bunch of different sources directly making table updates db, it's natural approach if have service-oriented architecture , 1 set of services way , out of tables. if implement audit trail using approach, of course need make sure audit tra

web services - Deploy a local webservice on many machines - is it the right strategy? -

i wondering best way deliver private web service instances lots of users, user able connect own offline version of service, running web service visual studios while debugging. struggling setting in vs2013 many online tutorials, not sure if not working because never supposed work way. i have provided in-depth explanation of issue not sure going in right way , appreciate feedback: background: i have web service interface engine. deals front-end , builds set of commands how make cad model. these commands controlling 3rd party cad software's api. therefore engine can seen have 2 main functions - build cad's api instructions, can saved later execution, catches instance of cad software running on same computer , builds model. the second part restricted general public. our in-house users should able use it. however, want have otherwise identical front-end , user experience. the problem is, if connect same engine public, exists on our main server, engine looking

db2 - How to removing spacing in SQL -

i have data in db2 want insert data sql. the db2 data had : select char('aaa ') test table_1 but then, when select in sql after doing insert, data become this. select test table_1 result : test ------ aaa why space character read box character. how fix space character read into. or there setting need change? or have use parameter? i used as400 , datastage. thank you. datastage appends pad characters know there spaces there. pad character 0x00 (nul) default , that's you're seeing. research apt_string_padchar environment variable; can set else if want. the 0x00 characters not in database. short answer is, can safely ignore it.

c# - Check calling for some method should belong to Unit Tests -

i trying follow test behaviour not method( that's doing). testing functionality in refresh items server. it done in refreshitems () method. in method have calls other methods of other service can networkservice (for web request). as implementation of refreshitems may change or may not calling specific method of networkservice. so should unittests include test checking whether networkservice methods has been called or not ? inject interface networkservice . called inetworkservice , iitemsservice might surfice: public interface iitemsservice { items getallitems(); //or whatever need } then have 2 options: mock , verify inject mock interface , verify correct calls called, test implementation not behaviour. var itemsservice = new mock<iitemsservice>(); //moq example var testobject = new classundertest(itemsservice.object); testobject.refreshitems(); itemsservice.verify(e => e.getallitems(), times.once); //verify calls moq stub create stu

javascript - Node.js scraping brings back weird results with thepiratebay -

i building simple node.js server web scraping needs. thing is, when try load pirate bay, result looks this: ��[{s�6�;��nz��%y�����g����b��n����"h�����o�$r-{s�nj������<~u������yb����q09���&v�/�w<##��'���q}��t *|�?g��g�e��sg��%|m�l>8�9��+t�4� ��u���y�Ł�n}j�tܳ(�en9nh0c����\�������8��� �@q]��n��.�c���^dmyhg�4Ó�(��p 脱�o�r����8�0]|�j����k���m�_�_ߜ�y:��������|=��|u īz�7:f�@���wݪz|la2���p�� ȋ�����Н��y= �%k�^t��*�;\���6��uď��_���l��r�� ��{��m�!vt豀�t��ۄ���hm��j���|��/a;�v}#��w�z����lc_�hmȎ�!3���䠾�i����usp�)�������j_n=�l����%x�Ā ��������>����-= [pjc�v�v�ز]�x݅Ǎ0�*o��*|<"��+!8�_>% a�g�i�e/ �s�ҝ but longer. tried setting meta charset utf-8 didn't work. here main part of app.js: app.get('/:key/:url', function(req, res) { // prevent bunch of people overloading server var key = req.params.key; if (key != '12345') res.send('error: incorrect key'); else { // scraping // slashe

c# - Is there any way to separate the styling from my XAML in Xamarin.Forms -

i'm using xamarin.forms in pcl xaml pages. way figured out style controls use inline syntax. <button text="inquiry" textcolor="blue" /> i prefer use structure one: <page.resources> <style targettype="button"> <setter property="borderthickness" value="5" /> <setter property="foreground" value="blue" /> </style> </page.resources> ( http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh465381.aspx ) however, style element not (yet) supported. has succeeded in separating layout contents? fyi: i've posted question in xamarin forums, got here google might want check out page: http://forums.xamarin.com/discussion/19287/styling-of-xamarin-xaml#latest from xamarin.forms 1.3 more styling options. xamarin.forms 1.3 technology preview support styles in xaml , in code allow styles based on dynamicresources via style.bas

api - Instagram & Processing - Real time view -

i'm working on small app similar instaprint , need help. i'm using source code globalgram andrew haskin, searches instagram particular hashtag , displays recent image posted hashtag. problem once, need continuously search hashtag , display image when new 1 added, refresh, i've been tinkering no avail. appreciated code below : import com.francisli.processing.http.*; pfont instagramfont; pimage backgroundimg; pimage brand; pimage userphoto; pimage profilepicture; string username; string tag; string[] tagstrings; com.francisli.processing.http.httpclient client; void setup() { size(580, 900); smooth(); backgroundimg = loadimage("iso_background.jpg"); brand = loadimage("iso.jpg"); instagramfont = loadfont("helvetica-bold-36.vlw"); client = new com.francisli.processing.http.httpclient(this, "api.instagram.com"); client.usessl = true; //// instantiate new hashmap hashmap params = new hashmap(); //// put ke

xcode - How to add overlay to image picker in iOS -

i trying add overlay image taken imagepicker such frame, shown during snap taking. trying use following code: self.picker = [[uiimagepickercontroller alloc] init]; self.picker.sourcetype = uiimagepickercontrollersourcetypecamera; self.picker.cameracapturemode = uiimagepickercontrollercameracapturemodephoto; self.picker.cameradevice = uiimagepickercontrollercameradevicerear; self.picker.showscameracontrols = no; self.picker.navigationbarhidden = yes; self.picker.toolbarhidden = yes; self.picker.wantsfullscreenlayout = yes; // insert overlay self.overlay = [[overlayviewcontroller alloc] initwithnibname:@"overlay" bundle:nil]; self.overlay.pickerreference = self.picker; self.picker.cameraoverlayview = self.overlay.view; self.picker.delegate = self.overlay; [self presentmodalviewcontroller:self.picker animated:no]; but helps when changing image picker skin. how can add , process overlay snapshot? if need merge picture taken uiimageview contains image, here'

Yii- Caching with CSqlDataprovider -

is possible caching of data sql server queries when using csqldataprovider. if can please provide links documentation it. or if have done please guide. i did search found nothing :( there is example of implementing feature <?php class cachedsqldataprovider extends cdataprovider { public $querycache; public $querycachelife; /** * @var cdbconnection database connection used in queries. * defaults null, meaning using yii::app()->db. */ public $db; /** * @var string sql statement used fetching data rows. */ public $sql; /** * @var array parameters (name=>value) bound sql statement. */ public $params=array(); /** * @var string name of key field. defaults 'id'. */ public $keyfield='id'; /** * constructor. * @param string $sql sql statement used fetching data rows

cakephp - Can't find model associated model data -

i'm new in cakephp , i'm having problems in example i'm building learn. i'm building plugin 3 models (categoria,plato,imagen) the relationships between them following: categoria - plato (n-n) plato - imagen (1-n) if go plato view, imagen relationship, when access through category, can't reach imagen associated each plato. why? what's problem? models code: plato: app::uses('appmodel', 'model'); class plato extends erestaurantappmodel { public $name = 'plato'; //public $actsas = array('containable'); public $hasandbelongstomany = array( 'categoria' => array( 'classname' => 'categoria', 'jointable' => 'categorias_platos', 'foreignkey' => 'plato_id', 'associationforeignkey' => 'categoria_id', 'unique' => 'keepexisting', &

android - How to properly implement Atooma plugin -

i downloaded atooma sdk, generated skeleton , filled registering single performer. installed package atooma cannot find plugin while doing part of rule. in logcat there 1 error related: service com.atooma.atoomapluginservice has leaked serviceconnection com.atooma.c@41d82b88 bound here since happens in sdk part of code i'm reluctant make changes there. any appreciated. after fiddling including/excluding atoomasdk.jar , referencing/unreferencing atoomasdk project changed , works should! sorry bothering , sorry because cannot reproduce doing solve it...

html difference between equal sign and colon -

what difference between using = , : when assigning value in attribute? example: <p style="width=100px, height:1000px"></p> does have reliable source tells difference between 2 , appropriate usage? = used assign values attributes in html elements. : used assign values css based properties. example html <p id="p1" height="100px"> css body{ background-color:red; } in example <p style="width=100px..." wrong , given value style attribute = css properties in style attribute values using : only. cannot separate css properties , , have use ; separate them. correct version <p style="width:100px; height:1000px"></p>

javascript - kendo ui code is Not working fine in java script function why? -

i have make js function call on button click in there 59 differnt values assign diffenrt html element java script. now found values assign but there 2 kendo ui drop down on page, not dropdown cascading frist assign value of 1st dropdown , accoding dropdown 2nd dropdown refereshed , had assign values 2nd drop down don't accept value. why? i had put alert in function if put alert it's disply why? code:-- if (c != null) { var country = $("#countryforpricing").data("kendodropdownlist"); alert(c); country.select(function (dataitem) { return dataitem.value == c; }); catalogpricingsetprogramexrate(c); } execution pointer execute function line line prove alert function , " catalogpricingsetprogramexrate(c) "

bash - add files to subfolder inside zip when creating -

i following on linux bash script: zip file file1.jar new archive inside of subdirectory. given: myfiletozip.jar expected: ./myfiletozip.jar ./myarchive.zip | /mods/ | /myfiletozip.jar is possible add non existant path during creation? or have create temp way @ filelevel before zipping? i have no memory of option allows create zip file non existent directory inside. but php can create in advance empty zip file empty non existent directory, , after can update file real files/structures want. run first script php myscript.php <?php $zip = new ziparchive(); $zip->open('my-archive.zip', ziparchive::create); $zip->addemptydir('./dir1/subdira'); $zip->addemptydir('./dir2/subdirb'); $zip->close(); ?> and after zip -u my-archive.zip path_to_add

c# - Opening a windows relative to its tab in WPF -

i've wpf application makes use of avalondock opening multiple tabs ...each tab represents function , has it's own controls .. single tab opened via menu. sometimes need show window in current tab , use mywindow w = new mywindow(); w.show(); //w.showdialog(); this opens popup(/modal) when switch tab (in case it's not modal) have window still open... need "force" window shown in it's tab. i've tried setting owner of window when var wnd = window.getwindow(docuentpane); i got main window of app... is possible want achieve in wpf? if yes how? in advance

AngularJS controller $scope reserved keyword? -

i newbie angular, came across this fiddle explains how nested controller works. when rename $scope else $abc , doesn't work, mean $scope reserved keyword in angularjs? function carcontroller($scope) { $scope.name = 'car'; $scope.type = 'car'; } function bmwcontroller($scope) { $scope.name = 'bmw'; } function bmwmotorcyclecontroller($scope) { $scope.name = 'bmwmotorade'; $scope.type = 'motorcycle'; } effectively, yes. it's not reserved word in sense e.g. if , while angularjs gives meaning. in example angular parses string representation of function , uses named parameters determine "inject" function when calls it. in case you're injecting $scope service.

Generate a UUID on iOS from Swift -

in ios swift app want generate random uuid ( guid ) strings use table key, , snippet appears work: let uuid = cfuuidcreatestring(nil, cfuuidcreate(nil)) is safe? or there perhaps better (recommended) approach? try one: let uuid = nsuuid().uuidstring print(uuid) swift 3 let uuid = uuid().uuidstring print(uuid)

c# - Xcode unity plugin error: "Undefined symbols for architecture armv7" -

today headache, hope can me: context: simple ios app need 1 method implemented unity-xcode plugin. ( http://docs.unity3d.com/manual/pluginsforios.html ) more details xcode: 5.1.1 unity: 4.5.1f3 i tried simple plugin unity-xcode, when run project (xcode), error appear: undefined symbols architecture armv7: "__savepicture", referenced from: registermonomodules() in registermonomodules.o ld: symbol(s) not found architecture armv7 clang: error: linker command failed exit code 1 (use -v see invocation) important mention when run project without plugin-stuff, fine, app runs in ipad without problems. i generate ".h" , ".m" , add files classes folder in generated xcode project, it´s simple call method in c# code: [dllimport ("__internal")] private static extern void _savepicture(string nom); can me? tried different settings since unity, hope make work , doesn't happen. related topic: http://forum.unity3d.com/threads/undefined-sy

css - Automatically compile LESS file on build server after every build -

i have main.less file in turn imports multiple other less files. want achieve have main.less file compiled main.css file after every build on build server. tried installing nodejs package dotless nuget package visual studio. there way somehow isolate nodejs package files 1 folder in project compilation of less file can run on machine not have npm installed ? options achieving this? can done lessc package ? the command line lessc compiler have watch function, client side less.js compiler has one. should use following code in html: <link rel="stylesheet/less" type="text/css" href="main.less" /> <script>less = { env: 'development'};</script> <script src="less.js"></script> <script>less.watch();</script>

logging - django runserver shows too many logs -

for instance, when django haystack gets more_like_this data, console flooded result data. how can suppress specific log? example django-haystack related log? def more_like_this(self): haystack.query import searchqueryset sqs = searchqueryset().more_like_this(self).models(type(self)).exclude(id=self.id).exclude(deleted=true) sqs.load_all() return sqs # generates tons of log...

android - ActionBar item is not showing when a ShapeDrawable is set as it's icon -

i working on simple project , want avoid png images as possible. need '+' (add) button , created using shapedrawable given code. res/drawable/plus_icon_drawable.xml <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="line"> <stroke android:color="#000" android:width="3dp"/> </shape> </item> <item> <rotate android:fromdegrees="90" android:todegrees="90"> <shape android:shape="line"> <stroke android:color="#000" android:width="3dp"/> </shape> </rotate> </item> </layer-list> this code works fine when add background of button or imagebutton when add icon of actionbar item, item not getting di

c# - String.Format decimal with both thousand separators and forced decimal places -

i'd string.format decimal has both thousand separators , forced decimal places (3). for example: input: 123456,12 78545,8 output: 123.456,120 78.545,800 i have tried string.format("{0:0.0,000}", input); but gives thousand separators doesn't force decimal places. in custom numeric format string period ( . ) used "localized decimal separator". ie. if current locale uses comma decimal separator should use period in format string. comma ( , ) used localised thousands separator. as format puts comma after period things going confused (thousands separators don't apply after decimal point). so try: string.format("{0:#,##0.000}", input); (using # digits include if input large enough.)

sql server - Decryptbypassphrase equivalent in MySQL? -

i've migrated huge mssql database mysql using mysql workbench. worked perfectly, we're attempting rewrite stored procedures. login, password encrypted using mssqls method "encryptbypassphrase". i don't want demand users change passwords- there equivalent decryptbypassphrase work mysql? can keep passwords, , same encryption methods? thank you!

asp.net mvc - Updating Twitter status using LinqToTwitter -

here's set out do: make mvc app on user clicks button , taken twitter login page after giving credentials user redirected second page on secong page there text box , 'tweet' button entering message , clicking on 'tweet' update status i got till 2nd point following samples linqtotwitter codeplex page. the code oauth controller works fine , redirect mvc app's second page. but missing not posting status. this code in button click pass user entered status: public actionresult status(string status) { var auth = new mvcauthorizer { credentialstore = new sessionstatecredentialstore() }; auth.completeauthorizeasync(request.url); var twittercontext = new twittercontext(auth); tweetasync(twittercontext, status); return view(); //return view user } void tweetasync(twittercontext twitterctx, string statustoupdate) { var tweet = twitterctx.tweetasync(statust