Posts

Showing posts from July, 2011

ms access - How to use progress bar onclick event -

hello trying display form shows progress of queries performed in onclick event: private sub command125_click() '***************statement covers period 104.03***************** dim countofdays integer dim lngred long lngred = rgb(255, 0, 0) countofdays = datediff("d", me.admit_date, me.from_date) if countofdays > 3 me.from_date.forecolor = lngred me.label126.visible = true 'select lines on contain dos 3 days prior 'to date of admission , enter reason code 104.03 if fileexists("m:\a_audit\client_" & [forms]![frmclients]![client_id] & "\client_" & [forms]![frmclients]![client_id] & ".xlsx") docmd.setwarnings (false) docmd.openquery ("qryerrorcode104-03") docmd.setwarnings (true) else msgbox "please upload itemized statement identify more 3 days" & _ "discrepancy between statement date , admission date."

ssl - Using browser's certificate (private key) to sign some string in javascript -

my users have certificates (private keys) installed in web browser. these certificates used browser authenticate user on third party websites. i sign string using 1 of private keys , when user uses/visits my website . there javascript api or function, enable this? short answer, can't sign string delivered through web browser using java script , client certificate end user. in case user certificates , keys used tls client authentication: during tls handshake server request browser present tls client certificate. the browser pick suitable client certificate , establish tls connection. once done, server deliver content: html , js, images... the browser render page elements. the browser has api access client certificates , keys not exposed java script engine.

c++ - Is it useful to create pointer(s) on the heap? -

is useful create pointer or array of pointers on heap ? if when , why need ? for example: #include <iostream> class box { /* things... */ }; int main(void){ // single pointer on heap box** pbox = new box*(nullptr); *pbox = new box(); // array of pointers on heap box** pboxes = new box*[3]{}; pboxes[0] = new box(); pboxes[1] = new box(); pboxes[2] = new box(); // delete pointers... return 0; } edit: make question more clear ... know dealing raw pointers not best practice ... want understand pointers , uses important part of c++ hence question (is useful...). the reasoning behind allocating memory space on heap or on stack not related type of variables allocated, it's related how it's allocated , how it's meant used. in case, nowadays should avoid new statements , use "managed" pointers, particularly std::xxx variants.

SQL Server XML/DataTable Insert - How to skip individual entity errors -

we can insert multiple rows sql server passing xml or datatable .net application stored procedure. question if 100 rows tried insert , 1 row has produced errors, remaining 99 rows inserted? or none of 100 rows wouldn't inserted of single row issue? is there way interfere during above mentioned bulk insert skip rows has errors?

json - Serialzing heterogeneous collection with Jackson in Java -

i'm using jackson serialize heterogeneous list. list declared this: list<base> mylist = new linkedlist<>(); i have classes aggregate , source in there: mylist.add(new aggregate("count")); mylist.add(new aggregate("group")); mylist.add(new source("reader")); those classes both implement base interface. each class has single property get/set method: aggregate has "type", , source has "name". i use code try serialize list: objectmapper om = new objectmapper(); om.configure(serializationfeature.indent_output, true); stringwriter c = new stringwriter(); om.writevalue(c, mylist); system.out.println(c); but find output json doesn't have indication of type of object serialized: [ { "type" : "count" }, { "type" : "group" }, { "name" : "reader" } ] as such, don't think can possibly de-serialize

JavaFX misaligned header on TableView or extra column -

pic of tableview header i need aligning headers columns on tableview. problem seems related setting tableview's column resize policy constrained-resize. can explain how fix this? thanks. i setting policy constrained-resize rid of column based on post: tableview has more columns specified my stack: java 8, javafx 8, , scenebuilder <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.control.tablecolumn?> <?import javafx.scene.control.tableview?> <?import javafx.scene.layout.borderpane?> <borderpane maxheight="200.0" maxwidth="322.0" prefheight="200.0" prefwidth="320.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1"> <center> <tableview fx:id="statustable" minheight="-infinity" minwidth="-infinity" prefheight="200.0" prefwidth="322.0">

reactjs - Is it OK to put propTypes and defaultProps as static props inside React class? -

this way i've been doing quite time now: export default class attachmentcreator extends component { render() { return <div> <raisedbutton primary label="add attachment" /> </div> } } attachmentcreator.proptypes = { id: proptypes.string, }; but i've seen people doing way: export default class attachmentcreator extends component { static proptypes = { id: proptypes.string, }; render() { return <div> <raisedbutton primary label="add attachment" /> </div> } } and in fact i've seen people setting initial state outside constructor well. practice? it's been bugging me, remember discussion somewhere said setting default props static not idea - don't remember why. non-function properties not supported es2015 classes. proposal es2016. second method considerably more convenient, plugin required support syntax ( theres common babel plugin it ). on other

How to print names from a text file in Python -

i have got text document looks this kei 1 2 3 4 5 igor 5 6 7 8 9 guillem 8 7 6 9 5 how can print names , last 3 scores i came this class_3 = open('class_3','r') read = class_3.read() read.split() print(read) but came out just k please help you can loop on file object , split lines, use simple indexing print expected output: with open('example.txt') f: line in f: items = line.split() print items[0], ' '.join(items[-3:]) output : kei 3 4 5 igor 7 8 9 guillem 6 9 5 the benefit of using with statement opening file close file @ end of block automatically. as more elegant approach can use unpacking assignment in python 3.x: with open('example.txt') f: line in f: name, *rest = line.split() print(name, ' '.join(rest))

java - Recursion- Kata challenge -

the challenge remove zeros @ end of number. zeros within 2 number okay. eg: 14000 == 14 //all end zeros removed 10300 == 103 // end zeros removed i wrote function solve problem: public class noboring { public static int noboringzeros(int n) { system.out.println(n); // testing system.out.println(math.abs(n % 10)); //testing if(math.abs(n % 10) != 0){ return n; } return noboringzeros(n/10); } } unfortunately doesnt work negative inputs. see output of test case below: //ld = last digit of number //zr 0 removed fixed tests: noboringzeros 1450 0 //ld 145 //zr 5 //ld 960000 0 //ld 96000 //zr 0 //ld 9600 //zr 0 //ld 960 //zr 0 //ld 96 //zr 6 //ld 1050 0 //ld 105 //zr 5 //ld -1050 0 //ld -105 //zr 5 //ld -105 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

python venv - Why is Django development server bringing my app under another app's address? -

after going through django project's tutorial on creating polling app, named polls, started own project on same virtual environment, under name. now, did in new app under the index view, still being shown @ http://127.0.0.1:8000/polls/ should @ http://127.0.0.1:8000/mynewproject/ i need on correcting this, or fact on 1 virtual environment, can work on 1 django project? , second question, should setting each project on different virtual envs? first answer: first wan mention these 2 things it doesn't matters how many projects there in virtual environment each can handled different different manage.py . and each project runs on different addresses if single app won't run on different addresses (until manually). as mentioned here had created app inside same project this project -- manage.py -- project -- -- settings.py -- -- urls.py <<--- main url pattern file whole project -- -- wsgi.py -- app1 -- -- views.py -- -- models.py -- -- urls.py <&

Slack bot that goes out and reads data from external page then posts? -

i have external website has dynamic data on refreshes regularly. i'd set slack bot reaches out site (maybe curl or screen scraping) , return first line of data message in channel. i browsed integrations , haven't found fits bill quite yet. don't have control on external site put send slack button on it. thanks! assuming curl/scraping part works intended, should have no specific issue. when user types either slash command or bot keyword, can perform scraping server then: if slash command, use delayed response (you have 30min respond, see documentation https://api.slack.com/slash-commands#responding_to_a_command ) if request came bot, post text in channel standard message it if shared more details framework use or share code

javascript - How do I return the response from an asynchronous call? -

i have function foo makes ajax request. how can return response foo ? i tried return value success callback assigning response local variable inside function , return one, none of ways return response. function foo() { var result; $.ajax({ url: '...', success: function(response) { result = response; // return response; // <- tried 1 } }); return result; } var result = foo(); // ends being `undefined`. -> more general explanation of async behavior different examples, please see why variable unaltered after modify inside of function? - asynchronous code reference -> if understand problem, skip possible solutions below. the problem the a in ajax stands asynchronous . means sending request (or rather receiving response) taken out of normal execution flow. in example, $.ajax returns , next statement, return result; , executed before function passed success callback

Python list appending issue -

i ran rather weird problem python list appending today. trying create array each element c struct . 1 of these elements list itself. problematic code: class players: name='placeholder' squad=list() teams=list() teams.append(players()) teams.append(players()) teams[0].name="abc" teams[1].name="xyz" teams[0].squad.append("joe") w in teams: print(w.name) print(w.squad) the output expected is: abc ['joe'] xyz [] since added member squad teams[0]. output is: abc ['joe'] xyz ['joe'] the name set fine .append appended both elements of teams ! what causes , how can work around this? the reason in class definition, squad , name class variables, not instance variables. when new player object initialized, sharing same squad variable across instances of player. instead, want define __init__ method player class explicitly separates instance-specific variables. class players: def

angularjs, unable to assign values to multiple attributes in custom directive -

i stuck problem have written custom directive rate stars, user can rate 1 5 clicking on stars, successful in achieving this. <span starrating class="star-rating" rating="ratedvalue" ></span> but using same directive display customer reviews, have isolated scope variable called "rating", , works too. <span starrating class="star-rating" readonlyflag="true" rating="reviewitem.rating" ></span> but time dont want user click , change rating. hence declaring variable in isolated scope of directive called "readonlyflag". when assign value readonlyflag in directive attribute. unable value in link function. the directive code below : angular.module("pagedirectives",[]).directive("starrating", function(){ return { restrict : 'a', template :'<ul class="list-inline">' + ' <li ng-repeat="star in stars&qu

javascript - HIde and show elements from list -

on screen load need hide elements list except li#active_language . second step click on visible li#active_language element, should open other li elements. tried code below isn't working. hope can help. thanks $(document).ready(function(){ $( ".jflanguageselection li:not(#active_language)").hide(); $( "#active_language" ).click(function() { $( ".jflanguageselection li:not(#active_language)").css("display","block";).show(10000); }); }); here html code: <ul class="jflanguageselection"> <li><a href="#"><img src="#" alt="english" title="english"></a></li> <li id="active_language"><a href="#"><img src="#" alt="deutsch" title="deutsch"></a></li> <li><a href="#"><img src="#" alt="swedish" title="swedish">&

excel - Re-size Row Height for Printing Dynamically -

Image
i attempting re-size row heights in order fix printing gaps appear when using auto re-size. example: in excel: in print preview: i've attempted number of things in order fix no luck. example of manual fix issue: in excel: in print preview: i cant fix issue manually because program creates multiple workbooks multiple cells have changed when issue occurs. seems occur cell spans more 3 rows, issue still happens both mono-spaced , regular fonts. i've tried using character ratio auto-fit height in vba didn't work , few other ideas fell short. at point im stumped. if wish recreate scenario use 54pt column width, size 8 calibri font, word-wrap, auto-fit row height, , filler text long enough.

algorithm - K negative edges - single source shortest path -

i've managed solve problem finding single source shortest paths when there's 1 negative edge using dijkstra. now i'm trying face new problem, how find shortest paths given source when there k negative edges using dijkstra (not bellman ford). (k known). can't think of way it. any suggestions? if nondirectional graph, there no single shortest path because single negative edge, go , forth on negative edge , have infinite number of paths of negative infinity. however, assuming directional graph no negative cycles, use breadth first search , keep track of both negative edges you've hit , shortest path each node you've discovered far. if see node you've visited, go there again if better previous path took there. since there no negative cycles algorithm must terminate. after algorithm terminates target node should have best path used there.

php - Any reason not to use bcrypt on email addresses? -

login form i'm working on right uses user email address , password login. thinking, there reason why shouldn't want use bcrypt on email addresses as: $email_hash = password_hash($email, password_default); i know it's intended passwords, what? should work on emails well... if email used login, shouldn't hashed/salted password? know isn't standard practice, never understood why. i don't need know user's email addresses. mean, it's not i'm gonna chat them. maybe when user gets banned should inform them email, why bother informing outlaws in first place. you need email address lookup user record. typically this: function create_account(email, password) { var pwhash = password_hash($password, password_bcrypt); // insert users values ($email, $pwhash); } function login(email, password) { // select pwhash users email = $email; return password_verify($password, $pwhash); // true or false } password_hash($email) retu

json - Best way to pass MPU6050 sensor data at 100 Hz from Edison to Intel Compute Stick -

our setup is: 1) intel edison reads raw data mpu6050 @ 100hz , calibrates 2) intel compute stick needs read data edison. connected usb. we need ensure there no lag data needs plotted in real time. to pass data edison intel compute stick considering using mqtt there opinion may lag due internal queue system. another option looking @ json, cause lagging @ 100 readings per second. any advise on best protocol use communicate info edison boars appreciated, thanks.

Typescript String Literal Types not working in function overloading -

according typescript documentation (look string literal types section), following code should work on typescript: function createelement(tagname: "img"): htmlimageelement; function createelement(tagname: "input"): htmlinputelement; // ... more overloads ... function createelement(tagname: string): element { // ... code goes here ... } when run code, or more meaningful variation, on typescript playground , or on visual studio, following error: specialized overload signature not assignable non-specialized signature. any suggestion? came error after trying implement similar on own code. did try start non specialized signature? function createelement(tagname: string): element; function createelement(tagname: "img"): htmlimageelement; function createelement(tagname: "input"): htmlinputelement; // ... more overloads ... function createelement(tagname: string): element { /* ... */ } ```

Noobish JavaScript Nested If-Else Statement Help/Advice/Pointers/YouNameIt -

i started learning javascript (today actually) , i'd appreciate nested if-else statements. thought i'd write simple program practice, , seems every if-else statement in if blocks executes regardless of parameter put in. pointers or things notice aren't germane problem @ hand appreciated. again. code below. edit: i've gotten now, , learned error of ways. commented , gave advice quickly. var playerone = prompt('choose rock, paper, or scissors'); var playertwo = prompt('choose rock, paper, or scissors'); var fight = function (playerone, playertwo) { if( playerone == 'rock' || 'rock') { if (playertwo == 'paper' || 'paper') { alert('player 2 wins!'); } else if (playertwo == 'rock' || 'rock') { alert('tie!'); } else { alert('player 1 wins!'); } } if(

Python Eve MONGO_DBNAME vs MONGO_AUTHDBNAME -

eve's global configuration docs mention mongo_authdbname , mongo_dbname parameters. i'd expect mongo_authdbname database eve checks provided authorization credentials against. analogous cl usage being: mongo -u "user" -p --authenticationdatabase "<mongo_authdbname>" --host x.x.x.x i expect mongo_dbname database eve orients endpoints/collections from. analogous cl usage being: mongo> use <mongo_dbname> so host:5000/endpoint refer endpoint collection within mongo_dbname however when set mongo_dbname other database need authenticate from, accessing every endpoint fails with: operationfailure: authentication failed. so... is understanding above correct? can mongo_dbname , mongo_authdbname different / credentials in settings.py have have authentication database same database want endpoints/collections oriented from? thanks check this question. in short, mongo_authdbname used in old mongodb authentic

python application that queries a database -

i need develop gui desktop application takes input user, calculations, , runs bunch of queries should exported csv, xls or txt file. want create installation package user can install without installing other applications (used front end) , other database (other ms access). questions are if use python front-end/gui, can create installation package? understand can create , .exe file .py file. want db copied in right folder (path referenced in program) on end-user's computer when user installs package. ms access (2010) on computer (windos 7 os) 32-bit , i'm having trouble using 64-bit python (version 3.5.1) , pyodbc(version 3.0.10). can use alternate db (sqlite?) user doesn't have install run application , don't have worry getting db in right folder on end-users computer. db small (few tables 1000 rows each). thanks much! looks can both - pyinstaller seems support sqlite3, python library working sqlite seems great fit use case: https://docs.python.org/3

ios - Parse just went AWOL -

1) woke morning , currentuser().objectid different has been past 3 months. of personal data lost , profile empty. objectid same old 1 on parse dashboard. reason it's different on device, , i've tried logging out/in repeatedly. 2) none of queries returning objects. i've been using many of same queries months, have worked great, they're not returning anything. is parse's fault? have until april 28th migrate data shouldn't expecting these results. why going crazy?

java - How to decrypt this String -

given following string: string s = "qba'g sbetrg gb qevax lbhe binygvar"; my desired output is: don't forget drink ovaltine my code: public static string decrpyt(string s){ string ans = ""; (int = 0; i<s.length(); i++) { int x = s.charat(i); if (x <= 105) { char c = ((char) (x + 13)); ans += c; } else { char c = ((char) (x - 13)); ans += c; } } return ans; } it returns: don4t-forget-to-drink-_our-ovaltine what need desired output? you changing characters, not letters, has been mentioned in comment. consider range of characters letters need modify. declare x char don't have consider actual numeric ranges. a-m => n-z action: += 13 a-m => n-z action: += 13 n-z => a-m action: -= 13 n-z => a-m action: -= 13 (all others) action: no change this can expressed in 3 cases: if ((x >= '

How do I get the unique maxium or greatest (version ID) value to each (Record ID) with row data in sql server -

in sql server joining 2 tables , need way maximum or greatest (version number) value each (record id) exists in table including it's row data selected. my query returning data follows returns record id's , versions, need return max version number value , row data: select distinct max(a.version_num), max(a.record_id), b.person, b.status, cast(a.summary_data nvarchar(4000)) table1 a, table2 b a.record_id = b.record_id , a.record_id not null , a.summary_data not null group a.version_num, a.record_id, b.person, b.status, cast(a.summary_data nvarchar(4000)) order max(a.version_num), max(a.record_id) desc this query returns duplicate record id's version number , row data: versionnum record id person status summary data 5 000000000000418 john open "specific summary data ... 4 000000000000418 jane closed "specific summary data ..."

sublimetext - Supress output in R -

it's possible supress output cat/print/similar in r console? i'm using sublimerepl sublime text , love supress echo when executing line (something ";" in matlab/octave), keeping output cat/print or similar commands obvious reasons. any idea? thanks in advance! there fair number of r functions return values way of invisible function. cat limited set of values, returned object larger. see instance code of lm : > invisible(strsplit(as.character(35600), split="..$")) > invisible(print(strsplit(as.character(35600), split="..$"))) [[1]] [1] "356" the r console works default read-eval-print loop , need emulate read , eval segments invisibly return value workspace. thought might need need rewrite readline function console output blanked out out. , need fiddle stdin , stdout connections well. section 1.6, "autoprinting" of r internals document required reading. made me wonder if recompile r r_visible

sql - Find non-duplicate records, excluding nulls, based on one field. -

i want find unique records in dat1 field, want every single null record returned. doesn't matter duplicate record dropped. example table: +----+--------------+ | id | dat1 | +----+--------------+ | 1 | 11@email.com | | 2 | 11@email.com | | 3 | null | | 4 | null | | 5 | 99@email.com | | 6 | 99@email.com | +----+--------------+ desired result: +----+--------------+ | id | dat1 | +----+--------------+ | 1 | 11@email.com | | 3 | null | | 4 | null | | 5 | 99@email.com | +----+--------------+ is possible? tried couple of approaches sub-queries couldn't quite pull off. select min(id), dat1 table dat1 not null group dat1 union select id , dat table dat1 null

lodash sorting an array of objects in javascript -

i have array of objects response server, trying sort uid in ascending order, while keeping entire array intact data array. meaning in data array there 2 elements. trying @ uid in 1 of arrays in of elements within array , determine order of how elements should placed within data array. i have tried following using lodash, doesn't seem work, feel i'm getting close , assistance: // sort by: console.log(res.results[0].data[0].row[1].uid) _.foreach(res.results, function(obj) { _.foreach(data, function(anotherobj) { _.foreach(row, function(row) { data.row = _.sortby(data.row, function(row) { return row[1].uid; }); }); }); }); here array of objects returned server: var res = { results: [{ columns: ['large', 'medium', 'small'], data: [{ row: [{ sid: 13, tid: 427 }, { uid: 69, vid: 450, wid: 65 }, null], multirow: {

what is the "Sources for sdk" in the Android sdk? -

i'm starting android development , want know de "sources sdk" present in android sdk manager. it's documentations or it's bin files? it's source files. this enable ide show source code when want see (e.g. while debugging), contains javadoc.

java - This is a run length encoding program for our partner assignment. -

we trying carry out instruction on javadoc. far have confused index paramter * read next run (or single character) , return index of symbol following run (or symbol read). * store count , symbol run in run parameter. * @param line - input line being processed * @param index - index of first character in next "run" (which might single character) * @param run - store symbol , count run * @return index of symbol following run read */ static int getnext(string line, int index, run run) { line.charat(index); //char first, line return ?.symbol;//store values run.count= ?.count; //the given number of specific symbol or repetition enter code here run.symbol= ?.symbol; //whatever symbol first see // completed return index+1;// make advance starter program doesn't loop infinitely } }

c# - How to Close Child Window Using Alt + F4 Key? -

alt + f4 shortcut close form. when use shortcut in mdi enviroment, application closed, shortcut applies 'container' , not 'childform'. what best practice capture event , close active child instead of container i read registering alt + f4 hotkey when mdi activates. when mdi deactivates, unregistering hotkey. so,the hotkey doesn't effect other windows. someone, can tell registering alt + f4 or better you can change void dispose(bool disposing) method in winform close child form instead, this: protected override void dispose(bool disposing) { if (/* need close child form */) { // close child form, maybe calling dispose method } else { if (disposing && (components != null)) { components.dispose(); } base.dispose(disposing); } } edit: commenter said, instead of modifying overridden dispose method, should override onformclosing method instead, so: protecte

Removing characters before adding to array in Java -

first off aware of arraylists , not want use them program. working on program local zoo (very beginning stages , not final version). takes user input , allows them enter animals , foods eat. program works fine if enter 1 food @ time, struggling figuring out how handle user input add more 1 food. (prompts guide them enter food separated commas, users may use spaces in between , need account either error message or accepting , csv.) there way , later retrieve values adding commas in? sorry pretty new java, help! code user input: //create array static string[][] animalfood; string[][] addarray(int x) { animalfood = new string[x][2]; scanner in = new scanner(system.in); //loop through array , add amount of items user chose (int row = 0; row < animalfood.length; row++){ system.out.print("enter animal name: "); animalfood[row][0] = in.nextline(); system.out.print("enter food animal eats: "); animalfoo

Using Ruby Driver to create a complicated query in Rethinkdb's Reql -

i using ruby driver rethink db , running problem nested elements has arrays. i have data structured this [{"family_name"=>"adam"}, {"family_name"=>"bobby"}, {"family_name"=>"crissy", "groups"=> [{"logo_url"=>"https://www.logourl.com/1111.png", "name"=>"sample name 1", "profile_url"=>"https://www.profileurl.com/groups?gid=1111"}, {"logo_url"=>"https://www.logourl.com/2222.png", "name"=>"sample name 2", "profile_url"=>"https://www.profileurl.com/groups?gid=2222"}, {"logo_url"=>"https://www.logourl.com/3333.png", "name"=>"sample name 3", "profile_url"=>"https://www.profileurl.com/groups?gid=3333"}, ]}, {"family_name"=>"bobby"}

php - phpLiteAdmin - Adding Images -

an application presently working on requires sqlite database. not 1 maintaining database believe tremendously beneficial use tool such phpliteadmin. however, need way store image blob in table (i know there pitfalls storing actual image data in database, purposes believe best approach). there way gui tool such phpliteadmin or not? somehow write custom function implement behavior if available default? thanks much! as alternative, store image's file name in char type column. example, there column img_filename in table. can show image in html <img src='...'> tag: <?php // database query here // ... print "<img src='".$row['img_filename']."' />" ?>

javascript - How to handle closures in TypeScript (Angular injections)? -

i have angular factory service in javascript defined this: app.service('myservicefactory', ['$http', '$timeout', '$interval', function($http, $timeout, $interval) { function myservice() { // can use injected values here without additional efforts } this.create = function() { return new myservice(); } }]); now want convert typescript: module services { export class myservicefactory { static $inject: string[] = ['$timeout', '$interval', '$http']; constructor( private timeout: angular.itimeoutservice, private interval: angular.iintervalservice, private http: angular.ihttpservice) { } public create(): myservice { return new myservice(); }; } export class myservice() { // have problem here. need redefine , // initialize variables, injected factory class } angular.module('mymodule').service('myservicefactory', myservicefactory); } do

php - Bootstrap button input group wont display correctly with <form> tags -

Image
so i'm working on social networking facebook type proof of concept project college , i'm trying bootstrap, multi-button input group display comment box. i have text area, comment , button on right hand side, whole input group filling width of panel seen below. trying achieve this! the problem when add in <form> tags, formatting of entire group within <div class="row"> goes crazy , forms little box on left hand side (screenshot below). if take out <form> tags formats properly, i'm not sure how manage <form> tags/where put them achieve multi-button group. how displays currently the code below few undos later when forms weren't broken, know isn't how went achieving it, i've succumbed now. if knows how achieve i'd grateful! while($row = mysqli_fetch_assoc($result)) { //get relative timestamp current post $timestamp = strtotime($row['statustimestamp']); $stamprelative = check

amazon web services - aws-sdk for Lambda not up to date? -

Image
i use node4.3 lambda function triggered custom resource in cloudformation json requires latest aws-sdk able call var cognitoidentityserviceprovider = new aws.cognitoidentityserviceprovider(); but looks aws-sdk not latest since errors , can see in logs aws.cognitoidentityserviceprovider undefined. am doing wrong or there workaround? as per docs here: http://docs.aws.amazon.com/awsjavascriptsdk/latest/index.html cognitoidentityserviceprovider not supported yet note: although services supported in browser version of sdk, not of services available in default hosted build (using script tag provided above). list of services in hosted build provided in "working services" section of browser sdk guide, including instructions on how build custom version of sdk services.

html - web page navigation not working when link is clicked -

i have web page table of contents , page navigation not working. here html: <a name="top_of_page">create account</a> <a href="#top_of_page">top</a> when click on top of page link nothing happens. doing wrong? in advance. name not correct attribute use. use id instead. <a id="top_of_page">create account</a> <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br> <a href="#top_of_page">top</a>

Excel VBA to find non unique values with multiple conditions -

Image
i looking trying create excel macro. have large sheet bit this: account name address dealer 68687 sara 11 wood 1111 68687 sara 11 wood 1111 68687 sara 11 wood 1111 12345 tom 10 main 7878 12345 tom 10 main 7878 54321 tom 10 main 7878 10101 john 25 lake 3232 10101 25 lake 3232 11111 john 25 lake 3232 what need highlight rows on sheet each dealer has more 1 unique value in account column, must have value in name column. in above example want highlight rows dealer 7878. i not if should @ loops or arrays, might take long time sheet quite large. looking help. thanks. james - dirk gave answer in comment. looks ... the format formula put column f, can see results of calculation. if feel should still have vba solution, gives starting point how layout code ... ignore rows empty name count rows dealer same dealer in current row, , account not same account in current row if count found in step 2 greater 0, highlight current r

javascript - scope variable not getting passed to template included using ng-include -

scope variable not getting passed template included through ng-include tag. want generic.html page come page1.html , page2.html. getting static content hi,welcome when click method in controller1.js name enclosed in angular directive not getting printed. tried name in 1 object $scope.user = {} , added user.name not able bond name in html template. main.js $stateprovider .state('index', { parent: 'app', abstract : true, url: '/index', views: { 'content@': { templateurl: urlpath+'ngtemplates/chat/chat.menu.html', controller: ['$state',function ($state) { $state.go('screen.welcome'); }] } } }) .state('screen.welcome', { url: '', templateurl: urlpath+'templates/page1.html',

Select all hierarchy level and below SQL Server -

i having difficult time one. have seen few examples on how obtain child records self referencing table given parent , how parents of child records. what trying return record , child records given id. to put context - have corporate hierarchy. where: #role level# -------------------- corporate 0 region 1 district 2 rep 3 what need procedure (1) figures out level record , (2) retrieves record , children records. the idea being region can see districts , reps in district, districts can see reps. reps can see themselves. i have table: id parentid name ------------------------------------------------------- 1 null corporate hq 2 1 south region 3 1 north region 4 1 east region 5 1 west region 6 3 chicago district 7 3

javascript - Krajee Bootstrap file input dynamic maxFilecount -

i want set maxfilecount dynamic nums if input field changed. my code: <input value="" name="check_nums" class="check_nums"> krajee fileinput: $(document).on('ready', function() { $('#file-th').fileinput({ var check_nums = $(".check_nums").val(); showuploadedthumbs: false, language: 'th', uploadasync: false, maxfilecount: [check_nums], resizepreference: 'height', resizeimage: true, overwriteinitial: false, validateinitialcount: true, showupload: false, allowedfileextensions: ['jpg', 'png', 'jpeg'], previewsettings: { image: {width: "auto", height: "100px"}, object: {width: "213px", height: "160px"}, }, layouttemplates: { actions: '<div class="file-actions">\n'

c# - List GetEnumerator return type does not match interface -

in visual studio 2015, when go list.cs , see class declaration, see 1 method named getenumerator: public enumerator getenumerator(); on other hand, interface ienumerable<t> , ienumerable specifies must define method format is: ienumerator<t> getenumerator(); ienumerator getenumerator(); this made me believe interface method can implemented though reuturn type not excatly match. although, turned out wrong when tried. what happening here? if @ source see 2 different getenumerator methods: public enumerator getenumerator() { return new enumerator(this); } ienumerator<t> ienumerable<t>.getenumerator() { return new enumerator(this); } the second 1 used if accessing object through ienumerator interface. both use same underlying implementation however. [serializable] public struct enumerator : ienumerator<t>, system.collections.ienumerator { ... } you can still typed version follows: var examplelist = new list<strin

Why is my Javascript form validation not working properly? -

why validation failing on second attempt here? on first attempt validation works fine, on second run, accept inappropriate values in email field. first 2 fields work fine, third field accept text after first run. validates if change value in email field, otherwise keep displaying error , failing validate should. function validate(){ clearerrors(); var errorflag = true; var name = document.getelementbyid("name"); nameval = name.value; if(nameval.length === 0){ var nameerror = document.getelementbyid("nameerror"); nameerror.style.display = "block"; errorflag = false; } var phone = document.getelementbyid("phone") var phoneval = phone.value; if(isnan(phoneval) || (phoneval < 1000000000 || phoneval >10000000000)){ errorflag = false; var phoneerror = document.getelementbyid("phoneerror"); phoneerror.style.display = "block";

How to detect the keyboard on the android window - Titanium Appcelerator -

i need verify existence of keyboard in window of android app ... problem can not test focus / blur input, , need check keyboard ... see official documentation appcelerator , functionality ios ... have solution? keyboardvisible property ios: http://docs.appcelerator.com/platform/latest/#!/api/titanium.app-property-keyboardvisible on ios can listen keyboardframechanged event. android, might able use 1 of these modules .

javascript - native ES6 Promises in browser vs. Node (asynchrony) -

it looks es6 promises async default, without need use process.nexttick in node (unlike events instance). e.g.: promise.resolve('foo').then(function a() { console.log('bar'); }); console.log('baz'); "baz" gets logged before "bar" appears async. with node.js, internally accomplished via process.nexttick or not. however, browser, how asynchrony achieved native promises? settimeout or other facility? we can see async well: new promise(function(resolve){ resolve('foo'); //called synchronously }).then(function(){ console.log('bar'); }); console.log('baz'); ("baz" logged first)

how does extern "C" allow C++ code in a C file? -

in order use c++ code in c file, read can extern "c" { (where c++ code goes here)} , when try printing out using cout, keep getting error because not recognize library . think confused on how extern "c" allows use c++ code in c. the opposite true. can use extern c add code want compile c code using c++ compiler. unless i'm missing can't compile c++ code c compiler.