Posts

Showing posts from February, 2013

javascript - Angular: How to show icon.png depending on the attribute of a item? -

i have array of objects looks this: [{"name":"steve", "hourly_wage":16, "status":"part-time"}, {"name":"maria", "hourly_wage":25, "status":"full-time"}, {"name":"jose", "hourly_wage":21, "status":"former"}] i want display icon each person's employment status. full circle full time, half circle part time , empty circle former. how can go doing in javascript/angular? i'm thinking if statement of sort inside ng-hide? most generic way in opinion create mapping, use it. js: $scope.statusiconmapping = {"part-time": "half_circle.jpg", "full-time": "full_circle.jpg", "former": "empty_circle.jpg" }; markup: <div ng-repeat="employee in employees"> ... <img src="{{statusiconmapping[employee.status]}}" /> <

angular - angular2 observable scan once then subscribe by many async -

i need bind shared observable 2 times in different moments. second binding gets null when evaluated first time until next item appears. here component class: export class app { subject = new behaviorsubject(1); scan = this.subject.scan((current, change) => current + change, 0).share(); other = this.scan.map(item => item); } and here template: <div> <button (click)="clickedscan=true">show scan</button> <button (click)="clickedother=true">show other</button> <button (click)="subject.next(1)">next</button> <div *ngif="clickedother"> other | async: <b>{{ '' + (other | async) }}</b> </div> <div *ngif="clickedscan"> scan | async: <b>{{ '' + (scan | async) }}</b> </div> </div> and here plunker ( update : plunker updated accepted answer) share() needed since otherwise scan method b

android - How to know data usage of mobile for specific sim slot -

i trying find data usage specific sim slot. using trafficstats.getmobilerxbytes() method gives total usage of both sim in dual sim device. want particular data usage of individual sim. suggestions appreciated. just hint: upon sim slot data active event trafficstats.setthreadstatstag(identifier_tag); and if(trafficstats.getthreadstatstag() == sim1_slot){ int usedbytes = trafficstats.getmobilerxbytes() }else{ // sim2 slot int usedbytes = trafficstats.getmobilerxbytes() }

android split string doesn't work correctly -

this question has answer here: android split not working correctly 2 answers in android app, split array value array. i have array name arraya. log of arraya[0]: peter|mustermann now split peter , mustermann, try this: string [] arrayb = arraya[0].split("|"); but log of arrayb[0] , arrayb[1] not be: peter and mustermann it be: p and nothing any ideas ? :( just use single quote string [] arrayb = arraya[0].split('|');

kendo ui grid date sorting is not working -

i trying sort data on desc date order can't, keep getting asc ordering on kendo ui grid, here code. this.gridconfig = { datasource: { transport: { read: '/api/endpoint, datatype: 'json' }, schema: { data: "my_data_var" } }, sort: { field: "date", dir: "desc"}, resizable: true, filterable: true, pageable: { pagesize: 200 }, columns: [{ field: 'date', title: 'date', template: "#= kendo.tostring(kendo.parsedate(date, 'yyyy-mm-dd'), 'dd/mmm/yyyy') #" sort option datasource configuration should : datasource: { transport: { read: '/api/endpoint, datatype: 'json' }, schema: { data: "my_data_var"

android - Ionic: Adding platform gives error -

having first ionic encounter, setting environment android app on osx yosemite. running command sudo ionic platform android getting following error: error: %s error: enoent, no such file or directory '/users/myuser/hooks' @ error (native) @ object.fs.readdirsync (fs.js:761:18) @ object.sethookspermission (/usr/local/lib/node_modules/ionic/node_modules/ionic-app-lib/lib/hooks.js:116:24) @ object.ionictask.run (/usr/local/lib/node_modules/ionic/lib/ionic/cordova.js:51:13) @ object.run (/usr/local/lib/node_modules/ionic/lib/cli.js:95:32) @ object.<anonymous> (/usr/local/lib/node_modules/ionic/bin/ionic:9:10) @ module._compile (module.js:460:26) @ object.module._extensions..js (module.js:478:10) @ module.load (module.js:355:32) @ function.module._load (module.js:310:12) updated hooks directory have execute permissions error happened { [error: enoent, open '/users/myuser/config.xml'] errno: -2, code: 'enoent', path:

lambda - Event is not Called C# -

i'm making nfc library, need raise event, when card has been read. in mainproject call library this: reader = new nfcreader(); if (reader.initialize()) { reader.uidreceived += (s, args) => displaytext(string.format("uid received: {0}", args.uid)); } my library: public class nfcreader { private scardmonitor monitor; public event eventhandler<nfcreadereventargs> uidreceived; public bool initialize() { // when card inserted, event raised // want read uid of card monitor = new scardmonitor(new scardcontext(), scardscope.system); monitor.cardinserted += (s,a) => getuid(a.readername); return true; } private void getuid(string readername) { string uid = myuidgetter(readername); onuidreceived(uid); } private void onuidreceived(string uid) { var handler = uidreceived; if (handler == null) {

java - How to dynamically check existing user in wicket -

in web application have register form new user. there 1 field username: textfield<string> username = new textfield<string>("username"); username.add(usernamevalidator.getinstance()); when user push button username validate. behaviour not user friendly. there options how validate dynamically , if there error in validation user cant push button ? you can use the: onchangeajaxbehavior username.add(new onchangeajaxbehavior() { @override protected void onupdate(ajaxrequesttarget target) { //do stuff here } });

storing several strings from a recursive function into a struct c -

i making predictive text interface store dictionary data structure (ive used trie), user searches partially word , completed words displayed numbers corresponding each one. have done insertion, search functions , have recursive traversal prints out completed words(with no numbers). want store them struct can use them in function user shown words corresponding numbers. heres main.c code (for testing not go readfile enters 25 000 words!): struct trienode* root = trierootconstructor(); struct trienode* pntr = null; trieinsert(root, "aback"); trieinsert(root, "abacus"); trieinsert(root, "abalone"); trieinsert(root, "abandon"); trieinsert(root, "abase"); trieinsert(root, "abash"); trieinsert(root, "abate"); trieinsert(root, "abater"); int x = 0; char* result = ""; char* search = "aba"; result = triesearch(root, &pntr, search, result, &x); printf("\n\n"); travers

excel - IF Column F = TEXT THEN change Column G -

i'm sure simple i'm having difficult time getting right. basically, if column f equal text string, column g should show text string. assuming data this: col f col g 1 black 2 white 3 black 4 5 white your formula in col g should like: =if(f1 = "black", "yes", if(f1 = "white", "no", if(f1 = "", "", ""))) using formula give you: col f col g 1 black yes 2 white no 3 black yes 4 5 white no

javascript - For the point inside circle, find in which quarter it is? -

i researched google couldn't find keywords search. ask here if algorithm , code efficient? http://sketchtoy.com/66429941 (algorithm) the algoritm is: have 4 points are: north, east, south , west of circle. check 4 distances (distancetonorth, distancetoeast, distancetosouth, distancetowest). , find minimum of them quarter. here code not seem efficient me. (firstquarter north, secondquarter east , on.. note: assume mousemove inside circle. var firstquarterx = centerx; var firstquartery = centery - radius; var secondquarterx = centerx + radius; var secondquartery = centery; var thirdquarterx = centerx; var thirdquartery = centery + radius; var fourthquarterx = centerx - radius; var fourthquartery = centery; var distancetofirst = math.sqrt(math.pow(x-firstquarterx, 2) + math.pow(y-firstquartery, 2)); var distancetosecond = math.sqrt(math.pow(x-secondquarterx, 2) + math.pow(y-secondquartery, 2)); var distancetothird = math.sqrt(math.pow(x-thirdquarterx, 2) + math.pow(y-

java - Quartz Scheduler - multiple process IDs of OC4J running same instance, each gets scheduled -

i have tried quartz schedule mails. when application deployed on app server, internally creates multiple process ids oc4j instance. when runs, these instance run separately , send mail. can use jdbc job store handle situation? else should avoid it? you can specify concurrent false if explicitly starting job through xml or java code.

collections - Why is toArray implemented like this in java? -

as see source code of: java.util.abstractcollection.toarray() , implemented this: public object[] toarray() { // estimate size of array; prepared see more or fewer elements object[] r = new object[size()]; iterator<e> = iterator(); (int = 0; < r.length; i++) { if (! it.hasnext()) // fewer elements expected return arrays.copyof(r, i); r[i] = it.next(); } return it.hasnext() ? finishtoarray(r, it) : r; } private static <t> t[] finishtoarray(t[] r, iterator<?> it) { int = r.length; while (it.hasnext()) { int cap = r.length; if (i == cap) { int newcap = cap + (cap >> 1) + 1; // overflow-conscious code if (newcap - max_array_size > 0) newcap = hugecapacity(cap + 1); r = arrays.copyof(r, newcap); } r[i++] = (t)it.next(); } // trim if overallocated return (i == r.length) ? r : arrays.copyof

asp.net - How to Create Session in asp .net C# login and registration memberprofile page -

i new asp .net c# created registration,login , member profile page after validations data stored in database.. , login page working fine... i dont know sessions ..how can create session , how make login module more effective using sessions? thanks in advance session per user basis. you can store session in sqlserver reduce load on server you can create session session["yourkey"]=somevalue; to read value if(session["yourkey"]!=null) { //use session values. } you can use forms authentication better approach login . forms authentication

c# - How to customize the Operation Triggers? -

i want customize operation triggers in ax 2012 r3 retail sdk. need catch trigger , write business logic there in trigger class. can please guide how that? need use i-interface classes used in blank operations. the 2 top google hits on "operation triggers in ax 2012 r3 retail sdk" brings information on how extend point of sale , how modify trigger .

Flash light not working as torch in some android devices -

hi using nexus 5.i have developed basic torch app works in devices except in nexus 5 please me some devices require surface view access camara object. try { camera.setpreviewtexture(new surfacetexture(0)); } catch (ioexception ex) { // ignore }

asp.net - Iframe shows ActionMethod name while loading PDF file in ASP MVC -

Image
i using iframe tag in order call actionmethod returns fileresult display pdf file. issue after loads pdf document instead of showing pdf file name, shows actionmethod name on top of pdf file name in chrome. razor code: <iframe src="@url.action("getagreementtoreview", "employee")" style="zoom: 0.60; -ms-zoom: 1; width: 100%;" width="99.6%" height="420" frameborder="0" id="agreementpdf"></iframe> cs code: public actionresult getagreementtoreview() { response.addheader("content-disposition", "inline; filename=master-agreement.pdf"); return file("~/content/master-agreement.pdf", "application/pdf"); } image: can see in screenshot, shows 'getagreementtoreview' i.e. actionmethod name instead of 'master-agreement.pdf'. does know how fix issue? thanks. sanjeev please try code : return file("~/content/mast

csv - How to get the actual value of a cell with openpyxl? -

i'm beginner python , need help. i'm using python 2.7 , i'm trying retrieve cell values of excel file , store csv file. code following: import os, openpyxl, csv aggname = "deu" wb_source = openpyxl.load_workbook(filename, data_only = true) app_file = open(filename,'a') dest_file = csv.writer(app_file, delimiter=',', lineterminator='\n') calib_sheet = wb_source.get_sheet_by_name('calibration') data = calib_sheet['b78:c88'] data = list(data) print(data) in range(len(data)): dest_file.writerow(data[i]) app_file.close() in csv file, this, instead of actual value (for example in case: sfcg, 99103). <cell calibration.b78>,<cell calibration.c78> <cell calibration.b79>,<cell calibration.c79> <cell calibration.b80>,<cell calibration.c80> <cell calibration.b81>,<cell calibration.c81> <cell calibration.b82>,<cell calibration.c82> <cell calibration.b83>,

delphi - what happens if you call dll explicit, without declaring in the procedure call its stdcall; -

testing this code: procedure fii(i:integer); var hbar: thandle; foo: procedure (x: integer); //i removed stdcall here! begin hbar := loadlibrary('bar.dll'); if hbar >= 32 { success } begin foo := getprocaddress(hbar, 'foo'); ... foo(i); // if debug trace call of dll not desired value ... freelibrary(hbar); end else messagedlg('error: not find bar.dll', mterror, [mbok], 0) end. what happen if dropped stdcall in 32 bit or 64 bit ? the answer , value $18f2dc passed x . if string, point position of $18f2dc ,and try extract string garbage there. happens because delphi pass pointer(s) in code. changed run run , not $18f2dc , 3 byte passed. (if pass int $18f2dc in decimal 1635036). does number has unique meaning? why stdcall needed? what happen if dropped stdcall in 32 bit? when no calling convention specified, default of register used. since not match true calling convention,

php - Select default value if no old input is set -

i using form model binding , have following select input : {!! form::select('user_id', $users, old('user_id') ?: auth::id(), ['class' => 'form-control select2 users']) !!} i accomplish following: in creation form: select option user_id equals authenticated user's id, but if there old input in session, select option instead. in edit form: select option stored in model. old('user_id') ?: auth::id() doesn't seem work when editing, because selects option of authenticated user , not 1 stored in model. i believe have line, {!! form::model($users, ['route' => ['admin.user.update', $user->id], 'method' => 'put']) !!} then code should this: {!! form::select('user_id', $users, isset($selecteduser) ? $selecteduser : null) !!} at create function not pass $selecteduser view pass id in session,and in edit function should pass $selecteduser view ,which auth::user()

javascript - Leaftlet on Ionic Tabs App shows only first tile -

i have ionic tabs app (i used cordova templates on visual studio 2015) leaflet map on second tab. on first tab have search parameters pois want show on map markers. working fine, including map showing tiles, until start interacting controls on first tab. specifically, when enter input control , soft keyboard appears, if go second tab, map showing first tile. if zoom in or out, map refreshes shows first tile. problem solved though if change orientation of device. the soft keyboard not thing causes problem. on ripple example, soft keyboard not show (i use laptop keyboard) after while manipulating search parameters on first tab, map stops working properly. also, have tried mapbox api instead of leaflet , problem occurs same way. the l.map instance unable correctly get/calculate it's dimensions because @ initialization instance's parent container has style of display: none . can call invalidatesize on map instance make recalculate it's dimensions when tab con

autocompletetextview - Are Android adapters asynchronous? -

i looked @ this example google, it's adapter on autocompletetextview makes network call api retrieve auto-complete suggestions. it doesn't use asynktask or threads, doesn't give strictmode warnings , doesn't lock ui when there's no internet connection , i'm wondering why. is arrayadapter asynchronous? filtering perfomed asynchronously. filtering operations performed calling filter(charsequence) or filter(charsequence, android.widget.filter.filterlistener) performed asynchronously. when these methods called, filtering request posted in request queue , processed later. call 1 of these methods cancel previous non-executed filtering request.

c# - How can i change the class and the functions inside to fit in any listBox items? -

i have class wich im using color text in listbox in form1: using system; using system.collections.generic; using system.linq; using system.text; using system.drawing; using system.windows.forms; namespace gatherlinks { class colortext { public static void texts(richtextbox box, string text, color color) { box.selectionstart = box.textlength; box.selectionlength = 0; box.selectioncolor = color; box.appendtext(text); box.selectioncolor = box.forecolor; } public static void colorlistbox(list<string> data, drawitemeventargs e) { int keywords = 0; string keyword = null; string url = data[e.index].substring(0, 5); if (data[e.index].contains("local keyword:")) { keywords = data[e.index].indexof("local keyword:"); keyword = data[e.index].substring(keywords, 14)

sql - Column 'book_name' does not belong to table -

i trying add data 2 fields in vb form sql server these column values book_name & member_id through 2 textboxes , search button using following code: dim b_name string = txtsearchbooknamenew.text dim m_id decimal = txtsearchidnew.text da = new sqldataadapter("select b.book_name, m.member_id book b join member m on b.staff_id = m.staff_id member_id =" & m_id & "and book_name =" & "'" & b_name & "'", cn) dt = new datatable da.fill(dt) if dt.rows.count > 0 cboidsave.text = dt.rows(0).item("member_id") cboisbnsave.text = dt.rows(0).item("book_name") end if but receiving error: "column 'book_name' not belong table" what causing error? after lots of headaches found out filling fields in wrong order, selected "book_name" first in sql query whe

How to load specific Hive partition in DataFrame Spark 1.6? -

spark 1.6 onwards per official doc cannot add specific hive partitions dataframe till spark 1.5 following used work , dataframe have entity column , data, shown below - dataframe df = hivecontext.read().format("orc").load("path/to/table/entity=xyz") however, not work in spark 1.6. if give base path following not contain entity column want in dataframe, shown below - dataframe df = hivecontext.read().format("orc").load("path/to/table/") how load specific hive partition in dataframe? driver behind removing feature? i believe efficient. there alternative achive in spark 1.6 ? as per understanding, spark 1.6 loads partitions , if filter specific partitions not efficient, hits memory , throws gc(garbage collection) errors because of thousands of partitions loaded memory , not specific partition. please guide. in advance. to add specific partition in dataframe using spark 1.6 have following first set b

android studio - Which Git/bitbucket Repositories structure choose for Parse Projects with CloudCode + AndroidStudio? -

i have parse project includes android application developed on androidstudio , javascript parse cloud code (+web hosting). i'm using git on bitbucket versioning. i'm wondering how organize repository(ies) in order to: have separate commits between 2 sub projects: cloud code , android code (in order have easy revert each subprojects …) have common release between these both subprojects (that must works obviously). have common parent directory check out both sub-projects if use single repository (in parent directory) this: parent-platformdir /.git /myandroidstudioproject /mycloudcodeapp then when link androidstudio git vcs detect cloud code modifications , might mix commit between these 2 subprojects. i know there features gitsubmodule of gitsubtree, it's not clear @ , i'm afraid doesn't suit need. so kind of git repository architecture suit best?

php - Wordpress : Excluding last post from loop breaks navigation -

i trying simple here : trying exclude last post loop in theme's index.php file. everything working fine except when click on links in page, browser shows homepage. here's code loop : <?php query_posts('offset=1'); ?> <?php while (have_posts()) : the_post(); ?> <h2> <a href="<?php the_permalink(); ?>"> <?php the_title() ?> </a> </h2> <?php endwhile; ?> can me fix this? thanks!

javascript - Adding dynamic mean to time series chart -

i try explain problem accurate possible. looking javascript chart library filling 2 following conditions: from ajax request retrieving time series, display dynamically data when changing time window. such done on highstocks: http://www.highcharts.com/stock/demo/basic-line and plot horizontal line corresponding mean, changing when user update time window on chart. actually possible display horizontal line. fixed on whole data , not change accordingly when time window modified: http://www.highcharts.com/stock/demo/yaxis-plotlines i quite new topic , know if it'sp ossible modify highstock classes have such result. or maybe other js libraries exists? using combination of answer here: highchart, total of visible series data after setextremes and example of dynamic average using visible series made previous question, here: http://jsfiddle.net/jlbriggs/gweulegq/ i put example, using aftersetextremes event, this: xaxis : { even

java - BigDecimal Dividing with uneven decimals -

i trying work on program work multiple bigdecimal calculations necessary. @ quite confusing point because bigdecimal not cooperating how like. let me explain need do: first takes monetary amount can have 2 decimal places. takes "allocations" how many accounts amount spread through. the program should divide amount between accounts. of course in situations amount can not evenly divided, example $3.33 divided between 2 accounts. in case must either have 1 allocation cent or round number. rounding not option, every penny must accounted for. here have far: totalallocations = transactionwizard.totalallocations;//set in class, how many accounts total spread bigdecimal totalallocationsbd = new bigdecimal(totalallocations).setscale(2);//converts big decimal. amounttotal = (bigdecimal) transinfo.get("amount"); // set total amount mathcontext mc = new mathcontext(2); remainderallocation = amounttotal.remainder(totalallocationsbd, mc); divide

javascript - Using Jquery inside of Razor -

i'm trying pass string javascript razor actionlink string filtering =$("#hello").val(); @html.actionlink(name, controllername, new { sort = columm, order = orderby, filters = filtering }) but i'm not able access variable, try @:filtering or "@filtering" doesn't work anyway, how can pass variable controller? if want send or post data controller's action may try this... <input type="submit" id="btnfilter" value="filter" name="btnfilter" /> $('#btnfilter').click(function () { var sort = sortvalue; var order = ordervalue; var filter= filtervalue; $.ajax({ type: 'post', url: '@url.action(actionname, controllername)', data:'{"sort":"' + sort+ '","order":"' + order+ '","filter":"' + filter+ '"}',

javascript - form submit trigger in html -

in html, form can submitted clicking submit button pressing enter when focus on submit button by pressing enter on input field is there way find out of 3 methods used submit form? html doesn't have built-in way of knowing, far know. you'd have catch necessary events , keep state in memory. following: set bool true when input receives focus. set false when loses focus. set bool true when button receives focus. set false when loses focus. subscribe click event on button, set bool true subscribe keydown event of keyboard, check whether enter-key , set bool true. now should have necessary information know actions user took submit form. jquery should able these events. also, believe form submitted when form has focus (so not button or input) , press enter. i'm not sure if actual form having focus, or control inside form. so, you're trying achieve require hacking around. sure can't provide users experience want in other way?

forms - Php Mailer / GoDaddy -

i uploaded contact form page attachment option coded in html embedded php (contact.php) via godaddy, when want fill out form , submit it, lot of errors don't understand. i using php mailer , php include php page (bootstrap.php) contact page. below code: contact page: <!doctype html> <html> <head> <?php ini_set('display_errors', 'on'); error_reporting(e_all); include('bootstrap.php'); ?> </head> <body> <div class = "wrapper"> <section class ="bulk"> <?php if(isset($_get["status"]) == "thanks") { ?> <br><br><br><br><br><br><br><br><br><br><br><br> <p class = "text-center"> email! in touch shortly </p> <?php } else { ?> <h1 class = "

How to hide superfish menu from login page in drupal 7 -

i have configured superfish block display on pages except user-login page not being honored. i've created superfish menu block no menu items , have configured show on user-login page not being honored. why trying this? there 3 dummy menu items (not associated pages) cannot make 'disappear' via context rule e.g. show when user == authorized user (see screen capture). so if knows how hide dummy menu items or whole superfish block login screen - please share - appreciated. login screen image i checked on 1 of sites ... should work when add "user" in display section of block config page. (you may have clear cache)... than, block hidden on user pages autorized users.. other options: "hook preprocess_page" or seperate page template ("page--user.tpl.php")...

c++ - Vector of vector : Segmentation Fault -

i have segmentation fault error @ runtime, here code indication of line error occurs : edit : variable scenario attribute of class probleme, code posted code of constructor edit : the error happens @ runtime class scenario { public: int id; std::vector<std::vector<int> > demandes; scenario() {} void setid(int i) { id=i; } void setdemande( std::vector<int> v) { demandes.push_back(v); } int getid() const { return id; } }; scenario.resize(nb_scenario); (int = 0; < nb_scenario; ++i) { scenario[i].setid(i); } int s; for(int i=0; i<nb_periode ; i++) { fichier >> s ; for(int j=0;j<nb_produit;j++){ fichier >> s ; for(int k=0;k<nb_scenario;k++){ fichier >> s; scenario[k].demandes[j][i]= s; //error here } } } you never add demandes vector. calling operator[] on e

windows - Automate Browser Searching -

i need search number of websites different values. can think of way have chrome: open specific site use search function on site search "x" take screenshot/output result move on next site , same steps. once completed, start process again new value "x+1" thanks!

jQuery - binding to elements that are not yet created -

[not duplicate] - checked event binding on dynamically created elements? question, , answer start point of question. start off $parent.on('click', '.specificchild' ... etc.). know (see wrapper1 ). first part of question has nothing referenced question. within parent element, want create child element , grand-child elements, , have click event on grand-child element. is possible pre-define child element , pre-define click event, before child/grand-child elements created ? // wrapper1 related -- works var $wrapper1 = $('.wrapper1'); var $number1 = $wrapper1.find('.number'); $wrapper1.on('click', '.incrementbutton', function () { var currentval = parseint($number1.html(), 10); $number1.html(currentval + 1); }); // wrapper2 related - doesn't work // define elements upfront var $wrapper2 = $('.wrapper2'); var $foundation = $wrapper2.find('.foundation'); var $number2 = $wrapper2.find(&

c++ - Smart or raw pointers when implementing data structures? -

i have been reading , experimenting standard library's smart pointers, unique_ptr , shared_ptr , although great replacements lot of cases raw pointers might deemed dangerous unsure of use when implementing data structures. to experiment, have written example of hash map uses shared_ptr - according meyer's effective modern c++ double size of unique_ptr . reason use unique_ptr kind of stumped due performing in add function, updating , copying. does have suggestions problem? should data structures remain written using raw pointers? #pragma once #include "core.h" const int table_size = 256; template<typename k> class hashkey { public: unsigned long operator()(const k& p_key) const { return (p_key) % table_size; } }; template<typename k, typename t> class hashnode { public: k m_key; t m_value; std::shared_ptr<hashnode> next = nullptr; }; template<typename k, typename t, typename f = hashkey<k>>

node.js - Reference one document from another (SQL-style join) with NeDB -

i have bunch of documents in nedb, let's of form: { _id : "3hdl4vdjqhcwvm76", type : "customer", name : "bob" }, { _id : "65bynnj7578b9hyu", type : "action", customer : "3hdl4vdjqhcwvm76", ... }, (so 'action' references 'customer') and want list actions along customer names. obvious way be: db.find({ type: 'action' }, function (err, actions) { actions.foreach(function(action) { db.findone({ type: 'customer', _id : action.customer }, function (err, customer) { console.log(action, customer.name); }); }); }); but gets painful quite quickly. there better way of doing this? like: db.find({ type: 'action' }, {join : ["customer"]}, function (err, actions) { console.log(action, action.customer.name); }); would awesome. it seems common thing want do, can't seem find information on doing it. thanks!

jquery - Javascript - Change suggested text before placing it in the textbox -

i have html textbox uses javascript autocomplete feature in jquery ui - v1.11.4. suggested string textbox concatenation of several columns (patient_no,patient_name,age , residence) table in database. wanted truncate part of string since require patient_no column placed in textbox. possible text suggestion : ' 00032 >> tom michael >> 14yrs >> westlands ' what want placed in textbox : ' 00032 ' below code //html <input name="patientno" id="patientno" type="text" /> //autocomplete.php $pat_no_seq_result = pg_query("select patient_no || ' >> ' || surname || ' ' || other_name || ' >> ' || (current_date-year_of_birth)/365 || 'yrs' || ' >> '||residence hp_outpatient_register;"); $dname_list = array(); while ($row = pg_fetch_row($pat_no_seq_result)) { $dname_list[] = $row[0] ; } //javascript <script type

ios - Label in custom view not updating -

i have created custom uiview in xib class infopopupview. add viewcontroller. works , custom class xib set in file's owner. can set titlelbl variable in first viewcontroller no problem. my problem appears when in viewcontroller want use infopopupview again different title... title not change/update. if infopopupview remembers last title set , dont care changing it.. how can initialise? titlelbl variable in infopopupview class can change later? any appreciated - thank ! viewcontroller var popupview: infopopupview! popupview = infopopupview(frame: cgrectmake(0, 0, 300, 268)) popupview.titlelbl.text = "myfirsttitle" view.addsubview(popupview) custom class class infopopupview: uiview { var view: uiview! @iboutlet weak var okbtn: uibutton! @iboutlet weak var titlelbl: uilabel! @iboutlet weak var textview: uitextview! @ibaction func didtapokbtn(sender: anyobject) { nsnotificationcenter.defaultcenter().postnotificationname

amazon s3 - Grab Post Data Using Only Javascript -

i preface saying possible want impossible, figured ask in case wrong. i sending http post data js file sitting on s3. using javascript want access post data sending file. is there way this? not using amazon-s3. can use server side javascript, aka node.js, when use amazon-s3 js not run server side. literally send javascript text , nothing more.

plsql - use to_date oracle function using week number and day number oracle -

i'm trying date day of week number , week of month number. for example, have table called club stores on day , week exams available, has dayofexam , weekofexam attributes. dayofexam=2 (monday). weekofexam=1 that means exams available on every monday of first week of each month. , need 04-jan-2016 ... 08-feb-2016 .. 07-mar-16 , on.... i tried using like to_date('21012016','dwmmyyyy'); is possible date? thanks. in sql, can use next_day , add multiple of 7 days. if want return date each month in year, can this. if want more months, can adjust starting date , number of months go forward. with x ( select 2 dayofexam, 1 weekofexam dual ), first_of_month ( select add_months( date '2016-01-01', level-1 ) mnth, dayofexam, weekofexam x connect level <= 12 ) select next_day( mnth, dayofexam ) + 7 * (weekofexam - 1) the_date first_of_month;

c# - Delete Id that has many values in link table -

i trying perform delete userid belongs linked table has many different areas user can belong to. linked table has userareaid , serviceareaid , when try , delete userid matches userareaid says sequence contains more 1 ... have made queryin linqpad selects the things want delete cannot go right iin actual project. from t in tbl_user t.userid == 21 select new { t.userid, servicearea = new {t.userareatbl_userserviceareadetails}, userinfo = new{t.username,t.email} } i have tried foreach on query not enumerable. how should try , achieve this? this whole of query set deleted flag true . var deleterecord = (from t in db.tbl_userserviceareadetails ((t.tbl_user.userid == id) && (t.serviceareaid == id)) )**** no method showing up? if (deleterecord != null) { deleterecord.tbl_user.deleted = true; // submit // ====== db.submitchanges(); // reload grid // =============== loadgrid(); t

github - git non-fast-forward rejected with upstream -

i have git repo master set in upstream, , dev branch getting every stream master. i have commited changes on dev branch useful specific branch , not master, , i my current branch : git status on branch dev branch ahead of 'master' 2 commits. my commits visible when git diff origin/master..head my branch date ( , goes through master doing before) : git pull . * branch master -> fetch_head up-to-date. but when push, got bashed : git push origin https://my_git.git ! [rejected] dev -> dev (non-fast-forward) error: failed push refs 'https://my_git.git' hint: updates rejected because tip of current branch behind hint: remote counterpart. integrate remote changes (e.g. hint: 'git pull ...') before pushing again. hint: see 'note fast-forwards' in 'git push --help' details. any tips appreciated, had on several posts : git push rejected non-fast-forward or git non-fast-forward rejected , none of them

tomcat - 404 Handler Hanging on ColdFusion 10, works perfect on ColdFusion 8 -

i'm having odd intermittent issue 404 handler pages on our coldfusion 10 server. here's backstory: we have been running 2 load-balanced coldfusion 8 servers ages without issue. we have upgraded 1 of these 2 servers coldfusion 10 in order soft-launch our coldfusion 10 upgrade. i've installed update 8 on cf10 server, , have removed , re-added connectors. both servers running windows 2008 r2. i've read several forum posts stating issues people getting connection reset issues 404 pages, i'm not seeing particular issue. seeing hung thread in fusionreactor 404.cfm file. here's example of stacktrace taken 1 of these hung threads: thread stack trace trace time: 07:02:14.638 04-mar-2013 request id: 179934 script name: http://example.com/404.cfm?404;http://example.com:80/somemissingfile started: 06:07:17.581 04-mar-2013 exec time: 3297057ms memory used: (32%)1,669,600kb memory free: 3,539,295kb thread id: 0x53de (21470) thread name: ajp-b