Posts

Showing posts from May, 2015

json - How to input multiple log groups for cloudformation -

so have cloud formation stack, bit modified version of https://aws.amazon.com/blogs/aws/cloudwatch-logs-subscription-consumer-elasticsearch-kibana-dashboards/?adbsc=startups_20150803_50195176&adbid=628221613226332160&adbpl=tw&adbpr=168826960 stack aws. problem want stream multiple log groups es , kibana. i thought logical solution change type: string type: commadelimitedlist : "loggroupname": { "description": "the cloudwatch logs log group use source subscription feeds elasticsearch cluster", "type": "string", "default": "" }, but gives me error loggroupname type must string. why doesn't method work? according aws, there isn't support feature yet : https://github.com/awslabs/cloudwatch-logs-subscription-consumer/issues/18#issuecomment-246456407

mysql - Not able to delete or update a row in PHP? -

i working on first php app simple notes taking application. using different urls notes - echo "<p><a href='/see_note.php?id={$row["note_id"]}'>{$row['note']}</a></p>"; so, primary key acts parameter url of note. link redirects me note without problem, when try delete or update note throws error - undefined index: id in /home/user/phpstormprojects/notes/see_note.php on line 17 line 17 extracting id url - $note_id = $_get['id']; here rest of code page displaying note- //get id url $note_id = $_get['id']; //fetch note database $query = "select note notes note_id = '$note_id'"; $query_result = mysqli_query($dbconn, $query) or die(mysqli_error($dbconn)); $row = mysqli_fetch_assoc($query_result); $note = $row['note']; //update note if(isset($_post['save_note_btn'])) { $note = $_post['note']; $query = "update notes set note = '$note' n

python - Pandas groupby object filtering -

i have pandas dataframe df.columns index([u’car_id’,u’color’,u’make’,u’year’)] i create new filterable object has count of each group (color,make,year); grp = df[[‘color’,’make’,’year’]].groupby([‘color’,’make’,’year’]).size() which return this color make year count black honda 2011 416 i able filter it, when try this: grp.filter(lambda x: x[‘color’]==‘black’) i receive error typeerror: 'function' object not iterable how leverage 'groupby' object in order filter rows out? i think need add reset_index , output dataframe . last use boolean indexing : df = df[['color','make','year']].groupby(['color','make','year']) .size() .reset_index(name='count') df1 = df[df.color == 'black']

Java Reference Object Duplicating -

ok, here code written public void print( object obj ){ system.out.println( obj.tostring() ); } public main() { linkedlist<integer> link = new linkedlist<integer>(); linkedlist<integer> temp = link; link.push(1); link.push(2); temp.push(10); while( link.isempty() == false ){ print( link.getlast() ); link.removelast(); } } i guess supposed print 1 & 2 because pushing 10 temp variable, not link. it's printing 1 2 10. what's happening here? can explain me? thanks. you need understand java references are. point objects live on heap. linkedlist<integer> link = new linkedlist<integer>(); linkedlist<integer> temp = link; when set temp equal link equating references . both point same object on heap. if modify object using either reference, other 1 sees well. if want temp independent of link, this: list<integer> link = new linkedlist<integer>(); list

python - improve linear search for KNN efficiency w/ NumPY -

i trying calculate distance of each point in testing set each point in training set: this loop looks right now: x in testingset y in trainingset print numpy.linalg.norm(x-y) where testingset , trainingset numpy arrays each row of 2 sets hold feature data 1 example. however, it's running extremely slowly, taking more 10 minutes since data set bigger (testing set of 3000, training set of ~10,000). have method or utilizing numpy incorrectly? this because naively iterate on data, , loops slow in python. instead, use sklearn pairwise distance functions , or better - use sklearn efficient nearest neighbour search (like balltree or kdtree). if not want use sklearn, there module in scipy . can "matrix tricks" compute this, since || x - y ||^2 = <x-y, x-y> = <x,x> + <y,y> - 2<x,y> you can (assuming data in matrix form given x , y): x2 = (x**2).sum(axis=1).reshape((-1, 1)) y2 = (y**2).sum(axis=1).reshape((1, -1)) dist

How to read "paired data" into an R data.table? Using an R list? -

let's have data.table in r: library("data.table") dt = data.table(x=c("b","b","b","a","a","a"),v=rnorm(6)) > dt x v 1: b 0.77399102 2: b 0.71450334 3: b 0.07187842 4: -0.88098815 5: -0.90192891 6: 0.66439642 i supply vector x field, , vector v field, each 6 items. however, see supply b 3 times, , a 3 times. key-value pair, i.e. 'b' : '0.77399102', '0.71450334', '0.07187842' 'a' : '-0.88098815', '-0.90192891', '0.66439642' in r, 1 implement list, i.e. pairs = list(b = c('0.77399102', '0.71450334', '0.07187842'), = c('-0.88098815', '-0.90192891', '0.66439642')) i input r list pairs data.table . possible? i'm confused how define x , v fields object. if isn't possible, how 1 this? use data.table(x = nam

XSLT 1.0 Loop Over Data Array -

i've been plugging away @ xslt stuff , i'm struggling it. i'm using software creates xslt template , adds order object. i've looped on , well, have serialized object need loop over. i've got custom php function processing this, have control on output looks like, don't know how loop on variable. this have far , i've tried several other combinations: <xsl:variable name="mi"> <xsl:value-of select="php:functionstring('client\marketing\helper\order::unserializemarketingitems', increment_id)"/> </xsl:variable> <xsl:for-each select="$mi"> <xsl:value-of select="item_id" /> </xsl:for-each> because calling custom php function (unserializemarketingdata) can , have tried making xml structure , returned regular object. but can't seem make happen have loop on object for-each. causes script go white or doesn't output @ all. so s

php - Login function only using second condition and not first -

i use username when username second condition email wouldn't work , vise versa. code below appreciated. :) public function loginuser($usernameemail,$password){ $query = $this->db->prepare("select * users email or username = :usernameemail"); $query->execute(array(":usernameemail"=>$usernameemail)); $rows = $query->fetch(pdo::fetch_assoc); if(password_verify($password, $rows['password'])){ $_session['userid'] = $rows['userid']; $_session['username'] = $rows['username']; $_session['usergroup'] = $rows['usergroup']; return true; } else { return false; } } you need test columns individually, combine tests or . where email = :usernameemail or username = :usernameemail you use in () : where :usernameemail in (email, username) your query being parsed as where (email != false) or (username = :us

How to do horizontal lines from a one column file using gnuplot? -

having file 1 column of data example: 10 2 34 4.5 16 i'd plot stack of horizontal lines plotting horizontal line let's -3 3 (x range) y value equal first row (10 in example), replot horizontal line ranging x=[-3:3] y value equal second row (2 in example), , on. how can it? use vectors plotting style. plot "file" using (-3):($1):(6):(0) vectors nohead the 4 values in using expression x (plain number -3), y (value first column), dx , dy .

shell - Store result of an operations in a variable in bash -

i have command in bash returns locale of ip address stored in variable $line . command looks this: geoiplookup -f geoip.dat "$line" >> resultfile which return result such "new york, ny". now want concatenate ip address result looks this: "215.216.217.218, new york, ny" so like: $line +", "+ (geoiplookup -f geoip.dat "$line") >>resultfile can give me correct syntax this? how about echo "$line, $(geoiplookup -f geoip.dat "$line")" >> resultfile this relies on backtick operator of bash $(...) executes command , captures output. in above line, bash execute geoiplookup -f geoip.dat "$line" , put output in place of $(...) part.

recursion - Understanding Event Queue and Call stack in javascript -

my curiosity understanding concept of "event queue" , "call stack" started when solving question: var list = readhugelist(); var nextlistitem = function() { var item = list.pop(); if (item) { // process list item... nextlistitem(); } }; the following recursive code cause stack overflow if array list large. how can fix , still retain recursive pattern? the solution mentioned this: var list = readhugelist(); var nextlistitem = function() { var item = list.pop(); if (item) { // process list item... settimeout( nextlistitem, 0); } }; solution: the stack overflow eliminated because event loop handles recursion, not call stack. when nextlistitem runs, if item not null, timeout function (nextlistitem) pushed event queue , function exits, thereby leaving call stack clear. when event queue runs timed-out event, next item processed , timer set again invoke nextlistitem. accordingly, meth

javascript - Referring to external function parameter within $timeout -

i listening websocket events sockjs , want insert received objects $scope.mails.items array. have below code snippet , problem reason not able pass message delayed function. know... tried read explanations issue asked repeatedly, still not able figure out why not working in particular case. reason need delay i'd make sure gets applied view, not otherwise. myservice.receive().then(null, null, function(message) { $timeout(function(m) { if($scope.mails.items.indexof(m) == -1) { $scope.mails.items.push(m); } }, 0, true, message); }); when debugging it, can see message variable has proper value when comes stopping in middle of delayed function, m not getting data, expect $timeout pass down. can please help? not sure why m not getting value (explanation welcome), works: myservice.receive().then(null, null, function(message) { $timeout(function() { if($scope.mails.items

INNER JOIN two BigQuery tables based on common timestamps within a range of each other? -

i have 2 table in bigquery. 1 has bunch of data based around timestamp. second set of data has feature add first set, timestamp. however, timestamps aren't same. however, know within 30 seconds of each other. i thinking join... on abs(timestamp1 - timestamp2) < 30, that's not working. you can cross join. not efficient, work if tables relatively small. syntax (also using standard sql, see mikhail's link how enable it): select ts1, x, ts1, y maintable cross join secondtable abs(ts1 - ts2) < 30 for large tables, might have more elaborate, bucket both sides minute, , equality join. you'll need support case when join crosses neighbor bucket, like: select ts1, x, ts2, y maintable join (select *, round(ts2/30) bucket secondtable union select *, round(ts2/30-1) bucket secondtable union select *, round(ts2/30+1) bucket secondtable) on round(ts1/30) = bucket abs(ts1-ts2) < 30 if there more 1 match , need select best one, like sele

asp.net core - How to inject HttpHeader value in controller? -

i have web api developed using asp.net core api. every incoming request has custom header value inserted. eg x-correlationid . controller use value logging , tracing request. i'm reading value in each controller below [route("api/[controller]")] public class documentcontroller : controller { private ilogger<transformcontroller> _logger; private string _correlationid = null; public documentcontroller(ilogger<documentcontroller > logger) { _logger = logger; _correlationid = httpcontext.request.headers["x-correlationid"]; } [httppost] public async task<inttransform([frombody]requestwrapper request) { _logger.loginformation("start task. correlationid:{0}", _correlationid); // here _logger.loginformation("end task. correlationid:{0}", _correlationid); return result; } } i think against di rules. instead of reading value inside contro

python - draw a large graph with many nodes and edges with igraph -

i'm trying visualize big data set of nodes , edges , have 2 files: nodes.txt , edges.txt , want draw graph them. it's got 403,394 nodes , 3,387,388 edges. know generate them randomly. so decide using igraph python draw layout , plot when try draw simple graph few edges works huge data set got memory error , doesn't work right. want draw graph edge list igraph . or maybe there better way do, suggest me. i use layout drl algorithm , use function plot.

javascript - Redux - how to save input value despite reRender? -

redux - how save input value despite rerender? can put value, save change, 1 point data ago when click 2-nd - 1-st constructor(props) { super(props); this.fields = {} } .... onchangename(e) { this.fields.tablename_input = e.target.value } onchangeparticipants(e) { this.fields.tableparticipants_select = e.target.value } componentdidupdate(params){ if (params.editing){ console.log(params) let tablename_input = this.fields.tablename_input && this.fields.tablename_input || params.table.name reactdom.finddomnode(this.refs.tablename_input).value = tablename_input let tableparticipants_select = this.fields.tableparticipants_select && this.fields.tableparticipants_select || params.table.participants reactdom.finddomnode(this.refs.tableparticipants_select).value = tableparticipants_select } } please add code fires saving, think problem it's in how update fields parameter. but, doing property not

Webpack Dev Server 2.1.0-beta.02 fails to load modules on second compilation -

i’m setting new project webpack2.1.0-beta.22 , web-pack-dev-server2.1.0-beta.2 . now, i’ve set webpack build configs few times i’m not stranger process, seem have weird bug. when run webpack straight up, app compiles 0 problems. but, when run webpack-dev-server fails after first compilation (ie. after first source code change) complaining not being able find files. error in ./~/css-loader!./~/postcss-loader!./src/app.css module build failed: (systemjs) enoent: no such file or directory, open '/users/jamie/skyrkt/bento-components/node_modules/css-loader/lib/loader' error: enoent: no such file or directory, open '/users/jamie/skyrkt/bento-components/node_modules/css-loader/lib/loader' @ error (native) error loading /users/jamie/skyrkt/bento-components/node_modules/css-loader/lib/loader "./lib/loader" /users/jamie/skyrkt/bento-components/node_modules/css-loader/index.js @ ./src/app.css 4:14-116 @ ./src/index.js @ multi main and err

arraylist - How to create a mutable array list containing immutable objects, Java -

i have objects representing columns in table want declare final. of these columns represent primary keys in table, , columns want add them array list gets passed function. how can declare mutable list (one can add primary key columns to) contains immutable objects (the column objects themselves)? public final class column { private final integer a; private final string b; public column(integer a, string b) { this.a = a; this.b = b; } public integer geta() { return a; } public string getb() { return b; } } create column class in fashion , add object arraylist. check out : http://docs.oracle.com/javase/tutorial/essential/concurrency/imstrat.html

I have been learning python 3.5, and trying to get a string to reprint a user input variable? -

print ("how old you??"), age = input() print("how tall you"), height = input() print("how weigh"), weight = input() print("so, you're '%r' old, '%r' tall , weigh '%r' ") % ('age, height weight') typeerror: unsupported operand type(s) %: 'nonetype' , 'str don't put variables in quotes. instead of print("so, you're '%r' old, '%r' tall , weigh '%r' ") % ('age, height weight') put print("so, you're '%r' old, '%r' tall , weigh '%r' " % (age, height weight))

Scala Play Json JSResultException Validation Error -

i trying pass json string other method error, play.api.libs.json.jsresultexception: jsresultexception(errors:list((,list(validationerror(error.expected.jsstring,wrappedarray()))))) i find strange occurs randomly, don't exception , do. ideas? here json looks val string = { "first_name" : { "type" : "string", "value" : "john" }, "id" : { "type" : "string", "value" : "123456789" }, "last_name" : { "type" : "string", "value" : "smith" } } i read (string \ "first_name").as[string] (string \ "first_name") gives jsvalue not jsstring as[string] not work. but if need first name value can val firstname = ((json \ "first_name") \ "value").as[string]

c++ - How many other files does include affect aside from the one it's in? -

Image
i'm learning c++, , under presumption including affect file included it, appear wrong. setup so: if don't include baseclass.h in either main or subclass (extends baseclass), seemingly-normal error telling me can't use baseclass in subclass because doesn't exist. if include baseclass.h in subclass.h, works fine. if don't include baseclass.h in subclass.h, include in main cpp, works fine? @ first thought meant including in 1 file included whole project, i'm not sure because baseclass.cpp included baseclass.h whole time , got error when wasn't included in main/subclass. why able interchange inclusion of baseclass.h between main cpp , subclass.h while having function in both cases? how many files affected when include something? i'm working in eclipse neon mingw gcc project, i'm not sure if affects behavior. here source code i'm working with: the main cpp, reproproject.cpp: #include <iostream> #include "baseclass.h" #i

jquery - How to get json in web2py view -

the methods data in view of web2py not seem working. used method mentioned in http://web2py.com/books/default/chapter/29/10/services <script> $.getjson('/application/default/weekdays', function(data){series: [{ type: 'area', name: 'response(kw)', data: data }] }); for plotting purpose , did not work; plot did not show up. used method in http://www.web2pyslices.com/slice/show/1334/consuming-a-web2py-json-service-with-jquery jquery.getjson("{{=url(r=request,f='call',args=['json','get_days'])}}", function(data){... , using plot showed not data. the $.getjson('/application/default/weekdays' did not somehow work, $.getjson('default/weekdays' worked.

python - Assignment build in functions -

i found example make me curious: int = float def parse_string(s): return int(s) print(parse_string('42')) the returned result 42.0 . int , float build in functions. how come can assign float int (build in functions)? seems wired me. python use references objects. when write int = float , change int reference point same object (a built-in function here) 1 pointed float reference. you don't change nature of int of course. you can restore int reference importing __builtin__ : import __builtin__ int = __builtin__.int

No matching function for call (3 arguments expected, 0 actual). Dealing with vectors and strings in C++ for the first time -

i trying write program gets bigger , smaller depending on data text file. there 3 functions have specific instructions. first project using vectors have been pretty confused. @ first getting lot of error messages have cut down 1 error in compiler. the error getting in insert function there no matching function call , candidate expects 3 arguments there none. have googled error , have read might need constructor can't seem set correctly. see need edit code pass 3 arguments, i'm not sure if supposed in function below or in main. another thought might passing wrong type googled error. possible haven't used vector , might not passing types correctly. calling reference might not right thing do. if me out appreciate help. i've been fixing errors past few hours google can't seem fix final error(which admittedly because of several errors). thank you. #include <iostream> #include <vector> #include <string> #include <fstream> using namespac

python - How do I get .to_datetime() to stop offsetting by UTC in string -

this question has answer here: how read datetime timezone in pandas 1 answer i'm converting timestamp given string .csv file. in format: 2016-06-06t09:30:00.000856632-04:00 when use .to_datetime() convert date object, offsets utc time. in example, 9:30am becomes 1:30pm: 2016-06-06 13:30:00.000856632 i read documentation function , thought setting utc = false parameter fix offsets time different amount. the string has -4 hours offset. remove before conversion: >>> pd.to_datetime("2016-06-06t09:30:00.000856632-04:00"[:-6]) timestamp('2016-06-06 09:30:00.000856632')

osx - Java folder missing -

i cant find java folder using osx cmd line. tried using find /users -name java , no luck. have looked on many sites library though root user still getting denied permissions. you can try /usr/libexec/java_home if looking specific version can use -v option for java 7 /usr/libexec/java_home -v 1.7 for java 8 /usr/libexec/java_home -v 1.8

java - Spring Boot & Zuul not honoring proxied favicon -

i've tried few different configurations tell zuul use favicon of proxied web-server, i've come empty handed. here's have configured of on zuul server. zuul.routes.favicon.path=/favicon.ico zuul.routes.favicon.url=http://mycontentserver.com/favicon.ico spring.mvc.favicon.enabled=false but responses? $ curl -sil http://myzuulserver.com/favicon.ico http/1.1 404 not found which should route to... $ curl -sil http://mycontentserver.com/favicon.ico http/1.1 200 ok keeping spring mvc favicon enabled returns typical spring icon. do have misconfigured here? misunderstanding how favicons work? so spring cloud netflix zuul appends path url. 404 experiencing mycontentserver.com not zuul. asking http://mycontentserver.com/favicon.ico/favicon.ico . set zuul.routes.favicon.url=http://mycontentserver.com/ .

Printing numbers from 1-100 as words in Python 3 -

list_of_numbers1to19 = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten', 'eleven', 'twelve', 'thirteen', 'fourteen', 'fifteen', 'sixteen', 'seventeen', 'eighteen', 'nineteen'] list_of_numbers1to9 = list_of_numbers1to19[0:9] list_of_numberstens = ['twenty', 'thirty', 'fourty', 'fifty', 'sixty', 'seventy', 'eighty', 'ninety'] in list_of_numbers1to19: print(i) list_of_numbers21to99 = [] count = 19 tens_count = 0 j in list_of_numberstens: k in list_of_numbers1to9: if tens_count%10 == 0: #should print iteration of list_of_numberstens tens_count +=1 tens_count +=1 print(j, k) as can see, getting messy :p sorry

listview - List All Mp3 files in android -

i developing music player in android stuck in reading mp3 files. here code read mp3 files. not returing files device(although there files copied using adb). want list using album, artist etc. please in this. final string media_path = environment.getexternalstoragedirectory()+""; private arraylist<hashmap<string, string>> songslist = new arraylist<hashmap<string, string>>(); // constructor public songsmanager(){ } /** * function read mp3 files sdcard * , store details in arraylist * */ public arraylist<hashmap<string, string>> getplaylist(){ file home = new file(media_path); //if (home.listfiles(new fileextensionfilter()).length > 0) { if (home.listfiles(new fileextensionfilter())!=null) { (file file : home.listfiles(new fileextensionfilter())) { hashmap<string, string> song = new hashmap<string, string>(); song.put("songtitle", file.getname().substring(0, (f

c - Does a memory leak exist? -

i'm looking @ assignment question. there piece of c code: char* read_from_file (const char* filename, size_t length) { return null; } void main (int argc, char **argv) { char* buff; if ((buff = read_from_file("test1.txt", 10)) == null) { fprintf(stdout, "failed read test1.txt\n"); } else { fprintf(stdout, "buff is: %s\n", buff); } if ((buff = read_from_file("test2.txt", 10)) == null) { fprintf(stdout, "failed read test2.txt\n"); } else { fprintf(stdout, "buff is: %s\n", buff); } } the question says memory leaking. tells me insert free(buff) statements in main program suppress memory leaking. thought memory leaks associated dynamic memory allocation. well, shouldn't free() used free pointer memory block allocated malloc() , etc. is there i'm missing assignment question? note: i'm looking advice , insights. there missing here. the

Is there any way to modify this tracking.phtml on magento admin? -

Image
when choose 1 of option below, field 'title' automatically filled selected value carrier options. i want same 'number' field, filled when choose custom carrier. there way modify tracking form? if yes, how? thank's in advance add following observer in module's config.xml <events> <adminhtml_block_html_before> <observers> <add_script_on_shipment> <class>yourmodule/observer</class> <method>addscript</method> </add_script_on_shipment> </observers> </adminhtml_block_html_before> </events> put following code in observer.php public function addscript($observer) { $block = $observer->getevent()->getblock(); if (($block instanceof mage_adminhtml_block_sales_order_shi

ios - Animating a CAShapeLayer / CAGradientLayer -

Image
this addition question asked yesterday. result worked perfect, modification. using drawrect draw & animate 2 graphs. background graph, , foreground graph the following code, based on thread above, produces cabasicanimation grows dark blue "triangle." instead of dark blue solid color, cagradientlayer 3 stops: red / green / blue. i tried adding cagradientlayer configure gradient, used addsublayer add gradient cashapelayer animates out. result posting below not animate. color , shape remain static. gradient looks great, need animate out: import uikit import quartzcore import xcplayground let view = uiview(frame: cgrect(x: 0, y: 0, width: 521, height: 40)) view.backgroundcolor = uicolor.whitecolor() xcplaygroundpage.currentpage.liveview = view let maskpath = uibezierpath() maskpath.movetopoint(cgpoint(x: 0, y: 30)) maskpath.addlinetopoint(cgpoint(x: 0, y: 25)) maskpath.addlinetopoint(cgpoint(x: 300, y: 10)) maskpath.addlinetopoint(cgpoint(x: 300, y: 30)) maskpa

Remove separated objects in an Image C# -

Image
your appreciated. using c# , emgucv image processing i have tried noise removal, nothing happens. tried image median filter, , works on first image, not work on second image. makes second image blurry , objects larger , more square-like. i want remove distinct objects (green ones) in image below turn black because separated , not grouped unlike second image below. image 1: at same way, want in image below, remove objects -- (the black ones) -- not grouped/(lumped?) remains on image objects grouped/larger in scale? image 2: thank you you may try gaussian blur , apply threshold image. gaussian blur used effect in graphics software, typically reduce image noise , reduce detail , think matches requirements well. for 1st image: cvinvoke.gaussianblur(srcimg, destimg, new size(0, 0), 5);//you may need customize size , sigma depends on different input image. you get: then cvinvoke.threshold(srcimg, destimg, 10, 255, emgu.cv.cvenum.thresholdtype.b

javascript - Knockout Js "You cannot apply bindings multiple times to the same element" -

i using kendo mobile app builder , using knockout js bindings getting error " you cannot apply bindings multiple times same element ". have 2 javascript file consist bindings, below code //employee.js// function employeeviewmodel() { this.employeename= ko.observable(); this.employeemobile= ko.observable(); this.employeeemail= ko.observable(); } ko.applybindings(new employeeviewmodel()); //company.js// function companyviewmodel() { this.companyname= ko.observable(); this.companymobile= ko.observable(); this.companyemail= ko.observable(); } ko.applybindings(new companyviewmodel()); //in index page using both script file drag , drop// <html> <head> </head> <body> <script src="employee.js"></script> <script src="company.js"></script> </body> </html> the "ko.applybindings" function takes 2 arguments: applybindings(viewmodelorbindingcontext,

sql - Need advice about JOIN by LIKE operator -

i have 2 data tables, 1 contain customer data such customer id , used bonus codes. second table internal notes, every note write customer there, example: gave customer 12 bonus code gft100. know need join 2 table based on bonus code, want every bonus code player used find relevant note in notes table. table 1: used bonus codes customerid | coupon_code | dateofusege -------------------------------------- 12 | aaa25 | 2016-09-10 ------------------------------------- 12 | bbb13 | 2016-09-10 -------------------------------------- 17 | ccc14 | 2016-09-10 table2:customer notes customerid| date | text --------------------------------------------- 12 |2016-09-07| gave bonus aaa25 ---------------------------------------------- 12 |2016-09-07| customer ---------------------------------------------- 17 |2016-09-06| gave bonus code ccc14 desired output: e

laravel 4 - How to reuse PHPUnit functions -

i want reuse of phpunit functions calling them instead of repeating them in unit tests, such example: public function testcontent() { $this->assertnotempty($this->response, $this->message); } if place under tests/testcase.php, runs unit tests. where right place put or how done? btw, using on laravel 4. apparently, problem not re-use tests, tests beeing called when it's not expected. so, have in mind: method name starting "test" (testfoo, testbar) in existing class considered test. so if have classes a, b , c this class extends \phpunit_framework_testcase { public function testfoo() {...} public function testbar() {...} } class b extends { public function testbaz() {...} } class c extends { public function testquz() {...} } you have 8 tests: a::testfoo(), a::testbar(), b::testfoo(), b::testbar(), b::testbaz(), c::testfoo(), c::testbar(), c::testquz(). it's not trying make. may want have testfoo , testb

javascript - OnLine Video Recording/Editing in PHP -

i going start 1 project(online video recording/editing). idea presenter can record/edit video online, please give me inputs. refer of these projects similar thing the recordrtc-to-php project project video recodrding , saving in php server. another project media stream recorder . a web video editor run on php here

spring - 400 the request sent by the client was syntactically incorrect -

i have gone through many examples of nature , proposed solutions site, none of solutions provided thereon apply problem. believe error message, 400 , shows when information sent controller mulformed. spent last 2 days cross referrencing project worked on in past, works, cannot pick problem. @requestmapping(value = {"/", "/home"}, method = requestmethod.get) public string homepage(modelmap model) { model.addattribute("user", getprincipal()); catalog catalog = catalogservice.getcatalogbycategory(catalog.catalogcategory.all); model.addattribute("catalog", catalog); return "welcome"; } this sends data jstl spring form on jsp follows: <form:form method="post" modelattribute="catalog"> <form:hidden path="id"/> <form:hidden path="name"/> <form:hidden path="category"/> <form:hidden path="orderitems&

wpf - Non XAML way to databind to collection/dictionary -

i have requirement dynamically load diagram (xaml includes custom usercontrol, screwcontrol ). i looking @ ways bind dependency property ( status ) of screwcontrol viewmodel class. challenge diagram contain varied number of screwcontrol s, each of needed data bound dictionary or collection in viewmodel . i have solved first challenge of loading xaml dynamically using xamlreader not sure how bind screwcontrol s collection/dictionary viewmodel. view model class public class assemblyviewmodel { public dictionary<int, screwstatus> screws { get; set; } public frameworkelement image { get; set; } ... } view class public partial class assemblyview : usercontrol { private assemblyviewmodel viewmodel; public assemblyview(assemblyviewmodel viewmodel) { initializecomponent(); datacontext = this.viewmodel = viewmodel; loaded += onloaded; } public frameworkelement xamlcontent { { return (frameworkelemen

excel match year and month in array -

i have array of dates in column match against on year , month. b c d e f g h j 1 date name name march april may june july august september 2 13-04-2016 lars lars 0 0 0 0 0 0 0 3 04-03-2016 brian brian 0 0 0 0 0 0 0 4 01-01-2016 lars erik 0 0 0 0 0 0 0 5 10-06-2016 erik knut 0 0 0 0 0 0 0 6 31-07-2016 erik soren 0 0 0 0 0 0 0 i have tried $a:$a;"="&date(year(today());3;""); ;3; month of march. evaluates 0 on accounts. so how adapt make count number of dates matching year , month (d2) lars (c2) in a:a? anyone. put in d2 (and adapt needed) =if(date(year(today()),3,1)=date(year(a3),month(a3),1),1,0) =if( --start if date(year(today()),3,1) -- current year, 3rd month, 1st day = --equals (for if statement) date(year(a3),month(a3),1) -- year & month ce

html - href link inside modal is not working -

i have modal in webpage uses bootstrap. i've added anchor tags in there href links. when trying click on anchor element, not clickable. anchor tag not working in modal. please me issue. please find below code - <div class="portfolio-modal modal fade" id="editionsmodal" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal-content"> <div class="close-modal" data-dismiss="modal"> <div class="lr"> <div class="rl"> </div> </div> </div> <div class="container"> <div class="row"> <div class="col-lg-8 col-lg-offset-2"> <div class="col-sm-3"> <a href="hingoli.html" data-target="#" styl

php - How to make website pages accessed by code -

it's pretty hard explain if have better title guest.. basically made website 5 pages. 1) index.html 2) page.html 3) footer.html 4) menu.html 5) contact.html in order access pages have type page name @ end of domain (i bet knew that..) i wanted access pages code.. example -> mywebsite.com\?page=contact how can ? kind regards, kobi. why don't make index.php following code: <?php include($_get['page'].'.html'); ?> the result be: calling mywebsite.com/?page=contact open mywebsite.com/index.php?page=contact because default the url stay mywebsite.com/?page=contact the script load file contact.html , show it

angularjs - Angular and not angular forms within the same page -

i have 2 forms on single page. 1 form adding/deleting working fine. in second form (which don't want through angular) but not able submit this(second form). both forms inside app. have idea please share. i can see when refresh page "ng-pristine ng-valid" classes added in second form. this first form <div class="address address-form" ng-hide="!isedit"> <form class="edit-address-form" ng-submit="updateaddress(currentaddress.aid);"> <div class="form-group"> <label class="sr-only" for="first_name">first name </label> <input type="text" class="form-control" id="first_name" value="testing" name="first_name" value="{{currentaddress.first_name}}" placeholder="first name" required ng-model="currentaddress.first_name"> </div>