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
196,606
1
null
null
27
6,915
So I'm trying to figure out how the Form's AutoScaleMode property can possibly help to support a system with a font or [DPI](http://en.wikipedia.org/wiki/Dots_per_inch) that is different from my work development machine. From the SDK: > AutoScaleMode Enumerationpublic enum AutoScaleMode By default .NET 2.0 Forms use AutoScaleMode.Font. So I designed a sample form on my Windows XP, Tahoma 8 pt, 96 DPI development machine. Then I tried it out on a - - The results were not encouraging, as you can see in this screenshot: ![](https://uiguidelines.files.wordpress.com/2008/10/comparison-of-form-autoscalemodes-matrix.png) The AutoScaleMode property was not designed to enable a .NET Form for support of different font or DPI settings. So what the proper way to support different font and DPI settings?
Supporting DPI and Default Font Changes
CC BY-SA 3.0
0
2008-10-13T03:02:13.497
2012-10-19T23:06:38.430
2017-02-08T14:08:37.273
-1
12,597
[ ".net", "winforms", "dpi", "highdpi" ]
196,608
1
215,595
null
7
951
There are lots of non-image-based CAPTCHA ideas floating around. But what about the old-fashioned way? What are the elements of a good image CAPTCHA? What visual elements are hard for computers, but easier for humans? What about mistakes, elements that are easier for computers than they are for humans? What are good techniques for increasing the of a CAPTCHA generator? Here's an example of a CAPCHA I've been working on. It generates the functions for two sine waves, then stretches a text between them. It lays that over a background drawn from a pool of images. ![Image-based CAPTCHA](https://farm4.static.flickr.com/3178/2936174357_fc9e92b881_m.jpg?iwonderwhollnoticethis) How could this be improved? (Specifically, I'm using PHP GD.) Things that come to mind are: - - - --- Edit: I know that there are some very worthy third-party CAPTCHA resources. I'm looking for attributes that them good. I'd like to use my own CAPTCHAs, just for the purpose of self-improvement. So, you can talk about reCAPTCHA, but it's not exactly what I'm looking for. Also, it has been brought up that not only the image, but also the matters, so feel free to comment on that.
Harder, Better, Faster, Stronger... Techniques for an image-based CAPTCHA?
CC BY-SA 2.5
0
2008-10-13T03:05:32.820
2019-02-19T18:33:14.897
2017-02-08T14:08:37.607
-1
1,615
[ "captcha", "spam-prevention" ]
197,407
1
200,913
null
3
27,126
I need to define a calculated member in MDX (this is SAS OLAP, but I'd appreciate answers from people who work with different OLAP implementations anyway). The new measure's value should be calculated from an existing measure by applying an additional filter condition. I suppose it will be clearer with an example: - - - The problem is that I don't know MDX and I'm on a very tight schedule (so sorry for a newbie question). The best I could come up with is: ``` ([Measures].[Total traffic], [Direction].[(All)].[In]) ``` Which almost works, except for cells with specific direction: ![example](https://i.stack.imgur.com/z3BxZ.png) So it looks like the "intrinsic" filter on Direction is overridden with my own filter). I need an intersection of the "intrinsic" filter and my own. My gut feeling was that it has to do with Intersecting `[Direction].[(All)].[In]` with the intrinsic coords of the cell being evaluated, but it's hard to know what I need without first reading up on the subject :) I ended up with ``` IIF([Direction].currentMember = [Direction].[(All)].[Out], 0, ([Measures].[Total traffic], [Direction].[(All)].[In]) ) ``` ..but at least in SAS OLAP this causes extra queries to be performed (to calculate the value for [in]) to the underlying data set, so I didn't use it in the end.
Define a calculated member in MDX by filtering a measure's value
CC BY-SA 4.0
null
2008-10-13T12:30:32.757
2020-04-20T16:20:40.447
2020-04-20T16:20:40.447
1,026
1,026
[ "sas", "olap", "mdx" ]
198,580
1
201,812
null
34
81,189
What are optimal settings for Recycling of Application Pools in IIS7 in a shared environment? ![enter image description here](https://i.stack.imgur.com/RNQo8.png)
What are optimal settings for Recycling of Application Pools in IIS7 in shared environment?
CC BY-SA 3.0
0
2008-10-13T18:41:04.850
2015-08-03T20:36:20.903
2013-04-22T15:01:51.787
23,199
23,280
[ "iis-7", "application-pool", "recycle" ]
199,158
1
199,232
null
0
286
I have a table that stores all the volunteers, and each volunteer will be assigned to an appropriate venue to work the event. There is a table that stores all the venues. It stores the volunteer's appropriate venue assignment into the column `venue_id`. ``` table: venues columns: id, venue_name table: volunteers_2009 columns: id, lname, fname, etc.., venue_id ``` Here is the function to display the list of volunteers, and the problem I am having is to display their venue assignment. I have never worked much with MySQL joins, because this is the first time I have joined two tables together to grab the appropriate info I need. So I want it to go to the volunteers_2009 table, grab the venue_id, go to the venues table, match up `volunteers_2009.venue_id to venues.id`, to display `venues.venue_name`, so in the list it will display the volunteer's venue assignment. ![alt text](https://i.stack.imgur.com/83QdA.jpg) ``` <?php // ----------------------------------------------------- //it displays appropriate columns based on what table you are viewing function displayTable($table, $order, $sort) { $query = "select * from $table ORDER by $order $sort"; $result = mysql_query($query); // volunteer's venue query $query_venues = "SELECT volunteers_2009.venue_id, venues.venue_name FROM volunteers_2009 JOIN venues ON volunteers_2009.venue_id = venues.id"; $result_venues = mysql_query($query_venues); if($_POST) { ?> <table id="box-table-a"> <tr> <th>Name</th> <?php if($table == 'maillist') { ?> <th>Email</th> <?php } ?> <?php if($table == 'volunteers_2008' || $table == 'volunteers_2009') { ?> <th>Comments</th> <?php } ?> <?php if($table == 'volunteers_2009') { ?> <th>Interests</th> <th>Venue</th> <?php } ?> <th>Edit</th> </tr> <tr> <?php while($row = mysql_fetch_array($result)) { $i = 0; while($i <=0) { print '<td>'.$row['fname'].' '.$row['lname'].'</td>'; if($table == 'maillist') { print '<td><a href="mailto:'.strtolower($row['email']).'">'.strtolower($row['email']).'</a></td>'; } if($table == 'volunteers_2008' || $table == 'volunteers_2009') { print '<td><small>'.substr($row['comments'], 0, 32).'</small></td>'; } if($table == 'volunteers_2009') { print '<td><small>1) '.$row['choice1'].'<br>2) '.$row['choice2'].'<br>3) '.$row['choice3'].'</small></td>'; ?> <td> <?php if($row_venues['venue_name'] != '') { // print venue assigned print $row_venues['venue_id'].' '.$row_venues['venue_name'].' '; } else { print 'No Venue Assigned'; } ?> </td> <?php } ?> <td><a href="?mode=upd&id=<?= $row[id] ?>&table=<?= $table ?>">Upd</a> / <a href="?mode=del&id=<?= $row[id] ?>&table=<?= $table ?>" onclick="return confirm('Are you sure you want to delete?')">Del</a></td> <?php $i++; } print '</tr>'; } print '</table>'; } } // ----------------------------------------------------- ?> ```
Join query and what do I do with it to display data correctly?
CC BY-SA 4.0
null
2008-10-13T21:56:02.180
2019-02-03T10:25:18.333
2019-02-03T10:25:18.333
4,751,173
26,130
[ "php", "mysql" ]
199,986
1
200,015
null
1
1,387
I know it's possible to change some columns in GridView controls to check boxes and when you are editing certain rows, the cells being hi-lited become text boxes, but supposed I want to add other controls in my gridView. For example: in the image below how would I change the entries of CategoryName to be a dropDown box of possible choices? ![](https://i.stack.imgur.com/bFVWI.jpg) [[Full size]](http://www.codersource.net/images/Gridview_depth_Image2.jpg)
How to add different controls in Gridview?
CC BY-SA 4.0
null
2008-10-14T04:02:44.543
2019-02-03T10:25:30.450
2019-02-03T10:25:30.450
4,751,173
750
[ "asp.net", "gridview" ]
200,786
1
203,947
null
1
2,696
I have a problem with a memory leak in a .NET CF application. Using [RPM](http://blogs.msdn.com/stevenpr/archive/2006/04/17/577636.aspx) I identified that dynamically creating controls are not garbage collected as expected. Running the same piece of code in .NET Window Forms behave differently and disposes the control as I expected. See the output from RPM via PerfMon for the counter: ![alt text](https://i462.photobucket.com/albums/qq346/pfourie/ScreenShot191.jpg) GC Heap: ![alt text](https://i462.photobucket.com/albums/qq346/pfourie/ScreenShot190a.jpg) My best guess is that the Weak Reference to the Panel is for some unknown reason not making the object eligible for GC, can it be? Even though solves the problem for the sample, I can't easily incorporate it into the existing application as it is not as clear cut to determine when the object is no longer in use. I have included a simplified version of the source to illustrate the problem: ``` using System; using System.Windows.Forms; namespace CFMemTest { public partial class Form1 : Form { public Form1() { InitializeComponent(); } // Calling this event handler multiple times causes the memory leak private void Button1_Click(object sender, EventArgs e) { Panel uc = new Panel(); // Calling uc.Dispose() cleans up the object } } } ``` 1. Calling GC.Collect() also doesn't result in the panels being cleaned up. 2. Using .NET CF 2.0 SP1 on a Windows CE 4.2 device.
Memory leak in .NETCF - creating dynamic controls?
CC BY-SA 2.5
null
2008-10-14T11:30:28.540
2009-01-07T20:59:32.813
2017-02-08T14:08:39.630
-1
11,123
[ ".net", "compact-framework", "memory-leaks", "garbage-collection", "profiling" ]
202,002
1
202,880
null
3
2,564
I need to open a Microsoft Word 2003 file and change its file properties. Such as changing the Subject in the Summary Tab. ![alt text](https://i.stack.imgur.com/FEpJY.gif)
How do I open a file in C# and change its properties?
CC BY-SA 4.0
0
2008-10-14T17:04:10.067
2019-02-05T12:19:29.687
2019-02-05T12:19:29.687
4,751,173
5,653
[ "c#", "ms-word" ]
202,706
1
203,012
null
2
1,503
Now, I know this is completely subjective, so please don't flame me. I've never been entirely satisfied with linux whenever I decided to install a distro like Ubuntu, Fedora etc. because of their awkward positioning and spacing of widgets. Have a look at [this](http://art.gnome.org/themes/gtk2/?sort_by=popularity&limit=12&view=list&order=DESC): ![alt text](https://i.stack.imgur.com/HT5d9.png) ![alt text](https://i.stack.imgur.com/NyCiJ.png) Notice the awkward spacing of the text field's text. I've seen many Gnome themes that look good on the surface but it all somehow breaks down, awkward spacings, strange borders. Etc. The entire linux desktop doesn't have the visual integrity of OSX for instance, and I wonder why. If there is any example of a nice integrated Linux environment, please please please show me, I really WANT to use Linux. (and I know, there's QT, and other managers like KDE etc. I noticed the same thing, so it probably isn't GTK or Gnome alone)
Is gtk+ responsible for the awkward look of most linux applications?
CC BY-SA 4.0
0
2008-10-14T20:40:50.240
2019-02-05T12:19:47.027
2019-02-05T12:19:47.027
4,751,173
13,466
[ "linux", "gtk", "gnome" ]
203,477
1
208,902
null
4
16,205
I'm using KML and the GGeoXml object to overlay some shapes on an embedded Google map. The placemarks in the KML file have some custom descriptive information that shows up in the balloons. ``` <Placemark> <name /> <description> <![CDATA[ <div class="MapPopup"> <h6>Concession</h6> <h4>~Name~</h4> <p>Description goes here</p> <a class="Button GoRight FloatRight" href="#"><span></span>View details</a> </div> ]]> </description> <styleUrl>#masterPolyStyle</styleUrl> ...Placemarks go here ... </Placemark> ``` So far so good - the popups show up and have the correct text in them. Here's the weird thing: I'm trying to use CSS to format what goes in the popups, and it halfway works. Specifically: - The `<h6>` and `<h4>` elements are rendered using the colors and background images I've specified in my stylesheet.- Everything shows up in Arial, not in the font I've specified in my CSS.- The class names seem to be ignored (e.g. none of the `a.Button` formatting is applied; if I define a style like the one below, it's ignored.)``` div.MapPopup { background:pink; } ``` Any ideas? I wouldn't have been surprised for the CSS not to work at all, but it's weird that it only partly works. ### Update Here's a screenshot to better illustrate this. I've reproduced the `<div class="MapPopup">` markup further down on the page (in yellow), to show how it should be rendered according to my CSS. ![alt text](https://farm4.static.flickr.com/3072/2942636927_2f8119a72a.jpg?v=0)
How does CSS formatting in a Google Maps bubble work?
CC BY-SA 2.5
0
2008-10-15T01:55:36.580
2011-08-04T22:10:24.437
2020-06-20T09:12:55.060
-1
239,663
[ "css", "google-maps", "kml" ]
205,244
1
205,332
null
5
26,856
I've created a web application that I've hosted with IIS 7 on a Windows Server 2008 machine. I've loaded a security certificate for secure.xxxxx.com. [IIS 7 Server Certificates http://img401.imageshack.us/img401/324/certxx6.gif](http://img401.imageshack.us/img401/324/certxx6.gif) When I browse to the web site with , I get this prompt: > Choose a digital certificate Identification The website you want to view requests identification. Please choose a certificate. There are no certificates. It's an empty, blank list. ![Internet Explorer Choose a digital certificate](https://i.stack.imgur.com/LVig2.gif) If I click either OK or Cancel, then the page loads just fine. There's no warning or other indication from Internet Explorer that there is a security issue. [Microsoft Internet Explorer SSL Security Certificate Website Identification http://img207.imageshack.us/img207/8265/ie2yr5.gif](http://img207.imageshack.us/img207/8265/ie2yr5.gif) The browser won't display the page at all. > Safari can't open the page. Safari can't open the page xxxxx because it couldn't establish a secure connection to the server xxxxx. [Apple Safari can't open the page http://img80.imageshack.us/img80/2899/safka3.gif](http://img80.imageshack.us/img80/2899/safka3.gif) Both and load the web site perfectly with no hassles. [Mozilla Firefox SSL Security Certificate http://img158.imageshack.us/img158/6833/foxsk4.gif](http://img158.imageshack.us/img158/6833/foxsk4.gif) [Google Chrome SSL Security Certificate http://img367.imageshack.us/img367/7928/chrsx2.gif](http://img367.imageshack.us/img367/7928/chrsx2.gif) Why might Microsoft Internet Explorer and Apple Safari fail to load my web site properly?
IE: Choose a digital certificate from a blank, empty list
CC BY-SA 4.0
0
2008-10-15T15:44:36.703
2019-02-07T17:43:17.243
2019-02-07T17:43:17.243
4,751,173
83
[ "internet-explorer", "iis", "ssl", "safari", "certificate" ]
206,070
1
207,607
null
10
14,045
I'm trying to be a good developer and create some documentation before I start programming my next project. I have created a database schema diagram in Visio and created relationships between columns. However, I am looking for a way to make the relationships between columns more clear. I want the arrow to connect column to column. Is there a way to do this in Visio? ![http://i.stack.imgur.com/sj0Bo.jpg](https://i.stack.imgur.com/sj0Bo.jpg)
Visio database diagrams, associating columns
CC BY-SA 3.0
0
2008-10-15T19:27:44.287
2015-08-24T16:53:48.213
2015-08-24T16:53:48.213
4,374,739
28,351
[ "database", "diagram", "visio" ]
209,657
1
209,684
null
3
6,217
I have a footer that is a 1 x 70px, which is set as the background and tiles horizonally. In cases when the web page does not contain a lot of content on it, it will display the footer above where the footer should be. I want it to fill in with a solid color, so if they scroll down, it won't show the footer, then the white under the footer. Here is the style I have for the footer. ``` .footer{ background:#055830 url('/images/footer_tile.gif') repeat-x top left; color:#fff; font-size:12px; height: 70px; margin-top: 10px; font-family: Arial, Verdana, sans-serif; width:100%; } ``` ![alt text](https://i.stack.imgur.com/pUzIQ.jpg) I want the footer to look like this: ![alt text](https://i.stack.imgur.com/s96Ft.jpg)
How do I make the footer stretch vertically?
CC BY-SA 4.0
0
2008-10-16T18:11:40.010
2019-02-09T10:45:19.423
2019-02-09T10:45:19.423
4,751,173
26,130
[ "html", "css", "footer" ]
210,905
1
450,411
null
0
493
I have a table (volunteers_2009) that has all the volunteers stored within, then I have a table (venues) that list all the different venues a volunteer could work (volunteers are assigned to one venue each, and that is stored within volunteers_2009.venue_id, which equals venues.id) The venues table also has a column for emails, each email is for the chairman of each venue. What I want to do is be able to automatically send each chairman an email with a CSV file of the volunteers table (volunteers_2009), and during that process, I want it to match up volunteers_2009.venue_id with venues.id and send the CSV with only the volunteers assigned to that chairman's venue, so the chairman only receives a CSV of the volunteers that were assigned to their venue. I would run thru the venues table, start at the beginning, match the venues.id to volunteers_2009.venue_id, then run the CSV export function to pull all the data WHERE venue_id = #, then attach it into the email and the recipient would be venues.chair_email. I already have a export CSV function, I could just pass it the venue_id to pull the appropriate volunteers, and I have a working email function as well, so I can pass it the attachment and recipient. Here is a sketch of the theory of the function of functions that would get this done: ![alt text](https://i.stack.imgur.com/Kn8fm.jpg) If you see a better way on how to go about this (if you can follow along with my poor hand writing), then please let me know, thanks.
How do I email CSV files to specific emails?
CC BY-SA 4.0
0
2008-10-17T02:10:16.470
2019-02-09T10:45:27.643
2019-02-09T10:45:27.643
4,751,173
26,130
[ "php", "mysql" ]
211,035
1
211,189
null
9
63,238
Today is officially my first day with C++ :P I've downloaded Visual C++ 2005 Express Edition and Microsoft Platform SDK for Windows Server 2003 SP1, because I want to get my hands on the open source [Enso Project](http://code.google.com/p/enso). So, after installing scons I went to the console and tried to compile it using scons, but I got this error: ``` C:\oreyes\apps\enso\enso-read-only\src\platform\win32\Include\WinSdk.h(64) : fatal error C1083: Cannot open include file: 'Windows.h': No such file or directory scons: *** [src\platform\win32\InputManager\AsyncEventProcessorRegistry.obj] Error 2 scons: building terminated because of errors. ``` After checking these links: [VS ans PSDK](http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1135164&SiteID=1) [Include tiffi.h](https://stackoverflow.com/questions/160938/fatal-error-c1083-cannot-open-include-file-tiffioh-no-such-file-or-directory-vc#160957) [Wndows.h](https://stackoverflow.com/questions/80788/fatal-error-c1083-cannot-open-include-file-windowsh-no-such-file-or-directory#81226) I've managed to configure my installation like this: ![alt text](https://i.stack.imgur.com/z41N8.png) And even run this script ![alt text](https://i.stack.imgur.com/1rB1L.png) And I managed to compile the file below in the IDE. ``` // Test.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <Windows.h> int _tmain(int argc, _TCHAR* argv[]) { return 0; } ``` But I still get that exception in the console. Does anyone have scons experience? Actually (and I forgot to tell you this) I started the command prompt with the link "Visual Studio 2005 Command Prompt". I assume this will include the paths in environment variables. Well after printing them I find that it didn't: ``` echo %INCLUDE% echo %LIB% echo %PATH% ``` And they were not present, so I created this .bat file: ``` set PATH=%PATH%;"C:\Program Files\Microsoft Platform SDK\Bin" set INCLUDE=%INCLUDE%;"C:\ Program Files\Microsoft Platform SDK\Include" set LIB=%LIB%;"C:\ Program Files\Microsoft Platform SDK\Lib" ``` Still, scons seeems not to take the vars... :(
fatal error C1083: Cannot open include file: 'Windows.h': and scons
CC BY-SA 4.0
null
2008-10-17T03:58:42.413
2019-02-10T22:38:56.613
2019-02-10T22:38:56.613
4,751,173
20,654
[ "visual-c++", "path", "environment", "scons", "include" ]
212,587
1
212,915
null
4
4,352
I’m having an issue where a drop down list in IE 6/7 is behaving as such: ![alt text](https://i488.photobucket.com/albums/rr249/djfloetic/ie7.jpg) You can see that the drop down `width` is not wide enough to display the whole text without expanding the overall drop down list. However in Firefox, there is no issue as it `expands the width` accordingly. This is the behaviour we want in IE 6/7: ![alt text](https://i488.photobucket.com/albums/rr249/djfloetic/firefox.jpg) We’ve looked at various ways to utilize the `onfocus, onblur, onchange, keyboard and mouse events` to attempt to solve the problem but still some issues. I was wondering if anyone has solved this issue in IE 6/7 without using any toolkits/frameworks (YUI, Ext-JS, jQuery, etc…).
Drop Down List Issue
CC BY-SA 4.0
0
2008-10-17T15:12:15.190
2019-10-18T05:35:14.557
2019-10-18T05:35:14.557
11,769,090
5,853
[ "javascript", "internet-explorer", "drop-down-menu", "cross-browser", "html-select" ]
213,002
1
305,766
null
3
36,575
I have some data grouped in a table by a certain criteria, and for each group it is computed an average —well, the real case is a bit more tricky— of the values from each of the detail rows that belong to that group. This average is shown in each group footer rows. Let's see this simple example: ![Report table](https://farm4.static.flickr.com/3008/2958165686_088405e1ef_o.jpg) What I want now is to show a grand total on the . The grand total should be computed by each group's average (for instance, in this example the grand total should be 20 + 15 = 35). However, I can't nest aggregate functions. How can I do?
Calculating grand totals from group totals in Reporting Services
CC BY-SA 3.0
0
2008-10-17T17:11:30.783
2021-08-18T16:16:32.107
2021-08-18T16:16:32.107
372,239
1,679
[ "reporting-services", "ssrs-grouping" ]
218,065
1
218,071
null
131
92,115
I have a div with `overflow:hidden`, inside which I show a phone number as the user types it. The text inside the div is aligned to right and incoming characters are added to right as the text grows to left. But once the text is big enough not to fit in the div, last characters of the number is automatically cropped and the user cannot see the new characters she types. What I want to do is crop the left characters, like the div is showing the rightmost of its content and overflowing to the left side. How can I create this effect? ![overflowing phone number to left](https://i.imgur.com/CRbCCPm.jpg)
Overflow to left instead of right
CC BY-SA 3.0
0
2008-10-20T11:09:17.253
2021-09-01T09:02:11.060
2015-02-13T23:43:13.933
1,266,650
31,505
[ "css", "html", "overflow" ]
218,337
1
218,606
null
-1
1,469
i'm fairly new to NHibernate and although I'm finding tons of infos on NHibernate mapping on the web, I am too silly to find this piece of information. So the problem is, i've got the following Model: ![Datamodel](https://i.stack.imgur.com/DihaU.jpg) this is how I'd like it to look. One clean person that has two Address Properties. In the database I'd like to persist this in one table. So the Person row would have a ShippingStreetname and a Streetname Column, the one mapped to ShippingAddress.Streetname and the other to Address.StreetName I found an [article on fluent interfaces](http://nhforge.org/blogs/nhibernate/archive/2008/09/06/a-fluent-interface-to-nhibernate-part-2-value-objects.aspx), but still haven't figured out how to do this through the XML Configuration. Thanks in advance! Update: I found the solution to this by myself. This can be done through the node and works rather straightforward. To achieve the mapping of Address and ShippingAddress I just had to add the following to the ``` <component name="Address" class="Address"> <property name="Streetname"></property> <property name="Zip"></property> <property name="City"></property> <property name="Country"></property> </component> <component name="ShippingAddress" class="Address"> <property name="Streetname" column="ShippingStreetname" /> <property name="Zip" column="ShippingZip" /> <property name="City" column="ShippingCity" /> <property name="Country" column="ShippingCountry" /> </component> ```
Mapping multiple Values to a Value Object in NHibernate
CC BY-SA 4.0
null
2008-10-20T13:00:06.297
2019-02-10T22:40:09.313
2019-02-10T22:40:09.313
4,751,173
21,699
[ "nhibernate", "orm", "mapping" ]
222,716
1
488,178
null
12
8,256
I am interested in writing a simplistic navigation application as a pet project. After searching around for free map-data I have settled on the [US Census Bureau TIGER](http://www.census.gov/geo/www/tiger/tgrshp2007/tgrshp2007.html) 2007 Line/Shapefile map data. The data is split up into zip files for individual counties and I've downloaded a single counties map-data for my area. How should I: - - - Ideally I'd like to be able to read in a counties map data shapefile and render all the poly-lines onto the screen and allow rotating and scaling. How should I: - - - Ex. of TIGER data rendered as a display map: ![alt text](https://i.stack.imgur.com/mNJ9X.png) Anyone with some experience and insight into what the best way for me to read in these files, how I should represent them (database, in memory datastructure) in my program, and how I should render (with rotating/scaling) the map-data on screen would be appreciated. EDIT: To clarify, I do not want to use any Google or Yahoo maps API. Similarly, I don't want to use OpenStreetMap. I'm looking for a more from-scratch approach than utilizing those apis/programs. This will be a application.
What is the best way to read, represent and render map data?
CC BY-SA 4.0
0
2008-10-21T17:22:45.253
2019-02-12T08:25:29.457
2019-02-12T08:25:29.457
4,751,173
2,635
[ "java", ".net", "graphics", "rendering", "maps" ]
224,352
1
224,461
null
5
763
Hopefully a picture is worth a thousand lines of code because I don't want to have to strip down all of the ASP.Net code, HTML, JavaScript, and CSS to provide an example (but I'll supply what I can upon request if someone doesn't say "Oh, I've seen that before! Try this...") [Actually, I did post some code and CSS - see bottom of question]. Here is a portion of a form page being displayed in Firefox: ![alt text](https://farm4.static.flickr.com/3191/2963487384_2c996e0bb6_o.png) The blue boxes are temporary stylings of a `<label>` tag and the orange lines are temporary border styles of the `<div>` tags (so I can see where they extend and break). The `<label>`'s are styled to `float: left` as are the `<div`'s on the right. In addition, the descendant controls of the `<div>` are also `float:left` purely so they will line up on the top of the `<div>` (since there are some taller controls like multiline textboxes down below). The radio buttons are generated by an ASP control, so they are wrapped in a `<span>` - also floated left since it is a descendant of the `<div>`. Here is the same portion of the screen rendered in IE7: ![alt text](https://farm4.static.flickr.com/3272/2963487410_d76e422e78_o.jpg) There are a few minor rendering differences, but the big one that's driving me crazy is the extra white space beside the `<input>` controls! Note that the `<span>`'s around the radio buttons and checkboxes line up correctly. Although they aren't shown, the same thing happens with drop-down lists and list boxes. I haven't tried wrapping the input controls in a `<span>`, but that might work. It's an ugly hack, though. I've tried several of the IE7 workarounds for box issues and I've edited the CSS until I'm in pure voodoo mode (i.e., making random changes hoping something works). Like I said, I hope someone will look at this and say, "I've seen that before! Try this..." Anyone? I'm using the XHTML 1.0 Transitional `<DOCTYPE>`, so I should be in standards mode. Here is a small snippet of the generated code for the above (the first control and the last control). Note that this code was generated by ASP.Net and then dynamically edited by JavaScript/jQuery. ``` <fieldset id="RequestInformation"> <legend>Request Information</legend> <ol> <li> <label id="ctl00_ContentPlaceHolder1_txtRequestDate_L" class="stdLabel" for="ctl00_ContentPlaceHolder1_txtRequestDate">Request Date:</label> <div class="FormGroup"> <input id="ctl00_ContentPlaceHolder1_txtRequestDate" class="RSV DateTextBox hasDatepicker" type="text" value="10/05/2004" name="ctl00$ContentPlaceHolder1$txtRequestDate"/> <img class="ui-datepicker-trigger" src="/PROJECT/images/Calendar_scheduleHS.png" alt="..." title="..."/> <span id="txtRequestDate_error"/> </div> </li> --STUFF DELETED HERE-- <li> <label id="ctl00_ContentPlaceHolder1_chkAppealed_L" class="stdLabel" for="ctl00_ContentPlaceHolder1_chkAppealed"> Request Appealed?</label> <div class="FormGroup"> <span class="stdCheckBox"> <input id="ctl00_ContentPlaceHolder1_chkAppealed" type="checkbox" name="ctl00$ContentPlaceHolder1$chkAppealed"/> </span> </div> </li> </ol> </fieldset> ``` Here is the relevant portion of the CSS (I double checked to make sure this duplicates the problem): ``` div { border-style: solid; border-width: thin; border-color:Orange; } label { border-style: solid; border-width: thin; border-color:Blue; } .FormGroup { float:left; margin-left: 1em; clear: right; width: 75em; } .FormGroup > * { float:left; background-color: Yellow; } fieldset ol { list-style: none; } fieldset li { padding-bottom: 0.5em; } li > label:first-child { display: block; float: left; width: 10em; clear: left; margin-bottom: 0.5em; } em { color: Red; font-weight: bold; } ``` # Solution! Matthew pointed me to this page on [IE/Win Inherited Margins on Form Elements](http://www.positioniseverything.net/explorer/inherited_margin.html) and that was the problem. The input boxes were inheriting the left margins of all of their containing elements. The solution I chose was to wrap each `<input>` element in an unstyled `<span>`. I've been trying to keep the structure of the HTML as semantically sound as possible, so I solved it using a jQuery command in the `$(document).ready()` function: ``` //IE Margin fix: // http://www.positioniseverything.net/explorer/inherited_margin.html jQuery.each(jQuery.browser, function(i) { if($.browser.msie){ $(":input").wrap("<span></span>"); } }); ``` Note that this will only add the stupid `<span>`'s on IE... StackOverflow to the rescue again!
Why does a floated <input> control in a floated element slide over too far to the right in IE7, but not in Firefox?
CC BY-SA 2.5
0
2008-10-22T03:06:44.793
2011-12-14T11:21:45.810
2017-02-08T14:08:44.367
-1
14,894
[ "asp.net", "html", "css", "webforms", "cross-browser" ]
225,309
1
229,392
null
5
8,948
Today i stumbled upon an interesting performance problem with a stored procedure running on Sql Server 2005 SP2 in a db running on compatible level of 80 (SQL2000). The proc runs about 8 Minutes and the execution plan shows the usage of an index with an actual row count of 1.339.241.423 which is about factor 1000 higher than the "real" actual rowcount of the table itself which is 1.144.640 as shown correctly by estimated row count. So the actual row count given by the query plan optimizer is definitly wrong! ![alt text](https://i.stack.imgur.com/kESKH.png) Interestingly enough, when i copy the procs parameter values inside the proc to local variables and than use the local variables in the actual query, everything works fine - the proc runs 18 seconds and the execution plan shows the right actual row count. As suggested by TrickyNixon, this seems to be a sign of the parameter sniffing problem. But actually, i get in both cases exact the same execution plan. Same indices are beeing used in the same order. The only difference i see is the way to high actual row count on the PK_ED_Transitions index when directly using the parametervalues. I have done dbcc dbreindex and UPDATE STATISTICS already without any success. dbcc show_statistics shows good data for the index, too. The proc is created WITH RECOMPILE so every time it runs a new execution plan is getting compiled. To be more specific - this one runs fast: ``` CREATE Proc [dbo].[myProc]( @Param datetime ) WITH RECOMPILE as set nocount on declare @local datetime set @local = @Param select some columns from table1 where column = @local group by some other columns ``` And this version runs terribly slow, but produces exactly the same execution plan (besides the too high actual row count on an used index): ``` CREATE Proc [dbo].[myProc]( @Param datetime ) WITH RECOMPILE as set nocount on select some columns from table1 where column = @Param group by some other columns ``` Any ideas? Anybody out there who knows where Sql Server gets the actual row count value from when calculating query plans? : I tried the query on another server woth copat mode set to 90 (Sql2005). Its the same behavior. I think i will open up an ms support call, because this looks to me like a bug.
SQL Server query execution plan shows wrong "actual row count" on an used index and performance is terrible slow
CC BY-SA 3.0
0
2008-10-22T11:18:51.633
2016-07-05T16:23:44.967
2016-07-05T16:23:44.967
426,671
25,727
[ "sql-server", "performance", "stored-procedures", "optimization", "sql-execution-plan" ]
226,784
1
226,795
null
151
187,163
I have downloaded Privoxy few weeks ago and for the fun I was curious to know how a simple version of it can be done. I understand that I need to configure the browser (client) to send request to the proxy. The proxy send the request to the web (let say it's a http proxy). The proxy will receive the answer... but how can the proxy send back the request to the browser (client)? I have search on the web for C# and http proxy but haven't found something that let me understand how it works behind the scene correctly. (I believe I do not want a reverse proxy but I am not sure). Does any of you have some explication or some information that will let me continue this small project? ## Update This is what I understand (see graphic below). I configure the client (browser) for all request to be send to 127.0.0.1 at the port the Proxy listen. This way, request will be not sent to the Internet directly but will be processed by the proxy. The proxy see a new connection, read the HTTP header and see the request he must executes. He executes the request. The proxy receive an answer from the request. Now he must send the answer from the web to the client but how??? ![alt text](https://i.stack.imgur.com/zNWDc.png) ### Useful link [Mentalis Proxy](http://www.mentalis.org/soft/projects/proxy/) : I have found this project that is a proxy (but more that I would like). I might check the source but I really wanted something basic to understand more the concept. [ASP Proxy](http://www.codeproject.com/KB/aspnet/asproxy.aspx) : I might be able to get some information over here too. [Request reflector](http://bartdesmet.net/blogs/bart/archive/2007/02/22/httplistener-for-dummies-a-simple-http-request-reflector.aspx) : This is a simple example. Here is a [Git Hub Repository with a Simple Http Proxy](https://github.com/MrDesjardins/SimpleHttpProxy).
How to create a simple proxy in C#?
CC BY-SA 4.0
0
2008-10-22T17:31:20.507
2019-09-26T15:27:52.760
2020-06-20T09:12:55.060
-1
13,913
[ "c#", ".net", ".net-2.0", "proxy" ]
230,226
1
230,254
null
7
1,451
I'm struggling with Visual Studio 2008. I've used some form of "Zen" colors for more than I can remember. In VS2008 I keep getting one color that I cannot read and I have been unable to identify it; the purpose of the question is to avoid trial an error (the VS color interface is really ugly with no "real time" apply button). If you look at the following picture, I'm debugging and the function on top has called the function below. The problem is that the calling line in upper function turns white (background) and is hard to read. The question is: Does anybody know what exact setting will allow me to change that? Thanks in advance. ![Sshot](https://i.stack.imgur.com/mb5Bi.jpg)
Colors in Visual Studio 2008
CC BY-SA 4.0
0
2008-10-23T15:38:01.703
2019-02-14T20:32:00.597
2019-02-14T20:32:00.597
4,751,173
2,684
[ "visual-studio-2008", "colors" ]
230,831
1
230,966
null
10
7,427
![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/a/a9/Unbalanced_binary_tree.svg/251px-Unbalanced_binary_tree.svg.png) The image above is from ["Wikipedia's entry on AVL trees"](http://en.wikipedia.org/wiki/AVL_tree) which Wikipedia indicates is unbalanced. How is this tree not balanced already? Here's a quote from the article: > The balance factor of a node is the height of its right subtree minus the height of its left subtree and a node with balance factor 1, 0, or -1 is considered balanced. A node with any other balance factor is considered unbalanced and requires rebalancing the tree. The balance factor is either stored directly at each node or computed from the heights of the subtrees. Both the left and right subtrees have a height of 4. The right subtree of the left tree has a height of 3 which is still only 1 less than 4. Can someone explain what I'm missing?
How is Wikipedia's example of an unbalanced AVL tree really unbalanced?
CC BY-SA 2.5
0
2008-10-23T18:20:08.973
2023-01-26T21:58:36.097
2017-02-08T14:08:45.733
-1
412
[ "data-structures", "binary-tree", "avl-tree" ]
232,563
1
null
null
1
1,373
The problem is fairly simple, but is best illustrated visually. Note that all screen shots are from the Visual Studio 2005 design surface. I've noticed no difference when I actually run the application. Here is my user control (let's call this UC-1): ![alt text](https://i.stack.imgur.com/0HwH2.png) The buttons on the control are set to anchor to Bottom + Right. Here is what it looks like when placed onto a particular parent user control (UC-A): ![alt text](https://i.stack.imgur.com/3uajb.png) Please disregard the difference in colors and such. Some styling is done in the user control's constructor. Notice the bottom of the control is getting clipped. The instance of the consumed control on the parent is set with a "FixedSingle" border. Notice also that the consumed control is taller than the original, indicating that the buttons bottom anchor settings are being respected, but are essentially overshooting where it should be. To confirm this is definitely a problem on the parent control, notice another user control (UC-2) containing a data grid view when placed on the same parent: ![alt text](https://i.stack.imgur.com/QgraT.png) Again, the instance of the consumed control is set with a "FixedSingle" border which helps illustrate the clipping. The datagrid is properly anchored to the Bottom Right. To reinforce the perplexity of this problem, here's the first user control (UC-1) when placed on a different parent user control (UC-B): [alt text http://i38.tinypic.com/2rnyjd0.png](http://i38.tinypic.com/2rnyjd0.png) Here's the second "consumed" control (UC-2) when consumed by a form: ![alt text](https://i.stack.imgur.com/KT1em.png) Notice, no clipping this time. I have spent many hours searching and experimenting to resolve this. I have exhausted the various settings of margins, padding, sizes (min/max), locations, anchors... etc. I can not for the life of me figure out why this one user control is causing child user controls to clip like this. Another strange thing I noticed was that when I do an UNDO on the parent user control design surface (where the controls are misbehaving), the clipped user control instances actually shift location even though the undo action is unrelated to those controls. For example, if I make the main containing control larger, then undo, a couple of the child user controls jump up. They appear to move about as far as they are being clipped. Very suspicious. Does anyone have any idea what is going on??
Winforms user control getting clipped when in another user control (sometimes)
CC BY-SA 4.0
0
2008-10-24T05:30:49.790
2019-02-14T20:40:18.720
2019-02-14T20:40:18.720
4,751,173
5,496
[ "winforms", "visual-studio-2005" ]
232,811
1
null
null
0
634
In my java application, I need to create a comment box for the users to add comments. Moreover, I need to provide the user with the provision for resizing and dragging the comment box. For this, I need to show a boundary around the comment box as in the case of comment box in Microsoft Excel which I have shown below: ![alt text](https://lh3.ggpht.com/subinvarghesein/SQGDAcBgHjI/AAAAAAAAAJc/YVGvsQltkyk/boundary.jpg) I dont need the circles shown on the boundary for resizing because I will be using a triangle kind of a thing on the bottom-right of the box. But I need the dotted area. How do I create it for my application in java? Any good thoughts? --- Currently I am in an analysis phase, just to find good options for this. What we have thought till now is to draw few dotted lines around the box to give the impression.
Boundary for comment box
CC BY-SA 2.5
null
2008-10-24T08:14:34.640
2010-04-21T15:22:52.260
2017-02-08T14:08:46.413
-1
22,550
[ "java", "graphics", "comments" ]
233,147
1
1,268,064
null
7
5,744
In VS2008, I have a web-site project. When I use find in files and search for a string, the find results window will list every occurence twice. What could be causing this? [EDIT] Below is the screen capture from VS. I was searching for the work CommissionBucketProductID within my website project. Notice that each line is returned twice. ![Screen Capture](https://i.stack.imgur.com/LXSyr.gif) [EDIT2] In response to your questions. I am only searching within the project, not the whole solution. I currently don't have these files under VSS, although they were in the past.
Visual studio 2008 - Find in files : lists everything twice
CC BY-SA 4.0
0
2008-10-24T11:25:01.493
2019-02-14T20:40:24.420
2019-02-14T20:40:24.420
4,751,173
21,155
[ "visual-studio", "visual-studio-2008" ]
233,411
1
233,826
null
21
23,117
Is it possible to enable a second monitor programatically and extend the Windows Desktop onto it in C#? It needs to do the equivalent of turning on the checkbox in the image below. ![alt text](https://i.stack.imgur.com/ss2sE.png)
How do I enable a second monitor in C#?
CC BY-SA 4.0
0
2008-10-24T12:55:47.603
2019-02-14T20:40:30.677
2019-02-14T20:40:30.677
4,751,173
4,500
[ "c#", "winforms", "desktop", "multiple-monitors" ]
239,367
1
239,384
null
2
295
I am using Direct3D to display a number of I-sections used in steel construction. There could be hundreds of instances of these I-sections all over my scene. I could do this two ways: ![I-Sections](https://i.stack.imgur.com/Eu1Lr.png) Using method A, I have fewer surfaces. However, with backface culling turned on, the surfaces will be visible from only one side. If backface culling is turned off, then the flanges (horizontal plates) and web (vertical plate) may be rendered in the wrong order. Method B seems correct (and I could keep backface culling turned on), but in my model the thickness of plates in the I-section is of no importance and I would like to avoid having to create a separate triangle strip for each side of the plates. Is there a better solution? Is there a way to switch off backface culling for only certain calls of DrawIndexedPrimitives? I would also like a platform-neutral answer to this, if there is one.
Modelling an I-Section in a 3D Graphics Library
CC BY-SA 4.0
null
2008-10-27T08:59:33.293
2019-02-14T20:51:03.947
2019-02-14T20:51:03.947
4,751,173
45,603
[ "graphics", "directx", "direct3d", "3d" ]
240,112
1
null
null
2
533
I'm looking for a way to create websites with the of Windows Vista, like what is shown in this screenshot (taken from one of Microsoft's websites): ![Microsoft Update Catalog](https://www.istartedsomething.com/wp-content/uploads/2008/08/windows7update.jpg) Any suggestions? I'd prefer an integrated designer / IDE, but libraries or templates might also help.
Any designers or libraries for creating "Vista-style" web pages?
CC BY-SA 2.5
0
2008-10-27T14:41:25.333
2008-10-27T16:17:56.637
2017-02-08T14:08:49.437
-1
23,564
[ "user-interface", "windows-vista" ]
241,015
1
241,030
null
28
153,077
I have a backup server that automatically backs up my live site, both files and database. On the live site, the text looks fine, but when you view the mirrored version of it, it displays '?' within some of the text. This text is stored within the news database table. Here is a screenshot of it being on the live server and of it on the mirrored server. What could happen within the process of backing it up to the mirrored server? ![Alt text](https://i.stack.imgur.com/ftKNy.jpg) The live server is [Solaris](https://en.wikipedia.org/wiki/Solaris_%28operating_system%29), and the mirrored server is Linux [Red Hat Linux](https://en.wikipedia.org/wiki/Red_Hat_Linux) 5.
Question mark characters display within text. Why is this?
CC BY-SA 4.0
0
2008-10-27T18:44:57.603
2021-11-16T17:22:51.130
2021-08-10T01:06:09.553
63,550
26,130
[ "html", "backup", "character-encoding", "mirror" ]
248,353
1
248,435
null
1
1,168
I'm busy with an asignment where i have to make a graphical interface for a simple program. But i'm strugling with the layout. This is the idea: ![Layout Example](https://i.stack.imgur.com/a3Xk7.png) What is the easiest way to accomplish such a layout? And what method do you use to make layouts in java. Just code it, or use an IDE like netbeans?
Java GUI LayoutManagers
CC BY-SA 4.0
0
2008-10-29T20:47:06.983
2019-02-15T07:48:50.513
2019-02-15T07:48:50.513
4,751,173
20,261
[ "java", "swing", "user-interface" ]
250,931
1
251,315
null
0
5,242
I have some HTML that displays fine on FireFox3/Opera/Safari but not with IE7. The snippet is as follows: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head></head> <body bgcolor="#AA5566" > <table width="100%"> <tr> <td height="37" valign="top"><img style="float:right;" border="0" src="foo.png" width="37" height="37"/></td> <td width="600" rowspan="2" > <table width="600" height="800"><tr><td><img src="bar.jpg" width="600" height="800"/></td></tr></table> </td> <td height="37" valign="top"><img style="float:left;" border="0" src="foo.png" width="37" height="37"/></td> </tr> <!-- This row doesnt fill the vertical space on IE7 //--> <tr> <td valign="top" bgcolor="#112233">&nbsp;</td> <td valign="top" bgcolor="#112233">&nbsp;</td> </tr> </table> </body> ``` The second row wont fill the vertical space created by the first rows middle column (notice the rowspan="2") correctly. Instead the first rows 1st and 3rd columns expand down even though I set their height to 37. The image below shows what happens in IE7 and Firefox3... ![alt text](https://i.stack.imgur.com/DpxMK.png) EDIT: added the HTML doc type to the code snippit. Added a screenshot. Any help appreciated, thanks :)
HTML Table columns height; Works in Firefox not in IE
CC BY-SA 4.0
null
2008-10-30T16:59:53.183
2019-02-15T07:50:20.997
2019-02-15T07:50:20.997
4,751,173
14,260
[ "html", "firefox", "internet-explorer-7" ]
257,955
1
258,194
null
0
1,996
Windows XP Disk Defragmenter report shows a constant in disk usage on a number of disk partitions on my system. I'm not referring to the little transitory gaps that occur. In disk D below, the gap in question is the one under the word "defragmentation". In disk P below, the gap is the one under "usage before def" the but a bigger one. The C partition doesn't have this anomaly. The size and placement pattern isn't obvious. It is as though there was an area, a no-man's land, that both the file system and the defragmenter avoid. These gaps survive daily use and defragmentation. I don't believe this is a residue from a paging file -- it should show up in green, anyway. Recycle bin is empty. Any ideas? Disk D (20 Gig): ![Disk D](https://i.stack.imgur.com/e8HYu.jpg) Disk P (40 Gig): ![Disk P](https://i.stack.imgur.com/20fvO.jpg)
Windows disk partition gap
CC BY-SA 3.0
null
2008-11-03T04:51:42.210
2011-06-24T21:20:57.873
2011-06-24T21:20:57.873
29,454
29,454
[ "windows", "filesystems", "defragmentation" ]
261,080
1
261,120
null
1
1,759
I would like to have a Java component which has a resize icon on the bottom right of the component so that when I drag that icon, the component will automatically resize with it. By resize icon, I mean the following: ![resize icon in Google Talk](https://lh5.ggpht.com/_7dfPdX2BP6o/SQ_sPvvHpTI/AAAAAAAAAKU/vRWKb_pLVvc/s144/resize%20icon.jpg) The above image contains the resize icon in the Google Talk messenger's main window. Is there any Java component which provides this facility?
Resizable Java component
CC BY-SA 2.5
null
2008-11-04T06:35:43.857
2013-09-03T07:32:37.430
2017-02-08T14:08:53.973
-1
22,550
[ "java", "resize", "components" ]
261,910
1
null
null
0
7,539
Would you please help me in making a rollover effect using jquery, what i want to do is when someone hover over any of the menu items the text slide down and disappear and a picture slides from the top down to the center (e.g. you could see this effect here [panda](http://www.iviewcom.com/panda) as you can see the picture slide down from the top but the text does not slide down which is not what want). I know it can be easily done using flash but i don't want my menu in flash as that would be a bad practice. can you tell me what do i need to change in my menu HTML and what jquery functions should i use. P.S. this my menu HTML and you can see my menu here ``` <ul class="nav"> <li class="active first"><a href="#" class="home">Home</a></li> <li><a href="#" class="news">News</a></li> <li><a href="#" class="offers">Special offers</a></li> <li><a href="#" class="private">Private label</a></li> <li><a href="#" class="locations">Locations</a></li> <li><a href="#" class="about">About us</a></li> <li><a href="#" class="jobs">Jobs</a></li> <li><a href="#" class="contact">Contact us</a></li> <li><a href="#" class="mm">Multimedia</a></li> </ul> ``` MENU: ![alt text](https://i.stack.imgur.com/8ANuL.jpg)
rollover effect using Jquery
CC BY-SA 3.0
null
2008-11-04T13:35:22.417
2013-07-19T14:53:14.240
2013-07-19T14:53:14.240
2,556,654
null
[ "php", "javascript", "jquery", "html" ]
262,017
1
null
null
2
1,494
We have a Navigation Based WPF application. It works fine when running directly from Visual Studio, or even if we copy the files to another directory or another computer and run it there. We deploy the application over the internet using ClickOnce and most of the time this does not cause any problems. Every now and then however, it just freezes completely and you get the classic "Application xxxx is not responding" and a non responsive UI. This does not happen every time, and only when using the deployed version. (Even if we test this on the development machine). > As I am typing this message, we are starting and quiting the deployed version many times in order to try and reproduce the behaviour... sometimes it will happen 10 times in a row, and then it'll work fine the next 20 times. With no indication as to what might be causing it. (Just managed to make it happen) Just to show you what I mean, here's a screenshot: [![alt text](https://i.stack.imgur.com/h1nZh.jpg)][null] This happened when double clicking the first item in the ListBox: ``` LLCOverviewPage llcOverview = new LLCOverviewPage((Controller)this.lstControllers.SelectedItem); this.NavigationService.Navigate(llcOverview); ``` The application just remains in this state forever, no exception is thrown. The constructor for the LLCOverViewPage looks like this: ``` public LLCOverviewPage(Controller CurrentController) { InitializeComponent(); this.currentController = CurrentController.ToLightLinkController(); this.updateControllerInfo(); } ``` The updateControllerInfo() method displays information on the page, and then calls a method more information that has been loaded previously from a SQL Compact 3.5 database: ``` private void updateControllerInfo() { //Update the UI with general properties this.lblDeviceName.Content = this.currentController.ShortName; this.lblEthernetAddress.Content = this.currentController.Eth0.EthernetAddress.ToString(); this.lblTcpPort.Content = this.currentController.Eth0.TcpPort.ToString(); this.lblActuatorThroughputMode.Content = (this.currentController.Dali.ActuatorThroughputMode ? "Enabled" : "Disabled"); this.lblNetmask.Content = (this.currentController.Eth0.Netmask != null ? this.currentController.Eth0.Netmask.ToString() : String.Empty); this.lblDefaultGateway.Content = (this.currentController.Eth0.DefaultGateway != null ? this.currentController.Eth0.DefaultGateway.ToString() : String.Empty); //Update the UI with the ballasts this.updateBallastList(); } private void updateBallastList() { this.lstBallasts.ItemsSource = null; List<BallastListViewItem> listviewItems = new List<BallastListViewItem>(); foreach (DaliBallast ballast in this.currentController.Dali.Ballasts.OrderBy(b => b.ShortAddress)) { listviewItems.Add(new BallastListViewItem(ballast,this.currentController.SerialNumber)); } this.lstBallasts.ItemsSource = listviewItems; } ``` That's about it. Nothing else happens when the page is constructed. With no exception and since the application does not crash, I have very little to go on in order to find what's going wrong. The SQL Compact database is stored in the users application folder, so the deployed version uses the same database as the normal version, no difference there. So, just to be clear, this problem occurs ONLY in the deployed version! (Tested on different machines with both Windows XP and Windows Vista) Any ideas as what might be causing something like this to happen, or what I might try in order to trace down this problem? > Using some good old debugging (writing log information to a file) I was able to determine all of my code succesfully excecutes and the application only freezes after that. So if you take another look at the constructor of the page being created: ``` public LLCOverviewPage(Controller CurrentController) { InitializeComponent(); this.currentController = CurrentController.ToLightLinkController(); this.updateControllerInfo(); } ``` After the this.updateControllerInfo() is where the application freezes from time to time. Would this be something beyond my code? Perhaps a WPF bug? I checked the Application EventLog in Windows, this is what it says: ``` <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event"> <System> <Provider Name="Application Hang" /> <EventID Qualifiers="0">1002</EventID> <Level>2</Level> <Task>101</Task> <Keywords>0x80000000000000</Keywords> <TimeCreated SystemTime="2008-11-04T15:55:55.000Z" /> <EventRecordID>1630</EventRecordID> <Channel>Application</Channel> <Computer>DEVTOP</Computer> <Security /> </System> <EventData> <Data>LLCControl.exe</Data> <Data>1.0.0.0</Data> <Data>2f4</Data> <Data>01c93e95c29f9da5</Data> <Data>20</Data> <Binary>55006E006B006E006F0077006E0000000000</Binary> </EventData> </Event> ``` The Binary text says: UNKOWN, guess I'm completely pooched... If I change the event handler code for the listbox to this: ``` LLCOverviewPage llcOverview = new LLCOverviewPage((Controller)this.lstControllers.SelectedItem); MessageBox.Show("Navigating Now"); this.NavigationService.Navigate(llcOverview) ``` it shows me that the application only freezes when Navigating! I hooked up a few event handlers to the NavigationService. The handlers simply write to the Log when the events are triggered. The result looks like this: > 17:51:35 Navigating 17:51:35 Navigated 17:51:35 LoadCompleted So why is this going to oblivion?
Weird behaviour when running ClickOnce deployed version of WPF application
CC BY-SA 4.0
null
2008-11-04T14:18:18.947
2019-02-15T10:08:14.210
2019-02-15T10:08:14.210
4,751,173
28,149
[ "c#", "wpf", "linq", "debugging", "clickonce" ]
263,305
1
263,573
null
37
12,145
I've been working on a visualization project for 2-dimensional continuous data. It's the kind of thing you could use to study elevation data or temperature patterns on a 2D map. At its core, it's really a way of flattening 3-dimensions into two-dimensions-plus-color. In my particular field of study, I'm not actually working with geographical elevation data, but it's a good metaphor, so I'll stick with it throughout this post. Anyhow, at this point, I have a "continuous color" renderer that I'm very pleased with: ![Continuous Color Renderer](https://i.stack.imgur.com/ycIzY.png) The gradient is the standard color-wheel, where red pixels indicate coordinates with high values, and violet pixels indicate low values. The underlying data structure uses some very clever (if I do say so myself) interpolation algorithms to enable arbitrarily deep zooming into the details of the map. At this point, I want to draw some topographical contour lines (using quadratic bezier curves), but I haven't been able to find any good literature describing efficient algorithms for finding those curves. To give you an idea for what I'm thinking about, here's a poor-man's implementation (where the renderer just uses a black RGB value whenever it encounters a pixel that intersects a contour line): ![Continuous Color with Ghetto Topo Lines](https://i.stack.imgur.com/eOiGk.png) There are several problems with this approach, though: - Areas of the graph with a steeper slope result in thinner (and often broken) topo lines. Ideally, all topo lines should be continuous.- Areas of the graph with a flatter slope result in wider topo lines (and often entire regions of blackness, especially at the outer perimeter of the rendering region). So I'm looking at a vector-drawing approach for getting those nice, perfect 1-pixel-thick curves. The basic structure of the algorithm will have to include these steps: 1. At each discrete elevation where I want to draw a topo line, find a set of coordinates where the elevation at that coordinate is extremely close (given an arbitrary epsilon value) to the desired elevation. 2. Eliminate redundant points. For example, if three points are in a perfectly-straight line, then the center point is redundant, since it can be eliminated without changing the shape of the curve. Likewise, with bezier curves, it is often possible to eliminate cetain anchor points by adjusting the position of adjacent control points. 3. Assemble the remaining points into a sequence, such that each segment between two points approximates an elevation-neutral trajectory, and such that no two line segments ever cross paths. Each point-sequence must either create a closed polygon, or must intersect the bounding box of the rendering region. 4. For each vertex, find a pair of control points such that the resultant curve exhibits a minimum error, with respect to the redundant points eliminated in step #2. 5. Ensure that all features of the topography visible at the current rendering scale are represented by appropriate topo lines. For example, if the data contains a spike with high altitude, but with extremely small diameter, the topo lines should still be drawn. Vertical features should only be ignored if their feature diameter is smaller than the overall rendering granularity of the image. But even under those constraints, I can still think of several different heuristics for finding the lines: - Find the high-point within the rendering bounding-box. From that high point, travel downhill along several different trajectories. Any time the traversal line crossest an elevation threshold, add that point to an elevation-specific bucket. When the traversal path reaches a local minimum, change course and travel uphill.- Perform a high-resolution traversal along the rectangular bounding-box of the rendering region. At each elevation threshold (and at inflection points, wherever the slope reverses direction), add those points to an elevation-specific bucket. After finishing the boundary traversal, start tracing inward from the boundary points in those buckets.- Scan the entire rendering region, taking an elevation measurement at a sparse regular interval. For each measurement, use it's proximity to an elevation threshold as a mechanism to decide whether or not to take an interpolated measurement of its neighbors. Using this technique would provide better guarantees of coverage across the whole rendering region, but it'd be difficult to assemble the resultant points into a sensible order for constructing paths. So, those are some of my thoughts... Before diving deep into an implementation, I wanted to see whether anyone else on StackOverflow has experience with this sort of problem and could provide pointers for an accurate and efficient implementation. I'm especially interested in the "Gradient" suggestion made by ellisbben. And my core data structure (ignoring some of the optimizing interpolation shortcuts) can be represented as the summation of a set of 2D gaussian functions, which is totally differentiable. I suppose I'll need a data structure to represent a three-dimensional slope, and a function for calculating that slope vector for at arbitrary point. Off the top of my head, I don't know how to do that (though it seems like it ought to be easy), but if you have a link explaining the math, I'd be much obliged! Thanks to the excellent contributions by ellisbben and Azim, I can now calculate the contour angle for any arbitrary point in the field. Drawing the real topo lines will follow shortly! Here are updated renderings, with and without the ghetto raster-based topo-renderer that I've been using. Each image includes a thousand random sample points, represented by red dots. The angle-of-contour at that point is represented by a white line. In certain cases, no slope could be measured at the given point (based on the granularity of interpolation), so the red dot occurs without a corresponding angle-of-contour line. Enjoy! ![alt text](https://i.stack.imgur.com/PovID.png) ![alt text](https://i.stack.imgur.com/x7jpg.png) Here's a fun fact: over on the right-hand-side of these renderings, you'll see a bunch of weird contour lines at perfect horizontal and vertical angles. These are artifacts of the interpolation process, which uses a grid of interpolators to reduce the number of computations (by about 500%) necessary to perform the core rendering operations. All of those weird contour lines occur on the boundary between two interpolator grid cells. Luckily, those artifacts don't actually matter. Although the artifacts are detectable during slope calculation, the final renderer won't notice them, since it operates at a different bit depth. --- UPDATE AGAIN: Aaaaaaaand, as one final indulgence before I go to sleep, here's another pair of renderings, one in the old-school "continuous color" style, and one with 20,000 gradient samples. In this set of renderings, I've eliminated the red dot for point-samples, since it unnecessarily clutters the image. Here, you can really see those interpolation artifacts that I referred to earlier, thanks to the grid-structure of the interpolator collection. I should emphasize that those artifacts will be completely invisible on the final contour rendering (since the difference in magnitude between any two adjacent interpolator cells is less than the bit depth of the rendered image). Bon appetit!! ![alt text](https://i.stack.imgur.com/RU3Yl.png) ![alt text](https://i.stack.imgur.com/6RWTM.png)
Drawing a Topographical Map
CC BY-SA 3.0
0
2008-11-04T20:25:30.373
2017-08-17T13:30:28.620
2017-08-17T13:30:28.620
2,573,061
22,979
[ "algorithm", "language-agnostic", "visualization", "bezier", "topographical-lines" ]
267,006
1
267,021
null
205
394,945
My new ASP.NET MVC Web Application works on my development workstation, but does not run on my web server... --- # Server Error in '/' Application. --- ## Configuration Error An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Could not load file or assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified. ``` Line 44: <add assembly="System.Web.Abstractions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> Line 45: <add assembly="System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> Line 46: <add assembly="System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> Line 47: <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> Line 48: <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/> ``` C:\inetpub\www.example.org\web.config 46 The following information can be helpful to determine why the assembly 'System.Web.Mvc, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' could not be loaded. --- Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053 --- Do I need to install the on the server? Or is there a different installer for servers? ![enter image description here](https://i.stack.imgur.com/V21XS.gif)
Could not load file or assembly 'System.Web.Mvc'
CC BY-SA 3.0
0
2008-11-05T22:40:34.983
2017-01-20T07:47:52.907
2016-04-21T01:35:32.027
3,119,050
83
[ "asp.net-mvc" ]
271,716
1
271,717
null
9
1,254
As best-behaved as I try to be about keeping my unit tests disconnected from the database, etc. etc, it still seems inevitable that my day will be interrupted by small regular enforced breaks while I wait for my machine to do something boring. ![xkcd comic: compiling](https://imgs.xkcd.com/comics/compiling.png) I personally find swordfighting makes me lose my train of thought. I'm often 'in the zone' when I run a build or suite of tests, and I'd prefer something that keeps me in the same focussed frame of mind, jumping me right back to hacking as soon as the build / test run / migration is done. I used to fantasize about a Tetris plugin for Visual Studio that popped up during the build and then paused and disappeared automatically when the build completed, but I never actually did anything about it. Lately we were thinking about building something into [autotest](http://www.zenspider.com/) which helps you learn Spanish while you wait for the tests to run, or maybe feeds you relevant stack overflow questions to answer. So. Suggestions please. Points for fun yet rewarding activities.
What should I do while I'm waiting for the build / the tests / the database migrations to run?
CC BY-SA 2.5
0
2008-11-07T10:32:00.400
2012-05-04T03:50:21.547
2017-02-08T14:07:45.260
-1
20,011
[ "testing", "build", "focus" ]
274,265
1
274,269
null
7
445
I can't for the life of me find a way to make this work. If I have 3 divs (a left sidebar, a main body, and a footer), how can I have the sidebar and main body sit next to each other without setting their positions as "absolute" or floating them? Doing either of these options result in the footer div not being pushed down by one or the other. How might I accomplish this regardless of what comes before these elements (say another header div or something)? In case it helps, here's an illustration of the two cases I'm trying to allow for: ![alt text](https://i.stack.imgur.com/zjEzC.jpg) Here's a simplified version of the HTML I currently have set up: ``` <div id="sidebar"></div> <div id="content"></div> <div id="footer"></div> ```
How to layout sidebar and main body without using 'absolute' or 'float'?
CC BY-SA 4.0
0
2008-11-08T02:49:29.163
2019-02-15T17:43:33.657
2019-02-15T17:43:33.657
4,751,173
5,291
[ "css", "xhtml", "html" ]
278,676
1
284,522
null
1
9,061
I'm working the the image upload piece of the [FCKEditor](http://www.fckeditor.net/) and I've got the uploading working properly but am stuck with the server file browser. ![FCKEditor Image Properties dialog](https://farm4.static.flickr.com/3184/3019956718_f7ab198c16.jpg?v=0) You can see in the dialog above has a button which pops up the following dialog ![FCKEditor Resources Browser](https://farm4.static.flickr.com/3054/3019956722_712ae75d24.jpg?v=0) The problem is that I have no idea which folder the file browser is pointing at. I've set the and in the PHP connector config.php to control where my image uploads go. ### How can I configure the file browser so that it starts off pointing at the same folder where my uploads are going? --- The property is what I'm looking for. That property is used for having the button point somewhere other than the default file browser. My problem is figuring out how to point the default file browser to a specific directory.
How to set the default location of the FCKEditor file browser?
CC BY-SA 2.5
null
2008-11-10T18:08:41.710
2008-11-13T18:30:13.110
2017-02-08T14:08:59.130
-1
305
[ "php", "fckeditor" ]
281,334
1
null
null
1
5,528
I have a UL that looks like this: ``` <ul class="popular-pages"> <li><a href="region/us/california/">California</a></li> <li><a href="region/us/michigan/">Michigan</a></li> <li><a href="region/us/missouri/">Missouri</a></li> <li><a href="region/us/new-york/">New York</a></li> <li><a href="region/us/oregon/">Oregon</a></li> <li><a href="region/us/oregon-washington/">Oregon; Washington</a></li> <li><a href="region/us/pennsylvania/">Pennsylvania</a></li> <li><a href="region/us/texas/">Texas</a></li> <li><a href="region/us/virginia/">Virginia</a></li> <li><a href="region/us/washington/">Washington</a></li> </ul> ``` And CSS that looks like this: ``` ul.popular-pages li a { display:block; float:left; border-right:1px solid #b0b0b0; border-bottom:1px solid #8d8d8d; padding:10px; background-color:#ebf4e0; margin:2px; color:#526d3f } ul.popular-pages li a:hover { text-decoration:none; border-left:1px solid #b0b0b0; border-top:1px solid #8d8d8d; border-right:none; border-bottom:none; } ``` So it's working fine in modern browsers, but it's looking like this in IE6. Any suggestions? ![alt text](https://thecleverest.com/Picture_26.png)
List Items turned into float:left blocks look strange in IE6
CC BY-SA 2.5
null
2008-11-11T16:12:39.370
2008-11-11T17:30:42.970
2017-02-08T14:08:59.463
-1
null
[ "css", "internet-explorer-6" ]
282,489
1
282,515
null
7
19,967
What is a good way to set up a single container div with some border images surrounding it (in my case only on the left, bottom, and right sides)? I have it centered at the top of the page, overlapping everything else (so like that OSX-style slide-down dialog). Here's the basic layout: ![alt text](https://i.stack.imgur.com/HoGAj.jpg) Here's what I've got so far (can I avoid a static width/height for the content?): ``` <div class="contentbox"> <div class="contentbox-wrapper" style="width: 400px"> <div class="contentbox-mid" style="height: 200px"> <div class="contentbox-w"></div> <div class="contentbox-content"> Content Box Test </div> <div class="contentbox-e"></div> </div> <div class="contentbox-bottom"> <div class="contentbox-sw"></div> <div class="contentbox-s"></div> <div class="contentbox-se"></div> </div> </div> </div> ``` ``` .contentbox { width: 100%; position: fixed; z-index: 2; } .contentbox-wrapper { width: 300px; margin-left: auto; margin-right: auto; } .contentbox-mid { height: 100px; } .contentbox-w { width: 30px; height: 100%; background: transparent url("../../images/contentbox_w.png"); float: left; } .contentbox-content { width: auto; height: 100%; background: #e8e8e8; float: left; } .contentbox-e { width: 30px; height: 100%; background: transparent url("../../images/contentbox_e.png"); float: left; } .contentbox-bottom { width: 300px; height: 30px; } .contentbox-sw { width: 30px; height: 30px; background: transparent url("../../images/contentbox_sw.png"); float: left; } .contentbox-s { height: 30px; background: transparent url("../../images/contentbox_s.png"); margin-left: 30px; margin-right: 30px; } .contentbox-se { width: 30px; height: 30px; background: transparent url("../../images/contentbox_se.png"); float: right; position: relative; bottom: 30px; } ```
Div with Border Images
CC BY-SA 4.0
0
2008-11-11T23:20:56.757
2018-08-20T09:06:01.370
2018-08-20T09:06:01.370
6,404,321
5,291
[ "css", "html" ]
282,838
1
null
null
46
89,871
I know this question had been asked more than a few times, but so far I haven't been able to find a good solution for it. I've got a panel with other control on it. I want to draw a line on it and on top of all the controls in the panel I came across 3 types of solutions (non of them worked the way I wanted) : 1. Get the desktop DC and Draw on the screen. This will draw on other applications if they overlap the form. 2. Overriding the panel's "CreateParams": = ``` protected override CreateParams CreateParams { get { CreateParams cp; cp = base.CreateParams; cp.Style &= ~0x04000000; //WS_CLIPSIBLINGS cp.Style &= ~0x02000000; //WS_CLIPCHILDREN return cp; } } ``` //NOTE I've also tried disabling WS_CLIPSIBLINGS and then drawing the line OnPaint(). But... Since the panel's OnPaint is called before the OnPaint of the controls in it, the drawing of the controls inside simply paints on top of the line. I've seen someone suggest using a message filter to listen to WM_PAINT mesages, and use a timer, but I don't think this solution is either "good practice" or effective. What would you do ? Decide that the controls inside have finished drawing after X ms, and set the timer to X ms ? --- This screen shot shows the panel with WS_CLIPSIBLINGS and WS_CLIPCHILDREN turned off. The Blue line is painted at the Panel's OnPaint, and simply being painted on by the textboxes and label. The Red line is painted on top only because it's not being painted from the panel's OnPaint (It's actually painted as a result of a Button being clicked) ![alt text](https://i73.photobucket.com/albums/i201/sdjc1/temp/screen3.png) --- 3rd: Creating a transparent layer and drawing on top of that layer. I've created a transparent control using: ``` protected override CreateParams CreateParams { get { CreateParams cp = base.CreateParams; cp.ExStyle |= 0x00000020; //WS_EX_TRANSPARENT return cp; } } ``` The problem is still, putting the transparent control on top of the Panel and all its controls. I've tried bringing it to the front using: "BringToFront()" , but it didn't seem to help. I've put it in the Line control's OnPaint() handler. Should I try putting it somewhere else ?? - This also creates issue with having another control on top of the panel. (catching the mouse clicks etc..) **EDIT: The black line is a sample of what I was trying to do. (used windows paint to paint it) ![alt text](https://i73.photobucket.com/albums/i201/sdjc1/temp/screen2.jpg)
Drawing on top of controls inside a panel (C# WinForms)
CC BY-SA 2.5
0
2008-11-12T02:37:24.023
2019-02-21T17:01:02.093
2017-02-08T14:09:00.160
-1
36,777
[ "c#", ".net", "winforms" ]
285,829
1
331,438
null
32
55,775
I'd like to use the DataGridView control as a list with columns. Sort of like ListView in Details mode but I want to keep the DataGridView flexibility. (with view and enabled) highlights the whole line and shows the focus mark around the whole line: ![selected row in ListView control](https://i361.photobucket.com/albums/oo51/Stark3000/ListView_row.png) (with = ) displays focus mark only around a single cell: ![selected row in DataGridView](https://i361.photobucket.com/albums/oo51/Stark3000/DataGridView_row.png) So, does anyone know of some (ideally) easy way to make the DataGridView row selection look like the ListView one? I'm not looking for a changed behaviour of the control - I only want it to look the same. Ideally, without messing up with the methods that do the actual painting.
DataGridView: how to focus the whole row instead of a single cell?
CC BY-SA 2.5
0
2008-11-12T23:38:00.700
2021-04-28T16:37:17.517
2017-02-08T14:09:01.223
-1
2,239
[ ".net", "winforms", "datagridview" ]
287,592
1
null
null
6
682
Why does the following have the effect it does - it prints a terminal full of random characters and then exits leaving a command prompt that produces garbage when you type in it. (I tried it because I thought it would produce a seg fault). ![http://oi38.tinypic.com/r9qxbt.jpg](https://i.stack.imgur.com/kGkf4.png) ``` #include <stdio.h> int main(){ char* s = "lololololololol"; while(1){ printf("%c", *s); s++; } } ``` it was compiled with:
why does this happen (see image)?
CC BY-SA 3.0
null
2008-11-13T17:26:17.420
2013-07-19T15:27:43.007
2013-07-19T15:27:43.007
2,556,654
null
[ "c", "console", "terminal", "reset" ]
289,176
1
289,410
null
46
4,502
I keep seeing the phrase "duck typing" bandied about, and even ran across a code example or two. I am way too busy to do my own research, can someone tell me, briefly: - - - ![duck typing illustration courtesy of The Register](https://regmedia.co.uk/2007/05/03/cartoon_duck.jpg) I don't mean to seem fowl by doubting the power of this 'new' construct, and I'm not ducking the issue by refusing to do the research, but I am quacking up at all the flocking hype i've been seeing about it lately. It looks like typing (aka dynamic typing) to me, so I'm not seeing the advantages right away. ADDENDUM: Thanks for the examples so far. It seems to me that using something like 'O->can(Blah)' is equivalent to doing a reflection lookup (which is probably not cheap), and/or is about the same as saying (O is IBlah) which the compiler might be able to check for you, but the latter has the advantage of distinguishing my IBlah interface from your IBlah interface while the other two do not. Granted, having a lot of tiny interfaces floating around for every method would get messy, but then again so can checking for a lot of individual methods... ...so again i'm just not getting it. Is it a fantastic time-saver, or the same old thing in a brand new sack? Where is the example that duck typing?
How is duck typing different from the old 'variant' type and/or interfaces?
CC BY-SA 2.5
0
2008-11-14T03:40:59.223
2019-10-01T07:33:57.747
2017-02-08T14:09:01.987
-1
9,345
[ "interface", "variant", "duck-typing" ]
289,409
1
289,455
null
2
10,136
I have a layout that is working, but it has one very annoying problem.. when the content is taller than the screen, the background stops. This is the desired layout in bad-ASCII-art format: ``` _____________________ _ | | long |logo| | | | content | | | | | | | | | | | | | |grad| |grad| | Viewport | | | | | | | | | | | | | | _| | | | | | | | | _____________________ |2em| <-20em->| 2em| ``` ..or with short content.. ``` _____________________ _ | | short |logo| | | | content | | | | | | | | | | | | | |grad| |grad| | Viewport | | | | | | | | | | | | | | | | | | | | _____________________ _| ``` Basically it looks like a single column, with a glow as a column either side. Over the left-glow is a logo. When the content is short, it is still the full-height. I have tried using the [CSS min-height hack](http://www.dustindiaz.com/min-height-fast-hack/), which fixes the middle column, but then the gradients only extend as far as the content (in the left column, a single `&nbsp;`, in the right column the logo) --- Here is what the layout looks like: ![Layout](https://i.stack.imgur.com/CVm4I.png) And the problem (when the browser window is shrunk vertically): ![Problem](https://i.stack.imgur.com/CVhOL.png) Finally, the problem HTML/CSS, [http://data.dbrweb.co.uk/tmp/fifestock_layout_problem/](http://data.dbrweb.co.uk/tmp/fifestock_layout_problem/)
Full-height CSS layout, with multiple columns
CC BY-SA 3.0
0
2008-11-14T07:09:06.213
2012-10-23T12:36:00.847
2012-10-23T12:36:00.847
745
745
[ "html", "css", "layout" ]
291,455
1
291,462
null
40
31,174
I have an XSD file that is encoded in UTF-8, and any text editor I run it through doesn't show any character at the beginning of the file, but when I pull it up in Visual Studio's debugger, I clearly see an empty box in front of the file. ![Box in file](https://i294.photobucket.com/albums/mm93/geostock/bom3.jpg) I also get the error: ![alt text](https://i294.photobucket.com/albums/mm93/geostock/bom4.jpg) Anyone know what this is? Update: Edited post to qualify type of file. It's an XSD file created by Microsoft's XSD creator.
XML - Data At Root Level is Invalid
CC BY-SA 2.5
0
2008-11-14T21:14:15.850
2013-02-18T00:55:21.990
2017-02-08T14:09:04.243
-1
16,587
[ ".net", "xml", "visual-studio", "xsd", "byte-order-mark" ]
291,527
1
291,669
null
3
4,155
I'm working on a website that uses not just frames, but frames within frames (ew, I know, but I don't get to choose). It actually works OK most of the time, but I'm running into a problem with some of the frames within frames in Safari (only). Some of the two-deep frames render in Safari with a small space on the right-hand side of the frame - I think it's just the ones with scroll set to "no", but fiddling with the scroll settings hasn't fixed it yet. It basically looks like there should be a scroll bar there, but there isn't. I've been working on this awhile and tried a lot of things: changing the heights of the rows, changing the scroll settings, adding a `colls='100%'` tag, changing the heights of the contents of the frames, as well as checking to make sure widths are set to 100% throughout. Nothing's fixed it so far. Does any one know what's happening here? Here's the basic gist of the code and some screenshots - please forgive the lack of proper quotes; it still renders and fixing them all in this codebase would be a losing battle: ``` <html> <frameset id=fset frameborder=0 border=0 framespacing=0 onbeforeunload="onAppClosing()" onload="onAppInit()" rows="125px,*,0"> <frame src="navFrame.html" name=ControlPanel marginwidth=0 marginheight=0 frameborder=0 scrolling=no noresize> <frame src="contentFrame.html" name=C marginwidth=0 marginheight=0 frameborder=0 scrolling=no> <frame src="invisiFrame.html" name=PING marginwidth=0 marginheight=0 frameborder=0 noresize> <noframes><body>Tough luck.</center></body></noframes> </frameset></html> ``` Inside that second frame (named "C" and with src of "contentFrame") is this: ``` <HTML> <HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8"></head> <frameset rows="48px,*,28px" border=0 frameborder=0 framespacing=0> <frame src="pageTitle.html" name=Title marginwidth=0 marginheight=0 noresize scrolling=no frameborder=0> <frame src="content.html" name=ScreenBody marginwidth=0 marginheight=0 frameborder=0> <frame src="submitBar.html" name=ContextPanel marginwidth=0 marginheight=0 frameborder=0 scrolling=no noresize> </FRAMESET> </HTML> ``` The frames that are troublesome are the first frame (named "Title" with src of "pageTitle.html") and the last frame (named "ContextPanel" with src of "submitBar.html") both have their widths set to 100% and heights are either 100%, not set, or a value less than or equal to their row height. Here is an image of the problem: ![image showing site in Firefox and Safari, with sections labeled](https://farm4.static.flickr.com/3290/3029873741_f42727c4e5_o.gif)
Safari Frames Invisible Scrollbar
CC BY-SA 2.5
0
2008-11-14T21:38:34.680
2011-03-16T00:06:52.617
2017-02-08T14:09:05.280
-1
18,860
[ "html", "safari", "scroll", "frames", "frameset" ]
294,773
1
294,898
null
3
6,963
First of all, I'm kinda new to the barcode formats and what I do know, I've learned from Wikipedia. We have some barcodes generated by an existing app that uses the Barcode.4NET library. The barcode is in Code 128A format. The code to generate them is pretty simple, looking something like this: ``` // Create the barcode Code128ABarcode c128A = new Code128ABarcode("045746201627080857"); ``` No other parameters are set for it - after setting the data, we just get a GIF version of the barcode back from the library. I'm working on a new app that is using iTextSharp for PDF generation and I figured that instead of using two libraries, I would use iTextSharp's barcode generation library since it supports Code128 barcodes. It has a few different variations of Code 128, but none of them are "Code 128A". Here is what the code looks like for it: ``` Barcode128 code128 = new Barcode128(); code128.CodeType = Barcode.CODE128; code128.ChecksumText = true; code128.GenerateChecksum = true; code128.StartStopText = true; code128.Code = "045746201627080857"; ``` The image below shows the best I've accomplished so far. ![alt text](https://farm4.static.flickr.com/3187/3037044282_c6396bc09a.jpg) The image on top is generated by iTextSharp and the one on the bottom is generated by Barcode4Net. Obviously, they aren't the same (and not just in the size and the font - the barcoded data is pretty different). Is anyone out there familiar enough with iTextSharp's (or iText itself) barcode components or with Code 128A barcodes to tell me how to make the iTextSharp one look exactly like the Barcode.4NET one?
Problem matching Code128A Barcodes generated with iTextSharp vs. Barcode.4NET
CC BY-SA 2.5
null
2008-11-17T02:46:59.127
2021-02-25T03:39:31.160
2017-02-08T14:09:05.977
-1
14,894
[ ".net", "itext", "barcode" ]
296,148
1
296,237
null
0
208
I have the following div layout: ![](https://i.stack.imgur.com/bZSnA.jpg) Everything is fine when I put normal txt elements in both the blue and the orange div. However, when I place an image in the orange div (which is 31px), the elements in the blue div get pushed down by about half the height of the blue div. (additional info, when hovering over the html for the orange div in firebug, it seems like only half of the image is contained within it, even though to the naked eye it appears fine). Would appreciate any help, I'm still a bit rusty on the box model. Thanks.
Image causing vertical alignment problems
CC BY-SA 3.0
null
2008-11-17T16:55:20.367
2015-06-19T20:20:28.500
2015-06-19T20:20:28.500
1,159,643
28,871
[ "html", "css" ]
302,650
1
304,931
null
0
851
in the out of the project template solution (Dynamic Data Web Application), I have the model created and all is good. - Get the list of the tables, and the select edit etc. But my database has linking tables that just contain forgien keys - so the list template just displays the fk value ![diagram of the table](https://lh6.ggpht.com/_KoHB_k0rTus/SSUbvobGucI/AAAAAAAAAB4/MYPlVYtB2zQ/s288/PARLinkTable.jpg) Is there away to combine the list of the row in the primary table with an inspection of another table based on the fk? More akin to a join in SQL? but using Linq2Entity and the MetaModel? Below is the List.aspx.cs - this seems to bind the standard grid to the entitydatasource, but this is to the current table as per the route in the MVC. But as you can see i need to go and query the Person, Role and Link table via the model to get the other fields so that this would be useful. ![vstudio](https://lh5.ggpht.com/_KoHB_k0rTus/SSUd7yGYUgI/AAAAAAAAADI/cbHUjV1GfrA/VS-Plain.jpg) PS want to try and keep this in LINQ2Entity if possible -trying to grok the natural thing that I want to do is start to spin off new sql queries to go and retrive the values. But this is not in this idiom.
Linq to Entity - can i get to another table in the model when in the list template MVC page
CC BY-SA 2.5
null
2008-11-19T17:14:41.137
2008-11-20T13:13:08.707
2017-02-08T14:09:07.673
-1
null
[ "linq", "entity-framework", "dynamic-data" ]
302,890
1
303,887
null
0
1,325
I am using a canvas which has a degrafa background, so far so good. However, when scrolling, the background (degrafa grid) does not get redrawn. In the code the background strokes are linked to the container height. The container height does not change even when scrolling. How do I get the height of the whole area so I can set the new height to my degrafa background? It looks like this: ![degrafa background example](https://i.stack.imgur.com/9GzZR.png) ``` <mx:Canvas id="blackBoard" width="100%" height="100%" x="0" y="0" backgroundColor="#444444" clipContent="true"> <!-- Degrafa Surface --> <degrafa:Surface id="boardSurfaceContainer"> <degrafa:strokes> <degrafa:SolidStroke id="whiteStroke" color="#EEE" weight="1" alpha=".2"/> </degrafa:strokes> <!-- Grid drawing --> <degrafa:GeometryGroup id="grid"> <degrafa:VerticalLineRepeater count="{blackBoard.width / ApplicationFacade.settings.GRID_SIZE}" stroke="{whiteStroke}" x="0" y="0" y1="{blackBoard.height}" offsetX="0" offsetY="0" moveOffsetX="{ApplicationFacade.settings.GRID_SIZE}" moveOffsetY="0"/> <degrafa:HorizontalLineRepeater count="{blackBoard.height / ApplicationFacade.settings.GRID_SIZE}" stroke="{whiteStroke}" x="0" y="0" x1="{blackBoard.width}" offsetX="0" offsetY="0" moveOffsetX="0" moveOffsetY="{ApplicationFacade.settings.GRID_SIZE}"/> </degrafa:GeometryGroup> </degrafa:Surface> ```
How can I redraw my degrafa background when scrolling?
CC BY-SA 3.0
null
2008-11-19T18:32:20.950
2013-09-03T02:30:45.580
2013-09-03T02:30:45.580
1,832,306
32,032
[ "apache-flex", "scroll", "degrafa" ]
303,718
1
8,092,202
null
4
3,170
My Firefox 3.0.4 does not display non-existing images at all, or it displays the image alt as plain text (if available). This way I would have no idea that there is supposed to be an image there. Does anyone know if there is a way to make it work like IE/Opera? (ie. display a box even if the image file doesn't exists) - plugin or anything? Test image: ![[broken image test]](https://example.com/notavalidlink)
How to display non-existing images the way IE/Opera does?
CC BY-SA 3.0
0
2008-11-19T22:58:31.690
2017-05-04T06:59:10.357
2017-05-04T06:59:10.357
962,603
36,036
[ "firefox" ]
304,745
1
305,136
null
2
1,015
I am currently writing an financial application, and we have a pretty standard customer table. It consists of many mandatory fields, and some optional like Cell/Fax etc.. I'm using NHibernate as a ORM and have all the mappings right. It already works. I just wonder, how do I "express" in code that a field is not-null without commenting? I have the hbm.xml files that document this, but it's kinda awkward to look at them for things like this. The other thing that comes to mind is that I don't want the repository to throw NHibernate Exceptions at my Logic, so maybe I should go the validation route in the Controller. Still, how can I make the POCO code express that some fields can be null? ![Class Diagram](https://www.tigraine.at/wp-content/uploads/2008/11/demo.png) As you can see, I want to have Cellular and Fax be optional while Phone mandatory. They are all just composite mappings, so the mapping file just specifies that the single elements of each have to be not-null, but I hate to do the Person.Cellular != null check all the time to avoid having a NullReferenceException.
Not-Null constraints in POCO Objects
CC BY-SA 2.5
null
2008-11-20T09:18:12.847
2008-11-28T23:58:42.227
2017-02-08T14:09:09.390
-1
21,699
[ "c#", "nhibernate", "class-design", "dbnull" ]
311,079
1
311,827
null
0
293
I'm trying to get better at using MVC/MVP style patterns with my WinForm apps and I'm struggling with something that maybe someone here with more experience can help me with. Below is my basic project layout: ![alt text](https://i.stack.imgur.com/BNawq.png) The class `G2.cs` handles the running of various threads and includes a Start/Stop and other various methods involved with those threads. It is my "main" class I suppose. It contains the main loop for my application as well. My GUI is composed of 3 forms so far and an associated controller for each. The `MainForm` has Start/Stop buttons that need to call methods on my `G2` class as well as possible future forms. Do I need to pass the `G2` reference to the Form when I create it and the form in-turn passes it to my Controllers or... is that not a good way to handle things? Also, am I correct in that it is the Views responsibility to create an instance of it's controller and it "owns" the controller?
How should I pass a reference of an object to a controller in MVC?
CC BY-SA 3.0
0
2008-11-22T08:21:07.437
2015-06-19T20:33:58.187
2020-06-20T09:12:55.060
-1
null
[ "winforms", "model-view-controller", "mvp" ]
312,569
1
314,738
null
2
2,516
I have a Windows GUI application that's using the Qt framework (currently version 3.3.5, might change to Qt4). I want to combine other Windows GUI applications in the main application. I can't use the widgets directly in the main application due to several constrains which I can't control. The final layout should look like this: ![http://i.stack.imgur.com/RlK7T.png](https://i.stack.imgur.com/RlK7T.png) Currently I'm using the method outlined in a [Hosting .exe applications into a dialog](http://www.codeproject.com/KB/dialog/exeHosting.aspx). In order to pass the `HWND` of the child applications I'm using my own IPC between the processes. Then, I need to forward resize events using Qt `resizeEvent` that calls `::MoveWindow` on the child windows. Is there a better or more generic mechanism for doing this? Some suggested that I use ActiveX, but I'm not familiar enough with this technology.
How to combine GUI applications in Windows
CC BY-SA 3.0
0
2008-11-23T14:32:40.947
2015-06-19T20:14:01.463
2015-06-19T20:14:01.463
1,159,643
33,982
[ "windows", "qt", "winapi", "user-interface", "ipc" ]
312,861
1
326,208
null
16
26,784
I put together a sample scenario of my issue and I hope its enough for someone to point me in the right direction. I have two tables Products ![alt text](https://i.stack.imgur.com/ktnI0.gif) Product Meta ![alt text](https://i.stack.imgur.com/dBrc0.gif) I need a result set of the following ![alt text](https://i.stack.imgur.com/Ken2R.gif)
Pivot using SQL Server 2000
CC BY-SA 3.0
0
2008-11-23T19:42:07.657
2018-07-20T12:54:56.833
2018-07-20T12:54:56.833
7,951,483
34,444
[ "sql", "sql-server", "tsql", "sql-server-2000" ]
312,942
1
313,039
null
2
4,906
I'm learning UML by trying to simulate how a car service garage works with diagrams and documentation. One problem I have is with postcondition (or rather, GOTO) statements. Is the dashed line << include >> relationship only for preconditions? Can Use-case bubbles connect to eachother and follow a logic path? So this is what I have so far.. 1) Is the 'Settle Payment' bubble in the wrong place? Should it have been << include >>ed to the other bubbles? 2) Should I associate the 'request service' bubbles to the technician too as he will be the one fixing the car? Image ![http://i.stack.imgur.com/iIBIt.jpg](https://i.stack.imgur.com/iIBIt.jpg)
UML Use-case diagram postcondition implementation (with diagram)
CC BY-SA 3.0
0
2008-11-23T20:54:23.330
2013-07-19T14:24:17.907
2013-07-19T14:24:17.907
707,795
39,473
[ "uml", "use-case" ]
314,329
1
2,392,649
null
40
95,575
OK, this is my own fault, but I can't seem to rescue myself. Whenever I try to step into a class that has fields with assignments calling into .NET code, I get a dialog box that contains the text "There is no source code available for the current location.": ![Screenshot of error message](https://i.stack.imgur.com/3pfTr.png) For instance, stepping into the constructor of the following class would give me the above message: ``` public class Test { private Stack<String> _Dummy = new Stack<String>(); public Test() { } } ``` I assume this is because at some point I fiddled with the settings for the symbol server, but no matter what I fiddle with now, I can't seem to get rid of that message. Where has my stupidity forgotten what it did? --- Summary of my current [options](https://stackoverflow.com/questions/4649093/visual-studio-2010-debugger-steps-over-methods-and-doesnt-stop-at-breakpoints/4649220#4649220): - - - - - -
Getting rid of "There is no source code available for the current location."
CC BY-SA 3.0
0
2008-11-24T14:44:03.700
2022-02-13T03:34:12.237
2017-05-23T12:17:21.147
-1
267
[ "visual-studio", "debugging", "message", "debug-symbols", "step-into" ]
316,520
1
316,554
null
11
2,050
I saw this signature on the ListView class: ``` public ListView..::.ListViewItemCollection Items { get; } ``` When I saw that, "What?!" I searched "dot dot colon colon dot" and "..::." on Google with no result. ![alt text](https://i.stack.imgur.com/av0FO.png)
What is the meaning of "..::." in C#?
CC BY-SA 3.0
0
2008-11-25T06:42:48.273
2023-01-19T15:18:00.883
2023-01-19T15:15:34.913
4,032,703
11,238
[ "c#" ]
326,937
1
365,976
null
18
69,633
I have been using TortoiseSVN, svn, and subclipse and I think I understand the basics, but there's one thing that's been bugging me for a while: Merging introduces unwanted code. Here's the steps. `trunk/test.txt@r2`. A test file was created with 'A' and a return: ``` A [EOF] ``` `branches/TRY-XX-Foo/test.txt@r3`. Branched out the `trunk` to `TRY-XX-Foo`: ``` A [EOF] ``` `branches/TRY-XX-Foo/test.txt@r4`. Made an unwanted change in `TRY-XX-Foo` and committed it: ``` A B (unwanted change) [EOF] ``` `branches/TRY-XX-Foo/test.txt@r5`. Made an important bug fix in `TRY-XX-Foo` and committed it: ``` A B (unwanted change) C (important bug fix) [EOF] ``` Now, I would like to merge only the important bug fix back to trunk. So, I run merge for revision `4:5`. What I end up in my working directory is a conflict. `trunk/test.txt`: ``` A <<<<<<< .working ======= B (unwanted change) C (important bug fix) >>>>>>> .merge-right.r5 [EOF] ``` Against my will, Subversion has now included "unwanted change" into the trunk code, and I need to weed them out manually. Is there a way to merge only specified revisions when multiple consecutive changes are made in the branch? The part of the problem is that B (unwated change) is included in .merge-right and I can't tell the difference between which revision it came from. I usually use TortoiseMerge and here's how it looks. ![text.txt.working](https://i.stack.imgur.com/NG2g7.png)
Subversion: How to merge only specific revisions into trunk when multiple consecutive changes are made in a branch?
CC BY-SA 3.0
0
2008-11-29T00:09:28.070
2014-10-29T03:18:12.930
2014-10-29T03:18:12.930
3,827
3,827
[ "svn", "version-control", "merge", "three-way-merge" ]
331,299
1
331,328
null
3
978
[Is it bad design to use table tags when displaying forms in html?](https://stackoverflow.com/questions/109488/is-it-bad-design-to-use-table-tags-when-displaying-forms-in-html) The accepted answer to this question in short: YES... ...but what about something like this: ![](https://content.screencast.com/users/MarkusHausammann/folders/Jing/media/a3db75c8-49ce-452c-a3ba-9eb6ce8150e9/2012-05-21_1829.png) I can't really think of different & better solution. The example is from SurveyMonkey and uses tables too.
Table tags for form display are bad... but what about survey questions like rt type?
CC BY-SA 3.0
0
2008-12-01T16:15:38.477
2016-09-15T14:47:12.867
2017-05-23T10:29:31.030
-1
11,995
[ "css", "layout", "html-table", "survey" ]
332,365
1
332,367
null
1,213
282,639
Just looking at: ![XKCD Strip](https://i.stack.imgur.com/G0ifh.png) [https://xkcd.com/327/](https://xkcd.com/327/) What does this SQL do: ``` Robert'); DROP TABLE STUDENTS; -- ``` I know both `'` and `--` are for comments, but doesn't the word `DROP` get commented as well since it is part of the same line?
How does the SQL injection from the "Bobby Tables" XKCD comic work?
CC BY-SA 3.0
0
2008-12-01T21:50:10.220
2022-07-11T16:37:38.367
2017-03-21T21:26:06.460
559,745
39,677
[ "security", "validation", "sql-injection" ]
333,181
1
336,334
null
0
2,328
I have 3 tables in database shown below. And I want to make a report just like shown link below. How can I do it with datagrid or datalist? Which one is the best chois? I have tried to do it for a week. ![http://img123.imageshack.us/my.php?image=61519307xx5.jpg](https://i.stack.imgur.com/uZtmk.jpg) > : ID_COMPANY, COMPANY_NAME: ID_PRODUCT, PRODUCT_NAME: ID_COMPANY, ID_PRODUCT, SALE_COUNT : I could do it, with your helps. However Now I have a small problem too. When I write query with pivot, products' name become column header. if a product name's length is bigger than 30 character, Oracle don't accept it as a column header. So I have croped and make the product names 30 character to solve this problem. After that a problem occured too. When I crop product name as 30 character, some products become same name and "ORA-00918: column ambiguously defined" error message occured. In this case what can be done?
Filling Datagrid And Sql Query
CC BY-SA 3.0
null
2008-12-02T06:04:21.893
2016-02-13T11:38:05.897
2015-12-31T07:19:14.643
2,024,469
439,507
[ "asp.net", "datagrid", "oracle10g", "pivot", "reporting" ]
336,886
1
336,981
null
7
3,077
I'm using Linq to entities applying a [Table per Type](http://msdn.microsoft.com/en-us/data/cc765425.aspx) approach. This has been going very well, up to now. I have the following setup: - - - - Here is the database diagram ![alt text](https://farm4.static.flickr.com/3246/3079069163_287172fb6c_d.jpg) Following the above video i applied the Table Per Type approach to the default schema that Linq to entities creates when you add the above tables to a model. Before applying Table per Type: ![alt text](https://farm4.static.flickr.com/3031/3079069195_f444304873_d.jpg) After Table per Type: ![alt text](https://farm4.static.flickr.com/3286/3079069111_a8a336c52e_d.jpg) I then compiled the project and got the error you can see in the image above. To fix this i went to the mapping for the foreign key link, i added the childid field, which the error message was moaning about. ![alt text](https://farm4.static.flickr.com/3036/3079904138_67b4ebb058_d.jpg) I then recompiled and get another error: > Problem in Mapping Fragments starting at lines 147, 176: Two entities with different keys are mapped to the same row. Ensure these two mapping fragments do not map two groups of entities with overlapping keys to the same group of rows. This is the point i'm at now. The problem seems to the that the "ChildID" on the "LinkingTable" is Nullable. If i set it to be Not nullable i don't get the above error. I have saved the Database and project used in the above steps to a [sky drive](http://skkurg.bay.livefilestore.com/y1pTY9oTppW7UIrkJnml3yfFNfoUGR7SQqEBbSEqrDiJlaD4GPKsxLipKLhzEsEZ3T22vHecn2Lc5QyhFF75KMOTg/TablePerType.zip?download). Does anyone know how to fix this error? Dave Before ``` <AssociationSetMapping Name="FK_LinkingTable_Child" TypeName="TablePerTypeModel.FK_LinkingTable_Child" StoreEntitySet="LinkingTable"> <EndProperty Name="Child"> <ScalarProperty Name="Id" ColumnName="ChildID" /> </EndProperty> <EndProperty Name="LinkingTable"> <ScalarProperty Name="LinkTableID" ColumnName="LinkTableID" /> </EndProperty> </AssociationSetMapping> ``` After ``` <AssociationSetMapping Name="FK_LinkingTable_Child" TypeName="TablePerTypeModel.FK_LinkingTable_Child" StoreEntitySet="LinkingTable"> <EndProperty Name="Child"> <ScalarProperty Name="Id" ColumnName="ChildID" /> </EndProperty> <EndProperty Name="LinkingTable"> <ScalarProperty Name="LinkTableID" ColumnName="LinkTableID" /> </EndProperty> <Condition ColumnName="ChildID" IsNull="false"/> </AssociationSetMapping> ```
Linq to Entities, Table per Type and Nullable Foreign Key Relationships
CC BY-SA 3.0
0
2008-12-03T11:46:45.850
2011-04-17T21:57:01.253
2017-02-08T14:09:16.000
-1
30,317
[ "linq", "entity-framework", "linq-to-entities", "table-per-type" ]
338,884
1
null
null
5
5,689
Is there any way to monitor/log thread interactions in the .NET runtime much like VisualVM does for Java? I don't have a specific need at the moment but I think it would be nice to see how all the threads in my application interact. ![https://visualvm.dev.java.net/images/threads.png](https://visualvm.dev.java.net/images/threads.png)
Monitor .NET Threads
CC BY-SA 2.5
0
2008-12-03T21:57:29.377
2008-12-03T23:08:15.833
null
null
1,490
[ ".net", "multithreading", "visualvm" ]
340,209
1
340,214
null
147
92,803
I'm writing a Java game and I want to implement a power meter for how hard you are going to shoot something. I need to write a function that takes a int between 0 - 100, and based on how high that number is, it will return a color between Green (0 on the power scale) and Red (100 on the power scale). Similar to how volume controls work: ![volume control](https://i.stack.imgur.com/uErDJ.png) What operation do I need to do on the Red, Green, and Blue components of a color to generate the colors between Green and Red? So, I could run say, `getColor(80)` and it will return an orangish color (its values in R, G, B) or `getColor(10)` which will return a more Green/Yellow RGB value. I know I need to increase components of the R, G, B values for a new color, but I don't know specifically what goes up or down as the colors shift from Green-Red. --- Progress: I ended up using HSV/HSB color space because I liked the gradiant better (no dark browns in the middle). The function I used was: ``` public Color getColor(double power) { double H = power * 0.4; // Hue (note 0.4 = Green, see huge chart below) double S = 0.9; // Saturation double B = 0.9; // Brightness return Color.getHSBColor((float)H, (float)S, (float)B); } ``` Where "power" is a number between 0.0 and 1.0. 0.0 will return a bright red, 1.0 will return a bright green. Java Hue Chart: ![Java Hue Chart](https://i.stack.imgur.com/QphuU.png)
Generate colors between red and green for a power meter?
CC BY-SA 3.0
0
2008-12-04T10:56:25.187
2017-10-25T04:08:00.563
2016-07-07T22:23:39.840
6,083,675
2,635
[ "language-agnostic", "graphics", "colors", "interpolation" ]
345,758
1
540,045
null
2
1,660
What is the issue with the Silverlight Tools for VS2008? I can't seem to place controls on the designer surface. This didn't work for me on two different machines. Do you have to tweak the XAML to be able to place the first control? Cursor stays a compass-like-cross when over the surface. Are you supposed to drag-n-drop controls or draw them? Screenshot (as far as I got) ![silverlight-issue](https://i264.photobucket.com/albums/ii199/brunotyndall/silverlight-issue.jpg)
Silverlight Tools for Visual Studio 2008 - Placing a Control Issue
CC BY-SA 3.0
null
2008-12-06T02:06:23.303
2013-07-20T02:37:32.570
2017-02-08T14:09:19.080
-1
36,590
[ "visual-studio-2008", "silverlight", "silverlight-2.0" ]
345,838
1
345,863
null
275
203,780
With the help of the Stack Overflow community I've written a pretty basic-but fun physics simulator. ![alt text](https://i.stack.imgur.com/EeqSP.png) You click and drag the mouse to launch a ball. It will bounce around and eventually stop on the "floor". My next big feature I want to add in is ball to ball collision. The ball's movement is broken up into a x and y speed vector. I have gravity (small reduction of the y vector each step), I have friction (small reduction of both vectors each collision with a wall). The balls honestly move around in a surprisingly realistic way. I guess my question has two parts: 1. What is the best method to detect ball to ball collision? Do I just have an O(n^2) loop that iterates over each ball and checks every other ball to see if it's radius overlaps? 2. What equations do I use to handle the ball to ball collisions? Physics 101 How does it effect the two balls speed x/y vectors? What is the resulting direction the two balls head off in? How do I apply this to each ball? ![alt text](https://upload.wikimedia.org/wikipedia/commons/2/2c/Elastischer_sto%C3%9F_2D.gif) Handling the collision detection of the "walls" and the resulting vector changes were easy but I see more complications with ball-ball collisions. With walls I simply had to take the negative of the appropriate x or y vector and off it would go in the correct direction. With balls I don't think it is that way. Some quick clarifications: for simplicity I'm ok with a perfectly elastic collision for now, also all my balls have the same mass right now, but I might change that in the future. --- Edit: Resources I have found useful 2d Ball physics with vectors: [2-Dimensional Collisions Without Trigonometry.pdf](https://www.vobarian.com/collisions/2dcollisions2.pdf) 2d Ball collision detection example: [Adding Collision Detection](https://web.archive.org/web/20210125052930/http://geekswithblogs.net/robp/archive/2008/05/15/adding-collision-detection.aspx) --- ## Success! I have the ball collision detection and response working great! Relevant code: Collision Detection: ``` for (int i = 0; i < ballCount; i++) { for (int j = i + 1; j < ballCount; j++) { if (balls[i].colliding(balls[j])) { balls[i].resolveCollision(balls[j]); } } } ``` This will check for collisions between every ball but skip redundant checks (if you have to check if ball 1 collides with ball 2 then you don't need to check if ball 2 collides with ball 1. Also, it skips checking for collisions with itself). Then, in my ball class I have my colliding() and resolveCollision() methods: ``` public boolean colliding(Ball ball) { float xd = position.getX() - ball.position.getX(); float yd = position.getY() - ball.position.getY(); float sumRadius = getRadius() + ball.getRadius(); float sqrRadius = sumRadius * sumRadius; float distSqr = (xd * xd) + (yd * yd); if (distSqr <= sqrRadius) { return true; } return false; } public void resolveCollision(Ball ball) { // get the mtd Vector2d delta = (position.subtract(ball.position)); float d = delta.getLength(); // minimum translation distance to push balls apart after intersecting Vector2d mtd = delta.multiply(((getRadius() + ball.getRadius())-d)/d); // resolve intersection -- // inverse mass quantities float im1 = 1 / getMass(); float im2 = 1 / ball.getMass(); // push-pull them apart based off their mass position = position.add(mtd.multiply(im1 / (im1 + im2))); ball.position = ball.position.subtract(mtd.multiply(im2 / (im1 + im2))); // impact speed Vector2d v = (this.velocity.subtract(ball.velocity)); float vn = v.dot(mtd.normalize()); // sphere intersecting but moving away from each other already if (vn > 0.0f) return; // collision impulse float i = (-(1.0f + Constants.restitution) * vn) / (im1 + im2); Vector2d impulse = mtd.normalize().multiply(i); // change in momentum this.velocity = this.velocity.add(impulse.multiply(im1)); ball.velocity = ball.velocity.subtract(impulse.multiply(im2)); } ``` Source Code: [Complete source for ball to ball collider.](https://www.dropbox.com/s/1j4aiu2aahjc19p/ballbounce.zip?dl=0) If anyone has some suggestions for how to improve this basic physics simulator let me know! One thing I have yet to add is angular momentum so the balls will roll more realistically. Any other suggestions? Leave a comment!
Ball to Ball Collision - Detection and Handling
CC BY-SA 4.0
0
2008-12-06T03:24:00.247
2022-07-27T14:03:05.340
2022-07-27T14:03:05.340
4,751,173
2,635
[ "graphics", "language-agnostic", "collision-detection", "physics" ]
348,291
1
348,473
null
3
2,795
Working in C# win forms, I'm trying to create a list of items where each item is compromised of an icon and 3 labels in a specific layout. Here's an illustration of it ![http://hosting04.imagecross.com/image-hosting-13/3535help.jpg](https://i.stack.imgur.com/Z1Kj4.jpg) The user should be able to select a single row, just like in a normal Listview. My first attempt was creating the icon and labels in a user control, and then putting the user control in a FlowLayoutPanel in a vertical layout (which would create a list). The problem was the selection. Since the clicking event was captured by the user control, there was no easy way on letting the other user controls in the list know that the control was selected and if they are currently selected they now should be unselected. (I hope this makes sense...) I also tried using some open source custom Listview I found here: [http://www.codeproject.com/KB/list/aa_listview.aspx](http://www.codeproject.com/KB/list/aa_listview.aspx) but it's too buggy. I also thought about creating a custom control that will inherit from Listview and render my user control in the list, but I also read about someone who tried to do that and got into a lot of difficulties. I'd be very happy to hear any suggestions you might have. Thanks!
user control in a selectable list - best way to do it?
CC BY-SA 3.0
0
2008-12-07T23:18:05.467
2013-07-19T15:27:52.493
2013-07-19T15:27:52.493
2,556,654
null
[ "c#", "winforms", "listview", "user-controls" ]
349,409
1
349,792
null
34
34,866
Tk GUI's seem to be universally considered ugly, but I'd like to know why specifically. Some in the Tcl/Tk world would argue that this is a moot point as there is much better support now for native look and feel, which is a big reason I decided on Tcl/Tk. Now, however, the problem is, because I'm leveraging a Tcl/Starkit vfs (virtual file system), the native file dialogs don't work, and I'm going to have to revert to pure Tk file dialogs. Please I'm looking for specific, technical reasons, e.g. regarding font aliasing (or lack thereof) or font style, or color, etcetera. Because I personally don't buy the "it's just ugly to me". To me, its just different, and I switch between Mac and Windows and Linux with regularity, so I'm used to different looks/feels. Specifically, motif-ish look of a traditional Tk GUI is regarded as ugly: ![Tcl/Tk GUI Sample](https://web.archive.org/web/20140120195559/http://ascend4.org/images/e/e4/Browser01.png)
Why are Tk GUI's considered ugly?
CC BY-SA 3.0
0
2008-12-08T12:45:18.833
2020-05-16T11:28:15.533
2017-02-08T14:09:21.120
-1
34,806
[ "user-interface", "tk-toolkit" ]
349,978
1
353,767
null
2
11,164
I have just imported a WAR file from an external site, which is basically a servlet into Eclipse IDE (the project runs on Apache-Tomcat). When I import it it has a folder called . So here are a few of my newbie questions: 1. I am unsure about what the exact purpose is of this folder is? What does it do, why would you choose to have it in your project? 2. I see that it has a folder called Improted Classes and foobar.class files inside it - why? (These seemed to be mirrored in Web Content folder - although here you can modify the code as they are foobar.java.) 3. There are references to foobar.jar files too - these are also mirrored in WEB-INF/lib folder too - why? I know these are basic type questions but I'm just getting to grips with Java and website dev, so apologies if they sound a bit dumb! - BTW if anyone knows any good online resource to understand more about project file structures like this, then let me know. I just need to get to grips with this stuff asap - as the project deadline is fairly soon. Cheers. Here's a screenshot just to help you visualise: ![alt text](https://rantincsharp.files.wordpress.com/2008/12/eclipserestlet.gif)
Understanding imported WAR in Eclipse and its folder structure
CC BY-SA 2.5
0
2008-12-08T16:05:00.320
2008-12-18T21:36:38.040
2017-02-08T14:09:21.457
-1
5,175
[ "java", "eclipse" ]
355,006
1
null
null
2
517
I am new to using Windows Forms in C++ (and just in general), and I am not exactly sure of the name or if it's even possible to do. Currently I am currently working on a school project in which we must make a program for an imaginary bookstore. I am trying right now to make a sort of list that shows what the "customer" is buying. I have to make it sort by price and ISBN and any other variable that the book has. In essence I am trying to make something like the following: ![Control](https://img.photobucket.com/albums/v683/Dalze/ListView.png) I just need to know how to get started. I can't figure out what the name of the control is or how to even get it to sort every time the user clicks on the header.
How do I create a certain control using Windows Forms in Visual C++?
CC BY-SA 2.5
null
2008-12-10T03:22:25.007
2010-03-19T18:00:16.733
2017-02-08T14:09:21.797
-1
44,840
[ "c++", "windows", "forms", "visual-c++" ]
355,135
1
null
null
0
178
Here is the problem: for your reference: ![http://i.stack.imgur.com/mmrNH.jpg](https://i.stack.imgur.com/mmrNH.jpg) database entries 1,2 and 3 are made using jython 2.2.1 using jdbc1.2. database entry 4 is made using vb the old to be replace program using odbc. We have found that if I copy and paste both jython and vb MailBody entries to wordpad directly from that SQL Server Enterprise Manager software it outputs the format perfectly with correct line returns. if I compare the bytes of each file with a hex editor or KDiff3 they are binary identically the same. There is a 3rd party program which consumes this data. Sadly that 3rd party program reads the data and for entries 1 to 3 it displays the data without line returns. though for entry 4 it correctly formats the text. As futher proof we can see in the picture, the data in the database is displayed differently. Somehow the line returns are preserved in the database for the vb entries but the jython entries they are overlooked. if I click on the 'MailBody' field of entry 4 i can press down i can see the rest of the email. Whereas the data for jython is displayed in one row. What gives, what am i missing, and how do I handle this? Here is a snippet of the code where I actually send it to the database. EDIT: FYI: please disregard the discrepancies in the 'Processed' column, it is irrelevant. EDIT: what i want to do is make the jython program input the data in the same way as the vb program. So that the 3rd party program will come along and correctly display the data. so what it will look like is every entry in 'MailBody' will display "This is a testing only!" then next line "etc etc" so if I was to do a screendump all entries would resemble database entry 4. add _force_CRLF to the mix: ``` def _force_CRLF(self, data): '''Make sure data uses CRLF for line termination. Nicked the regex from smtplib.quotedata. ''' print data newdata = re.sub(r'(?:\r\n|\n|\r(?!\n))', "\r\n", data) print newdata return newdata def _execute_insert(self): try: self._stmt=self._con.prepareStatement(\ "INSERT INTO EmailHdr (EntryID, MailSubject, MailFrom, MailTo, MailReceive, MailSent, AttachNo, MailBody)\ VALUES (?, ?, ?, ?, ?, ?, ?, cast(? as varchar (" + str(BODY_FIELD_DATABASE) + ")))") self._stmt.setString(1,self._emailEntryId) self._stmt.setString(2,self._subject) self._stmt.setString(3,self._fromWho) self._stmt.setString(4,self._toWho) self._stmt.setString(5,self._format_date(self._emailRecv)) self._stmt.setString(6,self._format_date(self._emailSent)) self._stmt.setString(7,str(self._attachmentCount)) self._stmt.setString(8,self._force_CRLF(self._format_email_body())) self._stmt.execute() self._prepare_inserting_attachment_data() self._insert_attachment_data() except: raise def _format_email_body(self): if not self._emailBody: return "could not extract email body" if len(self._emailBody) > BODY_TRUNCATE_LENGTH: return self._clean_body(self._emailBody[:BODY_TRUNCATE_LENGTH]) else: return self._clean_body(self._emailBody) def _clean_body(self,dirty): '''this method simply deletes any occurrence of an '=20' that plagues my output after much testing this is not related to the line return issue, even if i comment it out I still have the problem.''' dirty=str(dirty) dirty=dirty.replace(r"=20","") return r"%s"%dirty ```
mssql handles line returns rather awkwardly
CC BY-SA 3.0
null
2008-12-10T05:10:48.797
2013-07-19T15:14:46.270
2013-07-19T15:14:46.270
2,556,654
21,537
[ "java", "python", "sql-server", "formatting", "jython" ]
356,751
1
356,813
null
1
1,626
I used [Themeroller](http://jqueryui.com/themeroller/) to generate an app theme and I am using `jQuery` and `jQuery UI` to create some `modal dialog` alerts. They work fine (and look great) on Firefox 2 and 3, but the buttons are shifted to the right on IE 6 and 7. It looks like it's being bitten by the IE margin bugs, but I wanted to see if there was an easy fix before digging into the Themeroller CSS, or worse, the jQuery generation code, to find a workaround. Here is what the box looks like in both Firefoxen: ![alt text](https://farm4.static.flickr.com/3264/3097571133_6c67cae83b_o.png) And here is what the same box looks like in IE6/7: ![alt text](https://farm4.static.flickr.com/3163/3098408266_ae31d474db_o.png) The jQuery UI demo page's buttons look a little better under IE, but they are semi-obscured under the resize bar. If no one here says "Oh yeah, here's how you fix it..." I'm going to have to put both of the CSS files side by side and figure out the difference. I see a [semi-related issue](https://stackoverflow.com/questions/43458/how-do-i-make-the-jquery-dialog-work-with-the-themeroller-themes), but the answer there doesn't apply to my problem (because my dialog container does have the ui-dialog class.
Has anyone fixed the jQuery dialog button format in IE6 while using a Themeroller'ed theme?
CC BY-SA 3.0
0
2008-12-10T16:53:17.397
2017-12-28T07:00:18.713
2017-12-28T07:00:18.713
2,833,516
14,894
[ "jquery", "css", "jquery-ui", "themeroller", "jquery-ui-theme" ]
357,769
1
497,660
null
11
22,297
When I use Build->Publish Web Site in Visual Studio 2008, most of the time it compiles the site, and then simply asks me "All files in the target folder will be deleted. Continue?" (or something to that effect). On occasion, however, when publishing a project in Visual Studio, I would get a dialog box that would give me the choice of replacing the folder's contents completely, or simply replacing changed files with newer version. I much prefer to publish without completely obliterating the folder, because the deployed application creates user files and cache files as it's been used that I don't want to take extra steps to preserve. However, I'm not sure why Visual Studio doesn't always give me this option. Is this a setting somewhere I can change? Is it tied to the version of .NET I'm using? Any insight is appreciated! I still haven't figured this out, but here's some more information. Here's what the publish function looks like for one ASP.NET project on my Win XP desktop: ![](https://i.stack.imgur.com/QegqZ.gif) And here's what it looks like for a different project on my Vista laptop: ![](https://i.stack.imgur.com/gbcZh.gif) Notice the radio buttons in the second screenshot that allow me to choose to either delete the contents of the folder prior to publishing, or merely to overwrite matching files. I'd like to have these options for every project. Both computers are running Visual Studio 2008 Professional (version 9.0.30729.1 SP, according to Help->About). The exact same version. And I doubt the OS difference is causing this functionality change. It's got to be a setting somewhere, right? Does anyone know?
How can I use the "Publish" function in Visual Studio 2008 without erasing the contents of the target folder?
CC BY-SA 3.0
null
2008-12-10T22:02:31.220
2015-06-19T20:21:01.990
2015-06-19T20:21:01.990
1,159,643
8,409
[ "asp.net", "visual-studio", "visual-studio-2008", "build-process", "publish" ]
357,860
1
358,153
null
1
1,957
![alt text](https://farm4.static.flickr.com/3199/3099078396_a3c4924c81_o.gif) On the left you will notice the google logo rendered by IE, I drew a black line at the top and bottom of the G which extends into the FF windows which rendered the same exact logo yet the FF version renders the image larger. There is NO css linked to this page, just plain and simple Html. Can anyone tell me why this is happening and can I prevent it? Is my box just fubar and no one else gets this behavior? Edit: Failed to mention IE7/FF3 Edit: Posted Html as requested ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="ctl00_Head1"><title></title> </head> <body> <img src="http://www.google.com/intl/en_ALL/images/logo.gif" /> </body> </html> ```
Why do IE and Firefox render the same image differently, how can I prevent it?
CC BY-SA 2.5
null
2008-12-10T22:37:12.850
2019-02-22T17:09:19.073
2017-02-08T14:09:23.473
-1
40,714
[ "internet-explorer", "firefox", "image", "rendering" ]
359,214
1
360,039
null
3
341
I would like to display the differences between versions of the same content. Initially I rolled out my own WebControl, however the differencing algorithm I came up with was slightly naive. Does anyone know of any .Net code or a WebControl out there on the Internets that might be of use? The implementation that stackoverflow uses, is just the thing I'm looking for e.g: ![alt text](https://i.stack.imgur.com/SEXhn.png) I've wrapped the jsdiff implementation into a self contained web control assembly and uploaded it to the MSDN Code Gallery [Text differencing and syntax highlighting ASP.Net WebControls](http://code.msdn.microsoft.com/jsdiffsyntaxhighligh). Came across the following [javascript differencing library](http://ejohn.org/projects/javascript-diff-algorithm/). Will experiment wrapping it in a custom WebControl. The output looks similar to that used by stackoverflow: ![alt text](https://i.stack.imgur.com/RPpJF.png)
ASP.NET WebControl for displaying revisions or differences of content
CC BY-SA 3.0
0
2008-12-11T12:41:47.590
2015-06-19T20:21:28.947
2015-06-19T20:21:28.947
1,159,643
5,182
[ "asp.net", "diff", "web-controls" ]
359,472
1
null
null
181
177,078
## Short version It's clear how an access token supplied through the [Google Authentication Api :: OAuth Authentication for Web Applications](https://code.google.com/apis/accounts/docs/OAuth.html) can be used to then request data from a range of Google services. It is not clear how to check if a given access token is valid for a given Google account. I'd like to know how. ## Long version I'm developing an API that uses token-based authentication. A token will be returned upon provision of a valid username+password or upon provision of a third-party token from any one of verifiable services. One of the third-party services will be Google, allowing a user to authenticate against my service using their Google account. This will later be extended to include Yahoo accounts, trusted OpenID providers and so on. ![alt text](https://webignition.net/images/figures/auth_figure002.png) The 'API' entity is under my full control. The 'public interface' entity is any web- or desktop-based app. Some public interfaces are under my control, others will not be and others still I may never even know about. Therefore I cannot trust the token supplied to the API in step 3. This will be supplied along with the corresponding Google account email address. I need to somehow query Google and ask: ? In this case, [email protected] is the Google account unique identifier - the email address someone uses to log in to their Google account. This cannot be assumed to be a Gmail address - someone can have a Google account without having a Gmail account. The Google documentation clearly states how, with an access token, data can be retrieved from a number of Google services. Nothing seems to state how you can check if a given access token is valid in the first place. The token is valid for N Google services. I can't try a token against a Google service as means of verifying it as I won't know which subset of all Google's services a given user actually uses. Furthermore, I'll never be using the Google authentication access token to access any Google services, merely as a means of verifying a supposed Google user actually is who they say they are. If there is another way of doing this I'm happy to try.
How can I verify a Google authentication API access token?
CC BY-SA 4.0
0
2008-12-11T14:11:04.290
2022-11-17T15:43:40.220
2022-01-17T23:17:49.327
4,294,399
5,343
[ "web-services", "oauth", "google-oauth", "google-authentication" ]
359,582
1
420,062
null
0
728
A client has installed Sql server 2005 reporting services. When we go to the web bit at `http://servername/reports/` we just see a blank screen like: ![http://img91.imageshack.us/img91/3787/rsblankqx4.jpg](https://i.stack.imgur.com/nGQXH.jpg) We are using windows authentication and I think it has authenticated us as the "site settings" button is appearing and we can alter site security, add to roles etc. I have had this before and cant remember how I fixed it. Any ideas? Thanks, Alex
sql reporting serices not showing anything when go to web interface
CC BY-SA 3.0
null
2008-12-11T14:44:06.703
2013-07-19T15:04:52.383
2013-07-19T15:04:52.383
2,556,654
23,066
[ "sql", "reporting-services", "reporting" ]
361,799
1
null
null
105
110,078
I have been working for a while to create an iPhone app. Today when my battery was low, I was working and constantly saving my source files then the power went out... Now when I plugged my computer back in and it is getting good power I try to open my project file and I get an error: > Unable to Open ProjectProject ... cannot be opened because the project file cannot be parsed. Is there a way that people know of that I can recover from this? I tried using an older project file and re inserting it and then compiling. It gives me a funky error which is probably because it isn't finding all the files it wants... I really don't want to rebuild my project from scratch if possible. --- ### EDIT Ok, I did a diff between this and a slightly older project file that worked and saw that there was some corruption in the file. After merging them (the good and newest parts) it is now working. Great points about the SVN. I have one, but there has been some funkiness trying to sync XCode with it. I'll definitely spend more time with it now... ;-) ![enter image description here](https://i.stack.imgur.com/Up53v.png)
Unable to open project... cannot be opened because the project file cannot be parsed
CC BY-SA 3.0
0
2008-12-12T03:32:35.157
2021-11-24T07:42:40.317
2020-06-20T09:12:55.060
-1
null
[ "iphone", "xcode" ]
364,730
1
null
null
1
379
Screenshot of the problem: ![http://i36.tinypic.com/dfxdmd.jpg](https://i.stack.imgur.com/qutvW.jpg) The yellow block is the logo and the blue box is the nav links (I have blanked them out). I would like to align the links at the bottom so they are stuck to the top of the body content (white box). How would I do this? Here is the relevant CSS and HTML. ``` #header { height: 42px; } #logo { width: 253px; height: 42px; background-image:url(logo.png); float: left; } #nav { width: 100%; border-bottom: 2px solid #3edff2; vertical-align: bottom; } #nav ul { list-style-type: none; margin: 0; padding: 0; margin-bottom: 4px; text-align: right; font-size: 1.25em; } #nav ul li { display: inline; background-color: #3edff2; padding: 5px; } <div id="header"> <div id="logo"><a href="/"></a></div> <div id="nav"> <ul> <li><a href="#">*****</a></li> [...] </ul> </div> </div> ``` Thanks in advance.
positioning logo and navigation links not aligning
CC BY-SA 3.0
null
2008-12-13T03:02:25.003
2013-07-19T15:12:49.567
2013-07-19T15:12:49.567
2,556,654
null
[ "html", "css", "positioning" ]
365,489
1
365,556
null
246
536,977
My company is about to hire . We work on a variety of .NET platforms: ASP.NET, Compact Framework, Windowsforms, Web Services. I'd like to compile a list/catalog of good questions, a kind of minimum standard to see if the applicants are experienced. So, my question is: do you think should a good ? I'd also see it as a for myself, in order to see where my own deficits are . ![alt text](https://i.imgur.com/Xo2yI.png) *UPDATE: It want to make clear that we're not testing only for .NET knowledge, and that problem solving capabilities and general programming skills are even more important to us.
Questions every good .NET developer should be able to answer?
CC BY-SA 3.0
0
2008-12-13T17:47:33.777
2012-12-24T10:32:14.610
2012-12-24T10:32:14.610
13,249
6,461
[ ".net" ]
365,935
1
null
null
8
7,507
All of my methods are failing me in various ways. different lighting can mess it all up too. has anyone every trying to return a name given a rgb value? "red" "green" "blue" would be enough to satisfy my needs for today. i have unsafe byte processing of images from my web cam. [](https://i.stack.imgur.com/ptjtc.png) ![colors](https://upload.wikimedia.org/wikipedia/commons/thumb/5/55/Color_star-en.svg/646px-Color_star-en.svg.png)
trying to convert rgb from a .net Color to a string such as "red" or "blue"
CC BY-SA 4.0
0
2008-12-13T23:33:32.253
2022-12-07T09:53:04.547
2019-02-22T23:02:29.613
4,751,173
146,637
[ "c#", ".net", "image", "colors", "system.drawing.color" ]
374,198
1
null
null
3
4,858
I have been using SVN with Eclipse for ages without problems. But suddenly, one project is not working properly, even though others are fine. When I try to update I get this: ![alt text](https://i32.photobucket.com/albums/d22/d000hg/SVNissue.png) In the Eclipse log I see: U > nsupported working copy format svn: This client is too old to work with working copy 'C:\Work\xxxxxxxxxxxx\client'; please get a newer Subversion client Any ideas? I can't see how to update the SVN plugin even if it is too old...
SVN Update problem in Eclipse
CC BY-SA 2.5
null
2008-12-17T10:43:31.183
2008-12-17T17:01:49.750
2017-02-08T14:09:25.830
-1
13,220
[ "svn", "eclipse-plugin" ]
375,320
1
375,397
null
0
3,963
![Screenshot of Drop Down](https://farm4.static.flickr.com/3200/3116366800_570cc971b9_m.jpg) This would be my issue I have a drop down that's not displaying fully. I'm not sure even where to start so here's the HTML surronding the drop down and I'll provide the CSS also. HTML ``` <div id="add_item"> <ul class="vert"> <li> <ul class="horz"> <li class="name"> <select style="width: 195px; padding: 0px; margin: 0px;" disabled="disabled"> <option value=""></option> <option value="0">0</option> </select> </li> <li class="quantity"> <select style="width: 50px; padding: 0px; margin: 0px;" disabled="disabled"> <option value=""></option> <option value="0">0</option> </select> </li> </ul> </li> </ul> </div> ``` The reason the code has the drop down as being disabled is because it's dynamic, the surrounding HTML is the same except for having options to choose from and no longer being disabled. CSS ``` div#byitem ul.horz li.name { background:transparent none repeat scroll 0 0; display:block; font-size:11px; font-weight:bold; width:195px; } div#byitem ul.horz { background:transparent none repeat scroll 0 0; clear:left; list-style-type:none; margin:0; padding:0; } div#byitem ul.vert li { background:transparent none repeat scroll 0 0; height:14px; margin:0; padding:0; } div#byitem ul.vert { background:transparent none repeat scroll 0 0; list-style-type:none; margin:0; padding:0; width:540px; } element.style { margin-bottom:0; margin-left:0; margin-right:0; margin-top:0; padding-bottom:0; padding-left:0; padding-right:0; padding-top:0; width:195px; } #content form select { margin:0 0 4px 4px; z-index:1; } html, body, div, p, form, input, select, textarea, fieldset { -x-system-font:none; color:#333333; font-family:Arial,Helvetica,Verdana,sans-serif; font-size:11px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal; line-height:15px; } * { margin:0; padding:0; } ``` Thanks for any suggestions. # Edit I've added the CSS for the divs that the drop downs are contained in. Also changing the line height doesn't make a difference. The only difference between the two drop downs (Item and Quantity) is the width. Changing the width on Item doesn't make a difference. Took out the Add another item link as that was suspected to be a problem no change. Also I am doing my development in Firefox I just posted the screenshot from Safari.
Drop Down Box Not Fully Displayed (All Browsers)
CC BY-SA 2.5
null
2008-12-17T17:26:12.883
2008-12-31T02:45:57.420
2020-06-20T09:12:55.060
-1
657
[ "css", "drop-down-menu" ]
376,642
1
376,673
null
12
13,445
I'm not really sure how to title this question but basically I have an interface like this: ``` public interface IFoo { string ToCMD(); } ``` a couple of absract classes which implement IFoo like: ``` public abstract class Foo : IFoo { public abstract string ToCMD(); } public abstract class Bar : IFoo { public abstract string ToCMD(); } ``` then classes which inherit Foo and Bar: ``` public class FooClass1 : Foo { public override string ToCMD() {return "Test";} } ///there are about 10 foo classes. public class BarClass : Bar { public override string ToCMD() {return "BarClass";} } ///about the same for bar classes. ``` I am doing this so that when I have my custom list like: ``` public class Store<T> : List<T> where T : IFoo {} ``` I then can restrict the types that go in it but by having the interface it will still take any type of IFoo. Something like: ``` Store<Foo> store = new Store<Foo>(); //Only Foo types will work. store.Add(new FooClass1()); //Will compile. Store<IFoo> store = new Store<IFoo>(); //All IFoo types will work. store.Add(new FooClass1()); //Will compile. store.Add(new BarClass()); //Will compile. ``` My question is: Is this an ok way of going about this? or is there a better way? EDIT: Picture-> ![alt text](https://i.stack.imgur.com/RqPPj.jpg)
Inheritance design using Interface + abstract class. Good practice?
CC BY-SA 3.0
0
2008-12-18T01:34:52.380
2015-06-19T20:13:55.953
2015-06-19T20:13:55.953
1,159,643
6,335
[ "c#", "oop", "inheritance" ]
382,006
1
382,162
null
66
43,758
I'm creating a WPF application where several ListView selections are made in a row (similar to the iTunes browser). The problem is that the default inactive selection color is too light. (see below) ![Default inactive selection color (too light)](https://i.stack.imgur.com/hwctc.jpg) How can I change this color so my inactive listview looks like this? (see below) ![Inactive and active selection colors the same](https://i.stack.imgur.com/aORZ9.jpg) ## Solution Override the default SystemColor with a `Style` like so: ``` <Style TargetType="ListViewItem"> <Style.Resources> <SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static SystemColors.HighlightColor}"/> </Style.Resources> </Style> ```
WPF ListView Inactive Selection Color
CC BY-SA 3.0
0
2008-12-19T19:43:55.987
2022-04-16T17:41:40.033
2015-04-01T05:14:34.390
317
317
[ "wpf", "listview", "selection" ]
383,921
1
383,926
null
6
257
I have the types `Rock`, `Paper`, and `Scissors`. These are components, or "hands" of the Rock, Paper, Scissors game. Given two players' hands the game must decide who wins. How do I solve the problem of storing this chain chart ![Rock, Paper, Scissors chart](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e6/Rock_paper_scissors.jpg/250px-Rock_paper_scissors.jpg) without coupling the various hands to each other? The goal is to allow adding a new hand to the game (Jon Skeet, for instance) without changing any of the others. I am open to any idea of proxies, but not to large switch statements or duplication of code. For instance, introducing a new type that manages the chain's comparisons is fine as long as I don't need to change it for every new hand I add. Then again, if you can rationalize having a proxy that must change for every new hand or when a hand changes, that is welcome as well. This is sort of a Design 101 problem, but I am curious what solutions people can come up with for this. Obviously, this problem can easily scale to much larger systems with many more components with any arbitrarily complex relationships among them. That's why I'm laying a very simple and concrete example to solve. Any paradigm used, OOP or otherwise, is welcome.
Eliminating coupling out of classes that have strong conceptual bonds with each other
CC BY-SA 2.5
0
2008-12-21T00:10:28.037
2008-12-21T02:40:36.970
2017-02-08T14:09:29.237
-1
456
[ "language-agnostic" ]
386,438
1
386,478
null
6
2,995
Avast there fellow programmers! I have the following problem: I have two rectangles overlapping like shown on the picture below. ![alt text](https://farm4.static.flickr.com/3249/3128407236_d0e63a1b31.jpg) I want to figure out the polygon consisting of point ABCDEF. Alternate christmas description: The red cookie cutter is cutting away a bit of the black cookie. I want to calculate the black cookie. Each rectangle is a data structure with 4 2d-vertices. What is the best algorithm to achieve this?
Boolean operations on rectangle polygons
CC BY-SA 2.5
null
2008-12-22T15:00:26.103
2008-12-22T15:26:13.367
2017-02-08T14:09:29.563
-1
37,346
[ "c++", "algorithm", "geometry", "boolean" ]
388,677
1
820,410
null
34
43,056
I have a multi-browser page that shows vertical text. As an ugly hack to get text to render vertically in all browsers I've created a custom page handler that returns a PNG with the text drawn vertically. Here's my basic code (C#3, but small changes to any other version down to 1): ``` Font f = GetSystemConfiguredFont(); //this sets the text to be rotated 90deg clockwise (i.e. down) StringFormat stringFormat = new StringFormat { FormatFlags = StringFormatFlags.DirectionVertical }; SizeF size; // creates 1Kx1K image buffer and uses it to find out how bit the image needs to be to fit the text using ( Image imageg = (Image) new Bitmap( 1000, 1000 ) ) size = Graphics.FromImage( imageg ). MeasureString( text, f, 25, stringFormat ); using ( Bitmap image = new Bitmap( (int) size.Width, (int) size.Height ) ) { Graphics g = Graphics.FromImage( (Image) image ); g.FillRectangle( Brushes.White, 0f, 0f, image.Width, image.Height ); g.TranslateTransform( image.Width, image.Height ); g.RotateTransform( 180.0F ); //note that we need the rotation as the default is down // draw text g.DrawString( text, f, Brushes.Black, 0f, 0f, stringFormat ); //make be background transparent - this will be an index (rather than an alpha) transparency image.MakeTransparent( Color.White ); //note that this image has to be a PNG, as GDI+'s gif handling renders any transparency as black. context.Response.AddHeader( "ContentType", "image/png" ); using ( MemoryStream memStream = new MemoryStream() ) { image.Save( memStream, ImageFormat.Png ); memStream.WriteTo( context.Response.OutputStream ); } } ``` This creates an image that looks how I want it to, except that the transparency is index based. As I'm returning a PNG it could support a proper alpha transparency. Is there any way to do this in .net? --- Thanks to Vlix (see comments) I've made some changes, though it still isn't right: ``` using ( Bitmap image = new Bitmap( (int) size.Width, (int) size.Height, PixelFormat.Format32bppArgb ) ) { Graphics g = Graphics.FromImage( (Image) image ); g.TranslateTransform( image.Width, image.Height ); g.RotateTransform( 180.0F ); //note that we need the rotation as the default is down // draw text g.DrawString( text, f, Brushes.Black, 0f, 0f, stringFormat ); //note that this image has to be a PNG, as GDI+'s gif handling renders any transparency as black. context.Response.AddHeader( "ContentType", "image/png" ); using ( MemoryStream memStream = new MemoryStream() ) { //note that context.Response.OutputStream doesn't support the Save, but does support WriteTo image.Save( memStream, ImageFormat.Png ); memStream.WriteTo( context.Response.OutputStream ); } } ``` Now the alpha appears to work, but the text appears blocky - as if it still has the jaggie edges but against a black background. Is this some bug with .Net/GDI+? I've already found that it fails for even index transparencies for gifs, so I don't have much confidence it it. This image shows the two ways this goes wrong: ![vertical text comparison](https://i.stack.imgur.com/ONFOT.png) The top image shows it with no white background or `MakeTransparent` call. The second with the background filled with white and then `MakeTransparent` called to add the index transparency. Neither of these is correct - the second image has white aliasing jaggies that I don't want, the first appears to be solidly aliased against black.
Can you make an alpha transparent PNG with C#?
CC BY-SA 3.0
0
2008-12-23T11:38:11.767
2017-08-13T08:17:47.540
2017-08-13T08:17:47.540
4,220,785
905
[ "c#", ".net", "gdi+" ]
388,814
1
8,774,756
null
51
95,070
What is best way to show Date Picker for iPhone based Web Application. Can we show something like iPhone native date picker like shown below in web application: ![iOS Date Picker](https://i.stack.imgur.com/ms5tX.png)
Date Picker for iPhone Web Application
CC BY-SA 3.0
0
2008-12-23T12:59:17.267
2017-11-10T10:05:58.437
2017-09-06T12:35:13.460
6,015,101
191
[ "datepicker", "iphone" ]
389,825
1
389,830
null
15
35,551
I am trying to recreate something similar to the popup keyboard used in safari. ![alt text](https://dl.getdropbox.com/u/22784/keyboardToolbar.png) I am able to visually reproduce it by placeing a toolbar over my view and the appropriate buttons, however i cant figure out any way to dismiss the keyboard once the user has touched the done button.
Dismiss iphone keyboard
CC BY-SA 2.5
0
2008-12-23T19:25:43.400
2013-06-18T23:14:24.117
2012-12-27T08:36:21.370
1,371,853
8,918
[ "iphone", "cocoa-touch", "iphone-softkeyboard" ]
395,195
1
null
null
24
6,838
i'm trying to figure out how to layout a simple dialog in WPF using the proper (DLUs). --- > ## What's a dialog unit? A dialog is a unit of measure based on the user's preferred font size. A dialog unit is defined such that the is 4 dialog units wide by 8 dialog units high:![enter image description here](https://i.stack.imgur.com/yRvvQ.png)This means that dialog units:- - - --- i spent about two hours dimensioning this sample dialog box from Windows Vista with the various measurements. Can someone please give the corresponding XAML markup that generates this dialog box? [](https://i.stack.imgur.com/PgNaP.png) ([Image Link](http://i44.tinypic.com/30a7390.jpg)) Now admittedly i know almost nothing about WPF XAML. Every time i start, i get stymied because i cannot figure out how to place any control. It seems that everything in WPF must be contained on a panel of some kind. There's StackPanels, FlowPanels, DockPanel, [Grid](http://msdn.microsoft.com/en-us/library/system.windows.controls.grid.aspx), etc. If you don't have one of these then it won't compile. The only XAML i've been able to come up with (uing XAMLPad) so far: ``` <DockPanel xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Image Width="23" /> <Label>Are you sure you want to move this file to the Recycle Bin?</Label> <Image Width="60" /> <Label>117__6.jpg</Label> <Label>Type: ACDSee JPG Image</Label> <Label>Rating: Unrated</Label> <Label>Dimensions: 1072 × 712</Label> <Button Content="Yes" Width="50" Height="14"/> <Button Content="Cancel" Width="50" Height="14"/> </DockPanel> ``` Which renders as a gaudy monstrosity. None of the controls are placed or sized right. i cannot figure out how to position controls in a window, nor size them properly. Can someone turn that screenshot into XAML? You're not allowed to measure the screenshot. All the Dialog Unit (dlu) widths and heights are specified. 1 horizontal DLU != 1 vertical DLU. Horizontal and vertical DLUs are different sizes. --- # See also - [WPF applications that adjust to screen and font settings (Or, How would I relate DLUs to units in WPF?)](https://stackoverflow.com/questions/1425509/wpf-applications-that-adjust-to-screen-and-font-settings-or-how-would-i-relate)- [WPF global font size](https://stackoverflow.com/questions/893428/wpf-global-font-size)- [WPF buttons same/recommended width](https://stackoverflow.com/questions/2658511/wpf-buttons-same-recommended-width)- [WPF version of .ScaleControl?](https://stackoverflow.com/questions/6403918/wpf-version-of-scalecontrol)- [Microsoft User Experience Guidelines: Recommended sizing and spacing](http://msdn.microsoft.com/en-us/library/aa511279.aspx#sizingspacing)- [Microsoft User Experience Guidelines: Layout Metrics](http://msdn.microsoft.com/en-us/library/bb847924.aspx) 6/20/2011
WPF: How to specify units in Dialog Units?
CC BY-SA 4.0
0
2008-12-27T17:37:23.037
2019-02-24T05:00:48.283
2019-02-24T05:00:48.283
4,751,173
12,597
[ "wpf", "windows", "xaml", "dpi" ]
396,789
1
396,794
null
16
1,323
Is it acceptable to add "special," but unnecessary, content based on a user's web browser? For example, is it okay to display this: ![******.com works better with modern browsers like Firefox](https://farm4.static.flickr.com/3207/3145519128_af9b4ed2f7.jpg) at the top of my webpage for all IE users?
Is Web Browser "Discrimination" Okay?
CC BY-SA 2.5
0
2008-12-28T22:39:04.753
2015-01-15T15:53:08.700
2017-02-08T14:09:34.630
-1
1,615
[ "browser" ]
398,299
1
398,302
null
177
102,258
A friend was in need of an algorithm that would let him loop through the elements of an NxM matrix (N and M are odd). I came up with a solution, but I wanted to see if my fellow SO'ers could come up with a better solution. I'm posting my solution as an answer to this question. For a 3x3 matrix, the output should be: (0, 0) (1, 0) (1, 1) (0, 1) (-1, 1) (-1, 0) (-1, -1) (0, -1) (1, -1) ![3x3 matrix](https://i.stack.imgur.com/kjR4H.png) Furthermore, the algorithm should support non-square matrices, so for example for a 5x3 matrix, the output should be: (0, 0) (1, 0) (1, 1) (0, 1) (-1, 1) (-1, 0) (-1, -1) (0, -1) (1, -1) (2, -1) (2, 0) (2, 1) (-2, 1) (-2, 0) (-2, -1) ![5x3 matrix](https://i.stack.imgur.com/NE82F.png)
Looping in a spiral
CC BY-SA 3.0
0
2008-12-29T18:40:29.320
2021-09-02T19:03:12.903
2017-06-27T14:46:12.873
100,297
2,119
[ "algorithm", "matrix", "loops", "spiral" ]