Posts

Showing posts from June, 2013

wcf - Confusing DebugDiag report to identify High Memory usage -

Image
recently got new batch of dumps identify highmemory usage in 3 of our wcf services. hosted on 64bit apppool , windows server 2012. application 1 : processup time : 22 days gc heap usage : 2.69 gb loaded modules : 220 mb commited memory : 3.08 gb native memory : 2 gb issue identified large gc heap usage due un closed wcf client proxy objects. accounting 2.26 gb , rest cache in gc heap. application 2 : processup time : 9 hours gc heap usage : 4.43 gb cache size : 2.45 gb loaded modules : 224 mb commited memory : 5.13 gb native memory heap : 2 gb issue identified of objects of system.web.caheentry, due large cache size. 2.2 gb of string object on gc heap has roots cacheref root objects. application 3 : cache size : 950 mb gc heap : 1.2 gb native heap : 2 gb we upgrade windows server 2012, had old dumps well. dumps not show native heap same application. around 90 mb. i use windbg explore native heap !heap -s command. shows minimal native heap sizes s

android - How to check if two rectangles are "on" each other -

Image
i want check if enemy_green_light (enemy_green_light_xenemy_green_light_y) , player (x, y) touched each other. however, code doesn't want, , can met though didn't. (x, y) left corner coordinates. thanks! boolean before_x=(x<enemy_green_light_x)&&(x+player.getwidth()>enemy_green_light_x); boolean after_x=(x>enemy_green_light_x)&&(enemy_green_light_x+enemy_green_light.getwidth()>x); boolean before_y=(y<enemy_green_light_y)&&(y+player.getheight()>enemy_green_light_y); boolean after_y=(y>enemy_green_light_y)&&(enemy_green_light_y+enemy_green_light.getheight()>y); if(before_x||after_x) if(before_y||after_y) { pressed=true; } edit: tried code too, , didn't work. float p_y_1,p_y_2,p_x_1,p_x_2,e_y_1,e_y_2,e_x_1,e_x_2; p_y_1=y; p_y_2=y+player.getheight(); p_x_1=x; p_x_2=x+player.getwidth(); e_y_1=enemy_green_light_y; e_y_2=enemy_green_light_y+

php - Laravel + git, contributors have different environment -

me , coworker trying use local git repo our laravel project. using ubuntu, php 5.5.9-1ubuntu4.9, , using debian php 5.4.39. when pulled committed version, error when trying run composer update : user@ubuntu:/var/www/frontend$ composer install loading composer repositories package information installing dependencies (including require-dev) lock file nothing install or update generating autoload files php fatal error: class 'illuminate\support\arr' not found in /var/www/frontend/vendor/laravel/framework/src/illuminate/support/helpers.php on line 182 script php artisan clear-compiled handling post-install-cmd event returned error [runtimeexception] error output: php fatal error: class 'illuminate\support\arr' not found in /var/www/frontend/vendor/laravel/framework/src/illuminate/support/helpers.php on line

node.js - Is it possible to download images contained in an Excel document using NodeJS? -

i want download image contained in excel sheet cell. there nodejs packages can use access images? i'm using xlsx package downloading excel sheet contents. xlsx files secretly zipped xml documents :d! unzip them using favorite zip tool folder containing images , other content in excel document. look @ node-zip , fs in node.

javascript - Trouble getting the index of a child when it is clicked -

i'm trying index of child within parent element. followed answer here , ended infinite loop. my code far: var div = document.getelementbyid("spans"); var spans = div.getelementsbytagname("span"); div.addeventlistener('click', function(e) { var span = e.target; var spansiblings = 0; while((span.previouselementsibling) != null ) { spansiblings++; } console.log(spansiblings); }); the aim output 0 when user clicks on first span because it's first child in "spans" id: <div id="spans"> <span>this span #1</span> <span>this span #2</span> <span>this span #3</span> </div> any appreciated. as not changing span variable in loop, condition same. if assign previous sibling variable, works: var div = document.getelementbyid("spans"); var spans = div.getelementsbytagname("span"); div.addeventlistener(&#

php - Bootstrap Modal with mysql data -

i have html table list of product name , id, upon clicking product name link wanted open modal , show item respect id. i wanted pass $code model , retrieve data. how should do? my code below.. <a href="#mymodal" data-toggle="modal" data-target="#mymodal" data-code="@<? echo $code; ?>">product 1</a> <a href="#mymodal" data-toggle="modal" data-target="#mymodal" data-code="@<? echo $code; ?>">product 2</a> <div class="modal fade" id="mymodal" tabindex="-1" role="dialog" aria-labelledby="mymodallabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"><span

foreign keys - SQL Server move data between databases -

we have requirement have move data between different database instance on regular basis. (for e.g. customers willing pay more better performance). not going 1 off. the database tables has referential integrity. there way in can done without rewriting sql script (or other method) every time migrate customers data? i came across how move data between multiple database's table while maintaining foreign-key relationships/referential integrity? . appears have write script every time migrate data (please correct me if misunderstood answer on thread). thanks edit: both servers using sql server 2012 (same version). azure sql server database. they not linked (no firewall between them) we transferring data, not whole database. customers opted pay more. the schema same in both databases. preyash - please see documentation on split-merge tool . split-merge tool enables move data between databases, have described, based on sharding key (e.g., customer id). 1 modifica

AngularJS - DRY (input fields, function, directive) -

i new angularjs , got in situation code starts repeat. thinking of creating new directive bit confused scope/isolated scope/directive's controller/etc. issues. here trying achieve. please have in mind code working without directive, put in theoretic way. i have 2 inputs, 1 city , 1 zip code. <input get-zip name="city" ng-model="city" ng-blur="getzip();" /> <input name="zip" ng-model="zip" /> when user enters city , leaves input field, function getzip() should called (passing param: value of city input) searches corresponded zip code , enters zip field. in situations have 2 city-zip inputs on same form. in case need pass zip input name or model calling function, can append zip value right input. what right way solve issue? thank in advance. put zip , city inputs directives inside directive. can have many of these pairs each own scope. the directive containing these elements: (function () {

sql - TSQL Interleaved sequence without join operations or user defined objects -

is possible create interleaved sequence first , last values going in turns untill data set empty without using joins , user defined functions or procedures? code type model price 1 hats 1298 700,00 1 shoes 1232 600,00 1 pants 1276 400,00 2 hats 1321 970,00 2 shoes 1121 850,00 2 pants 1433 270,00 3 hats 1750 1200,00 3 shoes 1233 600,00 3 pants 1434 290,00 4 hats 1298 1050,00 4 shoes 1121 850,00 4 pants 1401 150,00 5 hats 1752 1150,00 5 shoes 1121 850,00 5 pants 1408 270,00 6 hats 1298 950,00 6 shoes 1233 950,00 6 pants 1288 400,00 7 shoes 1232 400,00 8 shoes 1232 350,00 9 shoes 1232 350,00 10 shoes 1260 350,00 11 shoes 1233 980,00 12 shoes 1233 970,00 i have added spaces between rows interleaved sequence idea

javascript - change Jquery loaded page URL -

i have code on index.php page: $('.editcustomer').load("page1.php"); <select name="date" id="date" class="form-control"> ...options here... </select> i have on page1.php should change page1.php page1.php?date=1234 $(document).ready(function() { $('#date').on('change', function() { $('.editcustomer').load("page1.php?date=" + $(this).val()); alert($(this).val()); }); }); but not doing because cannot find .editcustomer div how can make change page1.php? you can change url using history object: manipulating history/url of page history.replacestate(null, null, "page1.php?date=" + $(this).val()); though i'm not sure looking for.

.htaccess - How can i rewrite rule from link a to link b htaccess -

i need rewrite http://localhost.com/cat1/test2/ to http://localhost.com/blog/cat/cat1/post/test2/ but 404 error page. rewrite index.php success can't rewrite link above here rule write in .htaccess dont' work : rewriterule ^/blog/cat1/test2/$ blog/cat/cat1/post/test2/ how can do. thanks. cat1/test2/ , blog/cat1/test2/ not same thing, reason why didn't work. use rule instead: rewriterule ^cat1/test2/$ /blog/cat/cat1/post/test2/ [l] however, if typo, , left out blog , add blog/ before cat1/ @ beginning.

How to run Z3 in Java from SMT-Lib standard? -

up now, can run z3 solution of equations in cmd on window: z3 -smt2 path_smt_lib_file but how can run z3 smt-lib standard input in java. thank in advance. you should able find need in javaexample.java in folder examples/java . check out api . in particular, if want read smt2 file, see context.parsesmtlib2file() .

python - 3 digit palindrome products -

Image
i'm trying find largest palindrome product of 2 3 - digit number. code, below. have no idea why isn't working. please!? according me should scan through possible combinations , provide me answer.. doesnt seem work. ideas ? there may other problems code, it's hard tell when can't see how file on computer indented. also, if b = 99: should if b = 99: , python interpreter gives syntaxerror if . please post actual code that's on computer, indented inside code block. your main problem you're not re-calculating product inside while loop. , test if it's palindrome you'll need convert product string inside loop. also, loop should test a remains valid, although that's not critical here, since when fix other stuff loop break before a becomes invalid.

regex - Check that property matches pattern -

using nant, i'd check property matches following pattern: [0-9a-za-z_] . i have tried far: <condition property="check-my-prop"> <matches pattern="[1-9a-za-z_]" string="${myprop}"/> </condition> <fail message="my-prop must match pattern [1-9a-za-z_]" unless="check-my-prop" /> nant throws error: invalid element <condition>. unknown task or datatype. code adapted ant, not nant. how can achieve same goal? <property name="checkmyprop" value="" /> <regex pattern="^(?'checkmyprop'[1-9a-za-z_]+)$" input="${myprop}" failonerror="false"/> <if test="${string::get-length(checkmyprop) == 0}"> <fail>myprop must match pattern [1-9a-za-z_]</fail> </if>

ruby - Merge two arrays of hashes based on comparison of multiple keys -

i have 2 arrays of hashes: a1 = [{ id: 12496, name: "robert", email: "robert@hotmail.com" }, ...] a2 = [{ id: 12496, name: "robert", order_no: 5511426 }, ...] i find hashes in a2 id , name fields match id , name fields of entry in a1 (without caring email or other items make way a2 ), , merge value of order_no a1 hash @ values. i.e. end with: [{ id: 12496, name: "robert", email: "robert@example.com", order_no: 5511426 } ...] also want ignore elements present in a2 not in a1. i'm doing following: a1.each |a1_hash| matching_hash = a2.find { |a2_hash| data_matches?(a1_hash, a2_hash) } if a2.present? a1_hash["order_no"] = a2_hash["order_no"] if matching_hash.present? a2.delete(a2_hash) end but there faster way? this can done quite cleanly using few of ruby's built-in methods. a1 = [{ id: 12496, name: "robert", email: "robert@hotmail.com" }, {

ios - AVAudioPlayer with remote control events -

Image
i have problem work avaudioplayer . used avaudioplayer play audio resource file. use [[uiapplication sharedapplication] beginreceivingremotecontrolevents]; [self becomefirstresponder]; to handle remote control event when in background mode (lock screen) press pause button on lock screen, remote control events hidden, don't change play button. though don't set code endreceivingremotecontrolevents code handle remote control events - (void)remotecontrolreceivedwithevent:(uievent *)event { //if remote control event handle correctly if (event.type == uieventtyperemotecontrol) { if (event.subtype == uieventsubtyperemotecontrolplay) { [audioplayer play]; } else if (event.subtype == uieventsubtyperemotecontrolpause) { [audioplayer pause]; } else if (event.subtype == uieventsubtyperemotecontroltoggleplaypause) { [self toggleplaypause]; } } }

jquery - Disable fade In effect on second click of the element -

i have created custom jquery tab, it's working fine there need small change don't need fadein effect on second click of current tab item means there need $(".tab_container") show normally. how can achieve that? //custom tab $(".tab_container").hide(); $('.tab_container:first').show(); $('.tab ul li a').click(function () { var tab = $(this).attr("href"); $('.tab ul li a').removeclass('active'); $(".tab_container").hide(); $(this).addclass('active'); $(tab).fadein(); return false; }); fiddle : http://jsfiddle.net/nikhilvkd/h5maycuc/ i've updated code shown below. i've added variable called "currenttab" , hold current tab name. time when click on tab,checking selected tab variable "currenttab". if condition true, using jquery show() method instead of fadein() show tab. else using fadein() method , update "currenttab" varia

From php multidimensional array get html ul li ul li... with less loops (using less system resources) -

have php array array ( [0] => array ( [numberrenamed] => 2 [topicname] => contacts [upperlevelnumberrenamed] => 0 ) [1] => array ( [numberrenamed] => 3 [topicname] => legal services [upperlevelnumberrenamed] => 1 ) [2] => array ( [numberrenamed] => 1 [topicname] => services [upperlevelnumberrenamed] => 0 ) [3] => array ( [numberrenamed] => 4 [topicname] => accounting services [upperlevelnumberrenamed] => 1 ) ) from array want html this <div> <ul class="mnav-ul"> <li class="mnav-ul-li">contacts</li> <li class="mnav-ul-li">services <ul class="mnav-ul-ul"> <li>legal services</li> <li>accounting services</li>

extjs - Put a save button in the middle of the form -

Image
i have form 2 textfields aligned in 'vbox' format align 'stretch'. wish add save button should aligned in middle of form. how define button aligned in middle in usual alert ok button in middle of alert box. if can done without csss preferable. buttonalign : alignment of buttons added panel. valid values 'right', 'left' , 'center' (defaults 'right' buttons/fbar, 'left' other toolbar types). another way use dockeditems layout:'hbox' , pack:'center' ext.application({ name: 'fiddle', launch: function() { ext.create('ext.form.panel', { width: 300, bodypadding: 10, layout: { type: 'vbox', align: 'stretch' }, items: [{ xtype: 'textfield', title: 'contact info', name: 'name',

java - What happens to type if I derive non-generic class from a generic class? -

let say, have usual pojo called person . now, instance of arraylist<person> have type arraylist @ runtime due type erasure. if instance undergoes serialization/deserialization through library gson, desirialized object not arraylist<person> unless, of course, provide type token. now, here question. happens if create class (say persons ) follows: public class persons extends arraylist<person> { } will type information preserved here? deserialization mechanism able infer type indeed arraylist<person> , not raw type arraylist ? will type information preserved here? yes; example, this: final parameterizedtype supertypeofpersons = (parameterizedtype) persons.class.getgenericsuperclass(); system.out.println(supertypeofpersons.getactualtypearguments()[0].getsimplename()); will print person . is deserialization mechanism able infer type indeed arraylist<person> , not raw type arraylist ? it potentially could so, doesn&#

visual studio - Is it possible to add subscriptions? -

we have setup report deployed draft folder of server , manually move report folder. problem have lots of subscriptions needs recreated in ssrs interface every time , thats annoying. so possible setup subscriptions in visual studio each deployed version of report have subscriptions ready go? the project definition has event generator, trigger batch file difined, each time build new version event triggered. if want triggered event after running tasks of new build, write batch file trigger build , run task.

javascript - filter result using 2 JSON -

this saved localstorage, [{"industry_id":1,"merchant_id":2}] i want filter below result, hp. { "industries": [ { "id": 1, "name": "oil , gas", "merchant": [ { "id": 1, "name": "abc", }, { "id": 2, "name": "def", }, { "id": 3, "name": "ghj", } ] }, { "id": 2, "name": "it", "merchant": [ { "id": 1, "name": "apple", }, { &quo

java - ListView Shared Element Transition Issue -

i attempting create shared element transition between 2 activities. appears work find between 2 layouts, each containing single imageview. however, having issues getting transition work listview. the issue when user taps on first row, transition work expected. however, when second row tapped, origin of transition appears image of first row well! i have created simple list view custom row layout: row_detailed.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:weightsum="1"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textappearance="?android:attr/textappearancelarge" android:text="daft p

c# - The requested URL returned 500 - Internal Server Error -

i'm having problems in project asp.net mvc razor using kendo-grid. data model following: public partial class usuario { private string _id; public virtual string id { { return this._id; } set { this._id = value; } } private string _idperfil; public virtual string idperfil { { return this._idperfil; } set { this._idperfil = value; } } private string _identidad; public virtual string identidad { { return this._identidad; } set { this._identidad = value; } } private int? _iddeparea; public virtual int? iddeparea { { return this._iddeparea; } set { this._iddeparea = value; } } private char _forzarcambioclave; public virtua

asp.net mvc - Model binding for float fails -

Image
i'm trying send window's position server. model binding top fails. action method below: public void winclosed(window position) and window model: public class window { public decimal left { get; set; } public double top { get; set; } } in picture can see sample values: and javascript code: var position = this.wrapper.offset(); $.post("@url.action("winclosed", "home")", position); the first line relative kendo window. i've tried double , , float types in model. the decimal separator culture (fa-ir) / (forward slash) character. need replace . character / character. example var offset = this.wrapper.offset(); var l = offset.left.tostring().replace('.', '/'); var t = offset.top.tostring().replace('.', '/'); $.post("@url.action("winclosed", "home")", {left: l, top: t });

Unable to run LOOPS within Javascript Ruby on Rails View -

executive summary question 1: value of providing local variables render, when can access instance objects in controller? issue: can not run ruby loop within _error.js.erb file. goal of loop provide direct output $("#error_explanation") id regarding of i able run various other jquery commands illustrated below. i able run straight jquery commands leveraging ruby. dear friends, in create controller, within following: format.js { render "_error.js.erb", locals: {post: @post, errors: @post.errors.messages} } in view _error.js.erb, have 3 jquery queries, 2 of them work, third not work. this works. $("#error_explanation").append('<%= j pluralize(post.errors.count, "error") %> prohibited secret being saved: <p>'); works. $("#error_explanation").append('<%= post.errors.full_messages_for(:title) %>'); not work. $("#error_explanation").append(' <% post.errors.message

c# - Can visual studio designer show classes inheriting generic types? -

i trying clean designer errors in our solutions , ran following error: the designer not shown file because none of classes within can designed. designer inspected following classes in file: doubleattributetextboxbase --- base class 'numericattributetextboxbase' not loaded. ensure assembly has been referenced , projects have been built. the classes both defined in same assembly know it's not reference problem. i'm wondering if has fact base class generic. ideas? public class doubleattributetextboxbase : numericattributetextboxbase<double> public class numericattributetextboxbase<t> : textbox t : icomparable, icomparable<t> the base class class being designed must non-abstract , non-generic. make class inherits generic class designable. workaround insert trivial non-generic class in-between: public partial class doubleattributetextboxbase : numericattributetextboxbaseofdouble { public doubleattributetextboxbase()

html - PHP's DomXPath not working the way it was expected -

i'm trying parse html page: http://www.valor.com.br/valor-data/moedas for simple start, i'm trying td elements class="left" , echoing inner texts. i'm struggling understand why code: $finder = new domxpath($dom); $tds = $finder->query("//*[@class='left']"); foreach ($tds $td) { echo $td->textcontent; } gives me expected output (a bunch of words belong td elements aren't worth pasting here) while this: $finder = new domxpath($dom); $tds = $finder->query("//td[@class='left']"); foreach ($tds $td) { echo $td->textcontent; } finds nothing. i've tried $finder->query("//td") td elements, it's domxpath doesn't recognize tag names. has ever faced same problem? i have not tested, namespace issue. input page xhtml , has correctly declared xhtml namespace. therefore, need register namespace prefix , use prefix in query. so

php - Better regex for security and auditing? -

for personal use , work have written various regular expressions find variables in php. purpose of regex security reasons , in particular vet scripts , plugins. expression follows: \${1,1}[\w]+[" +"]{0,}=[" +"]{0,}['"][a-za-z0-9" "]+['"]+[;]{0,} the above regular expression find $vars , set to. use search entire directories , sites using dreamweaver. below example of kind of php variables found above regex. $var = 'sample'; $var = "sampletext" $var="sampletext" $$$var = "sampletext" $var = "sampletext" $var= 'sampletext'; $var = 'here sample text'; var = 'here more sample text'; you can see how there slight variation of above variables. use double quotes, single quotes, have semicolons others don't , there variations spaces. so, question, can simplify regular expression? have other regular expressions use vet , analyize code, php in part

ios - How to "invalidate" MFMessageComposeViewController (Obj-C) -

i have ibaction opens text message dialog when pressed, using mfmessagecomposeviewcontroller . have if statement containing statements , want make mfmessagecomposeviewcontroller "invalidated" if 1 of if statements true when pressed on same ibaction . so question simple, how "invalidate" mfmessagecomposeviewcontroller ? or @ least make dialog not appear? edit (code): if ([mfmessagecomposeviewcontroller cansendtext]) { nsmutablearray *recipients = [nsmutablearray array]; if (loadstring.length > 0) { [recipients addobject:loadstring]; } if (loadstring2.length > 0) { [recipients addobject:loadstring2]; } if (loadstring3.length > 0) { [recipients addobject:loadstring3]; } [controller setrecipients:recipients]; [controller setbody:thelocation]; [self presentviewcontroller:controller animated:yes completion:null]; } else { nslog(@"can't open text."); } } th

python - server is receiving two requests on single request sent by client -

i have written web server in python sends response "website coming soon!" client (client web-browser), problem when client sends single request like: http://localhost:13555 the server recieving 2 requests are: 1st request: get / http/1.1 host: localhost:13555 connection: keep-alive accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0 .8 user-agent: mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.81 safari/537.36 accept-encoding: gzip, deflate, sdch accept-language: en-us,en;q=0.8 2nd request: get /favicon.ico http/1.1 host: localhost:13555 connection: keep-alive user-agent: mozilla/5.0 (windows nt 6.3; wow64) applewebkit/537.36 (khtml, gecko) chrome/43.0.2357.81 safari/537.36 accept: */* referer: http://localhost:13555/ accept-encoding: gzip, deflate, sdch accept-language: en-us,en;q=0.8 but want 1st request received @ server because when doing operation on client-request 2nd request creating

unix - reconfiguring a Makefile -

i'm little new , trying build rather large project. in particular, source code executing lines gcc -wall -w -c -o setitimer-helper.o setitimer-helper.c gcc -lm setitimer-helper.o -o setitimer-helper this creates linker error because according c: undefined reference floor -lm must come after object files. i need know in source code can find , rearrange this. think it's in here, i'm unfamiliar unix. cc = gcc cflags = -wall -w ldflags = -lm all: setitimer-helper squish-pty squish-unix %.o: %.c $(cc) -c $< -o $@ %: %.c $(cc) $(cflags) $< $(ldflags) -o $@ clean: rm -f *.o setitimer-helper squish-pty squish-unix am correct? if so, how can fix this. if not, should look? thanks. change rule build binary put $(ldflags) @ end. %: %.c $(cc) $(cflags) $< -o $@ $(ldflags) when executed gcc command should like. gcc -wall -w setitimer-helper.c -o setitimer-helper -lm

javascript - How to use datepicker in dynamically created jQuery UI dialog? -

i have trouble active datepicker() in dynamically created jquery ui dialog(): index.html $(document).ready(function() { var $loading = $('<img src="./images/loading.gif" alt="loading">'); $('.page-popup').each(function() { var $dialog = $('<div></div>') .append($loading.clone()); var $link = $(this).one('click', function() { $dialog .load($link.attr('href')) .dialog({ title: $link.attr('title'), width: 600, height: 300 }); $link.click(function() { $dialog.dialog('open'); return false; }); return false; }); }); $( ".datepicker&

mysql - How would i execute a php while loop a specific number of times? -

im using bootstrap , main index page in php, have been trying dynamically display data database want display 5 of rows in database table. echo '<ul class="sort" id="rank_ul">'; $res = mysql_query("select * ifc order votes desc"); while($row=mysql_fetch_assoc($res)) {?> <li id="li<?php echo $row['id']?>"> <div class="tut-img"> <img src="<?php echo $row['img']?>" width="50" height="70" alt="<?php echo $row['title']?>" /> <div class="drag-label"></div> </div> <div class="title"> <a href="<?php echo $row['url']?>" target="_blank" title=""><?php echo $row['title']?></a>

JavaScript prototype and constructor -

i have following piece of code purpose of learning javascript. function pizza(type, slices) { this.type = type; this.slices = slices; } pizza.prototype.divvyup = function () { alert("the " + this.type + " pizza has been divvied up!"); }; var sausagepizza = new pizza("sausage", 8); sausagepizza.constructor.prototype.divvyup(); sausagepizza.divvyup(); if (sausagepizza.constructor.prototype.divvyup === sausagepizza.divvyup) { alert("yes equal"); } the thing when these 2 lines of code executed: sausagepizza.constructor.prototype.divvyup(); sausagepizza.divvyup(); though if statement next them ratifies equal far types , values concerned. first line gives me result reads "the undefined pizza has been divvied up" , second line turns out giving me little different result reads "the sausage pizza has been divvied up". i'm super confused why can't first line among these 2 read this.type variabl

c++ - Displaying 3D Textured models in Opengl -

i new opengl, , followed tutorial on internet. can load 3d models, , display them 2d texture wrapped on them... able create 3d textured model in blender, , export opengl program, have exact same model same 3d texture on it. know has uvs, , texture models cannot find out what.... can me, suggest tutorial, or make special texture loader me (in c++ if possible )? ps: again, how load 2d textures, , wrap them on 3d model, not want! i prefer .obj format import models blender. need write kind of obj loader. there tons of tutorials on how accomplish that. in nutshell need load positions, indices, normals, etc. .obj file. i watch whole series. (or needs last video) https://m.youtube.com/playlist?list=pleetnx-uptbxt9t-hd0bj31dsnwio-ywh in last video shows how use .obj loader. , texture loader provided in tutorial. if want export texture specified in blender theres line in .obj file contains path texture. load that.

javascript - Greasemonkey: Unable to move div classes -

i've been trying use personal grease/tampermonkey script use on twitch.tv currently i'm trying move stats , stream-config-status above dash-hostmode-contain. found this post , tried re-working fit want. had setup http://jsfiddle.net/7l2s180s/3/ pretty inexperienced failed. <div class="grid c7" id="controls_column"> <div class="dash-broadcast-control">title broadcast</div> <div class="dash-hostmode-contain"> not being hosted</div> <div class="dash-hosting-contain" style="display: none;"></div> <div class="dash-player-contain js-dash-player-contain">----</div> <div id="stats"> x people watching</div> <div id="stream-config-status">good quality</div> </div> my end goal this, haven't figured out 2 move yet. <div class="grid c7" id="c

how to center webview contents in android -

screenshot : https://camo.githubusercontent.com/7c4b76724b703bcded8aafbba9c012542726462c/687474703a2f2f692e696d6775722e636f6d2f716375554d664a2e706e6725374275726c253744 hi, there way can center text , image of articles? this layout file : <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ptr="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:id="@+id/header" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignparentright="true" android:layout_alignparenttop="true" android:gravity="center"> <textview android:id="@+id/title" android:layout_width="wrap_content" android:layout_height="

javascript - Track progress of file upload to google cloud storage via js? -

i'm wondering if possible track progress of file upload google cloud storage when using javascript client? have progress bar show user on how of file has been uploaded far. i'm using same upload code google gives on example page file upload. instead of using gapi.client.request api provided js library instead created xmlhttprequest , appended event listener event progress . seen following: const boundary = '-------314159265358979323846'; const delimiter = "\r\n--" + boundary + "\r\n"; const close_delim = "\r\n--" + boundary + "--"; var reader = new filereader(); reader.readasbinarystring(filedata); reader.onload = function(e) { var contenttype = filedata.type || 'application/octet-stream'; var metadata = { 'name': 'testing', 'mimetype': contenttype }; var base64data = btoa(reader.result);