text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
luck.
[ -0.1403590738773346, 0.14579088985919952, 0.12334778159856796, 0.2704066038131714, 0.03971540927886963, 0.006741852033883333, 0.020454995334148407, 0.3605251610279083, -0.019123932346701622, -0.6011483669281006, 0.007794793229550123, 0.22391277551651, 0.36930522322654724, -0.04263369739055...
Is there a performance difference between `i++` and `++i` if the resulting value is not used? Executive summary: No. `i++` could potentially be slower than `++i`, since the old value of `i` might need to be saved for later use, but in practice all modern compilers will optimize this away. We can demonstrate this by l...
[ -0.12014777958393097, -0.0004975278279744089, 0.2856896221637726, -0.20461684465408325, 0.24041880667209625, 0.16289299726486206, 0.38135868310928345, -0.39744627475738525, -0.1800883263349533, -0.7048081159591675, -0.3335048258304596, 0.7821384072303772, -0.3229442834854126, 0.03180473670...
diff i++.c ++i.c 6c6 < for (i = 0; i < 100; i++) --- > for (i = 0; i < 100; ++i) ``` We'll compile them, and also get the generated assembler: ``` $ gcc -c i++.c ++i.c $ gcc -S i++.c ++i.c ``` And we can see that both the generated object and assembler files are the same. ``` $ md5 i++.s ++i.s MD5 (i++.s)...
[ -0.12699909508228302, 0.24446038901805878, 0.5641716718673706, 0.023039326071739197, -0.30032554268836975, 0.18857108056545258, 0.20870047807693481, -0.6713016033172607, 0.046057526022195816, -0.4199068248271942, 0.0006871506338939071, 0.734250545501709, -0.46092382073402405, 0.10974536091...
My colleagues are attempting to connect BizTalk 2006 R2 via DB2/MVS adapter to a database hosted on z/OS mainframe. When testing the connecting settings, they are getting the following error ``` Could not connect to data source 'New Data Source': The network connection was terminated because the host failed to send an...
[ -0.12600253522396088, 0.43319836258888245, 0.5244756937026978, -0.08881573379039764, -0.32370463013648987, -0.0389384888112545, 0.4986497163772583, 0.016912898048758507, -0.15592706203460693, -0.5813910365104675, -0.03323287144303322, 0.5207681059837341, -0.22182244062423706, 0.40533915162...
is used, the connection can be made and queries submitted. What this DB2 adapter is reporting is it cannot even make a proper connection handshake, let alone submitting queries. I am unsure of what are the actual mechanisms involved to make a DB2 connection happen. **25 Aug 08:** > According to [this MSDN forums post...
[ 0.17245224118232727, 0.06894267350435257, 0.3846522867679596, -0.02199307084083557, -0.27193668484687805, -0.29331174492836, 0.3855614960193634, -0.09139695018529892, -0.1652277261018753, -0.6139269471168518, -0.2693713307380676, 0.16994310915470123, -0.28637567162513733, 0.255036801099777...
Microsoft products, I undertook the task of inspecting raw network packets to get a clue what is going on between the .NET DB2 provider's connection (which works) and the BizTalk 2006 DB2 adapter (which bombs). I observed DB2 traffic is done using the DRDA protocol. And ultimately concluded the BizTalk adapter method f...
[ -0.17559365928173065, 0.16520145535469055, 0.22378793358802795, 0.10620462149381638, -0.2094390094280243, 0.09726309776306152, 0.4285880923271179, -0.1622888296842575, 0.05466659739613533, -0.21981815993785858, -0.2515422999858856, 0.4368998408317566, -0.27175354957580566, -0.1010295227169...
0... = Reserved: Not set .0.. = Chained: Not set ..0. = Continue: Not set ...0 = Same correlation: Not set DSS type: RPYDSS (2) CorrelId: 0 Length2: 49
[ 0.0318334586918354, -0.38318851590156555, 0.4330327808856964, 0.11442118138074875, 0.004530357196927071, -0.21289896965026855, 0.21666471660137177, -0.74144446849823, -0.10507293790578842, -0.04700104892253876, -0.06759804487228394, 0.36669689416885376, -0.3012677729129791, 0.3479954004287...
Code point: SECCHKRM (0x1219) Parameter (Severity Code) Length: 6 Code point: SVRCOD (0x1149) Data (ASCII): Data (EBCDIC): Parameter (Security Check Code) Length: 5 Code point: SECCHKCD (0x11a4) Data (ASCII): Data (EBCDIC):
[ -0.6720027327537537, 0.09749941527843475, 0.439269095659256, -0.012433180585503578, -0.09510388970375061, 0.19369468092918396, 0.06118062138557434, -0.34574878215789795, -0.3821556568145752, -0.4665463864803314, -0.5578649044036865, 0.09249832481145859, -0.3087930679321289, 0.4224303066730...
Parameter (Server Diagnostic Information) Length: 34 Code point: SRVDGN (0x1153) Data (ASCII): \304\331\304\301@\301\331z@\301\344\343\310\305\325\343\311\303\301\343\311\326\325@\206\201\211\223\205\204 Data (EBCDIC): DRDA AR: AUTHENTICATION failed ``` Why the same credentials fails h...
[ -0.4631267488002777, 0.054048292338848114, 0.6418042778968811, 0.1586841642856598, -0.05344129353761673, 0.527901291847229, 0.23645105957984924, -0.5772887468338013, -0.05188262090086937, -0.45191311836242676, 0.1207052618265152, 0.47656822204589844, -0.05557016655802727, 0.459670484066009...
Destination Protocol Info 1 0.000000 [client IP] [DB2 server IP] TCP kpop > 50000 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=1 2 0.000399 [DB2 server IP] [client IP]
[ -0.4729577600955963, -0.4750247299671173, 0.7084178328514099, 0.27802643179893494, -0.0815233662724495, 0.3166298270225525, 0.09490666538476944, 0.017039475962519646, -0.1955605298280716, -0.5837737321853638, -0.10547182708978653, -0.06516214460134506, -0.10523927956819534, 0.2489101439714...
TCP 50000 > kpop [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460 WS=0 3 0.000414 [client IP] [DB2 server IP] TCP kpop > 50000 [ACK] Seq=1 Ack=1 Win=65536 [TCP CHECKSUM INCORRECT] Len=0 4 0.000532 [client IP] [DB2 server IP]
[ -0.5187644362449646, -0.16428877413272858, 0.4084295928478241, 0.4277364909648895, -0.22731545567512512, 0.4503712058067322, 0.1077214851975441, -0.1415286660194397, -0.4694925844669342, -0.17512033879756927, -0.14538933336734772, -0.007456512656062841, -0.34441447257995605, 0.119078226387...
DRDA EXCSAT | ACCSEC 5 0.038162 [DB2 server IP] [client IP] DRDA EXCSATRD | ACCSECRD 6 0.041829 [client IP] [DB2 server IP] DRDA ACCSEC | SECCHK | ACCRDB
[ -0.6972395777702332, -0.230355367064476, 0.6003957390785217, -0.004929177928715944, -0.19746960699558258, 0.01795186661183834, -0.14220714569091797, 0.023996373638510704, -0.517475426197052, -0.3571382164955139, -0.5853404402732849, 0.37930917739868164, -0.5003969073295593, 0.1978120058774...
7 0.083626 [DB2 server IP] [client IP] TCP 50000 > kpop [ACK] Seq=108 Ack=542 Win=65535 Len=0 8 0.190534 [DB2 server IP] [client IP] DRDA ACCSECRD | SECCHKRM | ACCRDBRM | SQLCARD 9 0.199776 [client IP]
[ -0.47849375009536743, -0.15067313611507416, 0.49208512902259827, 0.2547450363636017, -0.33864420652389526, -0.08259487897157669, -0.0205693282186985, 0.0710340142250061, -0.45147767663002014, -0.06761634349822998, -0.40531831979751587, 0.3994244635105133, -0.3219372630119324, 0.28013566136...
[DB2 server IP] DRDA PRPSQLSTT | SQLATTR | SQLSTT | OPNQRY 10 0.293307 [DB2 server IP] [client IP] TCP [TCP segment of a reassembled PDU] 11 0.293359 [DB2 server IP] [client IP]
[ -0.2931756377220154, -0.01123694609850645, 0.27960070967674255, 0.1425590068101883, -0.3310345709323883, 0.23558339476585388, -0.03180745616555214, -0.11034330725669861, -0.2969554364681244, -0.3573090434074402, -0.44817692041397095, 0.0687757134437561, -0.3316210210323334, 0.3111457228660...
TCP [TCP segment of a reassembled PDU] 12 0.293377 [client IP] [DB2 server IP] TCP kpop > 50000 [ACK] Seq=870 Ack=1444 Win=64092 [TCP CHECKSUM INCORRECT] Len=0 13 0.293404 [DB2 server IP] [client IP] TCP
[ -0.11392184346914291, -0.26715418696403503, 0.35429608821868896, 0.32248976826667786, -0.11654243618249893, 0.29576611518859863, -0.026096545159816742, -0.09977977722883224, -0.42843344807624817, -0.24080927670001984, -0.20972102880477905, 0.08683086186647415, -0.3936828374862671, 0.225014...
[TCP segment of a reassembled PDU] 14 0.293452 [DB2 server IP] [client IP] TCP [TCP segment of a reassembled PDU] 15 0.293461 [client IP] [DB2 server IP] TCP kpop > 50000 [ACK] Seq=870 Ack=2516 Win=65536 [TCP CHECKSUM INCORRECT] Len=0
[ -0.21111544966697693, -0.1540534645318985, 0.2128111869096756, 0.4517361521720886, -0.14812453091144562, 0.38106828927993774, -0.05309714749455452, -0.07848305255174637, -0.4266433119773865, -0.2355649173259735, -0.2946073114871979, 0.17335662245750427, -0.23826003074645996, 0.209069550037...
16 0.293855 [DB2 server IP] [client IP] TCP [TCP segment of a reassembled PDU] 17 0.293908 [DB2 server IP] [client IP] DRDA SQLDARD 18 0.293918 [client IP] [DB2 server IP]
[ 0.09377849102020264, 0.025167495012283325, 0.2652099132537842, 0.13809125125408173, -0.3101795017719269, 0.14224950969219208, 0.0980224758386612, -0.39186885952949524, -0.25127503275871277, -0.38166216015815735, -0.26581162214279175, 0.08638957142829895, -0.34421879053115845, 0.19091717898...
TCP kpop > 50000 [ACK] Seq=870 Ack=3588 Win=64464 [TCP CHECKSUM INCORRECT] Len=0 19 0.293957 [DB2 server IP] [client IP] DRDA QRYDSC 20 0.294008 [DB2 server IP] [client IP] DRDA QRYDTA
[ -0.3108680248260498, -0.20900873839855194, 0.43716031312942505, 0.3528064787387848, -0.1591327041387558, 0.1362491399049759, 0.020611310377717018, -0.24885937571525574, -0.37553560733795166, -0.04637160897254944, -0.09273628145456314, 0.2523898184299469, -0.2638382017612457, 0.395907580852...
21 0.294017 [client IP] [DB2 server IP] TCP kpop > 50000 [ACK] Seq=870 Ack=4660 Win=65536 [TCP CHECKSUM INCORRECT] Len=0 22 0.294023 [DB2 server IP] [client IP] DRDA SQLCARD 23 0.295346 [client IP]
[ 0.09932167083024979, -0.0637228861451149, 0.20745228230953217, 0.2245914191007614, -0.47885701060295105, 0.20468200743198395, 0.20309162139892578, -0.46949097514152527, -0.2588708698749542, -0.04768035560846329, -0.18738412857055664, 0.13716545701026917, -0.14625786244869232, 0.17915198206...
[DB2 server IP] DRDA RDBCMM 24 0.297868 [DB2 server IP] [client IP] DRDA ENDUOWRM | SQLCARD 25 0.421392 [client IP] [DB2 server IP] DRDA PRPSQLSTT | SQLATTR |
[ -0.4385986328125, -0.09214533120393753, 0.5292168259620667, 0.039722759276628494, -0.4323761761188507, 0.09051124006509781, -0.07402095943689346, -0.2605632245540619, -0.2523300051689148, -0.2504410445690155, -0.4203910529613495, 0.14374259114265442, -0.2238028198480606, 0.3834012746810913...
SQLSTT | OPNQRY 26 0.456504 [DB2 server IP] [client IP] DRDA SQLDARD | OPNQRYRM | TYPDEFNAM | QRYDSC | QRYDTA | ENDQRYRM | TYPDEFNAM | SQLCARD 27 0.456756 [client IP] [DB2 server IP] DRDA RDBCMM 28 0.488311
[ -0.726100742816925, -0.07097803056240082, 0.5823198556900024, 0.08507660031318665, -0.369365930557251, 0.020002996549010277, -0.04219008609652519, -0.1813146471977234, -0.30435630679130554, -0.18415570259094238, -0.31805112957954407, 0.22633633017539978, -0.23609863221645355, 0.37820482254...
[DB2 server IP] [client IP] DRDA ENDUOWRM | SQLCARD 29 0.498806 [client IP] [DB2 server IP] DRDA PRPSQLSTT | SQLATTR | SQLSTT | OPNQRY 30 0.630477 [DB2 server IP] [client IP]
[ -0.6057283878326416, -0.10736021399497986, 0.5611065030097961, 0.13583070039749146, -0.35736122727394104, 0.2551937699317932, -0.0931055098772049, -0.11262238025665283, -0.3579273223876953, -0.2602377235889435, -0.4588729441165924, 0.14765062928199768, -0.14624646306037903, 0.3399541079998...
TCP 50000 > kpop [ACK] Seq=5157 Ack=1579 Win=65171 Len=0 31 0.788165 [DB2 server IP] [client IP] DRDA SQLDARD | OPNQRYRM | TYPDEFNAM | QRYDSC | QRYDTA 32 0.788203 [DB2 server IP] [client IP] DRDA ENDQRYRM
[ -0.5748655200004578, -0.18853482604026794, 0.5004023909568787, 0.3074108064174652, -0.20171292126178741, 0.21016459167003632, -0.12411433458328247, -0.1701439619064331, -0.4444138705730438, -0.1573876142501831, -0.14010675251483917, 0.23379942774772644, -0.34882932901382446, 0.441951811313...
33 0.788225 [client IP] [DB2 server IP] TCP kpop > 50000 [ACK] Seq=1579 Ack=5815 Win=64380 [TCP CHECKSUM INCORRECT] Len=0 34 0.788648 [client IP] [DB2 server IP] DRDA RDBCMM 35 0.795951 [DB2 server IP]
[ -0.26307886838912964, 0.030832583084702492, 0.12927654385566711, 0.13550904393196106, -0.33667102456092834, 0.2362084835767746, 0.1899351179599762, -0.3457251191139221, -0.36769455671310425, -0.03232753276824951, -0.1592823565006256, 0.2816401422023773, -0.1751384288072586, 0.2622673213481...
[client IP] DRDA ENDUOWRM | SQLCARD 36 0.807365 [client IP] [DB2 server IP] DRDA PRPSQLSTT | SQLATTR | SQLSTT | OPNQRY 37 0.838046 [DB2 server IP] [client IP] DRDA
[ -0.6699753999710083, -0.2106187492609024, 0.6197302341461182, 0.17262786626815796, -0.33985933661460876, 0.12891055643558502, -0.11820273846387863, -0.07781160622835159, -0.46172818541526794, -0.3825951814651489, -0.46550068259239197, 0.15969876945018768, -0.18160976469516754, 0.4535470902...
SQLDARD | OPNQRYRM | TYPDEFNAM | QRYDSC | QRYDTA | ENDQRYRM | TYPDEFNAM | SQLCARD 38 0.838328 [client IP] [DB2 server IP] DRDA RDBCMM 39 0.841866 [DB2 server IP] [client IP] DRDA ENDUOWRM | SQLCARD 40 0.973506
[ -0.9612871408462524, -0.017788097262382507, 0.611792802810669, -0.020596051588654518, -0.30534350872039795, -0.030025534331798553, -0.0009491213713772595, -0.3114607632160187, -0.24466107785701752, -0.3610386550426483, -0.21673405170440674, 0.16580215096473694, -0.2649850845336914, 0.46682...
[client IP] [DB2 server IP] TCP kpop > 50000 [ACK] Seq=1906 Ack=6304 Win=65482 [TCP CHECKSUM INCORRECT] Len=0 ``` BizTalk DB2 adapter ``` No. Time Source Destination Protocol Info 1 0.000000 [client IP]
[ -0.4335448145866394, 0.05963699519634247, 0.5763931274414062, 0.10782042890787125, -0.3329591751098633, 0.2168908715248108, 0.17907406389713287, -0.050313081592321396, -0.5376914739608765, -0.24270004034042358, -0.21630151569843292, 0.14642174541950226, -0.3225942850112915, 0.4808721542358...
[DB2 server IP] TCP 28165 > 50000 [SYN] Seq=0 Win=8192 Len=0 MSS=1460 WS=8 2 0.002587 [DB2 server IP] [client IP] TCP 50000 > 28165 [SYN, ACK] Seq=0 Ack=1 Win=16384 Len=0 MSS=1460 WS=0 3 0.010146 [client IP]
[ -0.40987828373908997, -0.04812463000416756, 0.18754439055919647, 0.17856553196907043, -0.4270745813846588, 0.4751030504703522, 0.17415347695350647, -0.2880193293094635, -0.41897380352020264, -0.1920299381017685, -0.21412314474582672, 0.18489834666252136, -0.30989041924476624, 0.16746586561...
[DB2 server IP] TCP 28165 > 50000 [ACK] Seq=1 Ack=1 Win=65536 Len=0 4 0.019698 [client IP] [DB2 server IP] DRDA EXCSAT 5 0.020849 [DB2 server IP] [client IP]
[ -0.2944847047328949, -0.06591065227985382, 0.28639113903045654, 0.11639809608459473, -0.35864266753196716, 0.13219185173511505, 0.15288834273815155, -0.12962321937084198, -0.3538740575313568, -0.24722938239574432, -0.4170847237110138, 0.28571340441703796, -0.2635010778903961, 0.31143897771...
DRDA EXCSATRD 6 0.034699 [client IP] [DB2 server IP] DRDA ACCSEC 7 0.036584 [DB2 server IP] [client IP] DRDA ACCSECRD 8 0.042031 [client IP]
[ -0.5976242423057556, -0.2672499418258667, 0.6616722345352173, -0.07823888957500458, -0.22602543234825134, 0.003627546364441514, -0.11908838897943497, 0.06903219223022461, -0.5513467788696289, -0.41752299666404724, -0.5958026051521301, 0.4575396478176117, -0.3515052795410156, 0.122007966041...
[DB2 server IP] DRDA SECCHK 9 0.046350 [DB2 server IP] [client IP] DRDA SECCHKRM 10 0.046642 [DB2 server IP] [client IP] TCP
[ -0.17821039259433746, -0.09074581414461136, 0.38910359144210815, 0.16055786609649658, -0.47815680503845215, 0.08010648936033249, 0.02928248420357704, -0.05199975147843361, -0.3314518630504608, -0.10477102547883987, -0.5149356722831726, 0.1289142668247223, -0.45350003242492676, 0.3741473257...
50000 > 28165 [FIN, ACK] Seq=160 Ack=200 Win=65336 Len=0 11 0.053787 [client IP] [DB2 server IP] TCP 28165 > 50000 [ACK] Seq=200 Ack=161 Win=65536 Len=0 12 0.056891 [client IP] [DB2 server IP] DRDA ACCRDB 13
[ -0.4912640452384949, -0.10067860782146454, 0.36316052079200745, 0.20553378760814667, -0.36089152097702026, 0.308719277381897, 0.04601725563406944, -0.33775821328163147, -0.521087110042572, -0.1909821629524231, -0.2981296479701996, 0.31387859582901, -0.11936074495315552, 0.11547992378473282...
0.058084 [DB2 server IP] [client IP] TCP 50000 > 28165 [RST, ACK] Seq=161 Ack=295 Win=0 Len=0 ``` It is interesting to witness the .NET provider issue out various DRDA protocol packets within in a single TCP segment. The BizTalk adapter on the other hand, places only one protocol packet per ...
[ 0.12129312753677368, -0.06904105097055435, 0.4504128396511078, 0.13367873430252075, -0.3807171583175659, -0.2747345566749573, 0.13033178448677063, -0.013640310615301132, -0.4705032706260681, -0.5175896286964417, -0.12229051440954208, 0.3793019652366638, -0.3738810122013092, 0.5196515917778...
the failure in authentication is in the DRDA data exchange. I do not know the DRDA protocol so will have to study it before I can make more sense of it. **18 Sep 08:** At this stage the problem is still not solved, as getting cooperation from the DB2 DBA team and help from Microsoft have been met with many obstacles....
[ -0.15077641606330872, 0.3543313145637512, 0.4498274326324463, 0.03141818195581436, -0.08287899196147919, -0.2397230565547943, 0.7893487811088562, -0.1574583500623703, -0.08706938475370407, -0.4392746686935425, -0.10996421426534653, 0.540610134601593, -0.15541183948516846, -0.07570085674524...
make use of **IBM DB2 ODBC DRIVER** or **IBM DB2 ODBC DRIVER – IBMCL1**. The IBM driver's parameter configuration is different from Microsoft's driver. But we do not see any obviously critical difference that may lead to a failed authentication for the Microsoft driver. Why, it certainly took Microsoft long enough to e...
[ -0.22788293659687042, 0.27193644642829895, 0.3615177273750305, 0.3089483380317688, 0.06325042992830276, -0.2106289267539978, 0.06046081334352493, 0.21883584558963776, -0.1007886454463005, -0.8809753656387329, -0.08399844914674759, 0.4665411412715912, -0.3222171664237976, 0.2703443765640259...
is due to legal restrictions. Technically it is possible to work a connection with DB2Connect, but IBM has made it a priorietary node and prevented other parties from legally establishing the correct DRDA sequence to connect to it.
[ -0.14012770354747772, -0.2392793893814087, 0.2622147500514984, 0.2545587122440338, 0.41483643651008606, -0.2769261300563812, 0.1705656349658966, 0.18942418694496155, 0.01250293105840683, -0.2849176228046417, -0.44341641664505005, 0.15121522545814514, -0.4297521710395813, 0.5207642912864685...
How to determine the applications associated with a particular extension (e.g. .JPG) and then determine where the executable to that application is located so that it can be launched via a call to say System.Diagnostics.Process.Start(...). I already know how to read and write to the registry. It is the layout of the r...
[ 0.4533311426639557, -0.08617406338453293, 0.40226832032203674, -0.004201211500912905, 0.13361001014709473, 0.11293034255504608, 0.08940286189317703, -0.37634655833244324, -0.2280525267124176, -0.6969901323318481, -0.30096665024757385, 0.4344550669193268, -0.39311978220939636, 0.14421892166...
static void Main(string[] args) { const string extPathTemplate = @"HKEY_CLASSES_ROOT\{0}"; const string cmdPathTemplate = @"HKEY_CLASSES_ROOT\{0}\shell\open\command"; // 1. Find out document type name for .jpeg files const string ext = ".jpeg"; var e...
[ 0.011349690146744251, -0.1029486358165741, 0.5732403993606567, -0.1820301115512848, -0.13630782067775726, 0.10626395791769028, 0.11367610096931458, 0.17579182982444763, -0.029414888471364975, -0.2465537190437317, -0.4394461512565613, 0.4336804449558258, -0.5804403424263, 0.1031304001808166...
var docName = Registry.GetValue(extPath, string.Empty, string.Empty) as string; if (!string.IsNullOrEmpty(docName)) { // 2. Find out which command is associated with our extension var associatedCmdPath = string.Format(cmdPathTemplate, docName);
[ 0.012159495614469051, -0.19891472160816193, 0.7842045426368713, -0.317340612411499, 0.36277008056640625, -0.05319450423121452, 0.29785385727882385, -0.2589733302593231, 0.1497327983379364, -0.4980216324329376, -0.35494738817214966, 0.7711835503578186, -0.383279412984848, 0.2716194987297058...
var associatedCmd = Registry.GetValue(associatedCmdPath, string.Empty, string.Empty) as string; if (!string.IsNullOrEmpty(associatedCmd)) { Console.WriteLine("\"{0}\" command is associated with {1} extension", associatedCmd, ext);
[ -0.39001455903053284, -0.31604820489883423, 0.7819473743438721, -0.44616052508354187, 0.4730941951274872, 0.1693865954875946, 0.2541827857494354, -0.3067820072174072, 0.09127975255250931, -0.3174082636833191, -0.2771650552749634, 0.6975964307785034, -0.46606194972991943, 0.197977215051651,...
} } } } } ```
[ -0.05286634340882301, 0.46233952045440674, 0.26861345767974854, -0.21428057551383972, 0.3945882022380829, -0.2074044644832611, 0.11799322813749313, 0.3477530777454376, 0.20242395997047424, -0.5250234007835388, -0.36778154969215393, 0.5970296263694763, -0.3366963565349579, 0.345072776079177...
I am currently learning OLAP & MDX after many years of relational database development. Any tips on getting started in MDX? What are the best books and resources to learn MDX? A classic, albeit a bit dated, book is [Fast Track to MDX](https://rads.stackoverflow.com/amzn/click/com/1846281741). It's a great overview an...
[ 0.0813799649477005, 0.10940254479646683, 0.20715700089931488, 0.017863215878605843, 0.13715235888957977, -0.17533931136131287, 0.07278351485729218, 0.20956063270568848, -0.18043088912963867, -0.6801279783248901, -0.07273106276988983, 0.3299161493778229, 0.3866969048976898, 0.06358808279037...
I have defined a Java function: ``` static <T> List<T> createEmptyList() { return new ArrayList<T>(); } ``` One way to call it is like so: ``` List<Integer> myList = createEmptyList(); // Compiles ``` Why can't I call it by explicitly passing the generic type argument? : ``` Object myObject = createEmtpyList...
[ 0.14368309080600739, 0.0835486352443695, 0.31513577699661255, -0.38491013646125793, -0.17332689464092255, -0.2217690497636795, 0.20878984034061432, -0.5362237691879272, -0.0843852162361145, -0.5937463045120239, 0.010775333270430565, 0.36361631751060486, -0.5976454019546509, 0.1270206719636...
I have a WCF Web Service which is referenced from a class library. After the project is run, when creating the service client object from inside a class library, I receive an InvalidOperationException with message: > Could not find default endpoint element that references contract > 'MyServiceReference.IMyService' in...
[ -0.010216742753982544, 0.30460038781166077, 0.6738254427909851, -0.224370077252388, 0.01978159137070179, -0.15907138586044312, 0.33559897541999817, -0.49675488471984863, 0.04303982853889465, -1.0165996551513672, 0.18538926541805267, 0.4768665134906769, -0.3941570520401001, 0.37364840507507...
this? Note: I have a seperate console application which simply creates the same service object and makes calls to it and it works without no problems. > Here is my app.config file of the class library: You should put this configuration settings to main app's config file. .NET application (which is calling your class ...
[ 0.11673864722251892, -0.05039038881659508, 0.21948423981666565, 0.160592719912529, 0.0432472787797451, 0.017408033832907677, 0.22816742956638336, 0.10707291960716248, 0.048775795847177505, -0.9920604228973389, -0.08033982664346695, 0.5792475938796997, -0.4876965284347534, 0.092190012335777...
What's the easiest way to convert a percentage to a color ranging from Green (100%) to Red (0%), with Yellow for 50%? I'm using plain 32bit RGB - so each component is an integer between 0 and 255. I'm doing this in C#, but I guess for a problem like this the language doesn't really matter that much. Based on Marius a...
[ 0.09708911925554276, 0.28902336955070496, 0.14983566105365753, -0.05231689289212227, 0.0764143243432045, 0.3303050398826599, 0.014349893666803837, -0.43139588832855225, -0.19676382839679718, -0.45500147342681885, 0.03281337395310402, 0.6959683895111084, -0.019661977887153625, -0.0988293364...
- Only adjustment I had to make from Marius solution was to use 256, as (255 - (percent - 50) \* 5.12 yield -1 when 100%, resulting in Yellow for some reason in Silverlight (-1, 255, 0) -> Yellow ... I made this function in JavaScript. It returns the color is a css string. It takes the percentage as a variable, with a ...
[ 0.1734352707862854, 0.03976680710911751, 0.367053359746933, -0.2153514325618744, -0.17712309956550598, 0.4918646812438965, 0.09894169867038727, -0.5838482975959778, 0.13617898523807526, -0.4376146197319031, 0.06221534311771393, 0.5737317204475403, -0.2576761245727539, -0.0782252699136734, ...
return "rgb(" + red + "," + green + ",0)"; } ```
[ -0.015511619858443737, 0.33782145380973816, 0.13857588171958923, -0.40160390734672546, 0.1681152731180191, 0.010975563898682594, 0.11641939729452133, -0.25868600606918335, -0.06128455698490143, -0.2263210415840149, -0.46223726868629456, 0.7764095067977905, -0.39238816499710083, 0.208905249...
Using CSS, I'm trying to specify the height of a `span` tag in Firefox, but it's just not accepting it (IE does). Firefox accepts the `height` if I use a `div`, but the problem with using a `div` is the annoying line break after it, which I can't have in this particular instance. I tried setting the CSS style attri...
[ 0.15126407146453857, -0.030797308310866356, 0.7152947783470154, -0.13985112309455872, -0.31889286637306213, -0.07377764582633972, 0.01670357771217823, -0.2756496071815491, -0.28704801201820374, -0.595947265625, -0.2270079404115677, 0.48961442708969116, -0.2676085829734802, -0.1677347272634...
holding `div's` 1 and 2 is wide enough for them to fit, this should be fine.
[ 0.26289102435112, 0.39892005920410156, 0.5486189126968384, -0.1816837191581726, 0.07694368809461594, -0.138784721493721, -0.1839255839586258, -0.34138962626457214, -0.34999391436576843, -0.47319820523262024, -0.014332623220980167, 0.6331077814102173, -0.14469844102859497, 0.052295591682195...
I did a lot of PHP programming in the last years and one thing that keeps annoying me is the weak support for Unicode and multibyte strings (to be sure, natively there is none). For example, "htmlentities" seems to be a much used function in the PHP world and I found it to be absolutely annoying when you've put an effo...
[ 0.07057731598615646, 0.42413902282714844, -0.019355937838554382, -0.02026662416756153, -0.4069957733154297, -0.20076708495616913, 0.5599560737609863, 0.6906100511550903, -0.18863935768604279, -0.6869713068008423, 0.05418335273861885, 0.3206690549850464, -0.22197359800338745, 0.282270640134...
would just *love* to just dump this kind of functions, they seem totally superfluous. **Is it still necessary these days to write '&auml;' instead of 'ä'?** At least my Firefox seems perfectly happy to display even the strangest Asian glyphs as long as they're served in a proper encoding. **Update:** To be more precis...
[ 0.1973057985305786, 0.368994802236557, 0.25752952694892883, 0.010469337925314903, -0.15818220376968384, -0.08097562938928604, 0.4688584804534912, 0.16542185842990875, -0.17261026799678802, -0.2914030849933624, -0.4150400757789612, 0.1840987503528595, 0.06998853385448456, -0.032789215445518...
such issues? (assuming of course, that reliable sanitizing on input is possible - but then, if it isn't, can it be on output?) Named entities in "real" XHTML (i.e. with `application/xhtml+xml`, rather than the more frequently-used `text/html` compatibility mode) are discouraged. Aside from the five defined in XML itsel...
[ 0.1628316193819046, 0.4711982309818268, 0.22398751974105835, 0.009369051083922386, -0.012624598108232021, -0.22351676225662231, 0.28526583313941956, -0.16298997402191162, -0.2389688938856125, -0.4062226414680481, -0.6290616989135742, 0.5419138073921204, -0.29905036091804504, 0.008776019327...
Unicode character. As for whether you need entities at all these days: you can pretty much expect any modern browser to support UTF-8. Therefore, as long as you can guarantee that the database, the markup and the web server all agree to serve that, ditch the entities.
[ -0.16580288112163544, 0.15179939568042755, 0.1645914614200592, 0.20878343284130096, -0.14294882118701935, 0.034952562302351, 0.11264852434396744, 0.23786026239395142, -0.11658357083797455, -0.685151994228363, -0.4382649064064026, 0.349000483751297, -0.29608723521232605, -0.1375297904014587...
I'm rewriting an old application and use this as a good opportunity to try out C# and .NET development (I usually do a lot of plug-in stuff in C). The application is basically a timer collecting data. It has a start view with a button to start the measurement. During the measurement the app has five different views de...
[ 0.5788387656211853, -0.06140583008527756, 0.34695613384246826, 0.21237215399742126, 0.04966489598155022, 0.19798676669597626, -0.0942593514919281, -0.3628369867801666, -0.05536046251654625, -0.5479291081428528, 0.39523985981941223, 0.4197252094745636, -0.01702764816582203, -0.1311549395322...
Use six separate forms Creating a bunch of overlaid panels is a design-time nightmare. I would suggest using a tab control with each "view" on a separate tab, and then picking the correct tab at runtime. You can avoid showing the tab headers by putting something like this in your form's Load event: ``` tabControl1.To...
[ 0.25602853298187256, -0.3825318217277527, 0.7178196907043457, 0.09957350790500641, -0.16944469511508942, 0.07207349687814713, 0.30509263277053833, -0.41913673281669617, -0.26417237520217896, -0.9717692136764526, -0.12838278710842133, 0.33342766761779785, -0.37659546732902527, 0.16738389432...
I've used the PHP MVC framework Symfony to build an on-demand web app. It has an annoying bug - the session expires after about 15-30 minutes of inactivity. There is a config directive to prevent session expiration but it does not work. Even workarounds such as [this one](http://robrosenbaum.com/php/howto-disable-sess...
[ 0.2195984274148941, 0.22756461799144745, 0.6808863282203674, -0.026678187772631645, 0.2646760642528534, -0.5295409560203552, 0.6689843535423279, 0.11241407692432404, -0.2660101652145386, -0.3525714576244354, -0.13588955998420715, 0.593643069267273, -0.1801573485136032, -0.02497205510735511...
make sure that the action invoked does reset the session timer (things like ajax field completion don't do this on their own).
[ 0.08143231272697449, -0.16829076409339905, -0.19556230306625366, 0.1770259588956833, 0.09830467402935028, -0.5549773573875427, 0.5505416989326477, 0.13756103813648224, -0.1120099276304245, -0.5546254515647888, -0.2114240825176239, 0.8812036514282227, 0.017008066177368164, -0.56961297988891...
I don't like the AutoSize property of the Label control. I have a custom Label that draws a fancy rounded border among other things. I'm placing a `AutoSize = false` in my constructor, however, when I place it in design mode, the property always is True. I have overridden other properties with success but this one is...
[ 0.43541958928108215, 0.30152225494384766, 0.46619319915771484, -0.11558188498020172, -0.05327780172228813, -0.09071172028779984, 0.5223826169967651, -0.2051968276500702, -0.023339316248893738, -0.6616679430007935, -0.033064328134059906, 0.7440792322158813, -0.3714500069618225, 0.3887061178...
public partial class RoundedLabel : UserControl { private static readonly Color DEFAULT_BORDER_COLOR = Color.FromArgb( 132, 100, 161 ); private const float DEFAULT_BORDER_WIDTH = 2.0F; private const int DEFAULT_ROUNDED_WIDTH = 16; private const int DEFAULT_ROUNDED_HEIGHT = 12; ...
[ -0.3029847741127014, -0.16502249240875244, 0.5225576758384705, -0.16472697257995605, 0.08016397804021835, 0.6107644438743591, 0.19066573679447174, -0.16446924209594727, -0.07561139762401581, -0.4324428141117096, -0.3702479302883148, 0.8154844641685486, -0.028810987249016762, 0.265795409679...
mRoundedWidth = DEFAULT_ROUNDED_WIDTH; private int mRoundedHeight = DEFAULT_ROUNDED_HEIGHT; public event EventHandler TextClick; private Padding mPadding = new Padding(8); public RoundedLabel() { InitializeComponent(); } public Cursor TextCursor ...
[ -0.6744409799575806, -0.31737038493156433, 0.8303300142288208, -0.23475104570388794, -0.1979314386844635, 0.25904688239097595, 0.06188444048166275, -0.282824844121933, -0.3443598449230194, -0.08762028813362122, -0.2722809612751007, 0.8237544894218445, -0.18040747940540314, 0.06809506565332...
get { return lblText.Cursor; } set { lblText.Cursor = value; } } public Padding TextPadding { get { return mPadding; } set {
[ -0.5884573459625244, -0.4934099018573761, 0.8443597555160522, -0.1871011108160019, 0.11301376670598984, 0.341390460729599, -0.06450273841619492, -0.27964499592781067, -0.2820456326007843, -0.6613864302635193, -0.4653153419494629, 0.7774936556816101, -0.6229815483093262, -0.3365736305713653...
mPadding = value; UpdateInternalBounds(); } } public ContentAlignment TextAlign { get { return lblText.TextAlign; } set { lblText.TextAlign = value; }
[ -0.27408015727996826, -0.4097963869571686, 0.6803176999092102, -0.11227404326200485, 0.02347196452319622, 0.12551066279411316, 0.40934136509895325, -0.19799627363681793, -0.32915496826171875, -0.62117999792099, -0.7031363248825073, 0.49768948554992676, -0.5277605056762695, 0.18645054101943...
} public string TextString { get { return lblText.Text; } set { lblText.Text = value; } } public override Font Font { get { return base.Font; }
[ 0.015574628487229347, -0.13755789399147034, 0.48189157247543335, -0.2602671682834625, 0.08425825089216232, 0.16339871287345886, 0.27063092589378357, -0.2538204789161682, 0.26471617817878723, -0.5693568587303162, -0.3806156516075134, 0.7276014685630798, -0.2972438335418701, -0.0388636440038...
set { base.Font = value; lblText.Font = value; } } public override Color ForeColor {
[ 0.2676087021827698, -0.403678834438324, 0.4206819236278534, -0.19562914967536926, 0.3575200140476227, 0.0002460730611346662, 0.1657547652721405, -0.3701702654361725, 0.2919103801250458, -0.5987768173217773, -0.377758264541626, 0.7675182223320007, -0.55733722448349, 0.042069677263498306, ...
get { return base.ForeColor; } set { base.ForeColor = value; lblText.ForeColor = value; } }
[ -0.05288615822792053, -0.3245665729045868, 0.4015341103076935, -0.2077447474002838, 0.2952702045440674, 0.25527676939964294, 0.307478666305542, -0.4052544832229614, -0.005930720828473568, -0.41929367184638977, -0.5091074705123901, 0.5702092051506042, -0.357631653547287, -0.194679394364357,...
public Color BorderColor { get { return mBorderColor; } set { mBorderColor = value; Invalidate(); }
[ 0.14516009390354156, -0.20944494009017944, 0.5112634897232056, -0.2124299556016922, 0.38128969073295593, 0.11842592805624008, 0.3501281142234802, -0.17176538705825806, -0.056684304028749466, -0.541089653968811, -0.30053195357322693, 0.48857027292251587, -0.6883252859115601, 0.3463115394115...
} [DefaultValue(DEFAULT_BORDER_WIDTH)] public float BorderWidth { get { return mBorderWidth; } set { mBorderWidth = value;
[ 0.13085561990737915, -0.17358194291591644, 0.7014817595481873, -0.2762022018432617, 0.45776838064193726, -0.022994615137577057, 0.23184719681739807, -0.19095198810100555, -0.027192678302526474, -0.39583709836006165, -0.17531763017177582, 0.806244969367981, -0.14884072542190552, 0.103907443...
Invalidate(); } } [DefaultValue(DEFAULT_ROUNDED_WIDTH)] public int RoundedWidth { get { return mRoundedWidth; } set {
[ -0.22678712010383606, -0.12077343463897705, 0.5645765066146851, -0.13993504643440247, -0.2898760139942169, 0.2205076664686203, 0.3552846610546112, -0.24741297960281372, -0.25765305757522583, -0.16317066550254822, -0.31146174669265747, 0.6236569881439209, -0.003018653020262718, 0.2205014079...
mRoundedWidth = value; Invalidate(); } } [DefaultValue(DEFAULT_ROUNDED_HEIGHT)] public int RoundedHeight { get { return mRoundedHeight; }
[ -0.10660185664892197, -0.16587980091571808, 0.742199718952179, -0.19799667596817017, -0.09209952503442764, 0.2634688913822174, 0.3604733347892761, -0.13709533214569092, -0.14868830144405365, 0.09101209044456482, -0.05479830130934715, 0.774207592010498, 0.1829594522714615, 0.214735925197601...
set { mRoundedHeight = value; Invalidate(); } } private void UpdateInternalBounds() { lblText.Left = mPadding.Left;
[ 0.06250733137130737, -0.3453819751739502, 0.49482154846191406, -0.1965886354446411, 0.3865039348602295, 0.07611337304115295, 0.36471933126449585, -0.23547790944576263, -0.09694073349237442, -0.14601637423038483, -0.4821380078792572, 0.6569307446479797, -0.7075605988502502, 0.17052903771400...
lblText.Top = mPadding.Top; int width = Width - mPadding.Right - mPadding.Left; lblText.Width = width > 0 ? width : 0; int heigth = Height - mPadding.Bottom - mPadding.Top; lblText.Height = heigth > 0 ? heigth : 0; }
[ -0.4723225235939026, -0.21296001970767975, 0.6943272948265076, -0.3973305821418762, 0.05159023031592369, 0.4118736684322357, 0.19304901361465454, -0.6044784784317017, -0.37137916684150696, -0.3346520662307739, -0.6434901356697083, 0.7136143445968628, -0.23088335990905762, -0.20137690007686...
protected override void OnLoad(EventArgs e) { UpdateInternalBounds(); base.OnLoad(e); } protected override void OnPaint(PaintEventArgs e) { SmoothingMode smoothingMode = e.Graphics.SmoothingMode; e.Graphics.SmoothingMode = SmoothingMode.An...
[ -0.33806338906288147, -0.6131918430328369, 0.417992502450943, -0.05197501927614212, 0.15087422728538513, 0.1726495772600174, 0.5578629970550537, -0.4456567168235779, 0.23590172827243805, -0.6236914396286011, -0.30875852704048157, 0.7712689638137817, -0.4647340178489685, -0.0407218858599662...
int roundedWidth = RoundedWidth > (Width - 1)/2 ? (Width - 1)/2 : RoundedWidth; int roundedHeight = RoundedHeight > (Height - 1)/2 ? (Height - 1)/2 : RoundedHeight; GraphicsPath path = new GraphicsPath(); path.AddLine(0, roundedHeight, 0, Height - 1 - roundedHeight); pat...
[ -0.3987519443035126, -0.31516033411026, 0.7754393815994263, -0.29590749740600586, -0.3514076769351959, 0.4359029233455658, 0.10005252063274384, -0.32589444518089294, -0.2707970440387726, -0.4815688133239746, -0.23595550656318665, 0.5394408702850342, 0.08741898834705353, -0.2436235249042511...
1 - 2*roundedHeight, 2*roundedWidth, 2*roundedHeight), 180, -90); path.AddLine(roundedWidth, Height - 1, Width - 1 - 2*roundedWidth, Height - 1); path.AddArc(new RectangleF(Width - 1 - 2*roundedWidth, Height - 1 - 2*roundedHeight, 2*roundedWidth, 2*roundedHeight), 90, -90); path.AddL...
[ -0.2536954879760742, 0.04579564183950424, 0.7523934841156006, -0.20775407552719116, -0.36133500933647156, 0.6180073618888855, -0.06993946433067322, -0.4823824465274811, -0.4011017084121704, -0.6482516527175903, -0.39103013277053833, 0.1993492841720581, 0.08115335553884506, -0.0851840078830...
-90); path.AddLine(Width - 1 - roundedWidth, 0, roundedWidth, 0); path.AddArc(new RectangleF(0, 0, 2*roundedWidth, 2*roundedHeight), -90, -90); e.Graphics.DrawPath(new Pen(new SolidBrush(BorderColor), BorderWidth), path); e.Graphics.SmoothingMode = smoothingMode; ...
[ -0.3641186058521271, -0.6367589235305786, 0.9086880087852478, -0.09214356541633606, 0.23011088371276855, 0.36772072315216064, 0.19922392070293427, -0.5171319842338562, -0.1186448410153389, -0.7618550062179565, -0.209426611661911, 0.6413695216178894, -0.17293284833431244, -0.076484270393848...
{ UpdateInternalBounds(); base.OnResize(e); } private void lblText_Click(object sender, EventArgs e) { if (TextClick != null) {
[ -0.11861694604158401, -0.4203922748565674, 0.4853314459323883, -0.2375466227531433, 0.4301469922065735, 0.010622245259582996, 0.6165134310722351, -0.09587423503398895, 0.10716743022203445, -0.3092586100101471, -0.4511028230190277, 0.9160296320915222, -0.46564099192619324, 0.154701426625251...
TextClick(this, e); } } } } ``` (there are some issues with Stack Overflow's markup and the Underscore, but it's easy to follow the code). --- I have actually removed that override some time ago when I saw that it wasn't working. I'll add it again now and test. Basically I want to replace th...
[ 0.1489492654800415, -0.07336118072271347, 0.5468437671661377, -0.2116374373435974, 0.07329685240983963, -0.21886315941810608, 0.5466576218605042, 0.19442199170589447, 0.014464974403381348, -0.663600742816925, -0.14466583728790283, 1.0370646715164185, -0.5286604166030884, 0.1473304480314254...
the constructor of the form itself. They seem to revert back to their design-time defaults. I notice you're already overriding the OnLoad method. Have you tried setting AutoSize = false there? Or are you mainly concerned with providing a *default* value of false?
[ 0.47328537702560425, 0.10446189343929291, 0.06596950441598892, 0.008572421967983246, -0.04720345884561539, -0.14056681096553802, 0.4788249433040619, 0.04415511339902878, -0.08710615336894989, -0.3300337493419647, 0.11764699965715408, 0.7963045835494995, -0.33278608322143555, 0.080595999956...
I have a postgres database with a user table (userid, firstname, lastname) and a usermetadata table (userid, code, content, created datetime). I store various information about each user in the usermetadata table by code and keep a full history. so for example, a user (userid 15) has the following metadata: ``` 15, 'Q...
[ 0.18779872357845306, 0.5925822257995605, 0.5105997323989868, 0.0614716112613678, 0.013508781790733337, 0.25886407494544983, 0.39551520347595215, -0.1515689194202423, -0.017211493104696274, -0.5454566478729248, -0.09848872572183609, 0.37266233563423157, 0.03891490027308464, 0.24392578005790...
was, of course godawful slow. The best I could figure out to do it in SQL was to join sub-selects, which were also slow and I had to do one for each code. I suppose you're not willing to modify your schema, so I'm afraid my answe might not be of much help, but here goes... One possible solution would be to have the ti...
[ -0.08887884765863419, -0.09479036927223206, 0.3042146861553192, 0.021271485835313797, 0.13136862218379974, 0.24679803848266602, -0.03628886491060257, 0.1526777297258377, -0.15022438764572144, -0.3648596405982971, 0.22945968806743622, 0.21596352756023407, -0.0437004379928112, 0.398734450340...
be to have both 'Valid-From' and 'Valid-To' fields where the 'Valid-To' fields are blank until some other entry becomes valid. This can be handled easily by using triggers or similar. Using constraints to make sure there is only one item of each type that is valid will ensure data integrity. Common to these is that th...
[ 0.651050865650177, -0.32310327887535095, 0.24733352661132812, 0.11826227605342865, 0.1896131932735443, -0.15787279605865479, 0.10476149618625641, -0.14920517802238464, -0.003575724782422185, -0.3365667462348938, -0.49412310123443604, 0.4694329798221588, -0.21754741668701172, 0.381159454584...
and the article [A consensus glossary of temporal database concepts](http://www.cs.arizona.edu/~rts/pubs/SIGMODRecordMarch94p52.pdf).
[ -0.13912105560302734, 0.06576378643512726, 0.12554912269115448, 0.17997536063194275, -0.039806295186281204, 0.11722172051668167, 0.0717231035232544, -0.1880468875169754, -0.4232976734638214, -0.21527689695358276, -0.49009087681770325, 0.30370911955833435, 0.18208739161491394, 0.39267292618...
I'm using [Zend Studio](http://www.zend.com/en/products/studio/) to do remote debugging of my php scripts on a dev server. It works great for web code, but can I make it work with command line scripts? I have several helper apps to make my application run. It would be really useful to fire up the remote debugger throu...
[ 0.7307555675506592, 0.24578368663787842, -0.13097698986530304, 0.240182563662529, -0.46550339460372925, -0.3821408748626709, 0.2571598291397095, 0.028472546488046646, -0.07882164418697357, -0.680858850479126, 0.20982952415943146, 0.542681097984314, 0.05285382270812988, 0.34744784235954285,...
I'd need to tap into that? *UPDATE* I ended up using xdebug with [protoeditor](http://protoeditor.sourceforge.net/) over X to do my debugging. I was able to get [remote CLI debugging working in Eclipse](http://thenazg.blogspot.com/2008/12/remote-cli-debugging-via-eclipse-pdt.html), using xdebug, though I've not tried...
[ 0.37625691294670105, 0.08309288322925568, 0.02417244203388691, -0.07835184782743454, -0.2546137869358063, -0.30737271904945374, -0.0015781481051817536, 0.07689902931451797, -0.12288278341293335, -0.3732665777206421, 0.11169376224279404, 0.6746665835380554, -0.2570897936820984, -0.097190663...
What is a good complete [regular expression](http://en.wikipedia.org/wiki/Regular_expression) or some other process that would take the title: > How do you change a title to be part of the URL like Stack Overflow? and turn it into ```none how-do-you-change-a-title-to-be-part-of-the-url-like-stack-overflow ``` tha...
[ 0.2412642240524292, 0.29281967878341675, 0.2579837739467621, -0.15048186480998993, 0.15580123662948608, -0.45869362354278564, 0.33329862356185913, 0.04315343499183655, -0.013948166742920876, -0.36181339621543884, -0.19806893169879913, 0.5811113119125366, -0.07920929044485092, -0.0384568348...
know how to alter the string to all special characters are removed, it's all lowercase, and all whitespace is replaced. Here's how we do it. Note that there are probably more edge conditions than you realize at first glance. This is the second version, unrolled for 5x more performance (and yes, I benchmarked it). I fi...
[ 0.4601466953754425, -0.004164832644164562, 0.6746852993965149, 0.08167512714862823, 0.45740175247192383, -0.41174671053886414, 0.21230961382389069, -0.24108323454856873, -0.021205954253673553, -0.7195703387260437, -0.1252651810646057, 0.754422664642334, -0.2900172472000122, 0.0092233186587...
(title == null) return ""; const int maxlen = 80; int len = title.Length; bool prevdash = false; var sb = new StringBuilder(len); char c; for (int i = 0; i < len; i++) { c = title[i]; if ((c >= 'a' && c <= 'z') || (c >= '0' && c <= '9')) {
[ 0.26672130823135376, -0.3730160593986511, 0.522800087928772, -0.2094929963350296, 0.1809205710887909, 0.11599957942962646, 0.6831901669502258, -0.5647712349891663, -0.10644755512475967, -0.1235518530011177, -0.6084439754486084, 0.6720167398452759, -0.07713156193494797, 0.5618648529052734, ...
sb.Append(c); prevdash = false; } else if (c >= 'A' && c <= 'Z') { // tricky way to convert to lowercase sb.Append((char)(c | 32)); prevdash =
[ 0.3801034688949585, 0.10792766511440277, 0.304023802280426, -0.5115931630134583, -0.047957200556993484, 0.3351982831954956, 0.5768929123878479, -0.8612179160118103, 0.09765835106372833, -0.22418895363807678, -0.24490655958652496, 0.2628012001514435, -0.6109691262245178, 0.09764247387647629...
false; } else if (c == ' ' || c == ',' || c == '.' || c == '/' || c == '\\' || c == '-' || c == '_' || c == '=') { if (!prevdash && sb.Length > 0) {
[ 0.3353167772293091, -0.09833258390426636, 0.2194257378578186, -0.3719259202480316, 0.33745014667510986, -0.34069007635116577, 0.7759692668914795, -0.6585240364074707, 0.3711817264556885, -0.14188897609710693, -0.31748443841934204, 0.6558523178100586, -0.24314150214195251, 0.190161839127540...
sb.Append('-'); prevdash = true; } } else if ((int)c >= 128) { int prevlen = sb.Length; sb.Append(RemapInternationalCharToAscii(c));
[ 0.3548235297203064, -0.12563779950141907, 0.778200089931488, -0.40832507610321045, 0.18601714074611664, 0.11647786945104599, 0.6997706294059753, -0.960383415222168, -0.07412417978048325, -0.37585437297821045, -0.46203744411468506, 0.3959153890609741, -0.36952999234199524, 0.240761086344718...
if (prevlen != sb.Length) prevdash = false; } if (i == maxlen) break; } if (prevdash) return sb.ToString().Substring(0, sb.Length - 1); else return sb.ToString(); } ``` To see the previous version of the code this replaced (but is functionally equivalent to, and 5x faster)...
[ 0.3626742660999298, -0.24599121510982513, 0.5521857142448425, -0.387828528881073, 0.14703258872032166, -0.10083349049091339, 0.6207367181777954, -0.5982581973075867, -0.2818946838378906, -0.36697471141815186, -0.4049747884273529, 0.37324896454811096, -0.11913423985242844, 0.366813838481903...
`RemapInternationalCharToAscii` method source code can be found [here](https://meta.stackexchange.com/a/7696).
[ 0.12270102649927139, 0.12152303755283356, 0.6736999154090881, -0.023973653092980385, 0.17841476202011108, -0.2930850684642792, 0.533614993095398, -0.5028882026672363, -0.2088940590620041, -0.08319412916898727, -0.37929269671440125, 0.3542751371860504, -0.25962337851524353, 0.00647906074300...
I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma. What would be, in your opinion, the best way to do this using C#.NET 2.0? Why not: ``` string s = "foobar\ngork"; string v = s.Replace(Environment.NewLine,","...
[ 0.3745461106300354, 0.10697340220212936, 0.5580469369888306, -0.2321266084909439, 0.337303102016449, -0.04898311197757721, 0.1436864286661148, -0.10076063126325607, -0.2021237462759018, -0.4166110157966614, -0.059922002255916595, 0.6526567935943604, -0.4488683044910431, 0.10642248392105103...
I want to be able to make an HTTP call updating some select boxes after a date is selected. I would like to be in control of updating the textbox so I know when there has been a "true" change (in the event the same date was selected). Ideally, I would call a function to pop-up the calendar and be able to evaluate the d...
[ 0.35282862186431885, -0.3450271785259247, 0.3759346008300781, -0.060623299330472946, -0.16233471035957336, -0.12928645312786102, -0.15701262652873993, -0.18372619152069092, -0.31827083230018616, -0.38034602999687195, -0.08614964038133621, 0.30549895763397217, -0.20125065743923187, 0.017529...
range selection and a variety of other incredibly useful options, I've found that it meets all my needs. The fact that I sit next to one of its maintainers here at work is also fairly useful...
[ 0.6301636099815369, 0.26677045226097107, 0.13130494952201843, -0.07710711658000946, 0.0727243423461914, 0.07465878129005432, -0.17058958113193512, -0.06389310210943222, -0.11749392747879028, -0.5122495889663696, 0.000531278841663152, 0.9811000823974609, 0.43738698959350586, -0.259306520223...
I've read that Lambda Expressions are an incredibly powerful addition to C#, yet I find myself mystified by them. How can they improve my life or make my code better? Can anyone point to a good resource for learning such expressions? They seem cool as hell, but how do they relate to my day-to-day life as an asp.net de...
[ 0.38517531752586365, 0.24015134572982788, -0.37533116340637207, 0.22413960099220276, -0.22494807839393616, 0.09219726920127869, 0.3444660007953644, 0.15580232441425323, -0.2869393229484558, -0.3036331832408905, -0.09417611360549927, 0.5718987584114075, -0.16332899034023285, -0.085011132061...
expressions useful for anything other than querying Lamba expressions are nothing much other than a convenient way of writing a function 'in-line'. So they're useful any place you wanted a bit of code which can be called as though it's a separate function but which is actually written inside its caller. (In addition ...
[ 0.3426169753074646, -0.09693720191717148, 0.06694472581148148, 0.11882811784744263, -0.5769667029380798, 0.052587009966373444, 0.25676530599594116, -0.2254326194524765, -0.3805837035179138, -0.03868032619357109, -0.10500853508710861, 0.430796355009079, -0.4574803411960602, -0.2105954587459...
with ThreadPool.QueueUserWorkItem. The important point is that you could also write this using anonymous delegates (which were a C#2 introduction), or just a plain separate class member function. This <http://blogs.msdn.com/jomo_fisher/archive/2005/09/13/464884.aspx> is a superb step-by-step introduction into all this...
[ -0.05767529085278511, -0.36329156160354614, 0.01596531644463539, 0.10007309168577194, 0.011187009513378143, -0.20218472182750702, 0.002269591437652707, 0.21420614421367645, -0.5693110227584839, -0.41898947954177856, 0.4093678891658783, 0.5005678534507751, -0.44427141547203064, 0.0003573809...
I want to create a Java program that can be extended with plugins. How can I do that and where should I look for? I have a set of interfaces that the plugin must implement, and it should be in a jar. The program should watch for new jars in a relative (to the program) folder and registered them somehow. --- Although...
[ 0.6443457007408142, 0.3815947473049164, -0.00010441019549034536, -0.0038788150995969772, 0.0004357891157269478, 0.09016198664903641, 0.14530110359191895, -0.14490339159965515, -0.2805948555469513, -0.33220067620277405, 0.39070042967796326, 0.39198076725006104, 0.18882021307945251, -0.02386...