Posts

Showing posts from June, 2013

How can you run Xamarin Android Player from Visual Studio 2015? -

Image
so have visual studio 2015 installed along xamarin , android sdk, etc... after being frustrated slowness of default avd(android virtual device) took advice xamarin android player. i went through installation process , can run virtual device instance cannot open visual studio such when compile android app's code opens in xamarin android player instead of slow default avd opening. see image below: i had same issue. did open xamarin android player , downloaded of devices , restarted vs 2015. came up.

javascript - Set custom store marker on storeLocator.Store in Google -

i'm trying set custom marker each of stores. using google storelocator , there storelocator.store .setmarker option. i tried lot var store = new storelocator.store(store_id, position, storefeatureset, storeprops); var markerpin = new google.maps.marker( icon: 'http://url-to-marker.png' }); store.setmarker(markerpin); i've been trying find on google there isn't out there on storelocator project. i managed find out git repository of store locator project . in repository there sample examples , files demonstrates placement of markers. if dig examples directory , check out file places.js . can find code of how places populate markers. adding small code snippet, detailed overview can see whole project. google.maps.event.adddomlistener(window, 'load', function() { var map = new google.maps.map(document.getelementbyid('map-canvas'), { center: new google.maps.latlng(-28, 135), zoom: 4, maptypeid: google.maps.maptypeid.ro

rest - Golang: Json from URL as map -

what best way extract json url i.e. rest service go? seems rest client libraries in go force use of json.marshall needs struct used it. this doesn't work in case of unstructured data don't know coming in. there way have come in map[string:string]? why not parse map[string]string code have do var d map[string]interface{} data, err := json.unmarshal(apiresponse, &d) you can traverse data in struct too. if suspect, api response can not singular object, collection of objects, interface{} works arrays.

java - How to retrieve and display images from a database in a JSP page? -

how can retrieve , display images database in jsp page? let's see in steps should happen: jsp view technology supposed generate html output. to display image in html, need html <img> element. to let locate image, need specify src attribute. the src attribute needs point valid http:// url , not local disk file system path file:// never work when server , client run @ physically different machines. the image url needs have image identifier in either request path (e.g. http://example.com/context/images/foo.png ) or request parameter (e.g. http://example.com/context/images?id=1 ). in jsp/servlet world, can let servlet listen on url pattern /images/* , can execute java code on specific url's. images binary data , obtained either byte[] or inputstream db, jdbc api offers resultset#getbytes() , resultset#getbinarystream() this, , jpa api offers @lob this. in servlet can write byte[] or inputstream outputstream of response usual java io way

html - Bootstrap carousel navigation controls too tall -

Image
i have bootstrap carousel left , right navigation control overflow @ bottom of carousel after bottom of image. any way rid of overflow of navigation arrows? <div id="carousel" class="carousel slide" data-ride="carousel"> <ol class="carousel-indicators"> <li data-target="#carousel" data-slide-to="0" class="active"></li> <li data-target="#carousel" data-slide-to="1"></li> </ol> <div class="carousel-inner" role="listbox"> <div class="item active"> <a href="/freshers2015"> <img src="/files/2015/06/journosoc-prefreshers-web.png" alt="first slide"/> </a> </div> <div class="item"> <img src="/files/2015/06/whatjourno.png" alt="second slide"/> </div> </div> <a class=&quo

ios - double Tap a UITableView -

i try open uialertview 2 textfield text cell selected. use code: -(void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { uitapgesturerecognizer *taprecognizer = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(edit:)]; taprecognizer.numberoftapsrequired = 2; [self.view addgesturerecognizer:taprecognizer]; [taprecognizer requiregesturerecognizertofail:taprecognizer]; cardtableviewcell *cell = [tableview dequeuereusablecellwithidentifier:@"editcell" forindexpath:indexpath]; nsstring *cellfirsttext = cell.cellfirsttext.text; nsstring *cellsecondtext = cell.cellsecondtext.text; [[nsuserdefaults standarduserdefaults] setobject:cellfirsttext forkey:@"cellfirsttoedit"]; [[nsuserdefaults standarduserdefaults] setobject:cellsecondtext forkey:@"cellsecondtoedit"]; } -(void)edit: (uitapgesturerecognizer *)sender { uialertview *alert = [[uialertview alloc

javascript - Truncating Y-Axis Title in Highcharts v4.1.5 -

i'm having issue charts smaller in height have long y-axis titles start clipping @ edges (top , bottom). jsfiddle demo i've tried using style option try , enforce ellipsis overflow. yaxis : { title: { text:"really long title text go off chart haha haha , on , on", style: { textoverflow:'ellipsis', overflow:'hidden' } } }, however, these sorts of things not work without maximum width of sort, tried adding width: '100%' (see demo) stops short. i'm guessing has fact it's rotated. is there way have title dynamically adjust height of chart , truncate rather slide off oblivion? i haven't found helpful in documentation . google-jitsu hasn't been able locate helpful or relevant topics. you should try using absolute width, not percent: width: $('#container')[0].clientheight*0.85, o

mysql - Convert two inputs to a single array to input into db codeigniter -

im busy creating webpage issues drawings client , creates receipt sending client. part i'm having trouble select drawings want add receipt , change revision. the information drawings split on 2 tables. first contains drawing number, title, drawn etc , second contains revision history. tables linked drawing id. to issue drawings user must tick checkboxes , change revision of drawings wants issue. i want input database, i'm not sure how create array. controller takes gets dropdown inputs , ticked checkboxes. want dropdown inputs associated selected checkboxes updated database. this view. <h1>issue drawing</h1> <br> <div id="body"> <div class="row"> <div class="form-group-sm"><lable class="col-sm-2 control-label">project number:</lable> <?php $js = 'onchange="this.form.submit()" class="form-control" id="focusinput"';

sql - ASP.Net C# failed to UPDATE picture but success when INSERT new picture to Database -

i using .ashx file imagehandler. the error message received exception of type 'system.invalidoperationexception' occurred in system.data.dll not handled in user code additional information: invalid attempt read when no data present. this part showing error sqldatareader dr = cmd.executereader(); dr.read(); context.response.contenttype = dr["image_type"].tostring(); context.response.binarywrite((byte[])dr["profile_picture"]); dr.close(); this imagehandler.ashx: using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; using system.data.sqlclient; using system.data; using system.configuration; using system.io; public class imagehandler : ihttphandler { public void processrequest (httpcontext context) { sqlconnection myconnection = new sqlconnection(configurationmanager.connectionstrings["register"].connectionstring);

javascript - Event Listener for Web Notification -

is there way set event listener desktop notification? document.addeventlistener("desktop notification", function(){ // }); i've looked through mdn event reference , event type notification seems alert() . see https://github.com/jiahaog/nativefier project working sample. notice snippet (source https://github.com/jiahaog/nativefier/blob/development/app/src/static/preload.js ): function setnotificationcallback(callback) { const oldnotify = window.notification; const newnotify = (title, opt) => { callback(title, opt); return new oldnotify(title, opt); }; newnotify.requestpermission = oldnotify.requestpermission.bind(oldnotify); object.defineproperty(newnotify, 'permission', { get: () => { return oldnotify.permission; } }); window.notification = newnotify; } so, replace window's notification object own object act proxy added behaviour (calling callback on creat

php - pdo insert slow performance -

Image
im experiencing issue method created insert data in 3 different tables of database, slow, , not inside loop need detect problem is... here code. public function procesaordenrun () { #trae variables de config $data = new config(); $base_path = $data->url(); $base_path = str_replace("/classes","",$base_path); $fecha_creado = date("y-m-d"); $fecha_entrega = date('y-m-d', strtotime($fecha_creado. ' + 7 days')); $id_paciente = $_post["id_preregistro"]; $estado = "6"; $asignado = $_post["dr_remitente"]; $precio = $_post["precio_plantilla"]; $tipo_plantilla = $_post["tipo_plantilla"]; $tipo_pie = $_post["tipopie"]; $observaciones = $_post["observaciones"]; $id_usuario = $_post["id_usuario"]; $id_plantilla = $_post["id_plantilla"];

ios - What is the best practice for creating custom UIView's? -

for creating custom views have 3 options. override func drawrect(_ rect: cgrect) add sub-layers view's layer. do both. what best practice? why override drawrect if can draw in sub-layer (with easier api)? thanks rendering in drawrect means using cpu draw view using core graphics. if can use composition of calayer sub-layers, better option heavy lifting done gpu. on top of that, drawrect called on main thread, , if drawing code isn't fast app less responsive (of course can use background thread solve problem, still using cpu draw bitmap).

c - Using getchar() to take multiple values. -

could somehow use getchar() run through command line until hit '\n'. want scan in values enter such as. 21 23 1 78 54 '\n'. want scan 5 values array. unable scan them in. because of spacing between each value? or there function use ? thanks in advance if not bent on using getchar() have straightforward solution using scanf %d conversion specifier: while (i < array_size && scanf("%d", &a[i]) == 1) i++ ; the %d conversion specifier tells scanf skip on leading whitespace , read next non-digit character. return value number of successful conversions , assignments. since we're reading single integer value, return value should 1 on success.

php - How to set an index page in a subfolder -

i have following file/folder structure site: index.php games.php /category-games /category-games/game-1.php /category-games/game-2.php the file games.php supposed category homepage /category-games/ . there way make page show when visits mysite.com/category-games/ ? tried put page folder , called index.php guess that's not working. probably need via .htaccess. can me this? right if tries access mysite.com/category-games/ its going straight 404. cheers! case 1: if /category-games/ has no .htaccess place rule in root .htaccess: rewriteengine on rewriterule ^category-games/$ games.php [l,nc] case 2: if there .htaccess inside /category-games/ use rule rewriteengine on rewriterule ^/?$ /games.php [l]

python - Best practice: update/extend subclass class attribute -

this little curiosity. find myself updating class attribute inherited in subclass , i'd know how others deals it. know can't update them in __init__ : since it's class attribute update superclass instances well. this: class a(object): attribute = { 1: 'a', ..., 5: 'e', } class b(a): attribute = { 1: 'a', ..., 5: 'e', 6: 'f', } but, since follow dry principle as possible , i'd know if use more elegant way without copy , paste attribute. as asked concrete example django forms: class loginform(authenticationform): username = forms.emailfield(label=_('email')) error_messages = { 'inactive': _('this account inactive.'), 'invalid_login': _('please enter correct username , password. ' 'note both fields may case-sensitive.'), 'unconfirmed':

Integrating legacy C code in multi-threaded C++ code -

assume have legacy c file functions solve linear equations , several corresponding global variables. lineq.c: /* macro definitions */ ... /* global vars */ ... /* functions make use of above variables */ void solvelineq(...); now want use legacy library in modern multi-threaded c++ application. therefore, want write kind of wrapper class lineqsolver provides oo interface solving linear equations , internally calls functions of our legacy c library. however, should possible there multiple instances of lineqsolver used different threads. requires each instance/each thread has own copies of global variables in lineq.c . how can achieved, if don't want modify lineq.c ? a possible solution can imagine copy global variables , functions c file class lineqsolver , making them data , function members. then, each instance of lineqsolver operate on private copy of former globale variables. however, copy-paste programming style rather bad, when there update lineq.c , need cop

swift2 - Swift 2.0 'inout' function parameters and computed properties -

i'm testing swift 2.0 beta right , have found strange behaviour. here sample code: private func somefunc(inout somestring: string) { print("inside \'somefunc()\'") print(somestring) somestring = "some string" } private var someancillaryint = 42 print(someancillaryint) private var somestring: string { { print("inside \'getter\'") return "some string" } set { print("inside \'setter\'") someancillaryint = 24 } } somefunc(&somestring) print(someancillaryint) output: 42 inside 'getter' inside 'somefunc()' some string inside 'setter' 24 i don't understand why wasn't getter called while printing somestring inside somefunc() , why when somefunc() got passed somestring . one can assume don't understand intricacies of inout parameters yet , after being passed ino

javascript - Google maps function fromLatLngToContainerPixel(LatLng) not working -

im trying pixel coordinates of market using fromlatlngtocontainerpixel(latlng) function. not sure how use after searching examples in think got it. problem function returns "undifined". google maps api ref: https://developers.google.com/maps/documentation/javascript/reference?csw=1#mapcanvasprojection please help. code: var map, overlay; function initialize() { var mylatlng = new google.maps.latlng(-25.363882, 131.044922); map = new google.maps.map(document.getelementbyid('gmap'), { zoom : 13, center : mylatlng, disabledefaultui: true, draggable: false, scrollwheel: false, disabledoubleclickzoom: true }); var overlay = new google.maps.overlayview(); overlay.draw = function () {}; overlay.setmap(map); var marker = new google.maps.marker({ position: mylatlng, optimized: false, map:map }); var projection = overlay.getprojection(); var pixel = projection.fromlatlngtocontainerpixel(marker.getposition());

first time trying caching in Rails, don't even know where to begin -

first time trying implement caching app, , find confusing. after reading this indept article , still pretty lost. i decided start out simple. in test app i'm making, have following chunk of api call. def get_champion champion_url = "#{base_url}/api/lol/static-data/na/v1.2/champion#{api_key}" parse_json(champion_url) end i think best place me cache because data returned call static. what best method me cache here? there many caching techniques described in article, , don't know 1 use. if there technique think should try implement, please let me know, , i'll try best implement it. ps: right now, server logs says completed 200 ok in 2860ms (views: 2858.6ms | activerecord: 0.3ms) which high, now? edit: after reading through rails doc, thinking low-level cache might appropriate scenerio. class product < activerecord::base def competing_price rails.cache.fetch("#{cache_key}/competing_price", expires_in: 12.

algorithm - How can i maintain state between recursion calls -

here question trying solve: find kth smallest integer in binary search tree: my algorithm: inorder traversal of bst. each time visit node, decrement k 1 , when k=0, should in kth smallest node. here implementation: void findkthsmallest(struct treenode* root, int k) { if (root == null) return; if (k== 0) return; findkthsmallest (root->left, k); k--; if (k == 0) { cout << root->data; return; } findkthsmallest (root->right, k); } however above implementation, see state of k can't maintained between recursive calls. i think state of k need maintained in 2 scenarios: recursive call returns between child , parent , recursive calls between parent child - struggling. there way maintain state in such scenario ? in implementation, using variable k pass 2 different piece of information: the remaining number of nodes before target node found. if target node has been found. what's missing 2. can achieve : i) passing k

git checkout - Git jumping back to history after adding and removing files has different behaviour? -

i'm new comer git. found interesting. say if add file , commit. after checkout previous version, file doesn't exist expected. (since in last commit, hadn't been created) however, if remove file , commit. after jump previous commit, file doesn't exist well, surprises me. why there're different behaviours? thanks edit: reply. jumped previous commits git log showing hash. , git checkout 'hash'.

Continue batch file from previous point -

i playing alpha game when crashes corrupts saved game, created batch file saved game. @echo off :a rem deletes old backup rmdir /s /q "backup location 1" rem creates xcopy "game location" "backup location 1" /e /i /q /r /y rem adds time out 300 seconds timeout /t 300 rem deletes old backup rmdir /s /q "backup location 2" rem creates xcopy "game location" "backup location 2" /e /i /q /r /y rem adds time out 300 seconds timeout /t 300 rem repeats goto this works fine stars on first up. want have continue previous point of backing up. created following test file @echo off set point=a echo variable "%point%" if %point%==c (goto :a) if %point%==a (goto :b) if %point%==b (goto :c) :a echo set point=a echo variable "%point%" pause :b echo b set point=b echo variable "%point%" pause :c echo c set point=c echo variable "%point%" pause when file restarted poi

javascript - memory game in jQuery save image in array -

i creating memory game using jquery, problem 1 specific thing, dont find wrong. the way built it: images have default src value, after 1 click src change, if the 2 image clicked not same, default src value return. the problem is: after defualt src value return, when click on image again, last shown src should retrive array, show antoher random image instead. this relevent code var imgarr1 = ["images/skinny-unicorn.png", "images/all-757448_640.jpg", "images/alm-770667_640.jpg", "images/audi-798530_640.jpg", "images/landscape-691462_640.jpg", "images/skinny-unicorn.png", "images/all-757448_640.jpg", "images/alm-770667_640.jpg", "images/audi-798530_640.jpg", "images/landscape-691462_640.jpg"]; var arrstr = [32]; $('.img').click(function(){ //var opencount = opencardcount(); var id = $(this).attr("id"); if(getfromarray(id) != 'null')

matplotlib - How to install wxversion for Python -

i'm experimenting "spy" spectral python library, using pycharm, , i've gotten point tells me wxversion not found. how can install wxversion? i'm new python in general, doing else wrong? here code: import matplotlib #matplotlib.use('wx') #replaced editing matplotlibrc spectral import * img = open_image('92av3c.lan') print img.__class__ print print img print print img.shape pixel = img[50,100] print print pixel.shape band6 = img[:,:,5] print print band6.shape print arr = img.load() print arr.__class__ print print arr.info() print print arr.shape view = imshow(img, (29, 19, 9)) all of spy guide here: http://www.spectralpython.net/user_guide.html here error: traceback (most recent call last): file "/users/pkillam/pycharmprojects/untitled/spy experiments", line 36, in <module> file "/library/python/2.7/site-packages/spectral/graphics/spypylab.py", line 1238, in imshow import matplotlib.pyplot pl

php - Subfolder .htaccess redirecting to root folder -

here's root folders .htaccess options +followsymlinks options -indexes <ifmodule mod_rewrite.c> rewriteengine on rewritecond %{server_port} 80 rewriterule ^(.*)$ https://www.domain.net/$1 [r=301,l] rewritecond %{http_host} !^www\. rewriterule ^(.*)$ https://www.domain.net/$1 [r=301,l] </ifmodule> here's subfolder .htaccess <ifmodule mod_rewrite.c> rewritecond %{request_uri} /admin/?$ rewriterule ^(.*)$ %1/admin/index.php [ne,r,l] rewritecond %{request_uri} /admin/?$ rewriterule ^(.*)$ %1/admin/index.php [ne,r,l] rewritecond %{request_uri} /stores/?$ rewriterule ^(.*)$ %1/stores/ [ne,r,l] rewritecond %{request_uri} /categories/?$ rewriterule ^(.*)$ %1/categories/ [ne,r,l] # working client side rewritecond %{request_filename} !-f rewriterule ^([^/]*)$ index.php?qstr=$1 [qsa,l] rewriterule ^coupons/(.*)$ index.php?qstr=coupons/$1 [qsa,l] rewriterule ^(.*)/$ index.php?qstr=$1 [qsa,l] </ifmodule> my problem is, when try access http://do

ios - UICollectionView spacing is incorrect every other row -

i creating custom flow layout uicollectionview, , trying spacing right. despite setting minimumlinespacing = 2 every other line, there 1px between each row of images, can seen here . believe because apple uses points instead of pixels, how fix this? here code in collectionviewcontroller sets flow layout: let screenwidth = self.collectionview?.bounds.size.width let flowlayout: uicollectionviewflowlayout = uicollectionviewflowlayout() flowlayout.minimuminteritemspacing = 2 flowlayout.minimumlinespacing = 2 let totalspacing = flowlayout.minimuminteritemspacing * 4.0 let imagesize = (screenwidth!-totalspacing)/4.0 flowlayout.itemsize = cgsize(width: imagesize, height: imagesize) i figured out. if height of cell repeating float, spacing between each row alternate, every other row. instance, if want fit 3 cells 2 points spacing between each one, each cell 123.6666666667 points wide on iphone 6. (an iphone 6 375 points across, leading calculation

algorithm - Converting a number to its equivalent in a specific range -

Image
i have difficulties doing something, want convert number "equivalent" in given range. although concept simple, it's pretty hard explain i'll best. let's have got infinite row of tiles, although there infinite number of tiles, it's exact same color pattern repeats, : as can see, have given number each tile, take range, going 0 4, , : 0 purple 1 blue 2 red 3 green 4 yellow but because color pattern repeats infinitely, actually, 5 have same color 0, 6 have same color 1, 8 have same color 3. also, must not forget negative numbers, -1 have same color 4 example. actually want convert given number number of range have choosen, here range [0;4] know colour corresponds particular tile. want method work other ranges, example should work if range [1;5] or [-7;-3]. i have found method works [0;n] ranges (with n positive integer), , a positive integer : convertednumber = % (n+1) here's gives playground : but works conditions descri

php - Compiling geos without root CentOS -

i have been trying compile geos on restrcited(no root) environment , having difficulties... i did following wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2 tar jxf geos-3.4.2.tar.bz2 cd geos-3.4.2 nano ~/.bash_profile # added path=$path:$home/local/bin export path ./configure --enable-php --prefix=$home/local/ && make clean && make and im getting following errors making in php make[2]: entering directory `/home/myname/test/geos-3.4.2/php' making in . make[3]: entering directory `/home/myname/test/geos-3.4.2/php' /bin/sh ../libtool --tag=cc --mode=compile gcc -dhave_config_h -i. -i../include -i../include/geos `/usr/local/bin/php-config --includes` -dcompile_dl_geos -i../capi -i../include -i./opt/alt/php53/usr/include/ -pedantic -wall -ansi -wno-long-long -ffloat-store -std=gnu99 -g -o2 -mt geos_la-geos.lo -md -mp -mf .deps/geos_la-geos.tpo -c -o geos_la-geos.lo `test -f 'geos.c' || echo './'`geos.c libtool: compile: gcc -

python - Pandas extract data from column -

i have dataframe this import pandas pd d={'x':[8,5,6,7], 'cord':['(3,0)','(2,0)','(6,0)','(1,0)']} df=pd.dataframe.from_dict(d) i create df['y'] have first 'cord' value , shift index value. cord x y 0 (3,0) 8 1 #index 3, first value in (1,0) 1 (2,0) 5 6 #index 2, first value in (6,0) 2 (6,0) 6 nan #index 6, not exist, nan 3 (1,0) 7 2 #index 1, first value (1,0) make separate column, first element of cord df['cord1'] = df.cord.map( lambda x: x.split(',')[0].split('(')[-1]).map(int) df # cord x cord1 #0 (3,0) 8 3 #1 (2,0) 5 2 #2 (6,0) 6 6 #3 (1,0) 7 1 this might confusing, splits string '(a,b)' twice, first on ',' , , on '(' . finally, casts remaining string , 'a' , integer. now use cord1 column make y column df['y'] = df.cord1[ df.cord1.values].values being car

google maps - app takes too long to return longitude and latitude in android -

so code below use obtain longitude , latitude coordinations, however, when run app on android 4.4.3, app takes long bring , obtain coordinates. think result of bad coding ? or should make sure im under direct sky? thank suggestions. package com.example.geolocation; import android.app.activity; import android.content.context; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.widget.textview; public class mainactivity extends activity { textview textlat; textview textlong; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); textlat = (textview)findviewbyid(r.id.textlat); textlong = (textview)findviewbyid(r.id.textlong); locationmanager lm = (locationmanager)getsystemservice(context.location_service); //gets operating system

java - Implementing a compressed trie tree "add" function -

i'm trying write compressed trie tree code in java , i'm not sure how start implementing "compress" of tree. my node class consist of array of size 27 , string. public class trienode { trienode [] array; string data; } should write regular trie create function compresses nodes?

How do I create a grid in python with different values? -

i'm trying write 4x4 grid in python last 2 rows contain same numbers first 2 rows. the end result should this: 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 the goal make game above grid traversable. i've tried list comprehensions , concatenating 2 lists , it's not producing right answers. concatenating 2 lists should work. code concatenating 2 lists l1 = [1, 2, 3, 4] l2 = [5, 6, 7, 8] l3 = [l1 , l2]; l4 = l3+l3 print l4 should yield [[1, 2, 3, 4], [5, 6, 7, 8], [1, 2, 3, 4], [5, 6, 7, 8]]

bash - ls: No such file or directory -

this question has answer here: .bash_profile corrupted not found, command not found… restore original 2 answers i have been messing around trying install macvim higher version of 7.4. got working error ls: no such file or directory when looking directory. can temporarily fix using command path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin however, exit terminal window problem returns. how fix permanently. you should add following ~/.bash_profile file path loaded every time log in: export path=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

c++ - The term value is mentioned in the definition of an entity, but what is a value? -

in c++ standard there following definition of entity can found: [basic]/3 ( http://eel.is/c++draft/basic#3 ): an entity value , object, reference, function, enumerator, type, class member, bit-field, template, template specialization, namespace, parameter pack, or this. what value in context? is there rule of standard using term entity, make difference if didn't consider value entity? is pr-value expression value? the c++ language standard infamously vague formally defining "object" , "value" is. there efforts improve (e.g. n4430 ), not before c++17. at present, 1 of definitions of "object" "a region of storage". term "value" never defined; taxonomy of lvalues , rvalues not have "value" common ancestor, rather "expression". for time being, offer following commentary. every value object: every value has type, , type object type, type of object. conversely, every object has val

python - How to send password while using ssh command in os.system? -

for example, have code below: cmd = "ssh <host>" os.system(cmd) how can send password in python script don't have type password every time? use paramiko , so: sh = paramiko.sshclient() sh.connect(server, username=username, password=password) there many demos in paramiko github repo.

php - Magento 1.7 Observer Method -

i believe have config issue code below, module activated observer not being fired on event. can spot issue? app/etc/modules/james_coreproductcheck.xml <?xml version="1.0"?> <config> <modules> <james_coreproductcheck> <active>true</active> <codepool>local</codepool> </james_coreproductcheck> </modules> </config> app/code/local/james/coreproductcheck/etc/config.xml <?xml version="1.0"?> <config> <modules> <james_coreproductcheck> <version>0.0.1</version> </james_coreproductcheck> </modules> <global> <models> <james_coreproductcheck> <class>james_coreproductcheck_model</class> </james_coreproductcheck> </models> <events> <checkout_cart_product_add_after> <observers> <james_coreproduct_check_model_observer>