Posts

Showing posts from June, 2014

key value store - DynamoDB Schema Design - Order Model -

i modeling simple application use dynamodb storage. need store order ecommerce website. possible query using order_id , user email. looking @ dynamodb documentation, think best approach user order_id (most of queries made on index) primary key (partition key). and email? secondary index, bit lost. best approach? it looks global secondary index on email attribute solve problem: when need lookup order_id , use getitem operation , specify order_id primary key when need lookup email , use query api on gsi , specify email partition key. gsi have independent read capacity units - since said use order_id of time, provision more rcu main table gsi. reference: http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/gsi.html http://docs.aws.amazon.com/amazondynamodb/latest/apireference/api_getitem.html http://docs.aws.amazon.com/amazondynamodb/latest/apireference/api_query.html

javascript - Swapping elements in Angular JS -

i curious appropriate way animate , swap elements using angular. have two-dimensional array has nested ng-repeat create table. end goal have 2 elements in table swap places using animation, hover on eachother's positions. i have function swaps position of 2 jquery elements, doesn't update array , angular array no longer synced displayed. find animation hangs little when moving elements between rows whereas columns smooth. ie. [0][0] -> [0][1] smooth , [0][0] -> [1][0] hangs jquery.fn.swapwith = function (to, callback) { animating = true; thispos = this.position(); topos = to.position(); $.when(this.animate({ top: topos.top, left: topos.left }, 300), to.animate({ top: thispos.top, left: thispos.left }, 300)).done(function () { animating = false; if (callback) { callback(); }

ihaskell - How to install custom libraries, and use them? -

i have been trying install libraries, csv , hs-gchart . know ihaskell has alternatives charting wanted try install something. i'm using gibianski's docker image. i tried cabal install in docker container, results docker not installed ssh'd container , installed it. still cannot import of these libraries. then tried install stack build csv hs-gchart , still no luck. what straightforward/correct way install library , use ihaskell notebook? after talking andrew gibiansky on ihaskell's gitter, recommended me fork/clone repo, add stack install <library> in dockerfile , , docker build -t my-ihaskell /path/to/the/ihaskell/repo . after docker run my-ihaskell . now libraries work expected. ( hs-gchart fails, thats story)

c# - Does the eager Include function call data in-memory? -

i reading this answer , realized i'm not clear on how eager loading works in in-memory lifecycle of iqueryable . say have db.customers.include("orders") , generates object graph this: customer order order order if don't enumerate return include load data in-memory? that is, does iqueryable<customer> customerswithorders = db.customers.include("orders"); imply customer collection (and orders ) has been brought in-memory eagerly included orders ? or, "eagerness" mean if/when customer collection enumerated, orders brought in-memory well? there's 2 things going on here. first, no query submitted database until operation done requires execution of query. example, if like: var foos = db.foos.where(...); no query has been issued yet. however, if like: foreach (var foo in foos) { ... } then, query sent database. other things cause query executed things calling tolist() , count() , etc. basically, w

database - Issues on update/insert a field that the data type is SINGLE -

i can't believe in happening , simple prove issue. need execute code below access db using dao. create table table1(field1 single) insert table1 (field1) values(9.99) then select * [table1] the result field1 = 9,98999977111816 that big deal because if insert 2000 rows , sum field, value starting far , far expected sum of values. adding more information, currency have fieldsize = 15 store, single have fieldsize = 7 store, need use single because storage limit important me. solutions good. speculate lose time. true not deserve down votes. and issue, have same problem? documented issue? lets talk abou behavior, me? currency uses 15 bytes store no, doesn't. uses 8 bytes store , accurate 15 digits left of decimal point (ref: here ). single uses 7 bytes no, uses 4 bytes. however, floating-point representation , hence has limitations of any floating-point data type described here: is floating point math broken? if storage space requ

Twitter Streaming in Python: cp949 codec -

i using tweepy gather data using streaming api. here code , ran on acaconda command prompt. when streaming starts, returns tweets , after giving few tweets gives following error: streaming started ... rt @ish10040: crack dealer released prison obama murders woman , 2 young kids… exception in thread thread-1: traceback (most recent call last): file "c:\users\jae hee\anaconda2\lib\threading.py", line 801, in __bootstrap_inner self.run() file "c:\users\jae hee\anaconda2\lib\threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) file "c:\users\jae hee\anaconda2\lib\site-packages\tweepy\streaming.py", line 294, in _run raise exception unicodeencodeerror: 'cp949' codec can't encode character u'\xab' in position 31: illegal multibyte sequence i believe has encoding used chcp 65001 deal issue not give solution! here code auth = tweepy.oauthhandler(consumer_key, consumer_secret) auth.set_acce

php - Symfony 2.8 security setup with LightSamlPhp Bundle - Multiple Login Methods -

i running issue setting authentication in symfony 2.8 saml plugin ( https://www.lightsaml.com/sp-bundle/getting-started/ ). problem: want able login via saml , via going admin page. /admin/login page works fine, see user authenticated database. however, when try go through saml process, land on /discovery page. when see logs, user authenticated. so, think have not correctly in security settings. please let me know if can help here settings config/security.yml file: firewalls: dev: pattern: ^/(_(profiler|wdt)|css|images|js)/ security: false login_firewall: pattern: ^/saml/login$ anonymous: ~ discovery_firewall: pattern: ^/saml/discovery$ anonymous: ~ secured_area: pattern: ^/ anonymous: ~ light_saml_sp: provider: db_provider # user provider name configured in step 9 #user_creator: user_creator # name of user creator service created in step 10

Use C++ code in xamarin Android, iOS and UWP -

i have xamarin project runs on android, ios , windows phone 10. project write in c#. , want add c++ in solution , each project can use c++ function interrop. can add c++ project on android , ios adding shared library but can not add uwp project. if want use c++ library need use windows runtime component. want 1 shared code android, ios , uwp, think need create dynamic or static library not know how reference in uwp project.

XMLHttpRequest is not defined when testing react-native app with jest -

i trying test apiwrapper in react-native based app using jest (integration testing). when run in ios simulator runs fine wont run jest tests correctly - get: referenceerror: xmlhttprequest not defined when try run tests using api wrapper, eg.: it('login successful correct data', () => { let api = api.getinstance(); return api.login("test", "testpass") .then(result => expect(result).toequal('login_successful')); }); the api class trying test here use fetch api (not vanilla xhr). assume related jest trying mock have not found way make work yet. thanks in advance. i had similar problem lokka using xmlhttprequest . made mock lokka , api wrapper class depends on. try mocking api wrapper. this lokka mock looks now. i'll add more when start testing error handling. export default class { query() { return new promise(resolve => { resolve(200); }); } } you might able mock api wrapper si

typescript - React-Bootstrap Definitely Typed: Error TS2309: An export assignment cannot be used in a module with other exported elements -

i've upgraded typings react-bootstrap , i'm getting error: error ts2309: export assignment cannot used in module other exported elements. on line: declare namespace reactbootstrap { // import react import react = __react; //definitions omitted } declare module "react-bootstrap" { export = reactbootstrap; //error ts2309: export assignment cannot used in module other exported elements. } is definition file wrong or doing wrong? ok, in case had written own definitions, because missing typed typings: custom.d.ts: declare module "react-bootstrap" { // import react import react = require("react"); // <inputgroup.addon> interface inputgroupaddonprops extends react.htmlattributes { } class inputgroupaddon extends react.component<inputgroupaddonprops, {}> { } } the definitions typed looking this: declare module "react-bootstrap" { // import react imp

wordpress - Set woocommerce in localhost -

Image
i want set woocommerce in localhost working in server. donwloaded files , have database file. created floder in xamp/htdocs , put woocommerce files inside folder.i connect database editing thw wp-config file appropriate local db details.now im getting page not found error. you didn't mention had wordpress installed on machine inside /www . hope have... first ensure wordpress site working properly. can connect localhost/wp-admin or localhost/wp-login.php ? next go plugin tab , click on add new . have list of plugins may install. click on search box on right side , write woocommerce . end selection of results. next click on install (mine installed says update now ...) that's it, don't need touch inside db

ionic framework - Use href to redirect to tab in angularjs -

i'm trying ionic tab template. got stage have second-level tab in 1 of main tabs. .state('tab.leaderboard', { url: "/leaderboard", abstract:true, views: { 'tab-leaderboard': { templateurl: "templates/tab-leaderboard.html", controller: 'leaderboardctrl' } } }) .state('tab.leaderboard.players', { url: "/players", views: { 'leaderboard-page': { templateurl: "templates/players-leaderboard.html", controller: 'playersctrl' } } }) .state('tab.leaderboard.teams', { url: "/teams", views: { 'leaderboard-page': { templateurl: "templates/teams-leaderboard.html", controller: 'teamsctrl' } } }) if use direct link tab tab.leaderboard.teams , url on address bar changes, bar title changes content not loading , current page made call stays opened. however if click on link tab.leaderboard.teams , works perfectly

DB2 Database Documentation Tool -

i'm looking tool ibm db2 z/os can automatically document our database , represent in nice way such html document etc. with our sql databases using redgate tool called sql doc , looking similar that. has experience tool might me? thanks in advance! html formatting want it, getting database documentation easy 1) adding comments tables , columns comment on schema.table (column_name 'documentation column_name'); and 2) pulling data out query sysibm.syscolmns table. select name, tbname, tbcreator, remarks sysibm.syscolumns tbcreator = 'schema' , tbname = 'table' if need list of tables in particular schema it's just select distinct tbname sysibm.syscolumns tbcreator = 'schema' then it's matter of formatting output in whatever sort of html format want.

C# Timer Interval doesn't work -

Image
as written in title, in timer interval seems off. timer should take time "datetimepicker", convert seconds & change interval time set on datetimepicker. afterwards should post tweet on twitter, though doesn't work. keeps spamming posts on , over. private void intervalchoose_valuechanged(object sender, eventargs e) //datetimepicker { postinterval.interval = (intervalchoose.value.hour * 3600) + (intervalchoose.value.minute * 60) + intervalchoose.value.second; savetimerinterval = postinterval.interval; //savetimerinterval set 0 @ beginning messagebox.show("current interval in seconds: " + postinterval.interval.tostring()); } private void button1_click(object sender, eventargs e) { if (button1.text == "start bot") //starts program (works) { intervalchoose.enabled = false; messagebox.show(savetimerinterval.tostring()); postinterval.interval = s

hadoop - Unable to determine the current HDP while installing spark client on HDP 2.3 -

while deploying hdp cluster setup using apache ambari's automated setup guide, encountered following error @ edge node. stderr: 2016-08-08 17:46:03,644 - not determine hdp version component spark-client calling '/usr/bin/hdp-select status spark-client > /tmp/tmp_vn3of'. return code: 1, output: . click here to view complete console log we tried installing apache spark on hdp using this link

ubuntu - RabbitMQ SSL issue - what should the path to the certificates be? -

i'm setting rabbitmq on ubuntu works fine. i'm trying set ssl suspect rabbitmq can't find path i've put certificates. i'm following tutorial here using openssl https://www.rabbitmq.com/ssl.html the certificates set in folder /rmqca - when set logged in chrisadmin (i think have root permissions i'm little hazy on means/if it's correct). did mkdir /rmqca. i believe rabbitmq executes user rabbitmq - how make can see path it's config? change owner using: sudo chown -r rabbitmq:rabbitmq /rmqca and read this: https://www.rabbitmq.com/troubleshooting-ssl.html

git pull -X theirs local master still have conflicts -

i make pull accepting remote (theirs) modifications, without manual conflict solving. still conflicts without auto solution: $ git merge -s recursive -x theirs local/master conflict (rename/delete): rcs.d/s08kmod deleted in head , renamed in local/master. version local/master of rcs.d/s08kmod left in tree. auto-merging php5/cli/conf.d/20-xdebug.ini conflict (add/add): merge conflict in php5/cli/conf.d/20-xdebug.ini auto-merging apt/sources.list conflict (rename/rename): rename "apache2/sites-available/default-ssl"->"apache2/sites-available/default-ssl.conf.conf" in branch "head" rename "apache2/sites-available/default-ssl"->"apache2/sites-available/default-ssl.conf" in "local/master" using pull: $ git pull local master ssh://192.168.1.101/etc * branch master -> fetch_head warning: cannot merge binary files: console-setup/cached_utf-8_del.kmap.gz (head vs. ada82813d27e5bef846ee086d07a87a82cfb

javascript - How to get html tag's inner html in js/jquery? -

for example have: <p class="question"> paragraph <p> , i'm inside tag in question class <h1> , heading</h1> </p> </p> the question how can inner html of question class below: this paragraph <p> , i'm inside tag in question class <h1> , heading</h1> </p> there 2 functions inner html of element .text() .html() .text() console.log($(".question").text()); .text() give innertext of element not tags .html() console.log($(".question").html()); .html() function give inner tags also. this paragraph <p> , i'm inside tag in question class <h1> , heading </h1> </p> in case .html() fine

ios simulator - Saving Record in CloudKit not working [Swift 3] -

i trying save record have make in cloudkit dashboard. @ibaction func signuppressed(_ sender: anyobject) { let authinfo = authinfo() authinfo.email = emailfield.text! authinfo.firstname = firstfield.text! authinfo.lastname = lastfield.text! authinfo.username = usernamefield.text! authinfo.password = passwordfield.text! let container = ckcontainer.default() let privatedata = container.privateclouddatabase let record = ckrecord(recordtype: "authentication") record.setvalue(authinfo.email, forkey: "email") record.setvalue(authinfo.username, forkey: "username") record.setvalue(authinfo.firstname, forkey: "firstname") record.setvalue(authinfo.lastname, forkey: "lastname") record.setvalue(authinfo.password, forkey: "password") privatedata.save(record, completionhandler: { record, error in if error != nil { print(error) } else {

java - Change bitmap format using glide and BitmapTypeRequest -

don't know how : how change decodeformat on bitmap want use request : final bitmaptyperequest<?> request = glide.with(context) .load(uri) .asbitmap(); // here should .format(decodeformat.prefer_argb_8888) final simpletarget target = new simpletarget() { @override public void onresourceready(object resource, glideanimation glideanimation) { memcache.put(namestring, resource); } }; // must executed on main thread context.runonuithread(new runnable() { public void run() { request.into(target); } }); problem : .format(decodeformat.prefer_argb_8888) return bitmaprequestbuilder , need bitmaptyperequest edit : this operation works : glide.with(context) .load(uri) .asbitmap() .format(decodeformat.prefer_argb_8888) .into(imageview); but can see cache bitmaps method not use case. ch

swift - Core Data edit value with multiple entities -

i new core data , swift, have multiple entity in 1 row like let sceneobj = scene(entity: entitydescription!, insertintomanagedobjectcontext: dbhelper .getcontext()) sceneobj.createdat = string(dictionary!["createdat"]!) let appactionsdict = dictionary!["appactions"]! as? nsarray; appactionsarray in appactionsdict!{ let entitydescription1 = nsentitydescription.entityforname("appactions", inmanagedobjectcontext: dbhelper .getcontext()) let appactionsobj = appactions(entity: entitydescription1!, insertintomanagedobjectcontext: dbhelper .getcontext()) appactionsobj.action = appactionsarray["action"] as! nsnumber? sceneobj .addobject(appactionsobj)

How to use laravel package in lumen? -

i want use laravel package named thinksaydo/envtenant from githup link this package creating multitenancy software in laravel , can't install package in lumen how can install package , use in lumen? there many things you'll need tenancy lumen doesn't provide out of box. you'll need enable facades, setup providers, , lumen doesn't provide session support out of box . the purpose of lumen provide simple, fluid, stateless api returns data interchange language . you're doing here attempting run fully-functional saas service on micro-api framework; that's not going work. you need using laravel accomplish saas model, can know tenancy. in lumen, thing should looking @ api key in request.

java - How to solve this error - i want create MPAndroidChart dynamic multiple line -

Image
i tried mpandroidchart dynamic multiple line private linechart mchart; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); mchart = (linechart) findviewbyid(r.id.chart1); mchart.setdrawgridbackground(false); mchart.setdescription(""); mchart.setnodatatextdescription("you need provide data chart."); mchart.settouchenabled(true); mchart.setdragenabled(true); mchart.setscaleenabled(true); mchart.setpinchzoom(true); limitline llxaxis = new limitline(10f, "index 10"); llxaxis.setlinewidth(4f); llxaxis.enabledashedline(10f, 10f, 0f); llxaxis.setlabelposition(limitline.limitlabelposition.right_bottom); llxaxis.settextsize(10f); xaxis xaxis = mchart.getxaxis(); xaxis.enablegriddashedline(10f, 10f, 0f); yaxis leftaxis = mchart.getaxisleft(); leftaxis.removealllimitlines(); leftaxis.enab

c - How can I duplicate an EVP_PKEY struct without knowing the underlying algorithm? -

i'm working on tls implementation (using openssl 1.0.1s) employs 1024-bit rsa keys both encryption , authentication. want upgrade ec performance reasons, need remain backward compatible. so decided use openssl's evp api have common code possible. but, i've run problem when want read certificates ram (stored in asn.1 der format), can't find way copy evp_pkey struct (no pkey_dup or pkey_copy or of sort). i want avoid switch-casing evp_pkey.type next upgrade smoother, suggestions? i managed duplicate converting der , back. general i2d/d2i functions call specific ones. code: error_code_enum read_evp_pkey_from_ram (int index, int db_id, evp_pkey **pkey_ptr_ptr){ evp_pkey *pkey; unsigned char *p; unsigned char *der_ptr; int der_size; int pub_len, priv_len, type; *pkey_ptr_ptr = null; if ((pkey

python - How to use TensorFlow reader and queue to read two file at same time? -

my training set contains 2 kinds of file: training image file name "1.png" , label file name "1.label.txt". i found usage of queue , reader in tutorials this: filename_queue = tf.train.string_input_producer(filenames) result.key, value = reader.read(filename_queue) however, because training set contains 2 kinds of file, 1 correspond one. how can make use of queue , reader code above? edit i thinking using 1 queue containing base names feed 2 queue, image , label respectively. code this: with tf.session() sess: base_name_queue = tf.train.string_input_producer(['image_names'], num_epochs=20) base_name = base_name_queue.dequeue() image_name = base_name + ".png" image_name_queue = data_flow_ops.fifoqueue(32, image_name.dtype.base_dtype) image_name_queue.enqueue([image_name]) x = image_name_queue.dequeue() print_op = tf.print(image_name, [image_name]) qr = tf.train.queuerunner(base_name_queue, [base_name_queue] * 4)

php - i wan to export an excel from mysql database. i want to have the column name from users with the help of check box -

this normal csv query. want take column name user input. form containing checkbox or dropdown. how should modify it? have tried checkbox isset($_post["checkboxname"]) not working. me please. <?php include("../../../config.php"); //if(isset($_post["submit"])){ $xls_filename = 'export_'.date('y-m-d').'.xls'; // define excel (.xls) file name $start_date=$_post["date_time"]; $sql_ex = "select device_name,description,card,device_module,uid device"; $result = @mysql_query($sql_ex,$conn) or die("failed execute query:<br />" . mysql_error(). "<br />" . mysql_errno()); // header info settings header("content-type: application/xls"); header("content-disposition: attachment; filename=$xls_filename"); header("pragma: no-cache"); header("expires: 0"); /***** start of formatting excel *****/

how to get a folder name and file name in python -

i have python program named myscript.py give me list of files , folders in path provided. import os import sys def get_files_in_directory(path): root, dirs, files in os.walk(path): print(root) print(dirs) print(files) path=sys.argv[1] get_files_in_directory(path) the path provided d:\python\test , there folders , sub folder in can see in output provided below : c:\python34>python myscript.py "d:\python\test" d:\python\test ['d1', 'd2'] [] d:\python\test\d1 ['sd1', 'sd2', 'sd3'] [] d:\python\test\d1\sd1 [] ['f1.bat', 'f2.bat', 'f3.bat'] d:\python\test\d1\sd2 [] ['f1.bat'] d:\python\test\d1\sd3 [] ['f1.bat', 'f2.bat'] d:\python\test\d2 ['sd1', 'sd2'] [] d:\python\test\d2\sd1 [] ['f1.bat', 'f2.bat'] d:\python\test\d2\sd2 [] ['f1.bat'] i need output way : d1-sd1-f1.bat d1-sd1-f2.bat d1-sd1-f3.bat d1-sd2-f1.

php - Set background color for heading in export CSV format in laravel maatwebsite -

i trying set background color below export csv file. background color not setting first row. works xls format. please help. in advance. $filename = $filename."_".date('dmyhis'); \excel::create($filename,function($excel) use($newarray){ $excel->settitle('tasks'); $excel->setcreator('admin'); $excel->setcompany('company'); $excel->setdescription('time sheet'); $excel->sheet('sheet1',function($sheet) use($newarray){ $sheet->fromarray($newarray, null, 'a1', false, false); $sheet->cells('a1:n1', function($cells) { $cells->setbackground('#aaaaff'); }); }); })->download('

database - Execute postgres trigger after 24 hours after record insertion? -

i`m trying execute trigger after 24 hours after record insertion, each row, how this? please help you know, if user doesn`t verificate email, account deleted. without cron , on. postgres db. postgresql this may in relation scheduling sql command run @ time. pgagent this command tested , use in pgagent . delete email_tbl email_id in(select email_id email_tbl timestamp < now() - '1 day'::interval ); here test data used. create extension citext; create domain email_addr citext check( value ~ '^[a-za-z0-9._%-]+@[a-za-z0-9.-]+[.][a-za-z]+$' ); create table email_tbl ( email_id serial primary key, email_addr email_addr not null unique, timestamp timestamp default current_timestamp ); and here's test data insert email_tbl (email_addr) values('me@home.net') insert email_tbl (email_addr,timestamp) values('me2@home.net','2015-07-15 00:00:00'::timestamp) select * email_tbl timestamp < now() - '1 day'

python - parameters constraint in numpy lstsq -

i'm fitting set of data numpy.lstsq() : numpy.linalg.lstsq(a,b)[0] returns like: array([ -0.02179386, 0.08898451, -0.17298247, 0.89314904]) note fitting solution mix of positive , negative float. unfortunately, in physical model, fitting solutions represent mass: consequently i'd force lstsq() return set of positive values solution of fitting. possible this? i.e. solution = {a_1, ... a_i, ... a_n} a_i > 0 = {1, ..., n} non-negative least squares implemented in scipy.optimize.nnls . from scipy.optimize import nnls solution = nnls(a, b)[0]

php - Laravel 5.2 'The file "Cover.jpg" was not uploaded due to an unknown error.' -

i using laravel 5.2 , got error. fileexception in uploadedfile.php line 235: file "cover.jpg" not uploaded due unknown error. 1. in uploadedfile.php line 235 @ uploadedfile->move('productimages', '20160808094822_a3f390d88e4c41f2747bfa2f1b5f87db.jpg') 2. in productcontroller.php line 144 my code: public static function imageupload(request $request, $productid, $type = 'image') { /* set file destination */ $destination = 'productimages'; if ($request->hasfile('cover') or $request->hasfile('images')) { /* single file - cover */ if ($request->hasfile('cover')) { $filename = date('ymdhis') . '_' . md5($productid) . '.jpg'; $filepath = "/" . $destination . "/" . $filename; $prodimage = new product_images; $prodimage->productid = $product

Including new app causing AttributeError: 'str' object has no attribute '_meta' in Python/Django app -

using python 2.7 , django 1.9.9 i'm getting following error when try in include app developing within installed_aps traceback (most recent call last): file "manage.py", line 22, in <module> execute_from_command_line(sys.argv) file "/var/www/cltc/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 353, in execute_from_command_line utility.execute() file "/var/www/cltc/env/local/lib/python2.7/site-packages/django/core/management/__init__.py", line 345, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/var/www/cltc/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 348, in run_from_argv self.execute(*args, **cmd_options) file "/var/www/cltc/env/local/lib/python2.7/site-packages/django/core/management/base.py", line 398, in execute self.check() file "/var/www/cltc/env/local/lib/python2.7/site-packages/django/core

slack - jenkins: Find the triggering user of a job for the build-script -

we're using jenkins , slack. i'm trying setup slack notification build, , notifucation include more information - resort custom message. i found $git_branch , $build_number , $job_name , other interesting guys, , put them use. but lack way mention cause triggered build - polling on scm, or user pressed build now . later of extreme importance - in jobs deploy target environment... can recommend me way detect triggering cause , add custom message? btw - i'd want information not slack notification. i'd add information signature file add every artifact (as other things) use build user vars plugin: https://wiki.jenkins-ci.org/display/jenkins/build+user+vars+plugin you have variables: build_user – full name of user started build, build_user_first_name – first name of user started build, build_user_last_name – last name of user started build, build_user_id – id of user started build. *if want other job can use below url: http://[jenkins

codeigniter - session_start(): Cannot send session cache limiter - headers > already sent -

i knew question may mark duplicate can't find answer duplicated post decided post in own. i have pages session. after task, there button link controller called profileresult.php not have code yet surprising me got error. here error. a php error encountered severity: warning message: session_start(): cannot send session cache limiter - headers sent (output started @ /home3/oep2732/public_html/knowyourscore/application/controllers/profileresult.php:1) filename: session/session.php line number: 140 backtrace: file: /home3/oep2732/public_html/knowyourscore/index.php line: 315 function: require_once i created controller called profileresult.php <?php defined('basepath') or exit('no direct script access allowed'); class profileresult extends ci_controller { public function index() { } } ?> check controller file. remove empty space within file. example: <?php defined('basep

repetition - Repeating a several numbers a set number of times in VBA -

i have column of 47 numbers in column in spreadsheet. in sheet want numbers transposed row. did using code worksheets.add(before:=worksheets(1)).name = "calc" dim k integer k = 1 47 worksheets("calc").cells(1, k).value = worksheets("reformulering").cells(k + 1, 2).value next k however, want each number repeated 12 times in row before next number comes. can think of method this? best, id yes, add loop runs 1 untill 12 this: worksheets.add(before:=worksheets(1)).name = "calc" dim k integer dim integer k = 1 47 = 1 12 worksheets("calc").cells(1, ((k - 1) * 12) + i).value = worksheets("reformulering").cells(k + 1, 2).value next next k

Store file in android -

i want store file in android. following flow:- if(sd card available){ //store in sd card... }else{ //if sd card not available... //store in phone memory.. } the question there way access sd card , internal memory paths? i understand contextwrapper cw = new contextwrapper(getapplicationcontext()); file destinationdirforchequeimageininternalmemory = cw.getdir("dirname", context.mode_private); always gives internal storage location. is guaranteed storage location in phone memory? environment.getexternalstoragedirectory() does above line give sd card path? if not return? there way sd card location? (if environment.getexternalstoragedirectory returns phone memory path inspite of device having sd card in it.) please throw insight how this? just read android documentation on it. https://developer.android.com/reference/android/os/environment.html#getexternalstoragedirectory() getexternalstoragedirectory added in api

algorithm - Optimal Directed Dijkstra search in Python -

i've played around writing own heap , trying out directed dijkstra's algorithm using heap store distances. i've cross-checked answers bellman-ford (and on paper) i'm confident runs correctly, seems slow liking. i've made own graph class hold value of vertices/the length/head/tail of edges def dijkstra(g,root): ###initialize values root.value=0 h=heap.heap(root) v in g.vertices: if v==root: continue v.value=float('inf') h.insert(v) while len(h.nodes)>1: m=h.extractmin() ##only works directed graphs e in m.edges: if (e.v in h.nodes) , e.v.value>m.value+e.d: #if head of min vrtx in heap e.v.value=m.value+e.d h.check_parent(h.nodes.index(e.v)) #percolate on input of 50k edges , 1k nodes, takes >30sec complete. reasonable time expect python? assuming algorithm correct, heap limiting factor? (also know i'

list - how to write random numbers to file in python -

i store 100 randomly drawn numbers in file. how can write random numbers list, using file? how can read file? how can separate draw numbers import random draw = [] while true: numbers_lotto = random.randint(1,50) draw.append(numbers_lotto) if len(draw) == 5 # numbers? break import random file_name = 'random_numbers.txt' open ('file_name', 'w') a_file: in range (100): a_file.write ('{}\n'.format (random.random ())) open ('file_name', 'r') a_file: a_list = [float (word) word in a_file.read () .split ()] print (a_list) or import random import pickle file_name = 'random_numbers.txt' open (file_name, 'wb') a_file: pickle.dump ([random.random () in range (100)], a_file) open (file_name, 'rb') a_file: a_list = pickle.load (a_file) print (a_list)

c# - Binding dependency property - set in custom user control, get in viewmodel -

the aim instantiate object in custom usercontrol , access instance viewmodel. following not working, upratings property in viewmodel null. custom usercontrol dependency property public partial class scale:usercontrol { public scale() { initializecomponent(); } public static readonly dependencyproperty mouseratingsproperty = dependencyproperty.register( "mouseratings", typeof(iobservable<double>), typeof(scale)); public iobservable<double> mouseratings { { return (iobservable<double>)getvalue(mouseratingsproperty); } set { setvalue(mouseratingsproperty, value); } } // requires system.reactive nuget private isubject<double> _mouseratings = new subject<double>(); protected override void oninitialized(eventargs e) { base.oninitialized(e); // _mouserati

java - What Exception to throw when a web element is found in Selenium Automation -

currently, working on 'selenium wrapper library', set of methods created in order perform automation on particular web portal. these methods includes debug logging , other logic, , called within test classes. i've created new method check whether table cell (tag name 'td'), present inside table row (tag name 'tr'). below created method: public void checkentryisnotintable(string elementtablename, byelementtable, string checkvisibletext1) { // rows table, using tagname <tr> list<webelement> tablerows = getelements(elementtablename, byelementtable); debug.log.info("\ttotal of [" + tablerows.size() + "] rows found in table [" + elementtablename + "]" ); int rowcount = 0; boolean isnotfound = false; findcell: for(webelement row : tablerows) { // cells table, using tagname <td> list<webelement> rowcells = row.findelements(by.tagname("td"));

Python: How to catch inner exception of exception chain? -

consider simple example: def f(): try: raise typeerror except typeerror: raise valueerror f() i want catch typeerror object when valueerror thrown after f() execution. possible it? if execute function f() python3 print stderr raised exceptions of exception chain ( pep-3134 ) like traceback (most recent call last): file "...", line 6, in f raise typeerror typeerror during handling of above exception, exception occurred: traceback (most recent call last): file "...", line 11, in <module> f() file "...", line 8, in f raise valueerror valueerror so list of exceptions of exception chain or check if exception of type ( typeerror in above example) exists in exception chain. python 3 has beautiful syntactic enhancement on exceptions handling. instead of plainly raising valueerror, should raise caught exception, i.e.: try: raise typeerror('something awful has happened') ex

java - Error inflating class fragment While testing out fragment Activity -

i'm trying test out activity implement fragment s. when try run app error: error inflating class fragment ive read happens if extends activity instead of fragmentactivity in main activity , inherit right thing in activity itself. might problem ? my activity : package apps.radwin.zxingprojectfragmenttwo; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.app.fragmentmanager; import android.view.view; public class mainactivity extends fragmentactivity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } public void selectfrag(view view) { fragment objfragment = new fragmentone(); fragmentmanager fragmentmanager = getsupportfragmentmanager(); fragmentmanager.begintransaction() .replace(r.id.fragment_two_id, objfragmen