Posts

Showing posts from February, 2011

c++ - Passing an object to a function taking a reference, an interview test -

i had interesting (or stupid) interview question. well, know code below not compile, not give answer on how modify class c make code compile. told answers test(c(1)); or void test(c c) unacceptable. can me? here's question: q11. following code compile? if not, make changes want class c in order code compile. class c { public: c(int i) {} ~c() {} }; void test(c &c) { } int main(int, char*) { test(1); return 0; } the code not compile. there no way make compile changing class c first because signature main wrong (char* never type of second argument). but if signature of main correct test(1); wants implicitly create temporary object of c , pass test . however, cannot bind temporary non-const reference, , can't see way change class c create implicit temporary can bind parameter test . edit: closest i've come putting friend void test(int i) { } c . compile sun's cc compiler fails compile g++ 4.4, 4.5, or 4.8 ideone. edi

javascript - Detecting if inputs match by having common elements -

i have 2 input boxes , trying compare them, in order see if have common elements. reason, though, not working. code: html: personal address line 1: <input type = "text" id = "persadd1" /> address line 1: <input type = "text" id = "addline1" /> <input type = "submit" value = "continue" onclick = "vali()" /> javascript: function vali() { var add1str = document.getelementbyid('persadd1').value; var add2str = document.getelementbyid('addline1').value; var arr1 = add1str.split(" "); var arr2 = add2str.split(" "); var arr3 = []; (var = 0; < arr1.length; i++) { (var j = 0; j < arr2.length; j++) { if (arr1[i] === arr2[j]) { arr3.push( arr1[i] ); if(arr3 !== ""){ alert("error"); } } } } } jsfiddle

javascript - Audio Glitch in jQuery -

i've developed audio player plays radio station's stream. host audio on streamon , when click play button in player in lower right of streaming widget audio, after buffering, plays via inserting iframe styled invisible. however, people on staff have complained if click on play button multiple times whilst it's loading, play multiple streams (as can seen here: glitched page ). so, on test page attempted below code prevent such scenarios occuring. however, audio isn't being loaded on requested (as can seen here: test page ). appreciated. <script> $playing = 0; $(document).on("click", "button#mute", function(){ $('iframe#audiostreamon').remove(); $playing = 0; }); if ($playing =0) { $(document).on("click", "button#play", function(){ $(this).after('<iframe id=&

ruby - Rails 4: How to upload files with AJAX -

i want upload files ajax. in past accomplished using magical jquery form plugin , worked great. i'm building rails app , trying things "the rails way" i'm using form helper , paperclip gem add file attachments. the rails docs warn form helper not work ajax file uploads: unlike other forms making asynchronous file upload form not simple providing form_for remote: true. ajax form serialization done javascript running inside browser , since javascript cannot read files hard drive file cannot uploaded. common workaround use invisible iframe serves target form submission. it seems clear there's no off-the-shelf solution. i'm wondering what's smartest thing do. seems have several options: use form helper , iframe trick. use form helper + load jquery form plugin submit file (not sure if play nice rails's authenticity token, etc) use form helper + paperclip + [some other gem] extend it's functionality allow ajax form submissi

security - @RunAs and Role Propagation -

glassfish-3.1.2.2. i have 1 servlet , 2 ejb in project. servlet--------->init--------------->print // ejb init code @stateless @runas("system") @declareroles({"system"}) public class init { @resource ejbcontext ejb; @ejb private print print; public void initialize() { system.out.println("**********" + ejb.getcallerprincipal().getname()); system.out.println("**********" + ejb.iscallerinrole("system")); print.printline(); } } // ejb print code: @stateless @declareroles({"system"}) public class print { @resource ejbcontext ejb; public void printline() { system.out.println("**********" + ejb.getcallerprincipal().getname()); system.out.println("*********" + ejb.iscallerinrole("system")); } } // execution result: info: **********anonymous (ok) info: **********false (ok) info: **********system (ok) info: **********false (? ) why getting second false (i expecting true)

Magento Disabled Product shows 500 internal server error -

i facing weird issue out here. for product, if disable admin end, , run product url in browser, shows me 500 internal server error. for eg: http://domain.com/product.html now if add random param url , again run it, gives me 404 error page expected. eg: http://domain.com/product1.html this thing happening whenever disable product live site while staging site working if disable product. what issue server error if product disabled admin ? i checked .htaccess , has no issues. thanks in advance. try disable compilation , see if error persists. bug, described here: http://www.magentocommerce.com/boards/viewthread/310970/ the suggested solution is: in lib/varien/autoload.php :: registerscope, change include include_once : static public function registerscope($code) { self::$_scope = $code; if (defined('compiler_include_path')) { // change include_once prevent including multiple times !!! //@include compiler_include_path . directo

sql - Checkbox hell - webmatrix/razor -

i'm having trouble checkboxes on site. here's code have far: @{ layout = "~/_sitelayout.cshtml"; websecurity.requireauthenticateduser(); var db = database.open("stayinflorida"); var rpropertyid = request.querystring["propertyid"]; var propertyinfo = "select * propertyinfo propertyid=@0"; var qpropertyinfo = db.querysingle(propertyinfo, rpropertyid); if(ispost){ var sql = "insert propertyinfo (fepool, fejac, fegames) values (@0, @1, @2) propertyid=@3"; db.execute(sql, request["check1"], request["check2"], request["check3"], rpropertyid); } } <form method="post"> <div> <input type="checkbox" name="check1" value="true" /> value 1 <br/> <input type="checkbox" name="check2" value="check2" /> value 2 <br/> <input type="checkbox" name="check3" value="c

.net - How to set environment variables for external app -

i developing .net 4.0 class, calls external app reads 1 parameter environment. however, environment class can modified thread. , there's obvious problem when using 2 instances of class need different value in variable. what correct way set independent environment variables when calling external application? note: have updated question, heavily changing wording, because asking wrong question. if comment seems out of place, maybe should check edit history.

c# - Prism PopupChildWindowAction in Desktop DLL missing -

i trying implement modal dialog in wpf prism desktop application. from prism guidance can see proper way should using interaction: <i:interaction.triggers> <prism:interactionrequesttrigger sourceobject="{binding confirmcancelinteractionrequest}"> <prism:popupchildwindowaction contenttemplate="{staticresource confirmwindowtemplate}"/> </prism:interactionrequesttrigger> </i:interaction.triggers> but popupchildwindowaction not available in microsoft.practices.prism.interactivity.dll library desktop, silverlight? i google many different implementations of modal dialog in wpf (prism), wondering why feature missing prism desktop dll , available in silverlight dll? use interaction service interaction request suggested more appropriate approach mvvm application. that's true exists in silverlight prism library , what can create own . cs : public class openpopupwindo

How to inherit from an ancestor in Java? -

i have abstract base class , have concrete classes b , c extending , implementing abstract methods. abstract class {...} class b extends {...} class c extends {...} now add functionality a, can not touch a, b , c. thought might possible write generic class d extending of concrete classes b or c. class d<t> extends <t extends a> {...} is possible? , if correct syntax?

javascript - Encrypt iOS and Decrypt Node.js AES -

i have searched high , low solution , encrypt on node.js server , objective-c client, , vise versa using aes (or other if appropriate) i relatively new cryptography, , understanding why encrypted text different in each language beyond knowledge. this have far: node.js crypto methods using cryptojs library - node-cryptojs-aes var node_cryptojs = require("node-cryptojs-aes"); var cryptojs = node_cryptojs.cryptojs; var texttoencrypt = 'hello'; var key_clear = 'a16byteslongkey!'; //encrypted + decrypted var encrypted = cryptojs.aes.encrypt(cleartext, key_clear, { iv: null }); var decrypted = cryptojs.aes.decrypt(encrypted, key_clear, { iv: null }); //outputs console.log("encrypted: " + encrypted); //encrypted: u2fsdgvkx1/ilxojqiw2vvz6dzrh1lmhgeqhdm3ouny= console.log("decrypted: " + decrypted.tostring(cryptojs.enc.utf8)); // decrypted: hello objective-c crypto methods using aescrypt library nsstring* texttoen

How to connect to a server using another server by ssh in shell script? -

the scenario like: server_a="servera.com" server_a_uname="usera" server_b="serverb.com" server_b_uname="userb" i want write shell script fist connect server a, , connected server b. like: #!/bin/sh ssh $server_a_uname@$server_a ...and ssh $server_b_uname@$server_b but not able it. connect server only. how can achieve it? you may able find previous question: how use bash/expect check if ssh login works depending on situation might execute remote ssh command , wait positive feedback. see: how use ssh run shell script on remote machine?

bash - Concatenate command string in a shell script -

i maintaining existing shell script assigns command variable in side shell script like: my_command="/bin/command -dosomething" and later on down line passes "argument" $my_command doing : my_argument="fubar" $my_command $my_argument the idea being $my_command supposed execute $my_argument appended. now, not expert in shell scripts, can tell, $my_command not execute $my_argument argument. however, if do: my_argument="itworks" my_command="/bin/command -dosomething $my_argument" it works fine. is valid syntax call $my_command $my_argument executes shell command inside shell script my_argument argument? it works way expect work, fubar going second argument ( $2 ) , not $1 . if echo arguments in /bin/command this: echo "$1" # prints '-dosomething' echo "$2" # prints 'fubar'

html - css mouseover effect bug only in firefox -

currently facing problem in css mouseover effect created. if have @ http://176.32.230.21/luciaphotography.co.uk/ using chrome works fine, whenever mouse on of images, see relevant category image mouse over. in firefox, work if notice there 2 problems: the images not being resized properly, can see text on swatches blurry. (more important) if notice when mouseover, first image goes smaller , can see category image on right of picture (you'll see mean). i'm not quite sure what's happening second problem not happen in internet explorer although first problem does. assum it's because i'm using ie9 , not 10. i'm using latest versions of chrome , ff. <div id="widget1" class="widget-container"> <div class="textwidget"> <a href="#"> <img class="bottom" src="images/editorial.png"> <img class="top" src="images/front1.png"

Define a sub-query in a Model-Defined Function in Entity Framework -

is possible define subquery in model-defined function in entity framework? have situation have customer object has history of names in table. want return current name part of customer object. the model-defined function might this: <function name="currentname" returntype="edm.string"> <parameter name="e" type="model.customer"/> <definingexpression> (select top(1) n.legalname entities.customernames n order n.effectivedate desc ) </definingexpression> </function> unfortunately, above doesn't work. error of: the result type 'edm.string' specified in declaration of function 'snccmodel.currentlegalname' not match result type 'transient.collection[transient.rowtype(legal_name,edm.string(nullable=true,defaultvalue=,maxlength=512,unicode=false,fixedlength=false))]' of function definition any suggestions? supposed work? sorry, refactoring our data model sto

c# - What using directive can I implement in my .cs file that will let me use the "WebPageExecutingBase.Href()" Method? -

i have .cs file generates html. within it, make code little more fool proof using webpageexecutingbase.href() method, have done in many cshtml files before (mainly use of tilde ~ ). however, links broken on generated html if include tilde: string html = "<a href=\"~/somefolder/somefile.cshtml\">link</a>"; //generates broken link. but can't seem import appropriate using directive use href() method in environment of .cs file alone. i have tried: using system.web; using system.web.webpages; and trying use webpageexecutingbase.href() , while "webpageexecutingbase" part shows in intellisense, "href()" not (and, in fact, generates server-side error demanding second 'object' argument, have used same method 1 argument multiple times before). i have tried info on here: http://msdn.microsoft.com/en-us/library/system.web.webpages.webpageexecutingbase(v=vs.111).aspx no avail. i thought had right, i'm not

android - Video recording without specifing any output file -

i'm aware of there way of recording videos , saving specific file. here's code sample: mediarecorder recorder = new mediarecorder(); recorder.setaudiosource(mediarecorder.audiosource.default); recorder.setvideosource(mediarecorder.videosource.default); camcorderprofile cphigh = camcorderprofile .get(camcorderprofile.quality_high); recorder.setprofile(cphigh); recorder.setoutputfile("/sdcard/videocapture_example.mp4"); //saving file sd card recorder.setmaxduration(50000); recorder.setmaxfilesize(5000000); my question: possible record video without specifing output file, output byte array built record? target prevent saving file sd card. don't mind using 3rd party libraries, prefer not to. thanks in advanced! this idea has been used in spydroid project here check videostream class. the output set local socket, data retrieved localsocket stream , may manipulated desired (writ

c++ - Get pointer to class method with 'using' keyword -

i'm using visual studio 2010. why can't pointer class method "upgraded" public in child class? the following code not compile: #include <iostream> #include <functional> class parent { protected: void foo() { std::cout << "parent::foo()\n"; } }; class child : public parent { public: //void foo() { parent::foo(); } //this compiles using parent::foo; //this not compile }; int main() { child c; std::function < void () > f = std::bind(&child::foo, &c); f(); return 0; } it gives error: error c2248: 'parent::foo' : cannot access protected member declared in class 'parent' it compiles here . i think forgot add c++11 option in compiler. for example, gcc it's -std=c++11 or -std=gnu++11 . edit : seems here using alias declaration not implemented in visual studio version. in fact, here people talks compiler bug. the weird thing here is:

db2 - SQL Month comparison to declared variable -

select sc.locationid, --here result ( if month(date()) between 8 , 12 @semterm = 's1' else @semterm = 's2' end if )as @semterm student_class sc @semterm = sc.semester ; in db2 student management system. read access. desired outcome if jan thru june, s2 else if aug thru dec, s1. trying setup variable based on current date stamp month segregated assigned variable compared against column in student_class table. have tried case statements no luck. unable declare @semterm without error above select statement. looked @ clause solution also. out in left field? seems simple struggling syntax. part of larger statement locationid 1 column in student_class. you can't use if statement in simple select statement, must use case : select sc.locationid, --here result case when month(current date) between 8 , 12 's1' when month(current date) between 1 , 6 's2' else '' end semterm st

php - Composer install error -

i have been testing laravel in local development environment. when try upload sample project testing server, realize need upgrade php 5.2.17 5.3.15 (and install composer). started having problems. i use http install because composer complaining ssl (even when have extension=php_openssl.dll enabled i have following behavior: $ curl -ss http://getcomposer.org/installer | php -d detect_unicode=off -d allow_url_fopen=on #!/usr/bin/env php settings on machine may cause stability issues composer. if encounter issues, try change following: openssl extension missing, reduce security , stability of composer. if possible should enable or recompile php --with-openssl downloading... composer installed to: /xxx/composer.phar use it: php composer.phar $ php composer.phar ??????????$ so, every command try use on composer (help info) return ??? message. what's happening? thanks answering, can't see same error finally changed php.ini code (cli version) cover compose

Selectively remove Chrome browsing history -

Image
is possible selectively remove items google chrome browsing history? have website history wants default everytime start search specific letter, reference history re-find things. so remove history from, say, www.pythonismyfavoritest.com without removing everything; possible? try searching www.pythonismyfavoritest.com in search bar in chrome://history/ , remove each item clicking check box in left , hitting "remove selected items" button. the chrome history api works url such chrome://history/#q=hello&p=0

node.js - Javascript VM object returned has wrong reference? -

back again tedious problem. it's easier if explain context before problem. i'm trying build project (in node.js) allows program itself, inside via "input" (this network/console or really, lets assume via console this). so let's imagine have object: var database = { 'test': 123 } now console type: ;database.myfunc = function() { return database.test; } i run using vm.runincontext , copy database object afterwards (it needs sandbox'd because it's non-privileged users running it). works fine, , code works fine when executed in next command: ;database.myfunc() => 123 all far. @ point built own object dumper can export functions strings ( var str = new string(database.myfunc) ), works , exports them strings. this issue comes when import code file. i've tried code this: code = "retval = " + data.tostring(); sandbox = vm.createcontext({ "database": sb.database }); result = vm.runinnewcontext(code,

customization - Android: Create a toggle button with image and no text -

Image
is possible create toggle button in android has image no text? ideally this: ive seen similar posts answer change background want preserve holo light layout , swap text image. i need able programaticallly change image source, any ideas how make this? if cant done, there way can make normal button toggle on , off? can replace toggle text image no, can not, although can hide text overiding default style of toggle button, still won't give toggle button want can't replace text image. how can make normal toggle button create file ic_toggle in res/drawable folder <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_checked="false" android:drawable="@drawable/ic_slide_switch_off" /> <item android:state_checked="true" android:drawable="@drawable/ic_slide_switch_on" /> </selector> here @drawable/ic_slide_sw

Is Microsoft dropping support for SDF database files in Visual Studio? -

in visual studio 2013 there no longer option create .sdf sql server compact databases in webpages (webmatrix) websites. no longer able view .sdf database files in visual studio either. downloaded latest version of webmatrix open .sdf database webmatrix crashes when open website. when create new empty site , add existing files, crashes. i searched days way view , edit .sdf database , nothing working. can no longer navicat sql server app open database. cannot linqpad open .sdf database file, cannot compact viewer open or edit .sdf databases. can open .sdf databases sqlcetoolbox40.exe shows top 200 rows and won't let me edit tables. now i'm stumped. how view and edit .sdf database file? the answer yes: microsoft silently dropping support (as usual imho) sql compact edition. it started abandoning sql ce 3.5 in vs2012 continued dropping sql ce in sql management studio 2012 , in vs2013 you can use compactview or install sql server compact toolbox e

c# - How can I re-route a specific subdomain request to a different ASP.NET MVC controller? -

Image
i have asp.net mvc 4 web app. has default home page handles requests http://www.mydomain.com http://mydomain.com . have mvc area set can accessed via www.mydomain.com/foo/hello/ (where "foo" name of area , "hello" controller in area). if makes request foo.mydomain.com right now, route them default home page controller. requests foo subdomain root (eg. without specific area/controller specified) automatically rerouted /foo/hello/ controller. additionally, want requests "foo" area via www subdomain redirected "foo" subdomain. ie. want requests www.mydomain.com/foo/goodbye automatically redirected foo.mydomain.com/foo/goodbye i have, of course, looked @ lots , lots of other samples / questions , none of them seem address exact issue. i'm not sure if should solve issue routes, route constraints, route handlers, etc. additionally: application hosted on windows azure cloud services , don't have full control on iis setti

c# - Why is my array being flipped? -

public const t = true; public static bool[,] massmediumhorizontal = new bool[,] { {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t}, {t,t,t,t,t,t} }; as can see, array has width of 6 , height of 12. when compile it, width , height flipped. if place break point while debugging (visual studio feature) hover on variable's name, tells me size of array, , says 12x6 (width x height). of course, if want opposite of this, make original array 12x6 , end 6x12 after compiling. but why happen in first place? (i don't rotate ever after compiling) thinking arrays width , height confusing matter. measurements start outer-most dimension. your outer dimension 12, , i

sql - How to insert a list of numbers after an existing list of numbers -

i have column in database store pin numbers survey. list of numbers 5100 - 6674. need keep pin numbers there current survey have add new list of pin numbers same column. want make sure query have created insert new list column without affecting old list. there column gives survey type. need add new type new list example, have list of pins ranging 5100 - 6674 survey type of cln. next list range of numbers 8100 - 8855 survey type of tm. not want mess current survey running have 1 shot right, otherwise there big mess. here query have come with. declare @pin int set @pin = 8100 while (@pin <= 8855) begin insert survey (pin) values (@pin) select @pin = @pin + 1 survey pin > 6674 end update survey set type = 'tm' pin > 6674 thank or advice. i suggest set type @ same time pin , fix increment step: declare @pin int; set @pin = 8100; while (@pin <= 8855) begin insert survey(pin, type) values (@pin, @type); set @pin

git - BASH variables to SVN commit -

i'm migrating repositories , have created key variables use in subversion commit, important of commit message, , date trying commit variables part of svn ci operation, message easy can use svn ci -m"$(logmsg)" message, have no idea how explicitly add date , author fields commit, help? for (( r=$currev; r<$endrev+1; r++ )) git svn fetch -r $currev # move whitelists subversion folder find "$git_folder" \ -mindepth 1 \ -maxdepth 1 \ -regextype posix-egrep \ -not -regex ".*/(${exclude_pattern})$" \ -exec mv -t "$svn_folder" '{}' '+' # set opts svn logging cid=$(git log --format=oneline |awk '{print $1}') author='jd daniel <jdaniel@erado.com>' date=$(git log --date=iso |grep 'date' |awk -v n=2 '{sep=""; (i=n; i<=nf; i++) {printf("%s%s",sep,$i); sep=ofs}; printf("\n")}') logmsg=$(git log --oneline |awk -

linux - How can I retrieve logs between two timeframes using regex? -

i have huge log file, each line log entry it's own timestamp. how can retrieve logs in-between 2 specified timestaps (ie. start time - 22:00:00, end time - 23:00:00)? using bash, possible generate regex statement based on 2 input timestamps, may pipe command (such grep ): #!/bin/bash #this bare-bone recursive script accepts input of start/end timeframe #in 24-hour format, based on regex statement generated #select values in between 2 timeframes. please note script #has undergone optimization (i apologize reading difficulty, #did not occur me until might have use such script). #you free use, distribute, or modify script heart's content. #constructive feedback welcome. did best eliminate bugs, should #you find case generated regex incorrect timestamps, please #let me know. echo $0 - args passed: $1 $2 start_time=$(echo $1 | tr -d ":") end_time=$(echo $2 | tr -d ":") diff_char="" regex="" function loop () { diffcharval

Angularjs: input[text] ngChange fires while the value is changing -

ngchange firing while value changing (ngchange not similiar classic onchange event). how can bind classic onchange event angularjs, fire when contents commited? current binding: <input type="text" ng-model="name" ng-change="update()" /> this post shows example of directive delays model changes input until blur event fires. here fiddle shows ng-change working new ng-model-on-blur directive. note slight tweak original fiddle . if add directive code change binding this: <input type="text" ng-model="name" ng-model-onblur ng-change="update()" /> here directive: // override default input update on blur angular.module('app', []).directive('ngmodelonblur', function() { return { restrict: 'a', require: 'ngmodel', priority: 1, // needed angular 1.2.x link: function(scope, elm, attr, ngmodelctrl) { if (attr.type === &

c++ - How to animate two values using QTimeLine -

i have qgraphicsitem want animate size change. because of this, need vary both height , width of object on time. have used qtimeline in past single-variable animations , use here two-variable if possible. however, don't see qtimeline::setframerange() works 2 variables. how can accomplish this? there better qt class this? since animations have attached objects, graphics item qgraphicsobject , can expose relevant properties qt property system. since you're animating amounts qsizef , simplest way expose single property , use qpropertyanimation . in general, if have animate multiple properties in parallel, set them individual qpropertyanimation s. run in parallel using qparallelanimationgroup . it's of course possible use qtimeline , have interpolate between endpoints manually, basing on frame number, example. why bother. below complete example shows how animate 3 properties @ once: pos , size , rotation . main.cpp #include <qgraphicssce

python - How to check instanceof in mako template? -

i have variable myvariable want use in mako template. want able somehow check type before doing it. syntax check sort of information? know python has typeof , instanceof, there equivalent in mako or how it? pseudocode below: % if myvariable == 'list': // iterate throuh list %for item in myvariable: ${myvariable[item]} %endfor %elif variabletype == 'int': // ${myvariable} %elif myvariable == 'dict': // here you can use isinstance() : >>> mako.template import template >>> print template("${isinstance(a, int)}").render(a=1) true >>> print template("${isinstance(a, list)}").render(a=[1,2,3,4]) true upd. here's usage inside if/else/endif: from mako.template import template t = template(""" % if isinstance(a, int): i'm int % else: i'm list % endif """) print t.render(a=1) # prints "i'm int" print t.render(a=[1,2,3,4])

python - Real time timer -

i new python gentle. i have been trying write program counts or measures events in real time. @ moment using sleep command pause event doesn't take account time program takes run. have read on datetime module , can sort of see how used, bit stuck in implementing this. in short, want program counts 0 100 in real time seconds , milliseconds. your best bet (besides googling before posting question on so) might this: note time when program starts. start = datetime.datetime.now() do calculations sleep until 100 seconds after start . ( start + datetime.timedelta(seconds=100) ) note won't perfect, since there little overhead involved steps between accessing "current time" , going "sleep" (e.g. subtracting "current time" "wake-up time"). however, if sleep precision needs in seconds, should okay. repeat needed. if, after trying out , need additional actual implementation of these steps, feel free come , post question

html - Align table headers to the rows -

Image
i trying create table fixed row headers (so during scrolling column heading stay) , have been able achieve but table headers not aligned rows below. have created jsfiddle that. output like: here sample extracted html. <head> <style> table { /*background-color: #aaa;*/ width: 800px; } tbody { /*background-color: #ddd;*/ height: 200px; width: 800px; overflow: auto; } td { } thead > tr, tbody { display: block; } </style> </head> <body> <div id="containerdiv" style="width: 800px"> <table id="dynamictable"> <thead> <tr> <th> id </th> <th> t

database - Are there any limits on MYSQL DB & Table Sizes -

i have mysql table 2m+ rows, , overall database size 2.3gb. phpmyadmin runs out of memory retrieving table, never pulling 2m rows. there limitations should concern myself with? my machine: 4 gb ram, 1x i3 540 3.06ghz 120gb ssd hd i use nodejs query database, use myphpadmin manage it php terrible pulling many rows of data. doesn't scale large memory usage or large arrays. if want php myadmin output table need php memory limit. your db should fine. think mysql limits on operating system itself. however, table performance degrade tables increase in size. point degradation of performance happens entirely dependent on table structure , use , system running on.

database migration - Retrofit DB for use with RoundHouse -

i'm looking getting our db source control. can't find info on best way retrofit existing dbs use rh. i can see tables created should script out , add them our db , things proceed there? or should bak of db , run rh restore flag? seems there should guidelines of this. if have insights please let me know. thanks have seen powerup? https://github.com/chucknorris/powerup this utility extract current items out of database idempotent roundhouse format. as far tables, can script out separately , put runaftercreate table. there little guidance in wiki on - https://github.com/chucknorris/roundhouse/wiki/roundhousemodes

java - Intellij can't find .png -

my intellij can't find local .png images. private string craft = "craft.png"; imageicon ii = new imageicon(this.getclass().getresource(craft)); the .png located in same directory java files. don't understand why isn't working. using maven build, tried alternating resources java, still no luck :( craft.png must placed src/main/resources , otherwise not copied classpath according maven rules. see this answer more details. your code should changed to: private string craft = "/craft.png"; here sample working project .

facebook - You must specify one of `href`, `id`, `profile_id` or `name` -

i dont know wrong. receive messages on website when i'm logged administrator. i'm using og tags <meta property="og:image" content="http://www.soychile.cl/imagenes/soychile-avatar.jpg"/> <meta property="og:title" content="acto de aniversario del golpe: tres candidatos presidenciales han confirmado su asistencia | soychile.cl"/> <meta property="og:url" content="http://www.soychile.cl/santiago/deportes/2013/09/03/197812/aniversario-del-golpe-tres-candidatos-presidenciales-han-confirmado-su-asistencia.aspx" /> <meta property="og:description" content="evelyn matthei, ricardo israel y alfredo sfeir aceptaron la invitaci&#243;n del gobierno. rechazaron michelle bachelet, marcel claude, tom&#225;s jocelyn-holt y roxana miranda. franco parisi est&#225; en duda." /> <meta property="fb:app_id" content="number" /> <meta property="fb:

ios - MDM payload to wipe an OS X device -

i looking correct payload wipe os x device enrolled through mdm. payload works ios devices , mdm documentation states supported os x devices: > <?xml version=""1.0"" encoding=""utf-8""?> > <!doctype plist public ""-//apple//dtd plist 1.0//en"" ""http://www.apple.com/dtds/propertylist-1.0.dtd""> > <plist version=""1.0""> > <dict> > <key>command</key> > <dict> > <key>requesttype</key> > <string>erasedevice</string> > </dict> > <key>commanduuid</key> > <string>2349d04b-d0ba-404b-afae-4863f85cbba6</string> > </dict> > </plist> currently if send payload os x device following error in error chain: findmymac 'erasedevice' error any ideas? in order l

PHP cent use global variable in class method -

i trying make $var1 work on many different method var1 outcome of extract() array contains url parts exp: $url = 'localhost/site/classname/edit/254/...'; $arr[var1] = 'edit'; $arr[var2] = '254'; $var1 = 'something'; class myclass{ function dosomething(){ echo $var1; } } $obj = new myclass(); $obj->dosomething(); output: notice: undefined variable: var1 in.... is there way fix it?? 2 ways fix it: first, best - passing variables function arguments: $var1 = 'something'; class myclass{ function dosomething($var){ echo $var; } } $obj = new myclass(); //you pass constructor $obj->dosomething($var1); second, working, considered bad practice : $var1 = 'something'; class myclass{ function dosomething(){ global $var1 ; echo $var1; } } $obj = new myclass(); $obj->dosomething();

java - Is RabbitMQ's AMQP.BasicProperties.Builder thread-safe? -

title pretty self-explanatory. is amqp.basicproperties.builder thread-safe? citations/sources? i can't find indicates either way... no, amqp.basicproperties.builder not thread-safe. tested using following class: package com.anarsoft.agent; import java.util.concurrent.atomic.atomicinteger; import com.rabbitmq.client.amqp; public class testrabbitmq extends thread { static final amqp.basicproperties.builder builder = new amqp.basicproperties.builder(); static final atomicinteger threadcount = new atomicinteger(); public void run() { builder.clusterid("444").build(); threadcount.decrementandget(); } public static void main(string[] args) throws exception { for( int = 0 ; < 8 ; i++) { testrabbitmq testnumberformat = new testrabbitmq(); threadcount.addandget(1); testnumberformat.start(); } while(threadcount.get() > 0) { thread.sleep(1000); } } } http://vmlens.com shows

c# - Add XElement only if value exists -

i'm creating xdocument using linq-to-xml, this: order order = getorder(); xdocument doc = new xdocument( new xelement("purchaseorder", new xelement("name", order.name), new xelement("address", order.address), new xelement("shipper", order.shipper) ) ); so order not have shipper, null. in case, don't want include shipper element @ all. how can inline in code when creating doc? i form xml in parts instead of forming of @ once. ( easier read, easier debug ) xdocument doc = new xdocument(); var order = new xelement("purchaseorder", new xelement("name", order.name), new xelement("address", order.address)); if(order.shipper!=null) order.add(new xelement("shipper", order.shipper)); doc.add(order);

How to test that Akka actor was created in Scala -

i'm trying write test verify actor below creating heartbeatexpireworker , heartbeataccepter, have no idea how it. first thinking use mockhito mock or spy in place of context , verify called actorof, can't figure out way inject context without breaking akka testing framework. then, thinking send identify message workers verify exist. occurred me that wouldn't work either because akka testkit doesn't seem create children actors of actor under test. can take in testprobes can stand in neighboring actors. class heartbeatpumpworker(chatservice: chatservice, target: heartbeatmessagecmd) extends actor actorlogging workersreference { val heartbeatinterval = chatservice.getheartbeatinterval val tick = context.system.scheduler.schedule(0 millis, heartbeatinterval millis, self, sendheartbeat(target)) override def poststop() = tick.cancel() def receive = { case sendheartbeat(command: heartbeatmessagecmd) => log.debug("sending heartbeat&quo

how to consume php web service with php -

i have come across issue call web services api.since new maybe 1 share ideas on how solve issue. the api connecting using cert file authenticated. setting cert option in nusoap class getting time out error. so question is, have install certificate in user running the web server (in case iis 7). able access wsdl without problem using certificate installed in browser not when make call web service(i conection timeout). i not sure if environment running nusoap/php under iis 7 or certificate file self. any ideas helpful. thank you. after couple of change still not able connect api. below request: $request_xml = <<<eod <soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"> <soap-env:body> <prequal1207 xmlns="http://www.qwest.com/ppo/"> <wtn>3037555034</wtn>

loops - SAS: Creating multiple datasets at once from an excel file -

i have excel file 500 stock tickers. wish extract big sas dataset each stock's returns , additional observations. before, 20 stock tickers, follow: data s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14 s15 s16 s17 s18 s19 s20; set tick; if stock='dis' output s1; if stock='aa' output s2; if stock='qcom' output s3; if stock='fb' output s4; if stock='amgn' output s5; if stock='amzn' output s6; if stock='axp' output s7; if stock='nws' output s8; if stock='intc' output s9; if stock='krft' output s10; if stock='cb' output s11; if stock='celg' output s12; if stock='cmcsa' output s13; if stock='cost' output s14; if stock='csco' output s15; if stock='yhoo' output s16; if stock='dell' output s17; if stock='vod' output s18; if stock='dow' output s19; if stock='ebay' output s20; run; where tick sas dataset contai