text stringlengths 0 30.5k | title stringclasses 1
value | embeddings listlengths 768 768 |
|---|---|---|
Our web team has been asked to build some user interfaces in Sharepoint. The UI's would primarily be forms that would need to write to a SQL Server database.
Is ASP.NET the best way to do this? If so what's the best way to integrate the ASP.NET application into Sharepoint?
You have 4 options:
```
1. Build web parts
... | [
0.33936893939971924,
-0.12916125357151031,
0.7213315963745117,
0.4246918559074402,
-0.19980859756469727,
0.15313084423542023,
-0.06080608069896698,
-0.1101650670170784,
-0.11172516644001007,
-0.9596226811408997,
0.10159263014793396,
0.4295642375946045,
-0.22788870334625244,
-0.078587241470... | |
but infopath wont use the page layouts or master pages that you specify.
if the web app has already been developed then youre looking at option 4, if its not already developed then I would suggest 1 or 2 which gives you the flexibility of reusing the controls elsewhere in the site as well as utilising the sharepoint m... | [
0.397689551115036,
-0.24822105467319489,
0.4213736653327942,
0.3383837938308716,
0.14267444610595703,
-0.25227075815200806,
-0.10769256204366684,
-0.12562942504882812,
0.22648343443870544,
-0.5168758034706116,
0.0734897330403328,
0.8082095980644226,
-0.3409784436225891,
-0.3135698437690735... | |
Does anyone have any experience with running C++ applications that use the boost libraries on uclibc-based systems? Is it even possible? Which C++ standard library would you use? Is uclibc++ usable with boost?
We use Boost together with GCC 2.95.3, libstdc++ and STLport on an ARMv4 platform running uClinux. Some parts ... | [
0.18302594125270844,
0.01201521698385477,
0.39970365166664124,
0.16324755549430847,
-0.08517954498529434,
-0.1077871322631836,
-0.3044726550579071,
0.00960792787373066,
-0.08041108399629593,
-0.47027698159217834,
0.10448061674833298,
0.635578453540802,
-0.25528767704963684,
-0.112626321613... | |
caused by our version of GCC since it has problems when you have too many includes or deep levels of template structures.
If possible I would recommend you to run the boost test suite with your particular toolchain to ensure compatibility. At the very least you could compile a native toolchain in order to ensure that ... | [
0.19741399586200714,
0.24299505352973938,
-0.07151676714420319,
0.11447270959615707,
-0.27899956703186035,
-0.3880617022514343,
0.13641990721225739,
0.17445193231105804,
-0.10884610563516617,
-0.3654203712940216,
-0.054239608347415924,
0.6534743309020996,
-0.32203996181488037,
0.1600677520... | |
I am creating an touch screen application using Swing and have a request to change one of buttons so that it will behave like a keyboard when the button is held down.
(First of all, I am not sure that the touch screen will allow the user to "hold down" the button, but pretend that they can for now)
I was going to g... | [
0.4130061864852905,
-0.025432707741856575,
0.31782209873199463,
-0.11812642961740494,
-0.007899140939116478,
-0.09540650248527527,
0.038834795355796814,
-0.2796238958835602,
-0.214805468916893,
-0.37143975496292114,
0.2225976288318634,
0.4148748219013214,
-0.368914932012558,
0.169658333063... | |
to get events back on the `EventQueue`.
Is there a very simple way to do what I want? I hope I am just not seeing the API to do it.
[javax.swing.Timer](http://docs.oracle.com/javase/6/docs/api/javax/swing/Timer.html) is your friend. And [here's an article](http://docs.oracle.com/javase/tutorial/uiswing/misc/timer.html... | [
0.1895909607410431,
-0.28044193983078003,
0.06443668901920319,
0.11068324744701385,
-0.10170744359493256,
-0.44811347126960754,
0.3754706382751465,
0.13976892828941345,
-0.5247319936752319,
-0.5717529058456421,
0.09799686819314957,
0.7555840015411377,
0.06047084927558899,
-0.27789494395256... | |
I have the following code that creates two objects (ProfileManager and EmployerManager) where the object EmployerManager is supposed to inherit from the object ProfileManager.
However, when I do alert(pm instanceof ProfileManager); it returns false.
```
function ProfileFactory(profileType) {
switch(profileType)
... | [
0.49473345279693604,
-0.2409507930278778,
0.4193492829799652,
-0.2780662477016449,
0.19094665348529816,
-0.032635949552059174,
0.26566606760025024,
-0.5085318088531494,
-0.12205678224563599,
-0.8168915510177612,
0.07029471546411514,
0.4992702603340149,
-0.2716737687587738,
0.35186338424682... | |
this.importantHTML = null;
this.controller = null;
this.actions = new Array();
this.anchors = new Array();
}
ProfileManager.prototype.loadData = function(action, dao_id, toggleBack) {
var step = this.actions.indexOf(action);
var prv_div = $('div_' + step - 1);
var nxt_div = $('div_' + step)... | [
-0.2778748869895935,
-0.7613930106163025,
0.61821049451828,
-0.06905480474233627,
0.023858116939663887,
0.10295474529266357,
0.21625159680843353,
-0.4143007695674896,
-0.3364001214504242,
-0.7356750965118408,
-0.11199206113815308,
0.4488238990306854,
-0.5301101207733154,
-0.169970467686653... | |
onSuccess: function(data) {
nxt_div.innerHTML = data.responseText;
if(step != 1 && !prv_div.empty()) {
prv_div.SlideUp();
}
nxt_div.SlideDown(); | [
-0.3414596617221832,
-0.5694732666015625,
0.9145686626434326,
-0.2613895535469055,
0.07731291651725769,
0.2008349448442459,
0.20507587492465973,
-0.4819685220718384,
-0.06736036390066147,
-0.4077118933200836,
-0.7284547686576843,
0.349884033203125,
-0.508676290512085,
0.04654419794678688,
... | |
for(i = 1; i <= step; i++)
{
if($('step_anchor_' + i).innerHTML.empty())
{ | [
-0.1914958506822586,
-0.49905380606651306,
0.7334570288658142,
-0.428128182888031,
0.4220658838748932,
0.16541673243045807,
0.5449256300926208,
-0.6381207704544067,
-0.16066555678844452,
-0.5036202669143677,
-0.28722521662712097,
0.44823741912841797,
-0.5532005429267883,
-0.156167864799499... | |
$('step_anchor_' + i).innerHTML = this.anchors[i];
}
}
}
}
)
}
EmployerManager.prototype.superclass = ProfileManager;
function EmployerManager() {
this.superclass();
this.controller = 'eprofile.php';
this.anchors[1] = 'Industries';
this.... | [
0.16535204648971558,
-0.4163212776184082,
0.5406097173690796,
-0.15075354278087616,
0.4017823338508606,
0.30823081731796265,
0.07377034425735474,
-0.48092788457870483,
-0.44840314984321594,
-0.5957959890365601,
-0.010437739081680775,
0.43349552154541016,
-0.4053478240966797,
0.040215209126... | |
'Employer Profile';
this.actions[1] = 'index';
this.actions[2] = 'employer_list';
this.actions[3] = 'employer_display';
}
var pm = new ProfileFactory('employer');
alert(pm instanceof ProfileManager);
```
BTW, this is my very first attempt at Object-Oriented JavaScript, so if you feel compelled to com... | [
0.006902045104652643,
-0.09290885925292969,
0.36025866866111755,
-0.12312497198581696,
-0.13120976090431213,
-0.05645351484417915,
0.3004398047924042,
-0.2682451903820038,
-0.35481488704681396,
-0.7417284250259399,
-0.09558874368667603,
0.5249491930007935,
-0.46126165986061096,
-0.13426473... | |
this.anchors = new Array('Industries', 'Employer Profiles', 'Employer Profile');
this.actions = new Array('index', 'employer_list', 'employer_display');
}
EmployerManager.prototype = new ProfileManager;
```
Apparently JavaScript supports two different types of inheritance, function based and prototype based. Th... | [
0.4033046066761017,
-0.14406464993953705,
0.1561247706413269,
-0.20988453924655914,
-0.168270081281662,
-0.12476406246423721,
0.2873075008392334,
-0.18132853507995605,
-0.23773472011089325,
-1.1109957695007324,
0.2938089072704315,
0.368635892868042,
-0.6490291953086853,
0.07112015038728714... | |
Interface Builder can be used for basic dependency injection in a Cocoa app, but is anyone aware of more complete dependency injection frameworks for Objective-C/Cocoa for when you don't want to instantiate objects in a NIB file?
**Edit**
To clarify, I recognize that IB can be used for basic DI, but I'm looking for a... | [
0.27285414934158325,
-0.044623080641031265,
-0.15328891575336456,
0.08788416534662247,
-0.4442211091518402,
-0.022882575169205666,
0.43175867199897766,
-0.16541746258735657,
0.09463214129209518,
-0.8439536690711975,
0.23009666800498962,
0.8117781281471252,
-0.5063039660453796,
-0.143496319... | |
complex path when he tried to build needle, a DI framework for Ruby- [Net::SSH revisited](http://weblog.jamisbuck.org/2007/7/29/net-ssh-revisited).
Here are some links that will hopefully give you some sample code to do similar things in Objective C. With categories you can essentially change any class's behavior at r... | [
-0.1341504156589508,
-0.14077652990818024,
0.049007683992385864,
0.180614173412323,
-0.19067785143852234,
-0.06728631258010864,
0.40728211402893066,
-0.2685299515724182,
-0.23125478625297546,
-0.5602436065673828,
0.13949185609817505,
0.6978642344474792,
-0.47723743319511414,
0.014167136512... | |
Does anyone have any good references for equations which can be implemented relatively easily for how to compute the transfer of angular momentum between two rigid bodies?
I've been searching for this sort of thing for a while, and I haven't found any particularly comprehensible explanations of the problem.
To be pre... | [
0.05816568434238434,
-0.06026093661785126,
0.3898118734359741,
0.362722784280777,
-0.2969994843006134,
-0.05422066152095795,
-0.1737021803855896,
0.05225156247615814,
-0.5086582899093628,
-0.711203932762146,
0.48213884234428406,
0.3101159334182739,
-0.08918178081512451,
0.2622300386428833,... | |
the transfer of angular momentum between the bodies?
As an example, assume the two bodies have no angular momentum whatsoever; they're not rotating. When they interact at an oblique angle (vector of travel does not align with the line of their centers of mass), obviously a certain amount of their momentum gets transfe... | [
0.09608086198568344,
-0.3585612177848816,
0.7065185904502869,
0.3645533323287964,
-0.18843533098697662,
0.11113137006759644,
-0.39210274815559387,
-0.25844329595565796,
-0.41104379296302795,
-0.5292105674743652,
0.4194364547729492,
0.4357623755931854,
-0.151895672082901,
0.2817938923835754... | |
calculate this stuff in real-time. Does anyone have any ideas on the equations, or pointers to open-source implementations of these calculations for inclusion in a project? To be precise, I need this to be a rather well-optimized calculation, because of the number of interactions that need to be simulated within a sing... | [
0.48348894715309143,
0.07316859066486359,
0.016370171681046486,
0.2523265779018402,
0.0020890538580715656,
-0.17558705806732178,
0.19280245900154114,
0.3773546814918518,
-0.14718744158744812,
-0.44907668232917786,
0.5130646228790283,
0.43227753043174744,
-0.3062172532081604,
-0.26144176721... | |
I want to figure out (or at least have sketched out for me) the algorithm. Only in that way can I properly optimize it for my needs. Does anyone have any mathematic references on this sort of topic?
If you're interested in rotating non-spherical bodies then <http://www.myphysicslab.com/collision.html> shows how to do i... | [
0.3238518238067627,
-0.08230554312467575,
0.5923429727554321,
0.4420228898525238,
-0.2702779173851013,
-0.25008028745651245,
-0.3492014408111572,
0.12148920446634293,
-0.31808751821517944,
-0.6191089749336243,
0.26330137252807617,
0.32942134141921997,
0.014309299178421497,
0.11030811071395... | |
is spherical/circular, the normal force is always right through the CG, so there's no torque. However, the normal force is not the only force. There's also a friction force that is tangential to the contact normal which will create a torque about the CG. The magnitude of the friction force is proportional to the normal... | [
0.07977280765771866,
0.03975368291139603,
0.8915187120437622,
0.2808871567249298,
-0.5127525925636292,
-0.03853542357683182,
-0.2292507141828537,
0.06649390608072281,
-0.2175571620464325,
-0.2720288634300232,
0.008457563817501068,
0.44604745507240295,
-0.006230510305613279,
0.4780322313308... | |
I read about this ages ago but never tried it now I can't remember if this is possible or not. Is it possible to extend a class from two parents on php5 e.g.
class\_d extends class\_c and class\_b
moreover can you do this if class\_c and class\_b are themselves extended from class\_a ... so you get something like thi... | [
0.12459106743335724,
-0.27922460436820984,
-0.03164957836270332,
-0.0921390950679779,
-0.020956581458449364,
-0.22023728489875793,
0.013953547924757004,
-0.015367193147540092,
-0.30323901772499084,
-0.6099145412445068,
0.05930054187774658,
0.42630210518836975,
-0.030720287933945656,
0.1274... | |
class_b class_c
class_d
```
No.
The best way is probably what you suggested: add a getFoo() method to your inner class. | [
0.06811227649450302,
-0.09910028427839279,
-0.20046120882034302,
0.17615048587322235,
0.04876082018017769,
-0.15344959497451782,
0.09170731902122498,
0.2969319224357605,
0.04193961247801781,
-0.5557981729507446,
-0.2772101163864136,
0.43140700459480286,
-0.29729771614074707,
0.054155804216... | |
I have a table with a TEXT column where the contents is just strings of CSV numbers. Example ",1,76,77,115," Each string can have an arbitrary number of numbers.
I am trying to set up Full Text Indexing so that I can search this column rapidly. This works great. Instead of running queries with
```
where MY_COL LIKE '... | [
0.10326353460550308,
0.5729144811630249,
0.2756844162940979,
-0.16564375162124634,
-0.1681860238313675,
0.2570590674877167,
-0.04264693707227707,
-0.2139301598072052,
-0.38856396079063416,
-0.7090326547622681,
0.22079573571681976,
0.2715494632720947,
-0.2725639045238495,
0.2257409244775772... | |
But even after doing that it still doesn't work.
Working with relational databases that way is going to hurt.
Use a proper schema. Either store the values in different rows or use an array datatype for the column.
That will make solving the problem trivial. | [
0.25616636872291565,
0.23680344223976135,
0.18066522479057312,
0.4562482535839081,
0.015368065796792507,
0.02368907444179058,
0.2624896466732025,
-0.2692621052265167,
-0.040583256632089615,
-0.5017679333686829,
0.3335006535053253,
0.5802497863769531,
-0.37273290753364563,
0.023372177034616... | |
Is there any way to set an event handler without doing it manually in the classname.designer.cs file other than double clicking the UI element?
Click on the lightning bolt icon in the Properties window. Double-click the event you want to implement. | [
0.49454107880592346,
-0.3120150864124298,
-0.2054366171360016,
0.20719031989574432,
-0.12911033630371094,
-0.39223575592041016,
0.20072811841964722,
-0.04773318022489548,
-0.2690310776233673,
-0.6437488794326782,
-0.045933548361063004,
0.5241201519966125,
-0.18716193735599518,
-0.096310332... | |
I'm try to extract info from a MySQL DB into a MS SQL DB. The DB is a mess and the developer is no longer available.
All dates are in char fields, and I use
```
SELECT concat( mid(DueDate, 7, 4), mid(DueDate, 4, 2), mid(DueDate, 1, 2)) as DueDate FROM TableName
```
to get the date field in a format so MS sql serve... | [
0.176662415266037,
0.03734253719449043,
0.5583435297012329,
0.04241084307432175,
0.11323392391204834,
-0.030587462708353996,
-0.1762884557247162,
0.0648864358663559,
0.0692758560180664,
-0.3880883753299713,
0.09398500621318817,
0.12025918066501617,
0.0757770910859108,
0.5619208812713623,
... | |
comparison?
In MySQL you can convert a string to a date using the [STR\_TO\_DATE](http://dev.mysql.com/doc/refman/5.0/en/date-and-time-functions.html#function_str-to-date) function.
An example usage is:
```
mysql> SELECT STR_TO_DATE('04/31/2004', '%m/%d/%Y');
-> '2004-04-31'
```
To get the current date in M... | [
-0.05256005749106407,
-0.03833318129181862,
0.5374789834022522,
-0.11714163422584534,
-0.06814665347337723,
0.33131712675094604,
-0.18241378664970398,
-0.10502083599567413,
-0.10376925021409988,
-0.6958929300308228,
0.0678863525390625,
0.3616274893283844,
-0.07936148345470428,
0.3243432939... | |
I'm trying to create a custom transition, to serve as a replacement for a default transition you would get here, for example:
```
[self.navigationController pushViewController:someController animated:YES];
```
I have prepared an OpenGL-based view that performs an effect on some static texture mapped to a plane (let'... | [
0.1762809008359909,
-0.019002575427293777,
0.46440190076828003,
0.1685156226158142,
-0.0975884422659874,
0.02131037414073944,
-0.06474509090185165,
0.3198283910751343,
-0.2342284917831421,
-1.0667651891708374,
0.07192011177539825,
0.6174855828285217,
-0.2233336865901947,
0.2075231075286865... | |
to replace current view
* are there some APIs I can hook to in order to make my transition class as native as possible (make it a kind of Core Animation effect)?
Any thoughts or links are greatly appreciated!
**UPDATE**
Jeffrey Forbes's answer works great as a solution to capture the content of a view.
What I have... | [
0.1627321094274521,
-0.10637368261814117,
0.30558663606643677,
0.1620410978794098,
-0.13741670548915863,
-0.06484551727771759,
-0.008338737301528454,
-0.10475175827741623,
-0.17001552879810333,
-0.7612017393112183,
-0.226555734872818,
0.5352475643157959,
-0.1312548816204071,
0.159256309270... | |
which I actually want to go one item back, with animation, check this vid for explanation:
<http://vimeo.com/4649397>.
Another option would be to go with presentViewController, but that shows fullscreen.
Do you think maybe creating another window (or view?) could be useful?
While I cannot completely answer your quest... | [
0.14157816767692566,
-0.1295451521873474,
0.747013509273529,
0.1254652589559555,
-0.30500391125679016,
0.07217686623334885,
0.18065035343170166,
-0.33534494042396545,
-0.1985645890235901,
-0.7474285960197449,
0.021797288209199905,
0.4985811114311218,
-0.1756308525800705,
0.0073310742154717... | |
render a GLContext (not familiar on the phone) into a CGImage, but I would do something like that (and init a UIImage from that). I would prerender every frame of the animation you are trying to do and slap it into an UIImageView using the animation stuff provided within. That is, if your animation is simple enough. Ot... | [
0.19653142988681793,
-0.20255732536315918,
0.5454591512680054,
0.1507800817489624,
-0.1317712366580963,
0.06453698873519897,
-0.09539274126291275,
0.28762710094451904,
0.1795390099287033,
-0.8261202573776245,
-0.102346271276474,
0.47442859411239624,
-0.15967205166816711,
-0.010843048803508... | |
Wondering how to open many new windows with Javascript. I have found plenty of places on the internet that show you how to open a new browser window with Javascript, but I want to open a new UNIQUE window. For Example.
I have two links on a page. the user clicks on both links and they are both opened in the same windo... | [
0.6267667412757874,
0.2911352515220642,
0.09532380104064941,
-0.09374115616083145,
-0.2545759677886963,
0.06558647751808167,
0.31704631447792053,
0.1976049840450287,
-0.7473285794258118,
-0.9482722878456116,
0.18548452854156494,
0.20040930807590485,
-0.021760249510407448,
0.240143626928329... | |
same window. I want to pop it out of that window WITH JAVASCRIPT, NOT use the same window.**
Help?
```
window.open('page.html','WindowTitle','width=400,height=200')
``` | [
0.13756461441516876,
0.23084871470928192,
0.4628336429595947,
-0.09646540135145187,
0.07372438162565231,
-0.05899796262383461,
0.43176308274269104,
-0.16614913940429688,
-0.10315991938114166,
-1.1581721305847168,
-0.2775101661682129,
0.5896024107933044,
-0.36942505836486816,
-0.13146443665... | |
I have a class library with all my database logic. My DAL/BLL.
I have a few web projects which will use the same database and classes, so I thought it was a good idea to abstract the data layer into its own project.
However, when it comes to adding functionality to classes for certain projects I want to add methods ... | [
0.31618228554725647,
-0.21660959720611572,
-0.14923147857189178,
0.02877023257315159,
-0.05772099643945694,
0.07705816626548767,
-0.34825778007507324,
-0.047137536108493805,
0.0007487361435778439,
-0.49720078706741333,
0.0084433164447546,
0.1014394760131836,
-0.13101798295974731,
0.1118367... | |
//implementation here
}
}
```
In one project I want to add an interface that is used by different content items, so I have a class called:
```
// This is in Web Project
namespace DAL {
public partial class Product : ICustomBehaviour {
#region ICustomBehaviour Implementation
TheSharedMethod();
#e... | [
0.02930891513824463,
-0.19208058714866638,
0.35228756070137024,
-0.07474415749311447,
-0.1047012209892273,
-0.051832716912031174,
0.08273617923259735,
0.0045265331864356995,
-0.2020220309495926,
-0.8241447806358337,
-0.2007773220539093,
-0.06566271185874939,
-0.3104272186756134,
0.33122965... | |
to merge them at compile time, so I'm not sure what I'm doing wrong.
You can't write a partial class across projects. A partial class is a compile-time-only piece of syntactic sugar - the whole type ends up in a single assembly, i.e. one project.
(Your original DAL file would have to declare the class to be partial as... | [
0.17457488179206848,
-0.2553406059741974,
-0.3688126802444458,
0.18273746967315674,
-0.16808533668518066,
0.15160366892814636,
0.20015250146389008,
0.09032554179430008,
-0.18356743454933167,
-0.5239845514297485,
0.004942724481225014,
-0.28913143277168274,
-0.39006996154785156,
0.2980559170... | |
Need to an expression that returns only things with an "I" followed by either a "J" or a "V" (No Quotes) and then a minimum of 1 number up to 3 numbers.
I J###
I V###
I J##
I V##
I J#
I v#
Depends on your flavor
```
I(J|V)[0-9]{1,3}
```
Do you also need a space after an "I"?
```
I (J|V)[0-9]{1,... | [
0.06735658645629883,
0.3404074013233185,
0.4368710219860077,
-0.008037918247282505,
0.2975352108478546,
0.2877184748649597,
0.19061662256717682,
-0.334136039018631,
0.0784018486738205,
-0.4261868894100189,
-0.34124332666397095,
0.47441649436950684,
-0.08622974157333374,
-0.0983880236744880... | |
For some reasons, I would like to do an explicit quoting of a string value (becoming a part of constructed SQL query) instead of waiting for implicit quotation performed by `cursor.execute` method on contents of its second parameter.
By "implicit quotation" I mean:
```
value = "Unsafe string"
query = "SELECT * FROM s... | [
0.07613588869571686,
0.15662623941898346,
0.2896476984024048,
-0.12268275022506714,
-0.13753460347652435,
-0.0003384012670721859,
0.1927262544631958,
-0.22645123302936554,
0.09428703039884567,
-0.27450209856033325,
0.03120427578687668,
0.7118163108825684,
-0.2864018976688385,
0.08626464009... | |
by Python DB API specification (I couldn't find such functionality in [PEP 249](http://www.python.org/dev/peps/pep-0249/) document). If not, maybe Psycopg2 provides such function? If not, maybe Django provides such function? I would prefer not to write such function myself...
Ok, so I was curious and went and looked at... | [
0.16760563850402832,
0.40051817893981934,
0.2255019098520279,
-0.18988624215126038,
-0.30910593271255493,
-0.25242409110069275,
0.12991750240325928,
-0.18765585124492645,
-0.14488206803798676,
-0.4370878040790558,
-0.13345178961753845,
0.3851633071899414,
-0.6144962906837463,
-0.0279851686... | |
adapter;
In the examples folder of psycopg2 you find the file ['myfirstrecipe.py'](http://sourcecodebrowser.com/psycopg2/2.4.5/myfirstrecipe_8py_source.html) there is an example of how to cast and quote a specific type in a special way.
If you have objects for the stuff you want to do, you can just create an adapter ... | [
0.16194948554039001,
0.11929628252983093,
0.5494484305381775,
0.06102144345641136,
-0.3762357831001282,
0.1381649523973465,
-0.05176202207803726,
-0.48241087794303894,
-0.05512918904423714,
-0.597345232963562,
0.19245845079421997,
0.7032662034034729,
-0.3881113529205322,
0.0328531712293624... | |
I am writing a script which is likely to be modified by users. Currently I am storing the configuration settings inside the script. It exists in the form of a hash-of-hashes.
I would like to guard against people accidentally using lowercase characters in the hash keys, because that will break my script.
It would be s... | [
0.3542174994945526,
0.4012555480003357,
0.24920065701007843,
-0.02082885429263115,
0.19964371621608734,
0.07399766147136688,
0.34044939279556274,
0.022062934935092926,
0.03153318539261818,
-0.5955541133880615,
-0.003469273215159774,
0.3923042416572571,
-0.23284487426280975,
-0.063299797475... | |
he `uc`s every key, and then `uc`s it again if it doesn't match.
This `uc`s it once:
```
%hash = map { uc $_ => $hash{$_} } keys %hash;
```
But since you spoke of users *storing keys*, a tie is a much more sure way, even if slower.
```
package UCaseHash;
require Tie::Hash;
our @ISA = qw<Tie::StdHash>;
sub FETC... | [
-0.2084226906299591,
0.006663602311164141,
0.6572259664535522,
-0.257956862449646,
0.1875768005847931,
-0.021561743691563606,
0.0706457570195198,
-0.3026253581047058,
0.1468719244003296,
-0.5615304708480835,
-0.3723752796649933,
0.562015950679779,
-0.3088991343975067,
0.5970118641853333,
... | |
'UCaseHash';
```
That's a show. The `tie` "magic" encapsulates it, so the users can't unknowingly mess with it.
Of course, as long as you're using a "class", you can pass in the config file name and initialize it from there:
```
package UCaseHash;
use Tie::Hash;
use Carp qw<croak>;
...
sub TIEHASH {
my ( ... | [
-0.08084189891815186,
0.0818556398153305,
0.27511489391326904,
-0.33481496572494507,
0.0505562424659729,
-0.11413077265024185,
0.27572378516197205,
-0.21475669741630554,
0.0013603274710476398,
-0.40274688601493835,
-0.40525996685028076,
0.36281123757362366,
-0.46150413155555725,
0.44291538... | |
%phash = _process_config_lines( <$fh> );
close $fh;
$self->STORE( $_, $phash{$_} ) foreach keys %phash;
return $self;
}
```
Where you would have to call it like:
```
tie my %hash, 'UCaseHash', CONFIG_FILE_PATH;
```
...assuming some constant `CONFIG_FILE_PATH`. | [
0.000477943365694955,
0.1864069104194641,
0.5738242268562317,
-0.5133413076400757,
0.21741674840450287,
0.08197571337223053,
-0.014730026945471764,
-0.43765997886657715,
0.22245539724826813,
-0.41925084590911865,
-0.17107023298740387,
0.49942415952682495,
-0.2171495109796524,
0.21661691367... | |
In HTML in the td of a table you can break text by using `<BR>` between the words. This also works in the HeaderText of a TemplateItem but not the HeaderText of a BoundField. How do I break up the Header text of a BoundField.
Set `HtmlEncode = false` inside the `BoundField`
```
<asp:BoundField DataField="SomeDataFiel... | [
0.208627849817276,
0.22897489368915558,
0.33965975046157837,
-0.16862554848194122,
-0.27011051774024963,
-0.30884671211242676,
0.5479810237884521,
-0.15312205255031586,
-0.05756361037492752,
-0.5461381077766418,
-0.2830769717693329,
0.30631527304649353,
-0.3976181745529175,
-0.117493368685... | |
is not encoded and the br will work as expected. Unfortunately is not possible to specify this only for the header text, it will affect the cell contents as well. | [
-0.10114213079214096,
0.17755132913589478,
0.26267918944358826,
-0.20516885817050934,
0.1666131168603897,
-0.2806888222694397,
0.28212496638298035,
0.17771315574645996,
-0.1154370978474617,
-0.49478819966316223,
-0.25418445467948914,
0.23289749026298523,
-0.2811981737613678,
0.034426875412... | |
I have a project with a post build event:
```
copy $(ProjectDir)DbVerse\Lunaverse.DbVerse.*.exe $(TargetDir)
```
It works fine every time on my machine. I have a new developer who always gets the "exited with code 1" error. I had her run the same command in a DOS prompt, and it worked fine. What could be causing th... | [
0.43098747730255127,
0.17097069323062897,
0.23784665763378143,
-0.1081213429570198,
-0.20205657184123993,
-0.02911296673119068,
0.27977454662323,
0.04728614538908005,
-0.16396264731884003,
-0.896420419216156,
0.3754974901676178,
0.3997513949871063,
-0.19566737115383148,
0.3072185814380646,... | |
Is there a way to determine (.NET preferably) if the current user is a domain user account or local user account?
Ahead of time - I don not know the domain name this is running on so I can't just look for DOMAIN\Username v COMPUTER\Username.
Part of the answer could be determining the DOMAIN or COMPUTER name from co... | [
0.14124535024166107,
0.1175655946135521,
0.22327563166618347,
0.07121732831001282,
0.22871056199073792,
-0.10989679396152496,
-0.07904490828514099,
-0.21647606790065765,
-0.27913159132003784,
-0.4157397747039795,
0.11143244802951813,
0.46361103653907776,
-0.19780050218105316,
0.20596918463... | |
with other properties like Environment.MachineName to figure out what is the type of the user account being used.
Note that domain account is not necessarily Active Directory (can be that Novell Netware stuff) | [
0.04574953019618988,
0.05033392459154129,
0.15073943138122559,
0.22197437286376953,
-0.001227988163009286,
-0.4629329442977905,
0.15662802755832672,
0.28638169169425964,
-0.2650091350078583,
-0.6581724882125854,
0.11689040064811707,
0.3542162775993347,
-0.24294178187847137,
0.5252781510353... | |
At the XmlSerializer constructor line the below causes an InvalidOperationException which also complains about not having a default accesor implemented for the generic type.
```
Queue<MyData> myDataQueue = new Queue<MyData>();
// Populate the queue here
XmlSerializer mySerializer =
new XmlSerializer(myDataQueue.Ge... | [
-0.023066191002726555,
-0.2162710726261139,
0.7754868865013123,
0.08757057040929794,
0.10077409446239471,
0.05071675404906273,
-0.015382527373731136,
-0.12178181111812592,
-0.1570982187986374,
-0.7774596214294434,
-0.11752992123365402,
0.4509483277797699,
-0.4116266071796417,
0.27041155099... | |
My log file is:
```
Wed Nov 12 blah blah blah blah cat1
Wed Nov 12 blah blah blah blah
Wed Nov 12 blah blah blah blah
Wed Nov 12 blah blah blah blah cat2
more blah blah
even more blah blah
Wed Nov 12 blah blah blah blah cat3
Wed Nov 12 blah blah blah blah cat4
```
I want to parse out the full multil... | [
0.17131860554218292,
0.28357842564582825,
0.6724528670310974,
-0.28342005610466003,
0.0567745678126812,
0.21476101875305176,
0.27829545736312866,
-0.09786535799503326,
-0.08040174096822739,
-0.4831436574459076,
0.060741350054740906,
0.46204087138175964,
-0.15571807324886322,
-0.03461629152... | |
Nov 12 blah blah blah blah cat1
Wed Nov 12 blah blah blah blah cat2
more blah blah
even more blah blah
Wed Nov 12 blah blah blah blah cat3
Wed Nov 12 blah blah blah blah cat4
```
if you say every line that starts with space is a continuation of the folling its easy with (g)awk (this is from my memory, so ... | [
0.17693333327770233,
-0.12881572544574738,
0.8262071013450623,
-0.03440796956419945,
-0.38577142357826233,
0.4334741234779358,
0.41669803857803345,
-0.14256377518177032,
-0.3456398844718933,
-0.30512332916259766,
-0.3234310448169708,
0.21808750927448273,
-0.3917061984539032,
0.159644350409... | |
if (whatever)
{ print; multiline = 1;}
else
multiline = 0;
}
/^ / {if (multiline == 1) | [
0.16508689522743225,
-0.4051752984523773,
0.5740799903869629,
-0.26087281107902527,
0.04061492905020714,
0.17638063430786133,
0.041586145758628845,
-0.06786517798900604,
-0.24584676325321198,
-0.3242037296295166,
-0.2932814955711365,
0.45239582657814026,
-0.33383864164352417,
-0.1616826206... | |
print;
}
"
yourfile
```
where `whatever` is your check if your output should happen (e.g. for the cat). | [
0.23877066373825073,
-0.057482872158288956,
0.3968060314655304,
-0.2193821668624878,
0.41118350625038147,
-0.1731698364019394,
0.10008981078863144,
0.18879294395446777,
0.047545306384563446,
-0.5592239499092102,
-0.33980026841163635,
0.7061027884483337,
-0.4926284849643707,
-0.226475983858... | |
Recently, I found myself having to write up some concerns I have about race conditions in an application that is in development (not by me). This will likely be brought to the attention of stakeholders who are non-technical and with whom I do not have a direct line of communication, so my explanation needs to be in wri... | [
0.5786161422729492,
0.2442590594291687,
-0.17579768598079681,
-0.08385220915079117,
0.1778976172208786,
0.09916085749864578,
0.2821003198623657,
0.10535356402397156,
0.05093115568161011,
-0.5744180679321289,
0.2805754542350769,
0.43873995542526245,
0.024453217163681984,
0.23037472367286682... | |
but it's far from perfect.
The problem is, as much as I try to shield the reader from computer science, I have still found it difficult to eliminate phrases like "threads of execution" and "mutual exclusion" without losing correctness and substance. The risk is that, with too much hand-waving, these concerns could be ... | [
0.5986102223396301,
0.3856706917285919,
-0.39596447348594666,
0.12333548069000244,
-0.029425211250782013,
0.21177077293395996,
0.127478688955307,
0.029108701273798943,
0.04150407761335373,
-0.5171741843223572,
-0.004168303683400154,
0.4698701500892639,
-0.1229095458984375,
-0.0000857677659... | |
awesomely helpful if you did).*
Company X has $1,000 in the bank. X pays a rent of $2,000 and received a payment of $10,000 for services rendered to company Y. However, due to a race condition, X is in deficit of $1,000 and is now applying for bankruptcy. =(
You might want to explain how the bank handles company X's a... | [
0.2937338352203369,
0.18320663273334503,
0.641002357006073,
0.1072693020105362,
0.32151511311531067,
0.11071372777223587,
0.023270048201084137,
0.3723408281803131,
-0.35269102454185486,
-0.26275792717933655,
-0.045954275876283646,
0.36853229999542236,
0.01901872456073761,
0.193758174777030... | |
B updates the value to -$1,000. | [
-0.15738241374492645,
0.2550322115421295,
0.46043479442596436,
0.07321248948574066,
0.04906294867396355,
-0.001780461403541267,
0.13871659338474274,
-0.11616157740354538,
0.1198946088552475,
-0.28203722834587097,
-0.0873352438211441,
0.18821804225444794,
-0.02168981358408928,
0.04315878823... | |
I'm using a regex that [strips the href tags out of an html doc](http://regexlib.com/REDetails.aspx?regexp_id=646) saved to a string. The following code is how I'm using it in my C# console app.
```
Match m = Regex.Match(htmlSourceString, "href=[\\\"\\\'](http:\\/\\/|\\.\\/|\\/)?\\w+(\\.\\w+)*(\\/\\w+(\\.\\w+)?)*(\\/|... | [
-0.20904694497585297,
0.2784242331981659,
1.1714903116226196,
-0.24678117036819458,
0.2629692256450653,
-0.0730455219745636,
0.23637676239013672,
-0.4141288101673126,
0.06858177483081818,
-0.7404265403747559,
-0.20613689720630646,
0.7365227341651917,
-0.2815380096435547,
0.1206264048814773... | |
I trying `RegexOptions.RightToLeft`, it returns the last href tag in the string.
Is there something with my if statement that doesn't allow me to return all the results?
If you use Match instead of Match**es** you need to use a loop to get all the matches calling m.NextMatch() at the end of each loop. For example:
`... | [
-0.4329494535923004,
-0.13282711803913116,
0.7809299230575562,
-0.2620878219604492,
0.37301862239837646,
-0.12968023121356964,
0.49431952834129333,
-0.5658840537071228,
-0.03761204704642296,
-0.8265210390090942,
-0.3211837708950043,
0.632472813129425,
-0.5583628416061401,
0.156040444970130... | |
m = m.NextMatch();
}
Console.WriteLine();
``` | [
-0.4895733892917633,
-0.0901041030883789,
0.5215491056442261,
-0.5415806174278259,
0.7906894087791443,
0.051912784576416016,
0.4321572482585907,
-0.2271496206521988,
0.015342541970312595,
-0.9084902405738831,
-0.3951551914215088,
0.5193001627922058,
-0.31131160259246826,
0.2746869325637817... | |
Is there any way to access the Windows Event Log from a java class. Has anyone written any APIs for this, and would there be any way to access the data from a remote machine?
The scenario is:
I run a process on a remote machine, from a controlling Java process.
This remote process logs stuff to the Event Log, which I... | [
0.30890339612960815,
-0.12345503270626068,
-0.16077305376529694,
0.21786679327487946,
-0.04280573129653931,
-0.1117509976029396,
0.1926560252904892,
-0.06839954853057861,
-0.32484927773475647,
-0.6011872291564941,
0.0900869145989418,
0.44846096634864807,
-0.188493013381958,
0.0317332819104... | |
<http://www.jinvoke.com/>
On the Windows side, the function you're after is [OpenEventLog](http://msdn.microsoft.com/en-us/library/aa363672(VS.85).aspx). This should allow you to access a remote event log. See also [Querying for Event Information](http://msdn.microsoft.com/en-us/library/bb427356(VS.85).aspx).
If that... | [
-0.05765233933925629,
-0.053349997848272324,
0.48965129256248474,
0.05615873634815216,
-0.12185122817754745,
-0.2754550278186798,
0.011330577544867992,
-0.02100760117173195,
-0.2843831181526184,
-0.4514400362968445,
-0.1819985955953598,
0.7969552278518677,
0.011556588113307953,
0.163589850... | |
I have a time represented as the number of seconds elapsed since midnight, January 1, 1970, UTC (the results of an earlier call to time()). How do I add one day to this time?
Adding 24 \* 60 \* 60 works in most cases, but fails if the daylight saving time comes on or off in between. In other words, I mostly want to ad... | [
0.5067809820175171,
0.03191632404923439,
0.6950663924217224,
-0.26746025681495667,
0.3680230677127838,
0.14942516386508942,
0.45483580231666565,
0.010999470949172974,
-0.3494747281074524,
-0.5085758566856384,
0.23724108934402466,
0.30932193994522095,
-0.10574213415384293,
0.512358963489532... | |
base + i * 24 * 60 * 60;
std::cout << ctime(&time);
}
return 0;
```
}
Produces:
```
Sat Mar 11 08:00:00 2006
Sun Mar 12 09:00:00 2006
Mon Mar 13 09:00:00 2006
Tue Mar 14 09:00:00 2006
```
I want the times for March 12, 13, ... to also be 8 AM.
---
The answer provided by FigBug pointed me in the right di... | [
-0.28092771768569946,
0.19997519254684448,
0.8719387054443359,
-0.4742871820926666,
-0.22850801050662994,
-0.006930379197001457,
0.3342532813549042,
-0.032270628958940506,
-0.25385093688964844,
-0.35138678550720215,
-0.14277781546115875,
0.6761035919189453,
0.06325743347406387,
0.183875352... | |
std::cout << asctime(tm);
}
return 0;
}
```
Give me:
```
Sat Mar 11 08:00:00 2006
Sat Mar 12 08:00:00 2006
Sat Mar 13 08:00:00 2006
Sat Mar 14 08:00:00 2006
```
Which is what I want. Using gmtime gives me the times at 14:00:00
However, note that all days are Sat. Also, it goes to March 32, 33, etc. If I throw i... | [
-0.48005688190460205,
0.06711656600236893,
0.9886186718940735,
-0.4380704462528229,
-0.24171438813209534,
0.24012529850006104,
0.5475044846534729,
-0.2501361668109894,
-0.3275512456893921,
-0.3262748122215271,
-0.06721214205026627,
0.48290684819221497,
0.010919436812400818,
0.2014574557542... | |
= mktime(tm);
std::cout << asctime(tm);
}
return 0;
}
```
Gives me:
```
Sat Mar 11 08:00:00 2006
Sun Mar 12 09:00:00 2006
Mon Mar 13 09:00:00 2006
Tue Mar 14 09:00:00 2006
```
What am I missing???
---
OK, I have tried out FigBug's latest suggestion that is to use:
```
std::cout << ctime(&time);
```
ins... | [
-0.17094792425632477,
0.25245288014411926,
0.5648643970489502,
-0.2543899118900299,
-0.2962203025817871,
-0.09479515254497528,
0.35895949602127075,
-0.2770773470401764,
-0.27023202180862427,
-0.2517454922199249,
-0.2177746742963791,
0.8271943926811218,
-0.2410861998796463,
-0.0377712287008... | |
I use ctime or asctime for output:
```
Sat Mar 11 08:00:00 2006
Sun Mar 12 08:00:00 2006
Mon Mar 13 08:00:00 2006
Tue Mar 14 08:00:00 2006
```
I also get the correct results (with both output functions) on Red Hut Linux with g++ 3.4.6.
So I guess that I have come across a Cygwin bug.
Thank you for all your help a... | [
-0.244666188955307,
0.015452980063855648,
0.7411375641822815,
-0.26293623447418213,
-0.2506120204925537,
-0.22754131257534027,
0.422015905380249,
-0.09125865250825882,
-0.06909013539552689,
-0.8451887965202332,
0.009470178745687008,
0.8230912089347839,
-0.20605114102363586,
0.1371096670627... | |
0; i < 4; ++i) {
struct tm* tm = localtime(&base);
tm->tm_mday += i;
time_t next = mktime(tm);
std::cout << ctime(&next);
}
return 0;
}
``` | [
-0.042175889015197754,
-0.40332838892936707,
0.7844855189323425,
-0.5049097537994385,
0.46478763222694397,
0.04042674973607063,
0.4291761517524719,
-0.4411153197288513,
-0.0658811628818512,
-0.7075579166412354,
-0.41756805777549744,
0.5246991515159607,
-0.29639923572540283,
0.3714707195758... | |
I am still learning sql server somewhat and recently came across a select query in a stored procedure which was causing a very slow fill of a dataset in c#. At first I thought this was to do with .NET but then found a suggestion to put in the stored procedure:
set implicit\_transactions off
this seems to cure it but ... | [
0.16653284430503845,
0.15094266831874847,
0.2099841982126236,
0.046668123453855515,
-0.3158342242240906,
-0.2410176545381546,
0.36248865723609924,
0.044663432985544205,
-0.1420532613992691,
-0.7612705826759338,
0.27930042147636414,
0.4641139805316925,
-0.31538626551628113,
0.18685235083103... | |
know where to find good info on what each of these does and what is safe to use when I have stored procedures setup just to query of data for viewing.
I should note just to stop the usual use/don't use stored procedures debate these queries are complex select statements used on multiple programs in multiple languages... | [
0.35818740725517273,
0.2340501993894577,
0.1623179167509079,
0.39278221130371094,
0.03406466171145439,
-0.2036270648241043,
0.41210469603538513,
0.14374499022960663,
-0.20726393163204193,
-0.6435544490814209,
0.24209094047546387,
0.6228307485580444,
0.05453987792134285,
0.1824200600385666,... | |
the page out of SQL Server Books Online (BOL) that you want. It explains all the SET statements that can be used in a session.
<http://msdn.microsoft.com/en-us/library/ms190356.aspx> | [
0.40941599011421204,
0.07041344046592712,
0.3560871183872223,
0.3832140266895294,
-0.061050962656736374,
-0.40503212809562683,
0.09260954707860947,
0.14017368853092194,
-0.12294112145900726,
-0.4371894598007202,
-0.15887796878814697,
0.14549370110034943,
-0.13718706369400024,
0.00329520343... | |
Let's say we have a concrete `class Apple`. (Apple objects can be instantiated.)
Now, someone comes and derives an abstract `class Peach` from Apple. It's abstract because it introduces a new pure virtual function. The user of Peach is now forced to derive from it and define this new function. Is this a common pattern?... | [
0.10488962382078171,
0.16597343981266022,
-0.11938972771167755,
-0.07797177881002426,
0.22798636555671692,
0.5478965044021606,
-0.016396289691329002,
0.2943805158138275,
-0.34505826234817505,
-0.6925868391990662,
-0.06789834052324295,
0.2948131859302521,
-0.4076501727104187,
0.117997132241... | |
from Berry. It's abstract because it overwrites one of Berry's virtual functions, and makes it pure virtual. The user of Tomato has to re-implement the function previously defined in Berry. Is this a common pattern? Is this correct to do?
Sample:
```
class Berry
{
public:
virtual void EatYummyPie();
// more s... | [
0.22163145244121552,
-0.1475083827972412,
-0.09773740917444229,
-0.15859730541706085,
0.034586723893880844,
0.5004082918167114,
0.17244020104408264,
0.293444961309433,
-0.2629421353340149,
-0.623797595500946,
0.002959132194519043,
0.3970073163509369,
-0.3587610125541687,
0.1297505050897598... | |
a value class
(i.e. has copy ctor, non-identical
instances can be equal, etc). See Meyers
More Effective C++ Item 33 for why.
* Don't do it if Apple has a public
nonvirtual destructor, otherwise you
invite undefined behaviour when your
users delete an Apple through a
pointer to Peach.
* Otherwise, you're probably safe,... | [
-0.15466319024562836,
-0.10707399994134903,
-0.15443383157253265,
-0.0765574499964714,
-0.09487221390008926,
0.23889219760894775,
0.2736760973930359,
-0.15493866801261902,
-0.2579522728919983,
-0.5150437355041504,
-0.38959622383117676,
0.26365768909454346,
-0.3412908613681793,
0.0918976143... | |
do in order not to violate Liskov substitutability. The function you are overriding in Berry - let's call it `Juice()` - imposes certain requirements and makes certain promises. Derived classes' implementations of `Juice()` must require no more and promise no less. Then a DerivedTomato IS-A Berry and code which only kn... | [
0.22945018112659454,
-0.18072465062141418,
-0.15729345381259918,
-0.21826696395874023,
0.3462960422039032,
0.011864794418215752,
0.1810019314289093,
-0.26667648553848267,
0.2943044602870941,
-0.5331169366836548,
-0.2722090780735016,
0.6008039712905884,
-0.4013046324253082,
0.06825558096170... | |
Berry::Juice();
}
virtual void PrepareJuice() = 0;
};
```
Now there is an excellent chance that a Tomato IS-A Berry, contrary to botanical expectations. (The exception is if derived classes' implementations of `PrepareJuice` impose extra preconditions beyond those imposed by `Berry::Juice`). | [
-0.10230295360088348,
0.0810014083981514,
-0.17525829374790192,
-0.37950950860977173,
0.20659765601158142,
0.12823323905467987,
0.26265066862106323,
0.27174168825149536,
0.08646262437105179,
-0.574137270450592,
-0.26548245549201965,
0.4892248809337616,
-0.22156602144241333,
0.0386087447404... | |
To do the equivalent of Python list comprehensions, I'm doing the following:
```
some_array.select{|x| x % 2 == 0 }.collect{|x| x * 3}
```
Is there a better way to do this...perhaps with one method call?
If you really want to, you can create an Array#comprehend method like this:
```
class Array
def comprehend(&bl... | [
0.08478297293186188,
0.04878653585910797,
0.37130066752433777,
-0.1709907501935959,
-0.31264960765838623,
-0.07262518256902695,
0.20040316879749298,
-0.2676212191581726,
-0.37513303756713867,
-0.524503231048584,
0.1331794410943985,
0.5737339854240417,
-0.1831064224243164,
0.083668902516365... | |
I need to reformat a text file into a PDF. Using Perl, I am modifying an existing PostScript template file based on what is in the text file. Sometimes this text file will be long enough to require a two page PDF.
Can I create a two page PDF file from one .ps file using GhostScript? If so, what tells GhostScript where... | [
0.5042356252670288,
-0.21731697022914886,
0.6245434284210205,
0.1160876527428627,
-0.08961261808872223,
-0.3463249206542969,
0.34131553769111633,
-0.48298731446266174,
-0.3719237744808197,
-0.6840888261795044,
-0.11735742539167404,
0.3385973572731018,
-0.4572785198688507,
-0.05130124464631... | |
renders the page to the device, clears the page and starts a new one. PS to PDF conversion will create a new page in the PDF on this operator. If you want to chop up a PostScript file into pages, [psutils](http://gershwin.ens.fr/vdaniel/Doc-Locale/Outils-Gnu-Linux/PsUtils/) is a series of programs for manipulating Post... | [
0.1156623512506485,
-0.12819381058216095,
0.4025404751300812,
0.1544787883758545,
-0.0009036881965585053,
-0.007497543003410101,
-0.12877941131591797,
-0.01123474258929491,
-0.297299325466156,
-0.9115684032440186,
-0.4554425776004791,
0.06136905029416084,
-0.1715797483921051,
-0.1419977396... | |
In ASP.NET (not MVC), what is the best approach to programmatically setting styles on an unordered list used for navigation so the appropriate menu item is styled as the active item if that page is being viewed?
This would most likely be used in conjunction with a MasterPage.
The answer to your question depends a lot... | [
0.44430798292160034,
-0.341461181640625,
0.6376830339431763,
0.07602542638778687,
-0.309573233127594,
-0.2186841517686844,
0.011291272938251495,
-0.09521370381116867,
-0.32832711935043335,
-0.6276705861091614,
-0.11713096499443054,
0.7088223099708557,
-0.3126513957977295,
-0.11762610077857... | |
in the Style Sheet; of course if it was in a user control then you might be able to use Themes (but that depends on which version of ASP.net you are using. | [
0.3772442042827606,
-0.30146872997283936,
0.47064411640167236,
0.16505637764930725,
-0.2950717806816101,
-0.3846645951271057,
-0.029852591454982758,
0.17884793877601624,
-0.6924892067909241,
-0.5225234031677246,
-0.16699013113975525,
0.1019473746418953,
-0.21784138679504395,
-0.21794946491... | |
I'm digging into Reflection for the first time and I'm truely stuck. I've googled everything I can think of. I'm 90% where I wanna be now.
I'm trying to return the value of a Property in a custom class through Reflection.
Here's my class declaration:
```
Public Class Class2
Private newPropertyValue2 As String
... | [
0.26910698413848877,
0.2792247235774994,
0.38712799549102783,
-0.23479679226875305,
0.11490757018327713,
0.07382845133543015,
0.4318142831325531,
-0.08634119480848312,
-0.0005337493494153023,
-0.6312180757522583,
0.04767776280641556,
0.7293084263801575,
0.2288343757390976,
0.43827158212661... | |
String)
newPropertyValue2 = value
End Set
End Property
End Class
```
The class I've written to look at the class through reflection looks like this:
```
Public Class ObjectCompare
Private _OriginalObject As PropertyInfo()
Public Property OriginalObject() As PropertyInfo()
... | [
0.02187558449804783,
-0.1628401130437851,
0.3577200472354889,
-0.052923161536455154,
0.337819904088974,
-0.4439452588558197,
0.16106688976287842,
-0.44837650656700134,
-0.14166218042373657,
-0.20399050414562225,
-0.30865001678466797,
0.6791871190071106,
-0.23143044114112854,
0.511520206928... | |
Set(ByVal value As PropertyInfo())
_OriginalObject = value
End Set
End Property
Public Sub CompareObjects()
Dim property_value As Object
For i As Integer = 0 To OriginalObject.Length - 1
If OriginalObject(i).GetIndexParameters().Length = 0 Then
D... | [
0.17515377700328827,
-0.41918691992759705,
0.9368751049041748,
0.029061367735266685,
0.020948274061083794,
-0.039740633219480515,
0.04497283697128296,
-0.569169282913208,
-0.09038686752319336,
-0.3654775321483612,
-0.38280346989631653,
0.680269181728363,
-0.3565238416194916,
0.336645185947... | |
PropertyInfo = OriginalObject(i)
Try
property_value = propInfo.GetValue(Me, Nothing)
Catch ex As TargetException
End Try
End If | [
0.33910298347473145,
-0.44914186000823975,
0.44141340255737305,
0.045263223350048065,
0.1649198830127716,
-0.2800411581993103,
0.3221748173236847,
-0.5152556300163269,
0.0876372754573822,
-0.3270334303379059,
-0.2870540916919708,
0.8000423312187195,
-0.18663789331912994,
0.3470599353313446... | |
Next
End Sub
End Class
```
I put a breakpoint on the property\_value = propInfo.GetValue(Me, Nothing) line to see what the result is.
Here's how I call my code:
```
Dim test As New Class2
test.NewProperty2 = "2"
Dim go As New ObjectCompare
Dim propInf As PropertyInfo()
propInf = test.GetType.GetProperties()
g... | [
0.10656792670488358,
0.16661347448825836,
0.8605901598930359,
-0.20319566130638123,
0.19646403193473816,
-0.1845468282699585,
0.6106540560722351,
-0.38631632924079895,
-0.1980094313621521,
-0.7392319440841675,
-0.21526046097278595,
0.8101016879081726,
0.11506354063749313,
0.522649645805358... | |
appreciated. I've searched MSDN and Google to death and then on last time for fun ;)
`Me` refers to the `ObjectCompare` object, which is different than the class from which the `PropertyInfo` objects were derived (`Class2`). You need to also pass in an object of the type from which you retrieved the `PropertyInfo` obje... | [
-0.03933902829885483,
0.012367979623377323,
0.45986396074295044,
-0.02696339040994644,
-0.028669757768511772,
-0.22622574865818024,
0.4259791374206543,
-0.2093845158815384,
-0.09361956268548965,
-0.8537896275520325,
-0.08401326835155487,
0.7235664129257202,
-0.05308075621724129,
0.02689862... | |
Dim propInfo As PropertyInfo = OriginalObject(i)
Try
property_value = propInfo.GetValue(It, Nothing)
Catch ex As TargetException
End Try
End If
Next
End Sub
go.CompareObjects(test)
``` | [
0.37533363699913025,
-0.552605926990509,
0.6759426593780518,
-0.037759725004434586,
0.08032380789518356,
-0.1889907717704773,
0.4367315471172333,
-0.49239081144332886,
0.031572382897138596,
-0.312038779258728,
-0.251475065946579,
0.8388211727142334,
-0.35855352878570557,
0.2223424017429351... | |
I'm looking for a good Java obfuscator.
I've done initial research into the following Java obfuscators: proguard, yguard, retroguard, dasho, allatori, jshrink, smokescreen, jobfuscate, marvin, jbco, jode, javaguard, jarg, joga, cafebabe, donquixote, mwobfu, bbmug, zelix klassmaster, sandmark, jcloak, thicket, blufusca... | [
-0.04178350418806076,
-0.30892500281333923,
0.46568232774734497,
-0.1667858064174652,
-0.23580339550971985,
0.3916616141796112,
0.21518276631832123,
0.38523396849632263,
-0.12156477570533752,
-0.8200992345809937,
0.1379210501909256,
0.5964332222938538,
-0.2859330475330353,
-0.1983209401369... | |
much about.
What is a good java obfuscator? It doesn't need to be free, it just needs to work well and be easy to use.
I use [ProGuard](http://proguard.sourceforge.net) heavily for all my release builds and I have found it is excellent. I can't recommend it enough!
I *have* encountered obscure bugs caused by it's opt... | [
0.2434781789779663,
0.09903429448604584,
0.16149567067623138,
-0.21112847328186035,
-0.016129635274410248,
-0.2658262252807617,
0.45157691836357117,
0.24949130415916443,
-0.10418019443750381,
-0.7506997585296631,
0.05584176629781723,
0.8262743949890137,
-0.14215610921382904,
-0.16133563220... | |
to editing the text config myself, which is really very simple to do. These days I do the config by hand.
I have quite complex projects all of which involve dynamic loading and reflection. I also heavily use reflection for a callback implementation. ProGuard has coped with these very well.
EDIT: We also use DashO Pro... | [
0.1249411478638649,
-0.11985572427511215,
0.2861924171447754,
-0.08940519392490387,
-0.4205072224140167,
0.1289505660533905,
0.4627445638179779,
0.027930527925491333,
-0.0022547009866684675,
-0.6110029816627502,
-0.10823960602283478,
0.8569841980934143,
-0.1380833387374878,
-0.522486984729... | |
fair, this was circa 2001... so it might be better in current versions. | [
-0.0436290018260479,
0.07921453565359116,
0.5532240271568298,
0.06189641356468201,
-0.0266262199729681,
-0.02492348849773407,
-0.05993874743580818,
0.31035149097442627,
-0.2966740131378174,
-0.3591546416282654,
0.7381811738014221,
0.22612421214580536,
0.4419440031051636,
0.2494775205850601... | |
I'm looking at the MySQL docs [here](http://dev.mysql.com/doc/refman/5.0/en/innodb-foreign-key-constraints.html) and trying to sort out the distinction between FOREIGN KEYs and CONSTRAINTs. I thought an FK **was** a constraint, but the docs seem to talk about them like they're separate things.
The syntax for creating ... | [
-0.17686395347118378,
0.40670064091682434,
0.027524059638381004,
-0.057801976799964905,
0.057013753801584244,
0.02792935259640217,
-0.1876775026321411,
-0.0347287580370903,
-0.5819392204284668,
-0.12785367667675018,
-0.017049552872776985,
0.07839305698871613,
-0.4687133729457855,
0.1485050... | |
than a name for you FK, so if you don't specify it you get an anonymous FK?
Any clarification would be greatly appreciated.
Thanks,
Ethan
Yes, a foreign key is a type of constraint. MySQL has uneven support for constraints:
* `PRIMARY KEY`: yes as table constraint and column constraint.
* `FOREIGN KEY`: yes as tabl... | [
-0.2778758406639099,
0.14555566012859344,
0.08276977390050888,
0.04693344607949257,
-0.15844890475273132,
0.21979448199272156,
0.3280589282512665,
-0.01449324656277895,
-0.4332926571369171,
-0.3418177366256714,
0.005342515651136637,
0.14603176712989807,
-0.5374714732170105,
0.4932830929756... | |
explicitly, either to make metadata more readable or else to use the name when you want to drop the constraint. The SQL standard requires that the `CONSTRAINT` clause is optional. If you leave it out, the RDBMS creates a name automatically, and the name is up to the implementation. | [
0.5370435118675232,
0.19736352562904358,
-0.028981145471334457,
0.12777067720890045,
0.21926116943359375,
-0.5584627985954285,
-0.15237148106098175,
-0.2858455181121826,
-0.16791337728500366,
0.05899025872349739,
-0.41712531447410583,
0.6987587809562683,
-0.34727615118026733,
-0.0837886482... | |
I need to test if a file is a shortcut. I'm still trying to figure out how stuff will be set up, but I might only have it's path, I might only have the actual contents of the file (as a byte[]) or I might have both.
A few complications include that I it could be in a zip file (in this cases the path will be an interna... | [
0.44865813851356506,
-0.11445032060146332,
-0.13194112479686737,
0.08308860659599304,
0.06770019233226776,
0.12044277787208557,
0.1358581781387329,
-0.08658096194267273,
-0.23876790702342987,
-0.6588817238807678,
0.08799915015697479,
0.8634968400001526,
-0.13014276325702667,
-0.12454071640... | |
<summary>
/// Returns whether the given path/file is a link
/// </summary>
/// <param name="shortcutFilename"></param>
/// <returns></returns>
public static bool IsLink(string shortcutFilename)
{
string pathOnly = System.IO.Path.GetDirectoryName(shortcutFilename);
string filenameOnly = System.IO.Path.GetFileNam... | [
0.1102505549788475,
-0.36494725942611694,
0.8262868523597717,
-0.22738365828990936,
-0.18365827202796936,
0.2903570234775543,
0.48558396100997925,
-0.43610870838165283,
-0.3616034686565399,
-0.38265135884284973,
-0.14859937131404877,
0.5087882280349731,
-0.28559181094169617,
0.296756267547... | |
/// If path/file is a link returns the full pathname of the target,
/// Else return the original pathnameo "" if the file/path can't be found
/// </summary>
/// <param name="shortcutFilename"></param>
/// <returns></returns>
public static string GetShortcutTarget(string shortcutFilename)
{
... | [
0.16433195769786835,
-0.6279774308204651,
0.5980184078216553,
-0.2931026518344879,
-0.06929470598697662,
0.3931701183319092,
0.386257529258728,
-0.6054078340530396,
-0.31227803230285645,
-0.45734450221061707,
-0.060108721256256104,
0.5937564373016357,
-0.25237417221069336,
0.08839633315801... | |
Shell32.Folder folder = shell.NameSpace(pathOnly);
Shell32.FolderItem folderItem = folder.ParseName(filenameOnly);
if (folderItem != null)
{
if (folderItem.IsLink)
{
Shell32.ShellLinkObject link = (Shell32.ShellLinkObject)folderItem.GetLink;
... | [
-0.33648425340652466,
-0.17324025928974152,
0.44750845432281494,
-0.40682801604270935,
0.23630768060684204,
-0.13792330026626587,
0.4381128251552582,
-0.20383596420288086,
-0.024828879162669182,
-0.7418814897537231,
-0.5028959512710571,
0.7437108159065247,
-0.49644768238067627,
0.351659119... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.