text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
"the guarantee that numbers will never collide". And a way to prove if an encryption algorithm can fulfill this guarantee is to check if both the original number and the result of the encryption have the same number of bits, and that the the algorithm is reversible (bijection). [Thanks to **Adam Liss** & **CesarB** ...
[ -0.17753666639328003, 0.23802660405635834, -0.20191551744937897, 0.10539942979812622, 0.08794539421796799, 0.2616215646266937, 0.42929551005363464, -0.26932692527770996, -0.29931020736694336, -0.15645703673362732, -0.5455994606018066, 0.3937225937843323, -0.15704800188541412, -0.1161814928...
What does RESTful Authentication mean and how does it work? I can't find a good overview on Google. My only understanding is that you pass the session key (remeberal) in the URL, but this could be horribly wrong. How to handle authentication in a RESTful Client-Server architecture is a matter of debate. Commonly, it c...
[ -0.12537707388401031, -0.11395363509654999, 0.62323397397995, 0.13938406109809875, -0.217945858836174, -0.32430481910705566, 0.5120805501937866, -0.07377378642559052, 0.05639756843447685, -0.4747321307659149, -0.5330228805541992, 0.6574783325195312, -0.1008625403046608, -0.3260427117347717...
at best. Each authentication scheme has its own PROs and CONs, depending on the purpose of your security policy and software architecture. **HTTP basic auth over HTTPS** This first solution, based on the standard HTTPS protocol, is used by most web services. ``` GET /spec.html HTTP/1.1 Host: www.example.org Authori...
[ 0.22054657340049744, -0.003567307721823454, 0.4689127802848816, -0.038915954530239105, -0.10604053735733032, -0.45018863677978516, 0.7010481953620911, -0.3130224943161011, 0.0415734238922596, -0.5941799283027649, -0.26961150765419006, 0.6940043568611145, -0.1851332038640976, -0.06099780648...
secure to let the password stay only on the client side, during keyboard entry, and be stored as secure hash on the Server). We may use [Digest Authentication](https://www.rfc-editor.org/rfc/rfc2617), but it requires also HTTPS, since it is vulnerable to [MiM](http://en.wikipedia.org/wiki/Man-in-the-middle_attack) or ...
[ -0.04227299615740776, 0.06485220044851303, 0.2905876338481903, 0.21586401760578156, 0.3112128973007202, -0.5794909000396729, 0.4208964407444, 0.017650827765464783, -0.19272102415561676, -0.6857802867889404, -0.44189050793647766, 0.6496402621269226, -0.07295271009206772, 0.11710038781166077...
the server on each successive request). But this cookie data is application state data, so the client should manage it, not the server, in a pure Stateless world. ``` GET /spec.html HTTP/1.1 Host: www.example.org Cookie: theme=light; sessionToken=abc123 ``` The cookie technique itself is HTTP-linked, so it's not tru...
[ -0.17067018151283264, 0.063661590218544, 0.6015809178352356, 0.030005091801285744, 0.0434524342417717, -0.22215817868709564, 0.32698363065719604, -0.22571220993995667, -0.24432416260242462, -0.7643889784812927, -0.43456628918647766, 0.33905455470085144, -0.0560307651758194, 0.2471735775470...
to a cookie and suffers to the same issues: not stateless, relying on HTTP transmission details, and subject to [a lot of security weaknesses](https://www.rfc-editor.org/rfc/rfc6819) - including MiM and Replay - so is to be used only over HTTPS. Typically, a [JWT](https://jwt.io) is used as a token. **Query Authentica...
[ 0.13654135167598724, 0.06858781725168228, 0.5709649324417114, 0.05248899757862091, -0.0581345297396183, -0.43948253989219666, 0.35106661915779114, -0.09180574119091034, -0.017497317865490913, -0.4252333343029022, -0.44074341654777527, 0.5597341060638428, -0.06072074919939041, 0.14397487044...
URL encoding the > query string. This technique is perhaps the more compatible with a Stateless architecture, and can also be implemented with a light session management (using in-memory sessions instead of DB persistence). For instance, here is a generic URI sample from the link above: ``` GET /object?apiKey=Qwerty...
[ -0.0960124060511589, -0.06313678622245789, 0.41541624069213867, 0.10983460396528244, -0.4561671018600464, -0.11210684478282928, 0.21721400320529938, -0.08286478370428085, 0.08046064525842667, -0.7768800258636475, -0.09973566234111786, 0.43956997990608215, -0.3256508708000183, 0.37808805704...
parameter doesn't break the cache mechanism. See [this article](http://synopse.info/files/html/Synopse%20mORMot%20Framework%20SAD%201.18.html#TITL_98) for some details about RESTful authentication in our client-server ORM/SOA/MVC framework, based on JSON and REST. Since we allow communication not only over HTTP/1.1, b...
[ 0.06694460660219193, -0.02331768348813057, 0.536592960357666, 0.25042062997817993, -0.22445599734783173, -0.07050313800573349, 0.4527493417263031, -0.10975051671266556, -0.03916330263018608, -0.5814368724822998, 0.17594566941261292, 0.595859706401825, -0.06565024703741074, 0.02876951359212...
http logs are compromised, you will certainly have bigger security problems. In practice, the upcoming [MAC Tokens Authentication for OAuth 2.0](https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-http-mac-05) may be a huge improvement in respect to the "Granted by Token" current scheme. But this is still a work...
[ -0.028463121503591537, -0.1728542596101761, 0.5790080428123474, 0.09070292115211487, -0.07878944277763367, -0.44071945548057556, 0.40179088711738586, -0.19222049415111542, -0.13440409302711487, -0.46056419610977173, -0.36331841349601746, 0.4970087707042694, -0.0756077766418457, -0.09355437...
abstracted from the communication layer. And if you use HTTP communication, thanks to the [Let's Encrypt initiative](https://letsencrypt.org/) there is no reason not to use proper HTTPS, which is required in addition to any authentication scheme.
[ 0.5969454646110535, -0.001274333568289876, 0.22729328274726868, 0.3672276437282562, 0.13994388282299042, -0.5726035237312317, 0.24459609389305115, 0.14815646409988403, -0.1136547103524208, -0.548529326915741, -0.28322291374206543, 0.1938636600971222, -0.08895298838615417, -0.15644663572311...
I am working on setting up a Drupal based website and wanted to replace the site title in the header with an image file. I came across this article: ["Revised Image Replacement"](http://www.mezzoblue.com/tests/revised-image-replacement/) summarizing several techniques for doing just that. I was wondering what the curr...
[ 0.540802001953125, -0.03370381519198418, 0.288587361574173, 0.018660642206668854, 0.0074097998440265656, -0.3153926432132721, 0.13568589091300964, 0.006611705757677555, -0.35191965103149414, -0.7805028557777405, -0.1973915845155716, 0.593169093132019, -0.4074894189834595, -0.11153696477413...
Given two colors and *n* steps, how can one calculate n colors including the two given colors that create a fade effect? If possible pseudo-code is preferred but this will probably be implemented in Java. Thanks! Divide each colour into its RGB components and then calculate the individual steps required. ``` oldRed...
[ 0.151725172996521, -0.1463823914527893, 0.5672475099563599, -0.32716602087020874, -0.033901065587997437, 0.18691027164459229, 0.3721156716346741, -0.8851372599601746, -0.07168024033308029, -0.8949862122535706, -0.005419161170721054, 0.6613032221794128, -0.12451200932264328, -0.234875455498...
I have a DataTable that queries out something like below ``` usergroupid...userid......username 1.............1...........John 1.............2...........Lisa 2.............3...........Nathan 3.............4...........Tim ``` What I'm trying to do is write a LINQ statement that will return an array of UserGroup insta...
[ 0.1422416716814041, 0.3574977219104767, 0.4148315489292145, -0.10722032189369202, 0.017632709816098213, 0.06374502182006836, 0.24712851643562317, -0.32888710498809814, -0.06266571581363678, -0.861901581287384, 0.17965483665466309, 0.2625824213027954, -0.2330617904663086, 0.3968734443187713...
1, UserId = 2, UserName = "Lisa"}, new {UserGroupId = 2, UserId = 3, UserName = "Nathan"}, new {UserGroupId = 3, UserId = 4, UserName = "Tim"} }; var userGroups = from user in users group user by user.UserGroupId into userGroup select new {
[ 0.09727373719215393, -0.15264089405536652, 0.1768241673707962, -0.3765060603618622, 0.23944611847400665, 0.22850504517555237, 0.23305577039718628, -0.34389588236808777, -0.23615454137325287, -0.6910560727119446, -0.24404242634773254, 0.44475269317626953, -0.28554221987724304, 0.23268125951...
UserGroupId = userGroup.Key, Users = userGroup.ToList() }; foreach (var group in userGroups) { Console.WriteLine("{0} - {1}",group.UserGroupId, group.Users.Count); } ```
[ -0.2887573838233948, 0.1460503339767456, 0.38984283804893494, -0.5055391788482666, 0.25595593452453613, -0.0300075002014637, 0.2393549680709839, -0.2060983031988144, 0.005881225224584341, -0.5357681512832642, -0.2751411199569702, 0.4909977912902832, -0.37909162044525146, 0.1234421208500862...
I have several C# projects along with some internal library components that I'm trying to document together. Sandcastle seems to be the place to go to generate documentation from C#. I would like to know which of the two, DocProject or Sandcastle Help File Builder GUI is better and supports the features I need. I woul...
[ 0.40428993105888367, 0.33231788873672485, 0.15140286087989807, 0.0298618171364069, -0.054366156458854675, -0.110821932554245, -0.09548020362854004, -0.11429338902235031, -0.28979071974754333, -0.7196958661079407, 0.07264593988656998, 0.6911453008651733, -0.07480493187904358, -0.02904218994...
root using the Help 2 viewer) I can vouch for Sandcastle Help File Builder. It works really well and you can document any number of assemblies within a Sandcastle Help File Builder project. In theory, you could have a Builder project and generate a doc for each C# project and then have a master Builder project which do...
[ 0.35923177003860474, -0.06547360867261887, 0.0034198123030364513, 0.06861823797225952, -0.1639653891324997, -0.3111519515514374, 0.5103519558906555, -0.18935023248195648, -0.19609341025352478, -0.8307384252548218, 0.1985945850610733, 0.7376492023468018, -0.280654639005661, 0.13357292115688...
all files in ~/Cipher/nsdl/crypto can be found [here](http://nsdeleon.wikispaces.com/file/detail/crypto.zip) java files compiled with gcj, see compile.sh ``` nmint@nqmk-mint ~/Cipher/nsdl/crypto $ echo test | ./cryptTest encrypt deadbeefdeadbeefdeadbeefdeadbeef deadbeef Blowfish CBC > test null Exception in thread "ma...
[ -0.1472712606191635, -0.009051591157913208, 0.40051597356796265, 0.04734189808368683, 0.13441450893878937, -0.004390232264995575, 0.503132700920105, -0.6449823379516602, -0.2702193558216095, -0.474001407623291, -0.5049065351486206, 0.3511899709701538, -0.5626053214073181, -0.10587493330240...
+ "/PKCS5Padding"); dcipher = Cipher.getInstance(algorithm + "/" + mode + "/PKCS5Padding"); keyBytes = hexStringToByteArray(keyStr); ivBytes = hexStringToByteArray(ivStr); key = new SecretKeySpec(keyBytes, algorithm); iv = new IvParameterSpec(ivBytes); ecipher.init(Cip...
[ -0.5660635232925415, -0.5323494076728821, 0.6720551252365112, 0.12933605909347534, 0.11608181893825531, 0.1777796745300293, 0.4871545433998108, -0.47918158769607544, -0.28522878885269165, -0.5206171870231628, -0.43739622831344604, 0.3628847301006317, -0.44580820202827454, 0.152362123131752...
} } public void encrypt(InputStream in, OutputStream out) { try { // out: where the plaintext goes to become encrypted out = new CipherOutputStream(out, ecipher); // in: where the plaintext comes from int numRead = 0; while ((numRead = in.read(buf)) >= 0) { out....
[ -0.22738544642925262, -0.09918395429849625, 0.23897969722747803, -0.46306899189949036, 0.4497116804122925, 0.15231940150260925, 0.4317511022090912, -0.23541736602783203, 0.15024727582931519, -0.5650607943534851, -0.38356468081474304, 0.3645259141921997, -0.4531828463077545, 0.0435565486550...
} out.close(); } catch (IOException e) { System.err.println(e.getMessage()); } } public void decrypt(InputStream in, OutputStream out) { try { // in: where the plaintext come from, decrypted on-the-fly in = new CipherInputStream(in, dcipher); // out: where the plain...
[ -0.11798422038555145, -0.23294809460639954, 0.20146283507347107, -0.2618676722049713, 0.3233107924461365, 0.21553325653076172, 0.3005087673664093, -0.34028810262680054, 0.041616249829530716, -0.47402045130729675, -0.3090943396091461, 0.4829384684562683, -0.4481954574584961, 0.0699460282921...
((numRead = in.read(buf)) >= 0) { out.write(buf, 0, numRead); } out.flush(); out.close(); } catch (IOException e) { System.err.println(e.getMessage()); } } public static byte[] hexStringToByteArray(String s) { int len = s.length(); byte[] data = new byte[len /...
[ -0.14335477352142334, -0.4076502323150635, 0.48403212428092957, -0.2802625000476837, 0.1470663994550705, 0.3910703957080841, 0.23423263430595398, -0.3939954340457916, -0.384627103805542, -0.3906451463699341, -0.30961427092552185, 0.42087072134017944, -0.32770898938179016, 0.230217263102531...
{ data[i / 2] = (byte) ((Character.digit(s.charAt(i), 16) << 4) + Character.digit(s.charAt(i+1), 16)); } return data; } } ``` cryptTest.java: ``` package nsdl.crypto; import nsdl.crypto.BlockCrypt; public class cryptTest { public static void main (String args[]) { if (args.length != 5...
[ -0.2437640279531479, -0.008061950094997883, 0.25612983107566833, -0.20202289521694183, 0.1830412745475769, 0.2537354528903961, 0.43779751658439636, -0.3984697759151459, -0.13897155225276947, -0.3661457598209381, -0.5517765283584595, 0.544631838798523, -0.34191516041755676, 0.17625154554843...
= args[0]; String key = args[1]; String iv = args[2]; String algorithm = args[3]; String mode = args[4]; BlockCrypt blockCrypt = new BlockCrypt(key, iv, algorithm, mode); if (operation.equalsIgnoreCase("encrypt")) { blockCrypt.encrypt(System.in, System.out); ...
[ -0.6197919845581055, -0.21823003888130188, 0.6412544250488281, -0.15031372010707855, 0.108251191675663, 0.26954811811447144, 0.3313945233821869, -0.39445871114730835, -0.15459910035133362, -0.48389551043510437, -0.3985355496406555, 0.5482062697410583, -0.4528125822544098, 0.045109827071428...
blockCrypt.decrypt(System.in, System.out); } else { System.err.println("Invalid operation. Use (encrypt|decrypt)."); } } } } ``` The Cipher, `ecipher`, is not initialized, and it throws an `IllegalStateException` when you try to use it as if it were initialized in `ENCRYPT_MODE`. Note ...
[ -0.07748052477836609, -0.0645592138171196, 0.22118736803531647, -0.020945189520716667, 0.36547261476516724, -0.20579425990581512, 0.5715861916542053, -0.3453799784183502, -0.47609251737594604, -0.09952033311128616, -0.5017484426498413, 0.1166885644197464, -0.6066011190414429, 0.09329225122...
constructor—you keep sailing. Replacing `System.err.println(e.getMessage())` with `e.printStackTrace()` or at least `System.err.println(e)` should give you more detail. My guess is that `ecipher.init()` is throwing an exception because you're providing a 32-bit IV instead of 64 bits.
[ 0.15862725675106049, -0.11244887113571167, 0.48040029406547546, 0.34438198804855347, -0.01910506933927536, -0.2586550712585449, 0.14994816482067108, -0.24195028841495514, -0.419639527797699, -0.7964719533920288, -0.04488535597920418, 0.5663188695907593, -0.1417718231678009, -0.233321458101...
I have a table of music albums. I have a second table of album art. Unfortunately, not every album has some album art data. As such, i will need to do an OUTER JOIN between music and album art. Assumption: both tables just contain ints and varchars .. no blobs, etc. *Question* * Is it better to merge both tables int...
[ 0.3666549623012543, 0.3063976764678955, 0.1193704679608345, 0.13027611374855042, 0.11311262845993042, -0.17324911057949066, -0.24719564616680145, -0.43839970231056213, -0.42572516202926636, -0.5368027091026306, 0.2515237033367157, 0.5426904559135437, 0.0841779038310051, 0.0661887675523758,...
then sticking them in the same table should be fine. If you are joining these two tables in a lot of different instances, you may want to create a view in order to simplify your SQL statements.
[ 0.3098870515823364, 0.05239071324467659, 0.013999436981976032, 0.2573558986186981, -0.12462760508060455, -0.05243424326181412, -0.14696140587329865, 0.07106325775384903, -0.31920909881591797, -0.689444363117218, 0.333914577960968, 0.5001684427261353, -0.09149430692195892, 0.034934777766466...
I have a .NET 2.0 server that seems to be running into scaling problems, probably due to poor design of the socket-handling code, and I am looking for guidance on how I might redesign it to improve performance. **Usage scenario:** 50 - 150 clients, high rate (up to 100s / second) of small messages (10s of bytes each) ...
[ 0.4469994008541107, -0.08748054504394531, 0.3539174199104309, -0.01777179166674614, -0.21155543625354767, 0.30599066615104675, 0.25831639766693115, 0.02299417369067669, -0.4454367756843567, -0.8017567992210388, -0.06661158800125122, 0.12160802632570267, -0.11348464339971542, 0.000735474983...
are sent back to the clients as each group is processed by the exchange.) OS is Windows Server 2003, hardware is 2 x 4-core X5355. **Current client socket design:** A `TcpListener` spawns a thread to read each client socket as clients connect. The threads block on `Socket.Receive`, parsing incoming messages and inser...
[ -0.09851076453924179, 0.026539750397205353, 1.0931432247161865, -0.0874086245894432, -0.08301112055778503, 0.015240364708006382, -0.16528606414794922, 0.3092586100101471, -0.44524046778678894, -0.6591384410858154, -0.05728618800640106, 0.4993570148944855, -0.273001492023468, 0.430980592966...
to see intermittent delays of up to 100s of milliseconds while sending and receiving data to/from the clients. (We log timestamps for each acknowledgment message, and we can see occasional long gaps in the timestamp sequence for bunches of acks from the same group that normally go out in a few ms total.) Overall syst...
[ -0.06230359897017479, 0.06648507714271545, 0.32196563482284546, 0.0527433343231678, 0.08757083863019943, 0.1651436686515808, 0.4446968734264374, 0.05800386518239975, -0.6135004162788391, -0.5950459837913513, -0.21067282557487488, 0.42783236503601074, -0.09153205156326294, -0.15808337926864...
clients (gigabit LAN), and we have ruled out network or hardware-layer problems. Any suggestions or pointers to useful resources would be greatly appreciated. If anyone has any diagnostic or debugging tips for figuring out exactly what is going wrong, those would be great as well. *Note: I have the MSDN Magazine arti...
[ 0.40904954075813293, -0.0668291226029396, 0.0838845819234848, 0.21051162481307983, -0.1246686726808548, -0.059197213500738144, 0.13923071324825287, 0.3777763247489929, -0.43714749813079834, -0.7592632174491882, -0.011652869172394276, 0.6167006492614746, -0.10460855811834335, -0.00317862583...
design is simple, but does not scale well. You probably should look at using Socket.BeginReceive which will execute on the .net thread pools (you can specify somehow the number of threads it uses), and then pushing onto a queue from the asynchronous callback ( which can be running in any of the .NET threads ). This sh...
[ 0.4028126895427704, -0.3919280469417572, -0.02593042701482773, 0.08315707743167877, -0.046707212924957275, -0.024578606709837914, -0.1249345913529396, -0.0918101966381073, -0.20278804004192352, -0.8915340304374695, 0.1058792695403099, 0.49473732709884644, -0.3084908425807953, 0.12127846479...
Here is pseudo-code of how I setup an array representing the MandelBrot set, yet it becomes horribly stretched when leaving an aspect ratio of 1:1. ``` xStep = (maxX - minX) / width; yStep = (maxY - minY) / height; for(i = 0; i < width; i++) for(j = 0; j < height; j++) { constantReal = minReal + xStep * i; c...
[ -0.1427096277475357, -0.30469009280204773, 0.573746919631958, -0.14227202534675598, -0.05662718787789345, 0.550824761390686, 0.25883474946022034, -0.17277586460113525, -0.3204924762248993, -0.8953857421875, -0.16097518801689148, 0.594826877117157, 0.07232426106929779, 0.06829511374235153, ...
aspect ratio of 1:1. ``` xStep = (maxX - minX) / width; yStep = (maxY - minY) / height; ``` Aha! It's because you must keep the same aspect ratio *both* for the image you will draw *and* for the region of the complex plane you want to draw. In other words, it must hold ``` width maxX - minX ---------- = ------...
[ -0.028695134446024895, -0.04766077920794487, 0.618427038192749, -0.09484727680683136, 0.008029153570532799, 0.3217743933200836, 0.14396251738071442, -0.019235758110880852, -0.163398876786232, -0.7428702116012573, -0.27973154187202454, 1.005758285522461, 0.062127549201250076, -0.15251323580...
I need to compare build outputs of VS2005 in order to be sure I can reproduce the exact same product. when I do two builds one after the other in release and compare the produced files I get different files, doing text comparison it seems that more than just the datetime is different how can I build in order to repro...
[ 0.644231915473938, 0.09898175299167633, 0.27487167716026306, -0.14815104007720947, -0.1277742087841034, 0.06434349715709686, 0.35635682940483093, -0.12413245439529419, -0.017107989639043808, -0.8719310760498047, 0.035655178129673004, 0.546725332736969, -0.08888383954763412, 0.2468872219324...
Find out where the files are "known to differ immaterially", wipe those bytes, and then compare * Use ildasm to convert the assemblies to text, and then compare those results. (I haven't checked whether or not this reveals the differences too - it may do, in which case again you'd have to explicitly ignore certain sect...
[ 0.5575812458992004, 0.1270132213830948, 0.29128652811050415, 0.17954450845718384, 0.026338772848248482, -0.1672191619873047, 0.31857672333717346, -0.11925869435071945, -0.18912522494792938, -0.8979929089546204, 0.1455087959766388, 0.25381630659103394, -0.04658162221312523, -0.0654389038681...
I have two strings ``` <EM>is <i>love</i></EM>,<PARTITION /> ``` and ``` <EM>is <i>love</i>,<PARTITION /> ``` I want a regex to match the second string completely but should not match the first one. Please help. Note: Everything can change except the EM and PARTITION tags. luckily going through all this and doin...
[ -0.03094658814370632, 0.09679197520017624, 0.39915788173675537, -0.09450315684080124, -0.15028205513954163, 0.2756488025188446, 0.35252654552459717, -0.2567354142665863, 0.11667796969413757, -0.8073632717132568, -0.04043944552540779, 0.30682453513145447, -0.2964842617511749, 0.223723471164...
Suppose `a` and `b` are both of type `int`, and `b` is nonzero. Consider the result of performing `a/b` in the following cases: 1. `a` and `b` are both nonnegative. 2. `a` and `b` are both negative. 3. Exactly one of them is negative. In Case 1 the result is rounded down to the nearest integer. But what does the stan...
[ -0.06597457081079483, -0.1279037743806839, 0.054118137806653976, -0.36805933713912964, -0.0020891036838293076, 0.07932734489440918, 0.12752670049667358, -0.5082671642303467, -0.2600548565387726, -0.3394300937652588, -0.06876886636018753, 0.3483670949935913, -0.22950801253318787, -0.0399094...
standard says? Please answer only based on the standard, not what makes sense, or what particular compilers do. According to the May 2008 revision, You're right: > The binary / operator yields the quotient, and the binary % operator yields the remainder from the division of the first expression by the second. If the ...
[ 0.16769368946552277, 0.2370651364326477, 0.47378259897232056, -0.2127930372953415, 0.1401236355304718, -0.03156892955303192, 0.2464200109243393, -0.6034039855003357, 0.16368596255779266, 0.03177589178085327, -0.31254181265830994, 0.522901713848114, -0.29182374477386475, -0.0570802316069603...
ISO C, the preferred algorithm for integer division follows the rules defined in the ISO Fortran standard, ISO/IEC 1539:1991, in which the quotient is always rounded toward zero. Chances are that C++ will lag C in this respect. As it stands, it's undefined but they have an eye towards changing it. I work in the same ...
[ -0.08584963530302048, 0.25295528769493103, 0.0894920825958252, 0.010839403606951237, -0.42867299914360046, 0.04777446761727333, -0.2914939522743225, -0.06962213665246964, -0.2807733118534088, 0.0038807671517133713, 0.06022367998957634, 0.45439431071281433, -0.012755604460835457, 0.11130221...
Many of our customers have access to InstallShield, WISE or AdminStudio. These aren't a problem. I'm hoping there is some way I can provide our smaller customers **without access to commercial repackaging tools** a freely available set of tools and steps to do the file replacement themselves. Only need to replace a si...
[ 0.4728027284145355, 0.1562696099281311, 0.3435054123401642, 0.018544385209679604, 0.12688663601875305, -0.05387125164270401, -0.016838155686855316, 0.07438471168279648, -0.4070332646369934, -0.7862106561660767, -0.05898638442158699, 0.49256208539009094, -0.11578848958015442, 0.019570082426...
both questions and answers in that thread are not clear.* Okay, revisiting this question with my own answer providing nice little VB script that will do all heavy lifting. As mentioned in the original question, the aim was provide a simple solution for sysadmin users to make the updates/changes themselves. Below is a...
[ 0.5317296385765076, -0.12288220971822739, 0.897655725479126, 0.030287349596619606, -0.19068238139152527, 0.012793720699846745, 0.23340892791748047, -0.43222036957740784, -0.22419330477714539, -0.6198167204856873, -0.12665359675884247, 0.6347237825393677, -0.6036498546600342, 0.061069052666...
filesys.FileExists(MY_CONFIG) Then WScript.Quit 2 ' No config file, abort! Dim objFile, size, result, seq, objCab ' MakeCab object has been depreciated so we fallback to makecab.exe for with Windows 7 On Error Resume Next ' Disable error handling, for a moment Set objCab = CreateObject("MakeCab.MakeCab.1") On Error ...
[ -0.17053194344043732, 0.02999594435095787, 0.5724089741706848, -0.07625039666891098, 0.22571821510791779, 0.0725572481751442, 0.6557640433311462, -0.11237907409667969, -0.08895033597946167, -0.6860771179199219, -0.3709917664527893, 0.6493453979492188, -0.5938147902488708, 0.138813450932502...
Dim WshShell, oExec Set WshShell = CreateObject("WScript.Shell") Set oExec = WshShell.Exec("makecab " & filesys.GetFileName(MY_CONFIG) & " " & CAB_FILE) End If Set objFile = filesys.GetFile(MY_CONFIG) size = objFile.Size Set view = database.OpenView ("SELECT LastSequence FROM Media WHERE DiskId = 1") view.Exe...
[ 0.2178524136543274, -0.5095288753509521, 1.2379833459854126, -0.1065034568309784, -0.029381031170487404, 0.059455014765262604, 0.238143190741539, -0.7214491367340088, -0.16459928452968597, -0.5574193596839905, -0.28129082918167114, 0.8461042642593384, -0.3598957657814026, 0.199841484427452...
'MYC~2.CNF|MyConfigApp.xml' WHERE File = '" & MY_CONFIG & "'") view.Execute database.GenerateTransform database2, "CustomConfig.mst" database.CreateTransformSummaryInfo database2, "CustomConfig.mst", 0, 0 filesys.DeleteFile("temp.tmp") Set view = nothing Set installer = nothing Set database = nothing Set database2 = ...
[ 0.32128483057022095, -0.17096596956253052, 0.8953733444213867, -0.023701798170804977, 0.28099310398101807, 0.00809660367667675, 0.3815293610095978, 0.006122419610619545, -0.1002558246254921, -0.8250774145126343, -0.4391598105430603, 0.664036214351654, -0.3141249120235443, 0.175047382712364...
I am in the process of writing a text editor. After looking at other text editors I have noticed that a number of them refer to a "soft" versus "hard" wrap. What is the difference? I can't seem to find the answer by searching. A hard wrap inserts actual line breaks in the text at wrap points, with soft wrapping the act...
[ 0.1324278861284256, -0.0978158712387085, 0.3322995603084564, -0.06421898305416107, -0.1852293461561203, 0.1601456105709076, 0.05044999718666077, 0.23882468044757843, -0.4284549057483673, -0.5651893615722656, -0.16983520984649658, 0.5037832856178284, 0.17023317515850067, -0.0015731819439679...
How do I connect to the database(MYSQL) in connection bean using JSF to retrieve its contents. Also please let me know how do I configure the web.xml file? To get connected to mysql: ``` public void open() { try { String databaseName = "custom"; String userName = "root"; St...
[ 0.1495916098356247, 0.17277374863624573, 0.45252111554145813, 0.17158468067646027, 0.20629967749118805, -0.24437697231769562, 0.2836146056652069, 0.03383518010377884, -0.16422812640666962, -0.833595335483551, -0.4186911880970001, 0.45200425386428833, -0.3485122323036194, 0.4319105744361877...
// String url = "jdbc:mysql://localhost/" + databaseName; Class.forName("com.mysql.jdbc.Driver").newInstance(); connection = DriverManager.getConnection(url, userName, password); } catch (Exception e) { System.out.println("Not able to connect"); } } ...
[ -0.15843568742275238, -0.19998694956302643, 0.32684674859046936, 0.06161235645413399, 0.05012501776218414, -0.11679490655660629, 0.25646737217903137, 0.1092248260974884, -0.3634197413921356, -0.6632750630378723, -0.2661776542663574, 0.48488208651542664, -0.32092106342315674, 0.562345445156...
in pom.xml ``` <dependency> <groupId>groupId = mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.6</version> </dependency> ``` This was working successfully.
[ -0.4428934156894684, -0.25764167308807373, 0.5953053832054138, -0.3739252984523773, -0.04292833060026169, -0.08418852090835571, -0.5265212059020996, -0.25996342301368713, -0.2783680856227875, -0.547275722026825, -0.10286937654018402, 0.3613925576210022, -0.15067386627197266, -0.22668793797...
I'm using the ssOption control (Sheridan 3d Option control) in VB6. In Windows 98 the text area background color is the same color as the background color around the Option Circle, and that color is the default form color. So the Option button appears to be transparent. There is no Background color property and on W...
[ -0.02086794190108776, -0.09032885730266571, 0.5463070869445801, -0.22005657851696014, 0.16120292246341705, -0.15184801816940308, 0.2975485026836395, 0.2773820757865906, -0.1487439125776291, -0.713463544845581, -0.3075940012931824, 1.112489938735962, -0.25062963366508484, -0.059786036610603...
directory on both the Win98 and WinXP systems. 1. Why might it behave differently on 98 vs XP? 2. Any ideas on a fix? SSOption sets it background to the Windows Button Face on Windows XP. This the same background you get when you make a new form. You will need to use a frame or another type of enclosure that has a bac...
[ 0.09510039538145065, -0.33755698800086975, 0.6599330902099609, 0.09307270497083664, -0.07873725146055222, -0.23766081035137177, 0.03550960123538971, 0.1164841577410698, -0.3802599310874939, -0.668913722038269, -0.13822969794273376, 0.52493816614151, -0.5476266741752625, -0.1663815081119537...
only works well using the default button face color which is why it is hard coded into the control. It also has better formatting of the text when the option button is to the right of the text. If you can't use a enclosing frame or panel then you have a tedious alternative. You can make an VB6 option with no text. If ...
[ 0.19150561094284058, -0.43412598967552185, 0.3465700149536133, 0.25758007168769836, -0.06629692763090134, 0.15591323375701904, 0.39583447575569153, -0.1804506629705429, -0.22338765859603882, -0.7545468211174011, 0.2045884132385254, 0.5606493949890137, -0.27310073375701904, -0.2420582473278...
the ZoomIn tool if you installed VB6 as part of the Visual Studio 6 package to make sure it is right. If you are using it for the Alignment. Then you can fiddle with the width of the VB6 native option control until it looks right or make the option with no text and use a label.
[ 0.364027738571167, -0.4165958762168884, 0.4373997449874878, 0.0953693762421608, -0.34545326232910156, -0.13737456500530243, 0.17008404433727264, -0.0061210207641124725, -0.08580243587493896, -0.572410523891449, 0.06390433758497238, 1.105172038078308, -0.26720377802848816, -0.28600865602493...
This is to all the C# gurus. I have been banging my head on this for some time already, tried all kinds of advice on the net with no avail. The action is happening in Windows Mobile 5.0. I have a DLL named MyDll.dll. In the MyDll.h I have: ``` extern "C" __declspec(dllexport) int MyDllFunction(int one, int two); ```...
[ 0.27714991569519043, 0.010583867318928242, 1.0296193361282349, -0.2064637839794159, 0.03579219803214073, -0.21512256562709808, -0.019832724705338478, -0.13936123251914978, -0.10564041137695312, -0.5466343760490417, -0.07338058203458786, 0.8792873024940491, -0.36307293176651, 0.096718944609...
is where the bloody thing keeps giving me "Can't find PInvoke DLL 'MyDll.dll'". I have verified that I can actually do the PInvoke on system calls, such as "GetAsyncKeyState(1)", declared as: ``` [DllImport("coredll.dll")] protected static extern short GetAsyncKeyState(int vKey); ``` The MyDll.dll is in the ...
[ 0.1579708755016327, 0.024660686030983925, 0.7522596120834351, -0.025020815432071686, 0.05636246129870415, 0.026939138770103455, 0.2845406234264374, 0.008338414132595062, -0.018870089203119278, -0.5087799429893494, -0.14342249929904938, 0.46879813075065613, -0.22285877168178558, 0.277536094...
on multiple CPU architectures.
[ -0.11814827471971512, 0.27135059237480164, -0.09415901452302933, 0.15943986177444458, 0.19478140771389008, 0.0744050145149231, -0.1969439834356308, 0.02680942788720131, 0.041480354964733124, -0.6896944046020508, -0.22924058139324188, 0.42059385776519775, -0.20028991997241974, 0.02138662897...
I have spent lot of time doing research on VIM. I am Windows guy since last 6 yrs and was using VS. Now started working on Linux. I want to make VIM as close as possible to VS. I want features like Project Navigation Files in Different Tabs Search in Project AutoCompletion I have found plugins for the above requiremen...
[ 0.6351179480552673, 0.02115016058087349, 0.7120033502578735, 0.002079741097986698, -0.4329625964164734, -0.3159739375114441, 0.24910280108451843, 0.10187055170536041, -0.09206028282642365, -0.89182448387146, 0.11245875805616379, 0.8004311323165894, -0.11890584230422974, 0.35557886958122253...
makes all mess. Has any one done settings with these plugin.. Could you guys please post your vimrc files?? It will save lot of time for newbies like me.. Vim is a very different tool than Visual Studio. Plugins may help you get certain bits of functionality you desire, but do not expect them to work exactly like VS, ...
[ 0.8062704205513, -0.288642942905426, 0.05627528578042984, 0.39287006855010986, -0.49389734864234924, -0.3263143002986908, -0.07687906175851822, 0.04897322505712509, -0.48766130208969116, -0.7814733982086182, 0.21026095747947693, 0.5560623407363892, -0.30028408765792847, 0.2470785528421402,...
IDE's than Visual Studio, and all are available on Linux for free. You should either learn to use Vim the way it was built to be used, or find a different tool that suits you better. Shoehorning Vim into a surrogate for Visual Studio will probably cause you more pain than it's worth.
[ 0.7308914661407471, -0.3288021385669708, 0.15474243462085724, 0.3894767165184021, -0.3698761761188507, -0.33111488819122314, -0.22114896774291992, 0.09267382323741913, 0.030275925993919373, -0.6370999217033386, 0.12800924479961395, 0.7396034002304077, -0.13952259719371796, 0.37390580773353...
I've got a SQLServer Database and an application (.NET) that configures data on that database. On the other hand, I've got an application (VC++) that reads that data from the database and must be 'informed' a soon as possible of any change in the data saved on the database. I would like to receive a signal from the da...
[ 0.4616778492927551, 0.12250688672065735, 0.7341834306716919, 0.14100149273872375, 0.21521323919296265, -0.08673011511564255, 0.40181657671928406, 0.014995535835623741, -0.26391127705574036, -0.7406596541404724, -0.18047760426998138, 0.6364505290985107, -0.18617567420005798, 0.1076459884643...
SQLServer or in any API for accessing SQLServer (Native, OLE DB, or even ODBC) PS: Apologize for my english You can use a SQL Agent Job that will notify the other app starting it with sp\_start\_job. Check [this](http://www.windows-tech.info/15/830e5ff5a0c026bf.php) out.
[ -0.15033601224422455, 0.2333524078130722, 0.3002374470233917, -0.06871415674686432, -0.32030341029167175, -0.05257101729512215, 0.7173938155174255, 0.24186861515045166, -0.163425475358963, -0.5721583962440491, -0.2920781075954437, 0.2928559184074402, -0.331607460975647, -0.0845890566706657...
This is a [follow up question](https://stackoverflow.com/questions/319199/why-is-java-able-to-store-0xff000000-as-an-int). So, Java store's integers in [two's-complements](http://en.wikipedia.org/wiki/Two%27s_complement) and you can do the following: ``` int ALPHA_MASK = 0xff000000; ``` In C# this requires the use o...
[ -0.07215835154056549, 0.010713649913668633, 0.004700853955000639, -0.3628683090209961, -0.3713969588279724, -0.004753284156322479, 0.15626893937587738, -0.40433499217033386, -0.27520909905433655, -0.5149949193000793, -0.11352801322937012, 0.43651556968688965, -0.4403093159198761, -0.280649...
than all the other bits? In this specific case, it is safe to use an unchecked cast: ``` int ALPHA_MASK = unchecked((int)0xFF000000); ``` To "directly" represent this number as a signed value, you write ``` int ALPHA_MASK = -0x1000000; // == -16777216 ``` Hexadecimal is not (or should not) be any different from ...
[ -0.07155488431453705, -0.055648330599069595, 0.07541090995073318, -0.08422008901834488, -0.1756623089313507, 0.1160435825586319, 0.27882325649261475, -0.11207672953605652, 0.04722997546195984, -0.08486871421337128, -0.10970314592123032, 0.28494569659233093, -0.1702977567911148, -0.03685284...
Given a couple of simple tables like so: ``` create table R(foo text); create table S(bar text); ``` If I were to union them together in a query, what do I call the column? ``` select T.???? from ( select foo from R union select bar from S) as T; ``` Now, in mysql, I can apparently refer to th...
[ 0.0736684799194336, 0.2541325092315674, 0.5220603346824646, -0.3764247000217438, -0.21192513406276703, 0.14253510534763336, 0.005364744924008846, -0.24009355902671814, -0.08403885364532471, -0.338611900806427, -0.09591523557901382, 0.4311891496181488, -0.6847678422927856, 0.031717561185359...
standard across all SQL implementations? If not, how about just for sqlite3? Correction: sqlite3 does allow you to refer to T's column as 'foo' after all! Oops! Although there is no spelled rule, we can use the column names from the first subquery in the union query to fetch the union results.
[ 0.4127247929573059, -0.016567634418606758, 0.2911352217197418, -0.33073848485946655, -0.0750608816742897, -0.1034737154841423, 0.12762393057346344, 0.14760267734527588, -0.32537174224853516, 0.036942269653081894, -0.07167164981365204, 0.5573556423187256, -0.36608466506004333, -0.1533909291...
I cannot get a two-way bind in WPF to work. I have a string property in my app's main window that is bound to a TextBox (I set the mode to "TwoWay"). The only time that the value of the TextBox will update is when the window initializes. When I type into the TextBox, the underlying string properties value does no...
[ 0.22041645646095276, 0.014863968826830387, 0.5866662263870239, -0.22497408092021942, 0.04712998494505882, -0.08461160212755203, 0.7209675312042236, -0.11670231074094772, 0.10164207965135574, -1.1209626197814941, -0.1675875037908554, 0.4834214150905609, -0.36297011375427246, 0.2179818898439...
to get two-way binding to work properly in even this almost trivial example? Most probably you're trying to bind to a .net CLR property instead of a WPF dependencyProperty (which provides Change Notification in addition to some other things). For normal CLR property, you'd need to implement INotifyPropertyChanged an...
[ 0.07265155017375946, -0.3332655429840088, 0.42711809277534485, 0.16127437353134155, -0.24212346971035004, -0.44662168622016907, 0.19184911251068115, -0.2958628833293915, -0.16308052837848663, -0.6002771258354187, -0.0920184776186943, 0.6872729659080505, -0.23693694174289703, -0.07694251090...
me off too when I started learning about WPF data binding. **Update:** *Well OP, it would have been a waste of time if i was barking up the wrong tree.. anyways now since you had to dig a bit.. you'll remember it for a long time.* Here's the code snippet to round off this answer. Also found that updating the textbox h...
[ 0.5272632837295532, -0.01906045340001583, 0.5815994739532471, 0.010801191441714764, -0.19004768133163452, -0.13388720154762268, 0.2697729766368866, -0.03155462443828583, -0.2670636773109436, -0.5232207179069519, 0.08641555160284042, 0.7205199599266052, -0.11529955267906189, 0.0578413642942...
<StackPanel x:Name="TopLevelContainer"> <TextBox x:Name="txtValue" Background="AliceBlue" Text="{Binding Path=MyDotNetProperty}" /> <TextBlock TextWrapping="Wrap">We're twin blue boxes bound to the same property.</TextBlock> <TextBox x:Name="txtValue2" Background="AliceBlue" Text="{Binding Pat...
[ 0.04513491690158844, -0.26386430859565735, 0.4655148386955261, -0.14834477007389069, 0.23858951032161713, 0.14258098602294922, 0.19752399623394012, -0.37139272689819336, -0.23113080859184265, -0.5482074618339539, -0.35736557841300964, 0.3960496783256531, -0.4631040096282959, 0.116523593664...
} private string m_sValue; public string MyDotNetProperty { get { return m_sValue; } set { m_sValue = value; if (null != this.PropertyChanged) {
[ -0.1756146401166916, -0.42059797048568726, 0.6400279998779297, -0.009860610589385033, 0.21948795020580292, 0.06712179630994797, 0.5165207982063293, 0.046910304576158524, -0.05818673223257065, -0.4760975241661072, -0.56007319688797, 0.8461350798606873, -0.22255541384220123, 0.13030943274497...
PropertyChanged(this, new PropertyChangedEventArgs("MyDotNetProperty")); } } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion } ```
[ -0.40122106671333313, -0.4100889265537262, 0.8254551291465759, 0.020554212853312492, 0.2580511271953583, -0.4643121659755707, 0.14457683265209198, -0.061730366200208664, -0.14854219555854797, -0.8042155504226685, -0.5300712585449219, 0.3900982141494751, 0.1468355655670166, 0.70932459831237...
My WPF application generates sets of data which may have a different number of columns each time. Included in the output is a description of each column that will be used to apply formatting. A simplified version of the output might be something like: ``` class Data { IList<ColumnDescription> ColumnDescriptions { ...
[ 0.2443513572216034, -0.048215415328741074, 0.821681022644043, -0.2396194040775299, -0.10842830687761307, 0.1094018965959549, 0.09828313440084457, -0.72835773229599, -0.013423177413642406, -0.7574372887611389, -0.028482824563980103, 0.5427212715148926, -0.38368234038352966, -0.2622579038143...
Header = data.ColumnDescriptions[i].Name, Binding = new Binding(string.Format("[{0}]", i)) }); } ``` Is there any way to replace this code with data bindings in the XAML file instead? Here's a workaround for Binding Columns in the DataGrid. Since the Columns property is ReadOnly, like everyone noticed, I ...
[ 0.12745174765586853, 0.06300044059753418, 0.6063887476921082, 0.11567544937133789, -0.14852838218212128, -0.35524171590805054, 0.008718573488295078, -0.46526336669921875, -0.3595532178878784, -0.6144594550132751, -0.10332790017127991, 0.33978939056396484, -0.6246448159217834, 0.22069451212...
the ColumnCollection like this ``` <DataGrid Name="dataGrid" local:DataGridColumnsBehavior.BindableColumns="{Binding ColumnCollection}" AutoGenerateColumns="False" ...> ``` The Attached Property BindableColumns ``` public class DataGridColumnsBehavior { public static readonly Depen...
[ -0.4648303985595703, -0.026959693059325218, 0.7663719058036804, -0.027241745963692665, 0.17797598242759705, -0.05560021474957466, 0.007701604161411524, -0.159380704164505, 0.0019045964581891894, -0.4003249406814575, -0.3458564579486847, 0.5831212401390076, -0.47627338767051697, 0.307184875...
typeof(ObservableCollection<DataGridColumn>), typeof(DataGridColumnsBehavior), new UIPropertyMetadata(null, BindableColumnsPropertyChanged)); private static void BindableColumnsPropertyChanged(DependencyObject source,
[ -0.2954849600791931, -0.17675656080245972, 0.6216302514076233, -0.15776316821575165, 0.3010399043560028, 0.022772405296564102, 0.2684783935546875, -0.08664662390947342, 0.0894763395190239, -0.514498770236969, -0.35275042057037354, 0.5978885889053345, -0.5585147738456726, 0.3550336360931396...
DependencyPropertyChangedEventArgs e) { DataGrid dataGrid = source as DataGrid; ObservableCollection<DataGridColumn> columns = e.NewValue as ObservableCollection<DataGridColumn>; dataGrid.Columns.Clear(); if (columns == null) { return; } foreach (D...
[ -0.3205094635486603, -0.2198701798915863, 0.9302262663841248, -0.2414962649345398, 0.3337569832801819, 0.006445545703172684, 0.22639615833759308, -0.3607170581817627, 0.026691246777772903, -0.4012657105922699, -0.36190861463546753, 0.8952964544296265, -0.4571998417377472, 0.323074847459793...
dataGrid.Columns.Add(column); } columns.CollectionChanged += (sender, e2) => { NotifyCollectionChangedEventArgs ne = e2 as NotifyCollectionChangedEventArgs; if (ne.Action == NotifyCollectionChangedAction.Reset) { dataGrid.Columns.Clear();
[ -0.42616912722587585, -0.5337088108062744, 0.7060348391532898, -0.15207768976688385, 0.2537837624549866, 0.24808825552463531, 0.43711069226264954, -0.5495847463607788, -0.42138633131980896, -0.3173527419567108, -0.2828068137168884, 0.3419301509857178, -0.4160040318965912, 0.107218466699123...
foreach (DataGridColumn column in ne.NewItems) { dataGrid.Columns.Add(column); } } else if (ne.Action == NotifyCollectionChangedAction.Add)
[ -0.3744538128376007, -0.23559042811393738, 0.39865800738334656, -0.35847264528274536, 0.19443635642528534, 0.36615023016929626, 0.36562979221343994, -0.6759274005889893, -0.17266027629375458, -0.4812847673892975, -0.25323182344436646, 0.3158070743083954, -0.28947216272354126, -0.0179949514...
{ foreach (DataGridColumn column in ne.NewItems) { dataGrid.Columns.Add(column); } }
[ -0.3579445779323578, 0.07411275804042816, 0.34539979696273804, -0.44907596707344055, 0.25070205330848694, 0.3595633804798126, 0.11050131171941757, -0.3134581744670868, -0.0006061356980353594, -0.7040237784385681, -0.3278980255126953, 0.22150439023971558, -0.2209470272064209, 0.131316140294...
else if (ne.Action == NotifyCollectionChangedAction.Move) { dataGrid.Columns.Move(ne.OldStartingIndex, ne.NewStartingIndex); } else if (ne.Action == NotifyCollectionChangedAction.Remove) { foreach (DataGridColumn column in ne.OldItems)
[ -0.38729575276374817, -0.06992864608764648, 0.41544538736343384, -0.24780811369419098, 0.33209776878356934, 0.26774072647094727, 0.1458030343055725, -0.4639337956905365, -0.13075999915599823, -0.40996769070625305, -0.3704647421836853, 0.3371128737926483, -0.270285427570343, 0.1486356258392...
{ dataGrid.Columns.Remove(column); } } else if (ne.Action == NotifyCollectionChangedAction.Replace) {
[ -0.276065468788147, -0.6213381886482239, 0.39287158846855164, -0.13369716703891754, 0.2574966251850128, 0.1145809143781662, 0.3199763596057892, -0.5373380780220032, -0.2027207762002945, -0.33585742115974426, -0.10091310739517212, 0.4843149185180664, -0.4772251844406128, 0.00455073080956935...
dataGrid.Columns[ne.NewStartingIndex] = ne.NewItems[0] as DataGridColumn; } }; } public static void SetBindableColumns(DependencyObject element, ObservableCollection<DataGridColumn> value) { element.SetValue(BindableColumnsProperty, value); } public static ObservableColle...
[ -0.15679235756397247, -0.14056280255317688, 0.678411602973938, -0.22348369657993317, 0.1762843132019043, 0.0013173766201362014, 0.2574966251850128, -0.39660656452178955, -0.17768102884292603, -0.534198522567749, -0.6618863940238953, 0.5113905072212219, -0.621147871017456, 0.212370082736015...
Can someone illustrate what really is the difference between the two? Even though they are two very different things, one can argue they **both solve a software architecture problem** * a design pattern solves many software architecture issues (about creation, behavior, concurrency, ...) with different pre-defined *de...
[ 0.9948307275772095, 0.22564159333705902, 0.12411759048700333, 0.20540836453437805, 0.06292248517274857, -0.2536044418811798, 0.1598367542028427, -0.4750175476074219, -0.0866432636976242, -0.437939316034317, -0.10397198796272278, 0.7101191282272339, -0.315827876329422, 0.07369436323642731, ...
**scope**: + class design patterns (involves classes) + business design patterns (involves business workflows) + application design patterns (involves applications) * **framework has a** ***large*** **scope**: For instance, **[.NET is a framework](http://msdn.microsoft.com/en-us/netframework/default.aspx)** comp...
[ 0.5510743260383606, 0.13593238592147827, 0.1524788737297058, 0.11965685337781906, -0.07974455505609512, -0.1870698183774948, 0.06480346620082855, -0.23412631452083588, -0.2645503878593445, -0.8701195120811462, -0.20834004878997803, 0.17181645333766937, -0.43719160556793213, 0.0695956423878...
I have a `JFrame` that contains a "display" `JPanel` with `JTextField` and a "control" `JPanel` with buttons that should access the contents of the display `JPanel`. I think my problem is related on how to use the observer pattern, which in principle I understand. You need to place listeners and update messages, but I ...
[ 0.3567487597465515, 0.14517471194267273, 0.38544681668281555, 0.1114157885313034, -0.2467544674873352, -0.06168263405561447, 0.07551826536655426, -0.0008362910011783242, 0.1404586136341095, -0.7906348705291748, 0.18232811987400055, 0.8167868256568909, -0.4250637888908386, 0.055531002581119...
anonymous action listener as follows: ``` JButton openfile = new JButton("Convert file"); openfile.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { openButtonPressed(); } }); ``` You need to reduce the coupling between these objects. You can have a ma...
[ -0.06490982323884964, -0.34156060218811035, 0.5119524002075195, -0.2952147424221039, -0.2686839997768402, 0.18882353603839874, 0.3356461524963379, -0.5699222683906555, -0.24423415958881378, -0.44500818848609924, -0.28299394249916077, 0.8689746260643005, -0.7461165189743042, -0.037524502724...
in turn take the values from the textfields and create perhaps a transfer object. This way you reduce the coupling between the panels, textfields etc. and let the control in one place ( the mediator ) that is, you don't let them know each other. You can take a look at the code in this question: <https://stackoverfl...
[ 0.18751034140586853, -0.25276216864585876, 0.4440688192844391, 0.20827160775661469, 0.06515316665172577, 0.043590743094682693, 0.03239000216126442, -0.4261608421802521, -0.24460965394973755, -0.7141989469528198, 0.011098828166723251, 0.5567384362220764, -0.679538369178772, -0.3401711583137...
mediator // GUI components. private JFrame frame; private JTextField name; private JTextField count; private JTextField date; // Result is displayed here. private JTextArea textArea; // Fired by this button. private JButton go; private ActionListener actionListener; pub...
[ -0.22530362010002136, -0.49045810103416443, 0.8237292170524597, -0.24408183991909027, 0.20452217757701874, 0.32760170102119446, 0.4651029407978058, -0.5811330080032349, -0.3144063651561737, -0.3870137631893158, -0.611998975276947, 1.047910213470459, -0.6028938889503479, -0.0677673518657684...
okButtonPressed(); } }; } private void okButtonPressed(){ // template is an object irrelevant to this code. template.setData( getData() ); textArea.setText( template.getTransformedData() ); } public void initialize(){
[ -0.05394088476896286, -0.09051382541656494, 0.19411402940750122, -0.16084730625152588, 0.2071475088596344, 0.18455366790294647, 0.3513609766960144, -0.21481303870677948, -0.06246666982769966, -0.47934308648109436, -0.48127681016921997, 0.456266313791275, -0.6551891565322876, 0.011046245694...
frame = new JFrame("Code challenge v0.1"); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); name = new JTextField(); count = new JTextField(); date = new JTextField(); textArea = new JTextArea(); go = new JButton("Go");
[ -0.15083923935890198, -0.4998490512371063, 0.689363956451416, -0.30376186966896057, -0.1300283968448639, 0.11728847026824951, 0.2706705629825592, -0.2293136864900589, -0.26550108194351196, -0.5535972118377686, -0.6988710165023804, 0.4493541419506073, -0.39149463176727295, 0.219292730093002...
go.addActionListener( actionListener ); // prepare the button. layoutComponents(); // a lot of panels are created here. Irrelevant. } } ``` Complete and running code can be retrieved [here:](https://stackoverflow.com/questions/324554/#324559) It is important to favor composition over inheritance when po...
[ -0.08876701444387436, -0.08214883506298065, 0.10562943667173386, -0.13705936074256897, -0.022879736497998238, -0.17832717299461365, 0.19681063294410706, -0.4609043598175049, -0.47677478194236755, -0.7929763793945312, -0.5083047747612, 0.6084898710250854, -0.6432336568832397, -0.35387006402...
Is there a way to ensure all created subprocess are dead at exit time of a Python program? By subprocess I mean those created with subprocess.Popen(). If not, should I iterate over all of the issuing kills and then kills -9? anything cleaner? You can use [**atexit**](http://docs.python.org/library/atexit.html) for thi...
[ 0.5692678689956665, -0.14143423736095428, 0.13206496834754944, -0.11666543036699295, 0.16688832640647888, -0.0020918312948197126, 0.032559700310230255, -0.13389794528484344, -0.32754772901535034, -0.5940978527069092, -0.10594514012336731, 0.513993501663208, -0.46212059259414673, 0.02932081...
for p in all_processes: # list of your processes ... p_sec = 0 ... for second in range(timeout_sec): ... if p.poll() == None: ... time.sleep(1) ... p_sec += 1 ... if p_sec >= timeout_sec: ...
[ -0.3290673792362213, -0.3935372829437256, 0.6591473817825317, -0.12434103339910507, 0.3160225749015808, 0.3165634870529175, 0.014914768747985363, -0.2871721386909485, -0.4575881063938141, -0.9251019358634949, -0.282515287399292, 0.3670071065425873, -0.2553199231624603, 0.008197520859539509...
p.kill() # supported from python 2.6 ... print 'cleaned up!' ... >>> >>> atexit.register(cleanup) >>> >>> sys.exit() cleaned up! ``` **Note** -- Registered functions won't be run if this process (parent process) is killed. **The following windows method is no longer needed for python >= 2.6** Here's a way to ki...
[ 0.2516639232635498, -0.04547315090894699, 0.22853589057922363, -0.025838308036327362, -0.2880435883998871, 0.15490388870239258, 0.10149937123060226, -0.169179305434227, -0.23618119955062866, -0.5944960713386536, -0.13094650208950043, 0.7866511940956116, -0.5193742513656616, 0.0059339748695...
import win32api import win32con hProc = None try: hProc = win32api.OpenProcess(win32con.PROCESS_TERMINATE, 0, pid) win32api.TerminateProcess(hProc, 0) except Exception: return False finally:
[ -0.27588534355163574, -0.012222821824252605, 0.3181639015674591, -0.0729234516620636, 0.11049845069646835, 0.31266164779663086, 0.34479108452796936, -0.1329028457403183, -0.12413383275270462, -0.14575745165348053, -0.4442952275276184, 0.6157556176185608, -0.5005148649215698, -0.07512316107...
if hProc != None: hProc.Close() return True ```
[ -0.0203180443495512, 0.4911061227321625, 0.8408895134925842, -0.37692123651504517, 0.3888581097126007, -0.10746684670448303, 0.1801411211490631, -0.15699590742588043, 0.0949273481965065, -0.10131016373634338, -0.5514283776283264, 0.86788409948349, -0.18037816882133484, 0.07595738023519516,...
I need to determine the number of pages in a specified PDF file using C# code (.NET 2.0). The PDF file will be read from the file system, and not from an URL. Does anyone have any idea on how this could be done? Note: Adobe Acrobat Reader is installed on the PC where this check will be carried out. You'll need a PDF AP...
[ 0.35712188482284546, 0.02446678653359413, 0.8427441716194153, 0.3510039150714874, -0.030146822333335876, -0.47153240442276, 0.02433505840599537, -0.15517589449882507, -0.11722855269908905, -0.7515102624893188, -0.2701328694820404, 0.6575050354003906, -0.1427784413099289, -0.093832716345787...
System.Text; using iTextSharp.text.pdf; using iTextSharp.text.xml; namespace GetPages_PDF { class Program { static void Main(string[] args) { // Right side of equation is location of YOUR pdf file string ppath = "C:\\aworking\\Hawkins.pdf"; PdfReader pdfReader = new PdfReader(ppath); ...
[ -0.5656004548072815, -0.07716482132673264, 1.0216437578201294, 0.10456753522157669, 0.2841418385505676, 0.1801610141992569, 0.2512764632701874, -0.19412627816200256, -0.3302157521247864, -0.5458890795707703, -0.5190216898918152, 0.3196437954902649, -0.383148729801178, 0.10879184305667877, ...
I have heard a few developers recently say that they are simply polling stuff (databases, files, etc.) to determine when something has changed and then run a task, such as an import. I'm really against this idea and feel that utilising available technology such as [Remoting](http://en.wikipedia.org/wiki/.NET_Remoting)...
[ 0.7850948572158813, 0.010463776998221874, 0.23835977911949158, 0.42142120003700256, -0.3398265838623047, -0.04197082668542862, -0.07089760899543762, -0.2794862687587738, 0.16770020127296448, -0.42046722769737244, 0.30889421701431274, 0.32644951343536377, -0.0607781708240509, -0.06939018517...