text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
I'm about to inherit a rather large Java enterprise project that has a large amount of third party dependencies. There is at least seventy JARs included and some of them would seem to be unused e.g. spring.jar which I know isn't used. It seems that over the years as various developers have touched upon the code base t...
[ 0.4137001633644104, 0.3963322341442108, 0.007284197956323624, 0.015123282559216022, -0.08348684757947922, 0.01503429003059864, 0.04748811200261116, 0.0679532065987587, -0.3367392122745514, -0.5392980575561523, 0.2705271542072296, 0.2568717896938324, 0.5182613730430603, 0.5403608083724976, ...
to answers across languages that people think will be helpful. Personally, I think you have to start by assessing the scale of the problem. It's going to be fairly painful, but I'd make a list of the dependencies and work out exactly which parts of the project use which ones. Then I'd work out exactly what features of...
[ 0.340003103017807, -0.024344829842448235, -0.10212699323892593, 0.4866067171096802, 0.21051758527755737, 0.1771605908870697, 0.3278364837169647, 0.11064513027667999, -0.139632448554039, -0.6391588449478149, -0.032364994287490845, 0.34151679277420044, 0.02050374262034893, -0.128137409687042...
all of the dependencies that you only use to a small extent. Checking around might uncover things that you could use from other libraries that would eliminate the lesser used libraries. I'd also have a look around to see if there's anything small that you could just re-write and include in your own code-base. Finally...
[ 0.722540557384491, 0.025828393176198006, 0.06973645836114883, 0.5266344547271729, 0.20784299075603485, -0.11057617515325546, 0.23344488441944122, 0.22998422384262085, -0.21038667857646942, -0.3243296444416046, 0.22548918426036835, 0.6947441101074219, -0.29659736156463623, 0.109152257442474...
or less dependent on a lot of vendors!! ;o)
[ 0.3816530108451843, 0.09500742703676224, 0.27578333020210266, 0.22913998365402222, -0.06237945705652237, 0.3928108513355255, 0.11792594939470291, 0.18143907189369202, -0.05044405162334442, -0.5400320291519165, -0.14802446961402893, 0.6633747220039368, -0.08345860987901688, 0.11141669005155...
Is it possible to create a form on Windows using Ruby? I have a Ruby script and I would like to have an input form to ask for a user's password, then use this in the rest of my script. update: I have successfully done this with wxRuby, although it looks ugly. Shoes looks promising, I might look into that if I need to...
[ 0.6837693452835083, -0.12191218137741089, 0.2279440015554428, -0.17492985725402832, -0.14777156710624695, 0.010597215965390205, 0.6884763240814209, -0.12150487303733826, -0.021883269771933556, -0.8380277156829834, 0.4509403705596924, 0.691335916519165, -0.11222974956035614, -0.057453766465...
I want to check the login status of a user through an ajax request. Depending wether the user is logged in I want to display either the username/password input or the username. Currently the request is sent on body.onload and a prgoress indicator is shown until the response arrives. Is there a better way? --- Let's a...
[ 0.2607883810997009, 0.011300522834062576, 0.7913678288459778, -0.05973781272768974, -0.08829563111066818, -0.1409190148115158, 0.21147571504116058, -0.14433662593364716, -0.027786199003458023, -0.8061485886573792, -0.08638066053390503, 0.6907636523246765, -0.1292290985584259, 0.25818634033...
document.addEventListener("DOMContentLoaded", f, false); } else { if (document.readystate == 'complete') { window.setTimeout(f, 0); } else { //Add event to onload just if all else fails attachEvent(window, "load", f); }
[ -0.18893854320049286, -0.2844049632549286, 0.5162452459335327, -0.21473702788352966, 0.3314206004142761, -0.2150692641735077, 0.3052016794681549, -0.35982605814933777, -0.010240420699119568, -0.5582765936851501, -0.49387580156326294, 0.7010265588760376, -0.19240312278270721, -0.00236172880...
} } ``` Or for a more complex solution: <http://snipplr.com/view/6029/domreadyjs/>
[ -0.16394485533237457, -0.07343342900276184, 0.5609353184700012, -0.08225096762180328, 0.307534396648407, -0.09146464616060257, 0.4016210436820984, 0.18021565675735474, 0.13426631689071655, -0.47841960191726685, -0.38521137833595276, 0.8268178105354309, -0.05051029101014137, 0.4106225073337...
I'm using the following code to loop through a directory to print out the names of the files. However, not all of the files are displayed. I have tried using **clearstatcache** with no effect. ``` $str = ''; $ignore = array('.', '..'); $dh = @opendir( $path ); if ($dh === FALSE) { // error...
[ 0.3856162130832672, 0.14817707240581512, 0.3318062126636505, -0.21925561130046844, 0.17769558727741241, -0.12686476111412048, 0.7535102963447571, -0.15866629779338837, -0.3467892110347748, -0.6521790027618408, -0.20263643562793732, 0.3854336142539978, -0.3465072512626648, 0.312122672796249...
if (in_array($file, $ignore, TRUE)) { break; } $str .= $file."\n"; $file = readdir( $dh ); } ``` Here's the contents of the directory right now: ``` root.auth test1.auth test2.auth test3.auth test5.auth ``` However, test5.auth does not appear. If I rename it to test4.auth it does not appear...
[ 0.4701710343360901, 0.2715494930744171, 0.15279723703861237, -0.32961052656173706, 0.1808795928955078, 0.11560149490833282, 0.5981642007827759, -0.20141848921775818, -0.08119950443506241, -0.7394235134124756, -0.02583417296409607, 0.542634904384613, -0.30167335271835327, 0.1529441475868225...
on earth could be happening? I'm running Arch Linux (kernel 2.6.26-ARCH) with PHP Version 5.2.6 and Apache/2.2.9 with Suhosin-Patch. My filesystem is ext3 and I'm running fam 2.6.10. Your `break` keywords messes up your code: Your loop very likely first encounters the '.' directory and than breaks out of your while...
[ 0.5206950306892395, 0.457240492105484, 0.3781282901763916, -0.07704546302556992, 0.29073575139045715, -0.1917950063943863, 0.9914658665657043, 0.4004386365413666, -0.06287708878517151, -0.24012404680252075, -0.057493239641189575, 0.21317830681800842, -0.21232068538665771, 0.398991376161575...
I want to be able to set my country of origin - does this involve testing through a proxy, or is there something that can be set else where? I would use [TOR](http://www.torproject.org/) for this purpose. That way you are sure you are hitting the site from a different country.
[ 0.775842547416687, 0.14725996553897858, 0.1259099841117859, 0.12490382045507431, 0.43216177821159363, 0.03933649882674217, 0.1638433337211609, 0.4980749487876892, -0.24623899161815643, -0.23400653898715973, -0.007816328667104244, -0.287591814994812, 0.2694793939590454, 0.20545624196529388,...
I'm working on a simple 2D game engine in Java, and having no trouble with FSEM, buffer strategies, and so on; my issue is with the mouse cursor. In windowed mode, I can hide the mouse cursor, no problem, by using setCursor() from my JFrame to set a wholly-transparent cursor. However, after a call to device.setFullScre...
[ -0.2508927881717682, 0.0111319525167346, 0.46010923385620117, -0.26421111822128296, -0.08408752828836441, -0.14271043241024017, 0.41864708065986633, 0.08718997240066528, -0.18583020567893982, -0.7222845554351807, -0.0918433889746666, 0.6610093712806702, -0.3005121052265167, 0.0584904924035...
I can't get rid of it. I'm working under JDK 6, target platform is JDK 5+. **UPDATE:** I've done some more testing, and it looks like this issue occurs under MacOS X 10.5 w/Java 6u7, but not under Windows XP SP3 with Java 6u7. So, it could possibly be a bug in the Mac version of the JVM. I think I've finally found th...
[ 0.23760199546813965, 0.07509779185056686, 0.8131572008132935, -0.09421081840991974, 0.18401455879211426, -0.04547776281833649, 0.5104374885559082, 0.04802459105849266, -0.13884936273097992, -0.7606938481330872, -0.12484722584486008, 1.131359577178955, -0.22566813230514526, 0.06744992733001...
I'm using SqlServer for the first time, and in every single one of our create procedure scripts there is a block of code like below to remove the procedure if it already exists: ``` IF EXISTS (SELECT * FROM information_schema.routines WHERE routine_name = 'SomeProcedureName' AND routin...
[ 0.31744006276130676, 0.23421970009803772, 0.06256864964962006, -0.1310872584581375, 0.09413794428110123, -0.2349053919315338, 0.16253206133842468, 0.04216047748923302, -0.14084964990615845, -0.5727606415748596, 0.204583078622818, 0.5940883755683899, -0.3227112889289856, 0.3135213255882263,...
this code in its own stored procedure so that instead the scripts would look like this: ``` DropIfRequired('SomeProcedureName') //then the procedure definition ``` My attempt at a solution is: ``` CREATE PROCEDURE DropIfRequired ( @procedureName varchar ) AS IF EXISTS (SELECT * FROM information_schema.routines ...
[ 0.34818440675735474, 0.03369607776403427, 0.5871013402938843, -0.07063781470060349, 0.33009928464889526, 0.06253596395254135, 0.3321026563644409, -0.07261954247951508, -0.07882821559906006, -0.2429669201374054, -0.021357392892241478, 0.519342839717865, -0.38304564356803894, -0.190517053008...
is: ``` DECLARE @SQL VARCHAR(8000) SELECT @SQL = 'USE ' + DB_NAME() + CHAR(10) SET @SQL = @SQL + 'DROP PROCEDURE ' + @procName --PRINT @SQL EXEC(@SQL) ``` The one given by Andrew will only work if the default database for your login is set to the database you want. When using dynamic sql you get a new database cont...
[ 0.09110379964113235, -0.016114160418510437, 0.3288067579269409, -0.2208213061094284, 0.17778761684894562, -0.0990573987364769, 0.2527328431606293, -0.37549829483032227, -0.15882740914821625, -0.3412294089794159, -0.23790599405765533, 0.5828341245651245, -0.6032603979110718, 0.0448017641901...
Given the following HTML: ``` <select name="my_dropdown" id="my_dropdown"> <option value="1">displayed text 1</option> </select> ``` How do I grab the string "displayed text 1" using Javascript/the DOM? ``` var sel = document.getElementById("my_dropdown"); //get the selected option var selectedText = sel.options[se...
[ -0.31675949692726135, -0.6434233784675598, 0.6989229917526245, -0.1132892370223999, 0.20965421199798584, 0.19199903309345245, -0.04580594599246979, -0.29042530059814453, -0.43603119254112244, -0.5220153331756592, -0.5650594830513, 0.4019051492214203, -0.04461831599473953, -0.36294028162956...
I want to find a sql command or something that can do this where I have a table named tblFoo and I want to name it tblFooBar. However, I want the primary key to also be change, for example, currently it is: ``` CONSTRAINT [PK_tblFoo] PRIMARY KEY CLUSTERED ``` And I want a name change to change it to: ``` CONSTRAIN...
[ -0.2248455286026001, 0.13037939369678497, 0.5382180213928223, -0.22638805210590363, -0.0188591405749321, 0.003828962566331029, 0.04503188282251358, -0.2102607935667038, -0.410475492477417, -0.6914700269699097, 0.011019780300557613, 0.43167245388031006, -0.6513077616691589, 0.38103467226028...
through and do this all manually because a) it is an error prone process, and b)it doesn't scale. This is just off the top of my head and isn't complete (you'd need to add similar code for indexes). Also, you would need to either add code to avoid renaming objects from a table with the same base name, but additional ch...
[ 0.4369875490665436, 0.3360389173030853, 0.5399776101112366, -0.31687572598457336, -0.08476334810256958, -0.09487339854240417, 0.38909032940864563, -0.4528977870941162, -0.3099534511566162, -0.8163096308708191, -0.018352193757891655, 0.636709988117218, -0.35962846875190735, 0.26622062921524...
= 'tblFooBar' SELECT 'EXEC sp_rename ''' + name + ''', ''' + REPLACE(name, @old_name, @new_name) + '''' FROM dbo.sysobjects WHERE name LIKE '%' + @old_name + '%' ```
[ 0.1262979358434677, 0.21532946825027466, 0.2337852120399475, -0.2932816743850708, -0.07713557034730911, -0.11422200500965118, 0.3752347230911255, -0.21990202367305756, 0.09473861753940582, -0.38751456141471863, -0.5082491040229797, 0.10552043467760086, -0.5482252240180969, 0.24441379308700...
I am hoping to find a way to do this in vb.net: Say you have function call getPaint(Color). You want the call to be limited to the parameter values of (red,green,yellow). When they enter that parameter, the user is provided the available options, like how a boolean parameter functions. Any ideas? to limit a enum wit...
[ 0.5145688056945801, 0.023356564342975616, 0.5249192118644714, -0.15066151320934296, 0.10392742604017258, 0.03380531817674637, 0.306720495223999, -0.5454152822494507, 0.0912952721118927, -0.6355963349342346, -0.36441853642463684, 0.8238433003425598, -0.600898027420044, 0.13771291077136993, ...
I've been tasked to develop a web application to cover one of our business functions. It needs to have external access from outside our network. At the same time, it needs to be done fairly quickly. I don't have any experience in extranet applications so I'm not exactly sure what all is involved. Learning about it is t...
[ 0.7858322858810425, 0.19046248495578766, -0.13215605914592743, 0.18726114928722382, 0.42999178171157837, -0.07364128530025482, 0.42659372091293335, 0.30021926760673523, -0.14663344621658325, -0.6888017058372498, 0.36118340492248535, 0.5234039425849915, 0.17559680342674255, -0.0959222093224...
can take many things for granted when you are developing for local network: 1. Highspeed network 2. Trusted user base 3. Same timezone for all users (this makes maintenance jobs easier to schedule among other things) 4. Control over which browsers and versions users should use 5. Authentication against LAN authenticat...
[ 0.23268432915210724, -0.37106257677078247, 0.6025598645210266, 0.36332932114601135, -0.15988664329051971, -0.3898575007915497, 0.1466367393732071, -0.05840567871928215, -0.333938330411911, -1.0303910970687866, 0.06659911572933197, 0.43066272139549255, -0.006198373157531023, -0.037315949797...
you need to support. Oddest or most restricted browsers your users might use. If you decide to use SSL, do check the performance of your website on the slowest connection from the beginning. I have seen many SSL sites perform terribly on slow connections.
[ 0.36046522855758667, -0.02467350661754608, 0.04360361397266388, 0.28355535864830017, -0.1187627911567688, -0.3923637270927429, 0.44492107629776, 0.7123249769210815, -0.20561085641384125, -0.9738529920578003, -0.13803516328334808, 0.45089468359947205, -0.2442004233598709, 0.0374598912894725...
Quite a few comments to answers in a different post, *[Where are the best locations to write an error log in Windows?](https://stackoverflow.com/questions/191609/where-are-the-best-locations-to-write-an-error-log-in-windows)*, gave me the impression that a lot of things regarding standard folders (`%APPDATA%`; `%TEMP%`...
[ 0.12822097539901733, 0.2604903280735016, 0.4992915689945221, 0.14500632882118225, 0.08464505523443222, -0.10420688986778259, 0.44041937589645386, 0.13636748492717743, -0.5142365097999573, -0.37272435426712036, 0.018745994195342064, 0.361916720867157, 0.0771622359752655, -0.1603972464799881...
met with disregard (well, if you're lucky...) So what is your advice? Should I rewrite two modules in my current project to make them ready for Windows Vista, or should I not bother about it at all, until it is really needed? Personally, I'd have a quick look at the effort level of what it would take to enable "Vista...
[ 0.5010591745376587, 0.14984537661075592, 0.26183292269706726, 0.1679903268814087, 0.30889448523521423, -0.16248367726802826, 0.2478083223104477, -0.12027820944786072, -0.3194497525691986, -0.539034366607666, 0.006984374951571226, 0.9095277190208435, 0.032778549939394, -0.23618049919605255,...
here with shortcuts and such as they were generated in an older installation suite. It's the little things that we are currently addressing in getting our Vista Support fully up and running. I'm sure there will be some "unforeseen" obstacles you will come across as well. Best of luck!
[ 0.27608776092529297, 0.10674776136875153, 0.29015788435935974, 0.3454265296459198, 0.41012904047966003, -0.18061818182468414, 0.4294731914997101, 0.3750497102737427, -0.26334652304649353, -0.7461144924163818, 0.2164371907711029, 0.649589478969574, 0.31026598811149597, -0.18015716969966888,...
I'm currently looking at ways to allow people to select multiple files at once to batch upload images. I'm evaluating these options for my ASP.NET web app: * [YUI Uploader](http://developer.yahoo.com/yui/uploader/) * [Flajaxian](http://www.codeplex.com/FlajaxianFileUpload) * [SWFUpload](http://swfupload.org/) * [Dojo ...
[ 0.4710811376571655, -0.13852764666080475, 0.25018712878227234, -0.12767423689365387, -0.49661681056022644, -0.13012084364891052, -0.012708178721368313, -0.23356495797634125, -0.19895365834236145, -0.4906054735183716, 0.08929786831140518, 0.6176220774650574, -0.11049860715866089, -0.2429462...
these? Thanks for everyone's opinion but I ended up using [YUI Uploader](http://developer.yahoo.com/yui/uploader/) because that's what `flickr` uses and the project spec was basically an analysis of `flickr`'s features. The experience of using it was essentially excellent, and being able to compare it to what `flickr`...
[ 0.5263365507125854, -0.11681762337684631, 0.08060257881879807, 0.19957122206687927, -0.42473992705345154, -0.23686665296554565, -0.2724917531013489, 0.12747852504253387, 0.07246292382478714, -0.4129296839237213, 0.05734621733427048, 0.6272672414779663, -0.0835692435503006, 0.00589694827795...
I am getting ready to completely overhaul my web server. I use it for both development and to present product to clients. It also hosts my company website. I will be loading MS Server 2008 and MS SQL 2008. I want it to have the latest .NET Framework as well as the latest MVC templates. I want it to use SubSonic. I also...
[ 0.27745965123176575, 0.3855953514575958, 0.5814650654792786, -0.12100894749164581, -0.34040549397468567, -0.3845243453979492, 0.4576713740825653, 0.019939636811614037, -0.3189305365085602, -0.6589450836181641, 0.1918732076883316, 0.5344081521034241, 0.08160895109176636, 0.14040613174438477...
this and will have good suggestions. It is a good stout machine with lots of memory and storage, so, please let me know anything that will help me become a better developer. Scott and the Dev Team Well, sounds like you've already got a good list going. Though I'd recommend against SourceSafe. [See here for details](h...
[ 0.6100038290023804, -0.09917432814836502, 0.12416932731866837, 0.4156206250190735, -0.16878129541873932, -0.3221149444580078, 0.36666610836982727, 0.22409623861312866, -0.37670227885246277, -0.5407319068908691, 0.1126934215426445, 0.6601908206939697, -0.08525045961141586, 0.129382759332656...
a better developer. To pimp one of this site's founders, check out the [Joel Test](http://www.joelonsoftware.com/articles/fog0000000043.html) and see what you should implement.
[ 0.3422207236289978, -0.23550361394882202, 0.020793072879314423, 0.49730849266052246, -0.06648754328489304, -0.4125272333621979, 0.5039728283882141, 0.09253334999084473, 0.21827654540538788, -0.5276082158088684, 0.45284125208854675, 0.32943397760391235, 0.09143253415822983, 0.13356044888496...
I want to be able to do the following: ``` $normal_array = array(); $array_of_arrayrefs = array( &$normal_array ); // Here I want to access the $normal_array reference **as a reference**, // but that doesn't work obviously. How to do it? end( $array_of_arrayrefs )["one"] = 1; // choking on this one print $norm...
[ 0.10217062383890152, 0.0033073904924094677, 0.8273851275444031, -0.046062830835580826, 0.07340576499700546, 0.04103672504425049, 0.37424859404563904, -0.5573893189430237, 0.036433909088373184, -0.32808253169059753, -0.09203797578811646, 0.7773328423500061, -0.5272835493087769, 0.1406594514...
$lastKey = end(array_keys($array)); end($array); return $array[$lastKey]; } ```
[ -0.1257292479276657, -0.12491827458143234, 0.2871550917625427, -0.5630233883857727, 0.32784780859947205, -0.06537669897079468, 0.2108258455991745, -0.1679910272359848, -0.2686621844768524, -0.23654453456401825, -0.44351959228515625, 0.5819379687309265, -0.34370413422584534, 0.2717071175575...
I have around 3500 flood control facilities that I would like to represent as a network to determine flow paths (essentially a directed graph). I'm currently using SqlServer and a CTE to recursively examine all the nodes and their upstream components and this works as long as the upstream path doesn't fork alot. Howeve...
[ 0.3315073549747467, 0.27819713950157166, 0.3833770751953125, 0.24913865327835083, 0.18331767618656158, 0.18906547129154205, 0.31494760513305664, -0.010369320400059223, -0.05793577805161476, -0.7261963486671448, 0.3339725434780121, 0.4393569529056549, -0.033392246812582016, 0.44452279806137...
a simple two-column table, one column being the facility itself and the other being the facility that is upstream from the one listed in the first column. I tried adding an index using the current facility to help speed things up but that made no difference. And, as for the possible connections in the graph, any nodes...
[ 0.06733646988868713, 0.045086003839969635, 0.3994341194629669, 0.19096271693706512, 0.15416839718818665, 0.3137005865573883, -0.17608948051929474, -0.0787833034992218, -0.3595462739467621, -0.6673498749732971, 0.22576959431171417, 0.23771889507770538, -0.1862596571445465, 0.521235048770904...
a maximum recursive count hit; those were easy to fix). So, my question is, am I storing this information wrong? Is there a better way other than a CTE to query the upstream points? I know nothing about flood control facilities. But I would take the first facility. And use a temp table and a while loop to generate the...
[ 0.1679558902978897, -0.280987024307251, 0.31279081106185913, -0.05743386596441269, 0.3092567026615143, 0.1102411299943924, 0.25827765464782715, -0.20584627985954285, -0.2798427641391754, -0.4531751275062561, 0.12261764705181122, 0.7890821695327759, -0.506102442741394, 0.14987656474113464, ...
<= 3500 BEGIN SEt @intN = @intN + 1 INSERT INTO TempTable(LastNode, CurrentNode, N) SELECT LastNode, CurrentNode, @intN FROM your table WHERE LastNode IN (SELECT CurrentNode FROM TempTable WHERE N = @intN-1) ``` IF @@ROWCOUNT = 0 BREAK ``` END If we assume that every node points to one child. Then this sh...
[ -0.1576261669397354, -0.333248108625412, 0.39121827483177185, -0.12050153315067291, 0.4427446722984314, 0.3973107933998108, 0.08030526340007782, -0.1244831308722496, -0.10532081127166748, -0.7016504406929016, 0.2532099187374115, 0.2625742256641388, -0.11272705346345901, 0.20207558572292328...
provider. Incidentally 3500 rows is not that much so even in the worst case of each provider pointing to a different upstream provider, this should not take that long.
[ 0.28688400983810425, -0.14220303297042847, 0.6318522095680237, 0.2341948002576828, 0.1772359311580658, 0.2766135334968567, 0.06915978342294693, -0.16700679063796997, -0.3417661786079407, -0.7815406322479248, 0.16826927661895752, 0.275134801864624, -0.1077963337302208, 0.359018474817276, ...
I have a legacy WinForms Mdi App in VB.Net 2.0 which I am adding functionality to. One of the additions is a warning which needs to be raised when the current time nears a specified value (a deadline). My intention is to check the time once an hour until there is less than an hour until the deadline, then display warni...
[ 0.5637966990470886, -0.006346604786813259, 0.7394632697105408, -0.07708294689655304, 0.3200671374797821, -0.23698264360427856, 0.5040566325187683, -0.030872246250510216, 0.022219736129045486, -0.8006865978240967, 0.018382268026471138, 0.37755855917930603, -0.16337287425994873, 0.1432769149...
does not use System.Threading yet and my knowledge of it is limited at this time. I do know that there are 3 different Timer() methods available: * System.Threading.Timer(), * Windows.Forms.Timer() and * System.Timers.Timer() My question is, which is the best way to go with this? I attempted to use the threaded time...
[ 0.2761012315750122, -0.23203393816947937, 0.2785421311855316, 0.1703168898820877, 0.06570606678724289, -0.14998210966587067, 0.3637849986553192, 0.1287439912557602, -0.22172443568706512, -0.8680604100227356, 0.49289175868034363, 0.5083132386207581, -0.024520592764019966, 0.1997033655643463...
don't need it to be.
[ 0.6648841500282288, 0.24899961054325104, -0.19471368193626404, 0.19283096492290497, 0.1440505087375641, -0.061259783804416656, 0.15212874114513397, 0.17503036558628082, 0.2108069360256195, -0.4830887019634247, 0.0429617241024971, 0.2720542252063751, -0.25134873390197754, 0.1897839307785034...
If I were to use more than one, what order should I use modifier keywords such as: `public`, `private`, `protected`, `virtual`, `abstract`, `override`, `new`, `static`, `internal`, `sealed`, and any others I'm forgetting. I had a look at Microsoft's [Framework Design Guidelines](https://msdn.microsoft.com/en-us/librar...
[ 0.19932633638381958, -0.023969776928424835, 0.5454391241073608, 0.17523302137851715, -0.10526207089424133, 0.02803642302751541, 0.21381594240665436, -0.24532850086688995, -0.29832249879837036, -0.7265200018882751, -0.28469377756118774, 0.5805418491363525, -0.22162269055843353, 0.1310581564...
with the use of an [EditorConfig](https://learn.microsoft.com/en-us/visualstudio/ide/create-portable-custom-editor-options?view=vs-2017) file. > > > Example EditorConfig file > ========================= > > > To help you get started, here is an example .editorconfig file with the default options: > > > > ``` > #...
[ -0.5263484716415405, -0.05287737026810646, 0.7302876710891724, 0.10353143513202667, -0.017700854688882828, -0.07233878970146179, 0.3263401389122009, -0.48519453406333923, -0.1618845909833908, -0.7597618103027344, -0.4287688434123993, 0.4889662563800812, -0.3953147530555725, 0.1270541995763...
modifiers readonly unsafe volatile async ``` --- ReSharper --------- [ReSharper](https://www.jetbrains.com/resharper/), however, is more forthcoming. The defaults for ReSharper 2018.11, with access modifiers (which are exclusive) and inheritance modifiers (which are exclusive), grouped together is: ```cs { public ...
[ -0.6128833293914795, 0.08329825848340988, 0.6627981662750244, 0.1683562994003296, 0.18732023239135742, -0.13052234053611755, 0.5346043705940247, -0.6132514476776123, -0.25797346234321594, -0.2465304285287857, -0.7610805034637451, 0.7668451070785522, -0.5007978081703186, 0.3991425633430481,...
the `private protected` access modifier. 2 ReSharper only saves settings which differ from the default, so in general this node, as it is, will not be seen in the `dotsettings` file. --- `new static` vs `static new` ---------------------------- The MSDN page for [Compiler Warning CS0108](https://msdn.microsoft.com/...
[ -0.3382907211780548, -0.11999908834695816, 0.40063178539276123, 0.08208590000867844, 0.19203785061836243, -0.13437187671661377, 0.22723756730556488, -0.05548122152686119, -0.42523881793022156, -0.42106401920318604, -0.3307114839553833, 0.45254698395729065, -0.39261358976364136, 0.413127601...
static int i = 2; // CS0108, use the new keyword > // Use the following line instead: > // public static new int i = 2; > } > > ``` Likewise, the IntelliSense in Visual Studio 2015 also suggests changing `static` to `static new` [![CS0108 Visual Studio recommended change](https://i.stack.imgur.com/7vWEY.png)...
[ -0.3122992217540741, -0.3128218650817871, 0.3487635552883148, -0.3026611804962158, -0.350845605134964, -0.03697379305958748, 0.2748832404613495, -0.11375147849321365, -0.4578185975551605, -0.24669046700000763, -0.616946816444397, 0.4668236970901489, -0.5557423830032349, 0.19392448663711548...
public protected internal private static new abstract virtual override sealed readonly extern unsafe volatile async </s:String> ``` however since `static` cannot be used in conjunction with the inheritance modifiers or `sealed`, this is just a distinction between `new static` (the default, and suggested by the defaul...
[ -0.2604122757911682, 0.023987600579857826, 0.4922575056552887, 0.014159640297293663, -0.03535253554582596, -0.033038802444934845, 0.40489792823791504, -0.09369764477014542, -0.5590402483940125, -0.0838143602013588, -0.5519706606864929, 0.5973497033119202, -0.4203864634037018, 0.60573172569...
427 static new 10 990 ``` which implies that the preference at Microsoft is `static new`.
[ -0.08579105883836746, 0.16443848609924316, 0.23230448365211487, -0.1555396467447281, -0.025042062625288963, 0.1105303093791008, 0.24527984857559204, 0.2176773101091385, -0.014256525784730911, -0.21721626818180084, -0.4871166944503784, 0.4493860602378845, -0.22391796112060547, 0.25605174899...
Is there a CIL instruction to exchange the first two elements in the stack? There is no single instruction exchange. However, using [stloc](http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.stloc.aspx), [pop](http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes.pop.aspx), and [ldl...
[ 0.24253608286380768, -0.1085662767291069, 0.3546655476093292, 0.3053424060344696, 0.18562506139278412, -0.08240315318107605, -0.39664509892463684, -0.1903519183397293, -0.40351590514183044, -0.6248831748962402, -0.15762802958488464, 0.14652732014656067, -0.3790610730648041, -0.237227857112...
If I have the following Linq code: ``` context.Table1s.InsertOnSubmit(t); context.Table1s.InsertOnSubmit(t2); context.Table1s.InsertOnSubmit(t3); context.SubmitChanges(); ``` And I get a database error due to the 2nd insert, Linq throws an exception that there was an error. But, is there a way to find out that it w...
[ -0.10015926510095596, 0.30890294909477234, 0.3000432550907135, -0.06446895003318787, 0.04653206095099449, -0.22844438254833221, 0.2937830984592438, -0.31203120946884155, -0.1758730262517929, -0.44620904326438904, -0.1548687368631363, 0.7107203006744385, -0.26439571380615234, -0.18325230479...
I know this validation would be better done in the C# code and not in the database, but that is currently not an option. This is a bug in ReSharper 4.1 and is fixed in one of the later nightly builds. Download the last nightly build at <http://www.jetbrains.net/confluence/display/ReSharper/ReSharper+4.0+Nightly+Builds...
[ 0.4094196557998657, -0.04342064633965492, 0.5676766633987427, 0.03269338607788086, 0.36778658628463745, -0.24520762264728546, 0.2475000023841858, 0.021708913147449493, 0.010775882750749588, -0.4788146913051605, 0.007984714582562447, 0.9571214318275452, -0.19915957748889923, -0.242510586977...
On a Use Case diagram can you show things that an actor **cannot** do, for example because they won't have permissions to do it? Or is it just implied due to the fact that they won't have a line joining them to the particular use case? If the Use Case you are diagramming is the case where an actor attempts to do somet...
[ 0.24278394877910614, 0.06795984506607056, -0.07685523480176926, 0.10198269784450531, -0.025187326595187187, 0.0729902908205986, -0.0677902027964592, 0.01850999891757965, -0.033157672733068466, -0.8058307766914368, -0.016223691403865814, 0.3015473186969757, -0.6108152866363525, 0.1406389176...
In Eclipse (Ganymede) I'm debugging some code that uses Apache Commons HttpClient and would like to step into the HttpClient code. I've downloaded the source code and tried to attach it in the normal fashion (CTRL-click on the method name and use the Attach Source button). I've tried to attach both as external file and...
[ 0.3155857026576996, 0.01113958191126585, 0.294019877910614, 0.025222349911928177, -0.3807139992713928, -0.10844727605581284, 0.00301754311658442, 0.1360105574131012, 0.06130371615290642, -0.7526142597198486, 0.18910843133926392, 0.7440000176429749, -0.13457901775836945, 0.10294628888368607...
Eclipse do not solve the issue. Frustratingly, Eclipse provides no error message; it just does not attach the source. Here are the entries in .claspath: ``` <!-- Hibernate. Works --> <classpathentry kind="lib" path="/myEAP/EarContent/APP-INF/lib/hibernate.jar" sourcepath="D:/Data/Download/hibernate-3.2.2.ga/hibernate...
[ 0.0639197826385498, 0.3487118184566498, 0.341694176197052, -0.14449737966060638, -0.4844965934753418, 0.07094994187355042, 0.1542421579360962, -0.23810383677482605, 0.041518013924360275, -0.548450231552124, 0.10204819589853287, 0.5775390267372131, -0.2953042984008789, -0.08308740705251694,...
apache commons httpclient AutoCloseInputStream.java ... (and so forth) ``` Try pointing it at a directory containing the top level package directly, "D:/Data/Download/commons-httpclient-3.1/src/java" for
[ 0.13962343335151672, 0.13913822174072266, 0.3932240605354309, 0.07554443925619125, -0.6557646989822388, -0.45134541392326355, 0.32732000946998596, -0.3008270561695099, -0.18229199945926666, -0.2415853887796402, -0.10956496745347977, 0.07589899748563766, -0.4137406051158905, 0.1356547623872...
you. What worked for me was creating a new src zip file containing the "org" folder and everything beneath it. Here's my .classpath entry, (which works for me) in case it helps: ``` <classpathentry kind="lib" path="/blib/java/commons-httpclient-3.1/commons-httpclient-3.1.jar" sourcepath="/blib/java/commons-httpclient...
[ 0.29598864912986755, 0.03775900974869728, 0.444645494222641, -0.013079416006803513, 0.1948816180229187, -0.22115130722522736, 0.04309861734509468, -0.07424553483724594, -0.27364400029182434, -0.8749024271965027, -0.02199150063097477, 0.5874045491218567, -0.2160676270723343, -0.076172828674...
I am trying to use concat\_ws inside a group\_concat command. With a query, which simplified looks like: ``` SELECT item.title, GROUP_CONCAT( CONCAT_WS( ',', attachments.id, attachments.type, attachments.name ) ) as attachments FROM story AS item LEFT OUTER JOIN story_attachment AS attachments ON item.id = atta...
[ 0.021205071359872818, 0.12617959082126617, 0.327347069978714, -0.07370813190937042, 0.017454033717513084, 0.4198748767375946, -0.0012015209067612886, -0.28811004757881165, -0.20927190780639648, -0.527025580406189, -0.2675781846046448, 0.2781495451927185, -0.2709437310695648, 0.339632809162...
item.id = attachments.item_id GROUP BY item.id ```
[ -0.10316108912229538, 0.3045957386493683, 0.3524198830127716, -0.0029379522893577814, -0.09562462568283081, 0.06098701059818268, -0.2176995873451233, -0.27689996361732483, -0.4200915992259979, -0.5002037286758423, -0.1329910308122635, 0.08788766711950302, -0.4388413429260254, 0.67170053720...
I want to create a component that allows us to have compound keyboard shortcuts associated with an arbitrary command, like the Visual Studio IDE and Microsoft Office do. That is, keyboard shortcuts consisting of a sequence of multiple keystrokes, such as `Ctrl` + `W` + `C`. In Visual Studio this opens the class-view. ...
[ 0.13979631662368774, -0.18354330956935883, 0.19398698210716248, -0.12334754317998886, -0.03825996071100235, -0.05211072042584419, 0.2041798084974289, -0.02160397171974182, 0.0574553981423378, -0.5979532599449158, -0.132588192820549, 0.9499284029006958, -0.10147900879383087, -0.229273602366...
option available to you at this point. However, it should be simple enough to model. I would create a single class, perhaps `KeyboardChordProvider`. It will need to know about keyboard events at the form level. As stated elsewhere, the `Form.KeyPreview` property must be `true`. It may be enough for this provider to su...
[ 0.07309373468160629, -0.18837498128414154, 0.5029799342155457, 0.006640076637268066, 0.19615836441516876, -0.23943756520748138, 0.27941179275512695, -0.0001887248654384166, -0.030217109248042107, -0.6694818139076233, -0.0984630361199379, 0.8185756802558899, 0.06757444888353348, -0.10790378...
the chord, you would update the provider's state and raise an event so that a subscriber could set text: *(CTRL+W) was pressed. Waiting for second key of chord...* If the next keystroke matches a potential secondary option, then you have a match and could raise a `ChordPressed` event containing the details of the stro...
[ -0.12161258608102798, -0.33235272765159607, 0.6684638857841492, -0.08676785975694656, -0.1481933891773224, 0.2133672684431076, 0.2186669558286667, -0.14008881151676178, -0.15529142320156097, -0.7035796046257019, -0.07662709057331085, 0.7179676294326782, -0.10127810388803482, 0.068448431789...
*next* option, then you would reset the state of the provider. Internal to the provider you might model the possible keystrokes using a tree structure. The current state of the provider is just a particular tree node. At the beginning, the root node would be active. If a child matches a keystroke then it becomes the c...
[ -0.2565104067325592, -0.5118454694747925, 0.4803115427494049, -0.06972035020589828, -0.09509606659412384, 0.47716525197029114, 0.31106144189834595, -0.11088104546070099, -0.19122713804244995, -0.8998224139213562, 0.020947961136698723, 0.4197760224342346, -0.02466147020459175, 0.15062455832...
leaf. Whenever no keystroke matches a child, reset back to making the root node active. I think this design would achieve what you want.
[ -0.09353549778461456, -0.34613531827926636, 0.05362061783671379, 0.1798315793275833, 0.22166261076927185, 0.028415482491254807, 0.04645964503288269, 0.057966798543930054, -0.15753579139709473, -0.4865013062953949, 0.06454245001077652, 0.1260954737663269, -0.192061647772789, -0.014642016030...
Shouldn't this be a pretty straightforward operation? However, I see there's neither a `size()` nor `length()` method. Do a `SELECT COUNT(*) FROM ...` query instead. OR ``` int size =0; if (rs != null) { rs.last(); // moves cursor to the last row size = rs.getRow(); // get row id } ``` In either of the cas...
[ -0.06904592365026474, -0.19562546908855438, 0.6154106259346008, -0.27375364303588867, 0.051444463431835175, -0.16124719381332397, 0.10277078300714493, -0.3793991804122925, -0.5068727731704712, -0.3857842981815338, -0.07935217767953873, 0.4592428505420685, -0.4807035028934479, 0.31306827068...
From day 1 of my programming career, I started with object-oriented programming. However, I'm interested in learning other paradigms (something which I've said here on SO a number of times is a good thing, but I haven't had the time to do). I think I'm not only ready, but have the time, so I'll be starting functional p...
[ 0.17896029353141785, 0.212704598903656, -0.00806825328618288, -0.17870187759399414, -0.27532973885536194, 0.15325944125652313, 0.09570306539535522, 0.4007589817047119, -0.4014754295349121, -0.7950950860977173, -0.16895222663879395, 0.47385531663894653, -0.06006345897912979, 0.1056707426905...
This may seem a bit trivial, but I have not been able to figure it out. I am opening up a SPSite and then trying to open up a SPWeb under that SPSite. This is working fine on the VPC, which has the same Site Collection/Site hierarchy, but on production, I get an exception telling me that the URL is invalid when I try t...
[ 0.5735079050064087, 0.19827288389205933, 0.47356903553009033, -0.015605396591126919, 0.19519132375717163, -0.5551659464836121, 0.4719683825969696, 0.1794012188911438, -0.5962457060813904, -0.7644681930541992, -0.1463399976491928, 0.24693289399147034, -0.3690803647041321, 0.3003993928432464...
SPSite(branchScheduleURL); lblError.Text += Environment.NewLine + "Site Collection URL: " + scheduleSiteCol.Url; SPWeb scheduleWeb = scheduleSiteCol.OpenWeb(branchScheduleURL.Replace(scheduleSiteCol.Url, "")); //<--- Throws error on this line SPList scheduleList = scheduleWeb.GetList...
[ 0.028932122513651848, -0.32683613896369934, 0.47067683935165405, -0.13237275183200836, 0.23950809240341187, -0.0913095772266388, 0.5974018573760986, -0.322872519493103, -0.49326786398887634, -0.4338591694831848, -0.39160072803497314, 0.19214756786823273, -0.4593577980995178, 0.022588450461...
{ lblError.Text += Environment.NewLine + ex.ToString(); return null; } ``` Note: branchScheduleURL is actually the whole URL that includes the URL of the Web as well. The output + exception: > Site Collection URL: <https://ourSite.com/mocc> > > System.ArgumentException: Invalid...
[ 0.0034879320301115513, 0.06521094590425491, 0.7094974517822266, -0.09544768929481506, 0.22590456902980804, -0.18985918164253235, 0.4029698371887207, -0.22077304124832153, -0.39314544200897217, -0.4604605436325073, -0.45946478843688965, 0.279681921005249, -0.36469656229019165, 0.33426970243...
cfcFlags2) Note: <https://ourSite.com/mocc/internal/scheduletool> is the SPWeb I am trying to open. Am I missing something obvious? Any help would be greatly appreciated. Thanks. Looks at the examples table at the bottom of [this page](http://msdn.microsoft.com/en-us/library/ms955307.aspx). Try not sending any pa...
[ 0.2895177900791168, 0.10298384726047516, 0.39323359727859497, -0.07459893822669983, 0.03136831894516945, -0.44723281264305115, 0.2569136321544647, 0.2772875726222992, -0.7105182409286499, -0.6197047829627991, -0.018894951790571213, 0.21007588505744934, -0.4734839200973511, -0.0151148643344...
I need specifically to load a JPG image that was saved as a blob. GDI+ makes it very easy to retrieve images from files but not from databases... Take a look at [Image::Image(IStream \*, BOOL)](http://msdn.microsoft.com/en-us/library/ms535410(VS.85).aspx). This takes a pointer to a COM object implementing the IStream i...
[ -0.159656822681427, 0.028762759640812874, 0.6989480257034302, 0.04947671666741371, 0.17373031377792358, 0.08680250495672226, 0.02015191875398159, -0.0359925702214241, -0.39669904112815857, -0.8765864372253418, -0.12193351238965988, 0.41407763957977295, -0.25884291529655457, 0.2126477509737...
blobSize; ++iBlob) pImage[iBlob] = blob[iBlob]; ::GlobalUnlock(hMem); CComPtr<IStream> spStream; HRESULT hr = ::CreateStreamOnHGlobal(hMem,TRUE,&spStream); shared_ptr<Image> image = new Image(spStream); return image; } ``` But with error checking and such (omitted here to make things ...
[ -0.21087759733200073, -0.11359070241451263, 0.9920653104782104, -0.2607419788837433, 0.09572167694568634, 0.2166403979063034, 0.22869588434696198, 0.007389676757156849, -0.49023935198783875, -0.7551018595695496, -0.3540289103984833, 0.13174577057361603, -0.4661935567855835, 0.2709979712963...
Assume you have a flat table that stores an ordered tree hierarchy: ``` Id Name ParentId Order 1 'Node 1' 0 10 2 'Node 1.1' 1 10 3 'Node 2' 0 20 4 'Node 1.1.1'
[ -0.22882390022277832, 0.01000354252755642, 0.2533198893070221, -0.13239753246307373, 0.308709055185318, 0.12668155133724213, -0.17942416667938232, -0.12866009771823883, 0.03098565898835659, -0.6891651153564453, -0.10834347456693649, 0.39691534638404846, -0.13088193535804749, 0.281476438045...
2 10 5 'Node 2.1' 3 10 6 'Node 1.2' 1 20 ``` Here's a diagram, where we have `[id] Name`. Root node 0 is fictional. ``` [0] ROOT
[ -0.16393212974071503, 0.18599390983581543, 0.3137400150299072, 0.12134531140327454, 0.2542196214199066, 0.1019149124622345, 0.1420861780643463, 0.33808502554893494, -0.08883826434612274, -0.537734866142273, 0.017213312909007072, 0.0343419574201107, -0.07760186493396759, 0.3436741232872009,...
/ \ [1] Node 1 [3] Node 2 / \ \ [2] Node 1.1
[ -0.5106960535049438, 0.05958276987075806, 0.3120759427547455, -0.26737910509109497, 0.10379128903150558, 0.25718507170677185, 0.33321794867515564, -0.012809127569198608, 0.1373710185289383, -0.6243506073951721, -0.20233988761901855, 0.1246623620390892, -0.3547828197479248, -0.0034212267491...
[6] Node 1.2 [5] Node 2.1 / [4] Node 1.1.1 ``` What minimalistic approach would you use to output that to HTML (or text, for that matter) as a correctly ordered, correctly indented tree? Assume further you only have basic data structures (arrays and hashmaps), no fancy objects with parent/...
[ 0.016127444803714752, 0.0006705792038701475, 0.12661504745483398, 0.12460591644048691, -0.12401048094034195, 0.0716298446059227, 0.2766566276550293, 0.1685761958360672, -0.18549484014511108, -0.5683140158653259, -0.4292052984237671, 0.11907878518104553, -0.4136272072792053, -0.087405629456...
okay, this is purely a conceptional question. Bonus question: Is there a fundamentally better way to store a tree structure like this in a RDBMS? --- **EDITS AND ADDITIONS** To answer one commenter's ([Mark Bessey](https://stackoverflow.com/users/17826/mark-bessey)'s) question: A root node is not necessary, because...
[ -0.11229841411113739, -0.09736967086791992, -0.011266532354056835, 0.11769074946641922, 0.1658986657857895, -0.32302504777908325, 0.20458586513996124, -0.03537975251674652, -0.4195724129676819, -0.46876633167266846, -0.22979000210762024, 0.11656558513641357, -0.2578698992729187, 0.20255792...
there. Some answers go the extra mile and construct it first, but thats okay. The tree can be arbitrarily deep. Each node can have N children. I did not exactly have a "millions of entries" tree in mind, though. Don't mistake my choice of node naming ('Node 1.1.1') for something to rely on. The nodes could equally we...
[ 0.07103966176509857, 0.24955376982688904, 0.14810726046562195, 0.1744135469198227, 0.09232399612665176, 0.16872988641262054, 0.4548484981060028, 0.11250857263803482, -0.5498805046081543, -0.5140047073364258, 0.18898271024227142, 0.1962108463048935, -0.17469018697738647, 0.1536462903022766,...
support recursive queries](https://stackoverflow.com/questions/324935/mysql-with-clause/325243#325243) in standard syntax. ``` WITH RECURSIVE MyTree AS ( SELECT * FROM MyTable WHERE ParentId IS NULL UNION ALL SELECT m.* FROM MyTABLE AS m JOIN MyTree AS t ON m.ParentId = t.Id ) SELECT * FROM MyTree; ``` I...
[ -0.1722123622894287, 0.08318328857421875, 0.47770941257476807, 0.06578391045331955, -0.0956328883767128, 0.21888428926467896, 0.4822414219379425, -0.552892804145813, -0.2976875901222229, -0.03837655484676361, -0.3592170178890228, 0.45725804567337036, -0.26803335547447205, -0.16997244954109...
solution is called **Nested Sets**, and it can be stored in the same table too. Read "[Trees and Hierarchies in SQL for Smarties](https://rads.stackoverflow.com/amzn/click/com/1558609202)" by Joe Celko for a lot more information on these designs. I usually prefer a design called **Closure Table** (aka "Adjacency Relat...
[ -0.3024260103702545, 0.08616973459720612, 0.03253237530589104, 0.2021443247795105, -0.16592131555080414, 0.24813394248485565, 0.20136618614196777, -0.3868745267391205, -0.4627959430217743, -0.5666917562484741, -0.24254892766475677, 0.013712550513446331, -0.5244189500808716, 0.1105071827769...
descendant_id INT NOT NULL REFERENCES FlatTable(id), PRIMARY KEY (ancestor_id, descendant_id) ); ``` Store all paths in the Closure Table, where there is a direct ancestry from one node to another. Include a row for each node to reference itself. For example, using the data set you showed in your question: ``` INS...
[ -0.31165120005607605, 0.02218354120850563, 0.5458174347877502, -0.17324326932430267, 0.3097250461578369, 0.23347215354442596, 0.06402640044689178, -0.2896119952201843, 0.06779556721448898, -0.7799094319343567, -0.06667466461658478, 0.06640598922967911, -0.2838180959224701, 0.37882438302040...
client) looks like the following: ``` +----+ | id | +----+ | 1 | | 2 | | 4 | | 6 | +----+ ``` In other words, nodes 3 and 5 are excluded, because they're part of a separate hierarchy, not descending from node 1. --- Re: comment from e-satis about immediate children (or immediate parent). You can add a "`pa...
[ -0.4338443875312805, -0.04168347641825676, 0.689411461353302, -0.03483559563755989, 0.2319309115409851, 0.49148327112197876, 0.02312350459396839, 0.03809402510523796, -0.27858346700668335, -0.714624285697937, -0.2119017243385315, 0.29490190744400024, -0.1779581904411316, 0.3741548955440521...
(6,6,0); ``` Then you can add a term in your search for querying the immediate children of a given node. These are descendants whose `path_length` is 1. ``` SELECT f.* FROM FlatTable f JOIN ClosureTable a ON (f.id = a.descendant_id) WHERE a.ancestor_id = 1 AND path_length = 1; +----+ | id | +----+ | 2 | | ...
[ -0.5779743790626526, -0.22396737337112427, 0.42525309324264526, -0.07933121174573898, 0.013821659609675407, 0.30231916904449463, -0.06556743383407593, -0.32770100235939026, -0.3467771112918854, -0.6235966682434082, -0.4568314850330353, -0.013276685029268265, -0.2338961511850357, 0.43312799...
f JOIN ClosureTable a ON (f.id = a.descendant_id) WHERE a.ancestor_id = 1 ORDER BY f.name; ``` --- Re comment from @Nate: ``` SELECT f.name, GROUP_CONCAT(b.ancestor_id order by b.path_length desc) AS breadcrumbs FROM FlatTable f JOIN ClosureTable a ON (f.id = a.descendant_id) JOIN ClosureTable b ON (b.descendant...
[ -0.5845026969909668, 0.191227987408638, 0.4928850531578064, -0.35386812686920166, -0.15636126697063446, 0.4494144320487976, 0.20999480783939362, -0.20463109016418457, -0.2174931913614273, -0.6237099170684814, -0.5351550579071045, 0.05130895972251892, -0.3015400469303131, 0.5282207727432251...
| | Node 1.2 | 1,6 | +------------+-------------+ ``` --- A user suggested an edit today. SO moderators approved the edit, but I am reversing it. The edit suggested that the ORDER BY in the last query above should be `ORDER BY b.path_length, f.name`, presumably to make sure the ordering matches the hierar...
[ -0.036810822784900665, 0.16529494524002075, 0.3338935375213623, -0.10414742678403854, 0.028858758509159088, -0.0386490598320961, 0.29247063398361206, -0.1501660794019699, -0.34509003162384033, -0.5708845257759094, -0.22814379632472992, 0.2504265606403351, -0.6153444051742554, 0.41932758688...
see my answer to [MySQL Closure Table hierarchical database - How to pull information out in the correct order](https://stackoverflow.com/questions/8252323/mysql-closure-table-hierarchical-database-how-to-pull-information-out-in-the-c).
[ -0.2670755982398987, 0.09674745053052902, 0.41208913922309875, 0.22378435730934143, -0.021440422162413597, -0.11913657933473587, -0.13136987388134003, -0.19316330552101135, -0.1473858505487442, -0.07122865319252014, -0.2615497410297394, 0.24429215490818024, -0.07420867681503296, 0.07647702...
Say, I have a script that gets called with this line: ``` ./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile ``` or this one: ``` ./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile ``` What's the accepted way of parsing this such that in each case (or some combination of the two) `$v`, `$f`, an...
[ 0.105440154671669, 0.07974331825971603, 0.3002888560295105, -0.21860460937023163, -0.11492624878883362, 0.0890701413154602, 0.062401048839092255, -0.16058161854743958, -0.09961917996406555, -0.4645862281322479, -0.2667132616043091, 0.7040239572525024, -0.06440070271492004, -0.0744071081280...
# past value ;; -s|--searchpath) SEARCHPATH="$2" shift # past argument shift # past value ;; --default) DEFAULT=YES shift # past argument ;; -*|--*) echo "Unknown option $1" exit 1 ;; *)
[ -0.6569017767906189, -0.3712363541126251, 0.4617347717285156, -0.41407883167266846, 0.5822370648384094, 0.37147045135498047, 0.5168230533599854, -0.25739583373069763, -0.19835145771503448, -0.25764399766921997, -0.6994997262954712, 0.6192656755447388, -0.4570324420928955, 0.174994289875030...
POSITIONAL_ARGS+=("$1") # save positional arg shift # past argument ;; esac done set -- "${POSITIONAL_ARGS[@]}" # restore positional parameters echo "FILE EXTENSION = ${EXTENSION}" echo "SEARCH PATH = ${SEARCHPATH}" echo "DEFAULT = ${DEFAULT}" echo "Number files in SEARCH PATH with EXTENSIO...
[ -0.18317155539989471, -0.15572239458560944, 0.7177672982215881, -0.4577814042568207, 0.15363964438438416, 0.2519330382347107, 0.2919655740261078, -0.5803290605545044, -0.14634224772453308, -0.3668903708457947, -0.39452648162841797, 0.3844808042049408, -0.3003859221935272, 0.228643849492073...
copy-pasting the block above ```sh FILE EXTENSION = conf SEARCH PATH = /etc DEFAULT = Number files in SEARCH PATH with EXTENSION: 14 Last line of file specified as non-opt/last argument: #93.184.216.34 example.com ``` ##### Usage ```bash demo-space-separated.sh -e conf -s /etc /etc/hosts ``` --- ...
[ 0.1319916695356369, 0.07860329002141953, 0.42581504583358765, 0.06171086058020592, 0.04175145551562309, 0.04041745141148567, 0.2215901017189026, -0.6220375299453735, -0.4026397168636322, -0.3086220622062683, -0.13695669174194336, 0.761463463306427, -0.4435100853443146, 0.1588241308927536, ...
shift # past argument=value ;; --default) DEFAULT=YES shift # past argument with no value ;; -*|--*) echo "Unknown option $i" exit 1 ;; *) ;; esac done echo "FILE EXTENSION = ${EXTENSION}" echo "SEARCH PATH = ${SEARCHPATH}" echo "DEFAULT
[ -0.04411548003554344, -0.42142459750175476, 0.47860532999038696, -0.5193683505058289, 0.38334518671035767, 0.2628258168697357, 0.6214349865913391, -0.3965226709842682, -0.023600174114108086, -0.09081438928842545, -0.6515839099884033, 0.6204836964607239, -0.5658197402954102, 0.0686813145875...
= ${DEFAULT}" echo "Number files in SEARCH PATH with EXTENSION:" $(ls -1 "${SEARCHPATH}"/*."${EXTENSION}" | wc -l) if [[ -n $1 ]]; then echo "Last line of file specified as non-opt/last argument:" tail -1 $1 fi EOF chmod +x /tmp/demo-equals-separated.sh /tmp/demo-equals-separated.sh -e=conf -s=/etc /etc/host...
[ 0.1924860030412674, 0.06477244943380356, 0.46515730023384094, -0.37829965353012085, 0.01261992659419775, 0.11915893107652664, 0.4990863800048828, -0.713736355304718, -0.43694552779197693, -0.1753459870815277, -0.4189760088920593, 0.5637632608413696, -0.3955293297767639, -0.0220938511192798...
guide](http://tldp.org/LDP/abs/html/string-manipulation.html). It is functionally equivalent to ``sed 's/[^=]*=//' <<< "$i"`` which calls a needless subprocess or ``echo "$i" | sed 's/[^=]*=//'`` which calls *two* needless subprocesses. --- #### Using bash with getopt[s] getopt(1) limitations (older, relatively-rece...
[ 0.09372551739215851, -0.13824552297592163, 0.29589414596557617, 0.09769539535045624, 0.17335106432437897, -0.05521721765398979, 0.3674111068248749, -0.5576858520507812, -0.1863541156053543, -0.5863369107246399, -0.05434130132198334, 0.9203587174415588, -0.5410746932029724, -0.5156722664833...
been used previously in the shell. # Initialize our own variables: output_file="" verbose=0 while getopts "h?vf:" opt; do case "$opt" in h|\?) show_help exit 0 ;; v) verbose=1 ;; f) output_file=$OPTARG ;; esac done shift $((OPTIND-1)) [ "${1:-}" = "--" ] && shift ech...
[ -0.15455566346645355, -0.15871986746788025, 0.422129362821579, -0.19223685562610626, 0.13585270941257477, 0.10910630226135254, -0.018467769026756287, -0.6858360171318054, -0.0503641776740551, -0.5165634155273438, -0.14499953389167786, 1.0176326036453247, 0.04731620103120804, -0.44491201639...
of `getopts` are: 1. It's more portable, and will work in other shells like `dash`. 2. It can handle multiple single options like `-vf filename` in the typical Unix way, automatically. The disadvantage of `getopts` is that it can only handle short options (`-h`, not `--help`) without additional code. There is a [get...
[ 0.16553863883018494, -0.24162301421165466, 0.08131939172744751, 0.23970912396907806, -0.16147804260253906, -0.12480127066373825, 0.16645590960979462, -0.03159214183688164, -0.3724985122680664, -0.6840171217918396, -0.4852176904678345, 0.7057313919067383, -0.30544888973236084, -0.4732195436...
The way you would normally include a script is with "source" eg: main.sh: ``` #!/bin/bash source incl.sh echo "The main script" ``` incl.sh: ``` echo "The included script" ``` The output of executing "./main.sh" is: ``` The included script The main script ``` ... Now, if you attempt to execute that shell s...
[ 0.37531620264053345, 0.18635937571525574, -0.0586235448718071, -0.2407010942697525, 0.004180144984275103, -0.35005247592926025, 0.3079703152179718, -0.2682870626449585, -0.11757560819387436, -0.4686557352542877, -0.3597951829433441, 0.6027698516845703, -0.43679744005203247, 0.0142634334042...
I'm writing a Windows Forms Application in C#.NET On startup, the application displays a splash screen which is running in a separate thread. Whilst the splash screen is showing, the main application is initialising. Once the main application has finished initialising, the main form of the application is displayed, a...
[ 0.41035887598991394, 0.06652950495481491, 0.7641456723213196, -0.36738359928131104, 0.01366906613111496, -0.16217315196990967, 0.1371024250984192, 0.06468239426612854, 0.09387918561697006, -0.9194550514221191, -0.3794795274734497, 0.13090214133262634, -0.15252822637557983, 0.13746692240238...
to run the application in the first place! What could be causing the windows to suddenly jump "behind" like this? Try calling .Activate() on your main window when your thread closes. It's never been active, and thus has low Z-Order, so whatever is higher will naturally be above it. I had to fix this exact scenario in...
[ 0.47996246814727783, -0.1805434674024582, 0.4787972569465637, 0.0745166540145874, 0.13928869366645813, -0.2826400101184845, 0.8292931914329529, -0.15844564139842987, -0.4552123248577118, -0.3401917815208435, -0.176176056265831, 0.7723302841186523, -0.4425995945930481, 0.04314250499010086, ...
How can I determine the name of the Bash script file inside the script itself? Like if my script is in file `runme.sh`, then how would I make it to display "You are running runme.sh" message without hardcoding that? ``` me=`basename "$0"` ``` For reading through a symlink1, which is usually not what you want (you us...
[ 0.4384637176990509, 0.34909361600875854, 0.23375029861927032, -0.3048195242881775, -0.18539133667945862, -0.1892646849155426, 0.5171365141868591, -0.3225552439689636, -0.2464698702096939, -0.5958223938941956, 0.17704984545707703, 0.6627075672149658, -0.2307550013065338, -0.0119643667712807...