Posts

Showing posts from March, 2015

Remove Column from a GridView (VB.NET 2008) -

{vb.net 2008 using northwind microsoft database} how can remove column name id demogrid ? (without using sql code) dim strsql string = _ "select * products categoryid=1" try using adapter new oledbdataadapter(strsql, _ my.settings.oledbconnectionstring) dim ds new dataset adapter.fill(ds, "productinfo") demolist.displaymember = "productname" demolist.valuemember = "productid" demogrid.datasource = ds.tables("productinfo") end using catch ex exception messagebox.show(ex.message) end try you can remove column don't like gridviewname.columns.remove("columnname")

android - Google Cloud Messaging local testing on an external device -

i'm trying implement google cloud messaging app in development. i'm following walkthrough located in readme this github repository (the official google sample project). i'm doing that's asked, i'm confused how test this. far know have backend running computer (i can connect backend localhost:8080 in chrome), want test device registration external device (samsung galaxy s4). realize device cannot try connect 10.0.2.2 because makes device think it's connecting localhost on phone itself. tried entering computer's ip address both ports 8080 , 80, request times out before happens. i'm have correct server api key , sender id. is there might wrong here? how can connect computer phone? i'm willing post code and/or error logs if needed. running linuxmint 17.2 x64. if on same network , type internal ip address of computer followed port number , can test in browser in phone

perl - How can I handle with DBI this command "set Pagesize 50" -

hi trying set pagesize dbi , script fails recommendation how can hndle dbi: $dbh=dbi->connect( "dbi:oracle:", "", "", { ora_session_mode => ora_sysdba , raiseerror => 1, printerror => 1 } ); $dbh->do(qq{ " set pagesize 50" } ); there error: dbd::oracle::db failed: ora-00900: invalid sql statement (dbd error: error possibly near < > indicator @ char 1 in ' < >" set pagesize 50" ') [for statement " " set pagesize 50" "] @ run.pl line 9. dbd::oracle::db failed: ora-00900: invalid sql statement (dbd error: error possibly near < > indicator @ char 1 in ' < >" set pagesize 50" ') [for statement " " set pagesize 50" "] @ run.pl line 9. any idea ? you're quoting things twice in statement on accident. so oracle seeing command sent it: " set pagesize 50" qq{} alternate way of do

relayjs - In a GraphQL/Relay mutation that creates a model, is there a way to get back the model ID? -

we're using relay , graphql in new project. we've got relay mutation creates new model in db: export default class addcampaignmutation extends relay.mutation { getmutation() { return relay.ql`mutation { addcampaign }`; } getvariables() { return { type: this.props.campaigntype }; } getfatquery() { return relay.ql` fragment on addcampaignpayload { campaignedge viewer } `; } getconfigs() { return [{ type: 'range_add', parentname: 'viewer', parentid: this.props.viewer.id, connectionname: 'campaigns', edgename: 'campaignedge', rangebehaviors: { '': 'append', }, }]; } static fragments = { viewer: () => relay.ql` fragment on user { id

c - What can be reason behind of almost all structures being incomplete type in Kernel -

i'm porting functionality kernel whatever reason , came across loads of error messages. of i've fixed. i'm working on header files tune them needs. getting 92 of following error messages: include/linux/dax.h:66:26: error: dereferencing pointer incomplete type include/linux/highmem.h:67:18: error: dereferencing pointer incomplete type include/linux/pagemap.h:66:28: error: dereferencing pointer incomplete type include/linux/backing-dev-defs.h:191:22: error: dereferencing pointer incomplete type include/linux/writeback.h:217:13: error: dereferencing pointer incomplete type include/linux/blkdev.h:972:32: error: dereferencing pointer incomplete type include/linux/fsnotify_backend.h:317:13: error: dereferencing pointer incomplete type include/linux/fsnotify.h:218:12: error: dereferencing pointer incomplete type include/linux/fs.h:776:18: error: dereferencing pointer incomplete type include/linux/backing-dev.h:66:45: error: dereferencing pointer incomplete type any proti

ios - How to change viewController based on device orientation -

for last few days i've been trying figure out way this: change collectionviewcontroller if in landscape mode. change viewcontroller if in portrait mode. pretty way music app behaves. the way did implement viewwilltransitiontosize() in main portraitviewcontroller class: override func viewwilltransitiontosize(size: cgsize, withtransitioncoordinator coordinator: uiviewcontrollertransitioncoordinator) { let storyboard = uistoryboard(name: "main", bundle: nsbundle.mainbundle()) let portraitviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("portraitviewcontroller") as! viewcontroller let landscapeviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("landscapeviewcontroller") as! beercollectionviewcontroller if (uidevice.currentdevice().orientation.islandscape) { // in landscape presentviewcontroller(landscapeviewcontroller, animated: true, completion: nil) } else { /

mongodb - MongoCollection How to get grand children? -

the below query works fine , fetches departments , associations. mongocollection.findone("{name: '"+name+"'}, children: ['departments', 'associations']").as(employee.class); i have sub-children each department - items retrieve along same. not sure how retrieve above query.. tried below doesn't work... mongocollection.findone("{name: '"+name+"'}, children: ['departments', 'associations', 'departments.items']").as(employee.class); how retrieve grand children automatically? how retrieve grand json elements? thanks in advance. example document reference. users.json { "_id":objectid("577a3f7b4309be18d8c40121"), "name":"admin", "email":"admin.guna@gmail.com", "firstname":"guna", "lastname":"g", "password":"bevgi3awgpagf2o6ekuobeq14umdskwpg", &qu

php - Converting multi-dimensional array to a single HTML-like array? -

what fastest or convenient possible way convert multi-dimensional array single html-like array (the method used set name attribute in html forms)? example, $ar = [ 'x' => ['a' => 1, 'b' => 2, 'c' => 3], 'y' => ['yy' => ['yyy' => 3]], 'z' => 3333, 'm' => [1, 2], ]; should converted to: $ar = [ 'x[a]' => 1, 'x[b]' => 2, 'x[c]' => 3, 'y[yy][yyy]' => 3, 'z' => 3333, 'm[0]' => 1, 'm[1]' => 2, ]; here first try: $ar = [ 'x' => ['a' => 1, 'b' => 2, 'c' => 3], 'y' => ['yy' => ['yyy' => '3']], 'z' => 3333, 'm' => [1, 'x'] ]; function convert($key, $value, &$new) { foreach ($value $k => $v)

service - hooked policies returns an empty array, sails -

im tryng make works 2 hooked policies, doesnt. each of these works, , both return next(), then, when supposed pass controller, return empty array instead of list of devices here's config/policies.js module.exports.policies = { '*': ['isauthorized'], // resctricted here 'usercontroller': { 'create': true // dont need authorization here, allowing public access }, 'authcontroller': { '*': true // dont need authorization here, allowing public access }, 'device' : { 'find' : ['isauthorized', 'isowner'] } }; this policies. policies/isauthorized.js module.exports = function (req, res, next) { var token; if (req.headers && req.headers.authorization) { var parts = req.headers.authorization.split(' '); if (parts.length == 2) { var scheme = parts[0], credentials = parts[1]; if (/^bearer$/i.test(scheme)) { token = cred

javascript - Zoom in on hover effect -

i trying create on zoom hover effect , of external created responsive grid smooth zoon in, unfortunately effects behavior of grid if user resizes browser manually in next 3 following links try present how zoom effect achieved , did. this link display how grid worked @ beginning without ccs , javascript yet applied achieve zoom in. codepen.io link if resize browser window works great @ point. here goes css .item-inner { overflow:hidden; } .item-inner img { width: 100%; height: 100%; -webkit-transition: 10s ease; -moz-transition: 10s ease; -o-transition: 10s ease; -ms-transition: 10s ease; transition: 10s ease; } .item-inner img:hover { -moz-transform: scale(1.1); -webkit-transform: scale(1.1); transform: scale(1.1); } codepen.io link at point zooming on hover effect applied , if resize browser width still works fine, cause regardless of overflow: hidden grows in size, later add javascript stop that. javascript time $(documen

c# - MVC 5 Shared Long Running Task -

i have long running action/method called when user clicks button on internal mvc5 application. button shared users, meaning second person can come in , click seconds after has been clicked. long running task updating shared task window clients via signalr. is there recommended way check if task still busy , notifying user it's still working? there recommended approach? (can't use external windows service work) currently doing seems bad idea or wrong , it's feasible. see below sample of doing. public static task workertask { get; set; } public jsonresult senddata() { if (workertask == null) { workertask = task.factory.startnew(async () => { // 2-15 minute long running job }); workertask = null; } else { tempdata["message"] = "data being exported. please see task window status."; } return json(url.action("export", "home"), jsonrequestbehavior.

mysql - No confirmation or error message appearing for php foreach loop sql insert -

i have started learning php , doing php mysql database school named "dat501movie". have created input box user select movietitle (with movieid each movietitle stored option value), , multi select box user select multiple items (in case directorid) directorfistname , directorlastname displayed in display box directorid (for each directorfirstname , directorlastname) stored option value. i want store both movieid , directorid in junction table movie , director tables called director_movietable. but when select mutliple directorfirstname/directorlastname items , press input button "add" no confirmation or error message, telling me if data has been inserted dat501movie database or not, appears. , when check phpmyadmin cannot see new values in database. i grateful if please advise me why not recieving message , why data not being inserted database. below code multiple insert box , code when "add" button selected. <form method="post" a

java - Font issues with Crosscompiled OpenJDK on PPC32 -

Image
i upgrading openjdk-6 openjdk-8 on embedded platform , have problems fonts. we're using dejavu fonts. have created suitable fontconfig.properties file in jre/lib directory, , when list fonts java list follows: dejavu sans dejavu sans condensed dejavu sans light dejavu sans mono dejavu serif dejavu serif condensed dialog dialoginput monospaced sansserif serif the application in question awt application - because running under ppc32 using 0 jvm (haven't installed jamvm yet), shows artefacts when rendering fonts on screen. the issue looks changing background well... embedded system running x11 7.7, freetype, fontconfig, dejavu fonts. how can fonts render correctly inside java? tried xfd, , doesn't show artefacts @ all... fontconfig.properties: # # version version=1 # component font mappings serif.plain.latin-1=dejavu serif serif.bold.latin-1=dejavu serif bold serif.italic.latin-1=dejavu serif oblique serif.bolditalic.latin-1=dejavu serif bold oblique sa

ios - Target Desktops or Target Mobile with Queries? -

currently doing simple parallax effect of background-attachment: fixed , background-size: cover realize ios not want play nice @ background-attachment: fixed @ point given repaint costs well, want mobile/tablet not have background-attachment: fixed @ all. which better, remove background-attachment: fixed mobile or add in desktop. further more, easier media query stand point. repeating same css on , on different devices sounds bad time. also, trying avoid js as possible maintain compatibility can office computers may have disabled.

arrays - Get key names if values is true -

i need keys has value true, , return me key name. question: need use underscore or can not in simpler way? {"desenvolvimento": true, "artigos": false, "design": true} resolved: more simple. <span ng-repeat="(key, value) in item.tax.categorias" ng-if="value">{{key}}</span> simply use in loop , test prop! for(var prop in obj){ if(obj[prop] === true){ // true } } i encourage read through mdn ways can interact objects , arrays https://developer.mozilla.org/en-us/docs/web/javascript/reference/statements/for...in

javascript - How to filter by an array in AngularJs ng-repeat? -

i using ng-repeat display data. working fine. one of data fields in ng-repeat result set array of items. example: {x:1, y:[2,3,4]} filter data data in array. can filter non array data, having trouble when try filer looking inisde in array. here markup ng-repeat = "con in cons | filter: usrsingle.username in con.conplayerlist" (edited markup match example better ng-repeat = "con in cons | filter: '3' in con.y" ) usrsingle scope in controller can access. don't errors , can't seem find examples of this. more code requested , here below. forgot mention mean app. have mongodb serving data. use rest api data calls. (edit) code angular module: // call api data app.factory('usrservice', function ($resource) { return $resource('/api/users', {}); }); // factory hold user data between controllers app.factory('usrtracker', function () { var vusrprofile = { usrsingle: 'usrsingle' }; return { getpropert

Standard Array,Set,Dictionary variable creation ways Swift programming language -

i'm beginner in swift language. there many ways declare/create variables in it. please fill code below. want know ways can declare arrays, sets , dictionaries. var arr1 : [int] var arr2 = [int]() var arr3 : array<int> var arr4 = [1,2,3,4] var arr5 : array = [1,2,3,4] var arr6 : [array<int>] var dict1 : [int:int] var dict2 = [int:int]() var dict3 : dictionary<int,int> var dict4 = [1 : 2,3 : 4] var dict5 : dictionary = [1 : 2,3 : 4] var dict6 : [dictionary<string, int>] var dict7 = [dictionary<string, int>]() var dict8 = dictionary<int,int>() var set1 : set<int> var set2 = set<int>() var set3 : set = [1,2,3] var set4 : [set<int>] var set5 = [set<int>]() your listing contains forms declare declare , initialize variable two alternative forms of latter array , dictionary var arr7 : [int] = [] // same arr2 var dict9 : [int:int] = [:] // same dict2, dict8

okio - Streaming okhttp response body -

i'm implementing server-sent events library using okhttp. server sent events works keeping open http connection server on 'events' can streamed client. connection close on errors, or if client explicitly disconnects. what's best way achieve streaming behaviour using okhttp? i've attempted like: response.body().source().readall(new sink() { @override public void write(buffer source, long bytecount) throws ioexception { log.d(tag, "write(): bytecount = "+bytecount); } @override public void flush() throws ioexception { log.d(tag, "flush()"); } @override public timeout timeout() { return timeout.none; } @override public void close() throws ioexception { log.d(tag, "close()"); } }); with approach see log message in write() , can take quite while (minutes). makes me think there might buffering going on under hood , don't data until buffer flushed. i've used curl verify server be

paypal - Braintree iOS Drop-in Payment UI customization -

Image
i using drop-in payment ui in ios. using sdk subscription purpose. @ time of adding new card, drop-in ui shown "pay card" text, not correct text in case user not paying @ time, subscribing service. there way change text? please check below screen shot highlighted text. full disclosure: work @ braintree. if have further questions, feel free contact [support][support]. there no way change text or access fields in drop-in ui. have more control on interface, developer docs client-side payment processing have instructions on how tokenize payment information without drop-in ui.

Ionic plugin for Netbeans? -

i'm looking way work ionic framework on netbeans. found project in github here: https://github.com/hexaviewtech/ionic-netbeans-plugin can't install it. i'm following how install of plugin here browse downloaded ionicextention file , click ok button file ionicextension not exist. how install ionicextension netbeans ? the ways can see file not exist didn't download or downloaded saved directory somewhere other looking. download http://plugins.netbeans.org/download/plugin/3749 the file should named: 1436530602_com-hexaview-ionicextension.nbm it in downloads directory although depends on browser , preferences.

TinyMCE: How can I change the formats ("Paragraph", "Heading 1", etc.) -

by default tinymce (4) has "paragraph ▼" dropdown, , if click on list of formatting options ("paragraph", "heading 1", etc.). i'd able 2 things. first, want change options , names (eg. "normal" , "heading"), , found block_formats option that: block_formats: 'normal=p;heading=h1' however, i'm stuck on thing #2: adding classes generated elements. instead of plain <h1> elements, when picks "heading" want generate <h1 class="heading"> . i thought maybe work: block_formats: 'normal=p;heading=h1.heading' ... doesn't, , haven't been able find other option let me this. again, tinymce documentation isn't easiest place find answers, why came here. does know how configure tinymce have "paragraph ▼" dropdown customized names , custom classes on generated elements? i never did find way this, wound doing instead remove block format drop-down

AngularJs - Disable input on table dependent upon top row selection -

i trying make tables input elements disabled below top (master) row if "active" or "engaged" boolean set true on top row. not want them loose data below top row when set true, disable it. if user sets "active" && "engaged" false on top row want them able edit data below top row again. there easy way angularjs? here example: https://jsfiddle.net/7kg6kuzm/2/ <body ng-app="test" ng-controller="appctrl"> <p>{{test}}</p> <table class="table table-bordered"> <thead> <tr> <th class="border-less"></th> <th>people</th> <th>active</th> <th>engaged</th> <th>town</th> </tr> </thead> <tbody> <tr ng-repeat="(month, info) in months"> <td><p>{{month}}</p>&

android - How to call getMapAsync() from an activity -

i trying call getmapasync() activity got error: error:(109, 14) error: cannot find symbol method getmapasync(categoryactivity) public class categoryactivity extends activity implements view.onclicklistener,onmapreadycallback { protected void oncreate(bundle savedinstancestate) { //requestwindowfeature(window.feature_no_title); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_map); mapfragment mapfragment = (mapfragment) getfragmentmanager().findfragmentbyid(r.id.mapcontainerlayout); mapfragment.getmapasync(this); } try defining private class implementing onmapreadycallback interface , passing object.

assembly - Copy values from original array into a new one -

recently i'm learning assembly language , using arm assembler keil tool. , came across problems online. requires code copy values sourcearray(listed below) , writes destination array while removing duplicates. not understand quite clear how copy array? hope can help.. edit: while i'm asking i'm trying figure out on own, appreciate giving me example. and, not assignment. it's pure self-study. sram_base equ 0x40000000; start of address area reset, code, readonly entry stop b stop sourcearray dcb 2,44,66,66,1,1,4,10,3,10,23,1,23,255,254,2,2,3 asize dcb (asize-sourcearray) end

Xamarin error on visual studio -

Image
i install xamarin on visual studio , when want create blank app project gives error :object refrence not set instance of object. this out put: enter image description here looks didn't install (right) android sdks. go tools > options , find 'xamarin' page. go 'android settings' , check if sdk path found. if these aren't filled correctly should install them. easiest download installer xamarin or reinstall visual studio (through add/remove applications , edit visual studio installation). you can install , manage seperate sdks using android sdk manager. can find under tools > android > android sdk manager . in next screen can install sdks want use according emulator images, etc.

java - Error with import com.google.android.maps.* package from Eclipse to Android Studio -

hi guys have problem after exported project eclipse android studio have problem import com.google.android.maps.* package, don't recognise it. tried lot of things found, doesn't work me. touchedlocationoverlay.java package util; import java.util.arraylist; import android.graphics.drawable.drawable; import android.os.bundle; import android.os.handler; import android.os.message; import com.google.android.maps.geopoint; import com.google.android.maps.itemizedoverlay; import com.google.android.maps.mapview; import com.google.android.maps.overlayitem; public class touchedlocationoverlay extends itemizedoverlay<overlayitem> { private arraylist<overlayitem> moverlays = new arraylist<overlayitem>(); private handler handler; public touchedlocationoverlay(drawable defaultmarker, handler h) { super(boundcenterbottom(defaultmarker)); // handler object instantiated in class mainactivity this.handler = h; } //

android - sharedPreferences change listener in fragment not firing -

i have following oncreateview fragment public static final string sharedpreferences = "crmpreffiles"; public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { // inflate layout fragment final view layout=inflater.inflate(r.layout.fragment_item_fragment1, container, false); sharedpreferences prefs = getactivity().getsharedpreferences(sharedprefefrences, 0); sharedpreferences.onsharedpreferencechangelistener listener = new sharedpreferences.onsharedpreferencechangelistener() { public void onsharedpreferencechanged(sharedpreferences prefs, string key) { populatepage(layout); } }; prefs.registeronsharedpreferencechangelistener(listener); return layout; } in activity uses fragments preferences edited values grabbed via webservice call. why use onchangelistener. fragment created before preferences edite

android - Detect Screen Off / On in Cordova and Ionic -

i want detect when phone locked , unlocked. the plan display (non-ad) popup when phone unlocked. far cordova seems support pause , resume events not me functionality need. native android supports screen on/off , user present events. possible use these events , if not possible build plugin gain same functionality? thanks in advance. for android have use plugin template create background service can listen events: https://github.com/red-folder/bgs-sample on ios there plugin implements functionality if deploy on ios: https://github.com/ttatarinov/lock-screen-logger-phonegap-plugin

php - How to load my plugin file on joomla's back-end? -

Image
i have developed joomla extension , want load php file within extension directory onto joomla's back-end (admin page). for developing extension, have followed developer document of joomla , install on instance of joomla. located @ administrator\components\com_myextension picture below: note: root folder of joomla jstore for intention, achieve result have define behavior in xml file myextension.php file can included whenever admin page viewed or write function include myextension.php file when extension installed. neither way don't know how yet! in conclusion, want achieve load file myextension.php whenever joomla's admin page loaded. , must automatically. regards, dung tri i have figured out new way run php script after plugin activated. the way develop system plugin joomla. system plugin support functions can automatically run when admin page viewed like: onafterinitialise, onafterroute, onafterdispatch, onbeforerender. you can see tuto

c# create instance of Excel workbook from console application -

i have visual studio solution contains 2 projects (1) c# console application; , (2) c# excel workbook. the console application creates data, pass workbook. to have created method in excel workbook project, receives data console application. however, cannot create instance of excel book. @ moment trying: excel.application excelapplication = new excel.application(); excel.workbook excelworkbook = excelapplication.workbooks.add("mybook.xls"); i hard code path xls file, don't want prefer wrap single .exe any ideas? so you're asking how wrap 2 files (an exe , excel file), single exe. there simple (and clumsy) way of doing revolves around using resources in c#, meaning program have similar following: take excel file source out of resources , , write file when program run (temporary file) use current directory + excel temp file name feed worksheet.add method once edited, store temporary file's data resources of exe. another possibility

Apache PDFBOX - getting java.lang.OutOfMemoryError when using split(PDDocument document) -

i trying split document decent 300 pages using apache pdfbox api v2.0.2. while trying split pdf file single pages using following code: pddocument document = pddocument.load(inputfile); splitter splitter = new splitter(); list<pddocument> splitteddocuments = splitter.split(document); //exception happens here i receive following exception exception in thread "main" java.lang.outofmemoryerror: gc overhead limit exceeded which indicates gc taking time clear heap not justified amount reclaimed. there numerous jvm tuning methods can solve situation, however, of these treating symptom , not real issue. one final note, using jdk6, hence using new java 8 consumer not option in case.thanks edit: this not duplicate question of http://stackoverflow.com/questions/37771252/splitting-a-pdf-results-in-very-large-pdf-documents-with-pdfbox-2-0-2 as: 1. not have size problem mentioned in aforementioned topic. slicing 270 pages 13.8mb pdf

terminal - Difference between ls -l and dired (in emacs) -

what difference between ls -l , dired function in emacs? by itself, ls -l listing ( data ), dired program lets see information , use filenames , properties in commands. while use data in various ways, dired provides collection of useful ways might want use data. further reading: 30 dired, directory editor 30.5 visiting files in dired

Unable to archive iOS app after updating to Xcode 7.3 -

i'm having problems archiving ios swift application since last xcode update (xcode 7.3), application builds , runs correctly in debug mode try archive following error: no such module "realmswift" although references realmswift fails randomly importing or other pod. the strange point downgrading xcode 7.2.1 , command line tools 7.2 doesn't fix problem. i've clean cocoapods cache, removed ~/library/developer folder, removed pods folder within project folder. trying archive different machine doesn't work. rolled version of app released on crashlytics , therefore archived in past same result. any thoughts wrong?

javascript - html required not being set -

html required not being set inputs. submitting forms using onclick ,not submit input type. form submits without content in input <form action="ordercomplete.php" method="post"> <div id="supercon"> <?php $url="ordersummary.php"; //left arrow previous page echo"<div id=\"leftb\" onclick=\"location.href='".$url."';\" style=\"cursor: pointer;\">"; echo'<span class="centerer"></span>'; echo'<img class="centered" src="arrows.png">'; echo'</div>'; ?> </div> <!--delivery details --> <div id="conphp"> <p id="centerp">please enter details</p> <p id="conphpp"> >name: <br/> <input type='text' name='nam

apache spark - Accessing client side objects and code -

a spark applications needs validate each element in rdd. given driver\client side scala object called validator , of following 2 solutions better: rdd.filter { x => if validator.isvalid(x.somefield) true else false } or like // list of field validate against val list = rdd.map(x => x.somefield) // use validator check ones invalid var invalidelements = validator.getvalidelements().diff(list) // remove invalid elements rdd rdd.filter(x => !invalidelements.contains(x.somefield)) the second solution avoids referencing driver side object within function passed rdd. invalid elements determined on client, list passed rdd. or neither recommended? thanks if understand correctly (i.e. have object validator ), that's not driver code, because job's jar distributed workers. scala object define instantiated in executor jvm. (that's why don't receive serialization exception in contrast using methods defined in job, e.g. in spark streaming checkpoint

How to play audio on Chrome extension? -

Image
i writing mini addon chrome. in addon, have inserted code play audio ajax success. doesn't work websites use https , works fine on websites use http . can me edit it. manifest.json mystyle.js for full resolution of images: http://i.stack.imgur.com/x8f5q.png http://i.stack.imgur.com/7bx5i.png at first glance, there 2 issues code: you shouldn't put chrome.tabs.getselected , chrome.browseraction in mystyle.js . mystyle.js content script , can access limited chrome api. however, content scripts have limitations. cannot: use chrome.* apis, exception of: extension ( geturl , inincognitocontext , lasterror , onrequest , sendrequest ) i18n runtime ( connect , getmanifest , geturl , id , onconnect , onmessage , sendmessage ) storage use variables or functions defined extension's pages use variables or functions defined web pages or other content scripts you can't send http request https web page, si

How to use the Python script in Matlab to call the variables which defined in Matlab workspace? -

in matlab, variables can defined, example: >>global x y >>x = 1; >>y = 2; then, try call variables x , y in pre-defined python script f() as: def f(): global x y return x + y however, when run python script in matlab: >>py.f.f >>ans = >> 0 it returns 0 , expected value should 3 .

How do I remove the file extension from URLs in nginx? -

let's have file named careers.php , how serve file when click link goes http://example.com/careers without file extension both .html , .php files nginx ? please note solution has account query strings. instance, url may http://example.com/careers?lang=fr . also, i'd solution try subdirectories well. instance; if folder structure on server /views/careers.php , want http://example.com/careers still serve /views/careers.php . my current configuration looks following: server { listen 80 default_server; root /usr/share/nginx/landing-page; index index.php index.html; server_name example.com; location / { try_files $uri $uri/ =404; } error_page 404 /404.html; error_page 500 502 503 504 /50x.html; location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_param script_filename $docume

c++ - CreateRenderWindow() crashed when specify a Qt Window in Ogre -

Image
my app divided 2 modules, 1 game world driven ogre, while gui module implemented using qt. on app startup create qapplication instance , blank qwindow, put qwindow widget. code this: ``` qapplication qapp(argc, argv); // class gameworld_widget subclass of qwindow no other content ui::gameworld_widget *mainwnd = new ui::gameworld_widget; qwidget mainwndcontainer; mainwndcontainer.setobjectname("ogre222"); mainwndcontainer.resize(800, 600); mainwndcontainer.createwindowcontainer(mainwnd); mainwndcontainer.show(); ``` then create thread create , initilize ogre module elsewhere , pass 'mainthread' control qt. ``` // hwnd of gameworld_widget in 'main thread' auto hmainwnd = reinterpret_cast<hwnd>(mainwnd->winid()); std::thread gameworldthread([hmainwnd]() { try { game_world gameworld(hmainwnd); // see below } catch (game_world_exception &ex) { std::cout << "gameworldexception occurs\n"; return; } }); gameworldthread.de

javascript - Set click as default -

i´m using megafolio filter category clic, want set default category when page loads, how can that? there filter function function completegallerycontent(data, target, eng) { var items = data.d.results; console.log(items); var menu = ""; var cat = ""; (var item in items) { if(items[item].descriptionenglish==null) items[item].descriptionenglish=""; if(items[item].description==null) items[item].description=""; if(items[item].categoria.results!= null && items[item].categoria.results!= undefined && items[item].categoria.results.length > 0){ cat =setcategories(eng,items[item].categoria.results); } if (eng){ menu += "<div class='mega-entry " + cat + " cat-all' id='mega-entry-1' data-src='" + items[item].encodedabsurl + "' data-width='' data-height='' data-lowsize=''><div class='mega-covercaption meg

Can a progressive web app be registered as a share option in Android? -

total newbie question. tl;dr - can progressive web app registered share option in android? in android, can “share” things other installed android apps. example, let’s have chrome android , google+ app installed on android device. can share web site viewing in chrome google+ going chrome’s hamburger menu → share… → google+ (with list of other installed native apps). can progressive web app registered in list of installed native apps? if yes, can show me examples or code labs? if no, feature in progressive web app or android’s roadmap? no unfortunately that's not possible. the intent system useful native apps. the thing can create urls parsed intents on android device , passed native apps can't go other way around, i.e. native app -> trigger intent -> web app. main barrier there no way web app indicate can handle intent (done in native apps via androidmanifest).

java - Primefaces DataTable display only the last item -

the datatable displaying last item added, seems every time press commandbutton method rewrites list, can avoid that? jsf <p:commandbutton action="#{productobean.setpedidoactual()}" value="agregar" update="dt"/> </p:panelgrid> <p:datatable value="#{productobean.pedidoactual}" var="pedi"> <p:column headertext="nombre"> <h:outputtext value="#{pedi.descripcion}"/> </p:column> </p:datatable> bean public void setpedidoactual() { producto pro = productofacade.find(idproducto); listpedidoactual.add(pro); } public list<producto> getpedidoactual() { return listpedidoactual; } your setpedidoactual() method seems receive 1 item based on facade service find(idproducto) , correct? have checked remote service returns? there in fact 1 record. beside that,

Observing Multiple NSKeyObservingKeyValueoptions swift -

how observe multiple nskeyobservingkeyvalueoptions in swift self.avplayeritem.addobserver(self, forkeypath: "status", options:[.initial | .new], context: nil) i error error no '|' candidates produce expected contextual result type 'nskeyvalueobservingoptions' change self.avplayeritem.addobserver(self, forkeypath: "status", options:[.initial | .new], context: nil) to: self.avplayeritem.addobserver(self, forkeypath: "status", options:[.initial, .new], context: nil)

Python: How to POST a .bin file -

i trying write python program http post file in order upgrade dd wrt router's firmware. i can't believe how difficult has been. i have tried library after library: requests, urllib, mechanize, poster, etc all want submit form 1 input (erase=0) , ddwrt-upgrade-file.bin! also, basic auth required. can me out here here capture fiddler of working post submitted myself using chrome: ------webkitformboundaryhunea7lutbbt3jfn content-disposition: form-data; name="submit_button" upgrade ------webkitformboundaryhunea7lutbbt3jfn content-disposition: form-data; name="action" ------webkitformboundaryhunea7lutbbt3jfn content-disposition: form-data; name="change_action" ------webkitformboundaryhunea7lutbbt3jfn content-disposition: form-data; name="submit_type" ------webkitformboundaryhunea7lutbbt3jfn content-disposition: form-data; name="erase" 0 ------webkitformboundary

bash - Grep filename with unknown name -

using ubuntu linux want find file filename unknown. all know filename verify..something , has .php extension. i try grep verify /home/myuser did not find try current directory if name starts verify , ends .php : find . -iname 'verify*.php'

Why does nth_value function in BigQuery on display for rows >= n? -

code below produces result variable nt4 null rows 1,2, , 3. looks strange. bug? value should 'of' of rows in window function. select word, word_count, corpus, nth_value(word,4) on (partition corpus order word_count desc) nt4, rank(word) on (partition corpus order word_count desc) rank [publicdata:samples.shakespeare] this not bug. expected the reason - if use order without specifying rows or range, order implies window extends beginning of partition current row. see window functions details meantime, quick explanation: for example, " kinghenryviii " partition first row has window 1 row word - " the " second row has 2 rows in window - " the " , " i " third - " the ", " i " , " and " so far see there no 4th row here value null for forth row thare 4 rows in window - " the ", " i ", " and " , " of " fifth - " the &quo

php - Symfony 3: Can't make relations work -

i have entity(s) , entityhtml(s) entities has one-to-one relashionship ( entity stores metadata , entityhtml acts cache, storing ready html chunks rendering). i have defined relationship in entity class : /** * @orm\onetoone(targetentity="entityhtml") * @orm\joincolumn(name="entityid", referencedcolumnname="entityid") */ private $entityhtml; but isn't working. have kind of feeling, annotations don't work @ all, because changing them has no effect upon workability of application. on other hand, messing .orm.xml(s) reflects in how application works. can tell symfony update orm xmls based on changes annotations? should duplicate relation meta xml? does symfony use info @ both xml , annotations or choose 1 source? config.yml default one: # doctrine configuration doctrine: dbal: driver: pdo_mysql host: "%database_host%" port: "%database_port%"

javascript - Fetch initial page data with ReactJS + Redux + Cloud Endpoints -

i use reactjs + redux + google cloud endpoints. now, initial page load have fetch , display data via cloud enpoints. how accomplished? full code examples appreciated! you mount app blank slate, overlays, or loading spinners, , fetch data inside componentdidmount() . the react docs . load initial data via ajax fetch data in componentdidmount. when response arrives, store data in state, triggering render update ui. when fetching data asynchronously, use componentwillunmount cancel outstanding requests before component unmounted. this example fetches desired github user's latest gist: var usergist = react.createclass({ getinitialstate: function() { return { username: '', lastgisturl: '' }; }, componentdidmount: function() { this.serverrequest = $.get(this.props.source, function (result) { var lastgist = result[0]; this.setstate({ username: lastgist.owner.login, la

Protractor Running exe with child_process -

Image
i'm trying simulate upload file protractor know protractor can't interact os window , created exe file ( with autoit ), takes focus , insert file . when i'm testing manually working ok . when try write in protractor error this protractor code ( using child_process ) -- see pic here error massage tried using : no luck!! you don't need autoit upload files. send full absolute path file want upload upload input. if running tests selenium grid need use filedetector send file node test running: var filedetector = require('selenium-webdriver/remote/index.js').filedetector; browser.setfiledetector(new filedetector()); var path = require('path'); var filetoupload = '../yourfile.txt', absolutepath = path.resolve(__dirname, filetoupload); $('hiddenfileuploadinput').sendkeys(absolutepath) here question has answers might help: how upload file in angularjs e2e protractor testing

objective c - UITableView Rounded Custom Cells (w/ image) -

Image
i have quite daunting challenge. want make this: so: i use table (plain not grouped cells). cells must have rounded corners & shadow. i prefer use cgrect draw cells instead of using images (for speed & space economy). the cells in basic form cell 1 , have checkboxes cell 2 . tutorials use images background rounded cells never touch on point sliding cell reveal actions . think using image entire frame of cell slide , awkward. how can overcome? is possible mix cells ? regarding adding checkboxes though of 2 ways. either extend entire cell downwards , add checkboxes & text or add 2nd cell type made checkboxes (i prefer option don't know if it's possible mix cell types). note: cell entire rounded rectangle, not upper part (the upper part title). grey line style , image. i won't ask specific way of doing this. each has it's own way of doing things. if know how 1 of things above (except creating table view :) ), please me (but keep in mind m

iOS App Terminating due to uncaught exception with no stack trace (Swift) -

i writing code animating ui elements in app. app worked fine until changed alpha on ui elements, when got error: libc++abi.dylib: terminating uncaught exception of type nsexception there no stack trace or indication of error might in output, signal sigabrt pointing appdelegate class. the app worked on previous build , changed after alpha settings, undid try , debug situation. have tried disabling parts of code modified such game center , have tried setting breakpoints cannot app work. my question - error , coming from? here code modified if need see it: //this code called in game center authentication method uiview.animate(withduration: 0.5, animations: { self.pointsindicator.center.x += self.view.bounds.width // self.pointsindicator.alpha = 1 }) uiview.animate(withduration: 0.5, delay: 0.3, options: [], animations: { self.pointslabel.center.x += self.

Ionic: Authentication not persistent when merging to firebase v3 -

i'm merging ionic app firebase v2 firebase v3. when use new (v3) firebase email/password login api, not authenticated have log in every time app re-started. the user should stay authenticated when first logged in app. or @ least default in firebase v2 api. how can persist login? thanks, jørgen you should use onauthstatechanged() . function called time there's change in authentication state. firebase.auth().onauthstatechanged(function(user) { if (user) { // user signed in. ... other stuff } else { // no user signed in. ... other stuff } }); if logged in when open app, or call signinwithemailandpassword , function called , user contain firebase.auth().currentuser .

git - Pushing a branch to UPSTREAM after accidentally -

so there 2 remotes configured. my fork(origin) -> origin git@github.com:anirudh/testrepo.git the main repo fork made.(upstream) -> upstream https://github.com:anirudh/testrepo.git i made made feature branch no remote pre-configured , accidentally pushed upstream git push upstream now branch there on upstream undesired wanna push origin , delete branch in upstream what's safest way it? its more simple think: # create new branch desired name: git checkout -b <branch name> # push desired branch git push origin <branch name> # delete wrong branch upstream git push upstream --delete <branch delete> as best practice should add desired branch name pull/push. read on why. here git v2.0 release notes explain change in way git treat push (simple vs matching). updated in git v2.0 fix default git push behavior. prior git v2.0 when executed git push have pushed changed branches ( all , not current branch). git v2.0 re