Posts

Showing posts from June, 2010

angularjs - Using protractor with loops -

loop index ( i ) not i'm expecting when use protractor within loop. symptoms: failed: index out of bound. trying access element @ index:'x', there 'x' elements or index static , equal last value my code for (var = 0; < max; ++i) { getpromise().then(function() { somearray[i] // 'i' takes value of 'max' }) } for example: var expected = ['expect1', 'expect2', 'expect3']; var els = element.all(by.css('selector')); (var = 0; < expected.length; ++i) { els.get(i).gettext().then(function(text) { expect(text).toequal(expected[i]); // error: `i` 3. }) } or var els = element.all(by.css('selector')); (var = 0; < 3; ++i) { els.get(i).gettext().then(function(text) { if (text === 'should click') { els.get(i).click(); // fails "failed: index out of bound. trying access element @ index:3, there 3 elements" } }) } or var els = elem

symfony - Why Doctrine MongoDB ODM findBy and execute returns different classes? -

sbased on doctrine documentation $qb->getquery()->execute(); return cursor iterator on results $qb->find($criteria); returns actual found documents. i using symfony2 mongodbbundle , avoid iterating on result set in repository classes. // returns product document $entity = $this->get('doctrine_mongodb') ->getrepository("mybundle:product") ->findoneby(array('title' => 'somthing')); // returns cursor $entity = $this->get('doctrine_mongodb') ->getrepository("mybundle:product") ->customfunctionwithcreatequerybuilder(array('title' => 'somthing')); how can make cutomfunctionwithcreatequerybuilder() returns same class/result findoneby ? also how can make execute() returns embedded documents? edit content of cutomfunctionwithcreatequerybuilder: class productrepository extends documentrepository { public fun

apache - Treat file name as PHP GET -

i have profiles on test website setup viewed in format: example.com/profile.php?u=username i use format: example.com/profile/username how treat username variable in php, rather file? you need use apache mod_rewrite . create file named .htaccess on root of website , add following: rewriteengine on rewriterule ^/profile/(.*)$ /profile.php?u=$1 [qsa,l] now, if navigate : example.com/profile/usertest apache send variable usertest profile.php?u=usertest

php - Way to check if customer has made a payment? -

i'm trying find way of checking if customer has clicked final submit button perform transaction in php. i need send second e-mail different people when customer makes transaction, far can tell, there's no function or property retrieve sort of confirmation value. i don't need know if payment went through or not, if clicked last submit button, checkout page hosted on microsoft's servers. all of payment apis return status immediately. have , handle in code. how done vary api. you can use silent post * similar paypal's ipn. script on server notified of payments. use transaction details api , transaction in unsettled batches. * author of article

scrollbar - C# Custom Universal Scroll Bar -

i make custom scrollbar (change color, etc...) can added existing c# controls. examples have found work control designed for. what thinking is: public class coloredscrollbar : usercontrol { private scrollbar scrollbar; public coloredscrollbar(scrollbar scrollbar){ this.scrollbar = scrollbar; } // onpaint // draw scrollbar same size , location // scrollbar } so want draw right on top of existing scroll bar. giving custom want. for work need able pass events throw coloredscrollbar real scroll bar below. this way coloredscrollbar work every c# control, because uses impended scroll bar moving , calculations. is possible pass event control below. if can show how? if there better way create universal scroll bar (that can added existing c# controls), love here it. thanks.

css - How to fix Outlook design? -

i using exact 2013 outlook design changes. but not work <!--[if gt mso 14]> <style type="text/css"> .outlook{ background-color:#f00;} </style> <![endif]--> i think, use wrong version of outlook: outlook 2000 - version 9 outlook 2002 - version 10 outlook 2003 - version 11 outlook 2007 - version 12 outlook 2010 - version 14 outlook 2013 - version 15

Capybara returns hidden elements when using Poltergeist? -

i'm using following capybara query: all(:xpath, '//table[@class="myclass"]//tr) my table contains 2 entries: <tr class="class1" style="visibility: hidden;"> <tr class="class2"> the code above bit simplified compared original, serves example. when running capybara against chrome or firefox, query results 1 element (class2). when running same code against poltergeist, i'm getting both elements. tried play around explicitly telling capybara ignore hidden elements, i'm still getting hidden one. i'm missing here something? this has been fixed poltergeist team: https://github.com/teampoltergeist/poltergeist/issues/618#issuecomment-150139228

html5 - Font Boosting Issue in Android Lollipop -

we noticed font boosting issue in android lollipop os. if user modifies font size in settings menu, application reloading if running , fonts modified based on selected font size in device settings. if setting below metatag viewport, issue not exist in ios , android os < 5.0 > <meta name="viewport" content="width=device-width, initial-scale=1, > maximum-scale=1, user-scalable=no"> is there option resolve issue????? note : 1. kind of issue not available in ios , android < 5.0. 2. there no issue thin application android >= 5.0 well. (only webpage reloading whenever there change in device font settings) the issue getting resolved setting below value in webview. webview.getsettings().settextzoom(100); root cause: android os < 5.0 textzoom having default value 100. in lollipop os, value taken font settings in device if not overwritten in application. if setting textzoom 100, font settings changes not affecting ap

javascript - On select highlight related table cell on xy axis -

Image
i have table looks chart. quick view: how can make table work area selection chart? example if select 6 , the (x, y) of element 6 (2, 1) . minimum related area include elements @ positions (0,0), (0,1), (1,0), (1,1), (2,0), (2,1) should highlighted. therefore, grids '0,3,1,4,2,6' highlighted. this: similarly, -if select 3 highlight 0,3 grids -if select 2 highlight 0,1,2 grids i know less js make type of actions. save day. plunker so, others, puzzled bit trying do. there seems break in consistency examples gave. if want highlight along x,y axis little different have shown. either way, threw together, perhaps started: plunker it shown in picture 1 , 3, though not picture 2. $scope.boxes = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'] $scope.boxclass = ['cone', 'ctwo', 'cthree', 'cfour', 'cfive

node.js - stream mp4 video with node fluent-ffmpeg -

i'm trying create video stream server , client node fluent-ffmpeg , express , ejs . , haven't solve while. want play video beginning time. following codes make safari browser on windows others makes loop of few seconds or says video format not supported server code (run.js) : app.get('/video', function(req, res) { //define file path,time seek beegining , set ffmpeg binary var pathtomovie = '../videos/test.mp4'; var seektime = 100; proc.setffmpegpath(__dirname + "/ffmpeg/ffmpeg"); //encoding video source var proc = new ffmpeg({source: pathtomovie}) .seekinput(seektime) .withvideobitrate(1024) .withvideocodec('libx264') .withaspect('16:9') .withfps(24) .withaudiobitrate('128k') .withaudiocodec('libfaac') .toformat('mp4'); //pipe .pipe(res, {end: true}); }); client code (index.ejs): <htm

symfony - Sort alphabetically with Twig -

i'm trying sort list of categories in alphabetical order. since more of php flaw i'm trying in way described here . don't have access core files of system need done twig tags. the build in sort filter filters can't used when using numeric variable key in twig array. specific problem due use of array_merge php function i'm trying incorporate code in link own code i'm not able done right. i'm calling categories so: {% category in shop.categories %} {{ category.title }} - {{ category.id }} {% endfor %} if understand code correct should like: {% set temparray = {} %} {% category in shop.categories %} numeric : {{ category.id }}, text : {{ category.title }} <br /> {% set temparray = temparray | merge({('_' ~ category.numeric):(category.text)}) %} {% endfor %} {% val in looparray %} {{ temparray['_' ~ val] }} <br/ > {% endfor %} this doens't sort category names still

html - How to fit inner div inside an outer div -

html: <div style="width: 300px; position: absolute; right: 25%; top: 5%; -webkit-box-shadow: 2px 4px 40px 0px rgba(0,0,0,0.75); -moz-box-shadow: 2px 4px 40px 0px rgba(0,0,0,0.75);box-shadow: 2px 4px 40px 0px rgba(0,0,0,0.75);"> <section class="notif notif-warn"> <h6 class="notif-title">warning!</h6> <p>this task forced checked out user. changes not saved site.master.</p> <div class="notif-controls"> <a href="#" class="notif-close" id="cbtn">close</a> </div> </section> </div> jsfiddle: http://jsfiddle.net/sikni8/kb2r6d4c/1/ how can update css ensure inner div fits within outer div box shadow. you can add box-sizing: border-box; .notif class or remove 100% width. the problem when add 100% width + padding element cause overflow.

How to avoid escaping double quotes and single quotes in php -

i sure there must better way putting backslash ( \ ) escape double quotes in php suppose have following <param name="flashvars" value="config={clip:{autoplay:true,autohide..... the value consist of many " , ' , getting tedious adding \ before every " you can use addslashes in case. don't use queries database though. use specific escape functions that. $param = "config={clip:autoplay:true,autohide..."; // put full value here and in html: <param name="flashvars" value="<?php echo addslashes($param) ?>">

c# - WebClient vs. HttpClient - Async request -

i have simple webapi method: [httpget] public ihttpactionresult foo() { thread.sleep(3000); return ok("bar"); } and have these 2 methods in console application call it: async task usingwebclient() { task<string> task = new webclient().downloadstringtaskasync (new uri ("http://localhost.fiddler:63710/api/producttype/foo")); console.writeline("webclient - before calling wait"); string result = await task; console.writeline("webclient - after calling wait"); } async task usinghttpclient() { task<string> task = new httpclient().getstringasync (new uri ("http://localhost.fiddler:63710/api/producttype/foo")); console.writeline("httpclient - before calling wait"); string result = await task; console.writeline("httpclient - after calling wait"); } and calling these methods linqpad this: async task main() { await usingwebclient(); await usinghttpclient

jQuery Capture Checkbox in UI Dialog Box -

based upon checkbox, pop jquery ui dialog box. content of dialog box dynamically built db. each row has check box selection. i'd trigger additional functionality based on clicking 1 of check boxes. in dynamically created table, each check box has class of "promoteselect". here's code have jquery side of things. // handle selecting rows promotion sheet selection table $(".promoteselect").on("change", function() { if(this.checked) { var env = $("#selectedenv").val().touppercase(); var promo_key = $(this).val(); alert(promo_key); buildrepotable(promo_key, env); } }); any ideas? ** update ** figured out. had change container , selector. $('#higherdiv').on('change', '.promoteselect', function(){});

windows - c++: Let user process write to LOCAL_SYSTEM named pipe - Custom Security Descriptor -

i have service running localsystem creates processes in logged on users' session. service creates named pipe client connects read , write. according https://msdn.microsoft.com/en-us/library/aa365600%28v=vs.85%29.aspx client can read pipe (it's no admin, not creator, neither localsystem ). i created security descriptor grant user read & write access. didn't work. tried giving read & write-access everyone -group. not work. error code client returns access_denied (5). i glad know doing wrong. edit: if don't create custom security descriptor , open pipe generic_read works (but reading). edit2 want learn how right. , still want logged on user able write. not (this testing). service-code (commented-out code getting user sid): psid everyonesid = nullptr; sid_identifier_authority sidauthworld = security_world_sid_authority; if(!allocateandinitializesid(&sidauthworld, 1, securi

php - Array of objects bug with index -

i have foreach : foreach($values $key => $value){ $name = $value['name']; if(!isset($array[$value['position']])){ $array[$value['position']] = new \stdclass(); } $array[$value['position']]->$name = $value['value']; } so in loop, in $value , have $name , $position , $value . $name name of property $value value $position position of object in array (index) in loop, check first in object created in specific index (position), if not create it, , after put value in correct property. my problem is, if in array of value don't have positions following (0,1,2,3) example (0,1,3,4), script bug , don't have correct array @ end. how can detect if miss index ? , how can fix ? thanks ! ps : don't know if have enough informations.. tell me ! edit : at end, correct output must : [object { name="d", complet="false"}, object { adresse="d&

javascript - Why are some of my elements jumping when my css transition are initialized? -

i'm creating widget animated transitions. on click, circular elements hidden behind main circle element should expand outward center. my initial styles position these animated elements correctly, active styles position these elements correctly, making half of them start in odd position when active class toggled. why happening ? here fiddle . the css code : #al_stage { border:1px solid #000; width:650px; height:650px; position:relative; margin:20px auto; } .al_container { position:relative; padding:70px; box-sizing:border-box; width:255px; display:block; background:#5c76a3; border-radius:10px; } .al_scale { width:100%; padding-bottom:100%; position:relative; display:block; } .al_circle { z-index:2; border-radius:50%; background:gray; position:absolute; top:0; left:0; width:100%; height:100%; } .al_wrapper { display:table; width:100%; height:100%; } .al_center {

sql - phpMyAdmin CSV Upload Replace Data Not Working -

i have created database , table in phpmyadmin. i importing data csv file. this works fine , adds data correctly. however each time upload want replace existing data. i have ticked box "replace table data file", uploads fine doesn't replace existing rows adds new data new rows below old data. any ideas why happening? this appears misleading text; adds "on duplicate key update" directive rather truncating table prior insert, see bug report at: https://sourceforge.net/p/phpmyadmin/bugs/4891/

triggers - Check MySQL new record without Pooling -

i searching method check new records (in mysql table) without pooling each x seconds or minutes . i have found mysql triggers used can't call external program or php file? you can call external program in trigger through sys_exec() see: http://crazytechthoughts.blogspot.jp/2011/12/call-external-program-from-mysql.html

python - Celery beat using supervisor in production -

i trying run celery beat virtual env using supervisor. script doesn't seem work all supervisor scripts in directory /etc/supervisord has supervisord.conf file , directory conf.d contains file gorgon-celery.conf my supervisord.conf file looks this: [unix_http_server] file=/tmp/supervisor.sock ; (the path socket file) [supervisord] logfile=/var/log/supervisord/main.log ; (main log file;default $cwd/supervisord.log) logfile_maxbytes=50mb ; (max main logfile bytes b4 rotation;default 50mb) logfile_backups=10 ; (num of main logfile rotation backups;default 10) loglevel=info ; (log level;default info; others: debug,warn,trace) pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) nodaemon=false ; (start in foreground if true;default false) minfds=1024 ; (min. avail startup file descriptors;default 1024) minprocs=200 ; (min. avail process descriptors;default 200) childlog

php - How do I get first day of the year and last day of the year in SQL? -

i trying fetch set of information database based on datetime . using these statements fetch information: $year_posts = $_get['year']; if ($_get['year'] = date("y")){ $state_sql = " , p.start_date = date_format(now() ,'%y-01-01') , p.end_date = now()"; } else{ $state_sql = " , p.start_date = date_format(now() ,'$year_posts-01-01') , p.end_date = date_format(now() ,'$year_posts-12-31')"; } if variable = 2015. how make fetch information 2015-01-01 00:00:00 current date? and same goes 2014. how can fetch information 2014-01-01 00:00:00 2014-12-31 23:59:59 ? i've tried looking on different threads, can't figure out. help? i think trying figure out. $year_posts = $_get['year']; if ($year_posts == date("y")){ $state_sql = " , p.start_date >= '".date('y')."-01-01 00:00:00' , p.end_date <= '".date('y-m-d h:i:s

java - Pushing variables to Stack and Variables living in the Stack difference? -

Image
so know there exists 2 memory areas: stack , heap . i know if create local variable live in stack, not in heap. stack grow push data in: now try pass confusion having you: for example simple java code: public class testclass { public static void main(string[] args) { object foo = null; object bar = null; } } is translated byte code: public static void main(java.lang.string[]); code: stack=1, locals=3, args_size=1 0: aconst_null 1: astore_1 2: aconst_null 3: astore_2 4: return linenumbertable: line 5: 0 line 6: 2 line 7: 4 localvariabletable: start length slot name signature 0 5 0 args [ljava/lang/string; 2 3 1 foo ljava/lang/object; 4 1 2 bar ljava/lang/object; where definition acons_null is: push null reference onto stack and astore_1 is: store reference local variable 1 the confusion having is, pushed foo stack, stored in stack again?

ios - Can I use didReceiveRemoteNotification to create local notifications? -

we planning have end end encryption in our messaging app, cannot display user message apns push notification message directly. planning send silent push notification, decrypt message in ios app's background mode , display plain text message local notification - (void)application:(uiapplication *)application didreceiveremotenotification:(nsdictionary *)userinfo fetchcompletionhandler:(void (^)(uibackgroundfetchresult result))handler yes, event send silent notification (using contentavailable flag in payload) use notification notify app of message availability, in delegate method downloads message database on secure servers pushes local notification device saying. that way aren't giving apple opportunity decrypt message because won't go through servers.

ios - Adding an NSManagedObject to an NSMutableArray via didSelectRowAtIndexPath -

i have core data project set up, i've got nsfetchedresultscontroller working properly, nspredicates works properly, , i'm onto doing useful data displayed on screen. right now, have uitableviewcellaccessory working toggle checked/unchecked cells, i'm returning nil when try add selectedmanagedobject myarrayofmanagedobjects via didselectrowatindexpath . what proper way add/remove nsmanagedobject nsmutablearray via didselectrowatindexpath ? here relevant properties: @property (nonatomic, strong) nsmanagedobject *selectedmanagedobject; @property (nonatomic, strong) nsmutablearray *myarrayofmanagedobjects; here's viewdidload array want dump `nsmanagedobject's instantiated: - (void)viewdidload { [super viewdidload]; // standard core data setup stuff // instantiate list store myarrayofmanagedobjects self.myarrayofmanagedobjects = [[nsmutablearray alloc]init]; } here's didselectrowatindexpath -(void)tableview:(uitableview

java - Sort ArrayList by double values -

i have arraylist double values: double distance = haversinealgorithm.haversineinkm(lat, lon, stop.getstoplat(), stop.getstoplon()); distancelist.add(distance); i can smallest value in list this: int minindex = distancelist.indexof(collections.min(distancelist)); currentlist.get(minindex); //it smallest value element but have know second smallest value , third smallest value element too. don't know how. i tried sort list this: collections.sort(distancelist); but it's not working. mean last index of list isn't smallest or highest value. is here can explain me how can solve ? :) this code looks good: int minindex = distancelist.indexof(collections.min(distancelist)); currentlist.get(minindex); //it smallest value element so since in sorted order, can smallest, 2nd smallest, , 3rd smallert value bying directly calling index. currentlist.get(0); currentlist.get(1); currentlist.get(2);

sql server - Interquartile Range - Lower, Upper and Median -

i'm trying work out interquartile range based on array of numbers can length e.g. 1, 1, 5, 6, 7, 8, 2, 4, 7, 9, 9, 9, 9 the values need work out interquartile range are: upper quartile median lower quartile if dump above array of numbers microsoft excel (columns a:m), can use following formulas: =quartile.inc(a1:m1,1) =quartile.inc(a1:m1,2) =quartile.inc(a1:m1,3) to answers of: 4 7 9 i need work out these 3 values in either sql server or vb.net. can array values in format or object in either of these languages, can't find functions exist quartile.inc function excel has. does know how achieved in either sql server or vb.net? there might easier way, quartiles, can use ntile (transact-sql) distributes rows in ordered partition specified number of groups. groups numbered, starting @ one. each row, ntile returns number of group row belongs. so data: select 1 val #temp union select 1 union select 5 union select

jquery - JavaScript Objects and Arrays -

i'm having function adding 16 football teams highest number of points in 4 groups. every group must have 4 teams , must not have more 2 teams same league. i've added property in every team object league name in arr , sorted highest number of points. i can't figure out how put condition 1 group can't have more 2 teams 1 league? jsfiddle link: http://jsfiddle.net/6jdjjqfw/ code: var tournaments = ['bundes', 'league1', 'premier', 'primera', 'seriea']; var teams = []; var groups = []; function getdata(id) { var url = "http://api.helloworld.ba/n/app.php?f=" + id; return $.getjson(url); } var ajax = []; (i = 0; < tournaments.length; i++) { ajax.push(getdata(tournaments[i])); } $.when.apply($, ajax).done(function () { (var = 0, len = arguments.length; < len; i++) { teams.push(arguments[i][0]); } creategroups(teams); }); function creategroups(teams) { var ar

Read from file line by line and parse to vector a lot of ints in c++ -

i have seen lot of similar posts regarding similar cases case bit different. i'm newbie c++, appreciated. i have large file full of lines full of integers. each number separated blank spaces. need diferent lines stay seperate, don't want read file on 1 go. want read line line , parse each line in vector of integers. code i've got this: int main () { string line; ifstream myfile; myfile.open ("numbers.txt"); vector<int> vec1; int const2=0; int a; while ( getline (myfile,line) ){ // understand reads line // line , stores string "line" while (line >> a){ // part 1 can't right, // want push_back every int // string vec1 doesn't work vec1.push_back(a); // more stuff } // more stuff } myfile.close(); return 0; } here c++11 way (use -std=c++0x g++ or clang++), can google each function don'

How do I migrate my Nginx's rewrite rules from dotCloud to Next dotcloud? -

i have migrated static app dotcloud next dotcloud , found nginx regrite rules didn't work. they redirect from miappname.dotcloudapp.com/oldurl to miappname.dotcloudapp.com:someport/newurl instead of miappname.dotcloudapp.com/newurl the old nginx's rewrite rules must migrated adding domain name explicitly follows. old rule rewrite ^/oldurl /newurl redirect; new rule rewrite ^/oldurl $scheme://$host/newurl redirect;

asp.net - how to assign unique id to a input text field in listview -

i need assign unique id input text field in listview. here code... <asp:listview id="viewproductbycategorylistview" runat="server" groupitemcount="4" groupplaceholderid="groupplaceholder1" itemplaceholderid="itemplaceholder1" clientidmode="predictable" clientidrowsuffix="id"> <layouttemplate> <table> <asp:placeholder runat="server" id="groupplaceholder1"></asp:placeholder> </table> </layouttemplate> <grouptemplate> <tr> <asp:placeholder runat="server" id="itemplaceholder1"></asp:placeholder> </tr> </grouptemplate> <itemtemplate> <td> <table cellpadding="2" cellspacing="0" style="width: 200px; height: 100px;"> <tr>

Any plans for Spring 4.X to support JDO 3.1 -

for lot of upcoming big data solutions jdo looks better , unified standard approach. example being datanucleous http://www.datanucleus.org/products/datanucleus/index.html . there plans spring provide support jdo 3.x... there challenges/issues that? update on appreciated... ty

c# - Why is the value of only this variable ignored when constructing an object with {}? -

i have apirequest class on need default value isinbackground variable. apirequest class simplified : public class apirequest { public string url; public bool isinbackground = true; } when this, value of isinbackground ignored , set default : apirequest rq = new apirequest{ url = "/user/suggest/" + pseudo, isinbackground = false }; then log value , 'true', url right value... the way set 'false' do rq.isinbackground = false; then value indeed 'false' so question why behave way ? because isinbackground has default value ? public class apitest { public string url; public bool background = true; } public class testclass : monobehaviour { // use initialization void start () { apitest t = new apitest{ url = "coucou", background = false }; debug.log(" url: " + t.url + " background: " + t.background); } } edit : after trying

android - Fragment in viewpager savedinstancestate is always null -

i know question has been asked before none of answers given far of me. i have viewpager populated fragments (android.support.v4.app.fragment) fragmentstatepageradapter . of these fragments contain logic needs retained when orientation changes, such keeping track of view selected. however, although save data in question in onsaveinstancestate savedinstancestate null. can solve storing data in static variable (which since have 1 instance of each fragment work me) found quite ugly solution , there has proper way of doing this. this 1 of fragments doesn't retain it's state on rotation: public class priceselectfragment extends fragment { private tablerow mselected; private int mselectedpos = 0; // newinstance constructor creating fragment arguments public static priceselectfragment newinstance() { priceselectfragment fragmentfirst = new priceselectfragment(); return fragmentfirst; } public priceselectfragment() { //

direct3d - D3D9 64-bit debug runtime -

for debugging d3d9 applications enabling directx 9 debug runtime essential. (the june 2010 sdk must installed first.) for 64-bit applications can enabled in directx control panel (64-bit) checking use debug version of direct3d 9 . problem: resets retail when control panel closed, , doesn't anything. (the 32-bit equivalent works.) kjell andersson found answer : the problem originates windows 7 update locked down hklm\software\microsoft\direct3d registry key user named trustedinstaller . made administrator not having rights update settings in registry key - not allowing switch debug version of direct3d 9. to fix problem have follow procedure: using regedit administrator, go hklm\software\microsoft\direct3d key. select permissions... context menu on key. press advanced button. go owner tab , select administrator owner. apply changes , close advanced settings. back in premissions dialog select administrators group , chec

How to use partial matching in if loop in google apps script -

in problem input number of spreadsheets. loop on these spreadsheets , find particular sheet inside it. said sheet have common prefix. eg setup(xyz). setup word common. need particular sheet. know matchtype cannot used here, please let me know problem of code. code: function myfunction() { var ss = spreadsheetapp.openbyid("1kba8twfnx1brjttwsiydtdl"); var sheets = ss.getsheets(); if (sheets.length > 1) { for( var in sheets){ if((sheets[i].getname()).matchtype.any == "setup(") {logger.log(sheets[i].getname()); logger.log("hello"); } logger.log("hello"); } } } matchtype has never been in javascript. use getname().indexof("setup(")>=0

emacs24 - Emacs: After Aquamacs update, Auto-Fill-Mode's Alt-q breaks lines at maths delimiter in LaTeX -

Image
after updated aquamacs, using alt-q (in auto-fill minor mode) fill paragraphs when editing latex document results in each line being broken @ first occurrence of latex maths closing delimiter, \) . (well, almost! see example below 1 exception.) version information: aquamacs 3.2 gnu emacs 24.4.51.2 . question how tell aquamacs/emacs/auto-fill mode not break lines @ first \) sees on line, fill in paragraph used before update? steps reproduce behaviour help -> diagnose , report bug -> start aquamacs without customizations "pristine" aquamacs window. open file named testemacs.tex , paste lorem ipsum text, twice make 2 paragraphs. add small maths expressions delimited latex delimiters \( , \) , @ random places in second paragraph. leave first paragraph is. type alt-x auto-fill-mode enable auto-fill mode. go each paragraph , type alt-q invoke fill-paragraph function. observe difference! see screenshot below: as can see, everywhere except on

PHP Export to CSV class -

i have written following class export database results csv file. <?php class export { public static function tocsv($results = array(), $fields = array()) { $schema_insert = '"'.implode('","', $fields).'"'; $out .= $schema_insert."\n"; foreach($results $row) { $schema_insert = ''; $schema_insert .= '"'.$row->week_ending.'",'; $schema_insert .= '"'.$row->project.'",'; $schema_insert .= '"'.$row->employee.'",'; $schema_insert .= '"'.$row->plots.'",'; $schema_insert .= '"'.$row->categories.'"'; $out .= $schema_insert."\n"; } header("cache-control: must-revalidate, post-check=0, pre-check=0"); header("content-length: &q

java - Action Listener not working in a MVC application -

i have following problem: have small application simple ui. implemented action listeners work there fine. however, action listener dialog window , save button refuses print out test message. the code rather lengthy put on hastebin convienience. http://hastebin.com/eqokilawiv.avrasm i suspect might have how controller handling adding optionswindow listeners. i have tried couple of things see if work: having seperate controller optionswindow implement action listeners exactlythe same mainwindow . sadly didn't fix issue. having maincontroller adding action listeners single buttonlistener class. having maincontroller add action listeners 2 different action listener classes. at point ran out of ideas , suspect might missing crucial understand why doesn't work. i'm pretty new when comes implementing mvc welcome feedback. you add actionlistener button created default constructor, in actionlistener: optionswindow = new optionswindow(mainw

android - pkg: /data/local/tmp.... Failure [INSTALL_CANCELED_BY_USER] -

i'm using android studio connect run app in xiaomi redmi note 3g device . my device found in choose device dialog, keep getting error : target device: xiomi-hm_note_1w-mzi78pzdhessrwmn uploading file local path: c:\users\fadzlan\androidstudioprojects\hybridsecurity\app\buj remote path: /data/local/tmp/com.fyp.fadzlan.hybridsecurity installing com.fyp.fadzlan.hybridsecurity device shell command: pm install -r "/data/local/tmp/com.fyp.fadzlan.hybridsecurty" pkg: /data/local/tmp/com.fyp.fadzlan.hybridsecurity failure [install_canceled_by_user] anyone knows how solve problem? it happened me well. figured out phone needs in active mode ( not sleep) when run app.

php - How do I use FTP_Implicit_SSL class to connect to Implicit SSL/TSL? -

i need connect ftp server implicit ssl/tls a quick google , found this chaps wrapper class but there no demo on how use it? can't see how or specify user name, password etc... i'm sure it's easy cannot see how set them. if run following code errors straight away: <?php include "../objects/shared/ftp-implicit-ssl-tls.php"; $ftp_implicit_ssl = new ftp_implicit_ssl(); ?> error: warning: missing argument 1 ftp_implicit_ssl::__construct(), called in c:\wamp\www_dev\ftp.php on line 4 , defined in c:\wamp\www\objects\shared\ftp-implicit-ssl-tls.php on line 35 do set credentials in class itself? surely not! i don't think read class carefully. when create new class need __construct() method , that's gets called when call new class() /** * connect ftp server on implicit ssl/tls * * * @access public * @since 1.0 * @param string $username * @param string $password * @param string $server

c# - Convert Func to Delegate -

this question has answer here: cast delegate func in c# 7 answers i have following delegate defined: public delegate object mydelegate(dynamic target); and have func<dynamic, object> object: func<dynamic, object> myfunc how can convert myfunc mydelegate ? i have tried these instructions, none of them worked: mydelegate mydeleg = myfunc; mydelegate mydeleg = (mydelegate) myfunc; mydelegate mydeleg = myfunc mydelegate; you can wrap existing delegate: (mydelegate)(x => myfunc(x)) or equivalently: mydelegate mydeleg = x => myfunc(x); this causes small performance loss on each invocation code simple.

java - In memory mongodb for read-intensive applications -

i have project in data readonly (no writes @ all) , each request couple of thousand reads performed , bottleneck getting data database. we're running tokumx on tmpfs (~12gb compressed database) , still slow serialization , socket communication take substantial time, wanted "cache" 1 critical collection of 4.5m documents accessed through single simple query. eventually, might migrate whole database in-memory data store make faster. for now, thinking of using plain hashmap loaded @ app startup, i'm not sure best way :) other options fongo made unit testing , i'm not sure fast enough kind of situation any suggestions use problem? i suggest check google library guava. https://github.com/google/guava with cache can load data @ app startup in case data not inside cache, can create function query database.

c# - ASP.NET MVC 4 Kendo Grid - ForeignKeyAttribute on property is not valid -

i trying navigate through table in order display text value instead of id , error: an exception of type 'system.invalidoperationexception' occurred in entityframework.dll not handled in user code additional information: foreignkeyattribute on property 'languageid' on type 'developmentnotesproject.models.noteform' not valid. navigation property 'language' not found on dependent type 'developmentnotesproject.models.noteform'. name value should valid navigation property name. it's been hours i've been trying solve problem in vain ... lot time code: view: @using kendo.mvc.ui @model developmentnotesproject.models.noteform @{ viewbag.title = "index"; } <script type="text/javascript"> function formatter(value) { return value.substring(0, 50); } </script> <section id="listing"> <h2>my notes</h2> @(html.kendo().grid<