Posts

Showing posts from April, 2013

perform clicks and logout of website using cURL and php -

i used curl login website. natural question how perform clicks on buttons , logout. example..javascript uses click() function. php use? clues. i following book on web scraping. in author logins it's publishers website. book old , out of date. more over, says nothing logging out. publisher: https://www.packtpub.com/ you can't click button using php alone. php doesn't work that. php can download html of webpage, can't perform actions browser can. if want that, need headless browser. headless browser typically seen invisible browser. can things regular browser can do. there's phantomjs , , casperjs , this. there php libraries use phantomjs. example php phantomjs . personally, i've never done php, use phantomjs , casperjs on regular basis. alternative that, can php parse dom links, or buttons, , replicate http request that's made when clicking links/buttons. for example, if there's link goes /contactus , create request page using curl

mysql - Sql errror when running LOAD DATA LOCAL INFILE on AWS with RDS -

i have ubuntu webserver on aws communicating mysql server on aws rds. keep getting error sql when running ubuntu server. ideas why having problem. ideas why sql failing? basically i'm trying load file onto mysql server. need able achieve bash programatically. $(mysql -h "$host" --user="$user" --password="$pw" --local-infile=1 -d"$dbname" --skip-column-names -e "load data local infile '/html/results/f9_result.jtl' table `result.jtl` fields terminated ',' lines terminated ' ' ignore 1 lines;") error message: "you have error in sql syntax; check manual corresponds mysql server version right syntax use near 'terminated ',' lines terminated ' ', ignore 1 lines' @ line 1" escaping ticks suggested resolved problem sql $(mysql -h "$host" --user="$user" --password="$pw" --local-infile=1 -d"$dbname" --skip-column-name

connect to Cassandra CCM cluster with C# driver -

i trying play around application access ccm cluster create on fly, local development i'm not sure how set contact points (which ip address , not, security settings use) once i've created ccm cluster. any thoughts? keep researching , post answers find here. thanks! depending on number of servers have created, @ 127.0.0.1 , 127.0.0.2 , etc. unless need work multiple clusters, can connect use 127.0.0.1 address contact point connect cluster have created.

ios - XmppFramework I'm getting KissXml error -

Image
i'm getting error module 'kissxml' not found on xmppframework couldn't solve problem please me! setup xmppframework github xcode version 7.2 i use cocoapods @ beginning, because of need modify source code meet requirements, manually add xmppframework, encountered sorts of mistakes. 1 blogger noted, have solved problem. by replace @import kissxml; to #import "ddxml.h" have try~

ios - TWTRTimelineViewController with Guest Authentication -

i encountering numerous issues while trying use twtrtimelineviewcontroller guest authentication. from following documentation here , , following tutorial here , should able show twtrtimelineviewcontroller without issue, keep getting following error code when initializing fabric: [fabric] failed download settings error domain=fabnetworkerror code=-5 "(null)" . i've tried searching error , cannot find related -5 error code. i have tried initializing fabric using [[twitter sharedinstance] startwithconsumerkey:ktwitterconsumerkey consumersecret:ktwitterconsumersecret]; and [fabric with:@[ [twitter sharedinstance] ]]; but doing results in same error displaying following error when trying set datasource on twtrtimelineviewcontroller: [twitterkit] couldn't load tweets twtrtimelineviewcontroller: error domain=twitterapierrordomain code=200 "request failed: forbidden (403)" has ever had issue before or can show me how display twitter feed usi

foreach - Stata Renaming Variables using first line data -

i used insheet read in csv format data. names of variables should first line of dataset. have lot of variables , many years of data read in using foreach var loop follows: input str8 x str8 y str8 z first second third 3 6 2 4 1 2 8 7 6 end foreach var of varlist * { rename variable "`var'" "`=`var'[1]'" } unfortunately, receive syntax error response. i'm assuming problem must in way specified new name. extrapolating q&a: http://www.stata.com/statalist/archive/2011-09/msg01109.html the problem not foreach . input code didn't run me seems side-issue. the main problems seem rename not include syntax variable unless variable name. rename not use double quotes. see rename . this works , keeps on going. clear input str8 x str8 y str8 z "first" "second" "third" "3" "6" "2" "4" "1" "2" "

Transpose a column vector in torch -

i have colum vector want tranpose row vector, following error while doing it. there way tranpose 1 dimensional vectors in torch th> bb 1 2 [torch.doubletensor of size 2] [0.0005s] th> bb:t() [string "_result={bb:t()}"]:1: calling 't' on bad self (tensor must have 2 dimensions @ /tmp/luarocks_torch-scm-1-5379/torch7/generic/tensor.c:590) stack traceback: [c]: in function 't' [string "_result={bb:t()}"]:1: in main chunk [c]: in function 'xpcall' this because tensor has dimension of 1. can take transpose of tensor dimension 2. in order this, first resize tensor bb:resize(2,1) after that, should work: th> bb:t() 1 2 more generally, tensor other size, can use: bb:resize(bb:size(1),1)

javascript - Getting undefined node.js code -

i have code below. using readline , fs module trying search particular word in file line line , if word exist push contents of word array when try return array undefined. ideas? var fs = require('fs'); var readline = require('readline'); var reader = readline.createinterface({ input: fs.createreadstream('my_file_name.txt'), }); function newdefineword(reader1) { this.reader = reader1; } newdefineword.prototype.define = function(searchterm) { var arr = []; this.reader.on('line', function (line) { if (line.search(searchterm)!== -1) { arr.push(line); console.log(arr); } }); return arr; } var word = new newdefineword(reader); console.log(word.define('libro')); reader.on async returning before conclusion code should newdefineword.prototype.define = function(searchterm, cb) { var arr = []; this.reader.on('line

Test ArrayAdapter in Android -

i'm trying test custom arrayadapter , i'm having issues getting list appear public class planofcarecheckboxadaptertest extends androidtestcase { planofcarecheckboxadapter madapter; list<string> values; context mcontext; public planofcarecheckboxadaptertest() { super(); } @before public void setup() throws exception { super.setup(); mcontext = new mockcontext(); new pocvalues(mcontext); values = arrays.aslist("one", "two", "three"); madapter = new planofcarecheckboxadapter(mcontext, r.layout.item_multi_check, values, pocvalues.mastermap); assertequals("two", madapter.getitem(0)); } my implementation: public class planofcarecheckboxadapter extends arrayadapter<string>{ private bimap<integer, string> map; private set<integer> mpendingitems, mdoneitems; private boolean issuperuser; public planofcarecheckboxadapter(context context, int resource, list objects, bimap<integer,

internet explorer - IE links and other functioning not working but works in all other browsers -

i building site works in other browsers, when have checked in ie(11) none of links, :hover functions or inputs seem work. javascript works in banner when mouse hovers controls don't show. layout , styling seem working fine minus few tweaks. confusing thing building site using similar framework , works absolutely fine. have tried different doctype , html combinations no success , using html5. have tried on other people's ie browsers , come same issue, seems global issue , not ie browser. the site can viewed here site map links supposed work images under js banner. menu button @ top should open up. suggestions? it seems ie disable js.enable it.i infected virus stops js run on browsers.i checked on other pc works fine.chrome supportive development.i reinstall windows project work fine.

for loop - What does this iterative function in C do? -

specifically, want walk through algorithm starting input pat = "aab" , string = "ababbaabaa" . i'm having trouble figuring out going on inside of nested loop because i'm not proficient in c. function looks this: int nfind(char * string, char * pat){ int = 0, j = 0, start = 0; // int lasts = strlen(string) - 1; // int lastp = strlen(pat) - 1; // int endmatch = lastp; // (i = 0; endmatch <= lasts; endmatch ++, start ++){ // if (string[endmatch] == pat[lastp]){ (j = 0, = start; j < lastp && string[i] == pat[j]; ++, j++) ; } if (j == lastp) return start; } return -1; } so when function called, we'll have i=j=start=0 , lasts=9 , lastp=2 , , endmatch=2 . since endmatch < lasts , run loop. i'm not sure line if (string[endmatch] == pat[lastp]) means. i'm familiar if statements i'm not sure if they're asking if endmatch == lastp or if has character a

sitecore8 - Sitecore - setting background-image a div to a CMS value -

i've been try add background image of div value sitecore (8.0) in c# mvc using code <div style="background-image: url({model.myimage.src})> where myimage of type image returned glassview this returning html such as <div style="background-image: url(/~/media/myfolders/myimage.ashx)"> this image isnt being displayed when page rendered- although url resolves when entered browser's address bar must issue .ashx extension background image div. i tried using sitecore.resources.media.mediamanager.getmediaurl(mediaitem) returned me ashx couldn't resolved! try background-image: url('@model.image.src') . while example doesn't show it, have spaces in folder or file name, requires single or double quotes.

python - How to use pip with python3.5 after upgrade from 3.4? -

i'm on ubuntu , have python2.7, (it came pre-installed) python3.4, (used before today) , python3.5, upgraded today, installed in parallel. work fine on own. however, want use pip install packages, , can't figure out how 3.5 installation because pip installs 2.7 , pip3 installs python 3.4 packages. for instance, have asyncio installed on 3.4, can't import 3.5. when pip3 install aysncio , tells me requirement satisfied. i'm bit of newbie, did snooping around install directories , couldn't find , i've googled no avail. i suppose can run pip through python until sorted out. ( https://docs.python.org/dev/installing/ ) a quick googling seems indicate indeed bug. try , report back: python3.4 -m pip --version python3.5 -m pip --version if report different versions guess you're go. run python3.5 -m pip install package instead of pip3 install package install 3.5 packages.

What is the proper way to initialize an external framework in an Aurelia app -

i want know if aurelia way initialize framework. using foundation 6 , have made override working fine override: { "main": "dist/foundation", "files": ["dist", "assets", "js", "scss"], "shim": { "dist/foundation": { "deps": "jquery", "exports": "foundation" } }, "dependencies": { "jquery": "github:components/jquery" } } in main.ts modified below code adding .then(a=> { //initialize framework $(document).foundation(); }) full main.ts code import 'foundation'; import {aurelia} 'aurelia-framework'; export function configure(aurelia: aurelia) { aurelia.use .standardconfiguration() .developmentlogging(); //uncomment line below enable animation. aurelia.use.plugin('aurelia-animator-css'); //anyone wanting use htmli

PHP & MySQLi OOP - Session value not being set? -

when logging user in have checked the submitted values being set, (tested var_dump), validation of checking inputed values against database works fine redirect index.php page works fine, session value not being set "not logged in" message being shown @ top of page implemented see if code worked, should saying "logged in" when redirected index.php page. result of var_dump on session of userid null. should users id. login.php: <?php require_once('includes/classes/session.php'); require_once('includes/classes/database.php'); require_once('includes/classes/user.php'); require_once('includes/functions/general.php'); require_once('includes/functions/security.php'); require_once('includes/functions/user.php'); if($session->isloggedin()) { redirect('index.php'); } if (isset($_post['submit'])) { $username = trim($_post['username']); $password = trim($_post['password'

c# - Can AutoFixture generate random strings/text from a provided data set? -

it possible use autofixture generate random data string property .. it's fixed data source? for example: have 30 street names hardcoded memory collection (array/list/whatever). then, address instance, streetname property isn't random string value (which default result autofixture) 1 of street names hardcoded collection. my first thought use random number autofixture might able create.. , number inside array length/size ... in effect i'm randomizing array slot. then, using random number, value (aka street name) of collection/array slot (ie. given indexer, value @ index location). is how should done?

html - How can I stop the page from breaking mid td? -

Image
<table class="question-table"> <tr> <td> <div class="question-text">1. <p>$153$ + $634$ = ___</p> </div> <ol type="a"> <li>$787$</li> <li>$456$</li> <li>$657$</li> <li>$936$</li> </ol> </td> <td class="answer"><small>answer</small></td> </tr> <tr> <td> <div class="question-text">2. <p>$38$ + $47$ = __</p> </div> <ol type="a"> <li>$106$</li> <li>$85$</li> <li>$96$</li> <li>$52$</li> </ol> </td> <td class="answer"><small>answer</small></td> &

javascript - Remove line breaks/spaces from array -

i having trouble removing line breaks text in javascript. here example of data working with: 0: "christian pulisic" 1: "↵" 2: "from wikipedia, free encyclopedia" 3: "↵" 4: "christian pulisic" 5: "↵" 6: "personal information" 7: "↵" 8: "full name christian mate pulisic[1]" obviously, line spaces/breaks or whatever call them, polluting data getting. i cannot following function recognize line breaks , replace "" can remove array through function run data through. this code using not working: for (i in cleanarray){ cleanarray[i].replace(/(\r\n|\n|\r)/gm,"") }; console.log(cleanarray); cleanarray[i].replace(/(\r\n|\n|\r)/gm,"") return new string. furthermore, strings immutable in javascript. change for(var = 0; < cleanarray.length; ++i) cleanarray[i] = cleanarray[i].replace(/(\r\n|\n|\r)/gm,"")

Getting data from related table in Codeigniter -- translating MySQL query into CI MVC -

i have worked examples few different stackoverflow posts data related tables in ci, haven't been successful in connecting tables in "where" part, , i'd understand how translate mysql query ci mvc. this mysql query works dctag fields dctags table dctag_id in articles table matches: $dctagger = $article['dctag_id']; $query = "select `dctitle`, `dctag_id` dctags dctag_id = '$dctagger'"; $query_run = mysql_query($query); this code model, controller, , view files: model - public function get_article_dctag() { $this->db->select('*') ->from('dctags') ->where('dctag_id', $this->$data['dctag_id']); $query = $this->db->get(); return $query->result_array(); } controller - public function article($slug) { $data['article'] = $this->article_model->get_article($slug); $data['dctag'] = $this->article_model->get_article_dctag(); $this->load->view('t

java - How to access String within an ArrayList within an ArrayList within a HashMap? -

so have arraylist full of strings arraylist<string> colours = new arraylist<>(); colours.add("red"); colours.add("blue"); and arraylist stored in arraylist arraylist<arraylist> container = new arraylist<>(); container.add(colors); and arraylist stored in hashmap hashmap<integer, arraylist> map = new hashmap<>(); map.put(1, container); how access "red"? tried system.out.println(map.get(1).get(0).get(0)); but gave a error: java: cannot find symbol symbol: method get(int) location: class java.lang.object you should not use raw types arraylist<arraylist> use "cooked" types such arraylist<arraylist<string>> (or better, list<list<string>> ). likewise, instead of hashmap<integer, arraylist> , use hashmap<integer, arraylist<arraylist<string>>> (or better, map<integer, list<list<string>>> ).

DynamoDB Global Secondary Index to increase performance -

i designing application tracing call activity. each call can either terminated or activated. application query database every minute generate list of activate calls. there can 1000 calls per second. how should design database? should have "call" table , global secondary index on "state" attribute can equal "activate" or "terminated" or a "call" table , global secondary index on "isactive" attribute present active calls only. problems may faced if go out schema have suggested in question: calllist table 'state' gsi, way able query gsi , active calls, effect performance there limited values partition key (i assuming wont deleting record either, table grow huge in no time) calllist table gsi on isactive, have same above problem of rows have "isactive=false" my proposed schema: keep separate activecall table having entry of active calls, way don't have worry size of table or g

Bad substitution error when using bash -

this question has answer here: why /bin/sh behave differently /bin/bash if 1 points other? 4 answers so wanted bash script whenever run "bad substitution" error. have browsed stackoverflow , tried solutions none worked :/ ideas? #!/bin/bash printf "hello. ots setup script provided damon @ otland. please standby user input may required." read -r -p "do want install webpanel? [y/n]" response response=${response,,} # tolower if [[ $response =~ ^(yes|y| ) ]]; wget https://raw.githubusercontent.com/nicolasloew/vps/master/panelsetup.sh sh panelsetup.sh fi printf "if installed webpanel please navigate http://yourip:2004/ , follow install instructions." printf "once have installed webpanel login , go enduser-->configuration-->apache , delete in config , replace https://raw.githubusercontent.com/nicolasloew/vps

python - Answer prints 0 not actual answer -

def difference1(): answer = 0 in range(1, 100): sum1 = a**2 sum1 += answer print(answer) difference1() why code printing 0? want numbers between 1 , 100's squares added together. have made dumb mistake can't figure out. you never change 'answer' varaible, thats why 0 assigned it. do this: def difference1(): answer = 0 in range(1, 100): sum1 = a**2 answer += sum1 #the change on line print(answer) difference1()

php - How to sort by custom column in users section in worpdress -

i have 2 custom columns in users section in word press "store name" , " date" these 2 saved in users_meta table in db , how can show data in user admin list sorted "store name" , "date". current code till add column heading , fetching them user_meta in users section follow. themes function.php /* adds store name , date column user display dashboard. * * @param $columns array of columns displayed on user dashboard * @return updated array of columns including zip codes. */ function theme_add_user_store_name_column( $columns ) { $columns['store_name'] = __( 'store name', 'theme' ); $columns['date'] = __( 'date', 'theme' ); return $columns; } // end theme_add_user_store_name_column add_filter( 'manage_users_columns', 'theme_add_user_store_name_column' ); /** * populates store name , date column specified user's store name. * * @param $value em

Can't call a method from a separate class in Java -

making little mini blog application, setting places hold data. have 3 classes 1 post 1 user , 1 test, named blog. when try call getname(); method in blog class won't run keeps saying needs string, made array of user objects, , input string username spot, , still isn't working. public class blog { public static void main(string []args) { user[] userlist = new user[3]; userlist[0] = new user("what.com", "thelegioncrab", "jake parham", "jparham@gmail.com"); userlist[1] = new user("huh.com", "ragglefraggle", "brett hawkins", "bhawkins@gmail.com"); userlist[2] = new user("buh.com", "seanbeast", "sean sweeney", "ssweeney@gmail.com"); for(int counter = 0; counter<userlist.length; counter++) { user.getname(); } } } public class user { private string url; private str

c# - Delegate using different methods of different classes -

using system; delegate int numberchanger(int n); namespace delegateappl { class testdelegate { static int num = 10; public static int addnum(int p) { num += p; return num; } public static int multnum(int q) { num *= q; return num; } public static int getnum() { return num; } static void main(string[] args) { //create delegate instances numberchanger nc1 = new numberchanger(addnum); numberchanger nc2 = new numberchanger(multnum); //calling methods using delegate objects nc1(25); console.writeline("value of num: {0}", getnum()); nc2(5); console.writeline("value of num: {0}", getnum()); console.readkey(); } } in above code function called , calling function in same class.... can use both in seperate classes? if possible please give example ...... surely can. just put methods in separate class , create instance of access th

Google login redirect error with Azure Mobile Service Javascript client SDK -

when web client tried login google azure mobile javascript sdk, gave me error. <html> <head> <script src="https://ajax.aspnetcdn.com/ajax/mobileservices/mobileservices.web-1.2.7.min.js"></script> <script> function signin(){ var mobileserviceclient = windowsazure.mobileserviceclient; var client = new mobileserviceclient('https://thehome.azurewebsites.net', 'xxxx'); client.login("google").done(function (results) { alert("you logged in as: " + results.userid); }, function (err) { alert("error: " + err); }); } </script> </head> <body> <button onclick="signin()">click me</button> </body> </html> i used sample code https://azure.microsoft.com/en-us/documentation/articles/mobile-services-html-how-to-use-client-library/ . if click button, got below error. cannot /login/google?completio

ruby on rails - Routing error - uninitialized constant -

i not fix in rails 3.2.12, maybe missing something. config/routes.rb get "home/index" root :to => "home#index" devise_for :users, :only => :omniauth_callbacks match 'users/auth/:provider/callback' => 'authentications#create' match '/auth/:provider/signout' => 'authentications#signout' app/controllers/authentication_controller.rb class authenticationscontroller < applicationcontroller ... end app/models/authentication.rb class authentication < activerecord::base ... end i think should work current knowledge, there miss. my kind question tell wrong, please. rounting error uninitialized constant authenticationscontroller this message shows @ http://localhost:3000/auth/facebook/signout rails requires file name match class name. therefore should rename app/controllers/authentication_controller.rb app/controllers/authentications_controller.rb .

android - Playing video in EXOPlayer -

i using below code play video using exoplayer doesn't plays. video in mp4 format.where going wrong? showing error- com.google.android.exoplayer.exoplaybackexception: java.io.ioexception: failed instantiate extractor. code- loadvideo("res:/" + r.raw.samplevider); private void loadvideo(string path) { player = exoplayer.factory.newinstance(2, 1000, 5000); uri uri = uri.parse(path); samplesource = new frameworksamplesource(getactivity().getapplicationcontext(), uri, null); // 1. instantiate player. // 2. construct renderers. videorenderer = new mediacodecvideotrackrenderer(getactivity().getapplicationcontext(),samplesource, mediacodecselector.default, mediacodec.video_scaling_mode_scale_to_fit_with_cropping); audiorenderer = new mediacodecaudiotrackrenderer(samplesource,mediacodecselector.default); // 3. inject renderers through prepare. player.prepare(videorenderer, audiorenderer); // 4. pass surface video renderer.

javascript - Access video.js runtime properties in safari -

Image
i trying print runtime properties of video.js player in safari hls property not coming. getting error saying hls not defined. player.html <body> <script src="http://vjs.zencdn.net/5.6.0/video.js"></script> <script src="videojs.hls.min.js"></script> <video id="my-video" class="video-js" controls preload="auto" width="640" height="264" data-setup="{}"> <source src="http://manifest.us-west-2.qa2.boltdns.net/manifest/v1/hls/v4/clear/test/ddebe1d2-8285-46d6-9853-6bbc9f51616a/10s/master.m3u8?fastly_token=ntzkmda5zwrfngi4ndyymge0yzzlodqyndq5owi3ntdjnwi3nzq5m2jkn2iynjmxzdnhmwyzotdlztkwogu2zdflntk4yjqwyg%3d%3d" type="application/vnd.apple.mpegurl"> <p class="vjs-no-js"> view video please enable javascript, , consider upgrading web browser <a href="http://videojs.com/ht

android - Can not send string to php file using namevaluepair -

i trying send string php script using namevaluepair. couldn't receive on other side. here code. protected string doinbackground(string... args) { arraylist<namevaluepair> namevaluepairs = new arraylist<namevaluepair>(1); namevaluepairs.add(new basicnamevaluepair("username",code )); log.v("username", code); defaulthttpclient httpclient = new defaulthttpclient(new basichttpparams()); httppost httppost = new httppost("http://192.168.42.21:8080/sellapp/menuitem.php"); // depends on web service httppost.setheader("content-type", "application/json"); inputstream inputstream = null; string result = null; try { httppost.setentity(new urlencodedformentity(namevaluepairs)); httpresponse response = httpclient.execute(httppost); httpentity entity = response.getentity(); inputstream = entity.getcontent(); // json utf-8 default bufferedreader reader = new bufferedre

arrays - How to wrapped JSON Handler in Function -

so i'm using function pass json value (any object) in other class it's full of issues can't working func getswpeopleapi() -> nsmutablearray { var json2: nsmutablearray alamofire.request(.get, "http://swapi.co/api/people/1").responsejson { response in print(response.request) print(response.response) print(response.data) print(response.result) if let json = response.result.value{ json2 = json as! nsmutablearray } else{ return } } return json2 } do have suggestion on how can achieve pass apimanagerclass , data type best use when dealing json? you doing in wrong way! json must have type of nsdictionary . func getswpeopleapi(strurl: string, completionhandler: (nsdictionary?, nserror?) -> ()) -> (){ alamofire.request(.get, strurl).responsejson { response in switch response.result { case .success(let data):

Monaca IDE - console.log never appears -

x-post here, exposure: https://community.onsen.io/topic/222/monaca-ide-console-log-never-appears odd question, once while using monaca ide has ever shown in console.log portion of ide itself. occurred when had device synced via debugger. have since tried syncing , never device show in drop down box, says unknown device /www/html/… now, know have put several console.log(‘test’); lines of code try out , still no success. think ide’s console area show log operations emulator , not device debugger has own log view-able on device, apparently isn’t case. correct or missing simple here? so isn’t big of issue, figured out problem. basically, keep monaca ide tab open in chrome time (i work via laptop remotely). when come after long absence (several hours, don’t know time out is), bottom section in console has chrome error showing, page timed out. ide still there, section grayed out. so fix this, refresh page. section pops , except figured out @ moment when device connection

video - OpenWebRTC test-uri No decoder available for type audio/mpeg and owr_video_renderer_get_element assertion -

compiled openwebrtc, builds own gstreamer. test-send-receive worked fine audio. ubuntu 15.04. launching test-uri test program that: export path=/opt/openwebrtc-0.3/bin/:$path export ld_library_path=/opt/openwebrtc-0.3/lib export gst_plugin_path_1_0=/opt/openwebrtc-0.3/lib/gstreamer-1.0/ test-uri file://$home/videos/small.mp4 the file is: http://techslides.com/demos/sample-videos/small.mp4 the error: ==== warning message start ==== warning in element uridecodebin-1. warning: no decoder available type 'audio/mpeg, mpegversion=(int)4, framed=(boolean)true, stream-format=(string)raw, level=(string)2, base-profile=(string)lc, profile=(string)lc, codec_data=(buffer)1188, rate=(int)48000, channels=(int)1'. debugging info: gsturidecodebin.c(939): unknown_type_cb (): /gstpipeline:uri-source-agent-1/gsturidecodebin:uridecodebin-1 ==== warning message stop ==== got "video stream, id: 0" source! ** error:owr_video_renderer.c:314:owr_video_renderer_get_element:

arrays - Conversion between uint8 and char in C -

i have api implements writing operation eeprom. here declaration: cyble_api_result_t cyble_storeappdata (uint8 * srcbuff, const uint8 destaddr[], uint32 bufflen, uint8 isforcewrite); it working when call function , send array parameter srcbuff has been declared uint8 type. the problem is, need send char array pointer it. thinking char uint8 , compiler warning if send char array pointer function instead of uint8 . why can't use char instead of uint8 ? here 2 examples of calling function: static const uint8 datastack_rom[dedicatedromsize] = {0}; uint8 container_id[10]; char prefix[10]; //call function container_id has been declared uint8. working. cyble_storeappdata(container_id,datastack_rom,10,0); //call function prefix has been declared char. not working. cyble_storeappdata(prefix,datastack_rom,10,0); here warning second call: passing char[10] parameter of type 'uint8 *' converts between pointers integer ty

Equivalent of php_value under Apache + php-fpm -

under apache + php module can set php_value post_max_size 8m inside .htaccess. how can under apache + php-fpm? i'm using fastcgiexternalserver directive, want keep functionality within .htaccess file (if possible). thank you! i've found elegant way it: .user.ini files it seems .htaccess version php-fpm.

plsql - Which is best loop to fetch data from a Cusor in Oracle PL/SQL? -

i learning oracle pl/sql. want know loop best fetching data cursor. , please tell me when should use loop best performance. i rather avoid using explicit cursor , use cursor loop . for example, begin in (select column_list table ) loop <do something> end loop; end; / remember, loop row-by-row a.k.a. slow-by-slow . also, there reason why cursor loop better on explicit cursor. in recent oracle versions, optimized in better way doing bulk collect limit 100 internally. but, it's not bulk collecting , dealing operations subsequently on array have fetched incrementally. further improve performance using forall statement along bulk collect . imo, if possible, in pure sql . because, sql , pl/sql 2 different engines. procedural code handled pl/sql engine while sql handled sql statement executor, or sql engine. there overhead associated each context switch between 2 engines. so, if possible avoid context switching doing in pure sql.

winforms - Spreadsheet Gear migration errors -

i migrating spreadsheet gear of application 6.0.3.190 7.4.1.104.i getting issues color property.can 1 me in this.now using using color = system.drawing.color; , tosgcolor() .this became hectic in places ever use color.i expect should have shortcut this.can 1 suggest me how can functionalities few changes only.i getting exceptions c onvert icolorformat.linecolor system.drawing.color. note " breaking changes " page in spreadsheetgear 2012 documentation, lists particular change: in order support wpf , silverlight, core api has been separated gdi+ , windows forms apis , therefore uses new spreadsheetgear.color type rather spreadsheetgear.drawing.color. spreadsheetgear.drawing.color has been moved spreadsheetgear2012.drawing.dll. see spreadsheetgear.drawing.color example uses implicit , static converters convert between spreadsheetgear.color, spreadsheetgear.drawing.color , system.drawing.color. spreadsheetgear.colors , spreadsheetgear.systemcolors provide

selenium - Issue with global variables in python -

i getting issue global variable declared in python file. not have class declaration in file. declaring variables in class none type. , modifying variables in function. when calling variables inside class importing them, instead of modified value returning none type only. below code from selenium import webdriver pages.pagemethods.google_methods import methods browser = none s = none def before_feature(context, feature): print("before feature") def before_scenario(context, scenario): print('before scenario', scenario.name) context.driver = webdriver.firefox() #context.driver.maximize_window() browser = context.driver global s s = methods(browser) s.samplemethod() def after_scenario(context, scenario): print("after scenario", scenario.name) context.driver.quit() def after_feature(context, feature): print("after feature") ->here calling 's' variable inside class,it returning non

iphone - Create iOS framework using swift -

Image
i trying create ios framework using swift. follow blog , few others output not way want. below original source file public class testclass: nsobject { // publicvar description public var publicvar: int = 0 // dosomething description public func dosomething() { print("dosomething method") } } after adding framework project it's create testframwork-swift.h you can see it's not contain description. want framework header files apple. can me figure out this. not able understand doing wrong. not able add more swift files framework. just use triple slash instead of double slash comments want show in framework headers.

console - Unable to login User credentials -Eucalyptus -

we trying download user credentials entering eucalyptus management console couldn't so.as entering username , password admin management console ,its not accepting , showing error "invalid user/account name and/or password". ports listening. please tell valid data give input account name, username , password.thanks in advance. unable login eucalyptus management console you have entered password during eucalyptus installation. default eucalptus, admin , password. have credentials @ eucarc file too. hope helps !!

ipython notebook requires javascript - on firefox web browser -

i'm trying run jupyter notebook terminal on xfce ubuntu machine. typed in command: jupyter notebook --browser=firefox the firefox browser opens, empty , following error: "ipython notebook requires javascript. please enable proceed." i searched web on how enable javascript on ipython notebook didn't find answer. appreciate lot help. thanks! javascript has enabled in firefox browser turned off. turn on this to enable javascript mozilla firefox: click tools drop-down menu , select options. check boxes next block pop-up windows, load images automatically, , enable javascript. refresh browser right-clicking anywhere on page , selecting reload, or using reload button in toolbar.

objective-c Xcode black screen displays when going to next view controller -

i using parse logins user. when user presses login button displays black screen instead of user profile. code : uistoryboardsegue *loginview = [[viewcontroller_userprofile alloc]init]; [self presentmodalviewcontroller:loginview animated:yes];

Jquery show, hide function does not work -

jquery find function hide , show not work, wrong? <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> $('div').hover(function() { $(this).find('.delete').show(); }, function() { $(this).find('.delete').hide(); }); </script> <div> blah <span class="delete">delete</span> </div> add document ready function script , work <script> $(document).ready(function(){ $('div').hover(function() { $(this).find('.delete').show(); }, function() { $(this).find('.delete').hide(); }); }); </script> explanation: you binding hover function div before div exists. using document ready function, binding of function takes place when div available

python - My text size of a label won't change in kivy -

Image
i'm trying add label widget kv file text size won't change, understand think actual label size changing because label position should @ bottom of screen it's in middle of screen when run script. <leftarea@floatlayout>: label: text: 'search term: ' text_size: 200, 200 size: 200, 200 pos_hint: {'bottom': 1, 'left': 1} ok, fixed it, used markup text label: markup: true text: '[size=20]search term: [/size]' i still don't understand why original code doesn't work if can explain because followed kivy docs.

How to set a Qt groupbox's icons without using stylesheet? -

i know there many threads explaining setting icons of groupbox using stylesheet. want achieve same using else other stylesheet, possible? background: using stylesheets such modifications in ui, changing background color, font, etc.. our sr. architect says using stylesheets not practice, use qpalette instead. able change groupbox's background , using qpalette not getting how set icons. want set 2 icons groupbox, once checked status , unchecked status.

javascript - change in a variable outside angular scope -

beginner in angular + looked @ of complex $watch, $digest , $apply threads around still can't make work. var masterarray = [obj1, obj2, ... ]; this variable not inside angular scope , on plain js , gets updated plain js again outside angular's scope periodically user's interactions. how can capture change in masterarray , , update associated $scope well. app.('mycontroller', ['$scope', function($scope){ $scope.items = masterarray; }]); is there way update $scope.items masterarray changes? thing works when reload page masterarray pushed localstorage everytime it's updated. similar concern - data variable (outside angular) arrives little late callback function server in plain js or jquery angular scopes , variables defined during document load. i couldn't find way update angular scopes associated variables during page load null or empty updated data. some hack should work: app.('mycontroller', fun

java - Spring dont see angular -

i trying adapt app use angular, seems spring cannot see/communicate angular. here have : controller.java: @controller public class indexcontroller { @requestmapping(value = "/login", method = requestmethod.get, produces = {"application/json"}) public @responsebody map<string, object> getindexpage() { map<string, object> model = new hashmap<string, object>(); model.put("id", uuid.randomuuid().tostring()); model.put("content", "hello worl123321"); return model; } } index.html: <!doctype html> <html> <head> <title>title</title> <!--<link href="css/angular-bootstrap.css" rel="stylesheet"> <link rel="stylesheet" href="css/app.css"/>--> <style type="text/css"> [ng\:cloak], [ng-cloak], .ng-cloak { display: none !important;

ios - No visible interface for UITabBarItem when trying to set selectedImage -

i've seen can add selectedimage image uitabbaritem, amended cordova plugin add that: uiimage *tabicon = [uiimage imagenamed:imagename]; uiimage *selectedtabicon = [uiimage imagenamed:selectedimage]; tabicon = [tabicon imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; selectedtabicon = [selectedtabicon imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; item = [[uitabbaritem alloc] initwithtitle:title image:tabicon tag:tag selectedimage:selectedtabicon]; with selectedimage variable being string passed in plugin here: nsstring *name = [arguments objectatindex:0]; nsstring *title = [arguments objectatindex:1]; nsstring *imagename = [arguments objectatindex:2]; nsstring *selectedimage = [arguments objectatindex:3]; int tag = [[arguments objectatindex:3] intvalue]; however when try compile following error: /users/tomchambers/work/cordova-ios-tab-bar/src/ios/cdvtabbar.m:266:34: error: no visible @interface

XSB Prolog meta-interpreter issue with clpr constraints -

i running xsb prolog on mac (el capitan 10.11.2): xsb version 3.6. (gazpatcho) of april 22, 2015 [i386-apple-darwin15.2.0 64 bits; mode: optimal; engine: slg-wam; scheduling: local] [build date: 2016-01-17] i using clpr package , want write little meta-interpreter: :- [clpr]. try((g1,g2)):- !, try(g1), try(g2). try((g1; g2)):- !, try(g1); try (g2). try(true):- !. try({x}):- !, {x}. try(g):- clause(g, body), try(body). however, try({x=1+2}) not work -- not match fourth clause, , descends fifth clause. any idea why? hmm, seems if load file containing code load_dyn(test) code works. (it not work if consult file, i.e. load [test] .

google cloud messaging - Error while trying to upload p12 file to GCM for ios -

Image
i have been trying enable gcm ios client using below link https://developers.google.com/cloud-messaging/ios/client but have been facing issue try upload .p12 file on developer portal while trying configuration file below snapshot of error encountered. if 1 has encountered same, please let me know how solved it. you have more 4 project in google console developer.

java - Enterprise CMS Project in PlayFramework -

i've been shuffling around internet enterprise cms project developed play framework. came across dotcms , not written in play framework. hence, feel not idea. can recommend cms project developed play framework or other cms can integrated play framework. thanks in advance. you try use hippo cms , can find play framework hippo cms integration module on github. if not need enterprise features can configure hippo cms describe in blog post .

c# - Ozeki SDK - Axis camera RTSP authentication failure -

Image
i'm using ozeki sdk c# streaming rtsp axis p1204 camera. when try connect camera, nothing happens , no video streamed. here code i'm using stream video: camera = ipcamerafactory.getcamera("rtsp://192.168.0.90:554/axis-media/media.amp", "root", "pass"); connector.connect(camera.videochannel, imageprovider); camera.start(); videoviewer.start(); i traced network traffic wireshark: seems, ozeki sdk can't login axis p1204. vlc media player, can video stream no problem. any suggestions? the snippet quite short 401 unauthorized response. initially, try access camera enabling anonymous access in basic setup users). depending on ozeki sdk having support basic and/or digest authentication, can configure camera allow password type unencrypted (basic authentication) or encrypted (digest authentication).

java - Error when retrieving from my xml document using xquery -

i trying retrieve authors xml documents of authors have apostrophe's in names results throw error. input: <dblp> <book mdate="2002-01-03" key="books/aw/cerif97"> <author>stefano ceri</author> <author>piero fraternali</author> <title>designing database applications objects , rules: idea methodology</title> <publisher href="db/publishers/aw.html">addison-wesley</publisher> <year>1997</year> <isbn>0-201-40369-2</isbn> </book> </dblp> java/xquery code: public arraylist<string> getarraylistofauthors(){ string query = "for $x in fn:distinct-values(doc(\"" +xml_file_name+ "\")//author) " + "order $x "+ "return $x"; system.out.println("xquery query:"+query); arraylist<string>

release dynamic memory for pointer member in c++ -

i have class: class { a(); ////////something class }; then have class: class b { public: b(); a* member_a; }; b::b() { this->member_a = new a(); } what want this: main() { vector<b> vec_b; int num=1; while(some_condition) { (int i=0; i<num; i++) { vec_b.pushback(b()); } ////////do vec_b; num++; } } i know facing memory leak issue because of new a() in constructor of class b . trying release memory after each while loop, means recycle memory has been taken vec_b , objects of class b in vector, important release memory taken class-a-objects. thank much! that seems should job of b 's destructor b::~b() { delete member_a; } if have access c++11 or later, prefer std::unique_ptr deallocation free class b { public: b(); std::unique_ptr<a> member_a; }; b::b() { member_a = std::make_unique<a>(); }

ios - Always have to set Target Membership for .a File -

Image
i using flyer , crittercism in project . both have libappsflyerlib.a , libcrittercism_v4_3_4.a respectively. now whenever open project , run got error first time. ld: warning: directory not found option '-lapp/model/utility/crittercismsdk' ld: warning: directory not found for option '-lapp/model/crittercismsdk' ld: warning: directory not found option '-lapp' ld: warning: directory not found option '-lapp/model/flyer' ld: warning: directory not found option '-fapp/model/fabric' ld: library not found -lappsflyerlib clang: error: linker command failed exit code 1 (use -v see invocation) to resolve have uncheck , again check target membership project both libappsflyerlib.a , libcrittercism_v4_3_4.a manually.after project running fine. why have set membership .a file manually first time? missing here? because of @trojanfoe 's suggestion right direction solve issue , found happ

node.js - Create Price Range in mongo with aggregation pipeline with Nodejs -

wan't create price range using mongodb aggregation pipeline.. while using elastic search or solr can directly price filter range value... how can create price range according products price, if there no product in range don't create range... { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 1200 }, { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 200 }, { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 2000 }, { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 2020 }, { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 100 }, { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 3500 }, { "_id" : objectid("5657412ddb70397479575d1d"),"price" : 3900 } from above have create price range par produc

javascript - How to Load multiple angular2 components from different folders in one index.html file? -

Image
i have developed few angular 2 components. directory structure application following. and loading each component index.html <script> system.config({ map: { 'rxjs': 'node_modules/rxjs' }, packages: { app: { format: 'register', defaultextension: 'js' }, 'rxjs': {defaultextension: 'js'} } }); system.import('component_1/app/main') .then(null, console.error.bind(console)); </script> what have done , there must 1 index.html , according path provided inside system.config able load different components. able load components if placing index.html inside each components folder,but want use 1 index.html components calling main.ts of each component index.html. following code details. index.html <html> <head> <title>angular 2 typescript app</title> <meta charset="utf-8"> <meta http-equiv=&qu

How to run a java program with multiple classes and packages from command line? -

at moment looking way run java program command line, other adding jar file. program has following number of classes: the name of program file - myprogram main class - server1 second class - client handler package name - items 3rd class - user1 4th class - user2 the main class , client handler alongside package have run first in order user 1 & user 2 run, because client classes , dependent on main class. run java classname. long .class files there java find them. watch out when usin packages, should run java package root , type class name prefixed right package. if have jar files need should specify them -classpath when running java.