Posts

Showing posts from March, 2011

normalization - MySQL Table Design - User Logon Times -

i need provide following data regarding member logins example: last hour 654 last day 15,648 last week 109,536 last month 460,051 last year 5,520,614 i wondering best possible structure of table hold information in mysql db. currently i'm thinking of storing: user datetime i expect large on time , become slow query. is there better way structure table information on logins - hourly, day, week, month, year etc? $current_time = strtotime(date('d-m-y g:i:s a')); $last_hour = $current_time - 3600; $last_day = $current_time - (3600*24); $last_week = strtotime("-1 week"); $last_month = strtotime("-1 month"); $last_year = strtotime("-1 year"); // count // count last hour $sql = "select count(user_id) cnt `your_table` datetime>='$last_hour' "; // count last day $sql = "select count(user_id) cnt `your_table` datetime>='$last_day' "; // count last week $sql = "select count(user_

java - Android Calendar Intent event end always one hour after start, API level 8+ -

i understand same title used before, specific question (and answer) used contentvalues class, api level 14+; program uses minimum of api level 8. use intent putextra add values calendar: calendar begintime = calendar.getinstance(); begintime.set(year, month, day, fromhour, frommin, 0); calendar endtime = calendar.getinstance(); endtime.set(year, month, day, tohour, tomin, 0); long startmillis = begintime.gettimeinmillis(); long endmillis = endtime.gettimeinmillis(); intent intent = new intent(intent.action_edit); intent.settype("vnd.android.cursor.item/event"); intent.putextra("begintime", startmillis); intent.putextra("allday", false); intent.putextra("endtime", endmillis); intent.putextra("title", strselected); intent.putextra("description", strselected+" &qu

ios - Titanium Appcelerator Alloy not supporting formFactor styles for widgets -

i have developed sample code in created widget having view adds image view inside it. works perfect when apply styles tss of controller directly when "formfactor" used it's not working. clarify same please check code placed here. you can create new alloy project , test same following code: note: dependencies included in config.json widget implementation: widget.xml <alloy> <view id="section" class="section"></view> </alloy> widget.tss ".section":{ backgroundcolor: 'red', layout : 'vertical' }, widget.js var args = arguments[0] || {}; $.section.applyproperties(args); $.setdata = function(view) { $.section.add(view); } coding index page index.xml <alloy> <scrollview class="baseview"> <widget id="contentview" class="contentview" src="com.investis.scrollablesection"></widget> </scrollview> &

javascript - Use iframe for mvvm design pattern -

is idea use iframe mvvm pattern? using knockout js similate mvvm design pattern in c#. thinking of making independent components own html files (view) corresponding .js file (model) them, , render them using iframe whenever pages needs them. way can create many reusable components. can 1 please explain in details pros , cons of doing so? thanks using frames in web development, important parts of page, bad idea. should used embedding 3rd party plugins (like shoutbox). other stuff should use partial postbacks ajax instead (if need kind of behavior). can create reusable parts/controls both mvc , webforms frameworks, shouldn't have problems. if need know why frames bad idea, google it, there has been way many talks already.

php - How can I get array like this -

//i have array below: $a =array('1,2,6'); $b =array('2,3,1'); //then using arraycombine : $arr_combine = array_combine( $a, $b ); //output: //array( [1,2,6] => 2,3,1 ) ; how can array below? //output: array( 1=>2, 2=>3, 6=>1 ); if have array that, have explode element. $result = array_combine(explode(',', $a[0]), explode(',', $b[0]));

c# - How do I swap two characters in a string variable? -

i have string variable. want swap 2 characters in string word. want randomly swap 2 characters close each other. this have done: have done in words error. string word = txtword.text; random rand = new random(); int randomnumber= rand.next(0, word.length); string swappedword = swapcharacters(lastword, randomnumber, randomnumber + 1); private string swapcharacters(string value, int position1, int position2) { char[] array = value.tochararray(); // convert string char array char temp = array[position1]; // temporary copy of character array[position1] = array[position2]; // assign element array[position2] = temp; // assign element return new string(array); // return string } just change line below: int randomnumber= rand.next(0, word.length -1 ); let's see if works.

java - Array deep copy and shallow copy -

i'm learning deep copy , shallow copy. if have 2 arrays: int[]arr1={1,2,3,4,5}; int[]arr2={1,2,3,4,5}; question : both arrays point same references [1][2][3][4][5] . what happen if change arr1[2] ?does changes arr2[2] ? when pass array (random array, not arr1 or arr2 ) main method compiler makes shallow copy of array method, right? if java compiler re-written make , send deep copy of array data method. happens original array in main? think original array may change according method , pass main. not sure. question: both arrays point same references [1][2][3][4][5]. not exactly. arrays have identical content. being said, per initialization, data using not shared . initializing however: int[]arr1={1,2,3,4,5}; int[] arr2 = arr1 what happen if change arr1[2]?does changes arr2[2]? as per answer above question, no not. however, if change initialization mechanism per 1 pointed out, would. when pass array (random array, not arr1 or arr2) m

birt report viewer how to show all results on same page -

Image
i have report large number of rows displaying data set. when preview report in birt report viewer eclipse report designer (during development) allows me scroll , see rows in report without having skip pages. however when see same report in birt report viewer web application (java), report viewer shows 50 rows per page , have click on next page button not want. using report designer have set page break interval 200 , avoid before, after , inside still in web application doesn't show results in same page in eclipse. can me setting missing show results on same page please. here how embedd report viewer jsp.... <birt:viewer id="birtviewer" reportdesign="resources/reports/${reportname}.rptdesign" pattern="frameset" format="html" height="600" width="900" titl

php - Checkbox is missing in related products in magento -

i'm using magento c.e 1.7. product view page coming easytabs since i'm using easy tabs plugin. related products viewing easytabs. problem is, of products not having checkbox in related products list. checked stock availability, required options etc in admin. no problem product settings. code below <div class="box-collateral box-description"> <?php if($this->getitems()->getsize()): ?> <p class="test"><strong><?php echo $this->__('check items add cart or') ?>&nbsp;<a href="#" onclick="selectallrelated(this);return false;"><?php echo $this->__('select all') ?></a></strong></p> <ol class="tabsrelated"> <?php foreach($this->getitems() $_item): ?> <li <?php if($_item->iscomposite() || !$_item->issaleable()): ?> class="super-products"<?php endif; ?> id=&quo

c - How to check the given folder is a mount point -

i have test given folder path mount point or in local system c code. i read on net /etc/mtab file have entry mounted point. can check file system call or function check mount point. my kernel version 2.6.28.10 . these functions can used data structure access mtab file: file * setmntent(const char *file, const char *mode) int endmntent (file *stream) struct mntent * getmntent (file *stream) struct mntent * getmntent_r (file *stream, struct mentent *result, char *buffer, int bufsize) int addmntent (file *stream, const struct mntent *mnt) char * hasmntopt (const struct mntent *mnt, const char *opt) for more details these functions refer man page.

oracle - I am inserting millions of records in a table and in other session I want to know the status of the same -

i inserting millions of records in table in other session want know status of same how many records have been processed, no commit issued in first session query v$session_longops . not 100% gives sense of session state.

Enabling/disabling bookmarks in Visual Studio -

Image
my bookmark window looks this: yesterday though , out of there 1 check box @ left of each bookmark. until didn't know (or didn't care) can enable , disable bookmarks in visual studio (2012). today checkboxes gone. :-( can still enable , disable them via menu option edit -> bookmarks -> enable bookmark. assign function shortcut key combo, guess. but how can check boxes back? update: same applies vs2013. update: ... , vs2015. from point of view vs-bug. my checkboxes "away" or better seems away. when click position checkbox still works. means: when click left bookmark "flag" (where check box is) bookmarks still can enable/disabled.

Check browser version using Dart rather than JS? -

Image
is there "angular/dart" way detect older unsupported browsers , prevent continue elegant message (there plenty of examples using javascript) rather continue , show weird layout code doesn't work? even angulardart.org/demo site should imo stop ie8 (i know, enterprise customers still have old browsers installed - , set default - legacy apps) showing content doesn't work. if dart code cannot executed test has done in js. i'm not aware of library makes test. the test should follow what browsers support javascript compilation targets? .

r - Function to generate a random password -

i want generate random password employees function below. first attempt functions in r. need bit help. genpsw <- function(num, len=8) { # vorgaben für die passwortkonventionen festlegen myarr <- c("", 2, 3, 4, 5, 6, 7, 8, 9, "a", "b", "c", "d", "e", "f", "g", "h", "j", "k", "l", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", &

ajax php javascript php page open, parameters not being passed -

Image
i having trouble pass values php page, don't know whats wrong, know error occurs @ xmlhttp.open. tried lots of stuff, cant figure out. heres code: html: <html> <head> <script> function getvote(i, j) { if (window.xmlhttprequest) {// code ie7+, firefox, chrome, opera, safari xmlhttp=new xmlhttprequest(); } else {// code ie6, ie5 xmlhttp=new activexobject("microsoft.xmlhttp"); } xmlhttp.onreadystatechange = function() { if (xmlhttp.readystate==4 && xmlhttp.status==200) { document.getelementbyid("poll").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","poll_vote.php?vote1="+i+"&vote2="+j,true); xmlhttp.send(); //document.write(i + ' ' + j); } </script> </head> <body> <div id="poll"> <h3>are skier, or stout on board mon? either way, lets see if shred...</h3> <form&

javascript - Unable to bind function on dynamically created element -

this question has answer here: event binding on dynamically created elements? 19 answers i'm creating simple shopping cart javascript, , shopping cart without button remove item be? the cart created on-the-fly javascript, elements won't exist on page load. however, shouldn't problem this? $(".removefromcart").on("click",function(e){ alert("go away please.."); var tuoteid = $(this).attr("data-id"); deletefromcart(tuoteid); }); the element (created on fly) looks this: <a href="#" class="removefromcart" data-id="2">×</a> but won't trigger. if replace .replacefromcart with, example, p , trigger every time click on paragraph. this isn't first time i'm having problems .on() , takes half of hair solve, maybe more experience point me i'm doi

How to paste text into Vim Visual Mode? -

i working in vim , paste yanked text visual mode. possible? the p command works in visual mode, (cp. :help v_p ). however, default register contents overwritten. (my replacewithregister plugin has alternative command keeps it.) alternatively, can s or c replace visual selection, , use 1 of insert mode commands <c-r>{register} insert register contents. pasting default register, need use "_s avoid overwriting contents.

c# - IIS & Chrome: failed to load resource: net::ERR_INCOMPLETE_CHUNKED_ENCODING -

i came across chrome issue think worth sharing you. i worked on self written api using httphandler primary should return json data. when error occures wanted display html file. worked pretty in ie , ff, not in chrome. looking developer tools revealed error: net::err_incomplete_chunked_encoding google said not issue while seen much. got know was, magically disappearing after time. i found out lays on lines of code: result.storeresult(context); context.response.flush(); context.response.close(); //<-- causes error after removing last line worked well. don´t know why chrome had/has issue that, seemed if closed response stream before chrome finished reading it. i hope helps of coming across same or similar issue. now question: how best pratice in closing/flushing response stream? there rules? according asp.net sets transfer encoding chunked on premature flushing response : asp.net transfers data client in chunked encoding (transfer-encoding: chunked), i

PHP - Use value from array outside of the array -

i have array contains multiple other arrays. these arrays have value called [note] references variable called $thenote located above/outside array. variable holds simple template few spans. $thenote = '<span class="icon"></span><span>hello name $thename</span>'; i have array called client_infos contains multiple arrays inside like 'client_infos' => array ( array ( 'name' => 'john smith', 'note' => $thenote, 'prepend' => '', 'append' => '', 'formatting' => 'html', ), array ( 'name' => 'mary smith', 'note' => $thenote, 'prepend' => '', 'append' => '', 'formatting' => 'html', ), ); there unknown nu

ios - The app references non-public selectors in Payload/<Appname>.app/<App name>: FailWithError: , topMostAlert -

Image
on apple application uploader got error: the app references non-public selectors in payload/<appname>.app/<app name>: failwitherror: , topmostalert . i searched code failwitherror: , topmostalert . didnt find these in code except topmostalert used dismiss uialertview class uialertmanager = nsclassfromstring(@"_uialertmanager"); uialertview *alertview = [uialertmanager performselector:@selector(topmostalert)]; [alertview dismisswithclickedbuttonindex:0 animated:no]; i know error because of using selector in own code or third party code has same name selector marked non-public (apple provided api). i adding screenshot of framework used in code. you got rejected because using private class uialertmanager (via _uialertmanager ). change code uses public apis , through review process.

sql - MySQL is not using prmary index -

i have query: select sql_no_cache count(*) `numrows` (`citations`) left join `projects` on `projects`.`project_id` = `citations`.`project_id` left join `users` on `users`.`user_id` = `projects`.`user_id` `users`.`role` = '0' , `citations`.`created` between 1360213200 , 1360299599 , `citations`.`in_card` = '0' , `citations`.`citation_id` not in (select user_stats_citations.citation_id user_stats_citations, user_stats force index (user_stats_type_index) user_stats_citations.user_stat_id = user_stats.id , user_stats.type in (69 , 70, 71, 75, 76)); i have indexes on user table: users 0 primary 1 user_id 42836 (null) (null) btree users 1 users_industry_id_index 1 industry_id 118

node.js - How to access a web application running on Mesos? -

i'm quite new mesos, , i'm still trying wrap head around concepts , ideas. far think have understood mesos tries abstract away data center , present 1 big computer. using mesos + docker integration possible run any application on mesos, long application can run inside docker container. this makes me expect can use mesos run node.js applications. shouldn't hard set up. i need create new application, set instances & co., , go it. mesos deploys application , takes care of distributing on data center. when asking mesos endpoints can find out ip addresses / host names , ports created. but, of course, want web application available @ specific domain or subdomain, ideally port 80 or 443, using load-balancing , high-availability. there anything built mesos can use that? have @ haproxy (load balancer), application might run on node , in case of failure migrated node (and need update ip address of our app). marathon framework (sort of init.d mesos) can cu

css - How to edit and save 8 bit indexed color logo? -

Image
i bought re/max fransichzing , need edit official logo remax.com in adobe photoshop. but there little problem editing logo in photoshop. if open png logo, layer wierd - image in 8 bit indexed color: logo must transparent on remax dot com. can me how can edit this? you can change image mode , bit depth in image > mode menu in photoshop. if wanted change rgb you'd click on image > mode > rgb colour . also if have permission use , don't need enlarge snatch image homepage's sprite.

xml serialization - c# Serializable Get the attribute and value from a list item -

i'm hoping can me following. i'm trying item description , value following xml in c# <houselist> <house key="bungalow" description="bungalow house"> <houseitem description="bedroom">4</houseitem> <houseitem description="bathroom">3</houseitem> <houseitem description="kitchen">2</houseitem> </house> </houselist> at moment i'm trying this: [serializable] [xmltype(typename = "house")] public class house { private string key; private string description; private list<houseitem> items; ...... public list<linkitem> items { { return items; } set { items = value; } } [serializable] [xmltype(typename = "houseitem")] public class houseitem { private string value; private string description; [xmlattribute(attributename = "description")] public string description

doxygen - How to document screen / console / terminal input and output -

what best way document console input , output? in docbook have used (screen) , (programlisting) can't find similar tag in doxygen. i need 2 formats. listing of console commands seen in script whic can copy pasted, like: touch foo ls -hg foo and other format seen on screen output: joe@car:~$ touch joe@car:~$ ls -hg foo ls: cannot access foo: no such file or directory -rw-r--r-- 1 joe 9.3k mar 5 10:23 thanks/hans i think want @verbatim / @endverbatim . alternatively @code may equivalent programlisting mode, think verbatim suits needs better. the format of resulting text can adjusted in css file, if want particular font etc.

r - create binary matrix from data.frame -

how can create binary matrix data.frame 2 columns first column represents e.g. species , other region? data.frame in tall format seen below species region species1 1 species1 2 species1 3 species2 2 species2 4 species2 5 species2 6 species3 1 species3 2 species4 5 species5 3 species5 4 and matrix have unique species rows , unique regions columns. matrix filled 1s species present , 0s species absent, below 1 2 3 4 5 6 species1 1 1 1 0 0 0 species2 0 1 0 1 1 1 species3 1 1 0 0 0 0 species4 0 0 0 0 1 0 species5 0 0 1 1 0 0 any pointers appreciated, thanks! you looking function table documentation here if data.frame df , have do table(df)

php - .htaccess RewriteRule index -

first of apologize english. i'm trying make pretty urls. unfortunately have little experience in area. .htaccess file contents like: rewriteengine on rewriterule index/(.*)/(.*)/ index.php?category=$1&page=$2 rewriterule index/(.*)/(.*) index.php?category=$1&page=$2 rewriterule index/(.*)/ index.php?category=$1 rewriterule index/(.*) index.php?category=$1 rewriterule index/ index.php rewriterule index index.php it works. rewriting link like: site.com/index/department/workers to: site.com/index.php?category=department&page=workers so index.php can work link. if there no "page" parameter third or fourth rule handles link. , on. the problem in address bar there "index". link site.com/department/workers (without index) is possible? or can give me advice how can rewrite rules? you can remove index rewrite rules. ensure account requests match real files e.g.: directoryindex index.php rewriteengine on rewritecond %{req

Override LESS variable in CSS selector -

i'm looking method override less variable within css selector. example below doesn't work: @main: #01b2bb; body.purple{ @main: #937cb8; } #wrapper header{background-color: @main} i expected #937cb8 output when body have class purple. commonly often less, 1 have different variable files serve a different set of css (a different file) for, in case, body.purple css, @main defined globally in variable file #937cb8 (and "purple" variable file). keeps css code reduced, require 1 serve new file on class change of body . optionally if, however, want class distinction within single css file, better abstract code out more, keep more manageable keeping color defining within 1 mixin: less .setcolors() { @main: #01b2bb; //default .purple & { @main: #937cb8; .setcss(); } .red & { @main: #ff0000; .setcss(); } .blue & { @main: #0000ff; .setcss(); } } #wrapper header { .setcolors(); .setcs

How I can merge sub-document (as array) on mongodb collection -

hello have collection: { "_id" : objectid("508d27069cc1ae293b36928d"), "title" : "this title", "body" : "this body text.", "created_date" : isodate("2012-10-28t12:41:39.110z"), "comments" : [ { "subject" : "this coment 1", "body" : "this body of comment 1.", "author_id" : objectid("508d345f9cc1ae293b369296"), "created_date" : isodate("2012-10-28t13:34:23.929z") }, { "subject" : "this coment 2", "body" : "this body of comment 2.", "author_id" : objectid("508d34739cc1ae293b369297"), "created_date" : isodate("2012-10-28t13:34:43.192z") }, { "subject" : "this

Retrieve INTEGER values from excel using JAVA -

Image
my aim read excel file uisng poi , print values present in it. if value 5 output must 5. returning 5.0. below code have tried. fileinputstream fileinputstream = null; xssfsheet xssfresultsheet = null; string filepath = "c:\\myxcel.xlsx"; fileinputstream = new fileinputstream(new file(filepath)); xssfworkbook workbook = null; workbook = new xssfworkbook(fileinputstream); xssfresultsheet = workbook.getsheet("sheet1"); int irowcount = xssfresultsheet.getlastrownum(); (int = 1; <= irowcount; i++) { row resultrow = xssfresultsheet.getrow(i); system.out.println(resultrow.getcell(0)); } my excel has values 1,2,3 output 1.0,2.0,3.0. instead output should 1,2,3 change: system.out.println(resultrow.getcell(0)); to: system.out.println(new dataformatter().formatcellvalue(resultrow.getcell(0))); explanation: apache-poi provides dataformatter class utility leverage format of content as app

regex - Regular Expression for Amount Entry in uitextField in ios -

please 1 me achieve this, need implement validation amount text field. here's regex need allow allows 1-6 digits before , 1-2 digits after dot. had try these ways, didn't solution. 1) http://www.mpatric.com/2012-07-13-fomatting-ios-text-input-on-the-fly 2) regular expression in ios i haven't worked on ios before, don't know ios specific behavior regexes. check if works. ^(\d){1,6}\.(\d){1,2}$

javascript - PHP Registration Form not processing AJAX data -

i may being stupid, trying process registration form using ajax call php page. php page working on it's own, when try post form data php page through ajax nothing happens. this ajax call: $(document).ready(function ($) { $("#register").submit(function(event) { event.preventdefault(); $("#message").html(''); var values = $(this).serialize(); $.ajax({ url: "http://cs11ke.icsnewmedia.net/dvprototype/external-data/register.php", type: "post", data: values, success: function (data) { $("#message").html(data); } }); }); }); this form: <div id="registerform"> <form method='post' id='register'> <h3>register</h3> <p>fill in

Copying Linked List in C -

i wrote function copies linked list. unfortunately doesn't copy list completely. node *copy(node *list) { node *copy2; while(list != null) { copy2 = malloc(sizeof(node)); memcpy(copy2,list,sizeof(node)); list = list->next; if(list != null) { copy2->next = malloc(sizeof(node)); copy2 = copy2->next; } } return copy2; } it gives last element , has lots of memory leaks. you don't need 2 malloc each element. you need keep both reference @ head of list , @ current copied element you need keep pointer reference change pointer inside previous node. try this. node *copy(node *list) { node *newlist = null; node **newit = &newlist; while(list!=null) { *newit = malloc(sizeof(node)); memcpy(*newit,list,sizeof(node)); list = list->next; newit = &((*newit)->next); } return newlist; }

javascript - GetElementsByClassName - can't write the function to use the returned array -

i have posted already, think question poorly explained. have multiple divs class of "popupedit". want able target these using getelementsbyclassname.....the result being popup input field. see code below. i know getelementsbyclassname returns array of elements class editquestion, have failed write function works use array. lack of skill (i'm newbie). could give me solution have can study. apologies asking directly answer...i have tried numerous things without success. many thanks html <button class="editquestion">edit</button> <div class="overlay2"></div> <div class="popupedit"> <h2>edit question, input box here..</h2> <button class="closebtn2">close</button> </div> js window.onload = function () { document.getelementsbyclassname("editquestion").onclick = function () { var overlay2 = document.getelementsbyclas

Integer/ int autoboxing query with generic functions in Java -

okay, trying write generic sorting package in java (i'm taking algorithms course , see practice, both in algorithmic sense , in java i'm new language). anyway, figure best way create sort class multiple sorting methods within, such insertionsort , mergesort etc. if feel there's better way of doing this, please let me know comment open suggestions writing cleaner , more efficient code. as question: i have backbone structure down , want try coding insertionsort method first. however, have tried pass integer array getting problems. firstly, generics understand have use <integer> opposed <int> , reason if create array such int[] arr = new int[]{..} , pass in generic not work. how fix without using integer[] arr = new integer[]{..} ? under impression compiler box int integer automatically? my code: public class sort<t> { public t[] insertionsort(t[] array) { // stuff return array; } public static void main(string[

Enterprise Wlan - Ubiquiti UniFi - connection issues -

our company has several issues ubiquiti unifi enterprise w-lan solution. we´re using these acess points our whole building(2 floors – 3000 m2). every strategically postion equipped unifi 3.1.4(upgraded 2.x.x) access point. we have 40 active users/access point. for example, if user connected ap1 walks down floor , reaches range of ap1 notebooks connects different ap should wont choose „best“ one. same issue workplace employees, can sit in front of desk , client connects different ap´s without reason, results in connection errors , broken voice calls. any ideas? best rick additional information: we tested several firmware versions without effect we set transmit power of each ap maximum we have unstable pings each ap sometimes there connection no packets transmitted we tested different channels prevent signal overlaying there couple of things try. on controller, when creating wlan group, enable zero-handoff on frequency using. in wlan group setting

android - How to get Google maps API - API key -

i trying google maps working on app. understand need api key put in manifest file. ok far good. have done , have registered app , stuck on screen showing me information app (that have entered before) , nothing more. don't see keys nor nothing. there else do? https://developers.google.com/maps/documentation/android/start read , go step step, answers.

c# - Write to text files -

totally new this. depending on event button click need write appropriate text file. however, input data writes same text file. how specify appropriate text file writes , saved. the coding, identical apart name of text file, i'm using is: private void btnitemadd_click(object sender, eventargs e) { string sitem; string snumber; if (rdodrinks.checked == false && rdoconfectionary.checked == false) { //message remind user select category messagebox.show("please select category"); txtitem.focus(); } { { if ((rdodrinks.checked == true) && (txtitem.text != "") && (txtitemnumber.text == "")) //message remind user enter number messagebox.show("please input number"); txtitemnumber.focus(); if ((txtitem.text != "") && (txtitemnumber.text != "")) {

How to change spring security oauth2 default token endpoint? -

we have spring security oauth2 based application. every thing working fine. failed change default token endpoint "/oauth/token" "/external/oauth/token". my spring-servlet.xml <http pattern="/external/oauth/token" create-session="stateless" authentication-manager-ref="clientauthenticationmanager" use-expressions="true" xmlns="http://www.springframework.org/schema/security"> <intercept-url pattern="/external/oauth/token" access="isfullyauthenticated()" /> <anonymous enabled="false" /> <http-basic entry-point-ref="clientauthenticationentrypoint" /> <!-- include if need authenticate clients via request parameters --> <custom-filter ref="clientcredentialstokenendpointfilter" after="basic_auth_filter" /> <access-denied-handler ref="oauthaccessdeniedhandler"/

excel - Median of specific transactions -

Image
i have following sheet: i take median rows k . i know how take median of transactions. hard part me "search k , take transactions". any recommendations how solve this? i appreciate answer! something should work: =median(if(a2:a16="k",b2:b16)) and press ctrl + shift + enter evaluate it

ios - UIScrollView not active when zoom -

my problem are: i implement uiscrollview (drawview)to draw on it(task ok). i drag scrollview viewcontroller using storyboard , assign drawview class it. i using pink gesture zoom 1 element in drawview, correct, when element out of size drawview cant scroll see part of element. in file viewcontroller.m - (void)viewdidload { [super viewdidload]; [self.drawingview setscrollenabled:yes]; [self.drawingview setcontentsize:cgsizemake(100, 200)]; } can give me way solution problem or tutorial same? thank sorry bad grammar set content size of scrollview size of element adding it. say elementview view adding scroll view then, [self.drawingview setcontentsize:elementview.size];

javascript - jQuery auto load a div after a 5sec -

i have 4 div bars in home page. i'm loading div bars on click. want load the 1st div when page loading, 2nd div should load after 5 seconds. after 5 sec 3rd div should load wise. code : - $(document).ready(function () { $('#click1').click(function () { $('#desc1').toggle(400); $('#desc2').hide(); $('#desc3').hide(); $('#desc4').hide(); $('#desc5').hide(); }); }); thnx, var delay=5000; $(document).ready(function () { $('#desc1').toggle(function(){ $('#desc2').toggle(delay,function(){ $('#desc3').toggle(delay,function(){ $('#desc4').toggle(delay,function(){ $('#desc5').toggle(delay,function(){ }); }); }); }); }); });

ruby on rails - Nokogiri: Finding and XML element then adding child elements -

i have xml document , want add child elements under element name 'initgpty' , i'm attempting follows: filename = "#{payment.updated_at.strftime("%y%m%d")}.xml" file_contents = file.read("#{filename}") doc = nokogiri::xml(file_contents) initgpty = doc.at_xpath("//initgpty") first_id_tag = nokogiri::xml::node.new "id", doc initgpty.add_next_sibling(first_id_tag) the problem that initgpty = doc.at_xpath("//initgpty") returns nil i'm getting nomethoderror on .add_next_sibling. first time working both xml , nokogiri but, me, xml generated doc = nokogiri::xml(file_contents) looks strange. here's snippet line outputs in rails console: #<nokogiri::xml::element:0x58d9582 name="initgpty" namespace=#<nokogiri::xml::namespace:0x58ce1be href="urn:iso:std:iso:20022:tech:xsd:pain.008.003.02"> children=[#<nokogiri::xml::text:0x58d92d0 "\n ">, #<noko

javascript - Correct way to reference children in reactjs -

i looking facebook's react.js , found cool far. tried make simple folder sturcture, can open , close each folder. structure looks this <folder> <header/> <content/> </folder> clicking on header results in folder hiding/showing content. done via state. but want have multiple folders , 'toggle all' button. how button toggle children without creating big clutter? used refs address them, think bad practice the documentation states: ...your first inclination going to try use refs "make things happen" in app... ...think state should owned in component hierarchy. often, becomes clear proper place "own" state @ higher level in hierarchy. i created fiddle demonstrate whole thing. working don't think that's solution. ps (bonus question): better hide content not rendering (like done in fiddle), or add 'display : none;' styletag? correct way reference children in reactjs ->

css - bootstrap 3 - collapse menu earlier -

trying figure out how can collapse menu earlier? there easy way in bootstrap 3? the problem code atm, opens, , closes automatic? don't understand why happening. @media (max-width: 970px) { .navbar-header { float: none; } .navbar-toggle { display: block; } .navbar-collapse { border-top: 1px solid transparent; box-shadow: inset 0 1px 0 rgba(255,255,255,0.1); } .navbar-collapse.collapse { display: none!important; } .navbar-nav { float: none!important; margin: 7.5px -15px; } .navbar-nav>li { float: none; } .navbar-nav>li>a { padding-top: 10px; padding-bottom: 10px; } } html: <div class="top_menu_wrap"> <div class="navbar-header navbar-right"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <s

Cannot Determine Location In Android -

Image
i trying create android showing user's location in map-view.but when run app says "can't determinate location" .i in stuck .can me code or link guide on how implement correctly? here code: public class mymaplocationactivity extends mapactivity { private mapview mapview; private mylocationoverlay mylocationoverlay; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); // main.xml contains mapview setcontentview(r.layout.main); // extract mapview layout mapview = (mapview) findviewbyid(r.id.mapview); mapview.setbuiltinzoomcontrols(true); // create overlay shows our current location mylocationoverlay = new fixedmylocationoverlay(this, mapview); // add overlay mapview , refresh mapview.getoverlays().add(mylocationoverlay); mapview.postinvalidate(); // call convenience method zooms map on our location zoomtomylocation(); }

php - Extend Magento REST API in custom module -

i want use magento rest-api add custom data magento table. have added 1 table magento db , created module rest api using following link http://web.archive.org/web/20130512072025/http://magepim.com/news/extending-the-magento-rest-api-part-1_13 now want add data magento table using rest api... what need changed in api.xml / api2.xml or in v1.php file. kindly me have tried many codes using reference of product api2.xml file. no luck. when run following url http://magento-host/api/rest/magepim/products/count it executed v1.php file's _retrieve() function how call _create() function using php restapi oauth magento\app\code\core\mage\api2\model\resource.php allowed collection action type create method.. changed in api2.xml file , setup required fields in attribute tag magento\app\code\community\magepim\extapi\etc\api2.xml <?xml version="1.0"?> <config> <api2> <resource_groups> <extapi transla