text
stringlengths
0
30.5k
title
stringclasses
1 value
embeddings
listlengths
768
768
is designed to solve. In general, Microsoft is positioning these array of presentation technologies on the "**Reach vs Rich**" continuum. You have "plain old" HTML and Javascript on one end, acceptable by the most number of client machines out there, and the ultimate full-blown WPF on the other side where limited number of machines can handle. You did mention this to be an internal app, so WPF via XBAP or ClickOnce are also possible. So the scale would align this way: (reach) ASP.NET, AJAX, Silverlight, WPF (rich). So the question is just how rich you want/need it to be for the users until
[ 0.2650938928127289, -0.16589535772800446, 0.2933027148246765, 0.28491079807281494, -0.07583119720220566, -0.08426960557699203, -0.10994290560483932, 0.1319471299648285, -0.31856095790863037, -0.7731061577796936, -0.12370720505714417, 0.45311206579208374, -0.22285602986812592, -0.2083864808...
it hurts the deployment base? Frankly if all you fetch are forms and tabular data and statistics then regular ASP.NET web forms are just fine. If you want on-the-fly resizable graphs and client-side interactive with back-end WCF web services Silverlight can do that. If you want even more powerful graphical rendering than WPF via the remote deployment options is your bet.
[ 0.42911234498023987, 0.035059403628110886, 0.08527383208274841, 0.3721465766429901, -0.35271498560905457, -0.00835976842790842, 0.28990745544433594, -0.06375233083963394, -0.03984662890434265, -0.5404148101806641, 0.5242798924446106, 0.885752260684967, -0.06914923340082169, -0.260098516941...
Unchecked exceptions are alright if you want to handle every failure the same way, for example by logging it and skipping to the next request, displaying a message to the user and handling the next event, etc. If this is my use case, all I have to do is catch some general exception type at a high level in my system, and handle everything the same way. But I want to recover from specific problems, and I'm not sure the best way to approach it with unchecked exceptions. Here is a concrete example. Suppose I have a web application, built using Struts2
[ 0.15852703154087067, 0.2004590779542923, -0.08352292329072952, -0.029485292732715607, -0.20390774309635162, -0.18943347036838531, 0.5396380424499512, -0.3143036365509033, -0.41460981965065, -0.28721708059310913, -0.05029195919632912, 0.3976946473121643, -0.5559588670730591, -0.288950026035...
and Hibernate. If an exception bubbles up to my "action", I log it, and display a pretty apology to the user. But one of the functions of my web application is creating new user accounts, that require a unique user name. If a user picks a name that already exists, Hibernate throws an `org.hibernate.exception.ConstraintViolationException` (an unchecked exception) down in the guts of my system. I'd really like to recover from this particular problem by asking the user to choose another user name, rather than giving them the same "we logged your problem but for now you're hosed" message. Here are a
[ 0.798267126083374, -0.19897344708442688, 0.4064241647720337, 0.05684126913547516, -0.26556673645973206, 0.020684491842985153, 0.37254247069358826, 0.03353661298751831, -0.22031690180301666, -0.4430693984031677, 0.048590656369924545, 0.4629056453704834, -0.4140240252017975, -0.0257334448397...
few points to consider: 1. There a lot of people creating accounts simultaneously. I don't want to lock the whole user table between a "SELECT" to see if the name exists and an "INSERT" if it doesn't. In the case of relational databases, there might be some tricks to work around this, but what I'm really interested in is the general case where pre-checking for an exception won't work because of a fundamental race condition. Same thing could apply to looking for a file on the file system, etc. 2. Given my CTO's propensity for drive-by management induced by reading technology columns
[ 0.5339674949645996, 0.3259844481945038, -0.33499523997306824, 0.3783320188522339, 0.33484140038490295, -0.10382702946662903, -0.06148848682641983, 0.3312351107597351, -0.2567111849784851, -0.24655230343341827, 0.4452919065952301, 0.5010634064674377, -0.22414527833461761, 0.0110689895227551...
in "Inc.", I need a layer of indirection around the persistence mechanism so that I can throw out Hibernate and use Kodo, or whatever, without changing anything except the lowest layer of persistence code. As a matter of fact, there are several such layers of abstraction in my system. How can I prevent them from leaking in spite of unchecked exceptions? 3. One of the declaimed weaknesses of checked exceptions is having to "handle" them in every call on the stack—either by declaring that a calling method throws them, or by catching them and handling them. Handling them often means wrapping
[ 0.1808837354183197, 0.19232995808124542, 0.03506432846188545, 0.17486372590065002, -0.06098480895161629, -0.26463574171066284, 0.2502000331878662, -0.10221058875322342, -0.11805734783411026, -0.17549487948417664, 0.15392282605171204, 0.6764265894889832, -0.3420834243297577, 0.0058835749514...
them in another checked exception of a type appropriate to the level of abstraction. So, for example, in checked-exception land, a file-system–based implementation of my UserRegistry might catch `IOException`, while a database implementation would catch `SQLException`, but both would throw a `UserNotFoundException` that hides the underlying implementation. How do I take advantage of unchecked exceptions, sparing myself of the burden of this wrapping at each layer, without leaking implementation details? IMO, wrapping exceptions (checked or otherwise) has several benefits that are worth the cost: 1) It encourages you to think about the failure modes for the code you write. Basically, you have
[ 0.35287317633628845, 0.2869843542575836, -0.044972147792577744, 0.21020282804965973, 0.031148672103881836, -0.15435151755809784, 0.21111468970775604, -0.078274667263031, -0.24210195243358612, -0.43787479400634766, -0.0612802691757679, 0.5059908628463745, -0.14536698162555695, -0.0159193892...
to consider the exceptions that the code you call may throw, and in turn you'll consider the exceptions you'll throw for the code that calls yours. 2) It gives you the opportunity to add additional debugging information into the exception chain. For instance, if you have a method that throws an exception on a duplicate username, you might wrap that exception with one that includes additional information about the circumstances of the failure (for example, the IP of the request that provided the dupe username) that wasn't available to the lower-level code. The cookie trail of exceptions may help you debug
[ 0.21130163967609406, 0.06326337903738022, -0.20947258174419403, 0.34607040882110596, 0.03037290647625923, -0.3573385775089264, 0.05550713837146759, -0.2652328312397003, -0.4497561454772949, -0.38112711906433105, -0.004504943732172251, 0.43083620071411133, -0.291396826505661, -0.11741641908...
a complex problem (it certainly has for me). 3) It lets you become implementation-independent from the lower level code. If you're wrapping exceptions and need to swap out Hibernate for some other ORM, you only have to change your Hibernate-handling code. All the other layers of code will still be successfully using the wrapped exceptions and will interpret them in the same way, even though the underlying circumstances have changed. Note that this applies even if Hibernate changes in some way (ex: they switch exceptions in a new version); it's not just for wholesale technology replacement. 4) It encourages you use different
[ 0.31012049317359924, -0.16666625440120697, 0.16270363330841064, 0.18345332145690918, 0.08051630854606628, -0.3654685914516449, 0.32580259442329407, -0.4255152642726898, -0.45571720600128174, -0.6152400970458984, -0.2739097476005554, 0.4372497498989105, -0.36388862133026123, -0.281792789697...
classes of exceptions to represent different situations. For example, you may have a DuplicateUsernameException when the user tries to reuse a username, and a DatabaseFailureException when you can't check for dupe usernames due to a broken DB connection. This, in turn, lets you answer your question ("how do I recover?") in flexible and powerful ways. If you get a DuplicateUsernameException, you may decide to suggest a different username to the user. If you get a DatabaseFailureException, you may let it bubble up to the point where it displays a "down for maintenance" page to the user and send off a
[ 0.16772201657295227, 0.010468855500221252, 0.07374836504459381, 0.24957974255084991, -0.12605448067188263, -0.1252554953098297, 0.30382466316223145, -0.16721615195274353, -0.3684290945529938, -0.4717184007167816, -0.1341967135667801, 0.5048688054084778, -0.4742101728916168, 0.3209032416343...
notification email to you. Once you have custom exceptions, you have customizeable responses -- and that's a good thing.
[ 0.4115285277366638, 0.15991607308387756, 0.15093876421451569, 0.05865902453660965, -0.036428797990083694, -0.13328784704208374, 0.31410327553749084, 0.4808696210384369, -0.5755366086959839, -0.4640514850616455, -0.18738964200019836, 0.2015780210494995, -0.38924622535705566, -0.042240563780...
Right now, I keep all of my projects on my laptop. I'm thinking that I shouldn't do this, but instead use a version control system and check them in/out from an external hosting repository (Google Code, SourceForge, etc). I see several benefits here - first, I don't have to worry about losing my code if my computer crashes and burns or my external HDD crashes and burns; second, I can share my code with the world and perhaps even get more help when I need it. Is this a good idea? If so, what are some other project hosts that I
[ 0.6157005429267883, 0.4919251799583435, -0.031136568635702133, 0.30669698119163513, 0.10176565498113632, -0.36943066120147705, 0.41303056478500366, 0.3817129135131836, -0.1807839423418045, -0.6411235332489014, 0.04829291254281998, 0.5464611053466797, 0.2168959379196167, 0.24090071022510529...
should investigate (other than Google Code and SourceForge)? After losing some freelance work to a hard drive crash, I've become keen on the philosophy that "It doesn't exist until its in source control". As I don't want to necessarily share the source for my projects with the rest of the world, I pay for webhosting (using [Dreamhost](http://www.dreamhost.com) who have great deals on basic shared hosting and easy one-click installs for things like subversion) and store my data that way. They don't claim to be any sort of backup service, but all I really want is a second copy offsite somewhere. If I
[ 0.8763443231582642, 0.11245060712099075, 0.006693284492939711, 0.13894446194171906, 0.1864788830280304, -0.3833751976490021, 0.2555164396762848, 0.06614244729280472, 0.10828065127134323, -0.24482031166553497, 0.036740709096193314, 0.46373245120048523, 0.11979718506336212, 0.183460265398025...
do decide to share the code I can always make it public later. Do note that sourceforge does not allow private/personal projects, and Google Code forces you to license your code using an open source license. Both have some limitations on the number of projects you can create (and aren't really intended to store everybody and their brother's personal projects). Assembla looks pretty slick although it is hard to tell what all you get for free. I'm definitely going to try it out. There is an [extensive list](http://en.wikipedia.org/wiki/Comparison_of_open_source_software_hosting_facilities) at wikipedia.
[ 0.6824555993080139, 0.12115707993507385, -0.00915431883186102, 0.3118780255317688, -0.059654075652360916, -0.6100584864616394, 0.1398646980524063, 0.04059078171849251, -0.1322394758462906, -0.5662525296211243, 0.2203812152147293, 0.6338918805122375, 0.3011569678783417, 0.017074894160032272...
I'm trying to extend some "base" classes in Python: ``` class xlist (list): def len(self): return len(self) def add(self, *args): self.extend(args) return None class xint (int): def add(self, value): self += value return self x = xlist([1,2,3]) print x.len() ## >>> 3 ok print x ## >>> [1,2,3] ok x.add (4, 5, 6) print
[ 0.16124165058135986, -0.02921791560947895, 0.28198397159576416, -0.5504556894302368, -0.12548372149467468, 0.12516891956329346, 0.2274107038974762, -0.34637680649757385, -0.03540043532848358, -0.3520281910896301, -0.08974044024944305, 0.7265855073928833, -0.6278835535049438, -0.24579310417...
x ## >>> [1,2,3,4,5,6] ok x = xint(10) print x ## >>> 10 ok x.add (2) print x ## >>> 10 # Not ok (#1) print type(x) ## >>> <class '__main__.xint'> ok x += 5 print type(x) ## >>> <type 'int'> # Not ok (#2) ``` It works fine in the *list* case because the *append* method modifies the object "in place", without returning it. But in
[ -0.020637819543480873, 0.19884610176086426, 0.2889839708805084, -0.2974902391433716, 0.007343646138906479, -0.044257499277591705, 0.24724993109703064, -0.42787986993789673, -0.012484492734074593, -0.4698687195777893, -0.2647693157196045, 0.3392334580421448, -0.6834545135498047, -0.16629680...
the *int* case, the *add* method doesn't modify the value of the external *x* variable. I suppose that's fine in the sense that *self* is a local variable in the *add* method of the class, but this is preventing me from modifying the initial value assigned to the instance of the class. Is it possible to extend a class this way or should I define a class property with the base type and map all the needed methods to this property? `int` is a value type, so each time you do an assignment, (e.g. both instances of `+=` above), it doesn't modify
[ -0.003929315600544214, -0.06223425641655922, -0.060124415904283524, -0.08443672955036163, -0.24160274863243103, -0.09023257344961166, 0.33753588795661926, -0.13724498450756073, -0.07919912785291672, -0.5384084582328796, 0.0734851211309433, 0.6010928153991699, -0.3097371757030487, 0.1376385...
the object you have on the heap, but replaces the reference with one of the result of the right hand side of the assignment (i.e. an `int`) `list` isn't a value type, so it isn't bound by the same rules. this page has more details on the differences: [The Python Language Reference - 3. Data model](https://docs.python.org/3/reference/datamodel.html) IMO, yes, you should define a new class that keeps an int as an instance variable
[ -0.003332293825224042, -0.09670884907245636, 0.010448934510350227, 0.060849037021398544, -0.2309720516204834, -0.0427696518599987, 0.01924150064587593, -0.25599169731140137, -0.42995741963386536, -0.4855586290359497, 0.04520602896809578, 0.4099970757961273, -0.4997486472129822, 0.072405360...
This is a sql 2000 database that I am working with. I have what I call a staging table that is a raw data dump of data, so everything is ntext or nvarchar(255). I need to cast/convert all of this data into the appropriate data types (ie int, decimal, nvarchar, etc.) The way I was going to do this was to iterate through all records using a while loop and attempt a CAST on each column on a single record during each iteration, after I visit a particular record I flag it as processed (bit field). But how can I log the error
[ 0.30236417055130005, 0.3272489011287689, -0.09821537137031555, -0.15858817100524902, -0.14627334475517273, 0.03871311619877815, 0.21565088629722595, -0.31143608689308167, -0.0640827864408493, -0.5815995335578918, 0.3690601587295532, 0.30843034386634827, -0.3802889585494995, 0.3179690837860...
when/if it occurs but allow the while loop to continue. At first I implemented this using a TRY CATCH in a local SQL 2005 instance (to get the project going) and all was working well, but i learned today that the dev & production database that the international DBA's have set up is a SQL 2000 instance so I have to conform. **EDIT**: I am using a SSIS package to populate the staging table. I see that now I must revisit that package and implement a script component to handle the conversions. Thanks guys **EDIT**: I *am* doing this on a record by
[ 0.6815547347068787, 0.148993581533432, -0.00704805925488472, 0.014975436963140965, -0.025867899879813194, -0.4994606673717499, 0.49843156337738037, 0.026506265625357628, -0.30348339676856995, -0.7635299563407898, -0.04899308830499649, 0.4324459731578827, -0.1734665483236313, 0.000963012455...
record basis, not a batch insert, so the transaction idea seems like it would be feasible but I'm not sure how to trap @@ERROR and allow the stored procedure to continue. **EDIT**: I really like [Guy's approach](https://stackoverflow.com/questions/33685/sql-2000-try-catch-like-error-handling#39161), I am going to implement it this way. Generally I don't like "loop through the record" solutions as they tend to be slow and you end up writing a lot of custom code. So... Depending on how many records are in your staging table, you could post process the data with a series of SQL statements that test the columns for correctness and mark any records that
[ 0.6841673254966736, 0.00501521211117506, -0.0678512379527092, 0.18191637098789215, -0.0768008828163147, -0.42931804060935974, 0.12571671605110168, -0.2422720342874527, -0.45670759677886963, -0.20515035092830658, 0.3312808573246002, 0.6510240435600281, -0.41143202781677246, 0.08535756915807...
fail the test. i.e. ``` UPDATE staging_table SET status_code = 'FAIL_TEST_1' WHERE status_code IS NULL AND ISDATE(ntext_column1) = 0; UPDATE staging_table SET status_code = 'FAIL_TEST_2' WHERE status_code IS NULL AND ISNUMERIC(ntext_column2) = 0; etc... ``` Finally ``` INSERT INTO results_table ( mydate, myprice ) SELECT ntext_column1 AS mydate, ntext_column2 AS myprice FROM staging_table WHERE status_code IS NULL; DELETE FROM staging_table WHERE status_code IS NULL; ``` And the staging table has all the errors, that you can export and report out.
[ 0.07482064515352249, 0.37237414717674255, 0.18346017599105835, -0.3716280460357666, 0.3251969814300537, 0.20679640769958496, 0.42730119824409485, -0.2909252345561981, 0.14486204087734222, -0.5910729169845581, -0.17111115157604218, 0.40854766964912415, -0.1567300707101822, 0.203639850020408...
I'm working on a visual studio 2005 vb.net windows forms project that's been around for several years. It's full of default textboxes, labels, dropdowns, datagrids, datetime pickers -- all the standard stuff. The end result is a very gray, old-looking project. What would be the best approach to making this project look fresh and snazzy? I'd rather not rewrite the entire solution with all brand new forms objects, but would that be avoidable? I was actually just sprucing up a dialog today. A lot of it depends on what kind of application you have, and what OS it is running on. A
[ 0.342083603143692, 0.34074825048446655, 0.2717967927455902, -0.0008975204546004534, 0.02166138030588627, -0.16843324899673462, 0.02130170352756977, 0.21381719410419464, 0.0508793443441391, -0.6878052949905396, 0.04602690786123276, 0.21823298931121826, -0.14041903614997864, 0.17054192721843...
couple of these tips will certainly go a long way to jazzing things up. 1. Ensure adequate spacing between controls — don't cram them all together. Space is appealing. You might also trying flowing the controls a little differently when you have more space. 2. Put in some new 3D and glossy images. You can put a big yellow exclamation mark on a custom warning dialog. Replace old toolbar buttons with new ones. Two libraries I have used and like are [GlyFX](http://www.glyfx.com/) and [IconExperience](http://www.iconexperience.com/). You can find free ones too. Ideally get a graphic artist to make some custom ones for the
[ 0.3968074917793274, -0.09276513755321503, 0.361173152923584, 0.48146864771842957, -0.11730822920799255, 0.10909635573625565, -0.07258951663970947, -0.010678552091121674, -0.3801562488079071, -0.6050694584846497, 0.18505771458148956, 0.4590073227882385, -0.35815855860710144, -0.258371949195...
specific actions your application does to fill in between the common ones you use (make sure they all go together). That will go a long way to making it look fancy. 3. Try a different font. Tahoma is a good one. Often times the default font is MS Sans Serif. You can do better. Avoid Times New Roman and Comic Sans though. Also avoid large blocks of bold — use it sparingly. Generally you want all your fonts the same, and only use different fonts sparingly to set certain bits of text apart. 4. Add subdued colors to certain controls. This is
[ 0.3205847442150116, -0.3506004512310028, 0.30076101422309875, 0.311771959066391, -0.24374498426914215, 0.15316776931285858, 0.32506346702575684, -0.09043493866920471, -0.18105705082416534, -0.8602538704872131, 0.016455765813589096, 0.633662223815918, -0.42208653688430786, -0.39798450469970...
a tricky one. You always want to use subdued colors, nothing bright or stark usually, but the colors should indicate something, or if you have a grid you can use it to show logical grouping. This is a slippery slope. Be aware that users might change their system colors, which will change how your colors look. Ideally give them a few color themes, or the ability to change colors. 5. Instead of thinking eye-candy, think usability. Make the most common course of action obvious. Mark Miller of DevExpress has a great talk on the Science of User Interface Design. I actually
[ 0.35097736120224, -0.18586744368076324, -0.0735727846622467, 0.44806769490242004, -0.011587116867303848, -0.08745764195919037, 0.2135925441980362, 0.08245309442281723, -0.11996571719646454, -0.7268203496932983, -0.04303785413503647, 0.7867622375488281, -0.23624685406684875, -0.451799184083...
have a video of it and might be able to post it online with a little clean-up. 6. Invest in a few good quality 3rd party controls. Replacing all your controls could be a pain, but if you are using the default grids for example, you would really jazz it up with a good grid from [DevExpress](http://www.devexpress.com/) or some other component vendor. Be aware that different vendors have different philosophies for how their components are used, so swapping them out can be a bit of a pain. Start small to test the waters, and then try something really complicated before you
[ 0.6557013988494873, -0.322182834148407, 0.059763699769973755, 0.7003315091133118, -0.04949460178613663, -0.17501762509346008, 0.13700422644615173, -0.39901089668273926, -0.11955719441175461, -0.663543164730072, 0.13737325370311737, 0.5988450050354004, -0.07796826958656311, -0.2026964724063...
commit to replacing all of them. The only thing worse then ugly grids is ugly grids mixed with pretty grids. Consistency is golden! 7. You also might look at replacing your old tool bars and menus with a Ribbon Control like Microsoft did in Office 2007. Then everyone will think you are really uptown! Again only replacing key components and UI elements without thinking you need to revamp the whole UI. 8. Of course pay attention to the basics like tab order, etc. Consistency, consistency, consistency. Some apps lend themselves to full blown skinning, while others don't. Generally you don't want anything flashy
[ 0.013878853060305119, -0.11799760162830353, 0.8466441035270691, 0.30007678270339966, 0.031540583819150925, -0.06616810709238052, 0.3844144344329834, 0.1464000791311264, -0.529166579246521, -0.6131426692008972, -0.06496324390172958, 0.9098148345947266, -0.2103586196899414, -0.31418314576148...
that gets used a lot.
[ 0.48752424120903015, 0.3937443792819977, 0.0021204238291829824, -0.056954193860292435, 0.038013529032468796, -0.1351167857646942, 0.07600460946559906, 0.13170252740383148, -0.060205403715372086, -0.2530917227268219, 0.22351041436195374, 0.3067200481891632, 0.25162628293037415, -0.010744506...
So I've got a `JPanel` implementing `MouseListener` and `MouseMotionListener`: ``` import javax.swing.*; import java.awt.*; import java.awt.event.*; public class DisplayArea extends JPanel implements MouseListener, MouseMotionListener { public DisplayArea(Rectangle bounds, Display display) { setLayout(null); setBounds(bounds); setOpaque(false); setPreferredSize(new Dimension(bounds.width, bounds.height)); this.display = display; } public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D)g;
[ 0.3031820058822632, -0.177198126912117, 0.7660932540893555, -0.34813112020492554, -0.17174340784549713, 0.2028997391462326, 0.16444405913352966, -0.5020106434822083, -0.12796702980995178, -0.8284056186676025, -0.13997849822044373, 0.5112144947052002, -0.18316945433616638, 0.009063591249287...
if (display.getControlPanel().Antialiasing()) { g2.addRenderingHints(new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON)); } g2.setColor(Color.white); g2.fillRect(0, 0, getWidth(), getHeight()); } public void mousePressed(MouseEvent event) { System.out.println("mousePressed()"); mx1 = event.getX(); my1 = event.getY(); }
[ -0.026026412844657898, -0.23018433153629303, 0.4368618130683899, -0.3783111870288849, 0.2662898004055023, 0.5382354259490967, 0.4441918730735779, -0.2797810733318329, -0.16103212535381317, -0.6934584975242615, -0.3756253123283386, 0.7468312382698059, -0.32555916905403137, 0.200801640748977...
public void mouseReleased(MouseEvent event) { System.out.println("mouseReleased()"); mx2 = event.getX(); my2 = event.getY(); int mode = display.getControlPanel().Mode(); switch (mode) { case ControlPanel.LINE: System.out.println("Line from " + mx1 + ", " + my1 + " to " + mx2 + ", " + my2 + ".");
[ -0.14267714321613312, -0.49007880687713623, 0.4288317859172821, -0.2493261992931366, 0.4671410322189331, 0.3125470280647278, 0.2348632663488388, -0.08956555277109146, -0.25852906703948975, -0.37897929549217224, -0.49307408928871155, 0.7995430827140808, -0.37107378244400024, 0.0277996845543...
} } public void mouseEntered(MouseEvent event) { System.out.println("mouseEntered()"); } public void mouseExited(MouseEvent event) { System.out.println("mouseExited()"); } public void mouseClicked(MouseEvent event) { System.out.println("mouseClicked()"); } public void mouseMoved(MouseEvent event) { System.out.println("mouseMoved()"); } public void mouseDragged(MouseEvent event) {
[ -0.22553694248199463, -0.36566802859306335, 0.19726909697055817, -0.21318015456199646, 0.31021830439567566, 0.010753365233540535, 0.33525294065475464, 0.06890497356653214, -0.12513580918312073, -0.4949152171611786, -0.1862042099237442, 0.9677291512489319, -0.2637377679347992, 0.08148843050...
System.out.println("mouseDragged()"); } private Display display = null; private int mx1 = -1; private int my1 = -1; private int mx2 = -1; private int my2 = -1; } ``` The trouble is, none of these mouse functions are ever called. `DisplayArea` is created like this: ``` da = new DisplayArea(new Rectangle(CONTROL_WIDTH, 0, DISPLAY_WIDTH, DISPLAY_HEIGHT), this); ``` I am not really a Java programmer (this is part of an assignment), but I can't see anything glaringly obvious. Can someone smarter than I see
[ -0.17297951877117157, -0.1489441841840744, 0.3242538869380951, -0.21084146201610565, -0.014522678218781948, 0.09395032376050949, 0.31690898537635803, -0.022341413423419, -0.2887236475944519, -0.7807067036628723, -0.0854460671544075, 0.539243221282959, -0.3984403908252716, 0.174367159605026...
anything? The *implements mouselistener, mousemotionlistener* just allows the displayArea class to listen to some, to be defined, Swing component's mouse events. You have to explicitly define what it should be listening at. So I suppose you could add something like this to the constructor: ``` this.addMouseListener(this); this.addMouseMotionListener(this); ```
[ 0.6329730153083801, -0.19890443980693817, 0.17787931859493256, 0.000842724519316107, 0.04288843646645546, -0.4290454387664795, 0.32604530453681946, -0.278603732585907, -0.13169924914836884, -0.43370088934898376, 0.02826116979122162, 0.8322485089302063, -0.3367042541503906, -0.3250417113304...
Using C# and System.Data.SqlClient, is there a way to retrieve a list of parameters that belong to a stored procedure on a SQL Server before I actually execute it? I have an a "multi-environment" scenario where there are multiple versions of the same database schema. Examples of environments might be "Development", "Staging", & "Production". "Development" is going to have one version of the stored procedure and "Staging" is going to have another. All I want to do is validate that a parameter is going to be there before passing it a value and calling the stored procedure. Avoiding that SqlException rather than
[ 0.42988017201423645, 0.1540336310863495, -0.11272281408309937, 0.07132593542337418, 0.17904877662658691, -0.027917921543121338, -0.1418638676404953, -0.22781147062778473, -0.2174631953239441, -0.361826628446579, 0.33544832468032837, 0.6187758445739746, -0.4014803469181061, 0.12668505311012...
having to catch it is a plus for me. Joshua You can use SqlCommandBuilder.DeriveParameters() (see [SqlCommandBuilder.DeriveParameters - Get Parameter Information for a Stored Procedure - ADO.NET Tutorials](https://web.archive.org/web/20110304121600/http://www.davidhayden.com/blog/dave/archive/2006/11/01/SqlCommandBuilderDeriveParameters.aspx)) or there's [this way](http://www.codeproject.com/KB/database/enumeratesps.aspx) which isn't as elegant.
[ 0.22639784216880798, -0.5898423790931702, 0.20277997851371765, 0.1796623170375824, -0.27092909812927246, -0.21866445243358612, 0.2737874686717987, 0.028066853061318398, -0.35642072558403015, -0.46815696358680725, 0.5263113379478455, 0.437970370054245, -0.36409929394721985, 0.00613631680607...
I run Flex Builder 3 on a mac and as my project grows - the compile time gets longer and longer and longer. I am using some SWC's and there is a fair amount of code but it shouldn't take minutes to build and crash daily should it? In addition to the suggestions already mentioned, close any projects that you have open that you are not using. Rich click on the Project in the Navigator view and select "Close Unrelated Projects". Depending on how many projects you have open, this can lead to a significant improvements in compile time, as well as all
[ 0.4291127920150757, 0.15890182554721832, 0.5076494216918945, -0.19955886900424957, -0.16503596305847168, -0.26532766222953796, 0.3804713189601898, -0.1525329053401947, -0.14687028527259827, -0.9416760802268982, -0.026815669611096382, 1.034470796585083, -0.1533132791519165, -0.1301545500755...
around performance. mike chambers mesh@adobe.com
[ 0.5150413513183594, 0.2150033861398697, -0.16803832352161407, -0.1863434910774231, -0.11872659623622894, -0.11203117668628693, 0.6409053802490234, 0.052106183022260666, -0.0998128280043602, -0.6698909997940063, -0.12561587989330292, 0.45972251892089844, -0.09555792808532715, -0.37120562791...
I noticed that many people here use [TextMate](http://macromates.com/) for coding on OS X. I've recently started using it, and although I like its minimalistic interface, it makes it harder to stumble upon cool features if you don't know what you're looking for. So, what feature have you found most helpful for coding (mainly in Python)? Are there any third-party bundles I should know about, besides what's included? Don't neglect the 'mate' command line tool. You can use it to pipe output into TextMate, so if you do the following... ``` diff file1.py file2.py | mate ``` ...it will not only open in TextMate, but it is
[ 0.2898203134536743, 0.10743808001279831, 0.19854950904846191, -0.16697777807712555, 0.11669572442770004, -0.31690990924835205, 0.08806032687425613, 0.09957051277160645, 0.02226855605840683, -0.78993159532547, -0.17320500314235687, 0.5398736596107483, -0.4582422971725464, -0.120794355869293...
smart enough to know that you're looking at a diff and highlight lines on screen. TextMate's SVN integration is great; it also seems to have bundles for some other version control systems as well. Add GetBundle to browse the bundle repository. I found the jQuery bundle through it and it's very handy. As others have mentioned, rolling your own bundle for frequently used snippets is very helpful. If you have some snippets that are specific to a project or framework, you might want to prefix all of them with a common letter to keep the namespace tidy.
[ 0.5504351258277893, -0.4021816551685333, 0.20426976680755615, 0.3841485381126404, -0.12478434294462204, -0.29734089970588684, 0.06468241661787033, 0.3454699218273163, -0.38185980916023254, -0.6533042788505554, -0.2274426817893982, 0.44043710827827454, 0.10850845277309418, -0.05605758354067...
This is a follow on question to "[How do I delete 1 file from a revision in SVN?](https://stackoverflow.com/questions/33778/how-do-i-delete-1-file-from-a-revision-in-svn)" but because it probably has a very different answer and I believe that others would benefit from knowing the answer. (I don't know the answer yet.) The previous question was answered and I discovered that it is not possible to remove a revision from SVN. The second best solution was to remove the file from SVN, commit and then add the file back and commit again. I now want to make sure that the original file's revision history has gone. So I am hoping
[ -0.024487048387527466, 0.02568218670785427, 0.4494173228740692, 0.018585527315735817, 0.18112611770629883, -0.19362500309944153, 0.24566246569156647, -0.012054755352437496, -0.5751690864562988, -0.4771685302257538, -0.15192408859729767, 0.3116128444671631, -0.00978850293904543, 0.468814015...
that the answer to the question "**How can I find the revision history of the file that was deleted and then resubmitted to SVN?**" is that you can't. With a simple ``` svn log -v [folder] ``` you can browse quickly the adding and deletion. ``` ------------------------------------------------------------------------ r14 | kame | 2008-08-29 04:23:43 +0200 (ven., 29 aoû2008) | 1 line Chemins modifié : A /a.txt Readded a ------------------------------------------------------------------------ r13 | kame | 2008-08-29 04:23:24 +0200 (ven., 29 aoû2008) | 1 line Chemins modifié : D /a.txt Delete a ------------------------------------------------------------------------ r12 | kame | 2008-08-29 04:23:06 +0200 (ven., 29 aoû2008) | 1 line Chemins modifié : A /a.txt ``` svn log won't show
[ -0.453154981136322, 0.2690103054046631, 0.43232235312461853, 0.08927946537733078, 0.1592342108488083, 0.2885003983974457, 0.6698975563049316, -0.05425010994076729, -0.39761069416999817, -0.4839261472225189, -0.5384358167648315, 0.7236011624336243, -0.14884315431118011, 0.27580809593200684,...
the file, svn diff will pretend that the old revision does not exist, but a svn checkout targeting the old revision will happily give you the old file.
[ 0.25762540102005005, 0.018566541373729706, 0.7736585736274719, 0.05346192419528961, 0.1850450187921524, -0.34996822476387024, 0.1933278739452362, 0.15939122438430786, -0.20824962854385376, -0.3339959681034088, -0.4836234748363495, 0.5817583203315735, -0.2940629720687866, 0.4305884838104248...
In Ruby on Rails, I'm attempting to update the `innerHTML` of a div tag using the `form_remote_tag` helper. This update happens whenever an associated select tag receives an onchange event. The problem is, `<select onchange="this.form.submit();">`; doesn't work. Nor does `document.forms[0].submit()`. The only way to get the onsubmit code generated in the form\_remote\_tag to execute is to create a hidden submit button, and invoke the click method on the button from the select tag. Here's a working ERb partial example. ``` <% form_remote_tag :url => product_path, :update => 'content', :method => 'get' do -%> <% content_tag :div, :id => 'content' do -%>
[ 0.16466648876667023, -0.09034298360347748, 0.32084500789642334, -0.14892370998859406, -0.17757201194763184, -0.13095204532146454, 0.3201165795326233, -0.10221992433071136, 0.173789381980896, -0.7882063984870911, 0.14418037235736847, 0.5393557548522949, -0.49000293016433716, 0.2357091456651...
<%= select_tag :update, options_for_select([["foo", 1], ["bar", 2]]), :onchange => "this.form.commit.click" %> <%= submit_tag 'submit_button', :style => "display: none" %> <% end %> <% end %> ``` What I want to do is something like this, but it doesn't work. ``` <% form_remote_tag :url => product_path, :update => 'content', :method => 'get' do -%> <% content_tag :div, :id => 'content' do -%> # the following line does not work <%= select_tag :update, options_for_select([["foo", 1], ["bar", 2]]), :onchange => "this.form.onsubmit()" %> <% end %> <% end %> ``` So, is there any way to remove
[ 0.10630947351455688, 0.02838285081088543, 0.8179752826690674, -0.35959452390670776, 0.3253166377544403, 0.04078172892332077, 0.27800947427749634, -0.24483905732631683, -0.011814173310995102, -0.5124014616012573, -0.2952354848384857, 0.5934041738510132, -0.4421572685241699, 0.29248061776161...
the invisible submit button for this use case? There seems to be some confusion. So, let me explain. The basic problem is that `submit()` doesn't call the `onsubmit()` code rendered into the form. The actual HTML form that Rails renders from this ERb looks like this: ``` <form action="/products/1" method="post" onsubmit="new Ajax.Updater('content', '/products/1', {asynchronous:true, evalScripts:true, method:'get', parameters:Form.serialize(this)}); return false;"> <div style="margin:0;padding:0"> <input name="authenticity_token" type="hidden" value="4eacf78eb87e9262a0b631a8a6e417e9a5957cab" /> </div> <div id="content"> <select id="update" name="update" onchange="this.form.commit.click"> <option value="1">foo</option> <option value="2">bar</option> </select> <input
[ -0.2346692979335785, -0.27908697724342346, 0.459198921918869, 0.03233037143945694, -0.2769787609577179, 0.06172028183937073, 0.15059420466423035, -0.3607167899608612, 0.09058244526386261, -0.5970672965049744, -0.03716999292373657, 0.4844864308834076, -0.42852583527565, -0.12156818807125092...
name="commit" style="display: none" type="submit" value="submit_button" /> </div> </form> ``` I want to axe the invisible submit button, but using a straight form.submit appears to not work. So, I need some way to call the form's onsubmit event code. Update: Orion Edwards solution would work if there wasn't a `return(false);` generated by Rails. I'm not sure which is worse though, sending a phantom click to an invisible submit button or calling eval on the `getAttribute('onsubmit')` call after removing the return call with a javascript string replacement! If you didn't actually want to submit the form, but just invoke whatever code happened to be in the
[ 0.1348404884338379, -0.08698663115501404, 0.3122963011264801, -0.023630782961845398, -0.30121856927871704, -0.13619594275951385, 0.7170565724372864, -0.3827895224094391, -0.14389747381210327, -0.528141975402832, -0.3140605092048645, 0.6954242587089539, -0.5069676041603088, -0.2200684696435...
onsubmit, you could possibly do this: (untested) ``` var code = document.getElementById('formId').getAttribute('onsubmit'); eval(code); ```
[ 0.033136021345853806, -0.09642680734395981, 0.39713919162750244, 0.04354340583086014, 0.10728460550308228, -0.2321840524673462, 0.48600485920906067, -0.251707524061203, -0.04268188402056694, -0.3358151912689209, -0.43960195779800415, 0.3849380612373352, -0.5502746105194092, 0.2064001262187...
I'm looking for a library to handle [iCalendar](http://en.wikipedia.org/wiki/ICalendar) data in Java. Open source, well-documented implementations with a good object model are preferred. iCal parsing capabilities are less important to me, but still nice to have. Does anyone have any recommendations? I had limited success with [iCal4j](https://github.com/ical4j/ical4j) ([intro](http://ical4j.sourceforge.net/introduction.html)) on a project last year. It seems to be a fairly popular choice for ical work in the java community. If I remember correctly the API can be slightly confusing at first glance. However It's pretty solid in the long run. Good luck, Brian
[ 0.2817280888557434, 0.2048698514699936, -0.057633016258478165, 0.2441263049840927, -0.059502214193344116, -0.3500744104385376, 0.3781551122665405, 0.1984354555606842, -0.5063216686248779, -0.680141806602478, 0.07206019759178162, 0.2557653784751892, 0.08310233056545258, -0.09439660608768463...
Whilst starting to learn lisp, I've come across the term *tail-recursive*. What does it mean exactly? Consider a simple function that adds the first N natural numbers. (e.g. `sum(5) = 0 + 1 + 2 + 3 + 4 + 5 = 15`). Here is a simple JavaScript implementation that uses recursion: ```js function recsum(x) { if (x === 0) { return 0; } else { return x + recsum(x - 1); } } ``` If you called `recsum(5)`, this is what the JavaScript
[ 0.06607817113399506, -0.3492683470249176, 0.27405238151550293, -0.17855620384216309, -0.36352264881134033, -0.23298490047454834, 0.3015015721321106, -0.5255134701728821, -0.2937973439693451, -0.12087149173021317, -0.2759780287742615, 0.5482319593429565, -0.5212089419364929, -0.065503031015...
interpreter would evaluate: ```js recsum(5) 5 + recsum(4) 5 + (4 + recsum(3)) 5 + (4 + (3 + recsum(2))) 5 + (4 + (3 + (2 + recsum(1)))) 5 + (4 + (3 + (2 + (1 + recsum(0))))) 5 + (4 + (3 + (2 + (1 + 0)))) 5 + (4 + (3 + (2 + 1))) 5 + (4 + (3 + 3)) 5 + (4 + 6) 5 + 10 15 ``` Note how every recursive call has to complete before the JavaScript interpreter begins to actually do the work of calculating the sum. Here's a tail-recursive version of the same function: ```js function tailrecsum(x, running_total = 0) { if
[ -0.192948117852211, -0.14038246870040894, 0.28787022829055786, -0.40069690346717834, -0.2056504637002945, 0.20466312766075134, 0.592934250831604, -0.7019065618515015, 0.08901501446962357, -0.07447797060012817, -0.2489253133535385, 0.6325106620788574, -0.32230454683303833, -0.36585983633995...
(x === 0) { return running_total; } else { return tailrecsum(x - 1, running_total + x); } } ``` Here's the sequence of events that would occur if you called `tailrecsum(5)`, (which would effectively be `tailrecsum(5, 0)`, because of the default second argument). ```js tailrecsum(5, 0) tailrecsum(4, 5) tailrecsum(3, 9) tailrecsum(2, 12) tailrecsum(1, 14) tailrecsum(0, 15) 15 ``` In the tail-recursive case, with each evaluation of the recursive call, the `running_total` is updated. *Note: The original answer used examples from Python. These have been changed to JavaScript, since Python interpreters don't support [tail call
[ -0.01988878846168518, -0.20051032304763794, 0.21254444122314453, -0.27519601583480835, -0.09347230941057205, 0.1122022345662117, 0.2968948185443878, -0.21111169457435608, -0.195219025015831, -0.13942313194274902, -0.3316308557987213, 0.5594769716262817, -0.6301749348640442, -0.063090249896...
optimization](https://stackoverflow.com/questions/310974/what-is-tail-call-optimization). However, while tail call optimization is [part of the ECMAScript 2015 spec](https://www.ecma-international.org/ecma-262/6.0/#sec-tail-position-calls), most JavaScript interpreters [don't support it](https://kangax.github.io/compat-table/es6/#test-proper_tail_calls_(tail_call_optimisation)).*
[ -0.5941173434257507, -0.30807483196258545, 0.514004647731781, 0.06686369329690933, -0.04033418372273445, -0.10135997086763382, -0.01807597652077675, -0.36447691917419434, 0.015641167759895325, -0.3659358024597168, -0.31114304065704346, 0.6144488453865051, -0.6261813640594482, -0.4732285737...
What is the minimum I need to add to a .NET 2.0 WebSite's web.config to make it .NET 3.5? Visual Studio adds all the config sections and script handlers, but if you aren't using those are they are really necessary? Is there a command line tool to "upgrade" a .NET 2.0 web.config to 3.5? There is a good description of the 3.5 web.config available here: <https://web.archive.org/web/20211020153237/https://www.4guysfromrolla.com/articles/121207-1.aspx> The assemblies and config sections are important because they tell the runtime to use the new 3.5 dlls instead of the 2.0 dlls The *codedom* section tells the compiler to use 3.5. If you're not using ASP.Net Ajax you can
[ 0.5534670948982239, 0.052772026509046555, 0.1660679578781128, -0.017786134034395218, -0.1665576845407486, -0.17068348824977875, 0.15949878096580505, -0.19777175784111023, -0.10674756020307541, -0.945014476776123, 0.07554931938648224, 0.9774218201637268, -0.22026030719280243, -0.45294517278...
probably skip the rest. I've never tested that though.
[ 0.5285841822624207, 0.31981438398361206, -0.17252206802368164, -0.1708870381116867, -0.10486672073602676, -0.19310593605041504, 0.23418079316616058, 0.3600539565086365, -0.15397441387176514, -0.07994221150875092, 0.4946734309196472, 0.14373232424259186, 0.20075421035289764, -0.204959362745...
Could someone tell me what the units the `SetTimeout(int)` method in the `ICriteria` interface uses? Is it milliseconds, seconds, minutes or other? A little bit of poking around suggests that it could be seconds: Assuming that ICriteria is the same as the Criteria interface in Hibernate core, then the JavaDoc for [org.hibernate.Criteria](http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Criteria.html#setTimeout(int)) provides a hint - the "see also" link to [java.sql.Statement.setQueryTimeout()](http://java.sun.com/j2se/1.3/docs/api/java/sql/Statement.html#setQueryTimeout(int)). The latter refers to its timeout parameter as seconds. Assuming that the NHibernate implementation follows the implied contract of that method, then that should be fine. However, for peace of mind's sake, I went and looked for some NHibernate specific
[ 0.3851069211959839, -0.3711078464984894, 0.4627763628959656, -0.01355348527431488, -0.18814757466316223, 0.1204855889081955, 0.01095231156796217, -0.4113575220108032, -0.161082923412323, -0.39586758613586426, 0.31574416160583496, 0.22010281682014465, 0.029200812801718712, 0.248484343290328...
stuff. There are various references to CommandTimeout; for example, [here](http://svn.quanticosoft.com/devage/Eucalypto/Eucalypto1/Eucalypto/Transactions/TransactionScope.cs), related to NHibernate. Sure enough, the [documentation for CommandTimeout](http://msdn.microsoft.com/en-us/library/ms678265(VS.85).aspx) states that it's seconds. I almost didn't post the above, because I don't know the answer outright, and can't find any concrete documentation - but since there is so little on the issue, I figured it couldn't hurt to present these findings.
[ -0.08369207382202148, -0.37704309821128845, 0.27864542603492737, 0.2534577250480652, 0.201539546251297, -0.26850709319114685, 0.18090298771858215, 0.16147157549858093, -0.44385841488838196, -0.29821956157684326, -0.24998341500759125, 0.2119012176990509, 0.01541126612573862, 0.0884646922349...
I would like to retrieve the ethernet address of the network interface that is used to access a particular website. How can this be done in Java? **Solution** Note that the accepted solution of `getHardwareAddress` is only available in Java 6. There does not seem to be a solution for Java 5 aside from executing i(f|p)confing. [java.net.NetworkInterface.getHardwareAddress](http://java.sun.com/javase/6/docs/api/java/net/NetworkInterface.html#getHardwareAddress%28%29) (method added in Java 6) It has to be called on the machine you are interested in - the MAC is not transferred across network boundaries (i.e. LAN and WAN). If you want to make use of it on a website server to interrogate the clients, you'd
[ -0.03195180743932724, 0.034133292734622955, 0.6206218004226685, 0.025224752724170685, 0.14576511085033417, -0.24788625538349152, 0.27095481753349304, -0.2443104088306427, -0.08832085132598877, -0.965219259262085, -0.023868378251791, 0.7114542126655579, -0.1630340814590454, -0.1574892550706...
have to run an applet that would report the result back to you. For Java 5 and older I found code [parsing output of command line tools on various systems](http://forums.sun.com/thread.jspa?messageID=3424868#4204392).
[ 0.388021320104599, 0.28816497325897217, 0.03021860122680664, -0.11895011365413666, 0.22762233018875122, -0.12302566319704056, 0.5112059116363525, -0.00701261917129159, -0.20968510210514069, -0.4776183068752289, -0.18053120374679565, 0.38910067081451416, -0.2870977222919464, -0.084723018109...
How would you go about finding out how much memory is being used by an object? I know it is possible to find out how much is used by a block of code, but not by an instantiated object (anytime during its life), which is what I want. **There's no easy way to find out the memory size of a python object**. One of the problems you may find is that Python objects - like lists and dicts - may have references to other python objects (in this case, what would your size be? The size containing the size of each
[ 0.4625246822834015, 0.1490461677312851, -0.19506217539310455, 0.23182731866836548, -0.01973848231136799, -0.08531684428453445, 0.2369251251220703, 0.14129739999771118, -0.5459351539611816, -0.4885151982307434, 0.05164554715156555, 0.3867153227329254, -0.15132294595241547, 0.035244550555944...
object or not?). There are some pointers overhead and internal structures related to object types and garbage collection. Finally, some python objects have non-obvious behaviors. For instance, lists reserve space for more objects than they have, most of the time; dicts are even more complicated since they can operate in different ways (they have a different implementation for small number of keys and sometimes they over allocate entries). There is a [big chunk of code](http://code.activestate.com/recipes/544288/) (and an [updated big chunk of code](http://code.activestate.com/recipes/546530/)) out there to try to best approximate the size of a python object in memory. You may also want
[ 0.34369221329689026, -0.14450116455554962, -0.04495873302221298, 0.17527224123477936, -0.06609690934419632, 0.018068764358758926, 0.40076518058776855, 0.0721491202712059, -0.4115663766860962, -0.4893140196800232, -0.2185036689043045, 0.2902716100215912, -0.22358256578445435, 0.030722282826...
to check some [old description about PyObject](http://mail.python.org/pipermail/python-list/2002-March/135223.html) (the internal C struct that represents virtually all python objects).
[ -0.05312443897128105, -0.035792604088783264, 0.09058757871389389, -0.17100246250629425, -0.3930358290672302, 0.013204425573348999, 0.20561346411705017, 0.07966982573270798, -0.4162638187408447, 0.12764285504817963, -0.1947181224822998, 0.15838363766670227, -0.2722812592983246, -0.012131677...
I want to query a number of different databases mainly Oracle and Informix. Can anyone suggest me some tool using which I can do this easily? Try WinSQL lite at <http://www.indus-soft.com/SynametricsWebApp/WinSQL.jsp>. It is absolutely free and does not expire. It is only one file and does not come with any bulky DLLs. If you don't like it, simply delete the file from your hard drive. An introduction about how to use it against an informix database can be found in [this article](http://www.inquiry.com/techtips/info_pro/10min/10min0700/10min0700.asp).
[ 0.47871431708335876, -0.18046607077121735, 0.5058728456497192, 0.28217777609825134, 0.0948098823428154, -0.41736671328544617, 0.18254749476909637, 0.33766013383865356, 0.04705790802836418, -0.5673894286155701, 0.19886896014213562, 0.42315971851348877, 0.12327519059181213, 0.272229820489883...
I downloaded and installed the Aptana Studio free version. But apparently, to install the Radrails plugin for ruby on rails development you have to connect to the internet. I don't have internet on my machine right now. So is there a way I could download the installer from another machine and copy it over my existing Aptana installation? Update: Found a link for download [here](http://update.aptana.com/install/rails/3.2/) (Access denied now) I wrote down [my duel with Aptana Rails](http://madcoderspeak.blogspot.com/2008/02/showmethemoney-15-aptana-radrails-hell.html) - See if this helps you. There is a link on manual installation that may be what you're looking for.
[ 0.311172753572464, -0.023710789158940315, -0.051136236637830734, -0.008479581214487553, -0.4744724929332733, 0.13629211485385895, 0.6342537999153137, -0.20373332500457764, 0.18322286009788513, -0.6913004517555237, 0.3772834241390228, 1.033341646194458, -0.2956535518169403, 0.03824010491371...
What is the difference between Build Solution and Batch Build in Visual Studio 2008? The key point which seems to be missed in both the existing answers is that batch build allows you to build *multiple configurations* of each project (e.g. you can build debug *and* release configurations with a single operation). With a normal build, you have to use the configuration manager to select just one configuration for each project.
[ 0.2527172565460205, -0.05174264311790466, -0.15219980478286743, -0.05500202625989914, -0.1502484679222107, 0.17610551416873932, 0.25499123334884644, -0.1853637397289276, -0.18591949343681335, -0.6510635614395142, 0.0895225778222084, 0.5215452909469604, -0.3687494397163391, 0.08700170367956...
Given the key for some registry value (e.g. HKEY\_LOCAL\_MACHINE\blah\blah\blah\foo) how can I: 1. Safely determine that such a key exists. 2. Programmatically (i.e. with code) get its value. I have absolutely no intention of writing anything back to the registry (for the duration of my career if I can help it). So we can skip the lecture about every molecule in my body exploding at the speed of light if I write to the registry incorrectly. Prefer answers in C++, but mostly just need to know what the special Windows API incantation to get at the value is. **Here is some pseudo-code to retrieve
[ 0.34462857246398926, 0.2943706214427948, 0.31638285517692566, 0.13844193518161774, 0.07850951701402664, -0.36855411529541016, 0.5044926404953003, -0.3920780122280121, -0.04271361604332924, -0.5774247646331787, -0.267610102891922, 0.458548367023468, -0.13551300764083862, -0.0113975573331117...
the following:** 1. If a registry key exists 2. What the default value is for that registry key 3. What a string value is 4. What a DWORD value is **Example code:** Include the library dependency: Advapi32.lib ``` HKEY hKey; LONG lRes = RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Perl", 0, KEY_READ, &hKey); bool bExistsAndSuccess (lRes == ERROR_SUCCESS); bool bDoesNotExistsSpecifically (lRes == ERROR_FILE_NOT_FOUND); std::wstring strValueOfBinDir; std::wstring strKeyDefaultValue; GetStringRegKey(hKey, L"BinDir", strValueOfBinDir, L"bad"); GetStringRegKey(hKey, L"", strKeyDefaultValue, L"bad"); LONG GetDWORDRegKey(HKEY hKey, const std::wstring &strValueName, DWORD &nValue, DWORD nDefaultValue) { nValue = nDefaultValue; DWORD dwBufferSize(sizeof(DWORD)); DWORD nResult(0); LONG nError = ::RegQueryValueExW(hKey, strValueName.c_str(),
[ -0.23682309687137604, -0.13023601472377777, 0.40910282731056213, -0.201640322804451, 0.2890186309814453, 0.10836122184991837, 0.4195943772792816, -0.3658384084701538, 0.07581289857625961, -0.3859829604625702, -0.5718711614608765, 0.6839616894721985, -0.2614069879055023, 0.3282962739467621,...
0, NULL, reinterpret_cast<LPBYTE>(&nResult), &dwBufferSize); if (ERROR_SUCCESS == nError) { nValue = nResult; } return nError; } LONG GetBoolRegKey(HKEY hKey, const std::wstring &strValueName, bool &bValue, bool bDefaultValue) { DWORD nDefValue((bDefaultValue) ? 1 : 0); DWORD nResult(nDefValue); LONG nError = GetDWORDRegKey(hKey, strValueName.c_str(), nResult, nDefValue); if (ERROR_SUCCESS == nError)
[ -0.40263882279396057, -0.05839110538363457, 0.7571827173233032, -0.4278950095176697, 0.09023778885602951, 0.2703249752521515, 0.5493088364601135, -0.522394061088562, 0.02048185095191002, -0.12116389721632004, -0.7754940986633301, 0.6108241677284241, -0.14846746623516083, 0.2627794146537781...
{ bValue = (nResult != 0) ? true : false; } return nError; } LONG GetStringRegKey(HKEY hKey, const std::wstring &strValueName, std::wstring &strValue, const std::wstring &strDefaultValue) { strValue = strDefaultValue; WCHAR szBuffer[512]; DWORD dwBufferSize = sizeof(szBuffer); ULONG nError; nError = RegQueryValueExW(hKey, strValueName.c_str(), 0, NULL, (LPBYTE)szBuffer, &dwBufferSize); if (ERROR_SUCCESS == nError) { strValue = szBuffer; } return nError; } ```
[ -0.14891813695430756, -0.15599150955677032, 0.9457578063011169, -0.485734760761261, 0.10633793473243713, 0.3049676716327667, 0.44303080439567566, -0.5774464011192322, -0.13507060706615448, -0.457671195268631, -0.5666280388832092, 0.4852021634578705, -0.364501029253006, 0.40528109669685364,...
I would like to know which dependency described in my pom.xml brings a transitive dependency in my target directory. To be more precise, I have the library "poi-2.5.1-final-20040804.jar" in my WEB-INF/lib directory and I would like to know which dependency in my pom.xml brings that. To add to @David Crow, here's [a dependency:tree example](http://maven.apache.org/plugins/maven-dependency-plugin/examples/filtering-the-dependency-tree.html) from the Maven site: ``` mvn dependency:tree -Dincludes=velocity:velocity ``` might output ``` [INFO] [dependency:tree] [INFO] org.apache.maven.plugins:maven-dependency-plugin:maven-plugin:2.0-alpha-5-SNAPSHOT [INFO] \- org.apache.maven.doxia:doxia-site-renderer:jar:1.0-alpha-8:compile [INFO] \- org.codehaus.plexus:plexus-velocity:jar:1.1.3:compile [INFO] \- velocity:velocity:jar:1.4:compile ```
[ 0.039721667766571045, 0.23804551362991333, 0.489530473947525, -0.08808743208646774, 0.04250733181834221, 0.04942767694592476, -0.031424958258867264, -0.2610487937927246, -0.11250846832990646, -0.6244951486587524, -0.24720123410224915, 0.7045313715934753, -0.2662200927734375, -0.03424562141...
Where can I find some good pointers on best practices for running ASP.NET MVC on IIS6? I haven't seen any realistic options for web-hosts who provide IIS7-hosting yet. Mostly because I don't live in the U.S. So I was wondering on how you best build applications in ASP.NET MVC and make it easily available to deploy on both IIS6 and IIS7. Keep in mind that this is for standard web-hosts, so there is no access to ISAPI-filters or special settings inside IIS6. Are there anything else one should think about when developing ASP.NET MVC-applications to target IIS6? Any functions that doesn't work? UPDATE: One
[ 0.32750847935676575, -0.018944427371025085, 0.11864165216684341, 0.075937420129776, 0.07112526893615723, -0.1713627427816391, 0.3856227993965149, 0.15168502926826477, -0.4112640619277954, -0.7092041373252869, -0.13746997714042664, 0.5121947526931763, -0.21130836009979248, -0.00220724288374...
of the bigger issues is the thing with routes. The pattern {controller}/{action} will work on IIS7, but not IIS6 which needs {controller}.mvc/{action}. So how do I make this transparent? Again, **no ISAPI** and **no IIS-settings**, please. It took me a bit, but I figured out how to make the extensions work with IIS 6. First, you need to rework the base routing to include .aspx so that they will be routed through the ASP.NET ISAPI filter. ``` routes.MapRoute( "Default",
[ 0.05904858931899071, -0.41737616062164307, 0.5913609862327576, 0.055907826870679855, 0.02307298593223095, -0.25391483306884766, 0.0776241198182106, -0.11112714558839798, -0.6437193751335144, -1.043412685394287, 0.0439794547855854, 0.44862109422683716, -0.4997982978820801, -0.17359125614166...
// Route name "{controller}.aspx/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); ``` If you navigate to Home.aspx, for example, your site should be working fine. But Default.aspx and the default page address of <http://[website]/> stop working correctly. So
[ 0.09753463417291641, -0.07192248106002808, 0.7358741164207458, -0.03301457315683365, 0.3394244313240051, -0.5100553631782532, 0.5456562042236328, -0.0411706306040287, -0.32689234614372253, -0.9801465272903442, -0.15390734374523163, 0.2524762451648712, -0.1773432195186615, 0.238643422722816...
how is that fixed? Well, you need to define a second route. Unfortunately, using Default.aspx as the route does not work properly: ``` routes.MapRoute( "Default2", // Route name "Default.aspx",
[ -0.050898198038339615, -0.3943816125392914, 0.5815999507904053, 0.14057427644729614, 0.2522850036621094, -0.23163948953151703, 0.11311114579439163, 0.216692253947258, -0.5635508894920349, -0.9350021481513977, -0.09322202950716019, 0.3891652822494507, -0.4788765013217926, -0.060100644826889...
// URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); ``` So how do you get this to work? Well, this is where you need the original routing code: ``` routes.MapRoute( "Default2",
[ 0.03731365501880646, -0.34602200984954834, 0.6191166639328003, -0.005501727573573589, 0.3383543789386749, -0.3492611348628998, 0.06131488084793091, -0.1713002622127533, -0.33746469020843506, -0.9839505553245544, -0.09022751450538635, 0.27112680673599243, -0.3912670612335205, 0.199709787964...
// Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); ``` When you do this, Default.aspx and <http://[website]/> both start working again, I think because they become successfully mapped back to the Home controller. So the complete solution is: ``` public class MvcApplication : System.Web.HttpApplication { public static void RegisterRoutes(RouteCollection routes)
[ -0.08987133949995041, -0.3187984824180603, 0.9128778576850891, -0.0442325621843338, 0.3642010986804962, -0.0766860842704773, 0.3358554244041443, -0.33699560165405273, -0.39390793442726135, -0.9688140749931335, -0.25793081521987915, 0.38785502314567566, -0.4125519394874573, 0.36333933472633...
{ routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}.aspx/{action}/{id}",
[ -0.31830447912216187, -0.4375859498977661, 0.5860681533813477, 0.1753116250038147, 0.32206064462661743, 0.13207051157951355, 0.003583915764465928, -0.09422674030065536, -0.4126085340976715, -0.9847285151481628, -0.2035047560930252, 0.11109054088592529, -0.5256780982017517, -0.2018148154020...
// URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults ); routes.MapRoute( "Default2",
[ -0.19667969644069672, -0.4358702301979065, 0.7080804109573364, -0.05130593851208687, 0.28672367334365845, 0.027662837877869606, 0.1084938794374466, 0.06236270070075989, -0.31109511852264404, -1.032515287399292, -0.5058148503303528, 0.14719225466251373, -0.3330690562725067, 0.32455891370773...
// Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = "" } // Parameter defaults );
[ -0.24455611407756805, -0.36224767565727234, 0.6542421579360962, -0.09417116641998291, 0.2744097411632538, 0.009948755614459515, 0.14734148979187012, -0.061419691890478134, 0.09642495959997177, -0.627575159072876, -0.33687618374824524, 0.297982782125473, -0.3670237958431244, 0.5165010094642...
} protected void Application_Start() { RegisterRoutes(RouteTable.Routes); } } ``` And your site should start working just fine under IIS 6. (At least it does on my PC.) And as a bonus, if you are using Html.ActionLink() in your pages, you should not have to change any other line of code throughout the entire site. This method takes care of properly tagging on the .aspx extension to the controller.
[ 0.18274153769016266, -0.10469979792833328, 0.6390568017959595, -0.13560673594474792, 0.24943499267101288, -0.5267871022224426, 0.42016342282295227, 0.038085438311100006, -0.3675049841403961, -1.0242888927459717, -0.3003338873386383, 0.5288309454917908, -0.31879234313964844, -0.099224619567...
How do I get the latest version of my solution recursively like its done in the solution explorer context menu of Visual Studio? I want to do this from the command line or via a macro. I'm trying to automate a part of my daily routine by using a set of batch files. I am sure a lot of developers would love to have something like this. `tf get` only gets contents of a folder recursively (not solution). It does not look at project dependencies and so on. That won't work. TFS has a [.Net SDK](http://msdn.microsoft.com/en-us/library/bb130146(VS.80).aspx) that allows you to create your
[ 0.3955068290233612, -0.12196634709835052, 0.5463889241218567, -0.018184419721364975, 0.23195478320121765, -0.08011254668235779, 0.32783588767051697, -0.31148555874824524, -0.11037866771221161, -0.9771226048469543, -0.20094430446624756, 0.5244009494781494, -0.2749171257019043, 0.02131829224...
own custom programs that interact with a TFS Server. You could write a small program that performs the task you need: ``` TeamFoundationServer tfs = TeamFoundationServerFactory.GetServer("MyServer"); VersionControlServer vcs = (VersionControlServer)tfs.GetService(typeof(VersionControlServer)); WorkSpace[] myWorkSpaces = vcs.QueryWorkSpaces("MyWorkSpaceName", "MyLoginName", "MyComputer"); myWorkSpaces[0].Get(VersionSpec.Latest, GetOptions.GetAll); ```
[ 0.345582515001297, -0.23563514649868011, 0.6098489165306091, 0.222237691283226, 0.08657263219356537, 0.16707026958465576, 0.30928435921669006, -0.11140342801809311, -0.5587694644927979, -0.8691120743751526, -0.2779613137245178, 0.3561033308506012, -0.32357147336006165, 0.16422009468078613,...
In the transition to newforms admin I'm having difficulty figuring out how specify core=False for ImageFields. I get the following error: ``` TypeError: __init__() got an unexpected keyword argument 'core' ``` [Edit] However, by just removing the core argument I get a "This field is required." error in the admin interface on attempted submission. How does one accomplish what core=False is meant to do using newforms admin? To get rid of "This field is required," you need to make it not required, by using blank=True (and possibly null=True as well, if it's not a CharField).
[ 0.079187773168087, 0.1387784332036972, 0.4081142544746399, -0.20426669716835022, -0.15079563856124878, 0.009314152412116528, 0.40332910418510437, -0.3222416341304779, 0.12444360554218292, -0.5988917946815491, -0.1997804194688797, 0.8025720715522766, -0.2855656147003174, 0.19381418824195862...
I'm considering using the ChangePassword control on an ASP.NET 2.0 Webform. I don't want the 'cancel' button to show. Is there a good way to hide it without resorting to silly "width = 0" sort of games? Or perhaps there's a generic way to walk through the parts of a composite control like this and hide individual parts? Set CancelButtonStyle.CssClass to something like "hiddenItem" and set the CSS to "display:none". Otherwise you can convert the control to a template and simply delete away the cancel-button manually. When you click the control in Design-mode in Visual Studio, you get a little arrow with options
[ 0.29259514808654785, -0.3567051589488983, 0.3190987706184387, 0.004923578817397356, -0.0741209089756012, -0.056923478841781616, 0.0719972625374794, -0.13006803393363953, -0.21671198308467865, -0.6302368640899658, 0.14141017198562622, 0.6621723771095276, -0.4541209936141968, 0.0047007729299...
and one of them is "Convert to Template".
[ 0.511275053024292, 0.028654472902417183, -0.2514003813266754, -0.12313035875558853, 0.1324765980243683, -0.05299907550215721, -0.10294128209352493, -0.13221746683120728, 0.1486947387456894, -0.6193018555641174, -0.3124748766422272, 0.5406789779663086, -0.3418568968772888, -0.14260326325893...
Is there something like the Python descriptor protocol implemented in other languages? It seems like a nice way to increase modularity/encapsulation without bloating your containing class' implementation, but I've never heard of a similar thing in any other languages. Is it likely absent from other languages because of the lookup overhead? I've not heard of a direct equivalent either. You could probably achieve the same effect with macros, especially in a language like Lisp which has extremely powerful macros. I wouldn't be at all surprised if other languages start to incorporate something similar because it is so powerful.
[ 0.23776228725910187, -0.07024241983890533, -0.37721943855285645, 0.08360368013381958, -0.20182687044143677, -0.04896238446235657, 0.1907469630241394, 0.42191922664642334, -0.495670348405838, -0.5137453079223633, 0.02265981212258339, 0.666509211063385, -0.6054914593696594, -0.17724671959877...
Has the introduction of the .net framework made raw programming in COM and DCOM redundant ? (Except for using some COM+ services, e.g. for transaction management through the System.EnterpriseServices namespace) Not yet, because the OS is still unmanaged. If MS finally do what their labs have been talking about for years and produce a fully managed OS then it will. That OS won't be backwards compatible though. They would have to produce managed versions of Office, IE, etc first. They will have to produce a virtual machine to run unmanaged apps. The pain would be something similar to the move from Mac OS9 to
[ 0.18755565583705902, 0.05333263799548149, 0.5939726233482361, 0.24859416484832764, 0.13829170167446136, -0.19547788798809052, 0.31813693046569824, 0.10451161861419678, -0.36595919728279114, -0.7435768246650696, -0.09314370155334473, 0.5573573112487793, -0.2440682202577591, 0.28253114223480...
OSX.
[ -0.6636848449707031, 0.12938708066940308, 0.38306373357772827, -0.30589547753334045, 0.051355067640542984, -0.11463260650634766, -0.152798131108284, 0.3524266481399536, -0.23999036848545074, -0.898941159248352, -0.4677146077156067, 0.5060413479804993, -0.4644225239753723, 0.107616104185581...
On my side job as programmer, I am to write a program in C++ to convert audio files from/to various formats. Probably, this will involve building a simple GUI. Will it be a great effort to build seperate GUIs for Mac and Windows using Cocoa and WinForms instead of a cross-platform toolkit like Qt or GTK? (I will have to maintain a seperate Windows-version and Mac-Version anyway) The GUI will probably be very simple and only need very basic functionality. I always felt that native GUIs feel far more intuitive than its cross-platform brethren... If you have the expertise, use
[ 0.17491985857486725, 0.37245649099349976, 0.1925235241651535, 0.3181110918521881, -0.24139079451560974, -0.24212846159934998, 0.20806698501110077, 0.057207200676202774, 0.2424018532037735, -0.6747429370880127, 0.04360996559262276, 1.1359397172927856, -0.1714208871126175, 0.0214406847953796...
native frontends, it'll effectively double the job you have to do for UI but from my experience non-native UI is a little bit clunkier than their native counterparts.
[ -0.012613062746822834, 0.0995103120803833, 0.08419548720121384, 0.0830320343375206, -0.3237146735191345, -0.03449761122465134, 0.11588723957538605, 0.22517193853855133, -0.24419544637203217, -0.5620064735412598, -0.03838620334863663, 0.6762396097183228, -0.14339151978492737, -0.21969084441...
In [another question](https://stackoverflow.com/questions/32404/can-i-run-a-python-script-as-a-service-in-windows-how "Python scripts as Windows service") I posted yesterday, I got very good advice on how a Python script could be run as a service in Windows. What I'm left wondering is: How is Windows aware of the services that can be managed in the native tools ("services" window in "administrative tools"). I. e. what is the Windows equivalent of putting a start/stop script in /etc/init.d under Linux? As with most "aware" things in Windows, the answer is "Registry". Take a look at this Microsoft Knowledge Base article: <http://support.microsoft.com/kb/103000> Search for "A Win32 program that can be started by the Service
[ 0.1328488141298294, 0.0887790322303772, 0.07066024094820023, 0.029872922226786613, -0.11643276363611221, -0.268438458442688, 0.35206982493400574, 0.07810740917921066, -0.27907198667526245, -0.6431568264961243, -0.2196252942085266, 0.3235771358013153, 0.14880166947841644, 0.2580200135707855...
Controller and that obeys the service control protocol." This is the kind of service you're interested in. The service registration (contents of KEY\_LOCAL\_MACHINE\SYSTEM\CurrentControlSet\Services \myservice) carries information about the service, including things like its executable location, what to do when it fails (halt the OS?), what services must be started before this one, what user it runs as. As to service control protocol, main() of your program is supposed to invoke a Windows API call, setting up callbacks for start, stop, pause for your service. What you do in those callbacks is all up to you.
[ 0.08644698560237885, -0.4713161885738373, 0.4592580795288086, 0.3542681038379669, 0.4200567901134491, -0.22285452485084534, 0.00289101037196815, 0.1141776293516159, -0.3184084892272949, -0.584550142288208, -0.24692179262638092, 0.6521843075752258, -0.22044657170772552, 0.49537453055381775,...
100 (or some even number 2N :-) ) prisoners are in a room A. They are numbered from 1 to 100. One by one (from prisoner #1 to prisoner #100, in order), they will be let into a room B in which 100 boxes (numbered from 1 to 100) await them. Inside the (closed) boxes are numbers from 1 to 100 (the numbers inside the boxes are randomly permuted!). Once inside room B, each prisoner gets to open 50 boxes (he chooses which one he opens). If he finds the number that was assigned to him in one of these 50 boxes,
[ 0.335652232170105, 0.15098178386688232, 0.34033334255218506, 0.09452660381793976, 0.20910589396953583, 0.5766695737838745, 0.4609382152557373, -0.515265703201294, -0.4485858678817749, -0.5542258024215698, -0.6494299173355103, -0.4069998562335968, -0.46150171756744385, 0.08277243375778198, ...
the prisoner gets to walk into a room C and all boxes are closed again before the next one walks into room B from room A. Otherwise, all prisoners (in rooms A, B and C) gets killed. Before entering room B, the prisoners can agree on a strategy (algorithm). There is no way to communicate between rooms (and no message can be left in room B!). Is there an algorithm that maximizes the probability that all prisoners survive? What probability does that algorithm achieve? Notes: * Doing things randomly (what you call 'no strategy') indeed gives a probability of 1/2 for each prisoner, but
[ 0.24627329409122467, -0.21246232092380524, 0.08257941901683807, 0.09313590824604034, 0.3645074665546417, 0.12140475958585739, 0.5272098779678345, -0.5378398895263672, -0.6706491708755493, -0.6174598932266235, -0.4196121394634247, -0.2560425102710724, -0.2858487665653229, 0.1134502291679382...
then the probability of all of them surviving is 1/2^100 (which is quite low). One can do much better! * The prisoners are not allowed to reorder the boxes! * All prisoners are killed the first time a prisoner fails to find his number. *And* no communication is possible. * **Hint**: one can save more than 30 prisoners *on average*, which is much more that (50/100) \* (50/99) \* [...] \* 1 This puzzle is explained at [http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml](https://web.archive.org/web/20090616153244/http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml) and that person does a much better job of explaining the problem. The "all prisoners are killed" statement is wrong. The "you can save 30+ on average" is
[ 0.07814965397119522, -0.023772278800606728, -0.23782293498516083, 0.08041203022003174, 0.0191525686532259, 0.4276275634765625, 0.5243291258811951, -0.4634043574333191, -0.6918336749076843, -0.7648711800575256, -0.1432575136423111, 0.2833193838596344, -0.24156102538108826, 0.031775433570146...
also wrong, the [article](https://web.archive.org/web/20090616153244/http://www.math.princeton.edu/~wwong/blog/blog200608191813.shtml) says that 30% of the time you can save 100% of the prisoners.
[ 0.20733794569969177, 0.04300367459654808, -0.4477170705795288, 0.06168665736913681, 0.12911547720432281, 0.22105631232261658, 0.5064963102340698, -0.030883068218827248, -0.5485326647758484, -0.41283467411994934, 0.04349703714251518, 0.20578432083129883, 0.01551333349198103, 0.2606152892112...
Since there are no header sections for user controls in asp.net, user controls have no way of knowing about stylesheet files. So css classes in the user controls are not recognized by visual studio and produces warnings. How can I make a user control know that it will relate to a css class, so if it is warning me about a non-existing css class, it means that the class really do not exist? Edit: Or should I go for a different design like exposing css classes as properties like "HeaderStyle-CssClass" of GridView? Here's what I did: ``` <link rel="Stylesheet" type="text/css" href="Stylesheet.css" id="style" runat="server" visible="false"
[ 0.570624828338623, 0.0518823079764843, 0.1489100605249405, 0.0926549881696701, -0.3048975169658661, -0.25793442130088806, 0.30031323432922363, -0.1867353469133377, -0.15642322599887848, -0.5779920220375061, 0.036902666091918945, 0.4183533489704132, -0.3155596852302551, 0.21387535333633423,...
/> ``` It fools Visual Studio into thinking you've added a stylesheet to the page but it doesn't get rendered. --- Here's an even more concise way to do this with multiple references; ``` <% if (false) { %> <link rel="Stylesheet" type="text/css" href="Stylesheet.css" /> <script type="text/javascript" src="js/jquery-1.2.6.js" /> <% } %> ``` As seen in [this blog post](http://haacked.com/archive/2008/11/21/combining-jquery-form-validation-and-ajax-submission-with-asp.net.aspx) from Phil Haack.
[ 0.3705116808414459, 0.18212340772151947, 0.013163457624614239, -0.05715179070830345, -0.42345622181892395, -0.06558787822723389, -0.15075884759426117, -0.2546379864215851, -0.19907699525356293, -0.6890737414360046, -0.28931495547294617, 0.26407331228256226, -0.14766456186771393, -0.5312190...
How would you programmacially abbreviate `XHTML` to an arbitrary number of words without leaving unclosed or corrupted tags? i.e. ``` <p> Proin tristique dapibus neque. Nam eget purus sit amet leo tincidunt accumsan. </p> <p> Proin semper, orci at mattis blandit, augue justo blandit nulla. <span>Quisque ante congue justo</span>, ultrices aliquet, mattis eget, hendrerit, <em>justo</em>. </p> ``` Abbreviated to 25 words would be: ``` <p> Proin tristique dapibus neque. Nam eget purus sit amet leo tincidunt accumsan. </p> <p> Proin semper, orci at mattis blandit, augue justo blandit
[ -0.05776898190379143, 0.13053417205810547, 0.4773317575454712, -0.027690934017300606, -0.21633519232273102, 0.8371000289916992, 0.1604767143726349, -0.050494953989982605, -0.1530306041240692, -0.32896196842193604, -0.3633245527744293, 0.3269670903682709, -0.403190553188324, -0.603485345840...