Posts

Showing posts from April, 2015

What is the best workaround for the ASP.NET forms authentication timeout when using wildcard mapping? -

my team working on crappy old website , of pages still asp classic. however, we've migrated forms authentication using asp.net , wildcard mapping. works surprisingly except 1 thing: logged in users timing out quickly. after looking in logs appears people timing out after 20 minutes (which specified timeout due inactivity). so, our hypothesis asp classic pages not tripping whatever mechanism in forms authentication framework resets inactivity timer. i've googled around , read wildcard mapping post great gu still can't find else having problem. so, 1) have ever seen problem? , 2) what's best workaround? (other manually placing hidden frame in every janky asp page loads dumb .net page in background) update : slidingexpiration set true also : can't use perpetual sessions because need application time out after 20 minutes of inactivity. also, terrible site written interface stored in page. there's no simple piece of interface code slip javascript ...

iphone - Scroll View in Grid TabelView -

i m new iphone development , reason have query regarding how implement scroll view in table view m using following code #import <uikit/uikit.h> @class scrollviewviewcontroller; @interface scrollviewappdelegate : nsobject <uiapplicationdelegate> { uiwindow *window; scrollviewviewcontroller *viewcontroller; } @property (nonatomic, retain) iboutlet uiwindow *window; @property (nonatomic, retain) iboutlet scrollviewviewcontroller *viewcontroller; @end //////////////////////////////////////////// #import "scrollviewappdelegate.h" #import "scrollviewviewcontroller.h" @implementation scrollviewappdelegate @synthesize window; @synthesize viewcontroller; - (void)applicationdidfinishlaunching:(uiapplication *)application { // override point customization after app launch [window addsubview:viewcontroller.view]; [window makekeyandvisible]; } - (void)dealloc { [viewcontroller release]; [window release]; [s...

php - What is the best way to solve this problem in a model? -

i come across lot, , have been curious if there better way. consider (example only, assume oo query builder) class dogs extends pets { public function getall() { return $this->parserows($this->db->get('dogs')); } public function getbig() { return $this->parserows($this->db->get('dogs')->where('size', '>', 10)); } public function getsmelly() { return $this->parserows($this->db->get('dogs')->where('smell', '=', 'bad')); } private function parserows($rows) { foreach($rows &$row) { $row['id'] = (int) $row['id']; $row['categoryname'] = categories::getbyid($row['categoryid']); } return $rows; } } basically, need use lot of database queries, need go through post-processing assign things them. have been using pattern above. is best practice ...

c - What happens when there is a request for memory block which is not a power of 2? -

suppose malloc request memory block of size n 2 ^k !=n k>0. malloc returns space requestted memory block how remainig buffer handled page. read pages blocks of memory powers of two. wiki states following: method of memory allocation, heap become fragmented; is, there sections of used , unused memory in allocated space on heap. allocator attempt find unused area of allocated memory use before resorting expanding heap. so question how tracked? edit: how unused memory tracked when using malloc ? this depends on specific implementation, morten siebuhr pointed out already. in simple cases, there might list of free, fixed-size blocks of memory (possibly having same size), unused memory wasted. note real implementations never use such simplistic algorithms. this overview on simple possibilities: http://www.osdcom.info/content/view/31/39/ this wikipedia entry has several interesting links, including 1 above: http://en.wikipedia.org/wiki/dynamic_memory_allocat...

extjs - can anyboby write a hello world example for me for grouptabs -

hi can write hello world group tabs,i eanble , facing lots of problem link -> www.java2s.com not working , want ----> grouptab the example realized using tabpanel class. goto http://www.sencha.com/deploy/dev/docs/?class=ext.tabpanel .

.net - "Quoted-printable line longer than 76 chars" warning when sending HTML E-Mail -

i have written code in vb.net application send html e-mail (in case, lost password reminder). when test e-mail, gets eaten spam filter. 1 of things it's scoring badly on because of following problem: mime_qp_long_line raw: quoted-printable line longer 76 chars i've been through source of e-mail, , i've broken each line longer 76 characters 2 lines cr+lf in between, hasn't fixed problem. can point me in right direction? thanks! quoted printable expands 8 bit characters "={hex-code}", making messages longer. maybe hitting limit? have tried break message at, say, 70 characters? should provide space couple of characters per line. or encode email base64 - mail client can handle that. or set content-transfer-encoding 8bit , send data unencoded. know of no mail server unable handle 8bit bytes these days.

gzip - Compress Document folder in application sandbox of iphone -

i need compress documents folder in application sandbox , upload compressed file server. i've been able send files iphone server, stuck in regards compressing folder. i'm using asihttprequest libraries connecting server. any body can point me right direction. i'd highly grateful. thanks in advance nik you can't alter documents folder because don't have permission. however, can compress files inside it. pretty sure can use command line zlib actual compression. use nstask run apps code.

c# - Merging two arrays in .NET -

is there built in function in .net 2.0 take 2 arrays , merge them 1 array? the arrays both of same type. i'm getting these arrays used function within code base , can't modify function return data in different format. i'm looking avoid writing own function accomplish if possible. if can manipulate 1 of arrays, can resize before performing copy: t[] array1 = getonearray(); t[] array2 = getanotherarray(); int array1originallength = array1.length; array.resize<t>(ref array1, array1originallength + array2.length); array.copy(array2, 0, array1, array1originallength, array2.length); otherwise, can make new array t[] array1 = getonearray(); t[] array2 = getanotherarray(); t[] newarray = new t[array1.length + array2.length]; array.copy(array1, newarray, array1.length); array.copy(array2, 0, newarray, array1.length, array2.length); more on available array methods on msdn .

agile - In a Scrum project, should testing and peer reviews be worked into each sprint as individual tasks? -

this seems point of contention work. complain lack of verification structure in scrum projects, while scrum purists it's not scrum about. both sides bring great points, see people outside circle subject. thoughts? why? in scrum project, needs done should entered task. one of key points of scrum being able accurately predict team can done in sprint. in order this, must account going consume developer's time. this means things documentation, testing, , peer reviews must taken account tasks. edit: based on mendelt's post, i'm going clarify things bit. from wikipedia : product backlog: product backlog high-level document entire project. contains broad descriptions of required features, wish-list items, etc. "what" built. open , editable anyone. contains rough estimates, in days. estimate helps product owner gauge timeline and, limited extent, priority (e.g. if "add spellcheck" feature estimated @ 3 days vs 3 months, may af...

Using JQuery AJAX to grab some data from the Database and print them out according to each DIV ID -

i trying grab data database using jquery ajax, , print data div unique id. i got 2 div tags this: <div id="1" class="myclass"> content texting1 : $printing result test table id=1 </div> <div id="2" class="myclass"> content texting2 : $printing result test table id=2 </div> here function in controller: function findcontent($id=null){ $this->autorender=false; $result=$this->test->findbyid($id); if($result){ return $result['content']; } else{ return "nothing"; } } <script type="text/javascript"> $(document).ready(function(){ var id=$("div #myclass").val(); // stuck on line of code var curl="http://localhost:8080/test/findcontent"+id; $.ajax({ type: "post", url: curl, succes...

What tools exist to convert a Delphi 7 application to C# and the .Net framework? -

i maintain old pc-only application written in delphi 7. although delphi has served me in past use 1 application , find skills language diminishing. syntax different 'day job' languages of java/ruby takes me longer groove of writing new code, plus old have not used many interface s code not managed seems ancient me now! many of users moving vista may run app in compatibility mode or may have gpf problems depending on how pc configured department, have maintenance on application. i'm wondering if should jump more familiar stack. is there automated tool legwork of converting code base c#, leaving me concentrate on conversion on non-standard components? i'm using embedded database component called absolutedatabase bde compatible , using standard sql throughout, , native delphi html browser component can swapped out microsoft world. how these conversion tools? i not aware of automated tools making conversion. suggest stick delphi, maybe upgrade new ver...

database design - Implementing large system changes -

if you're familiar phrase "build 1 throw away", well, seem have done that; we’re reaching limits of version 1 of our online app. it's time clean things by: re-organizing code , ui unifying ui processes adding more functionality building future modifying our database structure handle of above what's best way make transition happen? we want avoid throwing of our users on new system (once it's finished) ... they'd freak out , couldn't handle call load. our users run gamut, technically proficient used-to-write-software types, don't know html is. should start new "installation" of our system , move users on gradually after ensure new design sufficiently solves enough of problems version 1? should (somehow) change each module of our system incrementally, , phase? may difficult because database layout change, resulting in having tweak "core code" , code several surrounding modules. is common have set of trusted, p...

c - the child process exited normally even if I sent a SIGABRT to it -

i trying process operations fork()ing , exec()ing tried example in parent wait()s child return , test if child ended (by exit()ing or return caller) or abnormally (receiving signal sigabrt) #include<stdio.h> #include<stdlib.h> #include<sys/types.h> #include<unistd.h> #include <sys/wait.h> int spawn (char* program, char** arg_list) { pid_t child_pid; child_pid = fork (); if (child_pid != 0) return child_pid; else { execvp (program, arg_list); abort(); } } int main () { int child_status; char* arg_list[] = {"ls","/",null}; spawn ("ls", arg_list); wait (&child_status); if (wifexited (child_status)) printf ("the child process exited normally, exit code %d\n", wexitstatus (child_status)); else printf ("the child process exited abnormally\n"); return 0; } i expect see sentence"the child process exited abnormally...

Good challenges/tasks/exercises for learning or improving object oriented programming (OOP) skills -

what challenge improve skills in object oriented programming? the idea behind poll provide idea of exercises useful learning oop. the challenge should language agnostic possible, requiring either little or no use of specific libraries, or common of libraries. try include 1 challenge per answer, vote correspond merits of challenge alone. nice if level of skill required indicated, , rationale behind why useful exercise. solutions challenges posted answers "how to..." question , linked here. for example: challenge - implement last-in-first-out stack skill level - beginner rationale - gives experience of how reference objects building skills in object-oriented design free book might of use. description follows "the intent of book beginning designer giving them sequence of interesting , moderately complex exercises in oo design. book can managers develop level of comfort process of oo software development. applications build step above trivial, ,...

treeview - Whats the best way to do throbber in C#? -

specifically looking make icons nodes in system.windows.forms.treeview control throb while long loading operation taking place. if load each frame imagelist, can use loop update each frame. example: bool runthrobber = true; private void animatethrobber(treenode animatednode) { backgroundworker bg = new backgroundworker(); bg.dowork += new doworkeventhandler(delegate { while (runthrobber) { this.invoke((methodinvoker)delegate { animatednode.selectedimageindex++; if (animatednode.selectedimageindex >= imagelist1.images.count) > animatednode.selectedimageindex = 0; }); thread.sleep(100); } }); bg.runworkerasync(); } obviously there's more few ways implement this, here's basic idea.

PHP Forms-Based Authentication on Windows using Local User Accounts -

i'm running php, apache, , windows. not have domain setup, website's forms-based authentication use local user accounts database built in windows (i think it's called sam). i know if active directory setup, can use php ldap module connect , authenticate in script, without ad there no ldap. equivalent standalone machines? i haven't found simple solution either. there examples using createobject , winnt adsi provider. bump user authentication issues active directory service interfaces winnt provider . i'm not 100% sure guess wsh/network connect approach has same problem. according how validate user credentials on microsoft operating systems should use logonuser or sspi. says logonuser win32 api not require tcb privilege in microsoft windows server 2003, however, downlevel compatibility, still best approach. on windows xp, no longer required process have se_tcb_name privilege in order call logonuser. therefore, simplest method validate user'...

php - How do you do fuzzy searches using bound parameters in PDO? -

trying sort of thing... where username '%$str%' ...but using bound parameters prepared statements in pdo. e.g.: $query = $db->prepare("select * comments comment :search"); $query->bindparam(':search', $str); $query->execute(); i've tried numerous permutations of single quotes , % signs , it's getting cross me. i seem remember wrestling @ point before can't find references. know how (if?) can nicely in pdo named parameters? ah. found comment on php.net reminded me of answer; need wildcard value before bindparam evaluated, , not worry quoting it. example works fine: $str = "%$str%"; $query = $db->prepare("select * comments comment :search"); $query->bindparam(':search', $str); $query->execute();

java - Using an ampersand in flying saucer -

i error below when converting pdf flying saucer. i've removed ampersand charector , worked, seems problem. how include ampersand's in pdf documents? in advance. error: 'the entity name must follow '&' in entity reference.' just replace & &amp; note:that won't work filenames, content.

C variable and constant value comparison not matching -

if have: signed char * p; and comparison: if ( *p == 0xff ) break; it never catch 0xff, if replace -1 will: if ( *p == (signed char)0xff ) break; how can happen? sign flag? though 0xff == -1 == 255 . the value 0xff signed int value. c promote *p int when doing comparison, first if statement equivalent to: if( -1 == 255 ) break; which of course false. using (signed char)0xff statement equivalent to: if( -1 == -1 ) break; which works expect. key point here comparison done int types instead of signed char types.

oop - Has anyone attempted to make PHP's system functions more Object-Oriented? -

i'm curious if project exists attempts group (or most) of php's built-in functions more object-oriented class hierarchy. example, grouping string functions single string class, etc. i realize won't solve problems (unless modifications took place @ php source code level), since built-in functions still accessible in global namespace, make usability easier. to answer question, yes there exists several of libraries talking about. far 1 want use entirely different question. phpclasses , pear.org places start looking such libraries. update: others have suggested spl library , wraps many of built in php functions. there still lots of php functions not wrap. leaving still without silver bullet. in using frameworks such cakephp , zend (others too), have noticed attempt solve of these problems including own libraries , building basics such db connectivity frame work. frameworks may solution

sql - Use cid in sqlite instead of column name? -

when creating view, name assigned column not usable in sqlite, in order perform specific operation afterwards. instance, created following view: create view myview select amount, count(name), name mytable group name having count(name) > 1; then following operation: select total(amount*count(name)) myview; unfortunately, count(name) name given sqlite second column, hence, cannot used in select statement. pragma table_info(myview) shows cid count(name) 1, there anyway use information able computation on column? you need define column alias: create view myview select amount, count(name) name_count, name mytable group name having count(name) > 1; then, you'll able use: select sum(v.amount * v.name_count) myview v; i changed out total sum , more consistent other databases ( sqlite aggregate functions ).

Where can I Find GOOD ASP.NET tutorial(or books) online? -

looking resources (or tutorials) demonstrate proper techniques on building asp.net web sites. i encourage check out pile of resources @ asp.net home page including forums, sample code, videos/screencasts , more. seriously.

c# - How to fit page to Silverlight WebBrowser control? -

i use webbrowser silverlight 4 control load page: <webbrowser height="350" name="webbrowser" width="400" /> ... webbrowser.navigate(new uri("http://mail.live.com")); but page loads horizontal , vertical scroll bars. i'm trying find ways actual size of loaded page (then can change height/width of control) or change scale of loaded page (to fit actual webcontrol control). possible standard webcontrol methods? the web browser component in silverlight com component wrapped silverlight control. you have 2 options. 1) make web site fluid inside browser shrink browser. or 2) way "shrink" web site set zoom. there link here tricking mouse scroll wheel zooming you. http://forums.silverlight.net/forums/p/200177/466986.aspx

sql - WAMP with PHP 5.3.3? -

http://www.php.net/archive/2010.php#id2010-07-22-2 i want test on windows seems there isn't fast wamp server fits 5.3.3. are there today? as 'total amp' package, lag somewhat. however, installing newest version of php http://windows.php.net/download/ should not problem, , long have apache server running should able make use of php-version installed. if require package preconfigured amp stack, you'll have accept take time incorporate newest versions of software, or roll own.

iphone - connect GUI to LOGiC -

i trying build first iphone app. first finish app logic whitch contain datalogic class have arrays. , 2 classes then build appgui contain 2 views. searchviewclass , resultviewclass problem how connect logic gui. instance of datalogic on appdelegate class , need 2 gui classes able accsess instance dont know accsess instances in appdelegate class gui classes? i didnt see app initialize gui classes?? gui classes instance?? you use mvc (model-view-controller) design pattern. should called model-controller-view pattern because controller mediates between model , view. in case datalogic class model. views controlled paired view controller object instance or subclass of uiviewcontroller. depending on app, there many different ways relate view controllers each other, views , model. the easiest understand navigation based app in xcode template projects. has no data model object have navigation controller , rootviewcontroller class paired view defined in rootviewcontroller...

oop - Why is Python not fully object-oriented? -

i want know why python not object-oriented. example, not support private, public, protected access level modifiers. what advantages , disadvantages of this? these expressions, python suitable applications (desktop, scientific, web or other)? python doesn't support strong encapsulation , 1 of many features associated term "object-oriented". the answer philosophy. guido doesn't hiding things, , many in python community agree him.

c# - How do I check if a given string is a legal / valid file name under Windows? -

i want include batch file rename functionality in application. user can type destination filename pattern , (after replacing wildcards in pattern) need check if it's going legal filename under windows. i've tried use regular expression [a-za-z0-9_]+ doesn't include many national-specific characters various languages (e.g. umlauts , on). best way such check? you can list of invalid characters path.getinvalidpathchars , getinvalidfilenamechars . upd: see steve cooper's suggestion on how use these in regular expression. upd2: note according remarks section in msdn "the array returned method not guaranteed contain complete set of characters invalid in file , directory names." the answer provided sixlettervaliables goes more details.

When using the firefox webdeveloper toolbar to edit CSS, why do some image disappear when the toolbar is open? -

my typical workflow editing , building stylesheets html documents open firefox web developer toolbar's edit css panel , edit directly in browser window. most of time works charm. there times, however, when open edit css panel, images disappear, , have no idea why. , more strange, times images add toolbar open not visible when shut. (i'm talking of images added css background-image rule). here's examples... http://kenbrook.org - if open edit css panel, body background image disappears, along several of div backgrounds. in fact, think of css background image images disappear. didn't write markup , of styles on site, i'm responsible editing , completing them. idea why happens? http://joelglovier.com - check 1 i'm building myself , writing styles (only couple elements on page right now). in header div have empty div i'm putting image in. when edit css open, image appears expected. when it's closed, however, image cannot seen, although using fir...

How to write a C++ FireFox 3 plugin (not extension) on Windows? -

could write-up step step guide developing c++ based plugin firefox on windows? the links , examples on http://www.mozilla.org/projects/plugins/ old , inaccurate - "new" link added page in 2004. the example anything, thinking plugin lets javascript set name , displays "hello {name}". show 2-way communication, have property returns full salutation. though not important, nice if plugin work in chrome too. see http://developer.mozilla.org/en/plugins . , yes, npapi plugins should work in google chrome well. [edit 2015: chrome removes support npapi http://blog.chromium.org/2014/11/the-final-countdown-for-npapi.html ]

java - BufferedImage in IKVM -

what best and/or easiest way replace missing bufferedimage functionality java project converting .net ikvm? i'm getting "cli.system.notimplementedexception: bufferedimage" exceptions when running application, otherwise runs fine. the awt code in ikvm easy read , edit. i'd recommend methods using throw exception, , implement them. i've done several times before ikvm's awt implementation , found easy background/server related functions. less usable if app desktop app, however.

git branch - How to clone all remote branches in Git? -

i have master , development branch, both pushed github . i've clone d, pull ed, , fetch ed, remain unable other master branch back. i'm sure i'm missing obvious, have read manual , i'm getting no joy @ all. first, clone remote git repository , cd it: $ git clone git://example.com/myproject $ cd myproject next, @ local branches in repository: $ git branch * master but there other branches hiding in repository! can see these using -a flag: $ git branch -a * master remotes/origin/head remotes/origin/master remotes/origin/v1.0-stable remotes/origin/experimental if want take quick peek @ upstream branch, can check out directly: $ git checkout origin/experimental but if want work on branch, you'll need create local tracking branch done automatically by: $ git checkout experimental and see branch experimental set track remote branch experimental origin. switched new branch 'experimental' that last line throws peo...

cmd - Long commands split over multiple lines in Windows Vista batch (.bat) file -

how make long commands go on multiple lines in windows (vista) batch file? you can break long lines caret ^ long remember caret , newline following removed. so, if there should space you're breaking line, include space. ( more on below. ) example: copy file1.txt file2.txt would written as: copy file1.txt^ file2.txt

wiki - Any better way to create MediaWiki numbered lists? -

when using mediawiki's markup language, thing hate creating numbered lists. way know create list this: #item1 #item2 however, if want add spaces or other text between lines, numbering gets lost. example, following create text has 2 number 1 items: #item1 somestuff #item2 is there way around this, or should use bullet points instead? noticed stackoverflow system not allow numbering this, have manually. like this: #item1 #:somestuff #item2

c# - Permutation/Algorithm to Solve Conditional Fill Puzzle -

i've been digging around see if similar has been done previously, have not seen mirrored conditions. make swallowing problem little easier understand, i'm going apply in context of filling baseball team roster. the given roster structure organized such: c, 1b, 2b, 3b, ss, 2b/ss (either or), 1b/3b, of, of, of, of, ut (can position) every player has @ least 1 of non-backup positions (positions allow more 1 position) they're eligible , in many cases more 1 (i.e. player can play 1b , of, etc.). manager of team, has players on , want see if have room particular player @ of slots or if can move 1 or more players around open slot eligible. my initial attempts use conditional permutation , collect in list possible unique "lineups" each player, updating open slots before moving next player. required (since order player moved affect positions available next player) list being looped through reordered , looped through again. still think way go, there number of...

.htaccess - show php file like a directory with htaccess -

hi want when user write www.test.com/6 in behind go http://www.test.com/index.php?id=6 not redirection mod_rewrite i internal server error options +followsymlinks rewriteengine on rewriterule ([0-9]*)$ /index.php?id=$1 [l,nc] i've written similar mod_rewrite line 1 of own projects. regex use polishing, works, here anyway: rewriterule ^([0-9]+)(/)?$ /path/to/file.php?id=$1 [qsa]

minimum effective schedule interval ( iphone objective c ) -

i think there minimum time span can assign interval schedule task in iphone sdk. haven't found minimum interval/time span yet. would let me know please! helpful me. edit any detail reference more appreciative. in advance nstimeinterval "double", can specify double value. smallest value next 0 2.225e-308. however, remember nstimer not high-precision tool. can specify small intervals, aren't honored os. here's documentation nstimer says: the effective resolution of time interval timer limited on order of 50-100 milliseconds

.net - How to shut down the computer from C# -

what's best way shut down computer c# program? i've found few methods work - i'll post them below - none of them elegant. i'm looking that's simpler , natively .net. works starting windows xp, not available in win 2000 or lower: this quickest way it: process.start("shutdown","/s /t 0"); otherwise use p/invoke or wmi others have said. edit: how avoid creating window var psi = new processstartinfo("shutdown","/s /t 0"); psi.createnowindow = true; psi.useshellexecute = false; process.start(psi);

function - Jquery check whether element is hidden (continuously) -

how check whether element made hide @ once. i.e how notify visibility of element. in case, element made hide slideup function. @ once should notified visibility of element. i got idea of using bind() method. not have onhide event. how ? suggestions helpful ! edit: i know possible use is(':hidden') want check continuously addeventlistener if($('#selector').is(':visible')){ //is visible }else{ //is not visible threfore hidden } edit if not exist have check opacity/filter property so if($('#selector').css('opacity')!=0){ //is visible//or partially visible//depends on opacity }else{ //is not visible threfore hidden } also make sure check opacity cross browser edit 2 function checkvisibility(){ //put visibility checker here settimeout('checkvisibility',1000)//every 1 second... } note: repetitions might slow down browser

What is the best way to read an entire file into a std::string in C++? -

how read file std::string , i.e., read whole file @ once? text or binary mode should specified caller. solution should standard-compliant, portable , efficient. should not needlessly copy string's data, , should avoid reallocations of memory while reading string. one way stat filesize, resize std::string , fread() std::string 's const_cast<char*>() 'ed data() . requires std::string 's data contiguous not required standard, appears case known implementations. worse, if file read in text mode, std::string 's size may not equal file's size. a correct, standard-compliant , portable solutions constructed using std::ifstream 's rdbuf() std::ostringstream , there std::string . however, copy string data and/or needlessly reallocate memory. relevant standard library implementations smart enough avoid unnecessary overhead? there way it? did miss hidden boost function provides desired functionality? please show suggestion how implement it. void ...

sdk - iPhone Simple submit form -

how can create simple submit form uitextfield , button , when user tabs button textfield information sends email (without email application) ? for first question, use grouped table view , cell contains text field , button. for second question, take @ skpsmtpmessage project on google code, "implements quick class sending 1 off messages via smtp on iphone".

rdbms - What is the biggest drawback of <your favorite database>? -

we have our favourite database. if objectively @ chosen database, drawbacks have , improved? the rules: one reply per drawback with; a short description of limitation, followed by; a more detailed description, explanation of how done better or example of technology not have same limitation. do not diss database haven't used extensively. easy take potshots @ other technologies want learn form experience, not prejudice. oracle databases quite expensive oracle licensing costs horrendous. has been improved release of oracle xe limitations of mean growth constraint on solution.

UITableView background showing in Interface Builder but in simulator -

does know why, if add image uiimage background, can see behind grouped table view in interface builder. when launch app, background not showing @ all, both in simulator , device. apart adding image, suppose did steps @ tableview programmatic side: self.tableview.backgroundcolor = [uicolor clearcolor]; self.tableview.opaque = no; self.tableview.backgroundview = nil; thanks following post made, found 2 possible solutions, 1 uiviewcontroller in place of uitableviewcontroller discussed here: uitableview fixed image background with disadvantage of header , footer problem grouped table. the other solution, involves writing more code , case if have common table share within different views of apps: have uiviewcontroller calling uitableviewcontroller , attach subview self.view.

multithreading - Delphi 6 : breakpoint triggered on non-VCL thread stops main thread repaints -

i have multi-threaded delphi 6 pro application working on heavily. if set breakpoint on code runs in context of main thread (vcl thread) don't have problems. however, if breakpoint triggered on code in 1 of other threads, after continue application breakpoint, repaints vcl components on main thread (including main form) don't happen anymore. application isn't dead because other background code keeps running, main thread. it's if windows message dispatcher has been corrupted or rendered dormant. note, in application allocate own wndproc() via allocatehwnd() on main form because need catch registered messages. wndproc() dispatch custom messages handle , if current message not handled code, pass message on calling main form's inherited wndproc(). if handle current message return wndproc() msg.result set 1 tell dispatcher message handled. can't override tform wndproc() instead of allocating own wndproc() because reason delphi vcl not pass through regist...

javascript - How do I detect a click outside an element? -

i have html menus, show when user clicks on head of these menus. hide these elements when user clicks outside menus' area. is possible jquery? $("#menuscontainer").clickoutsidethiselement(function() { // hide menus }); note: using stopeventpropagation() should avoided breaks normal event flow in dom. see this article more information. consider using this method instead. attach click event document body closes window. attach separate click event window stops propagation document body. $(window).click(function() { //hide menus if visible }); $('#menucontainer').click(function(event){ event.stoppropagation(); });

java - Content-Length header already present -

i using apache httpclient (4.1) included in android execute httpput. have verified have 1 content-length header. however, every time send request, protocol exception content-length header specified. httpclient client = new defaulthttpclient(); putmethod = new httpput(url + encodedfilename); putmethod.addheader(..) //<-once each header putmethod.setentity(new bytearrayentity(data)); client.execute(putmethod); //throws exception caused by: org.apache.http.protocolexception: content-length header present @ org.apache.http.protocol.requestcontent.process(requestcontent.java:70) @ org.apache.http.protocol.basichttpprocessor.process(basichttpprocessor.java:290) any ideas? i've not used httpclient myself, suspect problem putmethod.setentity(...) implicitly supplying content length , setting explicitly via 1 of putmethod.addheader(...) calls.

Live chat in ruby on rails application -

can suggest me approach of implementing live chat functionality in ruby on rails application? there plugin exists implement functionality? thanks yes, juggernaut . unfortunately requires flash, works pretty otherwise. might want @ websockets standard, there flash emulation in browsers don't support yet.

flex - Populating an array collection by parsing a string -

in actionscript have string str="subject,r1,r2:a,b:1,2:3,4"; dynamically have split string , build array collection given below arraycoll.additem({subject:a ,r1:1,r2:3}); this example of 1 set the arraycollection should built dynamic have tried not successful var str:string ="subject,r1,r2:a,b:1,2:3,4"; var parts:array = str.split(":"); var props:array = parts[0].split(","); var count:number = parts[1].split(",").length; var items:array = []; var values:array = []; var i:number, j:number; for(i = 0; < props.length; i++) values.push(parts[i + 1].split(",")); for(i = 0; < count; i++) { items.push({}); for(var j = 0; j < props.length; j++) { items[i][props[j]] = values[j][i]; } } var arcol:arraycollection = new arraycollection(items);

Ruby alternative for : Drools (www.drools.org) a business logic integration platform -

please suggest ruby alternative drools . better if supports integration rails active record. ruleby suggested in slideset http://www.slideshare.net/martincabrera/rules-engine-java-rails

ruby - Rails: How to change the title of a page? -

what best way create custom title pages in rails app without using plug-in? in views this: <% content_for :title, "title specific page" %> <!-- or --> <h1><%= content_for(:title, "title specific page") %></h1> the following goes in layout file: <head> <title><%= yield(:title) %></title> <!-- additional header tags here --> </head> <body> <!-- if pages contain headline tag, it's preferable put in layout file --> <h1><%= yield(:title) %></h1> </body> it's possible encapsulate content_for , yield(:title) statements in helper methods (as others have suggested). however, in simple cases such 1 put necessary code directly specific views without custom helpers.

How do I create a heterogeneous Array in Scala? -

in javascript, can do: ["a string", 10, {x : 1}, function() {}].push("another value"); what scala equivalent? arrays in scala homogeneous. because scala statically typed language. if need pseudo-heterogeneous features, need use immutable data structure parametrized covariantly (most immutable data structures are). list canonical example there, vector option. can this: vector("a string", 10, map("x" -> 1), ()=>()) + "another value" the result of type vector[any] . not useful in terms of static typing, in there promised. incidentally, "literal syntax" arrays in scala follows: array(1, 2, 3, 4) // => array[int] containing [1, 2, 3, 4] see also : more info on persistent vectors

asp.net - Login.aspx always wants to be my home page! -

just starting out in asp.net. have created login.aspx page in site , stuck on asp login control - that's did. welcome.aspx page won't show start page of site when debug - though set this. plus have edited web.config - (see below) - , still same thing. how make work have welcome.aspx page start default? <authentication mode="forms"> <forms defaulturl="~/welcome.aspx" loginurl="~/login.aspx" timeout="1440" ></forms> </authentication> if want users access welcome.aspx without being authenticated, put welcome.aspx in separate folder, , set new web.config in sub folder. fill out authorization section in web.config files in folder , subfolders accessible anonymous users, this: <authorization><allow users="?" /></authorization>

c++ - How to concatenate a std::string and an int? -

i thought simple it's presenting difficulties. if have std::string name = "john"; int age = 21; how combine them single string "john21" ? in alphabetical order: std::string name = "john"; int age = 21; std::string result; // 1. boost result = name + boost::lexical_cast<std::string>(age); // 2. c++11 result = name + std::to_string(age); // 3. fastformat.format fastformat::fmt(result, "{0}{1}", name, age); // 4. fastformat.write fastformat::write(result, name, age); // 5. iostreams std::stringstream sstm; sstm << name << age; result = sstm.str(); // 6. itoa char numstr[21]; // enough hold numbers 64-bits result = name + itoa(age, numstr, 10); // 7. sprintf char numstr[21]; // enough hold numbers 64-bits sprintf(numstr, "%d", age); result = name + numstr; // 8. stlsoft's integer_to_string char numstr[21]; // enough hold numbers 64-bits result = name + stlsoft::integer_to_string(numstr, 2...

mysql - Interacting with a Database from Scheme -

i try learn scheme , test project wanted create simple website 1-2 database queries (mysql preferred, postgresql ok, too). i know it's not schemes domain still want see how far can come. sadly, seems i'm stuck @ using database , googling "scheme database" or other combination including words (as expected considering double meaning of scheme in case) not helpful. can give me hints on how access database scheme program? i read scheme code interfacing mysql client program i'd prefer more direct. thanks. gnu guile has database interface supports postgres, mysql , sqlite. called guile dbi . other scheme implementations may try are: sisc (can connect jdbc compliant database, including mysql) , spark-scheme (can connect odbc compliant database, including mysql , comes bundled sqlite). note scheme implementations has form of foreign function interface write own mysql->scheme connector.

c# - Checking if file exist or not on ftp server before downloading it -

before downloading file ftp server, want check if exist or not, if not mu st throw exception. code sample works when file not exist. when file exist, after execution line; "ftprequest.method = webrequestmethods.ftp.downloadfile;" jumps second catch block , prints "error: operation cannot performed after request has been submitted." what's point can't see..thanks answers. public void filedownload(string filename) { stream = new filestream(filepath + filename, filemode.create); ftprequest = (ftpwebrequest)ftpwebrequest.create(new uri(ftppath + filename)); ftprequest.credentials = new networkcredential(username, password); ftprequest.method = webrequestmethods.ftp.getfilesize; try { response = (ftpwebresponse)ftprequest.getresponse(); ftprequest.method = webrequestmethods.ftp.downloadfile; ftprequest.usebinary = true; ...

Extend the Visual Studio C++ Build Process -

a found article ( extend visual studio build process ) explained how override build targets in c# project file. tested this, , seems work well. however, want override build target in c++ project (with visual studio 2005). problem c++ projects use different xml. instead of having <project> root, c++ projects have <visualstudioproject> root. when add <target> tag c++ project file , try open project in visual studio, error: the following error has occurred during xml parsing: file: [ path project file ].vcproj line: 304 column: 30 error message: element 'target' unexpected according content model of parent element 'visualstudioproject'. the file '[ path project file ].vcproj' has failed load. how can override visual studio build target c++ project? or there better way customize happens during c++ build? in visual studio 2005 there no build "targets" c++ builds c++ build system not u...

.net - LINQ Grouping: Select row instead of key? -

i won't able explain enough, here goes... i have table similar this: id | foreign_key_id | a_number | some_other_info 1 1 100 red 2 1 200 blue 3 1 300 orange 4 2 100 green 5 2 200 yellow 6 3 100 brown i want max "a_number" particular "foreign_key_id" in table, return rest of record have info "some_other_info" column. i've found can accomplish via query this: from x in this_table group x x.foreign_key_id g orderby g.max(x => x.a_number) descending select g.where (x => x.foreign_key_id == g.key).orderbydescending (x => x.a_number).first() edit: or possibly more concise query: from x in this_table group x x.foreign_key_id g let maxanumber = g.max(x => x.a_number) orderby maxanumber descending select g.where(x => x.a_number == maxanumber).first() ...

settings - Change overview ruler color in Eclipse -

how change overview rule background color in eclipse 3.4.0.i20080617-2000 (vertical bar on right of editing window annotations) ? general > editors > text editors > annotations allows change colors of marks not background of whole bar. it looks web searching skills getting weaker since cannot find anywhere ... i have same problem michal - seems non-customisable. i have trouble seeing of annotation marks in overview ruler due vista's lighter colouring. can change colour of marks, bar doesn't change colour. it looks way change change system colours windows.

How do you use an extension method in an InvokeMethod workflow? -

i have system.activities.statements.invokemethod activity. i'm trying activate with targettype: (null) targetobject: licxfiles //an icollection<string> methodname: storeifhasvalue the storeifhasvalue : public static void storeifhasvalue(this icollection<string> collection, string value) { if (value.isnullorempty( )==false) collection.add(value); } the param i'm passing workflow designer : direction: in type: string value: licxutilities.checkforlicx(projectpath,doc) checkforlicx : public static string checkforlicx(string projpath, xdocument proj) { var ns=proj.root.name.namespace; var q = refs in proj.root.elements(ns+"itemgroup").descendants(ns+"embeddedresource") refs.attribute("include").value.endswith(".licx", stringcomparison.currentcultureignorecase) select refs.attribute("include").value; var licx...

Hibernate: check if object exists -

suppose, objects of type a stored in db. here's way load specific 1 db using hibernate: org.hibernate.session session = ...; long id = 1; obj = session.load(a.class, id); if object id=1 doesn't exist objectnotfoundexception . there way check if such object exists without having catch exception? have smth like: org.hibernate.session session = ...; long id = 1; boolean exists = session.exists(a.class, id); if(exists){ // smth..... } couldn't find hibernate docs... you can use session.get : public object get(class clazz, serializable id) throws hibernateexception it return null if object not exist in database. can find more information in hibernate api documentation .

php - Basics of a remember-me system -

i using php / mysql login system. add remember-me it. basic mechanics of remember-me? involve adding new column table in mysql of user information stored, etc. ? thanks in advance, john there few different methods this. secure method add field mysql user table , have "remember_me" hash random hash generated. the hash should stored in cookie on users computer userid validation purposes long remembering period lasts (you should set remember me period in db timestamp security). when pull site, see if cookie isset, if authenticate hash userid. if validates considered logged in. if not validate, send them sign in page / not considered logged in. this how setup of sites. pain if login computer, no longer validated on computer using , have re-authenticate. security, me, more important them having login again due situation. edit: see comments below information regarding sessions / security.

Many-to-many relationships in ASP.NET Dynamic Data -

i need use many many relationship in project , since dynamic data doesn't support natively, ask sample of implementation of it. i'm looking way both create new instances of target entity , add new m2m relationship record using existing instances create relationship. i'm on tight schedule, appreciated. david ebbo (the architect dynamic data) posted many-to-many field template on blog. note solution entity framework.

hash - Is there an MD5 Fixed Point where md5(x) == x? -

is there fixed point in md5 transformation, i.e. there exist x such md5(x) == x ? since md5 sum 128 bits long, fixed point have 128 bits long. assuming md5 sum of string uniformly distributed on possible sums, probability given 128-bit string fixed point 1 / 2 128 . thus, probability no 128-bit string fixed point (1 − 1 / 2 128 ) 2 128 , probability there fixed point 1 − (1 − 1 / 2 128 ) 2 128 . since limit n goes infinity of (1 − 1 / n ) n 1 / e , , 2 128 large number, probability 1 − 1 / e ≈ 63.21%. of course, there no randomness involved – either there fixed point or there isn't. but, can 63.21% confident there fixed point. (also, notice number not depend on size of keyspace – if md5 sums 32 bits or 1024 bits, answer same, long it's larger 4 or 5 bits).

PHP Script Version Checking/Notification -

how can check version of script against online file see if it's latest version? for clarification, i'm talking script wrote, not version of php. i'd incorporate way end user tell when i've updated script. to specify second (more simple) solution phjr proposed: have file version.txt on own public server , include following function deployed project/script: define('remote_version', 'http://your.public.server/version.txt'); // version of deployed script define('version', '1.0.1'); function isuptodate() { $remoteversion=trim(file_get_contents(remote_version)); return version_compare(version, $remoteversion, 'ge'); } version.txt should contain recent version number, e.g.: 1.0.2

Auto select an item from a jQuery Autocomplete combobox -

i have page using couple of jquery's autocomplete comboboxes. need able autoselect item list when user clicks button, or if value passed page combobox. how can set value of both underlying selectbox , jquery combobox? never mind, found solution. when each autocomplete combobox created, give unique id, use id set value using $('#comboboxuniqueid').val($('#selectbox').val())

java - Is there a performance difference between a for loop and a for-each loop? -

what, if any, performance difference between following 2 loops? for (object o: objectarraylist) { o.dosomething(); } and for (int i=0; i<objectarraylist.size(); i++) { objectarraylist.get(i).dosomething(); } from item 46 in effective java joshua bloch : the for-each loop, introduced in release 1.5, gets rid of clutter , opportunity error hiding iterator or index variable completely. resulting idiom applies equally collections , arrays: // preferred idiom iterating on collections , arrays (element e : elements) { dosomething(e); } when see colon (:), read “in.” thus, loop above reads “for each element e in elements.” note there no performance penalty using for-each loop, arrays. in fact, may offer slight performance advantage on ordinary loop in circumstances, computes limit of array index once. while can hand (item 45), programmers don’t so.

javascript - Driving directions with traffic -

how receive driving time between 2 locations traffic. information displayed on iphone maps application, when 'show traffic' option selected. appreciate help. you have buy in >> maps business customer , set durationintraffic property of >> directionsrequest object true: durationintraffic (optional) specifies whether directionsleg result should include duration takes account current traffic conditions. feature available maps business customers. time in current traffic returned if traffic information available in requested area. without being business customer not able take current traffic situation account directions calculations, can still >> activate traffic layer in maps show current traffic situation on map.

php - Web page text display problem -

i keep getting these weird text characters when display user submitted text. in following example below. there way can fox using php, css or characters displayed properly? here problem text. problems of �real fonts� on web. 1 line summary: different browsers , different platforms �hinting� here meta tag. <meta http-equiv="content-type" content="text/html; charset=utf-8" /> it's encoding problem. make sure send correct encoding browser. if it's utf-8, you'll this: header("content-type: text/html; charset=utf-8"); also, make sure store content using same encoding throughout entire system. set database tables utf8 . if you're using mysql, run set names utf8 query when connecting make sure you're running in utf-8. these weird characters occur when switch encoding. also, functions in php take $charset parameter (e.g. htmlentities() ). make sure pass correct charset 1 well. to make sure php hand...