Posts

Showing posts from March, 2011

Non-portable Excel VBA macro behavior -

i'm using excel 2010 , adding small vba macro spreadsheet. (the purpose of macro take data on active sheet , export csv file, that's tangential question.) macro determines output path file using thisworkbook.path . added custom button quick access toolbar activate macro. after getting working algorithm in place in experimental spreadsheet (test.xlsm, stored in 1 path), made copy of spreadsheet in path , renamed _database.xlsm. opened _database.xlsm , ran macro. surprise, file written original path, not new one. , looking down @ windows toolbar, saw excel had opened original file on in original path well. after lot of jiggering around code tweaks, checking properties , such found prevent opening copied spreadsheet, removing quick access toolbar button, re-adding it, , saving file. questions are: why isn't macro "independently portable" along spreadsheet? i.e. why copy maintain kind of tie original sheet? is there way can create or modify macro m

c++ - Passing array of objects among classes -

afternoon all, first question on stack overflow -- best clear. i have created array of objects "objects2[arraysize]" class "class 2" must referenced both in class 1 , main() function. class1.h class class1 { public: void parsefunction(several parameters); private: int othervariables; }; class1.cpp #include "class1.h" void class1::parsefunction(several parameters) { for(int = 0; < arraysize; i++) { objects2[i].somememberfunction(); } } main #include "class1.h" main() { class2 objects2[arraysize]; //arbitrary array size class1 object1; object1.parsefunction(some parameters); for(int j = 0; j < arraysize; j++) { objects2[j].someothermemberfunction(); } } i have simplified best of ability, , point of readability. goal able access these objects "objects2[arraysize]" multiple classes, struggling getting pointers work. have intentionally opted use fixed array size rather vector a

ms office - How do I substitute one entry for another an MS Access report? -

i started working ms access 2010, , trying generate labels form have created. in form, 3 pieces of information put in user: style, color code, , unit of measure (uom). style numbers appear same way on form , in report, , have been able work. however, color code, need both inputted color code , actual color show on report. have table has of color codes corresponding color names. cannot figure out how text box supposed show color name show it. know virtually no sql, found information on on internet , pieced code in controlsource text box color name supposed in: =(select [description] [color] where([forms]![box label form]![thirdjoined]=[color]![colorcode])) [description] name of column within [color] table gives actual color name. [box label form] name of form. [thirdjoined] name of input text box within form. [colorcode] name of column within [color] table gives color code. this code doesn't work, , results in #name appearing in print preview view. how can work, ei

javascript - How do I get the global coordinates of a grouped svg element? -

suppose have following document (fiddle) : <svg> <g transform="translate(50,50)"> <rect width="20" height="20" style="fill:black;"> </g> </svg> how global coordinates of rect element assuming don't know it's in group? it kind of hard find. searching methods of svgelement results in pages saying svgelement has no methods! in fact have ton of methods, inherited: http://www.w3.org/tr/svg/types.html#interfacesvglocatable depending on want can use result of getctm or getscreenctm transform svgpoint , , learn element is: root = document.getelementbyid('root') rec = document.getelementbyid('rec') point = root.createsvgpoint() # top-left relative svg element ctm = rec.getctm() console.log point.matrixtransform(ctm) # top-left relative document ctm = rec.getscreenctm() console.log point.matrixtransform(ctm) http://jsfiddle.net/kitsu_eb/zxvax/3/

ssh - How to determine what ports X is listening on? -

my use case running nx on ssh , local proxy connects remote host via tunneling. because it's tunneled, tell nx connect localhost:port. problem need perform x authentication , if hit local x server accident instead of remote one, authentication error. how can determine port local x server listening on can avoid when setting tunnel? my current workaround avoid tunneling local port has application listening on it. it's screen number + 6000. example, if $display :5 port number 6005

Moving MySql from windows server to linux -

moving old win2003 server new vm server (our choice win or linux) if go linux there problems converting current tables? moving mysql/windows same version of mysql/linux you can mysqldump databases follows: c:\> mysqldump -uroot -p --routines --triggers --flush-privileges --all-databases > mysqldata.sql move mysqldata.sql linux box , run reload mysql -uroot -p < mysqldata.sql moving mysql/windows higher version of mysql/linux you can mysqldump databases except mysql schema !!! why? mysql has grants user in main table called mysql.user . for each major release of mysql, mysql.user has following number of columns: 43 columns in mysql 5.6 42 columns in mysql 5.5 39 columns in mysql 5.1 37 columns in mysql 5.0 31 columns in mysql 4.0/4.1 i have discussed mysql.user 's column arrangement before may 01, 2013 : can find out version of mysql data files? dec 24, 2012 : backup , restore "mysql" database jun 13, 2012 : fastest wa

Using an array through a switch() statement in Javascript -

i'm trying develop simplified poker game through javascript. i've listed possible card combinations given player might have in hand ordered value, this: switch(sortedhand) { //pair case [1,1,4,3,2]: sortedhand.push(1,"pair"); break; case [1,1,5,3,2]: sortedhand.push(2,"pair"); break; case [1,1,5,4,2]: sortedhand.push(3,"pair"); break; case [1,1,5,4,3]: sortedhand.push(4,"pair"); break; case [1,1,6,3,2]: sortedhand.push(5,"pair"); break; case [1,1,6,4,2]: sortedhand.push(6,"pair"); break; case [1,1,6,4,3]: sortedhand.push(7,"pair"); break; case [1,1,6,5,2]: sortedhand.push(8,"pair"); break; case [1,1,6,5,3]: sortedhand.push(9,"pair"); break; case [1,1,6,5,4]: sortedhand.push(10,"pair"); break; even though "sortedhand" array stores values succesfully (as i've seen through console.log), switch() sta

python - How can I replace a class @property's len(..) return with a custom __len__() procedure? -

when class defined ( ex. class myclass ), possible replace returns len(my_class_instance) using def __len__(self) . how can apply custom class @property in below scenario? class carwash(object): def __init__(self): self._queue = [1, 2, 3] @property def queue(self): return self._queue when len(car_wash.queue) called, don't want list's len returned replace custom __len__ procedure, since want query db first. how can this? if don't want list.__len__ called, don't return list: def carqueue(list): def __len__(self): return something_dubious() # if you're going override len, make sure overide `__iter__` # , `__getitem__` class carwash(object): def __init__(self): self._queue = carqueue([1, 2, 3]) @property def queue(self): return self._queue

Boolean boxing in Java 1.3 -

for reason have maintain java 1.3 project. use boolean seems give them default values have box them this boolean disableallthethings = new boolean(false); is there way have automatically constant somewhere such boolean disableallthethings = false_constant; it not important feels weird box booleans. there no boxing in example, create unnecessary object. how using constant provided boolean class (link 1.3 api) instead: boolean disableallthings = boolean.false;

rest - AFIncrementalStore - best design to prevent some records from being updated -

here use case: i using afincrementalstore, in standard way when offline, user still able update records i set own queue upload edited records , process queue when online when online refetch data i want make sure updated records don't re-updated old data server when online whenever edit record, flag in core data 'edited', , clear flag when sent server the goal is: when results server, if results exist in core data, flagged 'updated' or 'deleted', don't want them refreshed values server i looking best design achieve that, out of box if possible. avoid subclassing.

visual c++ - Transform an operation to generic method -

i working in visual c++, on .net, because need method available on language. want obtain frames per second of video file. best make creating project main() method, in (after debug) see result saving fine in res variable. void main() { // initialize com library coinitialize(null); // property store video file ipropertystore* store = null; shgetpropertystorefromparsingname(l"c:\\users\\public\\videos\\sample videos\\wildlife.wmv", null, gps_readwrite, __uuidof(ipropertystore), (void**)&store); // frame rate propvariant variant; store->getvalue(pkey_video_framerate, &variant); int res = variant.intval; store->release(); } now, want create method generic, in order obtain framerate of video. example, if method's name framerate: char* path = "c:\\users\\public\\videos\\sample videos\\wildlife.wmv"; int fps = framerate(path); thanks does not work? int getframerate(std::wstring p

operators - MySQL <> not working - returning those results -

i'm having problem <> (not) operator. i'm trying retrieve rows habbo_name not equal 2 given, still returning rows. has got suggestions how fix this? code: <?php $query = "select `user_id`, `rank`, `habbo_name`, `rating`, `branch` `personnel` status='active' , `rating` '%(sdp%' or `rating` '%/sdp)%' , (`habbo_name` <> '-jose,' , `habbo_name` <> 'tharuka$') , status='active' order `habbo_name`"; $result = $con->prepare($query); $result->execute(); while($row = $result->fetch()) { echo "<b>sdp:</b>&nbsp" . htmlspecialchars($row['habbo_name']) . "<br>"; } ?> result: sdp: -jose, sdp: -wyatt- sdp: cpt.black sdp: dr.jacobson sdp: malwarebyte sdp: nshadow sdp: tharuka$ (dudestetson) and has higher precedence or , when mixing both operators 1 ne

html - How to put horizontal dropdown menu bar -

i've faced problem putting horizontal sub menu bar. basically, can vertical dropdown menubar, haven't idea how make horizontal dropdown menu bar. can: http://jsfiddle.net/esxt9 but need this: https://www.dropbox.com/s/idx2r5bkbuzd1t0/horizonatl-sub-menubar.png i want css. thought, have change code: .nav ul ul { position: absolute; left: 0; right: 0; display: none; z-index: 5; } i removed left:0, right: 0, gave width 100%. but, won't work. can't idea should do. please, me. give width inner ul , float li inner ul http://jsfiddle.net/esxt9/1/ .nav ul ul { position: absolute; width:1000px; left: 0; right: 0; display: none; z-index: 5; } .nav ul ul li { float:left; margin: 0; }

setting a value for index.php page -

is there way set value index.php page on first load? i index.php load "index.php?subject=1" when loads first time. value change move around in site don't want fixed value. some 1 sugested if(empty($_session['visited'])) { //do stuff $_session['visited'] = true; } i cant seem work function. find_selected_page() function find_selected_page () { global $current_subject; global $current_page; if (isset($_get["subject"])) { $current_subject = find_subject_by_id ($_get["subject"]); $current_page = find_default_post($current_subject ["id"]); } elseif (isset($_get["page"])) { $current_subject = null; $current_page = find_page_by_id ($_get["page"]); } else { $current_page = null; $current_subject = null; } } index.php <?php require_once($_server['document_root'].'/session/session.php'); require_once($_server['document_r

ios - UITableViewCell content of previous row is still visible on Cell reload -

Image
i have uitableview has 2 different custom uitableviewcell 2 different unique identifiers. i load first custom uitableviewcell on load , second custom uitableviewcell on cell select . i know problem related way reusing cells. i've tried using routinesearchselectedresultcell * cell = (routinesearchselectedresultcell*)[tableview dequeuereusablecellwithidentifier:nil]; , result new uitableviewcell empty , properties not populated. i've tried [[[cell contentview] subviews] makeobjectsperformselector: @selector(removefromsuperview)]; give me same results. how go around problem?? - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { if (idp && idp.row == indexpath.row ) { return [self tableviewroutineselectedresult:tableview cellforrowatindexpath:indexpath]; } nsstring *cellidentifier = @"routinesearchcell"; routinesearchcell * cell = [tableview dequeuereusablecellwi

java - Define Hibernate SQL logging from log4j -

i use slf4j (with log4j binding) of projects' logging system. i'm rolling sleeves hibernate first time, , see 1 can enable/disable printing of sql statements (as executed hibernate) using following property in hibernate.cfg.xml file: <property name="show_sql">true</property> is there way specify inside log4j config xml instead of inside hibernate config? i'd unify of logging settings 1 configuration file. typically they're done setting following logger debug (via log4j.properties file). don't need change hibernate.cfg.xml log4j.logger.org.hibernate.sql=debug

objective c - Possible to set multiple parent entities for Core Data NSManagedObject? -

i have created following example core data nsmanagedobject subclasses: pbcommentableobject : nsmanagedobject // allow comments on object @property (nonatomic, retain) nsset *pbcomments; // unordered set of pbcomment objects pbcomment : pbcommentableobject // allow comments on comment @property (nonatomic, retain) pbcommentableobject *target; pblist : pbcommentableobject // allow comments on list @property (nonatomic, retain) nsorderedset *pbordereditems; // ordered set of pblistableobject objects pbstring : pblistableobject // allow strings added lists @property (nonatomic, retain) nsstring *pbtext; pblistableobject : ???? // i'd both pblist , pbstring pblistableobjects @property (nonatomic, retain) pblist *pblist; the problem having following behavior: lists ( pblist ) can hold ordered list of strings ( pbstring ) or other lists ( pblist ). allow comments ( pbcomment ) on lists ( pblist ) , other comments ( pbcomment ) not strings ( pbstring ) is possible do? t

javascript - How do I provide source-level debugging for a language like VS does for TypeScript? -

i understand concept of using source maps javascript make debugging easier minified scripts, etc. don't how source-level debugging works typescript in visual studio ( http://blogs.msdn.com/b/typescript/archive/2012/11/15/announcing-typescript-0-8-1.aspx ). for example, if create own language compiles/translates javascript, how interface browsers provide kind of source-level debugging? there standard protocol this? how visual studio it? update to clarify more, let's invent language called caffeinated beverage script compiles javascript. build ide language , want able set breakpoints, step through code, inspect variables, etc. in ide while javascript runs in browser. how ide communicate browser on level? you might consider webkit's remote debugging api: https://developers.google.com/chrome-developer-tools/docs/protocol/1.0/index i believe that's sublime web inspector uses. https://github.com/sokolovstas/sublimewebinspector

xsd - Is "ref=" the only directive that tells an XML schema to treat a global as a reference? -

Image
i going through xml tutorial right , while think understand concept of "reference", trying understand advantage of using it. if @ example given tutorial: the difference between reference element (e.g. "person") , "embedded" (?) element element uses it, uses ref= instead of name= . since both referenced element , non-referenced element global , avoid duplication defining complex type, is makes referenced element is? using local elements (non-global elements name attribute) allows have different types same element depending on occurs, example project/status might have different validation rules person/status. can used readability, though there disadvantages: local elements cannot reused, , cannot appear in substitution groups. i tend use local elements simple elements (elements having simple type), , make complex elements global.

c# - Loop through Dictionary to find dataType if FirstOrDefault is Null -

i have data comes through , generate datatable based on type in dictionary list of string objects. problem i'm having code checks dictionary firstordefault build datatable, if of values null things blow quickly. is there way can take following code , iterate through rest of dictionary values if particular key.value null within first set of values try , find valid type? i tried checking , setting type string, if column has real values in fails (for instance datetime when set string). i'd loop through key.key type values in question try , discover if of cells have type , if null string work. public datatable(ienumerable<dictionary<string, object>> source) { if (source != null) { var firstitem = source.firstordefault(); if (firstitem != null) { //foreach (var item in source) //{ // var u = item.values; // var t = item.keys;

javascript - How do I fix two bugs for my jQuery form Validation code? -

my code adds class error if field invalid , if field valid, error class removed , form submitted normally. i having trouble figuring out 2 small bugs form validation code created. bugs listed below: 1) if enter correct content within 1 field, , click submit, length of error class not update on first submit click. takes 2 submit clicks length update. (view console.log) 2) if change content of input field , click submit (all works well, error class removed) if decide delete updated text & leave field blank, error class not re-applied. would great if can assistance solving this. please let me know if unclear. thanks in advance: jsfiddle $('form.requiredfields').submit(function(e) { var req = $(this).find('.req'), validateemail = function(email) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-za-z\-0-9]+\.)+[

android - Stopwatch that works on background -

are there sample stopwatch project ( or tutorial ) stopwatch timer shown in notificationbar , keep working if application closed ? a simple countdown timer work, , persist through onpause() if allow to. new countdowntimer(30000, 1000) { public void ontick(long millisuntilfinished) { mtextfield.settext("seconds remaining: " + millisuntilfinished / 1000); } public void onfinish() { mtextfield.settext("done!"); } }.start(); refer this source more information. can update textviews if need show timer. edit count specifically, try chronometer , can found @ this link . can find demo of in samples apk .

symbolic math - Workaround for Maple in MATLAB -

i trying matlab toolbox sostools work inside matlab r2010b (7.11.0.584) following error: ??? error using ==> maple @ 54 maple command not available. googling found out matlab stopped using maple @ stage , switched mupad. short of switching older version of matlab, there known workaround situation? a solution in form of installing maple symbolic toolbox engine not possible version of matlab. this outlines alternative possible solution, did not find concrete workaround spare work. recommend contact authors, or check octave versions same functionality. the change mupad problem that's been posted numerous times, , there useful discussion of differences between maple , mupad here: http://www.walkingrandomly.com/?p=178 for commands looks simple translator might work. of implementation apparently in parsing output mupad , turning maple generate. input mupad , maple apparently equal of time, read doc above. to write translator, redirect calls maple placi

html - PHP success on file upload -

i'm sure there simple solution can't see. i have form uploading stuff. when script completes uses header('location: admin.php?success') , if($_get['success']) { echo woohoo success } type message before rest of script run. the problem is want upload 2 files @ once can't because first part of script executed , nothing else. considered using boolean value set true or false , display message failed. i'd able upload several files in succession , receive success message each one. many thanks. relevant php: if(isset($_get['success']) && empty($_get['success'])){ echo '<h2>file upload successful! whoop!</h2>'; } else{ if(empty($_post) === false){ //check file has been uploaded if(isset($_files['mytrainingfile']) && !empty($_files['mytrainingfile']['tmp_name'])){ file stuff... if(in_array($fileext, $blac

c++ - How do I compare two different strings from two separate text files? -

i c++ rookie , not know doing wrong. assignment compare 2 different .txt files, each containing item along either number of items , price of item. trying print names , prices of items. lets using .txt file namesandquantity.txt includes: 3 books 4 pens and .txt file namesandprice.txt includes: pens 3.45 books 19.55 the code using prints out first match: #include <iostream> #include <fstream> #include <cmath> int main(){ string nameofitemp, nameofitemq; double priceofitem; int numberofitems; ifstream indata; ifstream indata2; indata.open("namesandquantity.txt"); indata2.open("namesandprice.txt"); while (indata>>numberofitems>>nameofitemq){ while (indata2>>nameofitemp>>priceofitem){ if (nameofitemp==nameofitemq){ cout<<nameofitemq<<endl; cout<<priceofitem; } } } this code prints out first line: b

python - regedit still shows deleted keys even after rebooting -

i using winreg.deletekey delete keys registry. have no problems using api; i'm getting weird problem where, if delete key hkey_local_machine\software, code runs , deletes (and if run again says cannot find key since deleted), key still shown in regedit after rebooting! i can edit values of key within regedit! if try delete key again, windowserror raised says can't find file specified though worked first time! does know what's happening? baffling, , can't seem find info on this. edit: apparently 32-bit application opens 32-bit key, not 64-bit key. when try open key so: akey = winreg.openkeyex(akey, subkey_str, 0, winreg.key_wow64_64key) i "access denied" error message. have tried running script runas, opening terminal admin. user account has administrator privileges, , event went far check privilege on key itself. administrator , users have full access key. any ideas why can't open it?

wpf - multipule text font size for font in one text box -

i have following code textbox1.text = "two of peak human experiences " textbox1.text = textbox1.text & "good food , classical music." textbox1.fontsize = "16" it shows 2 lines in same text box . how change font size each line of text , have them appear in same textbox? use richtextbox instead. richtextbox1.selectionfont = new font("arial", 12, fontstyle.bold); richtextbox1.appendtext("two of peak human experiences are"); richtextbox1.selectionfont = new font("tahoma", 16, fontstyle.bold); richtextbox1.appendtext("good food , classical music");

AppStart vs static constructor in ASP.NET WebPages -

i have static class in app_code folder: public static class sitedata { public static string adminemail{ get; set; } } the class have static members shared among users. in example, used adminemail . i know 2 ways of initializing adminemail : solution 1 : create _appstart.cshtml (c#) @{ sitedata.adminemail = "admin@mydomain.com"; } solution 2 : create static constructor in sitedata class public static class sitedata { public static string adminemail{ get; set; } static sitedata() { adminemail = "admin@mydomain.com"; } } both solutions initialize adminemail @ application start. here questions: 1) solution more appropriate in situation? 2) advantages , disadvantages of both solutions? 3) use of appstart in asp.net if static class can task? from can tell appstart.cshtml seems more integrated rest of webapp. http://www.asp.net/web-pages/tutorials/working-with-pages/18-customizing-site-wide-beh

Why we cannot define primary key ourself in mongodb? -

the _id field reserved primary key in mongodb . why mongodb designed this? , can define primary key myself? yes, can define own primary key collection. note mongodb drivers automatically generate unique _id values; however, can override _id value: eg. db.yourcollection.insert({_id:"myuniquevaluen",a:1,b:1}) you can create secondary indexes enforce uniqueness. refer below: http://docs.mongodb.org/manual/tutorial/create-a-unique-index/ i'm not sure if understand why part of question. mention _id primary key , serves point of ensuring uniqueness of document within collection, , means of retrieving documents unique id. it's purpose no different primary keys in other databases. why pre-defined? it's partly due fact mongodb assigns unique object id value automatically if don't specify 1 purpose. having standard _id field simplifies implementation.

Asana Connect (OAuth) can not get token -

Image
when using asana oauth token the https://app.asana.com/-/oauth_token return error no route found any help? thanks! create application in asana get url = 'https:// app.asana.com/-/oauth_authorize?client_id='+ setting.client_id + '&redirect_uri=' + setting.redirect_uri + '&response_type=' + setting.response_type you code, post code url'https:// app.asana.com/-/oauth_token?grant_type=authorization_code' + '&client_id=' + setting.client_id + '&client_secret=' + setting.client_secret + '&code=' + query.code + '&redirect_uri=' + setting.redirect_uri the access code issued 1 hour. post url 'https:// app.asana.com/-/oauth_token?grant_type=refresh_token' + '&client_id=' + setting.client_id + '&client_secret=' + setting.client_secret

sql - convert any query result into a string -

using sql server 2005 , tsql, i'm looking way convert result of query (eg. select * person.address ) big string such as: addressid addressline1 addressline2 1 1970 napa ct. null 2 9833 mt. dias blv. null 3 7484 roundtree drive null 4 9539 glenside dr null 5 1226 shoe st. null would cursor way go? i'd mechanism generic can convert result of query string. try 1 - solution #1 (works table structure): query: set nocount on; declare @sql nvarchar(max) , @tablename sysname = 'person.address' select @sql = 'select stuff((select char(10) + ' + stuff(( select [text()] = char(10) + '+ cast(' + c.name + ' char(' + cast( case when c.max_length = -1 or type_name(c.system_type_id) = 'uniqueidentifier'

jquery - stopPropagation() not working in IE -

having issues in ie. things fin in chrom/opera etc. in ie go click , toggleclass nothing happens. thought implementing cancel.bubble me not case. following html: <div class="title"> <h2>catamarans</h2> <div class="dateselect"> <div class="prev"> <p>prev</p> <a href="#" onclick="datechange('formatteddate')">< month</a> </div> <div class="next"> <p>next</p> <a href="#" onclick="datechange('formatteddate')">month ></a> </div> </div> and in jquery function datechange(dateinput){ //creating new instance of date based on date passed function var nextday = new date(dateinput); //the date change according date passed in 1 day 1 month nextday.setdate(nextday.getdate()+1); //the following go function formats date in such way vb

javascript - How do I mock the result in a $http.get promise when testing my AngularJS controller? -

after reading, seems recommended way call web service angularjs controller use factory , return promise that. here have simple factory calls sample api. myapp.factory('myfactory', ['$http',function($http) { var people = { requestpeople: function(x) { var url = 'js/test.json'; return $http.get(url); } }; return people; }]); and how call in controller myapp.controller('myctrl1', ['$scope', 'myfactory', function ($scope, myfactory) { myfactory.requestpeople(22).then(function(result) { $scope.peoplelist = result; }); }]); while works fine, able mock result passed in when then called. possible? my attempt far has produced nothing. attempt: //fake service var mockservice = { requestpeople: function () { return { then: function () { return {"one":"three"}; } } } }; /

c# - IIS Error This configuration section cannot be used at this path -

i facing strange behavior in have application thats hosted on 2 nodes. works fine on 1 node, on other throws following error, server error in '/***_service' application. configuration error description: error occurred during processing of configuration file required service request. please review specific error details below , modify configuration file appropriately. parser error message: configuration section cannot used @ path. happens when site administrator has locked access section using <location allowoverride="false"> inherited configuration file. source error: line 34: </context> line 35: </spring> line 36: <appsettings> i have compared applicationhost.config files on both boxes , same. not facing problem in dev environment too. missing something? can please give me pointers? thanks

opengl - Is ordering between glUniformBlockBinding and glBindBufferBase important? -

when using ubos, bind uniform block binding point. bind ubo same binding point: like: gluseprogram(programname); gluniformblockbinding(programname, uniformlocation, bindingpoint); glbindbufferbase(gl_uniform_buffer, bindingpoint, bufid); i have 2 questions on this: should specify gluniformblockbinding first or glbindbufferbase or order doesn't matter? if understanding correct, glbindbufferbase must called after have updated ubo data. if correct answers first question. gluniformblockbinding sets state in program (which why shouldn't calling every frame). glbindbufferrange sets state in opengl context. neither affects other until render, no, doesn't matter which. and yes, cannot call glbindbufferrange (or base, defined in terms of range) unless have allocated storage buffer object.

delphi - Splash screen with progress bar -

my database takes quite time load (it on network) thought display splash screen animation (progress bar or simple animation) keep user occupied.since everyone's guess when table open, can not use timer running progress bar. animated gif better choice. however, how can hide/free splash screen before table opens (and main form shows) ??? you can use ttimer , update tprogressbar inside until loading on . for the timer use function "on timer" put parameter interval 500 ms to finish when loading on make tprogressbar not visible , timer enabled value false , finallely show main form

html - How can a web page robustly switch to another page with client scripting? -

i see in javascript; sending user page , how change page within javascript references using window.location switch new page. possible have similar result including meta tag http-equiv refresh value. while these work advertised, need continue retry in event host application not available @ time client starts up. a cross-browser solution particularly appreciated. update: current solution suggested. initial ajax verify connectivity, followed update of window.location . concern 1 given - status can change between getting response , updating page reference. i update lower level element body.innerhtml , example, in page body, prefer change top level element cleanly switch on new page. the purpose of initial page bootstrap long running application uses ajax loop fetch updates of both content , periodic page refreshes. intent able drop off web display panels , have them automatically configure when connected network.

compilation - Compile multiple stylesheets with Compass, different output style and ".min" file name -

summary: using compass, need compile sass stylesheets twice different output styles , file names. i have config.rb: http_path = "/" css_dir = "assets/css" sass_dir = "assets/sass" # …more stuff… # output_style = :expanded which compiles assets ┗ sass ┣ style1.scss ┗ style2.scss to assets ┗ css ┣ style1.css ┗ style2.css what need accomplish output this: assets ┗ css ┣ style1.css ┣ style1.min.css ┣ style2.css ┗ style2.min.css where ".min.css" files contain minified css, obviously. so figured need come like: on_stylesheet_saved |filename| # switch output_style :compressed # compile again , include ".min" file name end can 1 provide me basic sample on how accomplish that? have not messed ruby far, coming basic understanding through reading i've been doing on topic. ;) bunch! i'd suggest yeoman , or custom grunt script.

mysql - Is installshield suited in this scenario? -

the scenario company asked me find solution is, install mysql create users , grand privileges create database install multiple exe files run 3-4 sql scripts. ok saw installshield features, looking @ nsis option company dont care if buy installshield or use free 1 dropped options, after 2-3 hours of researching found installshield best. but have 0 experience in field , cant tell sure if installshield can meet needs or if im overthinking scenario , there simple solution. any advise appriciated. i recommend not go installshield. better go wix (windows installer xml). in our company used installshield msi-project half decade , it's pain. when try demo-version looks nice , polished more , more requirements start notice there many bugs , using installscript custom actions bring in 90s. the syntax of wix (which pure xml) confusing , hard read in first time it's have makros , variables can use in markup on side. you can write custom actions in c# , ther

Sql subquery with inner join -

i've got these tables in database: tourist - first table tourist_id - primary key extra_charge_id - foreign key name...etc... extra_charges extra_charge_id - primmary key excursion_id - foreign key extra_charge_description tourist_extra_charges tourist_extra_charge_id extra_charge_id - foreign key tourist_id - foreign key reservations reservation_id - primary key ..... tourist_reservations tourist_reservation_id reservation_id - foreign key tourist_id - foreign key so here example: i've got reservation reservaton_id - 27 reservation has 2 tourists tourist_id - 86 , tourist_id - 87 tourist id 86 has charges extra_charge_id - 7 , , extra_charge_id - 11; is possible make sql query , name , id of tourist , of charges so output may this: tourist_id : 86 name:john extra_charge_id - 7 extra_charge_id - 11 tourist_id: 87 name:erika extra-charge_id:10 (here query made extra_charge_description of of tourists reserva

c - How to compile CHOLMOD library (SuiteSparse) from IDE -

for time trying create static cholmod lib suitesparse each other library (f.ex. umfpack) can easiy compiled ide (i used code::blocks on linux , visual studio on windows). when trying compile cholmod bunch of syntax errors like: t_cholmod_triplet.c(21): error c2061: syntax error : identifier 'template' i investigated there #defines missing (like pattern, real defines) , therefore definitions of template invisible. searched them in files , in makefiles found nothing. when typing make (on linux) library compiles fine. missing? you can use suitesparse metis windows package: https://github.com/jlblancoc/suitesparse-metis-for-windows credit: jose luis blanco (universidad de almeria); jerome esnault (inria).

jquery - How to add caption to thumbnail hover - Bootstrap? -

Image
i trying use thumbnail hover caption plugin bootstrap. http://sevenx.de/demo/bootstrap/thumbnail-hover-caption.html this code. <div class="thumbnail"> <div class="caption" style="display: none;"> <h4>caption title</h4> <p><a href="#" class="btn btn-inverse" rel="tooltip" title="" data-original-title="preview"><i class="icon-eye-open"></i></a> <a href="#" rel="tooltip" title="" class="btn btn-inverse" data-original-title="visit website"><i class="icon-share"></i></a></p> </div> <img src="http://placehold.it/600x400" alt="alt name"> </div> in page, there part 'slidein/out'. when hover on thumbnail s

pg - Upsert in Postgres Ruby -

i have seen other questions deal issue , know postgresql doesn't have inbuilt upsert , must done using 2 methods. code i'm using in ruby using pg gem. @db.exec_params("update crawled set url = $1, timestamp = $2 url = $1",[url,datetime.now]) @db.exec_params("insert crawled (url, timestamp) values ($1, $2) not exists (select 1 crawled url = $1)",[url,datetime.now]) however when run syntax error exec_params': error: syntax error @ or near "where" (pg::error) line 1: ...ert crawled (url, timestamp) values ($1, $2) not ... where mistake? just looking @ example have 2 questions. which of lines causing error? table should have been replaced table-name, shouldnt it? http://www.postgresql.org/docs/8.2/static/sql-insert.html

java - Apache commons-io FileUtils.deleteDirectory is not working properly -

i've problem commons-io fileutils.deletedirectory(file) . call fileutils.deletedirectory(new file("/tmp/dir")); directory structure is: tmp/ - dir/ - a/ - b/ - c.txt i try debug following results: i stop program in fileutils before c.txt deleted. if (!file.delete()) file present , can rename (it not locked guess then). file.delete() returns true , program continues normal way (the file still present, can't rename it) i stop program before b/ directory removed. if (!directory.delete()) c.txt still present in directory , delete() on directory returns false , "unable delete directory /tmp/dir/a/b/" exception thrown when program ends file removed, b/, a/, dir/ directories not. weird behavior me c.txt file exists after deletion , invoking delete on parent dir cause error then. file used java program. suggestions? idea how check in java if filehandlers still open file? update: fixed i'm stupid jerk, checked co

php - Infinite scrolling jquery ajax -

i'm using jquery ,ajax , php implementing infinite scrolling image database and code works 1 time when reach end of page , show me message "no more content" when there content in database here cod index.php <html > <?php include($_server["document_root"].'/db.php'); $query = "select * photo order photono desc limit 12"; $result = mysql_query($query) or die('query failed: ' . mysql_error()); $actual_row_count =mysql_num_rows($result); ?> <head> <title>infinite scroll</title> <script src="jquery-1.7.2.js" type="text/javascript"></script> <script type="text/javascript"> var page = 1; $(window).scroll(function () { $('#more').hide(); $('#no-more').hide(); if($(window).scrolltop() + $(window).height() > $(document).height() - 200) { $('#more')

SharePoint 2013 Event Receiver Assembly Error -

sorry, english bad, try explain mean. i made eventreceiver on developer pc on visualstudio 2012 , it's work on developer's sharepoint2013 server. i made wsp packgage, deployed client's sharepoint 2013 server, activated feature , error. could not load type 'microsoft.sharepoint.administration.spdiagnosticsservice' assembly 'microsoft.sharepoint, version=15.900.0.0, culture=neutral, publickeytoken=71e9bce111e9429c'. how understood it's sharepoint.dll version another, can't find version , don't know it's on clients server. i have same error. copied dll files , had same error. installed visual studio on clinet server , didn't help. think it's server configuration bad.

.htaccess - HTACCESS RewriteCond on multiple domains -

i'm trying setup htaccess rewrite rule ignores .co.uk index. so example, if goto www.mydomain.co.uk/mypage redirects www.mydomain.com/mypage however if goto www.mydomain.co.uk stays on www.mydomain.co.uk, hit inner page redirects .com address. if user comes in on www.mydomain.com stay on .com domain any appreciated. try adding these rules htaccess file in document root of www.mydomain.co.uk domain: rewriteengine on rewritecond %{http_host} ^(www\.)?mydomain\.co\.uk$ [nc] rewritecond %{request_uri} !^/(index\.(html?|php))?$ rewriterule ^(.*)$ http://www.mydomain.com/$1 [l,r=301] if don't want permanent redirect, remove =301 part rule's flag.

python - variable 'error' referenced before assignmentRequest -

in django application, have checks in form return error = "something". thing that error not defined unless there error. mycharacters = character.objects.filter(username_id=request.user.id) if(mycharacters.count() >= 5): error = true if not error: #save db the problem if there no error, error variable not exist. i have thought possibility in order avoid error, be: error = none #checks here if error == none: #save db but not sure whether best approach. is there way if error var not exist: in python? you can following: error = mycharacters.count() >= 5 if not error: ... update error = mycharacters.count() >= 5 if error: to_json = {"incorrect":"excedeed maximum"} else: # save db

c# - How to hightlight part of the text in datagridview column? -

i have search button finds particular text on button click. want hightlight text user searched not entire text. how do it? search code. private void button7_click_3(object sender, eventargs e) { string filterby; filterby = "stringtext '%" + textbox6.text + "%'"; ((datatable)datagridview1.datasource).defaultview.rowfilter = filterby; } any ideas? i don't think functionality available winform controls yet, devexpress has control searchlookupedit you're trying achieve. see here .

port - Weird behavior while weblogic bootup -

i trying boot weblogic ( 12c ) . i facing weird problem , while weblogic server starts ,it tries listen port free. but gives error port in use(as shown in first line of logs below),but in next line starts listening port. idea why kind of behavior ? <jul 24, 2013 3:25:20 pm ist> <error> <server> <bea-002606> <the server unable create server socket listening on channel "default". address 10.19.218.207 might incorrect or process using port 12110: java.net.bindexception: address in use> <jul 24, 2013 3:25:20 pm ist> <notice> <server> <bea-002613> <channel "default[3]" listening on 0:0:0:0:0:0:0:1:12110 protocols iiop, t3, ldap, snmp, http.> <jul 24, 2013 3:25:20 pm ist> <notice> <server> <bea-002613> <channel "default[1]" listening on fe80:0:0:0:250:56ff:fe8a:29cc:12110 protocols iiop, t3, ldap, snmp, http.> <jul 24, 2013 3:25:20 pm ist> <notice> <

awk: "default" action if no pattern was matched? -

i have awk script checks lot of possible patterns, doing each pattern. want done in case none of patterns matched. i.e. this: /pattern 1/ {action 1} /pattern 2/ {action 2} ... /pattern n/ {action n} default {default action} where of course, "default" line no awk syntax , wish know if there such syntax (like there in swtich/case statements in many programming languages). of course, can add "next" command after each action, tedious in case have many actions, , more importantly, prevents me matching line 2 or more patterns. you invert match using negation operator ! like: !/pattern 1|pattern 2|pattern/{default action} but that's pretty nasty n>2 . alternatively use flag: {f=0} /pattern 1/ {action 1;f=1} /pattern 2/ {action 2;f=1} ... /pattern n/ {action n;f=1} f==0{default action}

web scraping - Python login a website and scrap -

i need login following website using python, aim scrape page once logged in. not wish install web browser, needs happen shell. have tried splinter, requires installation of web client... this website link https://www.my.commbank.com.au/netbank/logon/logon.aspx and source code of page .... <div class="ft"> <div class="row"> <div class="labelwrapper labeltextalignnotset align_notset"> <label for="txtmyclientnumber_field" id="txtmyclientnumber_label"><span class="mainlabel ">client number</span></label> </div><div class="fieldelement "> <input name="txtmyclientnumber$field" value="xxxx5050" maxlength="8" id="txtmyclientnumber_field" class="text textbox field" data-maxlength="8" type="text"> </div> </div> <div class="row"> <div class="labelwrap