Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
1,679
1
1,704
null
16
10,666
I'm writing an app to help facilitate some research, and part of this involves doing some statistical calculations. Right now, the researchers are using a program called [SPSS](http://en.wikipedia.org/wiki/Spss). Part of the output that they care about looks like this: ![[Part of the SPSS output](https://i.stack.imgur.com/m0swl.png) They're really only concerned about the `F` and `Sig.` values. My problem is that I have no background in statistics, and I can't figure out what the tests are called, or how to calculate them. I thought the `F` value might be the result of the [F-test](http://en.wikipedia.org/wiki/F-test#Table_on_F-test), but after following the steps given on Wikipedia, I got a result that was different from what `SPSS` gives.
How do I calculate these statistics?
CC BY-SA 3.0
0
2008-08-04T22:56:45.540
2015-11-02T15:51:48.007
2012-03-28T16:47:35.633
1,219,121
55
[ "statistics", "spss" ]
2,488
1
2,495
null
358
372,986
I'm tired of opening Dia and creating a database diagram at the beginning of every project. Is there a tool out there that will let me select specific tables and then create a database diagram for me based on a MySQL database? Preferably it would allow me to edit the diagram afterward since none of the foreign keys are set... Here is what I am picturing diagram-wise (please excuse the horrible data design, I didn't design it. Let's focus on the diagram concept and not on the actual data it represents for this example ;) ): ![diagram](https://i.stack.imgur.com/lxvlR.jpg) [see full size diagram](https://i.stack.imgur.com/ZnN2O.png)
Auto Generate Database Diagram MySQL
CC BY-SA 3.0
0
2008-08-05T15:45:02.930
2021-06-24T19:24:12.700
2012-04-01T10:30:48.577
1,219,121
58
[ "mysql", "database", "database-design", "diagram" ]
3,067
1
null
null
23
8,511
If you've ever used Eclipse, you've probably noticed the great keyboard shortcuts that let you hit a shortcut key combination, then just type the first few characters of a function, class, filename, etc. It's even smart enough to put open files first in the list. ![alt text](https://i.stack.imgur.com/aLKhF.png) I'm looking for a similar functionality for Visual Studio 2008. I know there's a findfiles plugin on codeproject, but that one is buggy and a little weird, and doesn't give me access to functions or classes.
Plugin for Visual Studio to Mimic Eclipse's "Open Type" or "Open Resource" Keyboard Access
CC BY-SA 3.0
null
2008-08-06T03:44:41.197
2015-08-20T22:14:18.063
2012-04-01T10:02:38.760
1,219,121
291
[ "visual-studio", "plugins" ]
3,725
1
3,776
null
18
4,408
I'm writing an application that is basically just a preferences dialog, much like the tree-view preferences dialog that Visual Studio itself uses. The function of the application is simply a pass-through for data from a serial device to a file. It performs many, many transformations on the data before writing it to the file, so the GUI for the application is simply all the settings that dictate what those transformations should be. What's the best way to go about designing/coding a tree-view preferences dialog? The way I've been going about it is building the main window with a docked tree control on the left. Then I have been creating container controls that correspond to each node of the tree. When a node is selected, the app brings that node's corresponding container control to the front, moves it to the right position, and maximizes it in the main window. This seems really, really clunky while designing it. It basically means I have tons of container controls beyond the edge of the main window during design time that I have to keep scrolling the main window over to in order to work with them. I don't know if this totally makes sense the way I'm writing this, but maybe this visual for what I'm talking about will make more sense: ![form design](https://i.stack.imgur.com/bVRJB.png) Basically I have to work with this huge form, with container controls all over the place, and then do a bunch of run-time reformatting to make it all work. This seems like a of extra work. Am I doing this in a totally stupid way? Is there some "obvious" easier way of doing this that I'm missing?
How to create a tree-view preferences dialog type of interface in C#?
CC BY-SA 3.0
0
2008-08-06T17:22:27.350
2016-01-17T12:49:42.543
2013-12-28T06:19:48.327
2,780,033
551
[ "c#", "user-interface" ]
4,225
1
4,281
null
17
1,356
Is there a trivial, or at least moderately straight-forward way to generate territory maps (e.g. Risk)? I have looked in the past and the best I could find were vague references to Voronoi diagrams. An example of a Voronoi diagram is this: ![here](https://i.stack.imgur.com/aX9Tp.gif). These hold promise, but I guess i haven't seen any straight-forward ways of rendering these, let alone holding them in some form of data structure to treat each territory as an object. Another approach that holds promise is flood fill, but again I'm unsure on the best way to start with this approach. Any advice would be much appreciated.
Territory Map Generation
CC BY-SA 4.0
null
2008-08-07T00:48:04.953
2018-12-27T21:50:55.553
2018-12-27T21:50:55.553
4,751,173
364
[ "language-agnostic", "maps", "voronoi" ]
7,477
1
7,523
null
129
160,521
I'm currently working on an internal sales application for the company I work for, and I've got a form that allows the user to change the delivery address. Now I think it would look much nicer, if the textarea I'm using for the main address details would just take up the area of the text in it, and automatically resize if the text was changed. Here's a screenshot of it currently. ![ISO Address](https://i.stack.imgur.com/XK48E.png) Any ideas? --- @Chris A good point, but there are reasons I want it to resize. I want the area it takes up to be the area of the information contained in it. As you can see in the screen shot, if I have a fixed textarea, it takes up a fair wack of vertical space. I can reduce the font, but I need address to be large and readable. Now I can reduce the size of the text area, but then I have problems with people who have an address line that takes 3 or 4 (one takes 5) lines. Needing to have the user use a scrollbar is a major no-no. I guess I should be a bit more specific. I'm after vertical resizing, and the width doesn't matter as much. The only problem that happens with that, is the ISO number (the large "1") gets pushed under the address when the window width is too small (as you can see on the screenshot). It's not about having a gimick; it's about having a text field the user can edit that won't take up unnecessary space, but will show all the text in it. Though if someone comes up with another way to approach the problem I'm open to that too. --- I've modified the code a little because it was acting a little odd. I changed it to activate on keyup, because it wouldn't take into consideration the character that was just typed. ``` resizeIt = function() { var str = $('iso_address').value; var cols = $('iso_address').cols; var linecount = 0; $A(str.split("\n")).each(function(l) { linecount += 1 + Math.floor(l.length / cols); // Take into account long lines }) $('iso_address').rows = linecount; }; ```
How to autosize a textarea using Prototype?
CC BY-SA 4.0
0
2008-08-11T01:43:13.493
2020-03-09T14:10:06.593
2019-01-03T06:54:14.567
10,757,987
841
[ "javascript", "html", "css", "textarea", "prototypejs" ]
8,472
1
8,637
null
317
82,711
It looks like we'll be adding [CAPTCHA](http://en.wikipedia.org/wiki/Captcha) support to Stack Overflow. This is necessary to prevent bots, spammers, and other malicious scripted activity. We only want human beings to post or edit things here! We'll be using a JavaScript (jQuery) CAPTCHA as a first line of defense: [http://docs.jquery.com/Tutorials:Safer_Contact_Forms_Without_CAPTCHAs](http://docs.jquery.com/Tutorials:Safer_Contact_Forms_Without_CAPTCHAs) The advantage of this approach is that, However, for people with JavaScript disabled, we still need a fallback and this is where it gets tricky. I have written a [traditional CAPTCHA control for ASP.NET](http://www.codeproject.com/KB/custom-controls/CaptchaControl.aspx) which we can re-use. ![CaptchaImage](https://i.stack.imgur.com/Puvbf.jpg) However, I'd prefer to go with something textual to avoid the overhead of creating all these images on the server with each request. I've seen things like.. - `\/\/(_)\/\/`- - Maybe I'm just tilting at windmills here, but I'd like to have a less resource intensive, non-image based `<noscript>` compatible CAPTCHA if possible. Ideas?
Practical non-image based CAPTCHA approaches?
CC BY-SA 3.0
0
2008-08-12T04:59:35.017
2012-06-29T13:37:52.210
2012-04-01T09:23:31.653
1,219,121
1
[ "security", "language-agnostic", "captcha" ]
9,805
1
9,851
null
8
5,816
I am currently writing a small calendar in ASP.Net C#. Currently to produce the rows of the weeks I do the following for loop: ``` var iWeeks = 6; for (int w = 0; w < iWeeks; w++) { ``` This works fine, however, some month will only have 5 weeks and in some rare cases, 4. How can I calculate the number of rows that will be required for a particular month? This is an example of what I am creating: ![enter image description here](https://i.stack.imgur.com/NkxN7.png) As you can see for the above month, there are only 5 rows required, however. Take the this month (August 2008) which started on a Saturday and ends on a Monday on the 6th Week/Row. --- This is an example of what I am creating: ![enter image description here](https://i.stack.imgur.com/NkxN7.png) As you can see for the above month, there are only 5 rows required, however. Take the this month (August 2008) which started on a Saturday and ends on a Monday on the 6th Week/Row.
Calculate DateTime Weeks into Rows
CC BY-SA 3.0
0
2008-08-13T13:38:56.043
2021-01-27T03:13:54.237
2016-12-21T04:38:26.107
256,196
383
[ "c#", "asp.net" ]
11,665
1
12,310
null
2
5,982
Here is the sample code for my accordion: ``` <mx:Accordion x="15" y="15" width="230" height="599" styleName="myAccordion"> <mx:Canvas id="pnlSpotlight" label="SPOTLIGHT" height="100%" width="100%" horizontalScrollPolicy="off"> <mx:VBox width="100%" height="80%" paddingTop="2" paddingBottom="1" verticalGap="1"> <mx:Repeater id="rptrSpotlight" dataProvider="{aSpotlight}"> <sm:SmallCourseListItem viewClick="PlayFile(event.currentTarget.getRepeaterItem().fileID);" Description="{rptrSpotlight.currentItem.fileDescription}" FileID = "{rptrSpotlight.currentItem.fileID}" detailsClick="{detailsView.SetFile(event.currentTarget.getRepeaterItem().fileID,this)}" Title="{rptrSpotlight.currentItem.fileTitle}" FileIcon="{iconLibrary.getIcon(rptrSpotlight.currentItem.fileExtension)}" /> </mx:Repeater> </mx:VBox> </mx:Canvas> </mx:Accordion> ``` I would like to include a button in each header like so: ![wishful" onclick="alert('xss')](https://i.stack.imgur.com/EN3kP.jpg)
How do I restyle an Adobe Flex Accordion to include a button in each canvas header?
CC BY-SA 4.0
null
2008-08-14T20:25:07.840
2018-12-27T22:02:20.540
2018-12-27T22:02:20.540
4,751,173
26
[ "apache-flex", "actionscript-3" ]
12,268
1
12,274
null
2
1,852
Lutz Roeder's Reflector, that is. Its obfuscated. ![enter image description here](https://i.stack.imgur.com/GHoWj.png) I still don't understand this. Can somebody please explain?
Have you ever reflected Reflector?
CC BY-SA 3.0
0
2008-08-15T14:01:15.030
2012-04-01T09:58:02.790
2012-04-01T09:58:02.790
1,219,121
null
[ ".net", "reflector" ]
13,938
1
13,969
null
4
1,528
![Visual Studio folder structure](https://i.stack.imgur.com/DibJS.jpg) I need some advice as to how I easily can separate test runs for unit tests and integration test in Visual Studio. Often, or always, I structure the solution as presented in the above picture: separate projects for unit tests and integration tests. The unit tests is run very frequently while the integration tests naturally is run when the context is correctly aligned. My goal is to somehow be able configure which tests (or test folders) to run when I use a keyboard shortcut. The tests should preferably be run by a graphical test runner (ReSharpers). So for example - - - - TestDriven.net have an option of running just the test in the selected folder or project by right-clicking it and select Run Test(s). Being able to do this, but via a keyboard command and with a graphical test runner would be awesome. ![TestDriven.net test run output](https://i.stack.imgur.com/NYnmJ.jpg) Currently I use VS2008, ReSharper 4 and nUnit. But advice for a setup in the general is of course also appreciated.
How do I run (unit) tests in different folders/projects separately in Visual Studio?
CC BY-SA 3.0
0
2008-08-17T21:21:07.670
2012-04-01T10:02:32.397
2012-04-01T10:02:32.397
1,219,121
446
[ "visual-studio", "unit-testing", "configuration", "vsx", "extensibility" ]
18,614
1
null
null
4
744
What is the the best way to write a form to submit some data in ASP.NET MVC? Is it as [Scott Guthrie](http://en.wikipedia.org/wiki/Scott_Guthrie) demonstrates here? Are there better approaches? Perhaps with less using of strings? ![alt text](https://i.stack.imgur.com/yehPg.png)
What is the best way to write a form in ASP.NET MVC?
CC BY-SA 3.0
0
2008-08-20T19:16:01.060
2019-04-01T20:07:42.353
2019-04-01T20:07:42.353
100,297
230
[ "asp.net-mvc", "forms" ]
21,697
1
22,043
null
17
5,757
I'm currently writing an ASP.Net app from the UI down. I'm implementing an MVP architecture because I'm sick of Winforms and wanted something that had a better separation of concerns. So with MVP, the Presenter handles events raised by the View. Here's some code that I have in place to deal with the creation of users: ``` public class CreateMemberPresenter { private ICreateMemberView view; private IMemberTasks tasks; public CreateMemberPresenter(ICreateMemberView view) : this(view, new StubMemberTasks()) { } public CreateMemberPresenter(ICreateMemberView view, IMemberTasks tasks) { this.view = view; this.tasks = tasks; HookupEventHandlersTo(view); } private void HookupEventHandlersTo(ICreateMemberView view) { view.CreateMember += delegate { CreateMember(); }; } private void CreateMember() { if (!view.IsValid) return; try { int newUserId; tasks.CreateMember(view.NewMember, out newUserId); view.NewUserCode = newUserId; view.Notify(new NotificationDTO() { Type = NotificationType.Success }); } catch(Exception e) { this.LogA().Message(string.Format("Error Creating User: {0}", e.Message)); view.Notify(new NotificationDTO() { Type = NotificationType.Failure, Message = "There was an error creating a new member" }); } } } ``` I have my main form validation done using the built in .Net Validation Controls, but now I need to verify that the data sufficiently satisfies the criteria for the Service Layer. Let's say the following Service Layer messages can show up: - - - - Let's also say that more rules will be in the service layer that the UI cannot anticipate. Currently I'm having the service layer throw an exception if things didn't go as planned. Is that a sufficent strategy? Does this code smell to you guys? If I wrote a service layer like this would you be annoyed at having to write Presenters that use it in this way? Return codes seem too old school and a bool is just not informative enough. --- > --- Cheekysoft, I like the concept of a ServiceLayerException. I already have a global exception module for the exceptions that I don't anticipate. Do you find making all these custom exceptions tedious? I was thinking that catching base Exception class was a bit smelly but wasn't exactly sure how progress from there. tgmdbm, I like the clever use of the lambda expression there! --- Thanks Cheekysoft for the follow-up. So I'm guessing that would be the strategy if you don't mind the user being displayed a separate page (I'm primarily a web developer) if the Exception is not handled. However, if I want to return the error message in the same view where the user submitted the data that caused the error, I would then have to catch the Exception in the Presenter? Here's what the CreateUserView looks like when the Presenter has handled the ServiceLayerException: ![Create a user](https://i.stack.imgur.com/HOJU7.png) For this kind of error, it's nice to report it to the same view. Anyways, I think we're going beyond the scope of my original question now. I'll play around with what you've posted and if I need further details I'll post a new question.
How Do You Communicate Service Layer Messages/Errors to Higher Layers Using MVP?
CC BY-SA 3.0
0
2008-08-22T03:12:59.517
2012-03-29T19:04:40.937
2012-03-29T19:04:40.937
122,607
1,894
[ "c#", "asp.net", "exception", "mvp", "n-tier-architecture" ]
26,145
1
40,209
null
3
2,249
I'm making a simple extra java app launcher for Eclipse 3.2 (JBuilder 2007-8) for internal use. So I looked up all the documentations related, including this one [The Launching Framework from eclipse.org](http://www.eclipse.org/articles/Article-Launch-Framework/launch.html) and have managed to make everything else working with the exception of the launch shortcut. ![alt text](https://i.stack.imgur.com/8I8zw.jpg) This is the part of my plugin.xml. ``` <extension point="org.eclipse.debug.ui.launchShortcuts"> <shortcut category="mycompany.javalaunchext.launchConfig" class="mycompany.javalaunchext.LaunchShortcut" description="launchshortcutsdescription" icon="icons/k2mountain.png" id="mycompany.javalaunchext.launchShortcut" label="Java Application Ext." modes="run, debug"> <perspective id="org.eclipse.jdt.ui.JavaPerspective"> </perspective> <perspective id="org.eclipse.jdt.ui.JavaHierarchyPerspective"> </perspective> <perspective id="org.eclipse.jdt.ui.JavaBrowsingPerspective"> </perspective> <perspective id="org.eclipse.debug.ui.DebugPerspective"> </perspective> </shortcut> ``` The configuration name in the category section is correct and the class in the class section, i believe, is correctly implemented. (basically copied from org.eclipse.jdt.debug.ui.launchConfigurations.JavaApplicationLaunchShortcut) --- I'm really not sure if I'm supposed to write a follow-up here but let me clarify my question more. I've extended org.eclipse.jdt.debug.ui.launchConfigurations.JavaLaunchShortcut. Plus, I've added my own logger to constructors and methods, but the class seems like it's never even instantiating.
Cannot add a launch shortcut (Eclipse Plug-in)
CC BY-SA 3.0
null
2008-08-25T14:45:15.910
2015-11-20T11:38:15.483
2015-11-20T11:38:15.483
3,218,692
2,710
[ "eclipse", "plugins" ]
26,670
1
30,688
null
1
1,101
I'm creating PDFs on-demand with ColdFusion's [CFDocument](http://cfquickdocs.com/cf8/?getDoc=cfdocument) tag, like so: ``` <cfdocument format="PDF" filename="#attributes.fileName#" overwrite="true"> <cfdocumentitem type="footer"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left"><font face="Tahoma" color="black"><strong>My Client's Corporation</strong><br/>Street address<br/>City, ST 55555</font></td> <td align="right"><font face="Tahoma" color="black">Phone: 555.555.5555<br/>Fax: 555.555.5555<br/>Email: [email protected]</font></td> </tr> </table> </cfdocumentitem> <html> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <!--- some content here ... ---> </table> </body> </html> </cfdocument> ``` The problem I'm having is that sometimes (actually, most of the time, but not always) of the footer text is there, but invisible. I can highlight it and copy/paste it into notepad, where I can see it all -- but in the generated PDF only the first line of the left column of the footer is visible, the rest is invisible. Hence why I added the font color of black in the code. ![screenshot of problem](https://i.stack.imgur.com/LHZ96.png) Any ideas on how to correct this?
Why is my PDF footer text invisible?
CC BY-SA 3.0
null
2008-08-25T19:14:07.280
2012-04-01T09:21:43.570
2012-04-01T09:21:43.570
1,219,121
751
[ "pdf", "coldfusion" ]
27,655
1
27,661
null
1
630
This is starting to vex me. I recently decided to clear out my FTP, and stumbled across an old Wordpress install I forgot I had (oh yes, very security conscious me). Anyway, for some reason deleting the directory failed so I investigated to see what was causing the blockage and I've narrowed it down to a file in wp-content. Now when I try to delete this file I can get two errors. I've tried in Windowx Explorer () and the Web Control Panel's File Manager. Here's some error shots: ![Windows FTP](https://i.stack.imgur.com/qMwJf.gif) ![File manager](https://i.stack.imgur.com/LxRLW.jpg) As you can see my File manager thinks the file is a [Symbolic Link](http://en.wikipedia.org/wiki/Symbolic_link). While it scares me that my web server is host to an obviously religoious artifact I'm also heavily confused by the situation. - - - - And I'm at a loss. Is there a special way to delete SymLinks? I've never heard of them, until now. ## edit Oho Windows you really are a magician of sorts. I decided to take a look at my FTP via command prompt and guess what? The file doesn't exist. Whether `ftp` ignores symlinks I don't know but I'm about to give up :P ![Command Prompt View](https://i.stack.imgur.com/y9S1P.jpg)
Cannot delete, a file with that name may already exist
CC BY-SA 4.0
null
2008-08-26T09:50:51.070
2018-12-27T22:22:37.630
2018-12-27T22:22:37.630
4,751,173
2,025
[ "file", "ftp", "symlink" ]
28,716
1
28,735
null
59
10,890
I'm trying to improve performance under high load and would like to implement opcode caching. Which of the following should I use? - [Installation Guide](http://www.howtoforge.com/apc-php5-apache2-debian-etch)- [Installation Guide](http://www.howtoforge.com/eaccelerator_php5_debian_etch)- [Installation Guide](http://www.howtoforge.com/xcache-php5-apache2-debian-etch) I'm also open to any other alternatives that have slipped under my radar. Currently running on a stock Debian Etch with Apache 2 and PHP 5.2 HowtoForge installation links added Based on the answers and feedback given, I have tested all 3 implementations using the following Apache JMeter test plan on my application: - - With 50 concurrent connections, the results are as follows: No Opcode Caching ![No Opcode Caching](https://i.stack.imgur.com/ueCBW.jpg) APC ![APC](https://i.stack.imgur.com/ggqC8.jpg) eAccelerator ![eAccelerator](https://i.stack.imgur.com/puxe5.jpg) XCache ![XCache](https://i.stack.imgur.com/GybYH.jpg) Performance Graph (smaller is better) ![Performance Graph](https://i.stack.imgur.com/oXTe9.png) From the above results, eAccelerator has a slight edge in performance compared to APC and XCache. However, what matters most from the above data is that any sort of opcode caching gives a tremendous boost in performance. I have decided to use APC due to the following 2 reasons: - - To summarize my experience: Ease of Installation: APC > eAccelerator > XCache Performance: eAccelerator > APC, XCache Control Panel: APC > XCache > eAccelerator
Which PHP opcode cacher should I use to improve performance?
CC BY-SA 3.0
0
2008-08-26T17:50:53.303
2015-06-20T21:50:57.320
2012-04-01T08:56:25.747
1,219,121
2,633
[ "php", "performance", "caching" ]
29,244
1
29,439
null
8
23,082
I have the following HTML (note the CSS making the background black and text white) ``` <html> <select id="opts" style="background-color: black; color: white;"> <option>first</option> <option>second</option> </select> </html> ``` Safari is smart enough to make the small triangle that appears to the right of the text the same color as the foreground text. Other browsers basically ignore the CSS, so they're fine too. Firefox 3 however applies the background color but leaves the triangle black, so you can't see it, like this ![Example](https://i.stack.imgur.com/Mvc7a.jpg) I can't find out how to fix this - can anyone help? Is there a `-moz-select-triangle-color` or something obscure like that?
HTML Select Tag with black background - dropdown triangle is invisible in Firefox 3
CC BY-SA 3.0
null
2008-08-27T00:23:02.783
2017-02-23T10:32:31.573
2014-07-08T11:27:57.347
3,326,275
234
[ "html", "css", "firefox", "drop-down-menu", "html-select" ]
30,160
1
30,402
null
5
1,419
I'm giving a presentation to a Java User's Group on Groovy and I'm going to be doing some coding during the presentation to show some side-by-side Java/Groovy. I really like the GroovyConsole as it's simple and I can resize the text easily. I'm wondering if there is anything similar for Java? I know I could just use Eclipse but I'd rather have a smaller app to use without having to customize a view. What's the community got? Screen shot of GroovyConsole: ![enter image description here](https://i.stack.imgur.com/GiR7b.jpg)
Is there a Java Console/Editor similar to the GroovyConsole?
CC BY-SA 3.0
null
2008-08-27T13:50:26.090
2012-05-04T00:58:15.777
2012-05-04T00:58:15.777
127,036
3,030
[ "java", "editor" ]
31,097
1
31,860
null
11
1,090
Visual Basic code does not render correctly with [prettify.js](https://code.google.com/archive/p/google-code-prettify) from Google. on Stack Overflow: ``` Partial Public Class WebForm1 Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 'set page title Page.Title = "Something" End Sub End Class ``` in Visual Studio... ![Visual Basic in Visual Studio](https://i.stack.imgur.com/Fl1CM.jpg) I found this in the [README](https://web.archive.org/web/20160428230325/http://google-code-prettify.googlecode.com:80/svn/trunk/README.html) document: > How do I specify which language my code is in?You don't need to specify the language since prettyprint() will guess. You can specify a language by specifying the language extension along with the prettyprint class like so:``` <pre class="prettyprint lang-html"> The lang-* class specifies the language file extensions. Supported file extensions include "c", "cc", "cpp", "cs", "cyc", "java", "bsh", "csh", "sh", "cv", "py", "perl", "pl", "pm", "rb", "js", "html", "html", "xhtml", "xml", "xsl". </pre> ``` I see no or option. Does anyone know if one exists as an add-in? --- Note: This is related to the [VB.NET code blocks](https://web.archive.org/web/20080914043525/http://stackoverflow.uservoice.com:80/pages/general/suggestions/18775) suggestion for Stack Overflow.
Is there a lang-vb or lang-basic option for prettify.js from Google?
CC BY-SA 4.0
0
2008-08-27T20:05:30.883
2021-11-14T11:54:06.860
2021-11-14T11:54:06.860
4,751,173
83
[ "javascript", "vb.net", "prettify" ]
32,494
1
42,043
null
68
37,036
I coded a Mancala game in Java for a college class this past spring, and I used the [Eclipse](https://www.eclipse.org) IDE to write it. One of the great (and fairly simple) visual aids in Eclipse is if you select a particular token, say a declared variable, then the IDE will automatically highlight all other references to that token on your screen. [Notepad++](https://notepad-plus-plus.org/), my preferred Notepad replacement, also does this. Another neat and similar feature in Eclipse was the vertical "error bar" to the right of your code (not sure what to call it). It display little red boxes for all of the syntax errors in your document, yellow boxes for warnings like "variable declared but not used", and if you select a word, boxes appear in the bar for each occurrence of the word in the document. A screenshot of these features in action: ![screenshot](https://i.stack.imgur.com/XZeTy.jpg) After a half hour of searching, I've determined that Visual Studio cannot do this on its own, so my question is: does anyone know of any add-ins for 2005 or 2008 that can provide either one of the aforementioned features? Being able to highlight the current line your cursor is on would be nice too. I believe the add-in ReSharper can do this, but I'd prefer to use a free add-in rather than purchase one.
Visual Studio identical token highlighting
CC BY-SA 3.0
0
2008-08-28T14:56:55.810
2018-03-05T12:20:16.853
2017-08-09T04:11:16.830
1,033,581
418
[ "visual-studio", "visual-studio-2008", "visual-studio-2005" ]
33,263
1
null
null
3
2,837
I'm using the [ASP.NET Login Controls](http://msdn.microsoft.com/en-us/library/ms178329.aspx) and [Forms Authentication](http://msdn.microsoft.com/en-us/library/aa480476.aspx) for membership/credentials for an ASP.NET web application. I've got two roles: - - I want pages to be viewable by four different groups: - - - - Expanding on the example in the [ASP.NET HOW DO I Video Series: Membership and Roles](http://www.asp.net/learn/videos/video-45.aspx), I've put those page files into such folders: ![Visual Studio Solution Explorer](https://i.stack.imgur.com/Ps7sm.gif) And I used the ASP.NET Web Site Administration Tool to set up access rules for each folder. It works but seems kludgy to me and it creates issues [when Login.aspx is not at the root](https://stackoverflow.com/questions/33089/how-do-i-use-aspnet-login-controls-when-my-loginaspx-is-not-at-the-root-of-my-a) and with the [ReturnUrl parameter](https://stackoverflow.com/questions/33166/how-do-i-keep-my-loginaspx-pages-returnurl-parameter-from-overriding-my-aspnet) of Login.aspx. Is there a better way to do this? Is there perhaps a simple way I can set permissions at the page level rather than at the folder level?
How do I best handle role based permissions using Forms Authentication on my ASP.NET web application?
CC BY-SA 3.0
null
2008-08-28T20:05:19.847
2012-04-01T20:43:32.583
2017-05-23T12:19:34.457
-1
83
[ "asp.net", "forms-authentication" ]
35,123
1
159,454
null
13
11,859
What did I do wrong? Here is an excerpt from my code: ``` public void createPartControl(Composite parent) { parent.setLayout(new FillLayout()); ScrolledComposite scrollBox = new ScrolledComposite(parent, SWT.V_SCROLL); scrollBox.setExpandHorizontal(true); mParent = new Composite(scrollBox, SWT.NONE); scrollBox.setContent(mParent); FormLayout layout = new FormLayout(); mParent.setLayout(layout); // Adds a bunch of controls here mParent.layout(); mParent.setSize(mParent.computeSize(SWT.DEFAULT, SWT.DEFAULT, true)); } ``` ...but it clips the last button: ![alt text](https://i.stack.imgur.com/1ubzc.png) bigbrother82: That didn't work. SCdF: I tried your suggestion, and now the scrollbars are gone. I need to work some more on that.
Prevent SWT ScrolledComposite from eating part of it's children
CC BY-SA 3.0
0
2008-08-29T19:36:33.920
2017-11-23T19:53:26.360
2017-11-22T12:03:56.590
452,775
3,657
[ "java", "eclipse", "swt", "rcp" ]
37,103
1
37,131
null
88
240,573
I have a container div with a fixed `width` and `height`, with `overflow: hidden`. I want a horizontal row of float: left divs within this container. Divs which are floated left will naturally push onto the 'line' below after they read the right bound of their parent. This will happen even if the `height` of the parent should not allow this. This is how this looks: ![Wrong](https://i.stack.imgur.com/v2x7d.png) How I would like it to look: ![Right][2] - Note: the effect I want can be achieved by using inline elements & `white-space: no-wrap` (that is how I did it in the image shown). This, however, is no good to me (for reasons too lengthy to explain here), as the child divs need to be floated block level elements.
CSS - Make divs align horizontally
CC BY-SA 4.0
0
2008-08-31T21:05:41.830
2021-07-10T22:02:48.067
2021-07-10T22:02:48.067
446,106
1,349,865
[ "html", "css", "alignment" ]
37,317
1
37,336
null
7
12,264
I'm working on a windows forms application (C#) where a user is entering data in a form. At any point while editing the data in the form the user can click one of the buttons on the form to perform certain actions. By default the focus goes to the clicked button so the user has to click back on to the control they want to edit in order to continue modifying the data on the form. What I need to be able to do is return the focus to the last edited control after the button click event has been processed. Here's a sample screenshot that illustrates what I'm talking about: ![Sample App Screen Shot](https://lh6.ggpht.com/joe.r.barone/SLs4KZMBqfI/AAAAAAAABNw/P6xtqhCo8Y4/s800/SampleApp1.jpg) The user can be entering data in textbox1, textbox2, textbox3, etc and click the button. I need the button to return the focus back to the control that most recently had the focus before the button was clicked. I'm wondering if anyone has a better way of implementing this functionality than what I've come up with. Here's what I'm doing right now: ``` public partial class Form1 : Form { Control _lastEnteredControl; private void textBox_Enter(object sender, EventArgs e) { _lastEnteredControl = (Control)sender; } private void button1_Click(object sender, EventArgs e) { MessageBox.Show("Do something here"); _lastEnteredControl.Focus(); } } ``` So basically what we have here is a class variable that points to the last entered control. Each textbox on the form is setup so the textBox_Enter method is fired when the control receives the focus. Then, when the button is clicked focus is returned to the control that had the focus before the button was clicked. Anybody have any more elegant solutions for this?
How do you return the focus to the last used control after clicking a button in a winform app?
CC BY-SA 2.5
0
2008-09-01T00:48:03.637
2014-06-18T19:14:17.867
2017-02-08T14:07:42.863
-1
3,452
[ "c#", ".net", "winforms" ]
37,783
1
83,332
null
2
1,557
I am creating an application for a Windows Mobile computer. The catch is that the device ([Motorola MC17](http://www.motorola.com/business/v/index.jsp?vgnextoid=d4397b103d175110VgnVCM1000008406b00aRCRD)) does not have a touch screen or universal keys - there are only six programmable hardware keys. [Fitt's law](http://en.wikipedia.org/wiki/Fitts%27s_law) is not applicable here, most Microsoft guidelines are also moot. For now I'm mimicking Nokia's S60 keyboard layout as close as possible, since it's the most popular phone platform among my target audience. ![Motorola MC17](https://i.stack.imgur.com/jsDo2.jpg) Are there any guidelines for creating a simple, discoverable user interface on such a constrained device? What fonts and colours should I use to make my UI readable? How do I measure if the items on-screen are big enough? What conventions should I follow?
Are there any guidelines for designing user interface for mobile devices?
CC BY-SA 4.0
0
2008-09-01T11:33:31.120
2018-12-27T22:23:26.857
2018-12-27T22:23:26.857
4,751,173
3,205
[ "user-interface", "windows-mobile", "usability" ]
41,198
1
41,235
null
24
26,147
How can I get an image to stretch the height of a `DIV` class? Currently it looks like this: ![](https://i.stack.imgur.com/DcrXC.png) However, I would like the `DIV` to be stretched so the `image` fits properly, but I do not want to resize the `image. Here is the CSS for the `DIV` (the grey box): ``` .product1 { width: 100%; padding: 5px; margin: 0px 0px 15px -5px; background: #ADA19A; color: #000000; min-height: 100px; } ``` The CSS being applied on the image: ``` .product{ display: inline; float: left; } ``` So, how can I fix this?
Getting image to stretch a div
CC BY-SA 4.0
0
2008-09-03T05:05:37.777
2020-02-26T13:49:50.797
2020-02-26T13:49:50.797
11,393,381
2,592
[ "css", "image" ]
47,817
1
604,928
null
24
48,270
Html Textarea elements only wrap when they reach a space or tab character. This is fine, until the user types a looooooooooooooooooooooong enough word. I'm looking for a way to strictly enforce line breaks (eg.: even if it results in "loooooooooooo \n ooooooooooong"). ![alt text](https://i.stack.imgur.com/sUmHB.png) The best I've found is to add a zero-width unicode space after every letter, but this breaks copy and paste operations. Anyone know of a better way? Note: I'm referring to the "textarea" element here (i.e.: the one that behaves similarly to a text input) - not just a plain old block of text.
Most elegant way to force a TEXTAREA element to line-wrap, *regardless* of whitespace
CC BY-SA 3.0
0
2008-09-06T20:36:05.250
2017-10-25T18:38:09.720
2015-06-19T19:32:00.623
1,159,643
4,939
[ "javascript", "html", "css", "text" ]
48,288
1
48,318
null
10
4,984
I've been trying to understand [Process.MainWindowHandle](http://msdn.microsoft.com/en-gb/library/system.diagnostics.process.mainwindowhandle.aspx). According to MSDN; "The main window is the window that is created when the process is started. After initialization, other windows may be opened, including the Modal and TopLevel windows, but ." (Emphasis added) But while debugging I noticed that MainWindowHandle seemed to change value... which I wasn't expecting, especially after consulting the documentation above. To confirm the behaviour I created a standalone WinForms app with a timer to check the MainWindowHandle of the "DEVENV" (Visual Studio) process every 100ms. Here's the interesting part of this test app... ``` IntPtr oldHWnd = IntPtr.Zero; void GetMainwindowHandle() { Process[] processes = Process.GetProcessesByName("DEVENV"); if (processes.Length!=1) return; IntPtr newHWnd = processes[0].MainWindowHandle; if (newHWnd != oldHWnd) { oldHWnd = newHWnd; textBox1.AppendText(processes[0].MainWindowHandle.ToString("X")+"\r\n"); } } private void timer1Tick(object sender, EventArgs e) { GetMainwindowHandle(); } ``` You can see the value of MainWindowHandle changing when you (for example) click on a drop-down menu inside VS. ![MainWindowHandleMystery](https://i.stack.imgur.com/r54iB.png) Perhaps I've misunderstood the documentation. Can anyone shed light?
Unexpected behaviour of Process.MainWindowHandle
CC BY-SA 4.0
0
2008-09-07T10:14:23.037
2018-12-28T07:40:47.750
2018-12-28T07:40:47.750
4,751,173
4,200
[ "c#", ".net", "msdn" ]
49,511
1
49,523
null
7
1,371
I have played with the idea of using a wiki (MediaWiki) to centralize all project information for a development project. This was done using extensions that pull information from SVN (using [SVNKit](http://svnkit.com/)) and by linking to Bugzilla to extract work assigned to a developer or work remaining for a release. Examples: ``` <bugzilla type="summary" user="[email protected]" /> ``` would return a summary ![Bugzilla Summary](https://i.stack.imgur.com/rfJjy.png) ``` <bugzilla type="status" status="ASSIGNED" product="SCM BEPPI" /> ``` would return ![Bugzilla Status](https://i.stack.imgur.com/YSV0t.png) Do you think that this would be useful? If so then what other integrations would you think would be valuable?
Using a wiki as a central development project repository
CC BY-SA 3.0
0
2008-09-08T11:32:49.517
2012-04-02T08:40:41.757
2012-04-02T08:32:45.380
1,219,121
2,939
[ "svn", "integration", "wiki", "projects", "bugzilla" ]
51,687
1
54,341
null
4
2,321
Has anyone implemented Lightbox style background dimming on a modal dialog box in a MFC/non .net app. I think the procedure would have to be something like: steps: 1. Get dialog parent HWND or CWnd* 2. Get the rect of the parent window and draw an overlay with a translucency over that window 3. allow the dialog to do it's modal draw routine, e.g DoModal() Are there any existing libraries/frameworks to do this, or what's the best way to drop a translucent overlay in MFC? Here's a mockup of what i'm trying to achieve if you don't know what 'lightbox style' means : ![alt text](https://farm4.static.flickr.com/3065/2843243996_8a4536f516_o.png) with a lightbox dialog box ![alt text](https://farm4.static.flickr.com/3280/2842409249_4a1c7f5810_o.png)
Lightbox style dialogs in MFC App
CC BY-SA 2.5
null
2008-09-09T11:53:23.360
2008-09-11T11:07:58.897
2017-02-08T14:07:47.180
-1
379
[ "c++", "user-interface", "mfc" ]
52,326
1
52,332
null
3
6,408
Is it possible to validate an xml file against its associated schema using Visual Studio 2005 IDE? I could only see options to create a schema based on the current file, or show the XSLT output ![alt text](https://i.stack.imgur.com/x9mHo.png)
How to validate an XML file against a schema using Visual Studio 2005
CC BY-SA 3.0
null
2008-09-09T16:45:06.810
2013-02-07T11:13:50.310
2013-02-07T11:13:50.310
8,446
5,182
[ "xml", "visual-studio", "xslt", "visual-studio-2005" ]
56,118
1
57,362
null
7
8,920
I am trying to write a formula in ActionScript 3 that will give me var "z" (please see image below) in degrees, which I will then convert to radians. I will already know the value of vars "x" and "y". Using trigonometry, how can I calculate the length of the hypotenuse and therefore the variable angle of var z? A solution in either AS3 or psuedocode would be very helpful. Thanks. ![triangle](https://i.stack.imgur.com/B0nfz.jpg)
Triangle Trigonometry (ActionScript 3)
CC BY-SA 3.0
0
2008-09-11T09:22:45.187
2012-03-29T23:54:15.667
2012-03-29T23:54:15.667
1,219,121
192
[ "actionscript-3", "trigonometry", "hypotenuse" ]
57,712
1
57,738
null
25
21,201
What is the best way to get hosting of an ASP.NET MVC application to work on IIS 5 (6 or 7). When I tried to publish my ASP.NET MVC application, all I seemed to get is 404 errors. I've done a bit of googleing and have found a couple of solutions, but neither seem super elegant, and I worry if they will be unusable once I come to use a shared hosting environment for the application. [Solution 1](http://blogs.microsoft.co.il/blogs/dorony/archive/2007/12/15/using-asp-net-mvc-on-iis-5.aspx) > 1. Right-click your application virtual directory on inetmgr.exe. 2. Properties->Virtual Directory Tab-> Configuration. 3. Add a new mapping extension. The extension should be .*, which will be mapped to the Executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll, or the appropriate location on your computer (you can simply copy this from the mapping for .aspx files). On the mapping uncheck "check that file exists". 4. 3 X OK and you're good to go. 5. If you want, you can apply this setting to all your web sites. In step1, click on the "Default Web Site" node instead of your own virtual directory, and in step 2 go to the "Home Directory" tab. The rest is the same. It seems a tad hacky to route everything through ASP.NET. [Solutions 2](http://blog.pagedesigners.co.nz/?p=29) Edit the MVC routing to contain .mvc in the URL and then follow the steps in solution 1 based around this extension. ![alt text](https://i.stack.imgur.com/TDp4F.png)
ASP.NET MVC and IIS 5
CC BY-SA 3.0
0
2008-09-11T21:30:50.740
2016-08-07T16:38:53.487
2016-08-07T16:38:53.487
4,433,386
230
[ "asp.net-mvc", "iis", "shared-hosting" ]
58,317
1
58,388
null
6
4,994
My site has a drop-down menu built in CSS and JavaScript that drops down over a Flash animation. In IE (6&7) the drop-down menus drop over the Flash animation, however, in Firefox (2&3) the menus appear underneath the Flash animation. Is there any way to get this dynamic menu to flow OVER the Flash in Firefox? ![alt text](https://lh3.ggpht.com/guterl/SMnyzAeha6I/AAAAAAAAABI/BGWJes9d9FA/s288/ie_sample.gif) In IE 7 menu appears over the Flash: In Firefox the menu appears under the Flash: (How can I fix this?!) ![alt text](https://lh3.ggpht.com/guterl/SMnyzHYVLrI/AAAAAAAAABQ/924qQaD3K0o/s288/firefox_sample.gif)
CSS / JavaScript Navigation Menu on top of Flash in Firefox
CC BY-SA 3.0
0
2008-09-12T04:47:42.670
2017-06-25T09:53:11.237
2017-06-25T09:53:11.237
7,750,640
6,050
[ "javascript", "css", "flash", "navigation" ]
59,309
1
27,663,253
null
172
169,307
What is the best way to vertically center the content of a div when the height of the content is variable. In my particular case, the height of the container div is fixed, but it would be great if there were a solution that would work in cases where the container has a variable height as well. Also, I would love a solution with no, or very little use of CSS hacks and/or non-semantic markup. ![alt text](https://content.screencast.com/users/jessegavin/folders/Jing/media/ba5c2688-0aad-4e89-878a-8911946f8612/2008-09-12_1027.png)
How to vertically center content with variable height within a div?
CC BY-SA 2.5
0
2008-09-12T15:29:55.000
2020-05-20T21:42:22.477
2017-12-12T08:32:48.267
1,654,984
5,651
[ "css", "vertical-alignment" ]
60,558
1
null
null
3
828
I need to do some emulation of some old DOS or mainframe terminals in Flex. Something like the image below for example. ![alt text](https://i.stack.imgur.com/qFtvP.png) The different coloured text is easy enough, but the ability to do different background colours, such as the yellow background is beyond the capabilities of the standard Flash text. I may also need to be able to enter text at certain places and scroll text up the "terminal". Any idea how I'd attack this? Or better still, any existing code/components for this sort of thing?
Terminal emulation in Flex
CC BY-SA 4.0
0
2008-09-13T14:16:35.027
2018-12-29T00:39:02.510
2018-12-29T00:39:02.510
4,751,173
6,277
[ "apache-flex" ]
66,720
1
null
null
45
30,212
I'm looking for a tool that will render a RDF graph in a reasonably useful graphic format. The primary purpose of the graphic format being inclusion into a PowerPoint slide or printing on a large plotter for management review. I am currently using TopBraid Composer which does a reasonably well at visualizing a single entity but doesn't seem to have a clear way of visualizing the entire graph (as a whole). Anyone know of any good solutions to this problem? ![TopBraid Composer Graph view screenshot](https://i.stack.imgur.com/2C2Q6.jpg)
Are there any tools to visualize a RDF graph? (please include a screenshot)
CC BY-SA 4.0
0
2008-09-15T20:40:30.593
2019-02-18T20:28:47.960
2018-12-29T19:01:50.330
4,751,173
3,957
[ "rdf", "semantics", "semantic-web", "owl", "ontology" ]
67,665
1
67,667
null
51
37,913
I recently came across an IE7 only bug that I thought I'd share so when I come to this site 6 months from now to figure out the same thing, I'll have it on hand. I believe the easiest way to recreate this bug would be the following html in a page with a declared doctype (it works correctly in "quirks mode" / no-doctype): ``` <div style="overflow: auto; height: 150px;"> <div style="position: relative;">[...]</div> </div> ``` In IE7, the outer div is a fixed size and the inner div is relatively positioned and contains more content (assuming the inner div causes an overflow). In all other browsers, this seems to work as expected. Screenshot: ![bug screenshot](https://i.stack.imgur.com/98kiZ.png)
IE7 CSS Scrolling Div Bug
CC BY-SA 3.0
0
2008-09-15T22:36:00.737
2013-12-13T21:50:43.167
2013-12-13T21:50:43.167
3,617
3,617
[ "html", "css", "internet-explorer-7" ]
76,002
1
76,030
null
7
4,314
My understanding of the Git pack file format is something like: ![alt text](https://content.screencast.com/users/aggieben/folders/Jing/media/dc42fabf-6fd6-47f3-9244-446b9ec04494/2008-09-16_1424.png) Where the table is 32-bits wide, and the first three 32-bit words are the pack file header. The last row of 32 bits are the first 4 bytes of an entry. As I understand it, the size of the entry is specified by consecutive bytes with the MSB set, followed by compressed data. In the first byte whose MSB is not set, is the MSB part of the compressed data, or is it a gap? If it's part of the compressed data, how can you guarantee that when the data is compressed that bit won't be set?
Git pack file entry format
CC BY-SA 2.5
0
2008-09-16T19:27:31.277
2017-06-16T10:19:27.440
2017-02-08T14:07:52.673
-1
3,279
[ "git", "file-format" ]
76,553
1
null
null
2
3,136
I want to add an item into the Desktop context menu (the menu you see when you right-click on an empty space on the Windows Desktop). Something like Catalyst Control Center in this screenshot: ![Embedded Example](https://i361.photobucket.com/albums/oo51/Stark3000/ContextMenuExample.png) I know how to add items to files' and folders' context menus through registry, but the Desktop seems to work differently: I didn't even find the text in the registry. So, how can I add a new item into the Desktop menu and how can I associate some code with it? I think the solution is language independent, if it's not, I'd appreciate any code that helps.
Adding item to the Desktop context menu in Windows
CC BY-SA 2.5
0
2008-09-16T20:23:17.897
2008-09-17T16:08:45.037
2017-02-08T14:07:53.007
-1
2,239
[ "windows", "user-interface", "desktop" ]
84,263
1
null
null
2
614
I'm designing a web site navigation hierarchy. It's a tree of nodes. Most nodes are pages. Some nodes are links (think shortcuts in Windows). Most pages hold HTML content. Some execute code. I'd like to represent these as this collection of classes and abstract (MustInherit) classes… ![class diagram](https://i.stack.imgur.com/0gNAy.gif) This is the database table where I'm going to store all this… [database table http://img178.imageshack.us/img178/8573/nodetablefm8.gif](http://img178.imageshack.us/img178/8573/nodetablefm8.gif) Here's where I'm stumped. PageNodes may or may not be roots. How should I handle the root class? ![class diagram](https://i.stack.imgur.com/1stKR.gif) I don't want to have to have all four of… - - - - I want the HtmlPageNode and CodePageNode classes to inherit from PageNode or else from RootPageNode. Is that possible? --- Clarification: There are multiple root nodes and roots may have parent nodes. Each is the root of only a sub-tree that has distinct styling. Think of different, color-coded departments. (Perhaps root is a poor name choice. Suggestions?) --- Update: Regarding the "Root" name... I've asked: [Is there a specific name for the node that coresponds to a subtree?](https://stackoverflow.com/questions/86790/is-there-a-specific-name-for-the-node-that-coresponds-to-a-subtree)
.NET abstract classes
CC BY-SA 4.0
null
2008-09-17T15:09:33.167
2019-02-18T07:19:45.557
2018-12-30T18:45:29.363
4,751,173
83
[ ".net", "inheritance", "abstract-class" ]
84,556
1
84,629
null
836
682,410
Personally I like this one: ![](https://i.stack.imgur.com/ZNtvc.jpg) P.S. Do not hotlink the cartoon without the site's permission please.
What's your favorite "programmer" cartoon?
CC BY-SA 4.0
0
2008-09-17T15:34:11.467
2022-07-16T15:40:26.347
2019-05-31T02:15:50.763
707,111
4,230
[ "language-agnostic" ]
86,181
1
86,294
null
3
3,363
I'm designing this collection of classes and abstract (MustInherit) classes… ![class diagram](https://web.archive.org/web/20120911004421/http://img396.imageshack.us/img396/1711/nodeclassinheritanceej0.gif) This is the database table where I'm going to store all this… ![database table](https://web.archive.org/web/20140725060342/http://img179.imageshack.us/img179/3237/nodetablenorootln3.gif) As far as the Microsoft SQL Server database knows, those are all nullable ("Allow Nulls") columns. But really, that depends on the class stored there: LinkNode, HtmlPageNode, or CodePageNode. Rules might look like this... ![rules table](https://web.archive.org/web/20140725053359/http://img127.imageshack.us/img127/74/datarulesha0.gif) How do I enforce such data integrity rules within my database? --- UPDATE: Regarding this single-table design... I'm still trying to zero in on a final architecture. I initially started with many small tables with almost zero nullalbe fields. [Which is the best database schema for my navigation?](https://stackoverflow.com/questions/56981/which-is-the-best-database-schema-for-my-navigation) And I learned about the LINQ to SQL IsDiscriminator property. [What’s the best way to handle one-to-one relationships in SQL?](https://stackoverflow.com/questions/57152/whats-the-best-way-to-handle-one-to-one-relationships-in-sql) But then I learned that LINQ to SQL only supports single table inheritance. [Can a LINQ to SQL IsDiscriminator column NOT inherit?](https://stackoverflow.com/questions/67659/can-a-linq-to-sql-isdiscriminator-column-not-inherit) Now I'm trying to handle it with a collection of classes and abstract classes. [Please help me with my .NET abstract classes.](https://stackoverflow.com/questions/84263/please-help-me-with-my-net-abstract-classes)
How do I enforce data integrity rules in my database?
CC BY-SA 4.0
null
2008-09-17T18:32:30.290
2020-09-16T07:07:49.730
2018-10-13T19:43:02.413
9,780,149
83
[ "sql", "sql-server", "database", "database-design" ]
88,883
1
1,336,258
null
1
6,631
I'm working now on a page that has a column of boxes styled with sexy shadows and corners and whatnot using the example [here](http://www.schillmania.com/content/projects/even-more-rounded-corners/). I have to admit, I don't fully understand how that CSS works, but it great. Inside the topmost box is a text-type input used for searching. That search box is wired up to a [YUI autocomplete](http://developer.yahoo.com/yui/autocomplete/) widget. Everything works fine in Firefox3 on Mac, FF2 on Windows, Safari on Mac. In IE7 on WinXP, the autocomplete suggestions render underneath the round-cornered boxes, making all but the first one unreadable (although you can still see enough peeking out between boxes that I'm comfortable IE7 really is getting more than one suggestion). Where could I start looking to correct the problem? Here's what success looks like in FF2 on WinXP: ![alt text](https://farm4.static.flickr.com/3042/2866012663_f5db805775_o.jpg) And here's what failure looks like in IE7: ![alt text](https://farm4.static.flickr.com/3105/2866012677_7535c1485f_o.jpg)
YUI Autocomplete renders under other page elements in IE7
CC BY-SA 2.5
0
2008-09-18T00:20:49.847
2009-08-28T04:13:34.657
2017-02-08T14:08:02.797
-1
8,995
[ "css", "internet-explorer-7", "yui", "z-index" ]
94,007
1
95,656
null
13
3,987
## Question I'm wondering how different ExtendScript is from JavaScript? Could I theoretically hire a web developer who has JavaScript savvy to develop it without demanding an excessive amount of learning on their part? ## Overview I'm working on a media database (or a so-called "multimedia library") project and it is based on XMP (the eXtensible Metadata Platform). The logical tool for administering the metadata and keywording seems to be Adobe Bridge, however I need to contract out the development of a couple of scripts to add a few key functions to Bridge, mainly for interfacing with a server-stored controlled keyword vocabulary. Upper management, in their infinite wisdom, has decided that putting a software alpha/beta tester and Adobe heavy-lifter [me] in charge of developing the project discovery is the best way to go about this. Whilst I know what I need done, I'm unsure who can actually do it. Regrettably, my programming knowledge is limited to C++, XML, Apple Script and web languages (unfortunately not including JavaScript), so I'm way out in the weeds when it comes to questions about JavaScript. [Bridge Developer Center](http://www.adobe.com/devnet/bridge/) Adobe has a handy SDK out there on the subject, but I can't really make much sense of the overall picture. Much of the Adobe user-to-user forum content is old or unrelated. ## Project description I need a menu added to the menu bar with three options. The three options would all use "Clear and Import" function possible in Bridge's Keywords panel to import 1 of 3 different tab-delimited text files from the database server using either the FTP or HTTP object. The reading I've done in the Bridge SDK and JavaScript guide suggests that menu items can be added as I've shown in the image below for clarity. Additionally, I've managed to get a very rough version of the "Clear and Import" method to work as a startup script, however I'd like to be able to call them on the fly by clicking on the appropriate menu entry. ![Diagram of Menu](https://farm4.static.flickr.com/3138/2868284584_ee00bb9563.jpg) For a larger view of the image, click [here](http://farm4.static.flickr.com/3138/2868284584_8fb0577be2_o.jpg)
Adobe ExtendScript development - How different than regular JavaScript?
CC BY-SA 2.5
0
2008-09-18T16:10:55.083
2009-06-17T04:17:22.110
2017-02-08T14:08:04.213
-1
17,794
[ "javascript", "adobe", "extendscript" ]
94,556
1
1,783,572
null
3
6,332
We've got a multiproject we're trying to run Cobertura test coverage reports on as part of our mvn site build. I can get Cobertura to run on the child projects, but it erroneously reports 0% coverage, even though the reports still highlight the lines of code that were hit by the unit tests. We are using mvn 2.0.8. I have tried running `mvn clean site`, `mvn clean site:stage` and `mvn clean package site`. I know the tests are running, they show up in the surefire reports (both the txt/xml and site reports). Am I missing something in the configuration? Does Cobertura not work right with multiprojects? This is in the parent .pom: ``` <build> <pluginManagement> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <inherited>true</inherited> <executions> <execution> <id>clean</id> <goals> <goal>clean</goal> </goals> </execution> </executions> </plugin> </plugins> </pluginManagement> </build> <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> <inherited>true</inherited> </plugin> </plugins> </reporting> ``` I've tried running it with and without the following in the child .poms: ``` <reporting> <plugins> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>cobertura-maven-plugin</artifactId> </plugin> </plugins> </reporting> ``` I get this in the output of the build: ``` ... [INFO] [cobertura:instrument] [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Instrumenting 3 files to C:\workspaces\sandbox\CommonJsf\target\generated-classes\cobertura Cobertura: Saved information on 3 classes. Instrument time: 186ms [INFO] Instrumentation was successful. ... [INFO] Generating "Cobertura Test Coverage" report. [INFO] Cobertura 1.9 - GNU GPL License (NO WARRANTY) - See COPYRIGHT file Cobertura: Loaded information on 3 classes. Report time: 481ms [INFO] Cobertura Report generation was successful. ``` And the report looks like this: ![cobertura report](https://i.stack.imgur.com/D7yiM.png)
Maven2 Multiproject Cobertura Reporting Problems During mvn site Build
CC BY-SA 4.0
0
2008-09-18T17:13:55.213
2019-01-02T18:47:03.977
2019-01-02T18:47:03.977
4,751,173
765
[ "maven-2", "code-coverage", "maven-plugin", "cobertura" ]
104,850
1
287,877
null
187
79,140
I want to try to convert a string to a Guid, but I don't want to rely on catching exceptions ( - - - In other words the code: ``` public static Boolean TryStrToGuid(String s, out Guid value) { try { value = new Guid(s); return true; } catch (FormatException) { value = Guid.Empty; return false; } } ``` is not suitable. I would try using RegEx, but since the guid can be parenthesis wrapped, brace wrapped, none wrapped, makes it hard. Additionally, I thought certain Guid values are invalid(?) --- [ChristianK](https://stackoverflow.com/questions/104850/c-test-if-string-is-a-guid-without-throwing-exceptions#137829) had a good idea to catch only `FormatException`, rather than all. Changed the question's code sample to include suggestion. --- Why worry about thrown exceptions? Am I really expecting invalid GUIDs all that often? The answer is . That is why I am using TryStrToGuid - I expecting bad data. [Namespace extensions can be specified by appending a GUID to a folder name](http://msdn.microsoft.com/en-us/library/cc144096(VS.85).aspx). I might be parsing folder names, checking to see if the text after the final is a GUID. ``` c:\Program Files c:\Program Files.old c:\Users c:\Users.old c:\UserManager.{CE7F5AA5-6832-43FE-BAE1-80D14CD8F666} c:\Windows c:\Windows.old ``` I might be running a heavily used web-server wants to check the validity of some posted back data. I don't want invalid data tying up resources 2-3 orders of magnitude higher than it needs to be. I might be parsing a search expression entered by a user. ![enter image description here](https://i.stack.imgur.com/Ghb12.png) If they enter GUID's I want to process them specially (such as specifically searching for that object, or highlight and format that specific search term in the response text.) --- Test converting 10,000 good Guids, and 10,000 bad Guids. ``` Catch FormatException: 10,000 good: 63,668 ticks 10,000 bad: 6,435,609 ticks Regex Pre-Screen with try-catch: 10,000 good: 637,633 ticks 10,000 bad: 717,894 ticks COM Interop CLSIDFromString 10,000 good: 126,120 ticks 10,000 bad: 23,134 ticks ```
Test if string is a guid without throwing exceptions?
CC BY-SA 3.0
0
2008-09-19T19:35:34.123
2021-12-13T10:49:51.883
2017-05-30T14:27:13.457
542,251
12,597
[ "c#", "string", "parsing", "guid" ]
106,920
1
null
null
8
765
Here's the last few frames of a typical Ruby on Rails traceback: ![application trace](https://i.stack.imgur.com/plGxn.png) And here are the last few frames of a typical Nevow traceback in Python: ![alt text](https://i.stack.imgur.com/Jn4Le.png) It's not just the web environment either, you can make similar comparisons between ipython and irb. How can I get more of these sorts of details in Ruby?
How can I get source and variable values in ruby tracebacks?
CC BY-SA 4.0
0
2008-09-20T03:15:54.610
2019-01-04T08:40:20.680
2019-01-04T08:40:20.680
4,751,173
9,585
[ "ruby", "debugging", "exception", "traceback" ]
107,054
1
107,149
null
1
1,690
I'm trying to implement an outdent of the first letter of the first paragraph of the body text. Where I'm stuck is in getting consistent spacing between the first letter and the rest of the paragraph. For example, there is a huge difference in spacing between a "W" and an "I" !['I' Outdent](https://i.stack.imgur.com/2TsvYm.png) !['W' Outdent](https://i.stack.imgur.com/DnZVSm.png) Anyone have any ideas about how to mitigate the differences? I'd prefer a pure CSS solution, but will resort to JavaScript if need be. : I don't necessarily need compatibility in IE or Opera
Consistent outdent of first letter with CSS?
CC BY-SA 3.0
0
2008-09-20T04:09:30.767
2016-01-14T20:34:47.130
2015-11-07T20:32:14.633
1,366,033
11,577
[ "css", "firefox", "safari", "typography" ]
109,608
1
110,400
null
1
744
When I place a control on a tabpage in Silverlight the control is placed ~10 pixels down and ~10 pixels right. For example, the following xaml: ``` <System_Windows_Controls:TabControl x:Name=TabControlMain Canvas.Left="0" Canvas.Top="75" Width="800" Height="525" Background="Red" HorizontalContentAlignment="Left" VerticalContentAlignment="Top" Padding="0" Margin="0"> <System_Windows_Controls:TabItem Header="Test" VerticalContentAlignment="Top" BorderThickness="0" Margin="0" Padding="0" HorizontalContentAlignment="Left"> <ContentControl> <Grid Width="400" Height="200" Background="White"/> </ContentControl> </System_Windows_Controls:TabItem> </System_Windows_Controls:TabControl> ``` will produce: ![alt text](https://i.stack.imgur.com/y5LuN.jpg) How do I position the content at 0,0?
How do I position the content of a tabpage in Silverlight?
CC BY-SA 4.0
null
2008-09-20T22:22:45.663
2019-01-05T19:55:40.120
2019-01-05T19:55:40.120
4,751,173
4,244
[ "c#", "silverlight" ]
110,271
1
110,285
null
1
888
. [Southpark game](http://www.megaderek.com/southpark/) (very popular if you see download count on download.com ,,, did he ask for permission ??) I am making a 2d game based on dexter's lab theme. I've got the sprite of dexter from GSA. basically I'm not an artist, so I have to depend on already available sprites, backgrounds, sfx on websites like GameSpriteArchive etc. But is it okay/legal to use the dexter sprite I have got ? I wish to release it publicly too, so shall I have to make lot of changes to do that? Is it possible to get a permission to use the sprite?? My hopes are very less in getting permission. 1. Dexter's sprite from google search 2. Enemy sprites from various GBA/SNES/etc games 3. tiles/objects from these retro games 4. Background art and style from blogs and portfolios of artists behind dexter, powerpuff girls, and samurai jack ![alt text](https://i.stack.imgur.com/LsJGT.jpg)
Is using Dexter's character sprite okay, or do I have to
CC BY-SA 4.0
null
2008-09-21T04:50:18.603
2019-01-05T19:55:50.110
2019-01-05T19:55:50.110
4,751,173
8,786
[ "graphics", "2d", "media" ]
113,640
1
113,667
null
54
72,738
I want to create a box like this with title: ![CSS box with title](https://i.stack.imgur.com/2rip1.gif) Can any one please let me know if there is a default CSS tag to do this? Or do I need to create my custom style?
Which CSS tag creates a box like this with title?
CC BY-SA 3.0
0
2008-09-22T07:35:51.753
2020-08-07T09:28:44.420
2014-10-17T01:50:40.737
964,243
20,165
[ "html", "css", "fieldset", "legend" ]
115,459
1
939,784
null
38
78,355
I'm looking for an online tool that will let me create a gif or png like this one: ![alt text](https://upload.wikimedia.org/math/b/4/7/b477e400396c711c60c4302bbbd888ae.png) Some kind of LaTex online service, with friendly examples?
Online tool for generating mathematical equation image files
CC BY-SA 2.5
0
2008-09-22T15:20:20.047
2017-02-14T17:42:18.570
2017-02-08T14:08:12.947
-1
19,269
[ "math", "image" ]
117,920
1
325,632
null
0
461
I have a website where people can upload documents, and view them later at their convenience. I store the binary info along with the mime type in my db, and later just stream the binary content straight to the browser. This works for for every file type except Office 2007 files. When I try to view the Office 2007 files, I get a popup requesting credentials. After I dismiss the the dialog (by canceling), I get another popup like the one below: ![](https://4.bp.blogspot.com/_U0AuZcqOces/SNgVYTB4rCI/AAAAAAAAAD8/_WT8BwTZwBQ/s400/office07popup.jpg) After also dismissing this dialog (by clicking "Yes"), the document finally opens. What gives? Does the browser really not know how to handle Office 2007 files? I checked the mime-type I'm saving, and everything looks correct. Any ideas on what I can do to get rid of these dialogs when trying to open a file?
How do I open Office 2007 files stored on a website?
CC BY-SA 2.5
null
2008-09-22T22:03:05.630
2008-11-28T12:18:19.190
2017-02-08T14:08:13.283
-1
781
[ "asp.net", "security", "office-2007" ]
121,810
1
582,063
null
6
4,715
I am forever right-clicking to reply to an email, only to accidentally click `Print` and have Outlook send it directly to the printer quicker than I can stop it. ![alt text](https://farm4.static.flickr.com/3221/2882658372_496d6e7a11_o.jpg) I am using Outlook 2007.
Remove Right Click Print Context Menu from Outlook 2007
CC BY-SA 3.0
0
2008-09-23T15:38:41.867
2020-06-23T08:09:17.130
2020-06-23T08:09:17.130
100,297
383
[ "vba", "outlook", "outlook-2007" ]
122,741
1
122,983
null
8
1,280
OK, I have been working on a random image selector and queue system (so you don't see the same images too often). All was going swimmingly (as far as my crappy code does) I got to the random bit. I wanted to test it, but how do you test for it? There is no `Debug.Assert(i.IsRandom)` (sadly) :D So, I got my brain on it after watering it with some tea and came up with the following, I was just wondering if I could have your thoughts? - - - i.e. ``` Debug.Assert(myObj.RndVal == RndIntTester.ValuePassed); ``` But I couldn't help but think, I ran that through lots of iterations to see if it fell over at any time etc. Do you think I was wasting my time with this? Or could I have got away with: ![Awesome Random Number Generator](https://imgs.xkcd.com/comics/random_number.png) [GateKiller's answer](https://stackoverflow.com/questions/122741/testing-for-random-value-thoughts-on-this-approach#122765) reminded me of this: ![Dilbert Random](https://www.random.org/analysis/dilbert.jpg) ## Update to Clarify - - -
Testing for Random Value - Thoughts on this Approach?
CC BY-SA 2.5
0
2008-09-23T18:16:23.390
2010-12-19T18:13:50.600
2020-06-20T09:12:55.060
-1
832
[ "unit-testing", "testing", "random", "automated-tests" ]
127,899
1
null
null
0
1,473
i have a control that is organized like this ![alt text](https://dl-web.getdropbox.com/get/jsstructure.GIF?w=faef1ed3) and i want to have the javascript registered on the calling master pages, etc, so that anywhere this control folder is dropped and then registered, it will know how to find the URL to the js. Here is what i have so far (in the user control ) ``` protected void Page_Load(object sender, EventArgs e) { if(!Page.IsClientScriptBlockRegistered("jqModal")) Page.ClientScript.RegisterClientScriptInclude("jqModal", ResolveClientUrl("~js/jqModal.js")); if (!Page.IsClientScriptBlockRegistered("jQuery")) Page.ClientScript.RegisterClientScriptInclude("jQuery", ResolveClientUrl("~/js/jQuery.js")); if (!Page.IsClientScriptBlockRegistered("tellAFriend")) Page.ClientScript.RegisterClientScriptInclude("tellAFriend", ResolveClientUrl("js/tellAFriend.js")); } ``` Any ideas?
Best way to register js for modularity in User Control
CC BY-SA 2.5
0
2008-09-24T15:31:38.457
2019-09-16T03:15:55.623
2019-09-16T03:15:55.623
3,744,182
1,748,529
[ "jquery", ".net", "user-controls", "relative-path", "resolveurl" ]
128,305
1
null
null
6
4,554
How to tag images in the image itself in a web page? I know [Taggify](http://www.taggify.net/), but... is there other options? [Orkut](http://en.blog.orkut.com/2008/06/tag-thats-me.html) also does it to tag people faces... How is it done? Anyone knows any public framework that is able to do it? See a sample bellow from Taggify: ![alt text](https://i.stack.imgur.com/gT1zq.jpg)
Tag images in the image itself? HOW-TO
CC BY-SA 4.0
0
2008-09-24T16:47:42.067
2019-01-08T19:52:45.233
2019-01-08T19:52:45.233
4,751,173
1,100
[ "javascript", "image", "tags" ]
129,920
1
355,791
null
16
4,526
I have developed a couple of extensions for Firefox, and am annoyed that it is so hard to get the extension signed. When an extension isn't signed, it says "Author not verified" when it is installed, and to me that just looks wrong. I have a simple build script that builds my .xpi file from sources, and I have a licenced copy of PKZip (which according to a number of tutorials is required to build a signed xpi file that Firefox requires), but I haven't found a way to get a free/cheap certificate that actually works or a set of instructions that do the trick. Since my extensions are free, I don't want to spend $400 on a commercial certificate, but I don't mind spending $50 or so to get it done. I have both Linux and Windows machines, although my build script currently uses Windows and that would be most convenient to use. How have you solved this? What do I need to do to automatically and securely sign my extensions when they are built? Edit: I appreciate the Google hits, but the steps they provide aren't complete enough on how to actually get a certificate that works. The feeling I get reminds me of this classic: ![alt text](https://i.stack.imgur.com/PIgLC.gif)
How do you sign your Firefox extensions?
CC BY-SA 4.0
0
2008-09-24T20:56:05.930
2019-01-10T08:06:06.840
2019-01-10T08:06:06.840
4,751,173
13,394
[ "firefox", "build-automation", "certificate", "code-signing" ]
135,573
1
null
null
4
4,682
I have a project containing at least one DLL along with the executable output. I have added a Deployment Project to this solution, which asked me for a name and working directory upon creation like all projects. I named this "MyProduc_Installer" and have been able to modify all aspects of the installation process except for changing the name of the installer itself. Throughout the install process, the user sees messages like "Welcome to the MyProduct_Installer Installer." Even in the Add/Remove Programs list, this is the application's ill conceived title. How do I change this setting? I have tried right click/properties, as well as all the View options. I couldn't find anything in the assembly information for the executable project, or solution properties. I have tried right-clicking on the project in the Explorer to change the properties, but here is what I see: ![alt text](https://sites.google.com/site/sizerfx/Home/properties.png?attredirects=0) There is no setting here to change the project title.
How to change settings for a Visual Studio 2005 Deployment Project
CC BY-SA 2.5
0
2008-09-25T19:49:44.710
2011-03-29T05:41:00.437
2017-02-08T14:08:16.707
-1
414,107
[ "deployment", "visual-studio-2005" ]
136,129
1
136,265
null
11
22,961
I am trying to set the disabled font characteristics for a Label Control. I can set all of the Font characteristics (size, bold, etc), but the color is overridden by the default windows behavior which seems to be one of these two colors: - - The image below demonstrates the behavior -- Column 1 is Labels, Column 2 is TextBoxs, and Column 3 is ComboBoxes. ![alt text](https://i.stack.imgur.com/60viN.png) Edit -- Explaining the image: The first two rows are default styles for a label, textbox, and combobox. In the second two rows, I set the Background color to Red and Foreground to White. The disabled font style handling by Microsoft is inconsistent.
Windows Forms: How do you change the font color for a disabled label
CC BY-SA 4.0
0
2008-09-25T21:05:01.597
2019-01-11T18:58:18.060
2019-01-11T18:58:18.060
4,751,173
19,242
[ "winforms" ]
136,604
1
137,162
null
1
1,219
Sorry if the title is poorly descriptive, but I can't do better right now =( So, I have this master-detail scheme, with the detail being a tree structure (one to many self relation) with n levels (on SQLServer 2005) I need to copy a detail structure from one master to the another using a stored procedure, by passing the source master id and the target master id as parameters (the target is new, so it doesn't has details). I'm having troubles, and asking for your kind help in finding a way to keep track of parent id's and inserting the children without using cursors or nasty things like that... ![table model for the problem](https://i.stack.imgur.com/hBzdZ.jpg) This is a sample model, of course, and what I'm trying to do is to copy the detail structure from one master to other. In fact, I'm creating a new master using an existing one as template.
Duplicate Data over One-to-Many self relation (Tsql)
CC BY-SA 4.0
null
2008-09-25T22:30:36.507
2019-01-11T18:58:31.887
2019-01-11T18:58:31.887
4,751,173
6,359
[ "sql-server", "tsql" ]
136,807
1
139,112
null
0
258
I'm having a weird cross-browser flash problem. Please see the screenshot below. I have seen this behaviour before, but I cannot recall what the cause was. Can someone please tell me why this happens, and possible actions I can take to fix it? ![flash problem in ie7 and firefox](https://i.stack.imgur.com/KDy17.png)
What can cause mutated Flash display like this?
CC BY-SA 4.0
null
2008-09-25T23:17:32.447
2019-01-13T10:24:03.913
2019-01-13T10:24:03.913
4,751,173
2,192
[ "flash", "internet-explorer", "firefox", "video", "cross-browser" ]
138,056
1
138,357
null
11
677
In other words, a block of code like this: ``` (setq initial-major-mode (lambda () (text-mode) (font-lock-mode) )) ``` ... would come out looking like something like this: ![alt text](https://i.stack.imgur.com/kiaIG.gif) If something like this already exists, what is it? And if it doesn't exist, how should I go about writing it?
When editing Lisp code, can emacs be configured to display each nested level of parentheses in a different color?
CC BY-SA 4.0
0
2008-09-26T06:41:49.073
2019-01-13T10:24:22.557
2019-01-13T10:24:22.557
4,751,173
7,598
[ "emacs", "lisp" ]
141,779
1
143,288
null
45
11,599
The problem/comic in question: [http://xkcd.com/287/](http://xkcd.com/287/) ![General solutions get you a 50% tip](https://imgs.xkcd.com/comics/np_complete.png) I'm not sure this is the best way to do it, but here's what I've come up with so far. I'm using CFML, but it should be readable by anyone. ``` <cffunction name="testCombo" returntype="boolean"> <cfargument name="currentCombo" type="string" required="true" /> <cfargument name="currentTotal" type="numeric" required="true" /> <cfargument name="apps" type="array" required="true" /> <cfset var a = 0 /> <cfset var found = false /> <cfloop from="1" to="#arrayLen(arguments.apps)#" index="a"> <cfset arguments.currentCombo = listAppend(arguments.currentCombo, arguments.apps[a].name) /> <cfset arguments.currentTotal = arguments.currentTotal + arguments.apps[a].cost /> <cfif arguments.currentTotal eq 15.05> <!--- print current combo ---> <cfoutput><strong>#arguments.currentCombo# = 15.05</strong></cfoutput><br /> <cfreturn true /> <cfelseif arguments.currentTotal gt 15.05> <cfoutput>#arguments.currentCombo# > 15.05 (aborting)</cfoutput><br /> <cfreturn false /> <cfelse> <!--- less than 15.05 ---> <cfoutput>#arguments.currentCombo# < 15.05 (traversing)</cfoutput><br /> <cfset found = testCombo(arguments.currentCombo, arguments.currentTotal, arguments.apps) /> </cfif> </cfloop> </cffunction> <cfset mf = {name="Mixed Fruit", cost=2.15} /> <cfset ff = {name="French Fries", cost=2.75} /> <cfset ss = {name="side salad", cost=3.35} /> <cfset hw = {name="hot wings", cost=3.55} /> <cfset ms = {name="moz sticks", cost=4.20} /> <cfset sp = {name="sampler plate", cost=5.80} /> <cfset apps = [ mf, ff, ss, hw, ms, sp ] /> <cfloop from="1" to="6" index="b"> <cfoutput>#testCombo(apps[b].name, apps[b].cost, apps)#</cfoutput> </cfloop> ``` The above code tells me that the only combination that adds up to $15.05 is 7 orders of Mixed Fruit, and it takes 232 executions of my testCombo function to complete. Is there a better algorithm to come to the correct solution? Did I come to the correct solution?
Solving the NP-complete problem in XKCD
CC BY-SA 2.5
0
2008-09-26T20:30:38.680
2012-07-08T03:10:30.383
2017-02-08T14:08:18.060
-1
751
[ "language-agnostic", "np-complete" ]
144,880
1
null
null
0
603
Curious what is recognized as a solid algorithm/approach for judging the strength of a directed acyclic graph - particularly the strength of certain nodes. The main question I have about this can be boiled down to the following two graphs: ![Dag Strength](https://farm4.static.flickr.com/3055/2893003041_0e9c6dc251.jpg) (if graph doesn't show up, click here or visit this link: [http://www.flickr.com/photos/86396568@N00/2893003041/](http://www.flickr.com/photos/86396568@N00/2893003041/) To my eyes, A is in a stronger position than a. I am judging strength by how strong a node can remain if a link is knocked out. I'd call the first a thin "stilt", and the second a thick "stalk". Here are the approaches I've considered so far for judging the strength of a node: 1) Counting the number of nodes below, subtracting the number of nodes above. - 2) Counting the number of complete paths (to termination) for each node, summing their lengths. - - 3) Counting every possible path, treating every node as a destination. - 3 seems like the best option so far, but is there one that is better, generalized for DAGs? Is this something that has a known best approach? The principles are to use as much information in the graph as possible, and for the solution to be explainable in an intuitive way.
How to judge the strength of a directed acyclic graph?
CC BY-SA 2.5
null
2008-09-28T00:40:20.053
2008-09-29T01:32:39.093
2017-02-08T14:08:19.117
-1
null
[ "tree", "graph-theory", "directed-acyclic-graphs" ]
145,354
1
145,571
null
27
11,287
After searching online, the best solution I've found so far is to just make a symbolic link in either "/Library/logs/" or "~/Library/logs/" to get it to show up in the Console application. I'm wondering if it would be possible to add a new directory or log file to the "root" level directly under the "LOG FILES" section in the console. Here's a quick screenshot: ![OS X Console](https://i.stack.imgur.com/0QsJz.png)
Adding custom log locations to the OS X console application
CC BY-SA 4.0
0
2008-09-28T06:34:37.970
2021-02-12T19:47:10.023
2019-01-14T18:26:33.853
4,751,173
5,291
[ "macos", "logging", "console" ]
147,981
1
null
null
1
543
is there a tomahawk component, that enables "scrollable tabs"? What I mean is something for the following situation: If I have very many tabs, the tab-bar gets a little arrow on the side to scroll through all the open tabs (like in firefox). ![image](https://dl.getdropbox.com/u/165601/arrow.png) Is there a tomahawk component for creating something similar?
Tomahawk and scrolling tabs
CC BY-SA 2.5
null
2008-09-29T08:44:39.273
2009-09-20T21:00:02.293
2017-02-08T14:08:19.790
-1
1,870
[ "java", "jsf", "tomahawk" ]
148,097
1
148,131
null
3
2,264
In IIS 6, I can use the Web Service Extensions folder in Inetmgr to allow/prohibit isapi filters, such as ASP.net. I want to be able to do this programmatically (in particular, from an installer script/exe). ![alt text](https://i56.photobucket.com/albums/g192/assaflavie/misc/iis.png?t=1222681203) Any ideas?
enabling/disabling asp.net web service extension via script
CC BY-SA 2.5
null
2008-09-29T09:31:34.637
2012-12-14T14:58:01.783
2017-02-08T14:08:20.123
-1
11,208
[ "asp.net", "iis" ]
149,337
1
null
null
4
1,333
Is it possible to create a .NET equivalent to the following code? ``` <?php if (!isset($_SERVER['PHP_AUTH_USER'])) { header('WWW-Authenticate: Basic realm="My Realm"'); header('HTTP/1.0 401 Unauthorized'); echo 'Text to send if user hits Cancel button'; exit; } else { echo "<p>Hello {$_SERVER['PHP_AUTH_USER']}.</p>"; echo "<p>You entered {$_SERVER['PHP_AUTH_PW']} as your password.</p>"; } ?> ``` I would like to be able to define a static user/password in the web.config as well. This is very easy to do in PHP, haven't seen anything explaining how to do this in MSDN. --- All I want is this: ![https://i.stack.imgur.com/IJE1b.png](https://i.stack.imgur.com/IJE1b.png)
HTTP Authentication in .NET
CC BY-SA 4.0
null
2008-09-29T15:54:52.220
2019-01-16T07:53:58.790
2019-01-16T07:53:58.790
4,751,173
795
[ ".net", "http", "authentication" ]
150,031
1
150,065
null
3
6,056
Does anyone have a good technique (or tutorial) to implement rulers within a C# Windows Forms application? I want to display an image while showing rulers that indicate your mouse position to allow a more accurate positioning of the cursor. Just like the image below: ![Ruler depicting where the cursor is located.](https://i.stack.imgur.com/QfIIi.png) I tried using splitter controls to hold the tick marks but I don't know how to make the top-left the gray blank area. Any advice? Thanks.
Implementing rulers in C# form
CC BY-SA 3.0
null
2008-09-29T18:36:14.997
2019-10-17T04:57:53.300
2015-03-17T08:01:48.523
4,535,131
13,115
[ "c#", "winforms", "controls" ]
150,535
1
150,617
null
5
1,296
How do you remove the jagged edges from a wide button in internet explorer? For example: ![alt text](https://i.stack.imgur.com/em5K0.gif)
Jagged Button edges in Internet Explorer
CC BY-SA 4.0
0
2008-09-29T20:38:29.527
2019-01-19T09:51:23.183
2019-01-19T09:51:23.183
4,751,173
208
[ "javascript", "css", "internet-explorer" ]
154,535
1
163,699
null
0
507
I have used Photoshop CS2's "Save for Web" feature to create a table of images for my site layout. This HTML appears fine in a web browser, however when imported into Visual Studio and viewed in the site designer, the metrics are wrong and there are horizontal gaps between images (table cells). The output from Photoshop does not refer to any stylesheets. The table attributes set border, cellpadding and cellspacing to 0. Here is how it looks in the Designer: ![alt text](https://sites.google.com/site/sizerfx/Home/layout1.png?attredirects=0) And here is how it looks in the browser: ![alt text](https://sites.google.com/site/sizerfx/Home/layout2.png?attredirects=0) Is Visual Studio picky about layout of tables and images? Is this a bug in Visual Studio 2005?
How do I ensure Visual Studio 2005 displays the tables and images correctly?
CC BY-SA 2.5
null
2008-09-30T19:21:17.970
2008-10-02T19:11:14.763
2017-02-08T14:08:21.800
-1
414,107
[ "asp.net", "html", "visual-studio", "designer", "photoshop" ]
155,920
1
159,948
null
58
113,047
I have one of those "I swear I didn't touch the server" situations. I honestly didn't touch any of the php scripts. The problem I am having is that php data is not being saved across different pages or page refreshes. I know a new session is being created correctly because I can set a session variable (e.g. $_SESSION['foo'] = "foo" and print it back out on the same page just fine. But when I try to use that same variable on another page it is not set! Is there any php functions or information I can use on my hosts server to see what is going on? Here is an example script that does not work on my hosts' server as of right now: ``` <?php session_start(); if(isset($_SESSION['views'])) $_SESSION['views'] = $_SESSION['views']+ 1; else $_SESSION['views'] = 1; echo "views = ". $_SESSION['views']; echo '<p><a href="page1.php">Refresh</a></p>'; ?> ``` The 'views' variable never gets incremented after doing a page refresh. I'm thinking this is a problem on their side, but I wanted to make sure I'm not a complete idiot first. Here is the phpinfo() for my hosts' server (PHP Version 4.4.7): ![alt text](https://i.stack.imgur.com/3bv0K.png)
PHP Session data not being saved
CC BY-SA 3.0
0
2008-10-01T01:57:49.127
2018-01-16T04:09:40.887
2015-07-27T08:28:13.710
411,022
13,556
[ "php", "session" ]
159,262
1
161,041
null
2
1,618
i have a flow panel that i'm adding extra items to it at runtime based on whether they have chosen to show all the items. that's all works fine; the expansion is controlled by a toolbar button. the trouble is we'd like the user to be able to move his mouse over the "+" sign to expand the section. ![alt text](https://i.stack.imgur.com/TRHTG.gif) initially i looked at TSpeedButton (OnMouseEnter) but even when it's "Flat", the focus rectangle still shows and so the glyph isn't centered. the main problem with this solution is it's appearance. then i looked at making a descendant of TImage. that's a bit "unconventional" but it'd work. in OnMouseEnter or OnClick, it'd toggle an internal boolean "Expanded" flag and then load the appropriate picture from a resource. i have a dislike for unconventional solutions like that. i need to add it to a few different screens so it's probably prudent for me to have/build a component for this. i have JVCL but i don't see anything suitable offhand. thank you for your comments/help!
Seeking a way to have a "Hover button" to expand a section
CC BY-SA 4.0
null
2008-10-01T19:19:49.417
2019-02-19T05:01:08.830
2019-01-20T19:46:18.780
4,751,173
14,031
[ "delphi", "components" ]
161,093
1
161,105
null
1
288
I have a table that looks like that: ![alt text](https://i.stack.imgur.com/R0TIr.jpg) The rows are sorted by CLNDR_DATE DESC. I need to find a CLNDR_DATE that corresponds to the highlighted row, in other words: Find the topmost group of rows WHERE EFFECTIVE_DATE IS NOT NULL, and return the CLNR_DATE of a last row of that group. Normally I would open a cursor and cycle from top to bottom until I find a NULL in EFFECTIVE_DATE. Then I would know that the date I am looking for is CLNDR_DATE, obtained at the previous step. However, I wonder if the same can be achieved with a single SQL?
Do this with a single SQL
CC BY-SA 3.0
null
2008-10-02T06:29:39.167
2015-06-19T20:20:53.960
2015-06-19T20:20:53.960
1,159,643
10,557
[ "sql", "oracle" ]
163,604
1
163,843
null
4
3,637
I'm trying to select a random 10% sampling from a small table. I thought I'd just use the RAND() function and select those rows where the random number is less than 0.10: ``` SELECT * FROM SomeTable WHERE SomeColumn='SomeCondition' AND RAND() < 0.10 ``` But I soon discovered that RAND() always returns the same number! Reminds me of this [xkcd cartoon](http://xkcd.com/221/). ![](https://imgs.xkcd.com/comics/random_number.png) OK, no problem, the RAND function takes a seed value. I will be running this query periodically, and I want it to give different results if I run it on a different day, so I seed it with a combination of the date and a unique row ID: ``` SELECT * FROM SomeTable WHERE SomeColumn='SomeCondition' AND RAND(CAST(GETDATE) AS INTEGER) + RowID) < 0.10 ``` I still don't get any results! When I show the random numbers returned by RAND, I discover that they're all within a narrow range. It appears that getting a random number from RAND requires you to use a random seed. If I had a random seed in the first place, I wouldn't need a random number! I've seen the previous discussions related to this problem: [SQL Server Random Sort](https://stackoverflow.com/questions/52964/sql-server-random-sort) [How to request a random row in SQL?](https://stackoverflow.com/questions/19412/how-to-request-a-random-row-in-sql) They don't help me. TABLESAMPLE works at the page level, which is great for a big table but not for a small one, and it looks like it applies prior to the WHERE clause. TOP with NEWID doesn't work because I don't know ahead of time how many rows I want. Anybody have a solution, or at least a hint? Thanks to AlexCuse for a [solution](https://stackoverflow.com/questions/163604/what-am-i-doing-wrong-when-using-rand-in-ms-sql-server-2005#163843) which works for my particular case. Now to the larger question, how to make RAND behave?
What am I doing wrong when using RAND() in MS SQL Server 2005?
CC BY-SA 3.0
null
2008-10-02T17:41:09.660
2017-09-11T00:42:41.233
2017-05-23T11:45:25.620
-1
5,987
[ "sql", "sql-server", "random" ]
167,808
1
167,841
null
3
1,394
I have created a user control to handle adding comments to certain business entities, like contacts and customers. Works great ... except for one issue. I am using a ListView control to edit and delete comments, and a separate area, on the same user control to add a new comment. All of this is wrapped in an UpdatePanel. ![Screenshot](https://farm4.static.flickr.com/3239/2909377399_888d42b595.jpg?v=0) Here is my scenario ... the user adds a new comment ... the page does a postback, the data is successfully saved, and the ListView control is updated to show the new comment. Now, if the user the browser, it will naturally postback again and will add another duplicate record. Any ideas on how best to prevent this?
AJAX, postbacks and browser refreshes
CC BY-SA 2.5
0
2008-10-03T16:43:20.300
2009-06-23T07:04:24.880
2017-02-08T14:08:25.167
-1
1,768
[ "asp.net", "ajax" ]
168,173
1
168,182
null
8
3,939
I have a webpage that pulls information from a database, converts it to .csv format, and writes the file to the HTTPResponse. ``` string csv = GetCSV(); Response.Clear(); Response.ContentType = "text/csv"; Response.Write(csv); ``` This works fine, and the file is sent to the client with no problems. However, when the file is sent to the client, the name of the current page is used, instead of a more friendly name (like "data.csv"). ![alt text](https://ktrauberman.files.wordpress.com/2008/10/exportcsv.gif) My question is, how can I change the name of the file that is written to the output stream without writing the file to disk and redirecting the client to the file's url?
Change name of file sent to client?
CC BY-SA 2.5
0
2008-10-03T18:17:32.777
2011-05-21T19:17:41.617
2017-02-08T14:08:25.500
-1
21,461
[ "c#", "asp.net", "http" ]
169,272
1
null
null
5
933
Today the blinkenlights [stereoscope](http://blinkenlights.net/stereoscope) project starts as part of the [nuit blanche](http://www.scotiabanknuitblanche.ca/) art event in Toronto. The Toronto city hall is transferred into a giant matrix display. There are [tools](http://blinkenlights.net/stereoscope/create) to create custom animations and an [iphone application](http://phobos.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=291807780&mt=8) to view the live stream. ![blinkenlights](https://static.flickr.com/3232/2909334414_331d1aff43.jpg) I think this is a great example of using technology for art and beauty. What other coding/programming projects are out there for the sake of art and beauty? Update: Youtube Video of blinkenlights in action: [http://www.youtube.com/watch?v=jTZosieGhIQ](http://www.youtube.com/watch?v=jTZosieGhIQ)
What coding projects are used to create art and beauty?
CC BY-SA 2.5
0
2008-10-03T23:15:46.810
2020-05-30T14:58:36.990
2017-02-08T14:08:26.173
-1
720
[ "matrix" ]
171,840
1
171,847
null
5
2,769
I'm running into an issue where I have a FileUpload control in an UpdatePanel. When I attempt to save changes and upload the file, no file is found. If I remove the UpdatePanel everything seems to work fine. Any ideas why this might be happening? And is there a work-around? ![Screenshot](https://farm4.static.flickr.com/3086/2914877750_0a68e10ffd.jpg?v=0)
Problem using the ASP.NET FileUpload control in an UpdatePanel?
CC BY-SA 2.5
0
2008-10-05T11:33:34.603
2008-10-05T11:46:21.147
2017-02-08T14:08:26.850
-1
1,768
[ "asp.net", "ajax", "file" ]
173,487
1
173,939
null
8
23,421
# 1st phase I have a problem shutting down my running JBoss instance under Eclipse since I changed the JNDI port of JBoss. Of course I can shut it down from the console view but not with the stop button (it still searches JNDI port at the default 1099 port). I'm looking forward to any solutions. Thank you! ## Used environment: - - Default ports: 1098, 1099 Changed ports: 11098, 11099 I changed the following part in jbosspath/server/default/conf/jboss-service.xml: ``` <!-- ==================================================================== --> <!-- JNDI --> <!-- ==================================================================== --> <mbean code="org.jboss.naming.NamingService" name="jboss:service=Naming" xmbean-dd="resource:xmdesc/NamingService-xmbean.xml"> <!-- The call by value mode. true if all lookups are unmarshalled using the caller's TCL, false if in VM lookups return the value by reference. --> <attribute name="CallByValue">false</attribute> <!-- The listening port for the bootstrap JNP service. Set this to -1 to run the NamingService without the JNP invoker listening port. --> <attribute name="Port">11099</attribute> <!-- The bootstrap JNP server bind address. This also sets the default RMI service bind address. Empty == all addresses --> <attribute name="BindAddress">${jboss.bind.address}</attribute> <!-- The port of the RMI naming service, 0 == anonymous --> <attribute name="RmiPort">11098</attribute> <!-- The RMI service bind address. Empty == all addresses --> <attribute name="RmiBindAddress">${jboss.bind.address}</attribute> <!-- The thread pool service used to control the bootstrap lookups --> <depends optional-attribute-name="LookupPool" proxy-type="attribute">jboss.system:service=ThreadPool</depends> </mbean> <mbean code="org.jboss.naming.JNDIView" name="jboss:service=JNDIView" xmbean-dd="resource:xmdesc/JNDIView-xmbean.xml"> </mbean> ``` ## Eclipse setup: ![](https://i.stack.imgur.com/nOlhy.png) I had a previous version, I got this problem, I read about some bugfix in JbossTools, so updated to 2.1.1.GA. Now the buttons changed, and I've got a new preferences view, but I cannot modify anything...seems to be abnormal as well: ![](https://i.stack.imgur.com/Ocfcf.png) ## Error dialog: ![](https://i.stack.imgur.com/uPPZ7.png) ## The stacktrace: ``` javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1385) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572) at javax.naming.InitialContext.lookup(InitialContext.java:347) at org.jboss.Shutdown.main(Shutdown.java:202) Caused by: javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:254) at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1370) ... 4 more Caused by: javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect] at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:228) ... 5 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.PlainSocketImpl.socketConnect(Native Method) at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:305) at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:171) at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:158) at java.net.Socket.connect(Socket.java:452) at java.net.Socket.connect(Socket.java:402) at java.net.Socket.<init>(Socket.java:309) at java.net.Socket.<init>(Socket.java:211) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69) at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62) at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:224) ... 5 more Exception in thread "main" ``` # 2nd phase: After creating a new Server in File/new/other/server, it did appear in the preferences tab. Now the stop button is working (the server receives the shutdown messages without any additional modification of the jndi port -- there is no opportunity for it now) but it still throws an error message, though different, it's without exception stack trace: "Server JBoss 4.0 Server failed to stop."
Problems with shutting down JBoss in Eclipse if I change JNDI port
CC BY-SA 4.0
0
2008-10-06T07:38:31.833
2019-01-22T08:23:25.050
2019-01-22T08:23:25.050
4,751,173
19,621
[ "java", "eclipse", "jboss", "jboss-tools" ]
175,036
1
null
null
4
33,498
i need to be able to produce a "pretty" printout of an individual list item's values, with the goals being: - - i'm avoiding using InfoPath at this time due to other issues (which i'll post separate questions for...) , i have an individual list item that normally displays similar to the following `DispForm.aspx` : ![SharePoint - DispForm.aspx](https://farm4.static.flickr.com/3025/2919055776_bec7d520c9_o_d.png) i need a printed version (`PrintForm.aspx`??) that will display similar to the following : ![SharePoint - PrintForm.aspx](https://farm4.static.flickr.com/3101/2918303785_ddfb28d32e_o_d.png) from what i can tell, i can't do this just by modifying/creating custom CSS. it also seems that i can't quite do this just by creating my own "print" version of `DispForm.aspx`. any suggestions, ideas, links would be very helpful.
How do I customize the print layout of a SharePoint list item?
CC BY-SA 2.5
0
2008-10-06T16:26:00.113
2011-08-16T20:36:08.557
2017-02-08T14:08:27.863
-1
12,293
[ "css", "sharepoint", "printing", "moss", "sharepoint-designer" ]
175,835
1
175,900
null
0
204
I'm trying add a tab to my web page that looks like this: ![alt text](https://i.stack.imgur.com/DT3e7.png) Using [this example](http://mattberseth.com/blog/2007/09/using_css_image_sprites_with_t.html) as a basis, I've gotten it partially working. My case differs because I want the text section to be a fixed with, but the tail section to dynamically resize to take up the rest of the tab's container. It looks good in IE 6, but doesn't really take up the full width of the container. In Firefox 3 it doesn't render well at all:![alt text](https://i.stack.imgur.com/Zeypv.png) (the red is a blank area between the spans). How do I get this to render properly in both IE6 and Firefox to take up the full width specified for #Tab? #Tab4 is the area I'd like to size to take up as much room as possible. ``` <style type="text/css"> #Tab { width: 300px; } #Tab1 { background: #000 url(BlueTabSprite.png) no-repeat 0 -136px; display: inline-block; height: 23px; padding-left: 4px; } #Tab2 { background: #000 url(BlueTabSprite.png) repeat-x 0 -242px; display: inline-block; overflow: hidden; padding-top: 4px; height: 19px; width: 100px; } #Tab3 { background: #000 url(BlueTabSprite.png) no-repeat right -30px; display: inline-block; height: 23px; padding-right: 6px; } #Tab4 { background: #000 url(BlueTabSprite.png) repeat-x 0 -83px; display: inline-block; height: 23px; width:60% } #Tab5 { background: #000 url(BlueTabSprite.png) no-repeat right -189px; display: inline-block; height: 23px; padding-right:6px; } </style> <div id="Tab"> <span id="Tab1"> <span id="Tab3"> <span id="Tab2">Test Tab</span> </span> </span> <span id="Tab5"> <span id="Tab4"></span> </span> </div> ```
Dynamically sizing tab made of images
CC BY-SA 4.0
null
2008-10-06T19:35:58.483
2019-01-22T08:23:30.870
2019-01-22T08:23:30.870
4,751,173
12,601
[ "css", "firefox", "internet-explorer-6", "css-sprites" ]
176,572
1
176,648
null
52
43,814
I have a UI widget that needs to be put in an IFRAME both for performance reasons and so we can syndicate it out to affiliate sites easily. The UI for the widget includes tool-tips that display over the top of other page content. See screenshot below or [go to the site](http://www.bookabach.co.nz/) to see it in action. Is there any way to make content from within the IFRAME overlap the parent frame's content? ![Tool-tip content needs to overlap parent frame content](https://i.stack.imgur.com/8rAnj.png)
Is there a way to have content from an IFRAME overflow onto the parent frame?
CC BY-SA 4.0
0
2008-10-06T23:07:54.437
2021-02-03T15:04:20.017
2019-01-23T20:28:42.000
4,751,173
11,577
[ "javascript", "css", "iframe", "tooltip" ]
177,271
1
177,278
null
38
58,039
Can anyone provide some pseudo code for a roulette selection function? How would I implement this: ![alt text](https://upload.wikimedia.org/math/0/d/2/0d24a82d8e813380f670bf80ae74486b.png) I don't really understand how to read this math notation. I never took any probability or statistics.
Roulette Selection in Genetic Algorithms
CC BY-SA 2.5
0
2008-10-07T04:56:18.493
2020-05-22T12:43:45.307
2017-02-08T14:08:31.753
-1
577
[ "genetic-algorithm", "evolutionary-algorithm", "roulette-wheel-selection" ]
178,578
1
178,595
null
9
46,496
I'm using Webbrowser control to login to HTTPS site with "untrusted certificate". but I get popup such standart window "Security Alert" about untrusted certificate: ![Security Alert window](https://i.stack.imgur.com/U01dp.jpg) I have to find this window by title and send it + to press : ``` int iHandle = NativeWin32.FindWindow(null, "Security Alert"); NativeWin32.SetForegroundWindow(iHandle); System.Windows.Forms.SendKeys.Send("Y%"); ``` but user can see a flickering of this window. How can I ignore this alert? Or disable this "untrusted certificate" check in Webbrowser control?
How to disable "Security Alert" window in Webbrowser control
CC BY-SA 3.0
0
2008-10-07T13:58:33.110
2016-02-12T12:45:36.750
2011-12-26T13:40:28.840
95
25,826
[ "c#", "https", "browser", "certificate" ]
178,696
1
178,727
null
4
6,045
I've got the following JavaScript on my web page... ``` 64 var description = new Array(); 65 description[0] = "..." 66 description[1] = "..." ... 78 function init() { 79 document.getElementById('somedivid').innerHTML = description[0]; 80 } 81 82 window.onload = init(); ``` In Microsoft Internet Explorer it causes the following error... > A Runtime Error has occurred. Do you wish to debug?Line: 81 Error: Not implemented ![javascript runtime error](https://i.stack.imgur.com/n06sz.gif) Line 79 executes as expected. If line 79 is commented out, it still throws the error. If I comment out line 82, then the function does not execute and there is no error.
Why am I getting this Javascript runtime error?
CC BY-SA 3.0
0
2008-10-07T14:27:34.050
2015-06-19T19:59:37.650
2015-06-19T19:59:37.650
1,159,643
83
[ "javascript", "html", "internet-explorer" ]
183,101
1
184,315
null
2
6,061
I use the MFC list control in report view with grid lines to display data in a vaguely spreadsheet manner. Sometimes when the user scrolls vertically through the control, extra grid lines are drawn, which looks terrible. This does not happen when the slider or the mousewheel are used to scroll, only when the little down arrow button at the bottom of the scroll control is used. It seems that this occurs when the size of the list control window is not an exact even number of rows, so that a partial row is visible at the bottom. If I adjust the size of the list control so that there is no partial rows visible, the problem is solved. However, it will appear when the program is run on another computer, presumably because the number of pixels occupied by a row changes. I am assuming that it is an interaction between screen resolution, font size and "dialog units". I guess that I need to programmatically force the size of the control when it is created. But what size? I have tried using the ApproximateViewRect() method but I cannot get it to work. Perhaps this method does not know about report view? The other method, I suppose, would be to create my own specialization of CListCtrl and over-ride whatever method is doing the scrolling. This seems likely to be a lot of work. This screenshot shows a closely related problem where the grid lines go missing ![alt text](https://i.stack.imgur.com/K5XzV.jpg) and here is one with the extra grid lines ![alt text](https://i.stack.imgur.com/6pADr.jpg) The only difference between these two and between them and one which scrolls perfectly is a few pixels different in the vertical size of the control.
MFC List Control scrolling shows extra grid lines
CC BY-SA 4.0
null
2008-10-08T14:40:13.820
2019-01-25T07:57:16.010
2019-01-25T07:57:16.010
4,751,173
16,582
[ "mfc" ]
183,407
1
183,425
null
0
1,593
Code and preview: ![what i have](https://i.stack.imgur.com/3J6CX.gif) ``` <html> <head> <title>Testing some CSS</title> <style type="text/css"> .dDay { font-size:205% } .dMon { font-weight:bold; font-variant:small-caps; font-size:130%; margin-top:-.7em; } .detailContainer { vertical-align:middle; display:table-cell; padding:0em 0em 0em 1em; } #dContainer { border:1px solid green; display:table; height:3.25em; } </style> <body> <div id="dContainer"> <div class="dDay">31</div> <div class="dMon">sep</div> <div class="detailContainer">Test O.O</div> </div> </body> </html> ``` My question is: is it possible to place another date section next to the first one, so it appears like this: [what i want http://img505.imageshack.us/img505/2787/previewsp2.gif](http://img505.imageshack.us/img505/2787/previewsp2.gif) --- EDIT: strange, I tried floating before I asked the question and it didn't work...thanks everyone :D
How can I get a section of this div to sit next to each other?
CC BY-SA 4.0
null
2008-10-08T15:33:24.120
2019-01-25T07:57:12.827
2019-01-25T07:57:12.827
4,751,173
25,515
[ "css" ]
186,935
1
187,010
null
2
1,274
I'm writing server-side programs in PHP for an iPhone app. And I have no iPhone. :P The iPhone app requests XML files from the site whenever a user runs the iPhone app. You may visit [http://www.appvee.com/iphone/ads](http://www.appvee.com/iphone/ads) or [http://www.appvee.com/iphone/latest](http://www.appvee.com/iphone/latest) for the XML files. And a message box will show up with the following error messages: "Web Site Error Conversion of data failed. The file is not UTF-8, or in the encoding specified in XML header if XML. " ![alt text](https://farm4.static.flickr.com/3195/2925993535_bd62b7cf42.jpg?v=0) Maybe I must add header("Content-type: text/xml"); at the beginning of the PHP files? I didn't add this line and it worked well before. Any help is greatly appreciated.
iPhone "Web Site Error"
CC BY-SA 2.5
null
2008-10-09T12:00:41.553
2009-05-11T09:32:38.783
2017-02-08T14:08:35.240
-1
23,773
[ "iphone", "encoding", "utf-8" ]
187,908
1
null
null
1
6,342
I would like to create a many to many relationship of a table (RoutePlace) with itself using JPA anotations. The singularity of the table I want to join with itself is that it has a compound-key. example: [https://h4losw2.files.wordpress.com/2008/10/tables.png](https://h4losw2.files.wordpress.com/2008/10/tables.png) ![alt text](https://h4losw2.files.wordpress.com/2008/10/tables.png) Any suggestions? Thanks in advance
JPA - many to many relationship of a table with a compound-key with itself
CC BY-SA 2.5
null
2008-10-09T15:50:30.713
2011-08-21T16:47:25.580
2017-02-08T14:08:35.580
-1
null
[ "jpa", "many-to-many", "entity-relationship", "compound-key" ]
188,373
1
790,445
null
3
7,669
I'd like to re-brand (and send error emails) for all of the SSRS default error pages (picture below) when you access reports via /ReportServer/. I'm already handling the ASP OnError event and of the default SSRS errors appear to catch their own exceptions and then render this page cancel the response all before the OnError event is ever fired. Any idea on how I can get a handle into SSRS to brand all error pages? ![Reporting Services Error](https://www.jazz2online.com/junk/reporting_error.gif)
Custom error pages in Reporting Services 2008
CC BY-SA 2.5
0
2008-10-09T17:43:49.737
2011-07-20T16:25:45.320
2017-02-08T14:08:35.920
-1
15,050
[ "reporting-services", "error-handling" ]
190,493
1
194,646
null
14
16,305
I am trying to figure out how to add a custom control to the iPhone MoviePlayer. For an example of what I am trying to do see the following image. ![alt text](https://i.stack.imgur.com/Zt5MG.jpg) I am trying to add something like the controls on the right and left of the basic movie controls. I had done this in the Open SDK by adding a subclass to the playerview, but now in the official SDK and Apple moving to MPMoviePlayerController I am not sure how to do it. Also with my old 1.x firmware way it required me to capture touch events and hide/show the control myself. I am hoping there is a way that would do this with the standard controls, but if not, that is fine. Thanks in advance.
Add Custom Controls to MoviePlayer
CC BY-SA 4.0
0
2008-10-10T08:14:09.980
2019-01-31T07:43:11.650
2019-01-31T07:43:11.650
4,751,173
26,728
[ "iphone", "objective-c", "cocoa-touch" ]
190,625
1
190,665
null
1
15,559
I have created the following stored procedure.. ``` CREATE PROCEDURE [dbo].[UDSPRBHPRIMBUSTYPESTARTUP] ( @CODE CHAR(5) , @DESC VARCHAR(255) OUTPUT ) AS DECLARE @SERVERNAME nvarchar(30) DECLARE @DBASE nvarchar(30) DECLARE @SQL nvarchar(2000) SET @SERVERNAME = Convert(nvarchar, (SELECT spData FROM dbSpecificData WHERE spLookup = 'CMSSERVER')) SET @DBASE = Convert(nvarchar, (SELECT spData FROM dbSpecificData WHERE spLookup = 'CMSDBNAME')) SET @SQL = 'SELECT clnt_cat_desc FROM ' + @SERVERNAME + '.' + @DBASE + '.dbo.hbl_clnt_cat WHERE inactive = ''N'' AND clnt_cat_code = ''' + @CODE + '''' EXECUTE sp_executeSQL @SQL RETURN ``` This procedure is used in many different databases and many different servers and is written as dynamic SQL to simplify maintenance. The procedure also runs on a different server than the one the procedure points to. I want to use the output of this procedure as a value in a table... ``` DECLARE @clid BIGINT DECLARE @fileid BIGINT DECLARE @myCode CHAR(5) DECLARE @myDesc VARCHAR(255) DECLARE @@tempDesc VARCHAR(255) SET @clid = 1831400022 SET @fileid = 2072551358 SET @myCode = (SELECT _clientPrimBusinessType FROM udbhextclient WHERE clid = @clid) SET @myDesc = EXEC UDSPRBHPRIMBUSTYPESTARTUP @CODE = @myCode, @DESC = @@tempDesc OUTPUT ---------------------------------------------------------------------------- SELECT a.clid , b.fileid , c.usrfullname AS ClientPartner , e.usrfullname AS ClientFeeEarner , @myDesc AS ClientPrimaryBusinessType FROM dbclient a INNER JOIN dbFile b ON a.clid = b.clid INNER JOIN dbuser c ON a.feeusrid = c.usrid INNER JOIN udbhextclient d ON a.clid = d.clid INNER JOIN dbuser e ON d._ClientFeeEarner = e.usrid WHERE a.clid = @clid AND b.fileid = @fileid ``` I know this is the incorrect syntax, but you can see what I am trying to achieve this without resorting to temporary tables as this would mean maintenance across 30 different servers with 3 to 5 databases on each. Smink - Tried your solution and got the following results... ![Running Smink's Solution](https://farm4.static.flickr.com/3029/2928268613_dd3c454f92.jpg)
Initialise A Variable With The Output Of A Stored Procedure In MS SQL Server
CC BY-SA 3.0
null
2008-10-10T09:20:11.267
2013-09-12T13:49:11.803
2017-02-08T14:08:36.600
-1
978
[ "sql-server", "sql-server-2005", "tsql", "stored-procedures" ]
190,867
1
191,398
null
1
1,460
Is it possible to have multiple view of the same display object? (e.g. same-computer multi-player game using split screen) The sample code that failed to work follows: ``` var content: Sprite = new Sprite(); var v1: Sprite = new Sprite(); var v2: Sprite = new Sprite(); with(content.graphics) { lineStyle(2, 0xff0000); drawCircle(100, 100, 80); lineStyle(5, 0x009999); drawRect(50, 80, 200, 30); } v1.addChild(content); v1.x = 0; v1.y = 0; v1.scrollRect = new Rectangle(0, 0, 100, 100); addChild(v1); v2.addChild(content); v2.x = 100; v2.y = 0; v2.scrollRect = new Rectangle(0, 0, 100, 100); addChild(v2); ``` I thought this would make two viewports (`v1` and `v2`) of the same object (`content`). But when I checked the docs, DisplayObjectContaner/addChild method, it says, "If you add a child object that already has a different display object container as a parent, the object is removed from the child list of the other display object container." Is there a solution for this? --- Obtained result ![Obtained result](https://i.stack.imgur.com/aWKOO.png) Expected result (simulated) [Expected result (simulated) http://img337.imageshack.us/img337/7914/222mq4.png](http://img337.imageshack.us/img337/7914/222mq4.png) --- Rendering to a bitmap as suggested by Antti is a great idea, but the rendered sprites will not be able to catch mouse events. Is there a way to redirect the mouse clicks on the bitmap to trigger clicks on the original sprites?
Multiple viewports of the same DisplayObject
CC BY-SA 4.0
0
2008-10-10T11:12:39.107
2019-01-31T07:43:17.797
2019-01-31T07:43:17.797
4,751,173
11,238
[ "flash", "actionscript-3", "viewport", "displayobject", "scrollrect" ]
191,812
1
193,144
null
9
2,887
How can I create a custom property for my .Net assembly which would then be visible under the Details tab in Windows explorer? Something to sit parallel with "File Description", "Type", "Product Version"... etc Update: To quote my comment to Lars ... "Whilst I would have liked to do this from within Visual studio, that is certainly not my priority. Actually I hope to integrate any solution into an existing nant build process. So affecting the assemblies post compile is entirely acceptable. Have you ever heard of such a tool?" Further Update: I'm not sure if what I'm talking about is an attribute or not, to clarify a little what I would like to creat in an entry in the following property page... ![alt text](https://i.stack.imgur.com/GgG90.png)
How can I create a custom Property for my assembly?
CC BY-SA 4.0
0
2008-10-10T15:16:30.130
2019-02-01T21:31:07.773
2019-02-01T21:31:07.773
4,751,173
11,356
[ ".net", "assemblies", "attributes" ]
192,938
1
192,955
null
1
2,790
When in Outlook 2003, open the Address Book, select Tools->Options. You get the address dialog showing the option "When sending mail, check names using these address lists in the following order:" ![Address dialog](https://i.stack.imgur.com/wa79y.jpg) For most people, this will contain only "Contacts". For corporate networks, it'll probably also contain "Global Address List". The problem is that in my company the GAL is many tens of thousands large, and it's common that conflicts occur in name resolution when attempting to send email and it goes to the wrong person in another country. Instead, I would like to place a separate Exchange address list "X" at the top of that list, to first resolve against names in our own company before checking the GAL. Then, resolve against "Contacts", then GAL. This configuration would need to be deployed to many hundreds of PCs. I've been able to do this on my own PC by hacking registry key: `HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\your_profile_name\9207f3e0a3b11019908b08002b2a56c2`, Value `11023d05`. This contains a REG_BINARY data structure that lists the IDs of the items of this list. I can reorder them to my liking and Outlook accepts it. The IDs of the GAL and "X" address list are static. However, the problem is that the "Contacts" ID is apparently not static, perhaps unique to the user and/or computer. Its value appears to be undiscoverable in the registry. This prevents me from simply copying this registry value to all PCs. Has anyone been able to progammatically reorder the contact name resolution list?
How to programmatically update the Outlook contact name resolution order
CC BY-SA 3.0
0
2008-10-10T20:35:07.867
2022-04-28T00:29:23.857
2013-07-19T14:36:37.900
null
3,347
[ "outlook", "registry", "exchange-server" ]
195,270
1
196,523
null
87
134,782
Are there any Combobox controls (dropdown list with autosuggestion) based on the jQuery library? It should be able to handle and have some options. A would be great too. I'm working with ASP.NET, but it's a not a problem if I had to write a wrapper for it. ![alt text](https://i.stack.imgur.com/ilhvD.png)
Professional jQuery based Combobox control?
CC BY-SA 3.0
0
2008-10-12T09:18:53.423
2015-08-28T15:02:48.153
2015-08-28T15:02:48.153
3,204,551
6,461
[ "javascript", "jquery", "combobox", "controls" ]