Posts

Showing posts from July, 2010

ruby - How can I use private gems(GemFury) in a docker container? -

i'm trying run ruby scripts automating exports. since these run remotely build them in docker container , push them iron worker. we use gemfury hosting essential private gems these scripts. keep credentials gemfury out of git use global bundle config bundle config gem.fury.io my_secret_token . how can set config bundle pull in gems gemfury without having them show in source control? set global bundle config property application specific property. push changes public repository. update secret_token value in bundle-config file ( $app_dir/.bundle/config ) , run $ git update-index --assume-unchanged <file> command remove file git tracking , prevent updating actual secret_token value in public repository. $ bundle config --local gem.fury.io secret_token $ git commit -a -m "adding application bundle config properties" $ git push origin master $ bundle config --local gem.fury.io d1320f07ac50d1033e8ef5fbd56adf360ec103b2 $ git update-index --assume-unch...

javascript - How to detect changes with Date objects in Angular2? -

date objects modified using setdate method arent getting updated in template. in template: <p>{{date | date:'mediumdate'}}</p> in component: nextday(){ this.date.setdate(this.date.getdate()+1); } but when call nextday function, template isnt updated new value. the way change detection working doing this: nextday(){ var tomorrow = new date(); tomorrow.setdate(this.date.getdate()+1); this.date = tomorrow; } are there better way accomplish same task? i think right way, change reference of date variable. docs here have: the default change detection algorithm looks differences comparing bound-property values reference across change detection runs. so if date reference remains same, nothing happen. need new date reference , that's why second version of nextday() works. if remove formatting pipe see still second version of nextday() works.

Facebook PHP Sdk return redirect uri is required -

Image
i trying authenticate using facebook php sdk returning error the parameter redirect_uri required you can see in url above redirect_uri present value. here code using config.php <?php //configure app here define("app_id","abcd");//replace facebook app id define("app_secret","abcd");//replace facebook app secret define("callback_uri","https://example.com/callback.php");//replace callback url [this facebook redirect user after login] define("logout_redirect_url","https://example.com/close.php");//replace url of login page /** app configuration end here **/ //no need change below require_once('facebook-php-sdk-v4-5.0.0/src/facebook/autoload.php');//loads facebook sdk session_start(); $fb = new facebook\facebook([ 'app_id' => app_id, 'app_secret' => app_secret, 'default_graph_version' => 'v2.5', ]); ?> login.php ...

How to find an index of clicked tab in QTabWidget in Python QT? -

i developing simple text editor has mutlitabs. want implement rightclick menu rename clicked (not current) tab of qtabwidget instance. have find index of clicked tab. how can this? from pyqt4.qtcore import * pyqt4.qtgui import * class myapplication(...): ... def contextmenuevent(self, event): tabindex = ... # <- should type here? menu = qmenu(self) renameaction = menu.addaction("rename") action = menu.exec_(self.maptoglobal(event.pos())) if action == renameaction: self.renametabslot(tabindex) def renametabslot(self, tabindex): ... you need check clicked position (i.e. event.pos () ) against tab regions manually. python bit rusty, here's c++ code instead. assuming tabwidget called mytabwidget : int tabindex = -1; { qtabbar* tabbar = mytabwidget->tabbar (); qpoint globalpos = ->maptoglobal (event->pos ()); qpoint posintabbar = tabbar->mapfromglobal (g...

html - -moz-appearance notwork properly in radio button -

Image
i have dropdown radio button: and when clicked dropdown change this: but in mozilla don´t change not style have: my css this(only put 1 style cause same rest of element); when clicked dropdown: li:first-child input[type='radio']{ -webkit-appearance:none; -moz-appearance: none; width:15px; height:15px; border:3px solid #6a706d; border-radius:50%; outline:none; margin: 0 13px -3px 0; /*box-shadow:0 0 5px 0px #6a706d inset;*/ } and when appear in dropdown: .status-1{ -webkit-appearance:none; -moz-appearance: none; width:12px; height:12px; border:3px solid #6a706d; border-radius:50%; outline:none; margin: 0 13px -3px 0; } here mi fiddle allright, got it. not element can change firefox. way this, fake this: fiddle there have been previous questions on stackoverflow this. check link

python - Getting values from all the indices of a list (Determining Prime Numbers) -

first , foremost i'm new python. trying determine if number, let's 167 prime number using modulo operation, % . e.g., let 167 % n = value i when 167 % 1 , 167 % 167 , should return 0 , n in range(2,166) , should giving remainder of 167 % n . problem have trying print remainder when 167 % n n = 1 ~ 167 don't know how values (which should remainder) of indices of list. so, here's have: l = [] #creates empty list i=0 #initialize i? in range(1, 168) : if 167 % == 0 : print ("there no remainder") else : 167 % == x # x should value of remainder l[i].append(x) #attempting add x ... indices of list. print(l[x]) #print values of x. it's better if can use while loop, should clearer. so, while i iterates 1-167, should adding results x indices of list , want print results. any recommendation guys? appreciated!! bunch. this creates list of remainders not equal zero: l = [] in range(1, 168) : remainder ...

c++ - Compiling libzip on Mac: Undefined symbols for architecture x86_64 -

i've been learning c++ , have decided try create simple file reader using libzip on archive files (e.g. word). i’ve installed libzip on macbook using brew seem keep on getting following issue whenever try compile program uses libzip: undefined symbols architecture x86_64: "_zip_fopen", referenced from: _main in main-918bfa.o "_zip_open", referenced from: _main in main-918bfa.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) make: *** [a.exe] error 1 the command use compile: g++ -g main.cpp -std=c++11 -i/usr/local/cellar/libzip/0.11.2/include -i/usr/local/cellar/libzip/0.11.2/lib/libzip/include -l/usr/local/cellar/libzip/0.11.2/lib -o ../a.exe main.cpp: #include <iostream> #include <fstream> #include <zip.h> #include <zlib.h> using namespace std; int numargs = 2; int main(int argc, char** argv){ // parse command line arguments ...

Can (or could) one suppress macro replacement in C by enclosing the name in brackets -

i seem recall 1 suppress replacement (expansion) of macro in c placing macro name in brackets, e.g. (free)(p) call function free whether or not macro free defined. see no mention of in c99 standard ( it there, see answer) , , observe msvs 2013 not implement either . added in light of answer: does, standard requires, i.e. function-like macros, expansion triggered following ‘ ( ’ , inhibited intervening ‘ ) ’. am dreaming, or there such possibility, , if so, rationale withdrawing it? or present in dialects? a function-like macro foo #define foo(x) ... is expanded when token foo appears followed ( token. thus, prevent expansion of foo , (foo) can used. said. applies function-like macros. this specified in iso 9899:2011 §6.10.3 ¶10, reads: 10 preprocessing directive of form # define identifier lparen identifier-list opt ) replacement-list new-line # define identifier lparen ... ) replacement-list new-line # define identifier l...

android - Build simple indoor postioning with ibeacon -

i'm trying build indoor positioning system android, depends on ibeacons detect i, how can go other room. let's take example: in home want put 1 beacon in every-room, in application have simple indoor map show home design contains fixed point every-beacon , fixed path between them. how can make phone moving inside map depends on distance between phone , beacon , make phone movement on fixed path. is solution without using gps or lonlat point? if better idea can helps? what map beacons arbitrary coordinate space, irrespective of gps. map gps well, think you'll little out of until the distances between beacons larger average gps accuracy - in other words, until mapped area large, won't happen if you're talking small indoor environment. and if achieve "perfect" gps accuracy in environment, on phone limited max accuracy of 5m radius still isn't guaranteed (gps errors assumed follow normal distribution reported accuracy 68% confident, o...

vb.net - clickonce deployment with prerequisites -

we have application deploy website. user goes website , downloads application machine. there few prerequisites such .net , sql server 2012 express click in "prereqs" install. have executable file syncronization exe user needs install before loading application. how can include before app runs loads well. because don't see option include it, has standard default microsoft ones. so want run .exe file along main app??? or .exe file should load before when start main app????

c++ - Count how many times elements in an array are repeated -

the program i'm trying write allows me enter 10 numbers , should tell me number x repeated x times , on. i've been trying problem result follows: for example...{1,1,1,1,4,6,4,7,4} the number 1 repeated 4 times the number 1 repeated 3 times the number 1 repeated 2 times the number 1 repeated 1 times the number 4 repeated 3 times the number 6 repeated 1 times the number 4 repeated 2 times the number 7 repeated 1 times the number 4 repeated 1 times the problem checks next number following numbers without skipping it, or without knowing has written before #include <iostream> #include <string> using namespace std; int main() { int x[10]; (int i=0;i<10;i++) { cin>>x[i]; } (int i=0;i<9;i++) { int count=1; (int j=i+1;j<10;j++) { if (x[i]==x[j]) count++; } cout<<"the number "<<x[i]<<" repeated ...

ruby - Create a form in rails by reading a yaml file -

i'm trying create form reading yml file. i'm able read file i'm not sure how place items in hash code creates forms. example, yml file reads like - f.label: :email f.email_field: :email - f.label: :name f.text_field: :name i read yml file in controller this @form_format = yaml::load(file.open('public/grant.yml')) and code in view <%= form_for(:submission, url: submissions_path) |f| %> <% @form_format.each |item| %> <% item.each |key, value| %> <%= key value %> <%= key value %> <% end %> <% end %> <%= f.submit "apply", class: "btn btn-primary" %> <% end %> i know it's <%= key value %> bit that's not correct i'm not sure how read <%= f.label: :email %> example values in hash. the overall reason i'm trying figure out because need create many (100+) unique forms , thought best way create unique...

javascript - How do I send CSRF tokens from AngularJS front end to Spring REST service backend? -

how set csrf protection between angularjs front end , spring boot rest backend? let's take http.post("/send-pin", jsonobject)... call code below example. i getting following error in server logs when try call spring boot rest service @ /send-pin url pattern angularjs front end method using http.post("/send-pin", jsonobject)... : invalid csrf token found http://localhost:9000/send-pin i read this other posting , states csrf token needs set in angularjs code makes request, code in link uses syntax $(document).ajaxsend(function(e, xhr, options) {xhr.setrequestheader('x-csrf-token', token);}); , not directly paste code below. also, clode in link takes data form, while code takes data angularjs controller. what specific changes need made code below backend rest service process request made angularjs app rest service running @ localhost:9000/send-pin url? here method in angularjs: $scope.login = function() { auth.authenticate1($scop...

javascript - how to load json file from local system and assign to some variable -

i want store json file local system cassandra column, newer version of cassandra supports json data. solution, looking approach this:- globalvariable<-load json file local system. cassandracolumn<-dump(globalvariable) third thing want know type of cassandracolumn, support, entire json data, whether text or blob. i don't know whether possible or not.your's suggestions highly appreciated. using cassandra2.2.4 on ubuntu 14.04 lts system. i tried far: 1.var data = params.jsondata; //assign entire json data variable 2. var insertquery = "insert " +keyspace+ "."+table_name+ " json '{"+data+"}';"; console.log(insertquery); client.execute(insertquery, function(err, result2){ if(result2){ return res.json("data inserted"); } else{ return res.json("data insertion failed"); } }); i did wrong while preparing insertquery. on console log : insert jsondb.iris json '{[object object...

performance - Cache Javascript libraries across websites -

i want share idea you. there many websites use sort of javascript library / framework (think jquery, angular, bootstrap). using these libraries can slow down page load, why don't cache them , use them later on different sites? a website should able tell browser libraries (+version) wants use. browser handles package management (keep them date , remove old unused ones) bower or npm. i made quick firefox extension proof concept, native browser implementation better of course. addon more explanation can found here: https://github.com/ovanschie/backage-firefox-addon i'm confident can speed page loading , decrease bandwidth usage (especially on mobile devices). what think? would implement in of sites if browsers support it? browsers cache libraries , cdns exist this. googles hosted libraries: https://developers.google.com/speed/libraries/ browsers cache files based on url.

c++ - Using std::thread or CreateThread()? -

this question has answer here: c++11 std::thread vs windows createthread [closed] 3 answers i revising codes when doing project developed when started coding in c/c++. it's threading. in tutorials read (which 2006) said that, when developing windows, 1 use createthread() create threads. using function better using std::thread? is faster also? in applications load crt (as c/c++ are) can't use createthread , per spec: a thread in executable calls c run-time library (crt) should use _beginthreadex , _endthreadex functions thread management rather createthread , exitthread; requires use of multithreaded version of crt. if thread created using createthread calls crt, crt may terminate process in low-memory conditions. std::thread on other hand right thing.

eclipse - java.lang.VerifyError: Inconsistent stackmap frames -

i getting error , have absolutely no clue how go fix it. looking around stackoverflow seems error related either corrupt files or classes compiled in incompatible versions of java. 1 of questions i've been looking into: causes of getting java.lang.verifyerror warning: error /clearnlp java.lang.verifyerror: inconsistent stackmap frames @ branch target 60 exception details: location: edu/emory/clir/clearnlp/util/dsutils.createstringhashmap(ljava/io/inputstream;ledu/emory/clir/clearnlp/util/chartokenizer;z)ljava/util/map; @60: aload_1 reason: type top (current frame, locals[5]) not assignable 'java/lang/string' (stack map, locals[5]) current frame: bci: @39 flags: { } locals: { 'java/io/inputstream', 'edu/emory/clir/clearnlp/util/chartokenizer', integer, 'java/io/bufferedreader', 'java/util/map', top, 'java/lang/string' } stack: { integer } stackmap frame: bci: @60 flags: { } locals: { ...

Getting File Metadata from Google API in Python -

i trying work out how download file meta-data google drive using python. have been pretty copying/pasting documentation provided google , have been fine now. when try call: drive_file = drive_service.files().get(id=file_id).execute() i receive following error: drive_file = drive_service.files().get(id=file_id).execute() file "build\bdist.win-amd64\egg\apiclient\discovery.py", line 452, in method typeerror: got unexpected keyword argument "id" however, in google documentation there example here (under python tab) shows pretty exact same thing have. code not work because of lack of python experience or else? full program displayed below: import httplib2 apiclient.discovery import build oauth2client.client import oauth2webserverflow def getdriveservice(): clientid = <my_client_id> clientsecret = <my_client_secret> oauth_scope = 'https://www.googleapis.com/auth/drive' redirect_uri = <my_redirect_uri> flow =...

twitter - Topic Modeling in R language -

Image
i have 1 question ,i'm applying topic modeling - lda in r language , used determine topics of user's tweets , notice when i'm using command tweets ( last 500 tweets without retweets) sometime got 500 , sometime got 130 , got 45 different users same n=500 , factor behind that tweets <- usertimeline("barackobama",n=500,includerts = false) also if want remove name of user tweets how can in r because noticed accuracy of clustering topics it's not , don't know how can measure percentage of accuracy thing in r . last question if twitterr support arabic tweets or not ! thanks.

boolean - XOR Majority Algebraic Logic -

Image
how implement majority function xor , and only? how authors of paper equation present below? a majority function 3 inputs can written cnf (product of sums) (a or b) , (a or c) , (b or c) or dnf (sum of products) ab or ac or bc using , and xor, can write maj(a,b,c) = ab xor bc xor ac a truth-table easiest way check this. xor 3 inputs true, if either 1 input true or 3 inputs. ab 00 01 11 10 +---+---+---+---+ 0 | 0 | 0 | 1 | 0 | c +---+---+---+---+ 1 | 0 | 1 | 1 | 1 | +---+---+---+---+

java - JavaFX WebView: Start Program, Input Data, Serve and Display Local HTML -> Refresh Data = Refresh WebView -

i need able open application, input data via textfields, send said data through freemarker , generate html, display in webview. here i'm falling off. i have working cannot, life of me, figure out how refresh webview display new current html doc after data input , rewrite. it's overwriting file fine, if close , reopen, re click button, webview shows new data. i'm sure issue i'm using getclass().getresource(string): url link = getclass().getresource("emailsigtest.html"); engine = webview.getengine(); engine.load(link.tostring()); how can thing change dynamically, i.e: 1. input data 2. write file 3. refresh webview reflect new html doc where need write , read file , make happen? i have tried engine.reload(); reload webengine... nothing. i have tried adding actionevent , .reload()... nothing. full source below: public class signaturegenfxmldoccontroller implements initializable { private string firstname, lastname, directline, title...

java - How to multiply a double and an int and cast to int in single statment -

i'm trying accomplish following without luck int = 1; double b = 0.5; int myinteger = (int) a*b; you've declared b integer. try this: int = 1; double b = 0.5d; int myinteger = a*b;

python - Scipy: Linear programming with sparse matrices -

i want solve linear program in python. number of variables (i call n on) large (~50000) , in order formulate problem in way scipy.optimize.linprog requires it, have construct 2 n x n matrices ( a , b below). lp can written as minimize: c.x subject to: a.x <= b.x = b x_i >= 0 in {0, ..., n} whereby . denotes dot product , a , b , , c vectors length n. my experience constructing such large matrices ( a , b have both approx. 50000x50000 = 25*10^8 entries) comes issues: if hardware not strong, numpy may refuse construct such big matrices @ (see example very large matrices using python , numpy ) , if numpy creates matrix without problems, there huge performance issue. natural regarding huge amount of data numpy has deal with. however, though linear program comes n variables, matrices work sparse. 1 of them has entries in first row, other 1 in first m rows, m < n/2. of course exploit fact. as far have read (e.g. trying solve scipy optimization probl...

javascript - return null document.getElementsByTagName -

ihave simple ul element in webpage : <div id="jqueryftd_demo" class="demo"><ul class="jqueryfiletree" style=""> <li class="directory collapsed"><a href="#" rel="/samplefolder/a/">a</a></li> <li class="directory collapsed"><a href="#" rel="/samplefolder/b/">b</a></li> <li class="directory collapsed"><a href="#" rel="/samplefolder/c/">c</a></li> <li class="directory collapsed"><a href="#" rel="/samplefolder/d/">d</a></li> <li class="file ext_accdb"><a href="#" rel="/samplefolder/sampledbfile.accdb">sampledbfile.accdb</a></li> <li class="file ext_txt"><a href="#" rel="/samplefolder/sometext.txt">somete...

javascript - Parse Cloud Code returns pointer instead of object after save -

problem: i'm trying return full object, instead keep getting pointer back. think might because modify object, save, return in response. how able modify, save, , return full object , not pointer? code: relevant code shown: getpicture(username, { success: function (pictureobject) { response.success(pictureobject); //always getting pointer }, error: function (error) { response.error(error); } }); ... function getpicture(username, callback) { var pictures = parse.object.extend("pictures"); var pictures = new parse.query(pictures); pictures.equalto("username", username); pictures.find({ success: function (results) { var object = results[0]; object.increment("views", 1); object.save(); //i think issue here callback.success(object); }, error: function (error) { callback.error(error); } }); } thank you...

node.js - index.js to share mysql details - with page.js? -

index.js has mysql connection details page.js able use these details not have provide mysql details page.js again. also.. page.js 's output needs made available index.js index.js can see the mysql query results. index.js: var http = require('http'); var url = require('url'); var mysql = require('mysql'); var connection = mysql.createconnection({ host : '-------------', user : '-----', password : '-------', database : '-----', }); var server=http.createserver(function(req,res){ res.writehead(200,{'content-type': 'text/html; charset=utf-8'}); require('page.js); res.end('test'); }).listen(80); page.js: connection.connect(); var querystring = 'select * t1 order id desc limit 5'; connection.query(querystring, function(err,res,fields){ bb = json.stringify(res); }); connection.end(); in page.js : exports.makequery = function(con...

java - Composite recording creates empty video -

here code create composite video recording using java.but creates blank video .not playing stream.why? mp = kurento.createmediapipeline(); webrtcendpoint webrtcepred = new webrtcendpoint.builder(mp).build(); webrtcendpoint webrtcepgreen = new webrtcendpoint.builder(mp).build(); composite composite = new composite.builder(mp).build(); hubport hubport1 = new hubport.builder(composite).build(); hubport hubport2 = new hubport.builder(composite).build(); hubport hubport3 = new hubport.builder(composite).build(); recorderendpoint recorderep = new recorderendpoint.builder(mp, recording_path + "twoside" + recording_ext).build(); webrtcepred.connect(hubport1); webrtcepgreen.connect(hubport2); hubport3.connect(recorderep); recorderep.record(); i change code follows,now working fine // media pipeline pipeline = kurento.createmediapipeline(); composite composite = new composite.builder(pipeline).build(); hubport hubport1 = new hubport.bu...

ios - Equivalent of loginViewShowingLoggedInUser -

i trying migrate app facebook sdk 3.4 4.x. used following import #import <fbsdkcorekit/fbsdkcorekit.h> #import <fbsdkloginkit/fbsdkloginkit.h> #import <fbsdkloginkit/fbsdkloginbutton.h> i used have 2 methods - (void)loginviewshowingloggedinuser:(fbloginview *)loginview - (void)loginviewfetcheduserinfo:(fbloginview *)loginview user:(id<fbgraphuser>)user i can't find these methods in 4.x sdk. i can see fbloginview changed fbsdkloginbuttondelegate. equivalent of above 2 methods. tried looking @ facebook ios samples not figure out. there's method called loginbutton:didcompletewithresult:error: defined in fbsdkloginbuttondelegate : - (void) loginbutton:(fbsdkloginbutton *)loginbutton didcompletewithresult: (fbsdkloginmanagerloginresult *)result error: (nserror *)error; source : facebook sdk docs note : above delegate login button, i.e. delegate called when user performs login using login button. dele...

c# - Switch with methods without constants -

i want accomplish task there method in c# . give me syntax please. switch(methods) { case method1: //do method2 case method3: // method4 case method5: // method6 } you can if know class name , method name actually. see below type magictype = type.gettype("magicclass"); methodinfo magicmethod = magictype.getmethod("itsmagic"); object magicvalue = magicmethod.invoke(); check below url https://msdn.microsoft.com/en-us/library/a89hcwhh(v=vs.110).aspx

Displaying dynamic data using jQuery chart -

here assignment: create page displays values using jquery chart, can switch between day-wise view , month-wise view using ajax x-axis: days/ months y-axis: a,b,c,d i've got variable values ready , drop down list change variables. don't know how feed these values jquery chart. i'm using jqxchart. how achieve this? please explain code. how feed date , month in jqxchart? here html code : <div id="chartcontainer" style="width:800px; height: 400px"></div> <div id="valueaxisdiv" class="form-group"> <h3>value axis : </h3> <select id="valueaxis"> <option>total number of feedback entries category</option> <option>average score category</option> <option>total number of feedback entries</option> <option>average score</option...

Nginx 500 internal error -

http { server { listen 443 ssl; server_name node.ramblr.io; server_tokens off; root /home/john/public_html/node.ramblr.io; index index.php index.html index.htm; ssl on; ssl_certificate /etc/pki/tls/certs/node.ramblr.io.crt; ssl_certificate_key /etc/pki/tls/private/node.ramblr.io.key; ssl_session_timeout 5m; ssl_protocols sslv3 tlsv1; ssl_ciphers all:!adh:!export56:rc4+rsa:+high:+medium:+exp; ssl_prefer_server_ciphers on; location / { try_files $uri $uri/ /index.html; } location ~ /\.ht { deny all; } } } its in nginx.conf that nginx config, have 2 other sites reversed proxied , work index.php reason. want know why getting 500 internal error off this. here of error logs nginx 2016/01/16 00:32:36 [crit] 6458#0: *5 ...

ios - How To Get A Perfect Position Of Rotating View? -

Image
i have 1 view , rotating view using cabasicanimation . problem how perfect position of view while rotating. have tried many type of codes can't got perfect position during rotation of view. cabasicanimation *rotationanimation = [cabasicanimation animationwithkeypath:@"transform.rotation.z"]; nsnumber *currentangle = [circleview.layer.presentationlayer valueforkeypath:@"transform.rotation"]; rotationanimation.fromvalue = currentangle; rotationanimation.tovalue = @(50*m_pi); rotationanimation.duration = 50.0f; // might fast rotationanimation.repeatcount = huge_valf; // huge_valf defined in math.h import [circleview.layer addanimation:rotationanimation forkey:@"rotationanimationleft"]; i using code rotating view. i have attached 1 photo of view. thank in advance please if know. to view's parameters during animation should use view.layer.presentationlayer added: in order coordinate of top left corner of view, ...

java - Learning basics about objects -

public class vector { private final double deltax,deltay; public vector(double deltax, double deltay) { this.deltax = deltax; this.deltay = deltay; public vector plus(vector(a, b)){ return new vector(this.deltax+a,this.deltay+b); } why not work when trying create method add new vector existing one? defining deltax horizontal component , deltay vertical. you aren't using correct syntax. method should be: public vector plus(vector other) { return new vector(this.deltax + other.deltax, this.deltay + other.deltay); } that way, can pass vector instances method.

php - Inserting data into SQL database not working but said it has -

this question has answer here: php: “notice: undefined variable”, “notice: undefined index”, , “notice: undefined offset” 23 answers so website have @ minute isn't inserting data correctly. have id , sub_date (date got submitted) these automatic of thought don't need create variables , stuff? correct me if im wrong? php code: <?php if (isset($_post['addbtn'])) { $m_titleadd = $_post['m_titleadd']; $authoradd = $_post['authoradd']; $statusadd = $_post['statusadd']; $tutorialadd = $_post['tutorialadd']; if (empty($errors)) { $sqlinsert = $odb -> prepare("insert `methods` values(null, :id, :m_title, :sub_date, :status, :author, :tutorial)"); $sqlinsert -> execute(array(':id' => null, ':m_title' => $m_titleadd, ':sub_date' => nul...

Find what time (in second) spend to play note in musicxml file -

i have note <note default-x="106.96" default-y="-25.00"> <pitch> <step>a</step> <octave>3</octave> </pitch> <duration>2</duration> <voice>1</voice> <type>eighth</type> <stem>up</stem> <staff>1</staff> <beam number="1">begin</beam> </note> how can find time spend play (in second) if tempo = 120bpm ? create table this: durationhashtable = { { "whole", 4.0 }, { "half", 2.0 }, { "quarter", 1.0 }, { "eighth", 0.5 }, { "16th", 0.25 } } then, formula is: notedurationseconds = ( 60.0 / beatsperminute ) * durationhashtable["eighth"]; this special, simple case where notes not dotted the time signature has <beat-type>4</beat-type> you not required support tuplets. things can become more complex, recom...

sql - Display grid on basis of Enquiry No -

the below query displays me result want show in grid. select bb.project_id, bb.building_id, bb.flat_id flat_id, cc.cust_enq_no enquiry_no, cc.name enquiry_name, to_char (cc.f_followup_date, 'dd/mm/yyyy') last_followup_date, cc.f_remarks last_followup_comments xxacl_pn_flat_det_v bb inner join xxcus.xxacl_pn_customer_enquiry_v cc on bb.project_id = cc.mkey but there change in requirement. now each f_flat_id there multiple cust_enq_no say select * xxcus.xxacl_pn_customer_enquiry_v f_flat_id = '18158' it has 3 records. so first query, how multiple cust_enq_no update i want filter , display in grid protected void displaygridenquiry() { oraclecommand cmd1 = new oraclecommand("select bb.project_id, bb.building_id, bb.flat_id flat_id, cc.cust_enq_no enquiry_no, " + "cc.name enquiry_name, to_char (cc.f_followup_date,'dd/mm/yyyy') last_followup_date, cc.f_remarks last...