Posts

Showing posts from June, 2010

php - How to convert xls to mysql? -

how convert large xls or csv dataset mysql data using php , preferably using silverstripe api? can directly or need convert first text? silverstripe has number of ways import csv files datamodel. the documentation worth reading on section: https://docs.silverstripe.org/en/3.1/developer_guides/integration/csv_import/ the quickest , simplest way manage custom dataobject modeladmin interface , use built in csv importer. class playeradmin extends modeladmin { private static $managed_models = array( 'player' ); private static $url_segment = 'players'; } when go player modeladmin see csv import form on left. make sure column titles in csv file line variable names of data object. for more complex import methods read documentation alternative methods allow so.

R: pass variable from R to unix -

i running r script via bash script , want return output of r script bash script keep working there. the bash sth this: #!/bin/bash rscript myrscript.r a=output_from_myrscript.r sth and r script sth this: for(i in 1:5){ sink(type="message") } i want bash work 1 variable r @ time, meaning: bash receives i=1 , works that, when task done, receives i=2 , on. any ideas how that? one option make r script executable #!/usr/bin/env rscript (setting executable bit; e.g. chmod 0755 myrscript.r , chmod +x myrscript.r , etc...), , treat other command, e.g. assigning results array variable below: myrscript.r #!/usr/bin/env rscript cat(1:5, sep = "\n") mybashscript.sh #!/bin/bash res=($(./myrscript.r)) elem in "${res[@]}" echo elem "${elem}" done nrussell$ ./mybashscript.sh elem 1 elem 2 elem 3 elem 4 elem 5

php - PDO lastInsertId() -

i'm using pdo on mysql database , try retrive lastinsertid() . i thought going last inserted vlue in column id in table primary_key . however, 0 output $statement = "select last_insert_id() my_table"; $sql = $dbh->query($statement); $lastid = $sql->fetch(pdo::fetch_num); $lastid = $lastid[0]; return $lastid; pdo class has method called lastinsertid() . can use method after inserting record/records collect last insert id.

What's wrong with this Java Linked List representation of a stack of integers? -

okay, following code nullpointer exception in pop method. therefore, know 'head' must null when method runs. thing have no idea why , i've looked on code bit now. please help! here is: node class: public class stacknode{ private stacknode link; //link next node private int value; public stacknode(int value, stacknode linkvalue){ this.link = link; this.value = value; } public stacknode(){ this.link = null; } public void setnodedata(int value){ this.value = value; } public void setlink(stacknode newlink){ this.link = newlink; } public int getvalue(){ return this.value; } public stacknode getlink(){ return link; } } linked list class: public class intstacklist{ private stacknode head; public intstacklist(){ this.head = null; } public void push(int value){ this.head = new stacknode(value, head); } public int pop(){ int value = this.head.getvalue(); //get int value stored in head node this.hea

php - Configuring urlManager Rules in Yii2 -

i'm new using yii2 , have been using urlmanager, have following code, works fine think should shorter. have couple rules follows :- 'rules' => [ 'gifts/<subjectone:[\s\s]+>/<subjecttwo:[\s\s]+>' => 'gifts/index', 'gifts/<subjectone:[\s\s]+>/<subjecttwo:[\s\s]+>/' => 'gifts/index', 'gifts/<subjectone:[\s\s]+>' => 'gifts/index', 'gifts/<subjectone:[\s\s]+>/' => 'gifts/index', ]; as can see i've added 4 rules go same page handle different situations. i've had add same url's twice, once / , 1 without stop 404's. please advise of better way handle this. you can add +|(\/?) @ trailing of rule. take look: 'gifts/<subjectone:[\s\s]+>+|(\/?)' => 'gifts/index', so there no need write rules twice.

mysql - select query for minus one hour -

Image
have below query: select hr, red (select hour(event_datetime) hr, max(red_kills) - (select max(red_kills) vwmatchall date_format(event_datetime,"%y-%m-%d %h") = date_format(date_sub(event_datetime, interval 1 hour), "%y-%m-%d")) red vwmatchall date(event_datetime) = '2015-10-09' group hour(event_datetime)) k the data structured such: the idea take current max() value of given column, red_kills in above example, , subtract max() value of same column, 1 hour previous. it's show difference hour. if 1 date doesn't have data 24 hours, still show data hours have. idea what's wrong query?

Skype chat window is not opening by using Skype Id of user after login in android -

i implementing skype integration in android application. have requirement open chat window of skype using skype id of user. have done successfully, problem when logged out skype , open the skype android application using user id redirecting login screen , after login same user id, skype application goes in background , redirect android application. want open chat window of skype when logged in id opening chat window. please suggest me, how can implement ? can show code using show skype intent? it should similar : intent skypeintent = new intent("android.intent.action.view"); skypeintent.setdata(uri.parse("skype:" + user_name)); startactivity(skypeintent); in manifest need following intent filter : <intent-filter> <action android:name="android.intent.action.view" /> <category android:name="android.intent.category.default" /> <data android:scheme="skype" /> </intent-filter>

c# - .NET Request Browser identifies Opera as Chrome -

so in code have: return request.browser.browser + " " + request.browser.majorversion when user opera, i've had version 21 , latest version 33, code returns chrome. returned "chrome 34" opera 21, , "chrome 46" opera 33. why happening , how fix it? the user agent strings chrome , opera exact same. end differs. i'm using opera version 33.0.1990.58 , chrome version 46.0.2490.86. here'r user agents each: chrome 46 = mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/46.0.2490.86 safari/537.36 opera 33 = mozilla/5.0 (windows nt 6.1; wow64) applewebkit/537.36 (khtml, gecko) chrome/46.0.2490.80 safari/537.36 opr/33.0.1990.58 in microsoft.net/framework/yourversion/config/browsers can see xml shows .net how parse agent strings. chrome.browser identification is: in .net 4.0. in same directory, opera.browser identification looks like: /" />. so opera shows chrome because .net doesn'

java - Version number of Git commit from a specific branch in TeamCity 8.x -

i building continuous delivery pipeline in tc, , 0th build step, i'd able extract unique version number give commit. it looks this: release_4.46. i'd use '4.46'-part append different steps of pipeline, , final step, name artifact e.g. app_4.46.war. i've managed assemble majority of pipeline(unit tests, jshint, maven build) , it's , running, cannot end of feature. any or pointers appreciated. thanks you can try adding powershell step extracts 4.46 branch name , set teamcity parameter can used in rest of steps. powershell code should looks like: function set-version{ param ( [string] $branch ) $extractedversion = $branch.split("_")[1] write-host "##teamcity[setparameter name='extractedversion' value='$extractedversion']" } and in powershell step can call function like set-version %teamcity.build.branch% once step executed, teamcity parameter extractedvers

Can't load large file (~2gb) using Pandas or Blaze in Python -

i have file >5 million rows , 20 fields. open in pandas, got out of memory error: pandas.parser.cparsererror: error tokenizing data. c error: out of memory i have read posts on similar issues , discovered blaze, following 3 methods (.data, .csv, .table), none worked apparently. # coding=utf-8 import pandas pd pandas import dataframe, series import re import numpy np import sys import blaze bz reload(sys) sys.setdefaultencoding('utf-8') # gave out of memory error '''data = pd.read_csv('file.csv', header=0, encoding='utf-8', low_memory=false) df = dataframe(data) print df.shape print df.head''' data = bz.data('file.csv') # tried followings too, no luck '''data = bz.csv('file.csv') data = bz.table('file.csv')''' print data print data.head(5) output: _1 _1.head(5) [finished in 1.0s] blaze for bz.data(...) object you'll have result. loads data needed. if @

monitoring - ITRS Geneos tool -

Image
is there way pass value shell script geneos gui dynamically.my requirement , there should no password stored in file . user run script geneos gui , dynamically pass password through gui script . yes - can using geneos commands. reference have added sample screenshot of how command in geneos gateway editor. notice set run on netprobe , checkbox enable password checked. means when run command inside geneos active console ask password. since command set run on netprobe, need define password on probe. under advanced section of probe. see below screenshot:

r - Convert a data read in by fread function to data.frame -

assume have sample csv file has 3 rows , 4 columns. looks following: name1 name2 name3 name4 11 12 13 14 21 22 23 24 31 32 33 34 i read in using fread() (i using small sample illustration purpose): data <- fread(sample.csv, stringsasfactors=false) then class(data) it return [1] "data.table" "data.frame" i want see first element of fourth column, tried data[1,4] but returns 4 (which guess index of column). interestingly, when call following data[1,] or data[1] it returns first row. so did data <- data.frame(data) to convert data data frame. my questions: 1. since initial data has 2 classes, there way me choose 1 class , 'drop' other? in case, want use data data frame. 2. in general, if data has more 1 class, may choose 1 class keep? instance, as.posixct() return object 2 classes ("posixct" "posixt"). if want keep 1 of classes? function works purpose in gen

c# - How to get the next working day, excluding weekends and holidays -

i have requirement need work on date field, requirement thing i call field minimum possible date add +1 date if minimum possible date happens fall on weekend(sat or sun) after adding 1 day, display next working day i.e monday if the minimum possible date happens fall on holiday, display next working day. (holidays 1.1 , 1.5 , 3.10 , 25.12 , 26.12) if minimum possible date happens fall on weekend(sat or sun) after adding 1 day, , day after holiday show next working day. eg: after +1 day if min possible day saturday, have display monday. if monday happens holiday have display tuesday. i have tried solution above problem having multiple if , else cases, wondering if there generic , graceful way of doing it? i have tried var holidays = new list<datetime>(); holidays.add(new datetime(datetime.now.year,1,1)); holidays.add(new datetime(datetime.now.year,1,5)); holidays.add(new datetime(datetime.now.year,3,10)); holidays.add(new datetime(datetime.now.year,12,25)); if(

numpy - Python count and probability -

i have following data : name item peter apple peter apple ben banana peter banana i want print frequency of peter eat : apple 2 banana 1 this code u, count = np.unique(data['item'], return_counts=true) process = u[np.where(data['name']= 'peter')[0]] process2 = dict(counter(process)) print "item\frequency" k, v in process2.items(): print '{0:.0f}\t{1}'.format(k,v) but got error want calculate probability of peter eat apple next time dont have idea , suggestion ? the error getting other answer indicates, cannot use data['name'] = 'peter' function parameter, intended use - np.where(data['name'] == 'peter') . but, given using pandas , , guessing data pandas dataframe . in case, want can achieved using dataframe.groupby . example - data[data['name']=='peter'].groupby('item').count() demo - in [7]: data[data['name']=='peter

.net - C# Serial Port Conditional & Partial Reading -

i stumped. searched myself blue in face - no go. i trying establish serial comms device sends 2 different blocks of data (one after other) every 1 second continuously. first block starts "pid" , second block ends "h18". i need read once every 5 seconds. my problem 2 fold: i have no idea/control when read starts , starts mid - block. i have no control on start , end cycle ensure full 2 blocks need both. both blocks 200 characters long in total, has no /r @ beginning , has /r/n in between various items. i have tried doing 2 subsequent reads no success. tried playing startswith , endswith not recognized? code has been on show, here base working currently: static void datareceivedhandlerbat(object sender, serialdatareceivedeventargs e) { var batm = sender serialport; if ((batm != null) && (!_gotresponse)) { while (stringb.length < 200) { byte[] buffer = new byte[batm.byt

SQLCipher and Fabric/Crashlytics issue in Android Studio -

i have android studio project using sqlcipher, no issues, when integrated fabric sdk , crashlytic crashing on run unsatisfied linker error when load libs sqlcipher because can't find libstlport_shared.so any 1 else running issue? have no idea begin troubleshoot this. here error. 10-27 11:12:27.869: e/androidruntime(4189): java.lang.unsatisfiedlinkerror: dalvik.system.pathclassloader[dexpathlist[[zip file "/data/app/com.myapp.myapp-2/base.apk"],nativelibrarydirectories=[/data/app/com.myapp.myapp-2/lib/arm64, /vendor/lib64, /system/lib64]]] couldn't find "libstlport_shared.so" sqlcipher android includes armeabi , armeabi-v7a , , x86 native libraries. might try removing arm64 versions of other libraries (i.e., fabric , crashlytic) if possible see if android attempts load armeabi version of libraries.

python - Error when verifying SSL certificate -

i got error when tried download data wikipedia pandas. pd.read_html('http://simple.wikipedia.org/wiki/list_of_u.s._states') the error message says, sslerror traceback (most recent call last) /users/soma/.pyenv/versions/3.5.0/lib/python3.5/urllib/request.py in do_open(self, http_class, req, **http_conn_args) 1239 try: -> 1240 h.request(req.get_method(), req.selector, req.data, headers) 1241 except oserror err: # timeout error /users/soma/.pyenv/versions/3.5.0/lib/python3.5/http/client.py in request(self, method, url, body, headers) 1082 """send complete request server.""" -> 1083 self._send_request(method, url, body, headers) 1084 /users/soma/.pyenv/versions/3.5.0/lib/python3.5/http/client.py in _send_request(self, method, url, body, headers) 1127 body = body.encode('iso-8859-1') -> 1128 self.end

c# - Identifying which Azure WorkRole Instance is executing the Queue? -

i working on azure worker roles. have worker role scaled 5 instance. want identify instance processed queue item. know, can use roleenvironment.roles list of instances not sure how actual instance. thanks in advance. you looking roleenvironment.currentroleinstance.role.name

R time aggregate with start/stop -

i have set of time series data has start , stop time. each event can last few seconds few days, need calculate sum, in example total memory used, every hour of jobs active @ time. here sample of data: mem_used start_time stop_time 16 2015-10-24 17:24:41 2015-10-25 04:19:44 80 2015-10-24 17:24:51 2015-10-25 03:14:59 44 2015-10-24 17:25:27 2015-10-25 01:16:10 28 2015-10-24 17:25:43 2015-10-25 00:00:31 72 2015-10-24 17:30:23 2015-10-24 23:58:31 in case should give like: time total_mem 2015-10-24 17:00:00 240 2015-10-24 18:00:00 240 ... 2015-10-25 00:00:00 168 2015-10-25 01:00:00 140 2015-10-25 02:00:00 96 2015-10-25 03:00:00 96 2015-10-25 04:00:00 16 i'm trying aggregate function can not figure out. ideas? thanks. here solution based on dplyr , lubridate . make sure first have data in right format (e.g date in posixct ) library(dplyr) library(lubr

c# - Specified argument was out of the range of valid values - RowDataBound -

i want change navigate url property in row data bound event. if coloumn not binded link want add navigate url= # <asp:templatefield headertext="reportd link" itemstyle-horizontalalign="center" > <itemtemplate> <asp:hyperlink id="lbl_rptlnk1" runat="server" navigateurl='<%#eval("reportlinks")%>' text='reported link' target="_blank" tooltip='<%#eval("reportlinks")%>'></asp:hyperlink> </itemtemplate> <itemstyle horizontalalign="left" /> </asp:templatefield> aspx.cs code if (e.row.rowtype == datacontrolrowtype.datarow) { hyperlink mylink = (hyperlink)e.row.cells[4].controls[0];//slno,linkname,linkid,link if (mylink.navigateurl == "waiting approval") { m

css - divs positioning in parent div keeping aspect ratio by height -

i have 1 div container , want position 10 divs inside it. ------------ ||---||---|| <- container || 1 || 2 || ||---||---|| ||---||---|| || 3 || 4 || ||---||---|| ||---||---|| || 5 || 6 || ||---||---|| ||---||---|| || 7 || 8 || ||---||---|| ||---||---|| || 9 || 10|| ||---||---|| ------------ i want these divs squares, in 2 columns , want them 20% of parent height. parent div must not allowed change width less sum of 2 inner divs , ok extended (inner divs must attached left) i'm seeking solution css. you can use calc(); option in css. for example; if wrapper div 100% in height, 100vh . can use set inner divs width , height: .innerdiv { height: 20vh; width: 20vh; } read here: https://css-tricks.com/viewport-sized-typography/ support decent: http://caniuse.com/#search=vw

java - Creating five rectangles with android UI canvas -

i new android programming , trying create 5 rectangles(two on right side of screen , 3 on left side of screen) on android using canvas drawrect method, shows top left rectangle only. doing wrong here? help. here's rectangle class: public class rectangle extends view { public rectangle(context context) { super(context); setfocusable(true); } @override protected void ondraw(canvas canvas) { super.ondraw(canvas); float x = getwidth(); float y = getheight(); paint topleftrect = new paint(); paint bottomleftrect = new paint(); paint toprightrect = new paint(); paint midrightrect = new paint(); paint bottomrightrect = new paint(); // draw top left rectangle topleftrect.setstyle(paint.style.fill); //topleftrect.setcolor(color.white); topleftrect.setcolor(color.parsecolor("#ffff99")); // canvas.drawpaint(topleftrect); canvas.d

javascript - Cannot push newly created item in MongoDB to AngularJS array -

i stuck 2 full days on issues. use ruby on rails, mongodb , angularjs. when add new record database, record added in collection (table), cannot record automatically displayed current list of items. i doing way: $scope.posts.push(angular.extend(p, response.id)); $scope.posts.push(angular.extend(p, {id: response.id})); //tried $scope.posts.push(angular.extend(p, {_id: response.id.$oid})); //tried $scope.posts.push(angular.extend(p, {id: response.id.$oid})); //tried $scope.posts.push(response.id); //tried $scope.posts.push(response); //tried the record still not among existing ones. after refreshing page record displayed among others. (just fyi - deleting record , splice works well). after investigating, might caused structure of mongodb collection/documents? i've noticed when load data mongodb database, hash looks this: resource {_id: object, body: null, created_at: "2015-10-26t19:14:13.016z", starred: null, title: "u8u88u8u", updated_at: "2

java - Passing an object between the methods which has to keep adding data in all the methods -

i have requirement of passing object between methods , adding data below example. below written code programming practice? public void parentmethod(){ propertybean propertybean = new propertybean(); propertybean.setvalue1("value1"); propertybean = childmethod(propertybean); propertybean.setvalue3("value3"); } public propertybean childmethod(propertybean propertybean){ propertybean.setvalue2("value2"); return propertybean; } you dont need return object childmethod(propertybean); this call make sure value2 set object. objects passed reference in java (except primitive types)

c# - Run my own application on hadoop without coding mapreduce? -

maybe did not understand how complex hadoop is, if there incorrect please me out. got this: hadoop great thing handle big amount of data. data analysis , mining. can write own mapreduce functions or using pig or hive. can use existing functions, wordcount , stuff - dont have write code. ok, if use great power of hadoop non-analysis/mining things? example have .net application written in c# able read files , generating pdfs barcodes. application running on 1 server, because 1 server cannot handle big amount of files need more power. why not adding hadoop nodes/clusters handle job? question: can take .net application , tell hadoop "do this, on every on nodes/cluster"? -> running these jobs without coding, possible? if not, have throw away .net application , rewrite in pig/hive/java-mapreduce? or how people solve these issues in situation? ps: important thing here not pdf generator , maybe not .net/c# - question is: there application in language whatever - can

how to use assertion in selenium so that if it throws assertion error next line will not skip(java) -

i using assert verify scenario in selenium webdriver. below code. if assertion error in first line, execution not happening next line. want execute next line , want print fail report in testng xslt. using ant trigger build. assert.assertequals(actualdatesent, expecteddatesent, "comparing assert date"); assert.assertequals(actualuccnumber, expecteduccnumber); edit try-catch block try { assert.assertequals(actualdatesent, expecteddatesent, "date validation failed"); assert.assertequals(actualuccnumber, expecteduccnumber, number validation failed); } catch(throwable t) { errorutils.addverificationfailure(t); seleniumscreenshot.takefailedscreenshot(testname); } the way surround every assert try {} catch (assertionerror ex) , store messages exception in list. @ end of method need check if list not empty , throw assertionerror messages list concatenated.

material design - Android Styles throw error while using appcompat-v7:23.0.1 -

i created new project in android studio, threw following errors pointing v23/values-v23.xml file. 1 1. error:error retrieving parent item: no resource found matches given name 'android:textappearance.material.widget.button.inverse'. 2. error:error retrieving parent item: no resource found matches given name 'android:widget.material.button.colored'. assistance highly appreciated at first change buildtoolsversion compilesdkversion 23 buildtoolsversion "23.0.0" defaultconfig { // applicationid "package name" minsdkversion 17 targetsdkversion 23 versioncode 1 versionname "1.0" } or set buildtoolsversion 23.0.1

solr - Do not show drill down results for faceted search -

i using haystack 2.4 , solr 4.* , trying faceted search. template: <h4>by author</h4> <div> <dl> {% if facets.fields.author %} <dt>author</dt> {# provide top 5 authors #} {% author in facets.fields.author|slice:":5" %} <dd><a href="{{ request.get_full_path }}&amp;selected_facets=author_exact:{{ author.0|urlencode }}">{{ author.0 }}</a> ({{ author.1 }})</dd> {% endfor %} {% else %} <p>no author facets.</p> {% endif %} </dl> but shows top level results like: author1 (20) when click author1 drill down results, nothing shows up. added url http://localhost:8000/search/?q=test1&selected_facets=author_exact:author1&selected_facets=author_exact:author1&selected_facets=author_exact:author1 anyone has idea on it? thanks! it seems related url.py configura

javascript - Extreamly simple HTML js code,but why doesn`t it work? -

i trying learn make simple quiz.so got script in stackoverflow.it works here http://jsfiddle.net/zy4gw/ ,but not when use ,here code <html> <head> <title>learning how make quiz</title> <script type="text/javascript"> $(function(){ $('#q-and-a li a').each(function(){ $(this).click(function(){ $(this).siblings('div').slidetoggle(300); }); }); }); </script> </head> <body> <ul id="q-and-a"> <li><a>question one</a> <div>answer question one...</div> </li> <li><a>question two</a> <div>answer question two...</div> </li> </ul> <style> ul { margin: 0; padding: 0; } ul li { margin: 0; padding: 0; list-style: none; } ul li { color: blue; } ul li div { display: none; } </style> </body> </html> why doesn`t run?

angularjs - Recommend design for dynamic ionic side menu -

my app has many states falls under different categories , need different side menus each category. /book/view /book/edit .. /dvd/buy /dvd/view ..etc i have 3 options: 1. using different menus templates: $stateprovider .state('dvd', { url: '/dvd', abstract: true, templateurl: 'templates/dvd_menu.html', controller: 'appctrl' }) .state('book', { url: '/book', abstract: true, templateurl: 'templates/book_menu.html', controller: 'appctrl'

Sending image in android studio -

i developing 1 application allow user send report of job. beside want send image of work. how send image sender receiver in android studio or best way implement features? your report 1 of common type: xml or json, if true, can encode image base64, , put string report. edit here can find how convert image base64 string. string can put message variable.

regex - jQuery allow specific numbers for mobile number -

i want allow enter mobile number these combinations(7 or 8 or 9). i restricting alphabets(allow numbers) how restrict numbers other 7 or 8 or 9. $(document).on('keypress', '.mobnum', function (e) { //if letter not digit display error , don't type if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) { if (e.which == 118){ return true; }else{ return false; } } }); use following function restict mobile number $(document).on('keypress', '.mobnum', function (e) { var mobnum="987654321"; if (mobnum === ''|| mobnum === 'null'|| mobnum === null || phonenumber(mobnum)=== false) { } else { operations } }); function phonenumber(mobnum) { var pattern = new regexp(/^[789]\d{9}$/i); return pattern.test(mobnum); };

powershell - exchange 2010 run custom script when email arrives -

i need process every incoming mails of specific mailbox , insert in external database: sender, receivers, subject , mail content. emails must processed immediately. mailbox on exchange 2010 server. i've read powershell scripts cannot find , example script can me. there more enough documentation online explains how achieve this. if search powershell ews should able find need. information : need have decent level of knowledge powershell , exchange work.

Display connection specific cookies in Erlang -

when setting cookie on node erlang:set_cookie/2 possible set different cookies different nodes. there way display, cookie set node? calling erlang:get_cookie/1 not display information, "default" cookie displayed. example: start nodea cookie foo , nodeb cookie bar . @ nodea set cookie use when communicating nodeb bar calling erlang:set_cookie(nodeb, bar) . pinging works fine, no "connection attempt disallowed node..." errors. calling erlang:get_cookie() on nodea still shows "default" cookie foo . how can find cookie set nodeb? it doesn't seem documented, auth:get_cookie/1 want. case, can call auth:get_cookie(nodeb) on nodea .

php - Ubuntu 14.04.3 LTS Server PHPMyAdmin client denied by server configuration: /usr/share/phpmyadmin -

first of all, searched hour through questions , didn't find matching ones. so, if have overseen something, patient me. i'm hosting vserver on ubuntu 14.04.3 lts mysql-database on apache 2.4.7. runs fine that. want install phpmyadmin easier access database. since i'm not firm ubuntu server checked tutorial on https://help.ubuntu.com/community/phpmyadmin after ran through installation , reconfiguring process reloaded (and restarted) apache2, still 403 message you don't have permission access /phpmyadmin on server. when try http://myserverip/phpmyadmin . with restart of apache2 message occured: [alias:warn] [pid 29422] ah00671: alias directive in /etc/phpmyadmin/apache.conf @ line 3 never match because overlaps earlier alias. in apache error.log found entry saying not me: ah01797: client denied server configuration: /usr/share/phpmyadmin any ideas? thank you! so, i'm going answer own question. added allow line phpmyadmim config file. after gra

there is no result my javascript array WHY? -

this question has answer here: how return response asynchronous call? 25 answers i push data array can see in array out of function there no data in array why ?? function keywordsearch() { var musicids = []; gapi.client.setapikey('aizasyb2o-w22osjvskphaysk_zxx7fsthm0mhe'); gapi.client.load('youtube', 'v3', function () { idlist = ''; var q = $('#queryserach').val(); $("#result").empty(); var request = gapi.client.youtube.search.list({ q: q, part: 'snippet', maxresults: 3, }); request.execute(function (response) { (var = 0; < response.items.length; i++) { var musicid2 = response.items[i].id.videoid; m

python - Pig Script: STORE command not working -

this first time posting stackoverflow , i'm hoping can assist. i'm new @ pig scripts , have encountered problem can't solve. below pig script fails when attempt write results file: register 'myudf.py' using jython myfuncs; = load '$file_nm' using pigstorage('$delimiter') ($fields); b = filter ($field_nm) not null; c = foreach b generate ($field_nm) fld; d = group c all; e = foreach d generate myfuncs.theresult(c.fld); --dump e; store e 'myoutput/theresult'; exec; i see results of e when dump screen. however, need store results temporarily in file. after store command, error receive is: output location validation failed . i've tried numerous workarounds, removing theresult folder , removing earlier contents of theresult, none of commands use work. these have been along lines of: hdfs dfs -rm myoutput/theresult and hadoop fs -rm myoutput/theresult ...using both shell (hs) , file system (fs) commands. i've tried call

html - Menu list doesn't appear in div as expected -

i want create navigation menu sidebar. it should have links ul list not displaying on div element i want using css only. pure css required because don't have scripting language knowledge <!doctype html> <html lang="en"> <head> <title>sidebar</title> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=material+icons "/> <style type="text/css"> /* #button { display: block; text-decoration: none; margin-top: 20px; margin-left: 50px; color: white; width: 20px; height:20px; font-size: 30px; transition: width 0.5s; background-color: black; text-align: center; padding-bottom: 30px

performance - Vulcanize, what's the point? -

just in general why 1 consider vulcanize web page. example building website 629kb, in 975ms(under 30m/s wifi network), 93 requests. after vulcanizing page, becomes 964kb, in 2.02s load time, 47 requests only. i have polymer-project components in there otherwise pretty straightforward website sass. not built upon framework. so question what's big fuzz vulcanization? missing here? seems have decreased performance of website. as mentioned, vulcanizing should bring js requests 1 , css requests 1. eliminating round trip latency huge actual users. sure test performance using webpagetest.org or @ least locally using throttling test different network speeds (chrome has built dev tools). all being said, http2 changes , makes vulcanizing less important.

how to drop a mysql database which is having numbers -

i created mysql database name 123, when want drop it,it not dropping , throwing error. used query. drop database 123; , tried drop database '123'; . other databases name abc123 dropping. solution greatful. try use this: drop database `123` you need put name inside backticks.

angularjs - Set audio/video files of single recorded video file using ngCamRecorder and run simultaneously -

i using ngcamrecorder creating video file , upload in 2 separate file (audio , video) after uploading struggling display in browser my code when video streaming using ngcamrecorder <?php $tmp_name = $_files['filetoupload']['tmp_name']; $size = $_files['filetoupload']['size']; $name = $_files['filetoupload']['name']; $name2 = uniqid().'.webm'; /* s3 server code */ /* include('s3/uploads3.php'); $s3obj = new amazons3video(); $result = $s3obj->uploadfiles3($tmp_name, $name2); */ $target_path = "/public_html/myproject/videos/"; $target_file = $target_path.$name; $complete =$target_path.$name2; $_session['videofilename'] = $name2; $com = fopen($complete, "ab"); error_log($target_path); $in = fopen($tmp_name, "rb"); if ( $in ) { while ( $buff = fread( $in, 1048576 ) ) { fwrite($com, $buff); } } fclose($in); fclose($com); ?&g

php - Laravel 5.1. - Login sessions not persisting -

i using laravel 5.1 sentinel - cartalyst auth driver. problem laravel can't "keep" users logged in. after time (when visit website) automatically kicks them out error not logged in (i have filter checks if user logged in every route expect login route). bugs me , can't fix it. tried using cookies, file , database driver keeping login sessions , fail. does knows how deal problem? bulding project intranet users (under local domain)... maybe problem? notice cookies expiration time current datetime laravels sets max expiration time. are sure imported correct namespace path cartalyst? had issue sessions not persisting , caused importing native php cartalyst class rather laravel one. should cartalyst\sentinel\laravel\facades\sentinel::class

mysql - Last Modified or IfModifiedSince Android SQL HTTP -

i have app retrieves , posts data sql server. my situation this: set download json data server every time app opened. server (1000's of rows , 15+ columns) data updated every couple of days or few times week. seems inefficient , silly update every time app opened if data hasn't changed. i want data update if data has been updated. i'm trying use this: urlconnection = (httpurlconnection) url.openconnection(); long lastmodified = urlconnection.getlastmodified(); it seems returning 0, means value not set? do need set on server allow respond getlastmodified request? note: able see last updated statistic on phpmyadmin. you other things instead : you add new table or new field have date last modified date , , let app info , compare local date , , decide eather update or not . you deal meta data idk if sql server . or can set service on android device update data base every 2 days way not efficient .

c# - Attach Image/ImageBrush from code behind -

i'm trying add image background of usercontrol. depending on value of variable need change background whatever path or uri format use, background not change. i've seen lots of questions here in stackoverflow none fixes single problem. let code below: if (callback.liveuvis.containsuvi(uvi)) { this.status.text = "live"; imagebrush imgb = new imagebrush(); bitmapimage btpimg = new bitmapimage(); btpimg.urisource = new uri(@"///img///live///bck_frame_info_video_live.png", urikind.relative); //imgb.imagesource = new bitmapimage(new uri("~/img/live/bck_frame_info_video_live.png", urikind.relativeorabsolute)); //imgb.imagesource = new bitmapimage(new uri("ms-appx:///img/live/bck_frame_info_video_live.png")); imgb.imagesource = btpimg; this.background = imgb;

Can TypeScript be used with existing JavaScript code? -

i working on pretty big existing web application team. time time experience common javascript coding nuances case difference while function calling or missing operator etc. i find typescript promising solution such issues specially while working team on different files/modules. has many benefits like static code analysis better auto-completion code minification dead code reduction string type checking strict oop i know there converters available can convert javascript typescript not want convert existing project files typescript. i wondering if possible keep existing code , develop new modules/files in typescript. may can migrate existing files in gradual manner. will work together? how it? i have tried read online couldn't find relevant information other converting existing projects typescript. yes. the language spec : typescript syntactic sugar javascript. typescript syntax superset of ecmascript 6 (es6) syntax. every javascript progr

javascript - Requiring Modules in react-native -

i'm stuck on problem in react-native project. i'm trying general require file, export modules. after require "require.js" file avoid calls require('../../modulename') in every file. i have 4 files: index.ios.js /app/home.js /app/myview.js /app/require.js require.js: module.exports = { home: require('./home'), myview: require('./myview') } in index.ios.js (he modules home , myview getting importet correctly) 'use strict'; var react = require('react-native'); var { appregistry, stylesheet, text, view, } = react; var { home, myview } = require('./app/require'); class test_require extends react.component { render() { return( <home /> ); } } appregistry.registercomponent('test_require', () => test_require); home.js (the module myview not getting importet) 'use strict'; var react = require('react-nat

javascript - Use jQuery.getJson to get Web API -

this question has answer here: what jsonp about? [duplicate] 7 answers i'm beginner of asp.net web api. fail use jquery.getjson() asp.net web api this failed: //in "file:///c:/users/lil/desktop/index.html" var url = "http://localhost:56110/api/values"; $.getjson(url, function (data) { $("#locmsg").text("success"+data); });` this succeeded: //in "http://localhost:56110/index.html" var url = "http://localhost:56110/api/values"; $.getjson(url, function (data) { $("#locmsg").text("success"+data); }); i though because of cross-domain request, succeeded: //in "file:///c:/users/lil/desktop/index.html" var url = "http://api.flickr.com/services/feeds/photos_public.gne?tags=dog&tagmode=any&format=json&jsoncallback=?"; $.getjson(u

lucene.net - Lucene Duplicated results / spaces in text search -

i’m using lucene 2.9.4.1 , works fine if search exists once in same line. per instance, if lucene find same string i’m looking in same line, have duplicated (or more) results. i’m using following booleanquery: booleanquery.add(new termquery(new term(propertyinfo.name, textsearch)), booleanclause.occur.should); the second issue searching spaces “hello world”: never works. can advise me or me these 2 malfunctioning features, please? thank in advance, best regards, well, found answer solved both of issues =) i using this: booleanquery booleanquery = new booleanquery(); propertyinfo[] propertyinfos = typeof(t).getproperties(); foreach (propertyinfo propertyinfo in propertyinfos) { booleanquery.add(new termquery(new term(propertyinfo.name, textsearch)), booleanclause.occur.should); } and use this: var booleanquery = new booleanquery(); textsearch = queryparser.escape(textsearch.trim().tolower()); string[] properties = typeof(t).getproperties().select(x =&g

coldfusion - How to change the user image using cfldap? -

Image
i'm able values want cfldap. when try update user image don't know how send correct value binary image attribute. i tried getting image variable cffile upload <cffile action="upload" filefield="file" destination="c:\inetpub\wwwroot\test" nameconflict="overwrite" result="image" /> also tried using cfimage static image - <cfimage action="read" source="c:\inetpub\wwwroot\test\image.png" name="anotherimage"> or <cffile action="readbinary" file="c:\inetpub\wwwroot\test\image.png" variable="binaryimagecontent"> but in case, when call <cfldap action="modify" dn="#results.dn#" attributes="thumbnailphoto=#obj.image#" modifytype="replace" server="myserver" username="mydomain\myuser" password="mypass"> the #results.dn# dn user before (everything ok

javascript - How to get multi tab view effect? -

the following image sums want have in html file. i want add tab naming "tab name" , "x" close button on top of tab, cover flow, vertical. how can achieve effect? http://i62.tinypic.com/2q084gg.jpg

How can I fetch the BuyerID based on buyer-email using Amazon MWS Api -

when parsing through orders amazon mws api report type _get_amazon_fulfilled_shipments_data_ , i can see buyer name property , other information buyer (address, etc.). however, don't see buyerid. know can use buyer-email (ie: fooamazoncustomer@marketplace.amazon.com) unique customer identifier. but purpose link orders made of such buyer public page need buyerid instead of buyer-email. so question is, how can fetch buyerid based on buyer-email using amazon mws api or scraping? thanks scottg , sagar. answer: don't believe it's possible. amazon uses anonymized emails protect customer , therefor they're not going give id can see profile or public page. did verify can buyers email address, again it's anonymous, orders api using getorder operation. – scottg

php - Use existing migrations tables for laravel unit testing -

i want use existing set of migrations create tables me stuff seed data into. using orchestra testbench testing. examples this show creating table on fly: db::schema()->create('oauth_identities', function($table) {... but want use existing migrations. testcase.php: use orchestra\testbench\testcase orchestratestcase; abstract class testcase extends orchestratestcase { protected function getbasepath() { // reset base path point our package's src directory return __dir__ . '/../vendor/orchestra/testbench/fixture'; } } dbtestcase.php: class dbtestcase extends testcase { protected $artisan; /* * bootstrap application */ public function setup() { parent::setup(); $this->artisan = $this->app->make('illuminate\contracts\console\kernel'); $this->artisan('migrate', [ '--database' => 'testbench', '--realpath' => realpath(__di

javascript - Attach Angular2 Component to existing element without replacing content -

i have problem migrate ng1 app ng2. load our ng1 app dynamicly , attach body or html tag of page inline directives inside. see example - plunkr . after page load, do angular.bootstrap(document.body, ['app']); directives "alive" now. but ng2 don't know how properly. if bootstrap component body selector, replace content of page. can add ... body, our "inline" directives still outside of tag, somewhere in user content, not compiled. the way can manage bootstrap every "inline" directive separately. bootstrap(mydirective); bootstrap first matched element on page, need "clone" directive class , dynamically set strict selector it: var somedirective = (function (_super) { __extends(somedirective , _super); function somedirective () { _super.call(this); } return somedirective; })(mydirective); //extend directive class somedirective['annotations'] = [ //set annotations new component({

Jquery Scrollmagic remove fix text trigger on right side in browser -

sorry iam newbie in here want ask how remove fix text trigger on right side in browser search in google tell remove scene.addindicators() when remove scroll gone this screenshot enter image description here this code <script> // define images var images = [ "assets/img/img-aris/0001.png", "assets/img/img-aris/0002.png", "assets/img/img-aris/0003.png" ]; // tweenmax can tween property of object. use object cycle through array var obj = {curimg: 0}; // create tween var tween = tweenmax.to(obj, 1, { curimg: images.length - 1, // animate propery curimg number of images roundprops: "curimg",