text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I have a drag and drop handler in my Flex application. The drag proxy, or the 'ghost' image to be displayed while dragging, must be loaded before I drag, and that takes some time. How can I make it load immediately or preload? One solution is to duplicate the image, but as far as I know, image objects can't be duplicat...
[ 0.4302770495414734, -0.35181206464767456, 0.6339635848999023, -0.007605130784213543, -0.019225282594561577, 0.10141555219888687, -0.05785675346851349, -0.13559432327747345, -0.274749755859375, -0.6620895862579346, 0.24728986620903015, 0.7527623176574707, -0.6214951276779175, 0.109932050108...
var dragSource : DragSource = new DragSource (); var dragProxy : Image = new Image (); dragProxy.source = e.currentTarget.source; // Won't work unless image is embedded dragProxy.load (e.currentTarget.source); // Must load setTimeout (DragManager.doDrag, 350, dragInitiator, dragSource, e, dragProxy); ...
[ 0.11434542387723923, -0.24660876393318176, 0.6347478032112122, -0.2248169183731079, 0.05265642702579498, 0.1530081331729889, -0.06811553984880447, -0.3607242703437805, -0.18125073611736298, -0.48941168189048767, -0.2869720160961151, 0.9205149412155151, -0.40418028831481934, -0.116764679551...
an image, **you must explicitly set a height and width of the image or else it will not appear**. If you define a width and a height for the Image proxy in your example, it will probably work: ``` var dragProxy : Image = new Image (); dragProxy.source = dragInitiator.source; dragProxy.width = dragInitiator.width; dra...
[ 0.21933279931545258, -0.18393364548683167, 0.8330096006393433, 0.014919373206794262, -0.08315475285053253, 0.13352668285369873, -0.12989038228988647, -0.1674569696187973, -0.2106224149465561, -0.8688881397247314, -0.2344246804714203, 0.6586381196975708, -0.2867964804172516, 0.0905659422278...
How can I display labels for each point plotted in a ZedGraph chart? For each point, create a text object with your label text, and add it to the graph. The [Point Label Demo](http://zedgraph.org/wiki/index.php?title=Point_Label_Demo) demonstrates...
[ 0.27534738183021545, -0.06033749133348465, 0.35515889525413513, 0.1991102397441864, 0.002191963605582714, -0.33684930205345154, -0.13647706806659698, -0.2376960963010788, -0.22035673260688782, -0.7815697193145752, 0.1120406985282898, 0.2675655484199524, 0.03466961905360222, 0.1740511357784...
I'm new to Qt so please excuse my ignorance. I am attempting to create a an 'svg image button' with QSizePolicy::Preferred for both horizontal and vertical. That part works. When the window is resized, the button grows and shrinks exactly how I want... But the image within the button stays the same size. I would like ...
[ 0.028428388759493828, -0.385269433259964, 0.6715205907821655, -0.32113030552864075, -0.25238797068595886, 0.3377227783203125, 0.31206652522087097, -0.217593252658844, -0.1224181056022644, -0.9710528254508972, -0.05190837010741234, 0.5840920209884644, -0.436766117811203, 0.17367616295814514...
SVGPUSHBUTTON_H #include "SVGPushButton.h" SVGPushButton::SVGPushButton(QString svgPath, QString name) : QPushButton(name) { QIcon icon(svgPath); setSizePolicy( QSizePolicy::Preferred, QSizePolicy::Preferred ); setFlat(true); setIcon(icon); } SVGPushButton::~SVGPushButton() {} void SVGPushButton::re...
[ -0.42526447772979736, -0.21817976236343384, 1.0300880670547485, -0.17221251130104065, -0.48697298765182495, 0.4247479736804962, 0.04357851669192314, -0.38640713691711426, -0.13289599120616913, -0.6204912066459656, -0.1684626042842865, 0.48496904969215393, -0.27590054273605347, -0.127525225...
I am trying to use the myType class declared in the package com.mycompany.myproject in a class that lives in com.mycompany.myproject.client but I am getting the following errors when compiling: > [ERROR] Line [X]: The import com.mycompany.myproject.myType cannot be > resolved If I try to run the hosted browser I get...
[ 0.3663802742958069, 0.3132990300655365, 0.33719417452812195, -0.08543366938829422, 0.025249239057302475, -0.11913192272186279, 0.5530102252960205, -0.08723679184913635, -0.012974652461707592, -0.8052083849906921, -0.0928279459476471, 0.6373399496078491, -0.31991273164749146, 0.373923152685...
**Casus:** *How to edit and advance with the same code, from several distanced locations and computers as easily as possible?* I have this thought for some time now. I am regularly having problems when I have to work on one project from different computers, as I have not taken any measures or whatsoever to ease myse...
[ 0.5974379777908325, 0.3552444279193878, 0.20346437394618988, 0.14465899765491486, 0.14054910838603973, 0.27222633361816406, 0.06556402891874313, 0.08408360928297043, -0.22114181518554688, -0.7677820920944214, 0.15134041011333466, 0.38450440764427185, 0.24133946001529694, 0.0904975160956382...
get your app running. Then you go to your girlfriend's house for the weekend but you need to advance with the project and during that time you want to do some coding. What I am currently doing is that I am archiving my whole project, along with a DB dump usually and place it on a ftp host, so that I may access it late...
[ 0.7829563617706299, 0.2551807761192322, 0.2595364451408386, 0.10585823655128479, 0.27532288432121277, -0.21225346624851227, 0.4137561619281769, 0.080842986702919, -0.06766457855701447, -0.7269657254219055, -0.025833088904619217, 0.5342308878898621, 0.028975624591112137, -0.0798197984695434...
into a dev server with Remote Desktop enabled - the problem with this is that remote connection is not always fast and snippy as one would need it to be in order to do RAD. Also that implies the PC must be always be turned on at home, regardless that I might not even need it, If say, there are better things to do durin...
[ 0.771606981754303, -0.08718134462833405, 0.2609088718891144, 0.44231006503105164, -0.14577601850032806, -0.3236687481403351, 0.6090997457504272, 0.13376528024673462, -0.12176106870174408, -0.7289309501647949, 0.07689657807350159, 0.5314329862594604, -0.055976320058107376, 0.272638589143753...
checkout code. This still has some of the problems, as you might need to install software, SVN client and eventually edit some configuration each time you change the computer. Oh, and as with the previous 'solution' - you are totally dependent on Internet access. * Buy an Eee PC and carry it around - that way you can h...
[ 0.6572225093841553, 0.15776897966861725, 0.016446860507130623, 0.2979603707790375, 0.322161465883255, -0.09136832505464554, 0.33495497703552246, 0.36055120825767517, -0.2618531584739685, -0.49295011162757874, 0.20380261540412903, 0.41074076294898987, -0.1806500405073166, 0.0638104528188705...
aren't very suitable for normal coding (small keyboard, screen, etc). * And finally, I have been thinking of an ideal scenario, where I have one of those linux distributions which go along a single CD or even a [**flashdrive**](http://www.pendrivelinux.com/). On the latest you can have all your environment always with ...
[ 0.729350745677948, 0.08028922230005264, 0.22282855212688446, 0.30036571621894836, 0.1646425575017929, -0.0938495621085167, -0.07610195875167847, 0.4750936031341553, -0.07946890592575073, -0.7446979284286499, 0.2058919370174408, 0.7755920886993408, -0.09460444748401642, 0.19251005351543427,...
savvy and I haven't been messing with it so much. Especially with flashdrive OS. **Bottom line questions**: 1. Do you agree that a flashdrive is an optimal solution? Is there a better practice I can put into work? Perhaps I should reconsider this way of working at all?:) 2. Do you think a flashdrive OS as say <http:/...
[ 0.7378242611885071, 0.062375497072935104, 0.20315559208393097, 0.20688919723033905, 0.15900489687919617, -0.16572220623493195, 0.039536312222480774, -0.13248911499977112, 0.09213617444038391, -0.5732336044311523, 0.3728320300579071, 0.8713884949684143, 0.007203544024378061, -0.168629229068...
locations on the same project? Here's an alternate solution: carry a portable hard drive that has a portable installation of a virtual machine player and a virtual machine with all the dev tools you need. Just plug this into whatever computers are available, fire up the VM, put it in fullscreen mode and you're good to ...
[ 0.762224018573761, -0.25485119223594666, 0.1978480964899063, 0.632073163986206, 0.2735052704811096, -0.31913307309150696, 0.27093639969825745, 0.1802341639995575, -0.30129313468933105, -0.30076348781585693, -0.11383356153964996, 0.5435926914215088, -0.06976348161697388, -0.159685418009758,...
My Google fu is failing me. How do I use Perl to serve up an already generated image? Example: ``` <html><body><img src="getimage.pl"></body></html> ``` What goes in getimage.pl? Here you go: ``` #!/usr/bin/perl -w my $file = "inner-nav.gif"; ## my $length = (stat($file)) [10]; ## (stat($file)) [10]; is the inode...
[ -0.24311783909797668, -0.12912067770957947, 1.0116468667984009, -0.4037953019142151, -0.21162955462932587, 0.12373746931552887, 0.5235989093780518, -0.26469823718070984, -0.09597035497426987, -0.5038613677024841, 0.32972559332847595, 0.7455074787139893, -0.4198915660381317, -0.102123379707...
**Problem:** to navigate backwards with TAB in Zsh similarly as in Firefox by ``` Shift-TAB ``` **Example of what Shift-TAB should do** I run the following code in terminal ``` ls <TAB> ``` I get ``` A B C D E F G H I J K H L M N... ``` I see the following in Zsh as I press TAB [alt text http://dl.getdropbox...
[ -0.20510061085224152, 0.06331491470336914, 0.5784941911697388, -0.3653460144996643, -0.06122151017189026, 0.012232992798089981, 0.2668740749359131, -0.14401346445083618, -0.361357182264328, -0.678640604019165, -0.10511495918035507, 0.7212387919425964, -0.32299938797950745, -0.0098899556323...
-Y ``` and then try again!
[ 0.21525487303733826, 0.6452556848526001, 0.0965704694390297, -0.04498492181301117, -0.17417672276496887, 0.0172476377338171, 0.24184909462928772, 0.15488897264003754, 0.1183164045214653, -0.4331381022930145, -0.19415566325187683, 0.570148229598999, -0.18108898401260376, 0.3854008913040161,...
In my app I have a tab bar. And in some views I as well have a toolbar. So when I come to those views with a toolbar it looks ugly - two bars at the bottom of the view. I thought that it would be a best solution to hide a tab bar when entering those particular views. But I just couldn't figure out how to do it in a rig...
[ 0.5128669738769531, 0.06304573267698288, 0.5028976798057556, -0.006520854774862528, -0.18361671268939972, 0.2761199176311493, 0.41893476247787476, 0.14525094628334045, -0.163435697555542, -0.4194362759590149, 0.31008511781692505, 0.5447381734848022, -0.058362290263175964, 0.225563928484916...
am: ``` self.hidesBottomBarWhenPushed = YES; ``` But it didn't work as well. What is the right solution to this situation? I don't want to have 2 bars at any view. You have to use set the hidesBottomBarWhenPushed property to YES on the controller that you are pushing and NOT to the UITabBarController. ``` otherCon...
[ -0.15575534105300903, -0.029074203222990036, 0.8374961018562317, -0.02797391265630722, -0.012219071388244629, 0.06903348863124847, 0.2316114455461502, -0.39152443408966064, 0.0808660015463829, -0.8264855146408081, -0.22333253920078278, 0.8919676542282104, 0.008955606259405613, -0.121046841...
Is there a preference or tweak that will stop Eclipse from putting up a dialog "This file has been changed on the file system." when I switch to Eclipse from another editor? Steps: * open eclipse project * edit some file and save it (page is now 'clean' but has been touched previously) * switch to other editor * edi...
[ 0.31805217266082764, -0.010911921970546246, 0.5101893544197083, -0.09397958219051361, -0.43560469150543213, -0.1607757955789566, 0.1349247395992279, -0.09643383324146271, -0.12780405580997467, -0.790272057056427, -0.0993683934211731, 0.631519615650177, -0.3015872836112976, -0.2706448733806...
Trying to use an onmouseover event ``` echo $html->link("Dashboard", "/dashboard/index", array("onmouseover" => "Tip('Test');") ); ``` becomes ``` <a href="/dashboard/index" onmouseover="Tip(&#039;Test&#039;);">Dashboard</a> ``` How do I prevent the link function from removing the single quotes? Mayb...
[ 0.5188544988632202, 0.01203729398548603, 0.2638833820819855, 0.21183107793331146, -0.00438748300075531, -0.2816600203514099, 0.6657735109329224, -0.25167474150657654, -0.1312435269355774, -0.633795440196991, 0.058359965682029724, 0.5058498382568359, -0.328652948141098, -0.03646406903862953...
I'm trying to create text in html, that once clicked, the the value of a textbox residing near it, changes its value to be equal to that of the text clicked. Is there anyway I can do that? In other words, I want the functionality of a button (the onClick event) for a link/text. For example: What's wrong with this? ``...
[ 0.25724121928215027, 0.05384674295783043, 0.44916945695877075, -0.19114069640636444, -0.17525164783000946, -0.006405014544725418, 0.25343775749206543, -0.29214876890182495, -0.16955576837062836, -0.6148330569267273, -0.07775888592004776, 0.49473580718040466, -0.44668808579444885, -0.087762...
slightly simpler: ``` $('#foo').attr('value', 'bar'); ``` One could add this event to a span element, for example. It's best practice to use script to set these events and special styles to reflect how they act, so that without script their different (lack of) behavior still looks intuitive.
[ 0.45171472430229187, 0.04325671121478081, 0.1788378655910492, -0.012892978265881538, -0.2432461827993393, -0.15815967321395874, 0.16550105810165405, -0.21328173577785492, -0.18608088791370392, -0.2747582495212555, -0.3169429302215576, 0.6018320918083191, -0.2512592673301697, -0.19761796295...
I've created an MSI file with WiX. The source WiX file contains the version information like this: ``` <Product Id="..." Name="..." Language="1033" Version="1.0.0.1" Manufacturer="..." UpgradeCode="..."> ``` The MSI file seem to work OK: it installs, it uninstalls, i...
[ 0.2805262506008148, 0.16108933091163635, 0.47309109568595886, -0.22600503265857697, 0.17516693472862244, 0.22403652966022491, 0.3034989535808563, 0.00982847809791565, -0.03883621469140053, -0.9143986105918884, -0.32950738072395325, 0.45195481181144714, -0.26921361684799194, 0.1840737313032...
calling the MsiGetFileVersion() API, it returns error 1006 (ERROR\_FILE\_INVALID File does not contain version information.) Hence my question: how to (programmatically, in C++) retrieve the version number of an MSI file? Or, to put it another way, where in the WiX file should the version information go in order to b...
[ -0.13204894959926605, -0.10793095082044601, 0.28220105171203613, 0.06187755614519119, -0.09167640656232834, -0.08649545162916183, 0.6354566216468811, -0.13476938009262085, 0.019398517906665802, -0.8797279596328735, -0.10623451322317123, 0.7241752743721008, -0.31441956758499146, 0.069116592...
build tools (such as the [WiX toolset](http://wix.sf.net)) to use so they populate the File/@Version information correctly. It will not get you the version information out of an MSI. As @sascha shows you could query the Property table for the "ProductVersion" or you could use the ::MsiGetProductProperty() which will do...
[ 0.604414701461792, 0.01801864244043827, 0.10748851299285889, -0.0350508838891983, -0.014934413135051727, 0.010969220660626888, 0.4345368444919586, -0.10236986726522446, -0.061930373311042786, -0.8233476281166077, -0.20873980224132538, 0.4527023434638977, 0.014290791004896164, -0.0473405160...
I have 7 lines of text: ``` a b c d e f g ``` Now I want to add characters to the end of each line, to end up with: ``` a, b, c, d, e, f, g, ``` I found that I can use the "sed" command and run my selection through sed using "Filter through command" in Textmate ``` sed 's/$/,/' ``` Now, one question remains: h...
[ -0.00920911692082882, 0.23223070800304413, 0.6241993308067322, -0.24679170548915863, -0.09879690408706665, 0.5921159982681274, 0.4810692369937897, -0.09437373280525208, 0.16221849620342255, -0.8500717878341675, -0.2240433543920517, 0.3189607262611389, -0.19437973201274872, -0.0641855001449...
selected: ``` #!/bin/bash if [[ $(pbpaste|wc -l) -eq 0 ]] then r=`pbpaste` sed 's/$/'$r'/' else sed 's/$/,/' fi ``` It's currently limited to appending one line's worth of text, if the clipboard contains more than one line it will default to a comma at the end of the selected lines. **Edit:** To take t...
[ -0.12199566513299942, 0.0627887025475502, 0.6566481590270996, -0.08074360340833664, -0.23429922759532928, 0.38065043091773987, 0.1398983597755432, -0.2195524275302887, -0.39482077956199646, -0.4476621150970459, -0.49750569462776184, 0.25428852438926697, -0.2328038066625595, -0.074544839560...
--button1 "Okay" --button2 "Cancel") [[ $(head -n1 <<<"$r") == "2" ]] && exit_discard r=$(tail -n1 <<<"$r") sed "s/$/$r/" ```
[ -0.29457351565361023, -0.015245363116264343, 0.8620458841323853, -0.44023600220680237, 0.5352082252502441, 0.1368890255689621, 0.16071882843971252, -0.3244297504425049, -0.21623378992080688, -0.12664879858493805, -0.6163293719291687, 0.6205694675445557, -0.41159746050834656, 0.124378688633...
I have several textboxes where users can enter information into them. This can include commas, so I can't use the standard comma delimited strings. What is a good delimiter to denote that strings should be separated based on that character that isn't typically used by users in their writings? I'm going to be combining...
[ 0.216509148478508, 0.2430104911327362, 0.23937393724918365, 0.059076160192489624, -0.07075881958007812, 0.042514752596616745, 0.1026230901479721, 0.03851952776312828, -0.1728959083557129, -0.3440626263618469, 0.018223848193883896, 0.29655933380126953, -0.19705207645893097, 0.07705707103013...
to CSV. google "pipe delimited" and you will find many examples. ``` string[] items = new string[] {"Uno","Dos","Tres"}; string toEncrypt = String.Join("|", items); items = toEncrypt.Split(new char[] {'|'}, StringSplitOptions.RemoveEmptyEntries); foreach(string s in items) Console.WriteLine(s); ``` And since ev...
[ 0.09860878437757492, -0.017049025744199753, 0.6425023674964905, -0.12166546285152435, -0.13986682891845703, -0.06891763210296631, 0.43230244517326355, -0.33526611328125, -0.2872750461101532, -0.6859145164489746, -0.40894806385040283, 0.3964271545410156, -0.3995923101902008, 0.2204637825489...
I'm curious, is it possible to somehow intertwine Core Animation to give a "fade out" of a UIBarButtonItem? I have a tableView which I represent with two different data sources. Once a particular data source gets triggered, I'd like to fade out the current UIToolBar options and fade in new ones. Thanks for pointing me...
[ 0.5385150909423828, -0.12929262220859528, 0.37663543224334717, -0.02592427469789982, -0.15863920748233795, 0.3275451958179474, 0.29420650005340576, 0.053684402257204056, -0.09529638290405273, -0.5728579163551331, 0.11960310488939285, 0.41686978936195374, -0.27509605884552, 0.17911241948604...
reference to the toolbar in your code. Create an IBOutlet property and link the toolbar to it in IB: ``` @property (nonatomic, retain) IBOutlet UIToolbar *toolbar; ``` This will allow you to reference the UIToolbar as self.toolbar. Then, create your new buttons and add them to an NSArray and pass this to the -[UIToo...
[ 0.025724587962031364, -0.030877696350216866, 0.4422771632671356, -0.07311825454235077, 0.20784196257591248, 0.36647742986679077, 0.12398041039705276, -0.3575459122657776, -0.15609025955200195, -0.7077699303627014, -0.3249723017215729, 0.5618757009506226, -0.3929598331451416, -0.19392937421...
target:self action:@selector(handleTap:)] autorelease]; NSArray *newButtons = [NSArray arrayWithObjects:newItem, nil]; [self.toolbar setItems:newButtons animated:YES]; ```
[ -0.1032167300581932, -0.45448848605155945, 0.1885281205177307, -0.33614102005958557, 0.019220104441046715, 0.6180296540260315, 0.2698880136013031, -0.30092957615852356, -0.22608458995819092, -0.6176552772521973, -0.29400283098220825, 0.6601235270500183, -0.5569607615470886, -0.215738967061...
I am searching the following words in .todo files: ``` ZshTabCompletionBackward MacTerminalIterm ``` I made the following regex ``` [A-Z]{1}[a-z]*[A-Z]{1}[a-z]* ``` However, it is not enough, since it finds only the following type of words ``` ZshTab ``` In pseudo code, I am trying to make the following rege...
[ -0.01460668072104454, 0.3665342926979065, 0.478759229183197, -0.07351936399936676, -0.303631454706192, -0.09324704110622406, 0.42308780550956726, 0.032077476382255554, 0.09805687516927719, -0.3908081650733948, -0.043733615428209305, 0.5495434403419495, -0.40716129541397095, 0.1915708035230...
[A-Z] # initial uppercase [a-z]* # any number of lowercase letters ) # end grouping {2,} # quantifier: at least 2 instances, unbounded max \b # word boundary /x ``` If you want it without the fancy formatting, just remove the whitespace and comments: ``` /\b([A-Z][a-z]*)...
[ 0.0054869987070560455, 0.2902129888534546, 0.30196794867515564, -0.15126359462738037, -0.08063355833292007, -0.025212278589606285, 0.2852875590324402, -0.23662684857845306, 0.0869118720293045, -0.5440192222595215, -0.3934411406517029, 0.5276854038238525, -0.30590736865997314, 0.00831651594...
just consecutive capital letters. His solution, which I've expanded with `/x` to show some detail, ensures at least one lowercase letter: ``` / \b # start at word boundary [A-Z] # start with upper [a-zA-Z]* # followed by any alpha (?: # non-capturing grouping for alternation precede...
[ -0.2109127640724182, 0.019410742446780205, 0.48022276163101196, -0.21062320470809937, -0.3189680576324463, 0.35444366931915283, 0.37751391530036926, -0.27694985270500183, -0.19365233182907104, -0.398363322019577, -0.43213698267936707, 0.3412899672985077, -0.17507383227348328, -0.0345994383...
| # or [A-Z][a-zA-Z]*[a-z] # next bit is upper, any zero or more, ending with lower ) [a-zA-Z]* # anything that's left \b # end at word /x ``` If you want it without the fancy formatting, just remove the whitespace and comments: ``` /\b[A-Z][a-zA-Z]*(?:[a-z][a-...
[ -0.1801859587430954, 0.2919091582298279, 0.32771286368370056, -0.30495330691337585, 0.031327299773693085, 0.07503675669431686, 0.3133646547794342, -0.09932323545217514, -0.03915533423423767, -0.4747643768787384, -0.635836124420166, 0.48761796951293945, -0.2054627388715744, -0.0022626500576...
in [Learning Perl](http://oreilly.com/catalog/9780596520106/).
[ -0.5148018002510071, -0.3250204920768738, 0.08451215922832489, 0.22014541923999786, 0.008238288573920727, 0.1097935363650322, 0.16915719211101532, 0.3026644289493561, -0.4402148723602295, -0.44482389092445374, -0.5736650228500366, -0.016608169302344322, 0.23713241517543793, -0.062011055648...
My teacher gave out a practice exam on java recently and I'm curious to see how I did on the true/false part. I'm least confident about number one, so any explanation there would help a lot. 1. In Java, a class can extend any number of abstract classes. > false. I don't quite understand why, is it just because in ...
[ 0.1477058231830597, -0.08342864364385605, -0.1660388857126236, 0.10995002090930939, -0.32648205757141113, -0.5946536064147949, 0.4807497560977936, -0.13954973220825195, -0.2859286963939667, -0.16455993056297302, -0.004955756012350321, 0.36577266454696655, -0.33023306727409363, 0.2878612875...
class can have any number of subclasses. > True. I can't think of anything that would restrict this. 4. In Java, there is no restriction on the number of interfaces a class can implement. > True 5. It is not possible to implement a stack as a doubly-linked list, because a stack requires access to only one end of ...
[ 0.17377683520317078, -0.1663321852684021, -0.13385166227817535, 0.10958372056484222, -0.30461424589157104, -0.30685412883758545, 0.40540605783462524, -0.25996822118759155, -0.12786898016929626, -0.6525239944458008, -0.02529606781899929, 0.3089469373226166, -0.49307939410209656, 0.027232032...
abstract or not. It can transitively extend multiple classes (e.g., it extends B which extends C so indirectly it also extends C). A class can implement multiple interfaces. There are many reasons why Java does not support multiple inheritance, but it does support multiple interfaces, so it is better in many ways. 2) ...
[ 0.178235724568367, -0.14923793077468872, -0.19353537261486053, 0.1017920970916748, -0.42872294783592224, -0.33857375383377075, 0.38605746626853943, -0.23645782470703125, -0.12859737873077393, -0.6081054210662842, 0.18272502720355988, 0.40632420778274536, -0.5030781626701355, 0.053037516772...
limit by the JVM implementation, but you'll never hit it in practice) 5) You can easily implement a stack as a doubly linked list, it's a good exercise. It is even efficient since you're still doing everything at O(1).
[ 0.1860756278038025, -0.22260679304599762, 0.47328683733940125, 0.07627582550048828, 0.07629921287298203, -0.47877785563468933, 0.0023037856444716454, -0.5115092396736145, -0.5540809631347656, -0.47143998742103577, -0.15126608312129974, 0.5069223642349243, -0.0922808051109314, -0.1789340227...
In a View, code like this will generate the right URL to jump to *controller*'s *action* method based on the routes in your global.asax.cs file. ``` <%= Html.ActionLink("text", "action", "controller") %> ``` My question is how can I achieve a similar route-to-URL mapping outside a view, such as a Controller? There ...
[ 0.04937836155295372, -0.16241183876991272, 0.5577048063278198, -0.0427681989967823, -0.42690226435661316, 0.186978280544281, 0.24182824790477753, -0.09097893536090851, -0.09506422281265259, -0.7874404788017273, 0.03850270062685013, 0.43873313069343567, -0.33855360746383667, -0.068383537232...
and actions What you are looking for is `RedirectToAction`. If you want just the url, use the `Url` property of the controller - its a [UrlHelper](http://msdn.microsoft.com/en-us/library/system.web.mvc.urlhelper.aspx).
[ 0.037946440279483795, -0.515127420425415, 0.4741358757019043, 0.2919459044933319, -0.05565816909074783, 0.004057907499372959, 0.045801810920238495, -0.04983130842447281, -0.638467013835907, -0.47030168771743774, -0.19264525175094604, 0.4482332468032837, -0.427243173122406, 0.03263999521732...
I'm trying to reorganize my code and make it more unobstrusive. Mainly, there is a link for performing an action. If you click on the link, the action is performed via ajax (the ajax code is not on the code here) and the text is replaced by other text, offering the user the ability of undo the action. If the user clic...
[ 0.00616864999756217, 0.042346931993961334, 0.27443069219589233, 0.07231464982032776, -0.06042133644223213, 0.12934216856956482, 0.6644518971443176, -0.15276919305324554, -0.4011106789112091, -0.5153845548629761, -0.14325830340385437, 0.5481855869293213, -0.47824937105178833, -0.26623818278...
you click on the link of the first paragraph, which uses inline onclick call, the code works as expected. But if you click on the link of the second paragraph, which uses jQuery onclick function, the Undo link doesn't work, and I can't figure out why. Any help? Thanks a lot! ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHT...
[ 0.02252151444554329, 0.08057166635990143, 0.6265056729316711, 0.04251270368695259, -0.20863410830497742, -0.163097083568573, 0.26473838090896606, -0.22518011927604675, -0.22056545317173004, -0.6144456267356873, -0.48490849137306213, 0.6340774893760681, -0.3064132332801819, -0.1241438463330...
$(".add2").click(function(){ var placeId = $(this).parents(".place").attr("id"); $("#" + placeId + " .add2").remove(); $("#" + placeId + " .actions").append("<span class=\"added\">Added!</span> <a class=\"undoadd2\" href=\"#\">Undo</a>"); return false;
[ -0.021193530410528183, -0.002743281191214919, 0.4578680098056793, -0.5143786072731018, 0.2114957571029663, 0.40968555212020874, 0.3333335816860199, -0.4954002797603607, -0.11791305243968964, -0.3052164912223816, -0.4329666495323181, 0.5331709980964661, -0.4237084686756134, 0.11295574903488...
}) $(".undoadd2").click(function(){ var placeId = $(this).parents(".place").attr("id"); $("#" + placeId + " .actions").find("span.added, a.add2").remove(); $("#" + placeId + " .actions").append("<a class='add2' onclick='copyPlace(\"" + placeId + "\"); return f...
[ -0.0283941812813282, 0.0628138929605484, 0.3709593117237091, -0.32229095697402954, 0.6166523098945618, 0.26581135392189026, 0.2828185558319092, -0.5623318552970886, -0.055280111730098724, -0.3835607171058655, -0.505295991897583, 0.40398773550987244, -0.49225297570228577, 0.2868463695049286...
return false; }) }); function addPlace(placeId){ $("#" + placeId + " .add").remove(); $("#" + placeId + " .actions").append("<span class=\"added\">Added!</span> <a class=\"undoadd\" href=\"#\" onclick=\"undoAddPlace('" + placeId + "'); return false;\">Undo</a>"); ...
[ -0.14455844461917877, -0.03890141472220421, 0.6649423837661743, -0.5169076919555664, 0.36113953590393066, 0.2572804391384125, 0.4028491675853729, -0.6378074884414673, -0.16344906389713287, -0.35893529653549194, -0.5609918832778931, 0.5652279853820801, -0.4500426948070526, -0.03619973361492...
function undoAddPlace(placeId){ $("#" + placeId + " .actions").find("span.added, a.undoadd").remove(); $("#" + placeId + " .actions").append("<a class='add' onclick='addPlace(\"" + placeId + "\"); return false;' href='#'>Add place</a>"); return false; } </script> </head>...
[ -0.23909015953540802, -0.018265508115291595, 0.3358294665813446, -0.43781334161758423, 0.35342761874198914, 0.5250382423400879, 0.11820369958877563, -0.5352832078933716, -0.09492181241512299, -0.3059771656990051, -0.38896626234054565, 0.49172794818878174, -0.2500055134296417, -0.1724523752...
place</a></p> </div> <div class="place" id="3435912"> <p class="actions"><a href="#" class="add2">Add place</a></p> </div> </body> </html> ``` > Since you are dynamically adding new > items to the DOM, you will have to > register the click handler again on > the new items. You can use [`.live`...
[ -0.08799426257610321, -0.09712695330381393, 0.6354798674583435, -0.16285014152526855, 0.14498290419578552, 0.17719338834285736, -0.13279464840888977, -0.43491771817207336, -0.31867387890815735, -0.4956190288066864, -0.3226880431175232, 0.06767130643129349, -0.21100275218486786, 0.363207310...
I'm developing an application which has a Settings pane, following the AppPrefs sample by Apple. If my application is named AppPrefs, this is the exact name/prompt/ title the Settings application will provide. Is there anyway to make this change? Can my executable somehow be named (for example) Application1 and my...
[ 0.06521015614271164, 0.07504667341709137, 0.5919707417488098, -0.031750742346048355, 0.16867248713970184, 0.09589668363332748, 0.11366024613380432, -0.023372994735836983, -0.29681551456451416, -0.775742769241333, -0.12145644426345825, 0.6529719233512878, -0.3859234154224396, 0.172399133443...
How similar is distributed computing and threading? I've found two papers coming to quite opposite conclusions: "Multi-Threading is Easier Than Networking. How threading is easy and similar to network code" <http://software.intel.com/file/14723> (this gives me an impression that they're so similar that after encapsu...
[ 0.1260763704776764, 0.03851528838276863, -0.01715938188135624, 0.11395947635173798, -0.2461453229188919, -0.2450798749923706, -0.38826993107795715, 0.0706644207239151, -0.5876544117927551, -0.5641838312149048, 0.3447011709213257, 0.49586132168769836, -0.09495988488197327, 0.289727598428726...
to be very similar. Let me define for the purposes of this post a "node" to be one hardware thread running on one machine. So a quad core machine is four nodes, as is a cluster of four single processor boxes. Each node will typically be running some processing, and there will need to be some type of cross-node communi...
[ 0.45461803674697876, 0.15333692729473114, 0.3195854723453522, 0.2914598286151886, 0.22438202798366547, 0.34336093068122864, -0.10101160407066345, 0.13151009380817413, -0.39868679642677307, -0.8220698833465576, 0.0007611428154632449, 0.25918737053871155, -0.2921796441078186, 0.3961083889007...
memory and semaphores, are not typically available across a network. Shared files may be available, but performance is typically poor. Sockets tend to be the most common and most flexible choice over a network, rather than the more sophisticated mechanisms. At that point you have to deal with the details of network arc...
[ 0.20785142481327057, 0.14889457821846008, 0.0864095613360405, 0.3496208190917969, 0.20642583072185516, 0.09047646075487137, 0.05486273765563965, 0.12270471453666687, -0.5438385605812073, -0.8745552897453308, -0.5371496677398682, 0.30286118388175964, -0.09987165778875351, 0.3509801030158996...
network, where do you put the queue? If you centralize it, that machine may suffer very high bandwidth costs. Try to distribute it and things get very complicated very quickly. What I've found, in general, is the people tackling this type of parallel architecture tend to choose embarrassingly parallel problems to solv...
[ 0.402509480714798, -0.04941932111978531, 0.08911851048469543, 0.35154956579208374, 0.00598693173378706, -0.08879002928733826, -0.009067210368812084, 0.6175447702407837, -0.738330066204071, -0.834202229976654, 0.33300721645355225, 0.412961483001709, -0.4138409197330475, 0.34923651814460754,...
behaves identically to a distributed system, using pure message passing and not assuming any thread to be the "main" one and such, then yes, they're going to be very similar. But what you've done is pretended you have a distributed architecture and implemented it in threads. The thing is that threading is a much simple...
[ 0.2790761888027191, -0.1593460738658905, 0.01158853992819786, 0.44557836651802063, -0.09984809905290604, -0.04504559561610222, 0.06715703755617142, 0.349075049161911, -0.6384174227714539, -0.5430006384849548, 0.19418929517269135, 0.3673827648162842, -0.6636210083961487, 0.36624348163604736...
local to a machine. You're not taking advantage of the special case.
[ 0.3746044635772705, -0.052819572389125824, -0.05211154744029045, 0.15876039862632751, 0.21226410567760468, 0.04277895390987396, 0.05591779202222824, 0.2508622705936432, -0.28209614753723145, -0.4878098964691162, -0.02393282577395439, 0.5201168060302734, -0.32137176394462585, 0.053676735609...
Almost any working PHP programmer has faced having to use CURL to send raw HTTP requests, whether it's for credit card payment processing, nefarious screen scraping, or something in-between. Almost any forum where PHP programmers congregate has a large number of people who [can't get the cURL functions to do what they...
[ 0.5821688175201416, 0.1253974586725235, 0.07847806066274643, 0.18625901639461517, -0.42134854197502136, -0.552351713180542, 0.45889896154403687, -0.07632226496934891, -0.3240661323070526, -0.28252387046813965, -0.13082516193389893, 0.3438263535499573, -0.34111717343330383, -0.0683233141899...
to figure out why their request isn't working? I find the CURLINFO\_HEADER\_OUT option to be very useful. ``` <?php $curl = curl_init('http://www.php.net'); curl_setopt($curl, CURLOPT_HEADERFUNCTION, 'dbg_curl_data'); curl_setopt($curl, CURLOPT_WRITEFUNCTION, 'dbg_curl_data'); curl_setopt($curl, CURLINFO_HEADER_OUT, ...
[ 0.07591543346643448, 0.02462545782327652, 0.6972813010215759, -0.23989538848400116, -0.07184017449617386, 0.04135762155056, 0.5498753190040588, -0.4475032091140747, 0.016353927552700043, -0.5871201157569885, -0.6514826416969299, 0.5304896831512451, -0.5430484414100647, 0.07540670782327652,...
What **automated standards-conformance tests** are there for OpenID providers? I'm making changes to the implementation of an [OpenID](http://openid.net/) provider, to bring it from version 1.1 of the standard to version 2.0. Before releasing the code, I want to be sure that it conforms to the specifications of the s...
[ 0.5760823488235474, 0.09756650775671005, 0.3479420244693756, 0.14229212701320648, -0.33999788761138916, -0.5152560472488403, 0.3173315227031708, -0.09986306726932526, -0.2349318116903305, -0.8053557276725769, -0.002326532732695341, 0.3979085385799408, -0.1044021025300026, 0.063691623508930...
the certification process: <https://openid.net/certification/testing/> Enjoy!
[ 0.9138166308403015, 0.025154924020171165, 0.2981020212173462, 0.3542371392250061, 0.2521076500415802, -0.9605988264083862, 0.4738515317440033, 0.014653317630290985, -0.19712157547473907, -0.1931038349866867, -0.18327555060386658, 0.43511027097702026, 0.3288433253765106, -0.0224115122109651...
I am learning Ruby and thought of making a Binary->Decimal converter. It gets a binary string and converts to decimal equivalent. Is there a way to keep track of the current iteration step in ruby so that the variable 'x' can be removed? ``` def convert(binary_string) decimal_equivalent = 0 x=0 binary_s...
[ -0.0017166141187772155, 0.17468038201332092, 0.2113501876592636, -0.11628276854753494, -0.3037988543510437, -0.28340548276901245, 0.39711037278175354, -0.24696238338947296, 0.10340112447738647, -0.9062478542327881, -0.02889525331556797, 0.3314318060874939, -0.3251214027404785, -0.046241305...
binary_string.reverse.enum_for(:each_char).each_with_index do |binary, i| decimal_equivalent += binary.to_i * (2 ** i) end return decimal_equivalent end ``` Incidentally, you may be interested in `Array#pack`, and `String#unpack`. They have support for bit strings. Also, an even easier way to get this result ...
[ 0.062348973006010056, 0.1703825742006302, 0.04644432291388512, -0.26194897294044495, 0.03480307385325432, -0.030974166467785835, 0.1952456831932068, -0.3723379671573639, -0.23831644654273987, -0.5458438396453857, -0.35940566658973694, 0.3491349220275879, -0.28809306025505066, 0.01111014187...
I have the following in my .Zshrc ``` . /Users/Masi/bin/Zsh/prompt ``` I need run the following code to access the file from .zshrc ``` Ctrl-Z vim ~/bin/Zsh/prompt ``` I tried to do the same unsuccessfully by first highlighting the path in visual mode and running ``` :'<,'>!vim ``` **How can you move...
[ -0.010676194913685322, 0.12731045484542847, 0.817241370677948, -0.01446690782904625, -0.061054784804582596, -0.0748772919178009, 0.18608230352401733, 0.01612704247236252, -0.3239029347896576, -0.898698627948761, -0.13097628951072693, 0.5599772930145264, -0.3674103617668152, 0.3667995333671...
with the file under the cursor, use ^Wf. See also the question [How do you return from 'gf' in Vim](https://stackoverflow.com/questions/133626/how-do-you-return-from-gf-in-vim) for more information on file navigation.
[ -0.226830393075943, -0.1534276306629181, 0.6445645093917847, -0.07969795167446136, -0.2473476380109787, 0.0123944953083992, 0.09938444197177887, 0.1028904840350151, -0.511771559715271, -0.4975934624671936, -0.4878934919834137, 0.4893436133861542, -0.24066703021526337, 0.05532458424568176, ...
What I am trying to do is the following: I have an array of values, these values will eventually be used to generate a random unique string but that's a little later. First I would like to loop through all the values in the array (foreach loop) then I would like to limit this (while loop) Is this a correct method for d...
[ 0.3869327902793884, 0.15629228949546814, 0.3974662125110626, -0.07159861922264099, -0.06709785014390945, 0.0990046039223671, 0.38464483618736267, -0.3769362270832062, -0.17149752378463745, -0.28219854831695557, 0.41672393679618835, 0.42731600999832153, -0.4112321138381958, 0.24053052067756...
'9', '0', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '!', '£', '$', '%', '^', '&', '*', '(', ')', '_', '+', '{', '}' ); $length_of_unique_key = 15; $counter = 0; foreach($a...
[ -0.00932632852345705, 0.23439547419548035, 0.49321073293685913, -0.04097866639494896, 0.276928573846817, 0.9466313123703003, 0.1958465278148651, -0.04881327599287033, -0.14989073574543, -0.10643447190523148, -0.6067084670066833, 0.1564401537179947, -0.20426242053508759, 0.4056515097618103,...
as $values) { $counter++; while ($counter <= $length_of_unique_key) { } } ?> ``` Shouldn't you be incrementing your counter within the `while` loop, so it can exit?
[ 0.45851796865463257, -0.0627506673336029, 0.5639705061912537, -0.2869732081890106, 0.20019492506980896, -0.08590535819530487, 0.4739559590816498, -0.3993796110153198, -0.168936625123024, -0.01611604355275631, -0.1123296394944191, 0.35619446635246277, -0.1562800258398056, 0.4875526428222656...
HI. I need to write some text over a custom button. So I subclassed UIButton. In -drawrect, I write the text I need. The problem is that the text ends up under the button. After I write my text, UIButton's drawrect goes ahead and draws on top of me. I am not even calling [super drawrect: rect] even though I was antici...
[ -0.09487581998109818, -0.23563656210899353, 0.7511729598045349, -0.03165166825056076, -0.7199466824531555, -0.06351958215236664, -0.05840152129530907, -0.039126474410295486, -0.16557173430919647, -0.5528681874275208, -0.09731487929821014, 0.5502896308898926, -0.4910743534564972, 0.05095855...
(as you found). You have three options: * Leave the button's title blank and add a new text field to the button at the position you want. * if you are using 3.0 access the button's label property. Although the label itself is read only its properties (including frame) are not. * Sub-class UIControl. UIControl is a UIV...
[ 0.18098166584968567, -0.452409952878952, 0.4996225833892822, 0.07364565134048462, -0.39908015727996826, -0.16564859449863434, 0.3608401119709015, -0.3306713402271271, -0.2659560441970825, -0.8099382519721985, -0.3822358548641205, 0.5953792929649353, -0.3146200478076935, -0.1069194525480270...
these controls I would use the third option. Otherwise use the first (or second if you are on 3.0).
[ 0.17946888506412506, -0.16461323201656342, 0.3536396622657776, -0.00529026985168457, -0.17260655760765076, -0.09385655075311661, 0.14221908152103424, -0.32662785053253174, 0.019137535244226456, -0.7430525422096252, -0.04154594987630844, 0.8980112075805664, -0.3501947820186615, -0.278246521...
I've inherited an old Classic ASP website to modify. Although not requested up-front, I'd like to delete a bunch of the old "orphaned" pages. For some reason, The old developer decided to create muliple instances of the file instead of using source control (eg. `index-t.asp, index-feb09.asp, index-menutest.asp`). I'...
[ 0.3811514675617218, 0.31454724073410034, 0.06569038331508636, -0.00313333747908473, -0.05682918429374695, -0.19949573278427124, 0.2465527057647705, 0.3561724126338959, -0.35789114236831665, -0.9227458834648132, 0.0326380729675293, 0.1099170371890068, 0.0651862695813179, 0.6127352118492126,...
I'm working on a project and I came to the following *naming problem*. I'd like to implement the factory pattern but I don't know the best class namings to use (i'm changing from one to the other and it's quite time-consuming :S). I usually go for namespaces to separate *groups* of classes, but my *problem* is with t...
[ 0.2743367850780487, 0.1994188278913498, 0.036298684775829315, -0.3239990770816803, -0.20806998014450073, 0.35425782203674316, 0.31523072719573975, -0.1450306475162506, -0.24885690212249756, -0.8891260027885437, 0.21414269506931305, 0.12344534695148468, -0.5925410389900208, 0.68882030248641...
can mix up the Mesh classes (whether is the factory class or the actual Mesh class). Actually, this is a simplification, my problem involves some more namespaces and the classes that have the same name are used in both namespaces. I was thinking on maybe using suffixes to separate the classes and put them on the same ...
[ 0.3574577271938324, -0.14943285286426544, -0.08683298528194427, 0.16271506249904633, -0.03567042946815491, 0.15480464696884155, 0.27627331018447876, -0.046889979392290115, -0.08171462267637253, -1.0637153387069702, 0.18133261799812317, 0.34949085116386414, -0.7655069231987, 0.3746801912784...
would end up using the namespace name do differentiate them: ``` class Mesh { ... }; namespace Factory { class MeshFactory // I can't figure a better different name { ... }; } ``` I prefer the second option. Is there a solid reason why is better the first option? Or is there another way? Wha...
[ 0.06121869385242462, -0.06126219034194946, 0.006106052082031965, -0.08347318321466446, -0.08706506341695786, 0.20586276054382324, 0.3368063271045685, -0.02603110298514366, -0.08689307421445847, -1.140589714050293, -0.03812646493315697, 0.6872081160545349, -0.5311353802680969, 0.39596071839...
be the same class, with the same name. If it does not, then they should be different classes, with different names. Since it's likely that they only purpose of the factory class will be to produce instances of the Mesh class, I suggest you name it MeshFactory. The namespace is not relevant.
[ 0.4507404863834381, -0.2542150020599365, -0.03779446333646774, -0.06024580076336861, -0.17315250635147095, 0.1021597683429718, 0.39287087321281433, 0.23295284807682037, 0.03659826144576073, -1.0918757915496826, 0.20263315737247467, 0.6254892349243164, -0.7203812003135681, 0.396676510572433...
Any info out there on how to print the generated charts in say PDF format? They look fabulous on screen but the end users want to print them and file as needed. download the Chart Control samples from MSDN. there are several samples of how to print. To get PDF, you need a PDF print driver. <http://code.msdn.microsoft....
[ 0.07570457458496094, -0.09505578130483627, 0.8726017475128174, 0.2646235525608063, 0.03969801962375641, -0.20433814823627472, -0.08861644566059113, -0.05820732191205025, -0.4919527471065521, -0.7990005016326904, -0.022357093170285225, 0.4948919415473938, -0.18934735655784607, -0.1523350775...
--EDIT-- I believe this is a valid question that may have multiple answers (as defined [here](https://stackoverflow.com/questions/157125/do-we-really-need-the-subjective-tag-and-is-it-commonly-mis-used/157227#157227)). This is NOT a discussion nor a poll. Furthermore, this question is evidently NOT argumentative as no...
[ 0.7388008832931519, 0.3685254156589508, -0.005392149090766907, 0.2385490983724594, 0.18050667643547058, -0.17943885922431946, 0.4078017473220825, -0.15251262485980988, -0.02909669280052185, -0.3079098165035248, -0.04841780662536621, 0.684747576713562, 0.19335800409317017, -0.05062958970665...
power of the team But the worst of all is code complexity. My code tends to get *evil*. It even bites *myself* after a few weeks. I put tremendous effort in keeping it simple, readable, maintainable, elegant, beautiful, cohesive, loosely coupled, based on nice straightforward abstractions. But all this effort goes dow...
[ 0.20172634720802307, -0.07666340470314026, -0.04533906280994415, 0.24483788013458252, -0.19934886693954468, -0.11607418209314346, 0.7192147374153137, -0.16116195917129517, -0.05581934005022049, -0.7549165487289429, -0.07412784546613693, 0.48610010743141174, 0.13779272139072418, -0.16595230...
adding a feature he would HAVE to do something stupid. There's no way he'd be able to do it RIGHT, even if he was a GENIUS, even if he was my own CLONE unfamiliar with the codebase. Why, why for God's sake does this happen? Isn't there some methodology, some technology, some meditation technique, anything at all?! How...
[ 0.7339685559272766, 0.24889563024044037, -0.16880914568901062, 0.351464182138443, 0.1352924257516861, 0.012267191894352436, 0.6965163946151733, 0.02741406299173832, -0.3540742099285126, -0.47106054425239563, 0.10759412497282028, 0.5841289758682251, -0.33949509263038635, 0.147029310464859, ...
be "implement x by tomorrow to keep the sky from falling." Towards simplicity ... TDD mentioned thoroughly, agree totally. TDD is a trick to keep code focussed on what it needs to do and no more. Re-factor frequently mentioned. Totally agree. On simplicity vs complexity and working alone ... don't work alone on ship...
[ 0.7391027212142944, 0.1178911104798317, 0.04028931260108948, 0.1299358755350113, -0.2538411021232605, -0.06053883582353592, 0.5231994390487671, -0.23239293694496155, 0.2066868245601654, -0.9640016555786133, -0.20442457497119904, 0.9254998564720154, -0.005102983675897121, -0.154074952006340...
lucid and just better with a teammate. Don't care how green they are. Actually, the greener the better to ensure clear code. On working alone ... Working alone has its place in R&D, not shipped code. At best, lone cowboy projects make cool stuff that is terrible pain to maintain. Work done alone always needs a month ...
[ 0.6487600207328796, 0.0013323171297088265, -0.12911486625671387, 0.5768041610717773, -0.05722823739051819, -0.25861111283302307, 0.6168416738510132, 0.12492705881595612, -0.12572616338729858, -0.5180083513259888, 0.20466841757297516, 0.6644382476806641, 0.04620366543531418, -0.305602073669...
various books on Domain Drive Design extremely helpful in providing ways to create super clear code. DDD not applicable to every problem though. If you do find the answer to the balance between simplicity and over-engineering ... well, I wouldn't even know what to do then. I suppose I'd get bored and find another lin...
[ 0.72745680809021, 0.24214589595794678, 0.14636556804180145, 0.43578070402145386, -0.1590712070465088, -0.2649262845516205, 0.28230229020118713, 0.46348249912261963, -0.011351609602570534, -0.529462456703186, 0.3380885124206543, 0.6565686464309692, 0.05863373354077339, 0.49400076270103455, ...
In **Java**, what is the maximum size a `String` object may have, referring to the `length()` method call? I know that `length()` return the size of a `String` as a `char []`; Considering the [`String`](http://docs.oracle.com/javase/7/docs/api/java/lang/String.html) class' [`length`](http://docs.oracle.com/javase/7/do...
[ -0.028572846204042435, 0.1519414335489273, 0.30878785252571106, -0.28349632024765015, 0.0313422828912735, 0.13226436078548431, 0.04816226288676262, -0.5275090336799622, -0.28440308570861816, -0.30549636483192444, -0.11889240890741348, 0.36593762040138245, -0.12157730758190155, -0.135412588...
variables contained in an array > have no names; instead they are > referenced by array access expressions > that use nonnegative integer index > values. These variables are called the > *components* of the array. If an array > has `n` components, we say `n` is the > *length* of the array; the components of > t...
[ 0.028285367414355278, 0.05512532964348793, 0.3947359323501587, 0.010147793218493462, -0.19058148562908173, 0.017879273742437363, 0.12918837368488312, -0.540000855922699, -0.08177916705608368, -0.35114189982414246, -0.09087200462818146, 0.44539734721183777, -0.44953519105911255, 0.131020799...
1`, as that is the maximum value for a nonnegative `int` value. However, there probably are going to be other limitations, such as the maximum allocatable size for an array.
[ -0.09736961871385574, -0.11328733712434769, -0.044251106679439545, -0.3526913821697235, -0.018155109137296677, -0.1448892503976822, 0.1293722689151764, -0.4474455714225769, -0.21461963653564453, -0.2887254059314728, -0.3187190592288971, 0.31262123584747314, -0.38559219241142273, -0.1125303...
Basically, I was hoping to sort of keep my files sorted instead of having them all in the same folder as my executable, but referencing files in sub folders relative to my executable has proven difficult. ``` // DEFINES #define IMAGE_BACKGROUND "\\content\\images\\background.bmp" #define FONT_MAIN "\\content\\fonts\\s...
[ -0.10634324699640274, 0.10840709507465363, 0.7565357089042664, 0.0056924824602901936, 0.21266628801822662, -0.02901333011686802, 0.3621174693107605, -0.0625821202993393, -0.23807796835899353, -0.9140177369117737, 0.014021207578480244, 0.4766963720321655, -0.38714393973350525, -0.1172047555...
I am hoping that an architecture question is reasonable on Stackoverflow, so I am asking this here. I have been trying to see where a functional language would be useful outside of math-oriented problems, and it dawned on me that an ESB (Enterprise Service Bus) would be perfect for a FP language, as there isn't anythi...
[ 0.09039018303155899, -0.12601079046726227, 0.015265697613358498, -0.051555585116147995, -0.05342738330364227, 0.17863531410694122, 0.020124102011322975, -0.02190266363322735, -0.21144826710224152, -0.7641661167144775, -0.052096955478191376, 0.2688535451889038, -0.1792285144329071, -0.08992...
like Erlang may be very useful I believe. This is very much a variable scope issue. Currently, the text field and button are in the scope of the `main` method, so having a separate class for the `ActionListener` will mean that it will not have access to those variables. There are a few ways to achieve this: (1) Make...
[ -0.0552385076880455, -0.05980358645319939, 0.43693020939826965, -0.3400091826915741, -0.09463769197463989, -0.08549217134714127, 0.2817980945110321, -0.3290174603462219, -0.10474010556936264, -0.5213279724121094, -0.22830712795257568, 0.6530486345291138, -0.5400007367134094, 0.143020659685...
myTextFieldSubmit.addActionListener(new ListenerClass()); } static class ListenerClass implements ActionListener { public void actionPerformed(ActionEvent e) { myTextField.setText(""); } } } ``` (2) Make an anonymous inner class in the `main` method, and this will allow `myTextField` and `m...
[ -0.17749950289726257, -0.13859869539737701, 0.6670164465904236, -0.5766308903694153, -0.134173184633255, 0.31154677271842957, 0.4442717730998993, -0.3942943513393402, -0.0001738355349516496, -0.5668364763259888, -0.5374395847320557, 0.6952816247940063, -0.4222252070903778, 0.01407143287360...
public void actionPerformed(ActionEvent e) { myTextField.setText(""); } }); } } ``` (3) Make a local class that is local to the `main` method. Again, this will require the text field and button to be declared `final` to allow access from the inner class. ``` public class MyClass { ...
[ -0.16191257536411285, -0.29703250527381897, 0.5871867537498474, -0.5486841201782227, 0.12871332466602325, 0.20651081204414368, 0.38851046562194824, -0.09397119283676147, -0.1330292522907257, -0.4558107852935791, -0.5323976278305054, 0.650684654712677, -0.467241108417511, 0.2281878143548965...
= new JButton("Submit"); class ListenerClass implements ActionListener { public void actionPerformed(ActionEvent e) { myTextField.setText(""); } } myTextFieldSubmit.addActionListener(new ListenerClass()); } } ``` (4) Handing an reference to the `ListenerClass`, for exampl...
[ -0.04350484162569046, -0.0031311470083892345, 0.6794536113739014, -0.5588245987892151, -0.10302244126796722, 0.36142200231552124, 0.45061928033828735, -0.7097453474998474, -0.04325959086418152, -0.5589945912361145, -0.6046831011772156, 0.7182019352912903, -0.3598172962665558, 0.04763597249...
public static void main(String args[]) { new MyClass(); } } class ListenerClass implements ActionListener { MyClass myClass; public ListenerClass(MyClass myClass) { this.myClass = myClass; } public void actionPerformed(ActionEvent e) { myClass.myTextField.setText(""); } } ``` (5) Make...
[ -0.15178410708904266, -0.18122005462646484, 0.578498363494873, -0.6313468813896179, 0.030488431453704834, 0.4947631061077118, 0.4630780816078186, -0.39028292894363403, -0.2966904640197754, -0.4204346239566803, -0.5604926347732544, 0.7943506240844727, -0.4046865701675415, 0.1824769824743271...
e) { MyClass.myTextField.setText(""); } } ``` There still probably are more ways to achieve this, and there may be better ways to implement this. The choice of which approach you take really depends up on the desired design of the application.
[ 0.32455986738204956, 0.06610453128814697, 0.42833706736564636, 0.0041967942379415035, 0.14416716992855072, -0.24539043009281158, 0.1968439370393753, 0.04093025624752045, 0.10549397766590118, -0.8534398674964905, -0.22526021301746368, 0.5888972878456116, -0.1629284918308258, -0.048541318625...
I've read about it, I understand it's basic function--I'd like to know an example of a common, real-life use for this pattern. For reference, I work mostly with business applications, web and windows, using the Microsoft stack. Think of an Itinerary builder. There are lots of things you can add to you Itinerary like h...
[ 0.8049355149269104, 0.30429795384407043, 0.07940643280744553, 0.13725699484348297, 0.49167194962501526, 0.4448149502277374, 0.1250023990869522, 0.015175185166299343, -0.4167678654193878, -0.35915473103523254, 0.07930706441402435, 0.27499961853027344, -0.28469470143318176, 0.202400133013725...
out an Itinerary. What you need is a factory where you can have different steps, certain steps happen, others don't and generally produce very different types of objects as a result of the creation process. In general, you should start with factory and go to builder only if you need higher grain control over the proce...
[ 0.6385828852653503, -0.19250687956809998, 0.017494115978479385, 0.0591726116836071, 0.1289444863796234, 0.1776670515537262, 0.5498459339141846, 0.01627896912395954, -0.4567644000053406, -0.8147463202476501, -0.06890691816806793, -0.21710489690303802, -0.24336157739162445, -0.05833481624722...
As I'm currently learning to use WCF Services, I am constantly encountering tutorials on the internet which mention using a `ServiceHost` when using a WCF Service. **What exactly is this `ServiceHost` ?** --- In my current project I am using a WCF Service and having a reference to it from my app and whenever I want...
[ 0.0330813005566597, 0.44099897146224976, 0.576448380947113, -0.15948234498500824, 0.05940036103129387, -0.2394186109304428, 0.30536988377571106, 0.03674677759408951, -0.22299006581306458, -0.9368002414703369, 0.0000035959794786322163, 0.5851081013679504, -0.17836600542068481, 0.42042291164...
my IIS and I just access the `.svc` from my app to instantiate the `ServiceClient`. So why and where is `ServiceHost` used? A ServiceHost basically provides you everything you need to host a WCF service in a non-IIS or WAS setting. A common place for a ServiceHost would be in a console app or Windows service. See the ...
[ 0.17453882098197937, 0.08676707744598389, 0.4797258973121643, -0.12298966944217682, 0.08741697669029236, -0.35426774621009827, 0.13031384348869324, -0.10060019791126251, -0.12960109114646912, -1.0204076766967773, -0.18403099477291107, 0.5055695176124573, -0.10066591948270798, 0.40631547570...