Posts

Showing posts from March, 2011

internet explorer - Selenium python click on span class -

i trying automate intranet site. source code bunch of tables , consists of hundreds of codes below: <span id="gridview1_ctl51_lblcasetype"></span> </td><td nowrap="nowrap"> <span class="fakelink" title="edit case" onmouseenter="this.focus()" onclick="editcase('286658')"> 286658</span> </td><td nowrap="nowrap">1360428-0000</td><td align="center" style="color:red;"> <span id="gridview1_ctl51_label2">13,0</span> </td><td align="center"> <span id="gridview1_ctl51_label2">8,8</span> </td><td align="center"> <span id="gridview1_ctl51_label9">r</span> </td><td> <span id="gridview1_ctl51_label6">waiting info fr. suppl.</span> </td><td> <span id="gridview1_ctl51_label11&qu

sorting unique values in an array with Ruby -

is there way write method in ruby takes array of items , returns array without duplicates. without using ruby’s uniq method? so, output of array [1,5,"frog", 2,1,3,"frog"] [1,5,"frog",2,3] you getting unexpected end-of-input because using parenthesis instead of braces denote block. try: my_array.to_a.select{ |i| != } but isn't quite you'd expect. here alternative: my_array.group_by{|item| item}.keys hope helps

css - YUI3 Y.Panel - How to hide HTML contents while page is loading? -

i have panel i'm using modal dialog box, , such contents should hidden view while page loading. however, if use css set div's display:none or visibility:hidden yui show() & hide() methods don't work (eg, clicking button call modal dialog greys out screen, referenced div not appear). can point me towards best way this? thanks! try adding yui3-widget-loading container div . when y.panel instantiated, remove class. can define .yui3-widget-loading { display:none; } not visible during page load.

hadoop - Getting java.lang.NoSuchFieldError: INT_8 error while running spark job through oozie -

i getting java.lang.nosuchfielderror: int_8 error when trying execute spark job using oozie on cloudera 5.5.1 version. on appreciated. please find error stackstrace below. 16/01/28 11:21:17 warn tasksetmanager: lost task 0.2 in stage 20.0 (tid 40, zlab-physrv1): java.lang.nosuchfielderror: int_8 @ org.apache.spark.sql.execution.datasources.parquet.catalystschemaconverter.convertfield(catalystschemaconverter.scala:327) @ org.apache.spark.sql.execution.datasources.parquet.catalystschemaconverter.convertfield(catalystschemaconverter.scala:312) @ org.apache.spark.sql.execution.datasources.parquet.catalystschemaconverter$$anonfun$convertfield$1.apply(catalystschemaconverter.scala:517) @ org.apache.spark.sql.execution.datasources.parquet.catalystschemaconverter$$anonfun$convertfield$1.apply(catalystschemaconverter.scala:516) @ scala.collection.indexedseqoptimized$class.foldl(indexedseqoptimized.scala:51) @ scala.collection.indexedseqoptimized$class.foldleft(in

php - URL perfectly working on localhost, not working on web server -

i've tried other solutions posted here, nothing worked.. i have following code on .htaccess doc. rewriteengine on rewriterule ^registrationform/([a-za-z0-9_-]+)$ registrationform.php?code=$1 rewriterule ^registrationform/([a-za-z0-9_-]+)/$ registrationform.php?code=$1 i receive email , clicking on url access registrationform.php i start registrationform.php that: <?php if (!empty($_get['code']) && isset($_get['code'])) { $code=$_get['code']; do knows why works on localhost not on remote server? the problem not how got code running in acquiring code. problem have occurred here. if (!empty($_get['code']) && isset($_get['code'])) { $code=$_get['code']; the line of code above not able code part part of querystring. querystring has been generated doesn't have word code in it. may want read this article .

how to? bootstrap - 2 Columns with 3 rows with equal height? -

i have 2 columns 3 "rows" (or 3 items). want have row 1 in both columns same height, in row 2 , row 3 same. i know how 3 rows having 2 columns. using 3 rows 2 columns not work on small device, because left columns should first , right column @ end. i want on desktop like: a1|b1 a1|right row same height, less content a1 a2|b2 no content|b2 no content|b2 a3|b3 on mobile should be: a1 a2 a3 b1 b2 b3 if use 3 rows 2 columns work equal height each row on desktop, on mobile have: a1 b1 a2 b2 a3 b3 your specific required cannot solved constructing 3 row 2 column. you should try wrap leftone(s) single div , rightone(s) single div. this <div id="left" class="col-md-8"> a1<br></br> a2<br></br> a3<br></br> </div> <div id="right" class="col-md-8"> b1<br></br> b2<br></br> b3<br></br> </div> this way in norma

OSX Anaconda default python -

i have anaconda distribution installed on macbook local home directory /users/simon/anaconda when open iterm , type python see default osx install of python. saw thread here , implemented fix mentioned: mac using default python despite anaconda install my .bash_profile looks this: export path="$home/anaconda/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$path" a few strange things happen: when type python still see osx python despite having changed .bash_profile if source /users/simon/.bash_profile fixes problem. using python brings anaconda's python when quit iterm or restart computer , try load python again, goes osx version. .bash_profile remains unchanged. when try of above using terminal works fine. issues described above appear specific iterm2 , i'm not sure why how system use anacondas python instead of osx version? it seems $path redefined somewhere else in configuration. doesn't cause issue if know in order loaded

jquery - Rebind DropDownList in KendoGrid, depending on Value Selected in other DropDownList on the same row -

Image
this common problem, dont know how figure out kendoui widgets , javascript. have kendogrid datasource coming ajax call web services. data bound columns. 2 columns (source , destination) 2 drop down lists: each column defined if (stringstartswith(coltitle, 'source')) { columns.push({ field: dataitem.replace(/\s+/g, ''), title: coltitle, width: 150, locked: false, editor: sourcedropdowneditor, //template: "#=sourcetankidentifier#", attributes: { style: "text-align: left" }, type: "text" }); } and sourcedropdowneditor follow: function sourcedropdowneditor(container, options) { $('<input id="sourcesdropdownlist" required data-text-field="source" data-value

sql server - How to select the 2 newest entries in a SQL database -

i new sql , dont have knowledge on subject yet , have problem. trying select data database tables using query: select distinct upper(m.name) 'member name', m.memberid 'member id', (b.booktitle + ' / ' + a.firstname + ' ' + a.lastname) 'title', l.barcode 'barcode', (convert(varchar(8), lr.duedate, 5) + ' renewed ' + convert(varchar(1), (select count(lr.loanid) loan l, loanrenewal lr lr.loanid = l.loanid , l.memberid = 's002')) + ' times') 'status', bc.callnumber 'call number' book b, author a, bookauthor ba, bookcopy bc, member m, membertype mt, loan l, loanrenewal lr, publishwork pw m.memberid = 's002' , m.memberid = l.memberid , l.loanid = lr.loanid , l.barcode = bc.barcode , bc.isbn = pw.isbn , pw.bookid = b.bookid , ba.bookid = b.bookid , b.main_authorid = a.authorid

How to display filter in google analytics -

i have google analytics account 1 domain, lets call mydomain, on domain there subfolder (/mysubfolder/) reports for. therefore created filter in admin tab - view - filter filter out data based on . how can create 1 report show data based on filter, , 1 report show data top domain (without subfolder)?

debug javascript function with parameters -

i have website javascript , when move mouse on website, there function triggered. need debug whole javascript code step step when executed. need find out function called (and parameters too). how can - should use this? real time debugger? edit: see script loaded url (my site mydomain.tld, second script loads seconddomain.tld). second script obfuscated/minimized , control clicks on website (when clicked, triggers 1 function). possible javascript on site call function in second script? if yes, how please. i need find out function called in console (firebug, developer tools, etc.) can click profile button or use commands: console.profile(); //... console.profileend(); and display functions called during profiling. then can use debugger; command inside functions mentions.

html - Display Video Frame in Mobile -

Image
how display frame of video in mobile? <video width="100%" height="100%" type="video/mp4"> <source src="{{ asset('videos/home_1.mp4') }}" type="video/mp4"> </video> the actual output (ios): in android doesn't display play button user might not know there video can played. for mobile devices can make use of poster attribute of <video> tag. please check the fiddle here . controls optional attribute can added video tag bottom bar play, volume controls. <video width="100%" height="100%" controls poster="https://cdn.photographylife.com/wp-content/uploads/2014/06/nikon-d810-image-sample-6.jpg"> <source src="{{ asset('videos/home_1.mp4') }}" type="video/mp4"> </video> sending 1080p video mobile device phone doesn't make sense, video big screen, , bandwidth required send video may use of users li

java - How to get the MySQL query results into a ArrayList<object> -

i have sql query results in multiple columns. want execute query , results arraylist<> instead of resultset . class column definitions public class record{ private string filename; private string fileid; private string loan; private string page; } query : string query = "select filename, fileid, loannumnber, pagenumber table"; resultset rs = stmt.executequery(query); i want results of query in recorddata object. arraylist<record> recorddata = new arraylist<record>; please suggest how arraylist can populated directly correct mapping. use following code snippet if want implement yourself. convert result set record objects , add arraylist . record record; while(rs.next()){ record = new record(); string filename = rs.getstring("filename"); string fileid = rs.getstring("fileid"); string loannumnber = rs.getstring("loannumnber"); string pagenumber = rs.getstring

HTML form submits an empty string when JavaScript indicates the hidden control has a value -

amongst many other controls, have following html elements on form <input id='cmdregisterme' name='cmdregisterme' value='register me' onclick="return presubmit();" type='submit' /> <input type="hidden" id="newhash" name="newhash" value=""> <input type="text" id="email" name="email" value="" size="50" maxlength="50"> <input type="password" id="password1" name="password1" value="" size="30" maxlength="25"> <input type="password" id="password2" name="password2" value="" size="30" maxlength="25"> and js functions function presubmit() { document.getelementbyid("newhash").value = donewhash(document.getelementbyid("password1").value, document.getelementbyid("email&quo

uiviewcontroller - Changing the initial screen on ios -

Image
i trying add login screen app when tried changing initial view controller login screen when change initial view controller pointer has no effect. have tried suggestions in: ios 7 - failing instantiate default view controller did not work me. first screen under navigation controller instead showing intended initial view before login added. app delegate func application(application: uiapplication, didfinishlaunchingwithoptions launchoptions: [nsobject: anyobject]?) -> bool { let mainstoryboard: uistoryboard = uistoryboard(name: "main", bundle: nil) let centerviewcontroller = mainstoryboard.instantiateviewcontrollerwithidentifier("viewcontroller") as!viewcontroller let drawerviewcontroller = mainstoryboard.instantiateviewcontrollerwithidentifier("drawerviewcontroller") as!drawerviewcontroller let leftsidenav = uinavigationcontroller(rootviewcontroller: drawerviewcontroller) let centernav = uinavigationcontroller(rootvi

sdl 2 - How to properly pass a pointer to a function in C++ for another function operating directly on that pointer? -

i learning create c++ applications using sdl2 library , encountered problem while trying organise code. here's simple example ilustrating situation: void createwindow (sdl_window *gamewindow) { gamewindow = sdl_createwindow(/* arguments here */); } int main (int argc, char* argv[]) { sdl_window* gamewindow = null; createwindow(gamewindow); // code here... } why doesn't work? when try compile code, sdl_geterror() screams: "invalid renderer". when make way sdl_window* createwindow (sdl_window* gamewindow) { gamewindow = sdl_createwindow (/* arguments here*/); return gamewindow; } it works. don't way. i may not understand pointers or way sdl2 works on them, thought passing 1 function lets me operate directly on variables intead of copies, don't have return anything. me looks operating on copy of variable adress, not variable itself. arguments in c passed value , is, arguments copied , every modification applied

c++ - How to protect a process from being killed? -

this question has answer here: prevent user process being killed “end process” process explorer 3 answers i've tried protect process in c++ windows, code is: #include <iostream> #include <aclapi.h> #include <iostream> #include <windows.h> #include <sddl.h> #include <stdio.h> using namespace std; bool denyaccess() { handle hprocess = openprocess(process_all_access, false, getcurrentprocessid()); security_attributes sa; sa.nlength = sizeof(security_attributes); sa.binherithandle = false; setkernelobjectsecurity(hprocess, dacl_security_information, sa.lpsecuritydescriptor); return true; } int main() { while(denyaccess()); return 0; } but can kill process task manager! what's wrong ? windows server uses pair of threads monitor each other enforce licensing of windows server vs win

java - How can I set timeout on client node for a data node of elasticsearch? -

so have 1 client node , 2 nodes both master , data. the data node have 32gb ram of 16gb allocated heap elasticsearch. the server run of data expect during gc phases. server stops responding. tried different configurations unable bring gc time down. now problem if there gc going on 1 node, whole cluster dies. there way can set timeout es data node on es client. so when gc happening on node timeout , es client return result collected 1 of node , not wait complete data return both node. is there way this. if wants can share jvm settings elasticsearch , elasticsearch.yaml file also. logs gc : [2016-01-28 12:36:27,200][warn ][monitor.jvm ] [main-server-m2xlarge-2] [gc][old][91418][327] duration [11.1s], collections [1]/[11.6s], total [11.1s]/[24.6m], memory [6gb]->[4.7gb]/[15.5gb], all_pools {[young] [411.7mb]->[14.4mb]/[532.5mb]}{[survivor] [38.1mb]->[0b]/[66.5mb]}{[old] [5.6gb]->[4.7gb]/[14.9gb]} [2016-01-28 12:38:06,227][warn ][monitor.jvm

Filter nested objects in elasticsearch query based on query -

i have doc multiple nested documents. nested queries work fine still return nested objects (i.e. whole document) though search query match few nested objects. filter documents whole. here example: put /demo { "mappings": { "company": { "properties": { "employees": { "type": "nested" } } } } } put /demo/company/1 { "id": 1, "name": "google", "emp_count": 3, "employees": [{ "id": 1, "name": "john", "address": { "city": "mountain view", "state": "california", "country": "united states" } }] } put /demo/company/2 { "id": 1, "name": "facebook", "emp_count": 3, "employees": [{ "id": 1, "name": "

angularjs - Angular JS -which grid to use -

which best control can used in angularjs list items in table format . have seen multiple options ng-table,ui-grid,ag-grid,kendo-grid.i need features like,sorting,filtering,row styling,header column splitting,scrolls,pagination , should responsive too. my personal preference goes out ui-grid , it's flexible , allows create custom directives/hooks extend rich functionalities. i've used in big project huge datasets , although required custom tweaking lightning fast.

vi - Add new line after current line in insert mode vim -

i new @ vim, , transition sublime vim being hard. want know if there's shortcut add new line above or behind current line while i'm in insert mode without leaving it. in sublime used cmd + enter cmd + shift + enter to didn't find similar way on vim. i found way in normal mode using 'o' , 'o' , configuring amazing way http://vim.wikia.com/wiki/insert_newline_without_entering_insert_mode none of them reach need. thanks ! defining shortcut adding line below easy, type following on vim command-line (after typing : in normal mode) or add vimrc file: imap <c-enter> <esc>o that adds insert-mode mapping ( imap ) ctrl-enter leave insert mode, use o add new line after current line (leaving in insert mode started). ( <c-xxx> how vim represents special key sequence ctrl + xxx , , <esc> escape key). that's similar "amazing way" link to, using appropriate key sequence go insert mode normal mo

python - Generate a function which has a decorator -

i know can generate functions lambda expressions or setattr , there way generate functions @ runtime have decorators? example create @property , @<name>.setter functions @ runtime. well, given that @decorator(config) def function(args): # ... is syntactic sugar for def function(args): # ... function = decorator(config)(function) i'm sure can figure out rest. :)

android - Are MobileFirst client-side APIs such as WL.App.sendActionToNative available when creating a "Cordova" style of application in MobileFirst 7.1? -

i'm working client who's considering migrating existing mobilefirst platform 7.1 hybrid app the cordova app type . they trying understand if app type still give them access mobilefirst apis such wl.app.sendactiontonative bridge native , js layers. the list of supported , unsupported features doesn't mention apis; supported in cordova-type apps? well... in hybrid app 1 of benefits of worklight "we" own native , web portion. create cordova plug-in (based on tutorials) if wanted, sendactiontonative - because own both sides - helped here "bridging" 2 ends, "negating" need cordova plug-in. feature "cordova plug-in" in itself(!) internally. in "pure" cordova apps don't own both ends. web end... mfp sdk cordova plug-in. anyway, yes, enter platform folder native code , use apis , should work, in cordova world not make sense - you're not supposed touch native code... you're supposed use cordova plu

c# - Elvis operator in a casting invocation chain -

the elvis operator, aka null-conditional operator, massively cool. in linq queries works great in concert null-coalescing "??" operator. somedata.where(dt=>(dt?.inner?.innermost?.include=="yes")??false); but do if need cast intermediate values? for 1 link in chain, works out fine. somedata.where(dt=>( ((innerclass)dt?.inner) ?.innermost)?.include=="yes") ??false); but additional necessary casts cast , invocation "driven apart". somedata.where(dt=>( ((innermostclass) <=== cast ((innerclass)dt?.inner) ?.innermost)?.include=="yes")) <=== use ??false); probably messed the parenthesis more once here, hope idea. though "trainwreck" invocation chain code smell, there more expressive way of doing improve succinctness , clarity? you can keep chaining , prevent parenthesis using simple extension method: dt?.inner.as<innerclass>()?

c# - how to join two table column name and yield one result in linq -

need clear 1 doubt on linq public list<selectlistitem> getattributename() { var attri = (from z in _entities.attributes select z).asenumerable() .select(z => new selectlistitem { text = z.attributename + " (" + z.attributetype.attributetypecode + ")", value = z.attributeid.tostring() }); return attri.tolist(); } on line text = z.attributename + " (" + z.attributetype.attributetypecode + ")", the output be.. this.. abcd (efgh) ijkl(mnop) qrst(uvwx) but need output is abcd ijkl qrst efgh mnop uvwx how achieve that..? public list<selectlistitem> getattributename() { return _entities.attributes .select(a => new selectlistitem { text = a.attributename, value = a.attributeid.tostring() }) .concat(_entities.attributes.asenumerable()

get releases empty in github api -

i try idea-community releases following, return empty curl "https://api.github.com/repos/jetbrains/intellij-community/releases" but when releases exist in here how releases from the documentation : this returns list of releases, not include regular git tags have not been associated release. list of git tags, use repository tags api . github's ui confusing, repository doesn't have releases, github-specific concept. "releases" seeing regular git tags. try instead: curl https://api.github.com/repos/jetbrains/intellij-community/tags see what's difference between tag , release?

linux - jboss fuse 6.2.1 mq in fabric -

i have jboss fuse 6.2.1 on linux server in fabric mode 2 child container. created mq command fabric:mq-create --group mur --assign-container risng1,risng2 --port tcp=61617 mur-broker mq profile mq-broker-mur.mur-broker ready but expect transport protocol configured static port 61617 dynamic. in fuse 6.1 modifed base template broker.xml <transportconnector name="openwire" uri="tcp://0.0.0.0:${bindport}"/> bind port configured in properties in profile. in fuse 6.2 not work. question how configured static port in fabric mode on jms broker? i found closed issue https://issues.jboss.org/browse/fabric-1237 solved, you can use custom template in profile <beans xmlns="http://www.springframework.org/schema/beans" xmlns:amq="http://activemq.apache.org/schema/core" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.

html - Select elements with randomly-generated IDs with CSS -

i have markup ids not known in advance: #product-20625055 { background-color: #fc0; } #product-66980342 { background-color: #0cf; } #product-54722210 { background-color: #f0c; } <div class="product" id="product-20625055">product 1</div> <div class="product" id="product-66980342">product 2</div> <div class="product" id="product-54722210">product 3</div> i need change background color of divs. specific selector think of not work: div.product[id^="product-"] { background-color: transparent; } could done without hard-coding ids, using !important , changing html markup? instead of resorting !important , might want consider using :not() pseudo-class increase specificity of selector, this: div.product:not(#specificity-hack) { background-color: transparent; } this matches same elements original selector (assuming specificity-hack not possible i

ruby on rails - Validate Japanese Character in Active Record Callback -

i have japanese project needs validate half width , full width japanese character, 14 chars allowed on half width , 7 characters on full width. is there knows how implement that? right on model class customer validates_length_of :name, :maximum => 14 end is not choice i'm using ror 2.3.5 both fullwidth , halfwidth can used the following code may push on line fulfil exact requirement you've far specified in least possible time . uses moji gem ( japanese documentation ), gives lots of convenience methods in determining content of japanese language string. it validates maximum of 14 characters in name only consists of half-width characters, , maximum of 7 characters name s otherwise (including names contain combination of half- , full-width characters i.e. presence of 1 full-width character in string make whole string regarded "full-width"). class customer validates_length_of :name, :maximum => 14, :if => proc.new { |

java - Hashmap (alternative) with just 1 entry -

i've got set up, want have string saved, date attached it. private hashmap<string, date> = new hashmap<string, date>(); the problem i'm having want 1 thing inside hashmap, when put new string, date in, old 1 gets removed. i've got myself calling clear before add one, came on different problem: string current = something.get ???? as see above, want 1 entry inside. without date. is there better alternative? or seeing wrong? you can use pair<k,v> : a convenience class represent name-value pairs. // import statement import javafx.util.pair; pair<string, date> = new pair<>("string1", new date()); and can use something.getkey() string , & something.getvalue() date .

vb.net - WPF UserControl doesnt render properly -

i have wpf user control contains simple telerik grid. embedded user control element host control , added host control 3rd party docking library provides visual studio docking functionality. now in windows application docking works fine when enable autohide docking container of user control user control not rendered properly, renders when move pointer on controls. suggestions on how rid of issue? tried updatelayout(),invalidatevisual() none of them seems working. appreciated.

c++ - Two-channel cv::Mat object filled with row-col indexes without for cycle -

i want create two-channel matrix in opencv, values corresponding pair of row , column indexes. can in following way: for (int = 0 ; i< img_height ; ++ i){ (int j = 0 ; j < img_width ; ++ j){ src.ptr<point2f>(i)[j] = point2f(j,i); } } i wonder if there way in opencv initialize such matrix in faster , more compact way, without using element-wise approach. searched on documentation, didn't find me purpose. i ask because need application faster, i'm looking possible improvements can apply on code. thanks in advance there's no builtin function to this. can mimic matlab function meshgrid using repeat , in case going slower. you can improve few things: get pointer beginning of line out of inner loop, since same each line. avoid create temporary object store values. i think swapped , j. have @ code: mat2f src(img_height, img_width); (int = 0; < img_height; ++i) { vec2f* ptr = src.ptr<vec2f>(i); (int j =

javascript - Turn objects/controls to black and white -

in ie8 there function called dx filter, provides various multimedia-style visual effects web page. most of them can replaced css there's still 1 that's killing me. it's xray filters, following syntax : <!-- div target container image. --> <div id="odiv" style="position:absolute; left:270px; color:tan;" > image - > <img src='/workshop/graphics/earglobe.gif' /> </div> <button onclick=" odiv.style.filter= 'progid:dximagetransform.microsoft.basicimage(xray=1)'"> show xray</button><br/> <button onclick="odiv.style.filter=''">clear filter</button><br/> it can make controls/objects : buttons, tab headers, images ... turn x-ray images, example : <html> <head></head> <body> <button type="button">i'm normal</button> <button type="button"

java - Extract & Delete patterns not functioning entirely with Arraylists -

this first time asking question on here apologize mistakes in terms of form. i working on assignment ap computer science involves generating listarray filled random ints (within range) , processing them methods remove objects either exceed or less threshold determined earlier in program. here example of code wrote along preconditions provided teacher. /** * @param orig list of integer * @param mid int > 2 * @return new list of integer contains, in order, numbers in * orig >= mid / 2 */public static arraylist<integer> extractupper(arraylist<integer> orig, int mid) { arraylist<integer> myarray = new arraylist<integer>(); for(integer a: orig) { if (a >= mid/2) myarray.add(a); } return myarray; } /** * @param orig list of integer * @param mid int > 2 * @return none postcondition: numbers less mid / 2 have been * removed orig */ public static void deleteupper(arraylist<integer> orig, int mid) { for

mysql - Minus/Sum a table with itself -

i have table : id product_property_id product_id amount type 1 1 145 10 0 2 4 145 12 0 3 6 145 13 1 4 23 147 2 0 5 4 145 15 1 6 4 145 2 1 type : 0: out 1: in what want : for example : product_id 145 product_property_id 4 : (15+2) - 12 = 5 product_id product_property_id new_amout 145 4 5 is possible use sql result or have use php instant of ? if understand correctly, query using conditional aggregation: select product_id, product_property_id, sum(case when type = 1 amount when type = 0 - amount else 0 end) new_amount likethis group product_id, product_property_id;

javascript - Meteor return name from previous query -

i'm doing small app display friend requests , 'accept/reject' button beside each request. here's template.notifications.helpers : listrequests: function(){ return notifications.find({touser: meteor.userid()}); } and here's notifications (where display notifications friend requests) template: <template name="notifications"> {{#each listrequests}} <p>{{displayusername}} <span id="fromuserid"><strong>{{fromuser}}</strong></span> sent friend request. <button class="btn btn-primary" id="btnacceptrequest">accept</button> <button class="btn btn-danger" id="btnrejectrequest">reject</button> </p> <p>{{createdat}}</p> {{/each}} </template> and here's user collection: { "_id": "zasutbgrh3oqcpskh", "emails

android - Services are not activating in ASUS_Z010D -

i had started service application level adding following line of code. startservice(new intent(this, **********.class)); then problem if restarted device services automatically starting in devices in asus_z010d these services not starting automatically, starting when app opened. is there way solve please let me know..... in advance

mongodb - Unable to insert from Meteor method with object -

morning folks! running trouble trying should simple insert in meteor, passing object killing me. i have set of filters on site working, want save selector of filters collection can pull documents match several filters. the problem seems passing object contains saved search. object have collection2 might see nested properties ("addresses.state") i've got "blackbox: true" set on schema, don't know why looking there... here's whole flow: form save search name: <template name="savesearch"> <div> <button class="btn btn-link" type="button" data-toggle="collapse" data-target="#savesearchform" aria-expanded="false" aria-controls="savesearchform"> advanced search </button> <div class="collapse" id="savesearchform"> <div class="well"> // display filters awesome meteor-tabular-filte

c# - Disabling tilt effect for some items in ListView on Windows Phone -

i have windows phone 8.1 app showing list of items in listview . set isitemclickenabled true . there 2 types of items in listview , "active" , "disabled" ones. both type render differently, use itemtemplateselector choose right template. i want "active" items clickable standard tilt effect (pressed animation) , "disabled" items not generate tilt effect (i not care click being fired, can handle that). i found out can disable tilt effect on listview whole editing itemcontainerstyle template. how can disable items in listview ? you can disable tilt in itemcontainerstyle, , enable tilt individual item template... e.g. custom control tilt effect.

eclipse - What I need to setup netbeans for broadleaf commerce with glassfish 4.1? -

i tried broadleaf eclipse still gives more errors , familiar netbeans , glassfish setup mysql server , created new schema. don't know how create tables broadleaf not provided schema creation file. can broadleaf project automatically creates tables.also imported eclipse project netbeans project, tried maven install , tried run single-single modules, first run admin module , if modules needs run simultaneously how can i? when try run admin module gives following errors warning: unable load class org.apache.hadoop.hdfs.web.resources.userprovider, reason: java.lang.noclassdeffounderror: com/sun/jersey/spi/inject/injectableprovider info: webmodule[null] servletcontext.log():set web app root system property: 'bladmin.root' = [/home/yogesh/documents/eclipse-workspace/demosite/admin/target/admin/] info: webmodule[null] servletcontext.log():initializing log4j [/home/yogesh/documents/eclipse-workspace/demosite/admin/target/admin/web-inf/log4j.xml] info: webmodule[null]

java - How do I check to see if there are more than 2 of a character in a string sequence? -

in java program have string. want check contents of string , make sure single character not repeated more 2 times in entire string. example, in "abcdefghdid" character 'd' has 3 occurrences, want return error if in string character occurs more 2 times without regard character's positions in string. i'm not sure how this, should use regex? you can use regular expression , if matches /(\w).*\1.*\1/ string illegal. or can split string individual characters , count how many times occur.