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
400,130
1
400,179
null
27
26,244
Let's say I have a class that implements the interface. Something like this: ![http://www.flickr.com/photos/garthof/3149605015/](https://farm4.static.flickr.com/3199/3149605015_f090f20185_o.png) uses some unmanaged resources, hence the method from releases those resources. should be used like this: ``` using ( MyClass myClass = new MyClass() ) { myClass.DoSomething(); } ``` --- Now, I want to implement a method that calls asynchronously. I add a new method to : ![http://www.flickr.com/photos/garthof/3149605005/](https://farm4.static.flickr.com/3103/3149605005_bde86e4e0b_o.png) Now, from the client side, should be used like this: ``` using ( MyClass myClass = new MyClass() ) { myClass.AsyncDoSomething(); } ``` However, if I don't do anything else, this could fail as the object might be disposed before is called (and throw an unexpected ). So, the call to the method (either implicit or explicit) should be delayed until the asynchronous call to is done. I think the code in the method should be executed . I'd like to know which could be the best way to accomplish this. Thanks. [Dispose pattern](http://msdn.microsoft.com/en-us/library/fs2xkftw(VS.80).aspx) --- Thank you so much for your responses. I appreciate your effort. As [chakrit](https://stackoverflow.com/users/3055/chakrit) [has commented](https://stackoverflow.com/questions/400130/how-to-dispose-asynchronously#400165), I need that . Ideally, something like this should work fine: ``` using ( MyClass myClass = new MyClass() ) { myClass.AsyncDoSomething(); myClass.AsyncDoSomething(); } ``` I'll study the counting semaphore, it seems what I'm looking for. It could also be a design problem. If I find it convenient, I will share with you some bits of the real case and what really does.
How to dispose asynchronously?
CC BY-SA 2.5
0
2008-12-30T12:14:26.133
2021-08-11T12:41:24.117
2017-05-23T12:01:33.300
-1
1,679
[ "c#", "asynchronous", "dispose" ]
401,024
1
401,031
null
1
2,552
Short of inserting a try/catch block in each worker thread method, is there a way to deal with unhandled, non-ui thread, exceptions in Windows Forms? `Thread.GetDomain().UnhandledException` works great for catching the error, but by then it's too late to do anything about it (besides log it). After control passes out of your `UnhandledException` handler the application will terminate. The best you can hope for is a generic Windows error that looks this: ![http://i40.tinypic.com/2be98i.jpg](https://i.stack.imgur.com/8kxgl.jpg) All my research indicates that you insert a try/catch block in the worker thread method, but I wanted to put this out there in case anyone had a different take. Thanks.
Unhandled, non-ui thread, exceptions in Windows Forms
CC BY-SA 3.0
null
2008-12-30T18:18:19.723
2013-07-19T15:04:34.763
2013-07-19T15:04:34.763
2,556,654
20,700
[ "c#", ".net", "winforms", "multithreading" ]
409,259
1
null
null
180
163,836
I'm trying to do that for a couple of days now, and after reading tons of messages of people trying to do that too, I'm still unable to have a fully working `UITextField` in some of my `UITableViewCells`, just like in this example: ![Screenshot](https://i.stack.imgur.com/gD4cE.png) Either I have the form working but the text is not visible (although I set its color to blue), the keyboard goes on the field when I click on it and I haven't been able to correctly implement the keyboard events. I tried with a bunch of examples from Apple (mainly `UICatalog`, where there is a kinda similar control) but it's still not working correctly. Can somebody help me (and all the people trying to realize this control) and post a simple implementation of a `UITextField` in a `UITableViewCell`, that works fine?
Having a UITextField in a UITableViewCell
CC BY-SA 3.0
0
2009-01-03T16:01:16.600
2019-05-09T17:40:46.157
2016-04-04T15:07:49.280
5,580,988
50,090
[ "ios", "objective-c", "uitableview", "cocoa-touch", "uitextfield" ]
410,593
1
null
null
43
106,549
I would like to clarify the differences between by value and by reference. I drew a picture: ![Enter image description here](https://i.stack.imgur.com/fNEsL.jpg) So, for passing by value, a copy of an identical object is created with a different reference, and the local variable is assigned the new reference, so to point to the new copy How should I understand the following? > If the function modifies that value, the modifications appear also within the scope of the calling function for both passing by value and by reference
Pass by reference and value in C++
CC BY-SA 4.0
0
2009-01-04T07:08:36.037
2022-08-16T13:54:40.280
2022-08-16T13:54:40.280
63,550
36,064
[ "c++", "pass-by-reference", "pass-by-value" ]
412,427
1
null
null
196
805,691
We always write code like this formal: ``` void main(){ if(){ if() } ``` ![Alt text](https://i.stack.imgur.com/dPV7i.jpg) But when I use [Notepad++](http://en.wikipedia.org/wiki/Notepad%2B%2B), the display is: ``` void main(){ if(){ if() } ``` ![Alt text](https://i.stack.imgur.com/1T37o.jpg) How do I use Notepad++ to auto indent? Thanks to [Jonathan](https://stackoverflow.com/a/412449/325514), I have set it, but it does not take any effect. The snapshot is below: ![Alt text](https://i.stack.imgur.com/1jOZS.jpg) I am using Notepad++ version 5.1.3.
Auto-indent in Notepad++
CC BY-SA 3.0
0
2009-01-05T06:36:28.643
2021-12-20T08:43:14.690
2017-05-23T12:34:27.447
-1
51,539
[ "notepad++", "indentation", "code-formatting" ]
413,876
1
422,873
null
0
322
### Boring introduction: In my workplace, we have a very old WinForms product (in market since 1994, and still running on VB3). It has three very different versions, each of them goes to one client. The clients pass it on to their users, some of which are shared. The versions can live side-by-side. Five years ago, we rewrote one of those versions in C#.Net. Two years later, another version (let's call it version M) was rewritten, and two years after that, it was time for the last remaining version (let's call it version C) to be converted. We've been working for one year, and are going to production this week. During the conversions, it has been decided not to convert anything that was sold as an external module; these were built in VB6, and they used several controls from [BeCubed](http://www.becubed.com/index.htm) and [FarPoint](http://www.fpoint.com/). There are two such modules in version M, and three modules in version C. Each module has it's own MSI installer, which is run quietly by the main product's installer. ### The bug During production, we found a bug: when version C in installed on a fresh computer, then version M is installed, we get a message as soon as an external module is opened in version C: ![BeCubed error](https://lh3.ggpht.com/_L2AGN2rr3tM/SWJBoWNPcVI/AAAAAAAACaA/pPNTMywh4Gw/BeCubed.PNG) After clicking Ok, the module works. Also, this doesn't happen when they are installed in any other order and both modules in version M work perfectly. ### Other details - - - --- Does anyone know what could cause such an error, what could be a possible solution?
Licensing error message with BeCubed 6
CC BY-SA 2.5
null
2009-01-05T17:32:12.923
2018-09-19T14:01:22.050
2017-02-08T14:09:38.650
-1
9,536
[ "c#", "licensing", "versioning" ]
414,137
1
null
null
0
3,402
I'm a bit confused with this one. I have a Dataset with a BackupDate and a BackupTime as well as a BackupType. The BackupDate is comprised of 12 characters from the left of a datetime string within a table. The BackupTime is comprised of 8 characters from the right of that same datetime string. So for example: BackupDate would be 'December 12 2008' and the BackupTime would be '12:53PM.' I have added an XY-scatter chart to the report. I've added a 'series' value for the BackupType (so one can distinguish between a Full/Incr/Log backup). I've added a category value of BackupDate and set the Scale for the X-axis from the Min of BackupDate to the Max of BackupDate. I've then added an item to the Values with the Y variable set to BackupTime and the X variable set to BackupDate. The interval for the Y-axis is 12:00AM to 11:59PM and the formatting for the labels is 'hh:mmtt'. The BackupTime matches the format of the Y-axis. The BackupDate matches the format of the X-axis. 10 entries are retrieved by my Dataset and the Legend is properly populated by the BackupType field. No points are being plotted on the graph and no markers/pointers are shown if they are enabled. There should be a point on the graph for every point in time of each day there is a backup of a specific type. Am I missing something? Does anyone know of a good tutorial dealing specifically with XY-scatter graphs and using them in a way I intend? I am using the 2005 version of SSRS rather than the 2008 version. Screenshot of what my chart currently looks like: ![](https://img.photobucket.com/albums/v376/MythOpus/chart.jpg) In case it could be dataset related: ``` SELECT TOP (10) backup_type, LTRIM(RTRIM(LEFT(backup_finish_date, 12))) AS BackupDate, LTRIM(RTRIM(RIGHT(backup_finish_date, 8))) AS BackupTime FROM DBARepository.Backup_History ``` As requested, here are the results of this query. There is a Where clause to constrain the results to a specific database of a specific server that was not included in the above SQL Query.
XY-Scatter Chart In SSRS Won't Display Points
CC BY-SA 2.5
null
2009-01-05T19:05:26.150
2010-07-04T16:00:05.743
2017-02-08T14:09:38.990
-1
null
[ "reporting-services", "charts", "reporting", "graphing" ]
414,470
1
414,567
null
2
448
I have a submit button that is a block of HTML code because of styling and images to make it look better. (I stole most of it from Wufoo). This is one every form in the application and I was wondering if there is a cleaner way to do this. Something like a partial or helper? The name of the button "Submit" or "Add Contact" needs to be a variable. # snippet ![](/images/icons/tick.png) Add Contact #variable text ![](/images/icons/cross.png) Back * Required
Rails: Creating an HTML Snippet with a Variable?
CC BY-SA 2.5
null
2009-01-05T20:49:58.110
2009-01-05T21:18:36.693
2020-06-20T09:12:55.060
-1
10,258
[ "ruby-on-rails" ]
414,553
1
null
null
15
8,549
From the outset, collision detection feels like it is an O(n^2) problem. You have a bunch of objects and you need to check if each object is colliding with any of the other objects. However, I know that it is wildly ineffecient to check each object against all the other objects. Why do a relatively expensive collision check between two balls if they aren't even close to eachother? Here is example of my simple program I'm working on: ![alt text](https://i.stack.imgur.com/H7T2o.jpg) If you have 1000 balls then if you went with the naive collision detection you would have 1000^2 collection checks (a million)! This collision checking has quickly become the bottleneck in my application. I to implement some broad phase pruning. What techniques should be used to prune collision checks when working with 2d - circular objects? I've read about QuadTrees, BSP, spatial hashing, etc but it is difficult to sort out what method is most appropriate to this use case. Does anyone have any knowledge about what might work best?
What technique should be used to prune 2d collision checks?
CC BY-SA 3.0
0
2009-01-05T21:14:12.567
2019-04-18T13:56:49.623
2015-06-19T20:18:07.187
1,159,643
2,635
[ "data-structures", "collision-detection", "spatial", "broad-phase" ]
419,964
1
420,084
null
1
1,664
In interface builder i've created a UITextfield within a subclass of a UITableViewCell. The default font is just too small. If I make it bigger in interface builder it looks a bit ugly. Not as crisply rendered. I'd like a font similar to that used in the addressBook application when you edit a contact. The text their is bigger than the default and display nice. Anyone got a good font/style/size? And I should set this in IB right? The UITextfield class states: @property(nonatomic,retain) UIFont *font; // default is nil. use system font 12 pt Does this mean they only want you to use size 12? Thanks! ![alt text](https://farm4.static.flickr.com/3494/3175998957_a6c65faf91.jpg?v=0)
Larger alternative to default UITextfield font that looks GOOD
CC BY-SA 2.5
null
2009-01-07T11:29:07.210
2009-01-07T12:14:12.003
2017-02-08T14:09:41.033
-1
51,420
[ "iphone", "cocoa-touch", "interface-builder" ]
421,968
1
422,561
null
16
13,831
I need to create a transparent blurred background. Lets suppose I have a border with a white blurry transparent background. Everything that is behind the border is blurred. I'm trying to avoid dependencies; I'm currently using .NET 3.0, and want it to run with XP too. Mockup image: ![Mockup Image](https://i.stack.imgur.com/rmKkp.png)
blurred opacity
CC BY-SA 2.5
0
2009-01-07T20:37:12.407
2016-05-27T08:45:58.423
2011-04-03T16:19:05.607
1,569
1,013
[ "wpf", ".net-3.0" ]
424,927
1
450,178
null
16
2,252
I've been developing a very large LOB app using my flavor of M-V-VM which I call M-V-MC (Model-View-ModelController), which is a kind of a combination between M-V-C and M-V-VM. I had posted [this answer](https://stackoverflow.com/questions/322612/what-are-the-most-common-mistakes-made-in-wpf-development#322679) regarding how views get instantiated in M-V-VM to the question "[what-are-the-most-common-mistakes-made-in-wpf-development](https://stackoverflow.com/questions/322612/what-are-the-most-common-mistakes-made-in-wpf-development)". [Sam](https://stackoverflow.com/users/7021/sam) made the following comment regarding my answer: > This creates a follow-up-question: how do you create the views? I use RelayCommands to bind actions from the view to the ViewModel, so the view does not even know an action has fired, does not know he should open a new view. Solution: create an event in the VM for the View to subscribe to? When I originally started M-V-VM development I had this notion that EVERYTHING should live in the ViewModel, and have studied a lot of examples from guys like [Josh Smith](http://joshsmithonwpf.wordpress.com/) and [Karl Shifflett](http://karlshifflett.wordpress.com/). However I have yet to come up with a good example of when a command needs to live in the ViewModel. For instance, let's say I have a ListView that displays Customers, and a button that I click to allow me to edit the currently selected customer. The ListView (View) is bound to a CustomerVM (ViewModel). Clicking the button fires the EditCustomerCommand which opens a popup window which allows me to edit all the properties of the CustomerVM. Where does this EditCustomerCommand live? If it involves opening a window, (UI functionality), shouldn't it be defined in the code-behind of the view? ![alt text](https://codingcontext.files.wordpress.com/2009/01/commandflow.png) Does anyone have any examples of when I should define a command in the View versus the ViewModel? [Matthew Wright](https://stackoverflow.com/users/47006/matthew-wright) states below: > New and delete from a list would be good examples. In those cases, a blank record is added or the current record is deleted by the ViewModel. Any action taken by the view should be in response to those events occurring. So if I click the new button, what happens? A new instance of the CustomerVM is created by the Parent ViewModel and added to it's collection right? So how then would my editing screen get opened? The view should create a new instance of the Customer ViewModel, and pass it in to the ParentVM.Add(newlyCreatedVM) method right? Let's say I delete a customer record via the DeleteCommand living on the VM. the VM calls into the business layer and tries to delete the record. It can't so it returns a message to the VM. I want to display this message in dialogbox. How does the view get the message out of the command action?
M-V-VM - Any Examples of using commands in the ViewModel?
CC BY-SA 2.5
0
2009-01-08T16:30:11.580
2009-01-16T13:53:36.387
2017-05-23T12:33:39.607
-1
17,744
[ "wpf", "mvvm" ]
425,803
1
426,135
null
2
1,833
I am trying to use Windows Workflow and have a model that looks similar to the image in the link below: ![Workflow screen shot](https://i.stack.imgur.com/NK4tR.jpg) After each of the Send Activities (`GetSomthing`, `GetSomthingElse`, `GetSomeMoreStuff`) the same custom activity is being called (`LogSomthingBadHappened`). While it might not look so bad in this picture in my real model the custom activity is a SequenceActivty, has quite a few nodes, and when its repeated 3 times starts to make the workflow look very ugly. I would like to do something like this: ![Edited Workflow screen shot](https://i.stack.imgur.com/ZSoYU.jpg) Can the `IfElse` branches be merged like this? Should I be using a State Machine work flow instead (haven't figured these out yet)?
Windows Workflow - IfElse branch
CC BY-SA 3.0
null
2009-01-08T20:37:37.507
2011-11-20T05:00:11.813
2011-11-20T05:00:11.813
331,508
47,608
[ "workflow", "workflow-foundation" ]
427,848
1
427,881
null
3
4,324
I have to code a simple control in .Net that draws geometry that looks like following image and the geometry doesn't get any more complex than shown in this image, i.e. it will be a few filled polygons and some dashed lines. This is not a static image however, that is drawn once and forgotten. The dimensions of the geometry can be changed by the user which will have to be reflected in the drawing by updating it. ![alt text](https://i.stack.imgur.com/71rUA.jpg) My senior says I should use WPF for drawing. My question is whether WPF is overkill for this kind of work and will System.Drawing suffice?
WPF v/s System.Drawing
CC BY-SA 3.0
0
2009-01-09T12:08:47.357
2015-06-19T20:21:40.310
2015-06-19T20:21:40.310
1,159,643
25,125
[ ".net", "wpf", "system.drawing" ]
429,718
1
null
null
6
1,248
How hard would it be to take an image of an object (in this case of a predefined object), and develop an algorithm to cut just that object out of a photo with a background of varying complexity. Further to this, a photo's object (say a house, car, dog - but always of one type) would need to be transformed into a 3d render. I know there are 3d rendering engines available (at a cost, free, or with some clause), but for this to work the object (subject) would need to be measured in all sorts of ways - e.g. if this is a person, we need to measure height, the curvature of the shoulder, radius of the face, length of each finger, etc. What would the feasibility of solving this problem be? Anyone know any good links specialing in this research area? I've seen open source solutions to this problem which leaves me with the question of the ease of measuring the object while tracing around it to crop it out. Thanks --- Essentially I want to take a 2d image (typical image:which is easier than a complex photo containing multiple objects, etc.) ![http://benmartin3d.com/WIP/Project1/image1small.jpg](https://i.stack.imgur.com/Z736K.jpg) , But effectively I want to turn that into a 3d image, so wouldn't what I want to do involve building a 3d rendering/modelling engine? Furthermore, that link I have provided goes into 3ds max, with a few properties set, and a render is made.
Image recognition and 3d rendering
CC BY-SA 3.0
0
2009-01-09T21:00:06.627
2013-09-01T03:39:58.977
2013-09-01T03:39:58.977
1,288
32,484
[ "algorithm", "image-recognition", "3d-rendering" ]
432,349
1
432,924
null
24
18,341
I'm using [LaTeX](http://www.latex-project.org/)'s "[listings](http://en.wikibooks.org/wiki/LaTeX/Packages/Listings)" package to format source code. Unfortunately I get curly quotes instead of straight quotes. Since the curly quotes don't always point in the right direction, it looks bad. How can I get straight quotes instead? I'd prefer not to change or filter the source code itself. Filtering the code to properly change " to `` or '' would work, but this is easier done than said with multiple quotes on a line, or quotes spanning multiple lines. Or you could use symbol or a host of other things. But I'd really like to keep the source unchanged. Example LaTeX: ``` \documentclass{article} \usepackage{listings} \begin{document} \begin{lstlisting} Fahrenheit=input("What is the Fahrenheit temperature?") Celsius=(5.0/9.0)*(Fahrenheit-32) print"The temperature is",Celsius,"degrees Celsius" \end{lstlisting} \end{document} ``` Example output (using [Miktex](http://miktex.org/) on windows): ![Image of source code](https://farm4.static.flickr.com/3450/3186136899_306b443283_o.png) ([Direct link to image of incorrect output](https://farm4.static.flickr.com/3450/3186136899_306b443283_o.png))
How do you display straight quotes instead of curly quotes when using LaTeX's 'listings' package?
CC BY-SA 2.5
0
2009-01-11T04:25:29.350
2018-09-12T09:47:40.893
2017-02-08T14:09:43.067
-1
49,404
[ "latex", "miktex" ]
435,925
1
436,052
null
28
15,413
Each item in a WPF ListBox control seems to have a bit of left padding. How can I restyle to remove all padding? ![Default Comparison](https://liijba.blu.livefilestore.com/y1pCGMhr_GaDEKJd4JWaVbyA-zXDL_IaGHOYsXQBPYFlihFt_eVmW9DX1EucSipT3nMygvki6UIDga_YLowF7vNmQ/ListBoxPadding.png)
Remove all left padding from WPF ListBox
CC BY-SA 2.5
0
2009-01-12T16:15:13.283
2011-09-27T15:14:46.210
2017-02-08T14:09:43.400
-1
38,309
[ "c#", "wpf" ]
441,038
1
441,050
null
2
14,682
I get this error when debugging my ASP.NET web application after I trigger an UpdatePanel: ![ASP.NET htmlfile: Unknown runtime error updatePanelElement.innerHTML=rendering](https://i.stack.imgur.com/CqrGC.gif) htmlfile: Unknown runtime error and "updatePanelElement.innerHTML=rendering" is highlighted in a ScriptResource.axd file.
ASP.NET UpdatePanel Error htmlfile: Unknown runtime error, updatePanelElement.innerHTML=rendering
CC BY-SA 3.0
null
2009-01-13T22:11:58.570
2015-01-11T16:18:36.213
2015-01-11T16:18:36.213
964,243
83
[ "asp.net", "ajax", "updatepanel" ]
441,910
1
441,917
null
4
1,677
This is an exact duplicate of: [IE6 issues with transparent PNGs](https://stackoverflow.com/questions/130161/ie6-issues-with-transparent-pngs) --- Firefox:![alt text](https://i377.photobucket.com/albums/oo218/prakashrajgopal/FirefoxP.jpg) IE 6:![alt text](https://i377.photobucket.com/albums/oo218/prakashrajgopal/IEP.jpg) The background for the image is transparent. Yet IE seems to screw it up. Any ideas?
Firefox and IE rendering same image differently!
CC BY-SA 2.5
null
2009-01-14T04:31:16.840
2009-01-14T07:30:20.487
2017-05-23T10:29:31.030
-1
31,622
[ "internet-explorer", "image", "firefox", "rendering" ]
444,231
1
null
null
6
4,160
I am using Django's RSS capabilities to build an RSS feed. The `<description>` of the RSS feed items contains HTML markup. Currently, I am just injecting the HTML markup into the feed using the following template: ``` {{ obj.post }} ``` Django, of course, translates special characters (`<`, `>`, `&`, etc.) to their respective HTML entities. I know I could just output the HTML and wrap all the HTML code in `<![CDATA[...]]>` sections. [This page](http://cyber.law.harvard.edu/rss/encodingDescriptions.html) says that either method is acceptable. If that's true, is there a good reason to pick one method over the other? And if I use example #2, is there a filter for Django to automatically wrap the HTML text in CDATA tags, or should I just change my template to: ``` <![CDATA[ {{ obj.post|safe }} ]]> ``` --- # Edit It seems that Django autoescapes special characters in RSS feeds (or any XML for that matter) no matter what, regardless of whether you pass it through the `safe` filter or not (the issue is discussed in [this ticket](http://code.djangoproject.com/ticket/6533)). However, general answers are welcome.
What is the best way to embed HTML in an RSS feed?
CC BY-SA 2.5
0
2009-01-14T18:58:42.813
2012-05-01T08:51:27.760
2009-01-16T20:22:20.550
28,804
28,804
[ "html", "django", "rss" ]
446,000
1
449,733
null
2
1,429
I have a custom explorer bar (a band object) that hosts a webbrowser control. I can initialize the WebBrowser control properly and have it display web pages. However, I've noticed that when I resize the explorer bar, to the size of the bar: ## Before Resize: ![Before Resize](https://farm4.static.flickr.com/3347/3198030477_abd73d020b.jpg) ## After Resize: ![After Resize](https://farm4.static.flickr.com/3482/3198030475_952eceb19d.jpg) I'm not sure what events I need to handle and what can resize the browser control. I have some experience in .NET programming, and none really in Windows programming. I've also included my source code [here](http://rapidshare.com/files/183531789/ExplrBar.Cpp) if you would like to poke aorund it more.
Resizing a Webbrowser control hosted by an Explorer Bar in IE
CC BY-SA 4.0
null
2009-01-15T08:19:32.697
2019-01-30T19:30:09.170
2019-01-30T19:30:09.170
13,860
53,735
[ "c++", "windows", "internet-explorer", "webbrowser-control" ]
448,673
1
448,689
null
966
330,139
How do emulators work? When I see NES/SNES or C64 emulators, it astounds me. ![http://www.tommowalker.co.uk/snemzelda.png](https://i.stack.imgur.com/3BsOH.png) Do you have to emulate the processor of those machines by interpreting its particular assembly instructions? What else goes into it? How are they typically designed? Can you give any advice for someone interested in writing an emulator (particularly a game system)?
How do emulators work and how are they written?
CC BY-SA 3.0
0
2009-01-15T22:10:15.827
2013-06-11T16:00:35.517
2013-06-11T16:00:35.517
13,531
2,635
[ "emulation", "c64" ]
452,449
1
452,534
null
0
3,451
When I try to create a new Maintenance Plan in SQL Server, I get the following warning: > The action you attempted to perform on a remote instance of SQL Server has failed because the action requires a SQL Server component that is not installed on the remote computer. To proceed, install SQL Server 2005 Management Tools on the remote computer, and then try again. For more information, see "How to: Install SQL Server 2005 (Setup)" in SQL Server 2005 Books Online, or find the article on MSDN at [http://go.microsoft.com/fwlink/?LinkID=57083](http://go.microsoft.com/fwlink/?LinkID=57083) . (ObjectExplorer) However, the tools are installed, AFAIK. I'm connecting to the local machine. Here's a screenshot of both the error message alongside SQL Server telling me it won't install the management tools because they are already there. ![alt text](https://farm4.static.flickr.com/3399/3202696116_96acddb58a.jpg?v=0) (previous step [here](http://www.flickr.com/photos/lianza/3201848963/)) Any ideas?
SQL Complains that Management Tools are not installed, but they are
CC BY-SA 2.5
null
2009-01-16T23:45:20.717
2009-01-17T00:23:33.900
2017-02-08T14:09:46.787
-1
26,624
[ "sql-server", "sql-server-2005", "installation" ]
452,678
1
452,682
null
1
2,959
I would like to see errors in my terminal colorfully like: ![enter image description here](https://i.stack.imgur.com/SU0Vu.png)
How can I have a terminal's error messages colored?
CC BY-SA 3.0
null
2009-01-17T02:13:32.150
2022-04-29T18:27:56.877
2015-05-23T07:20:42.140
54,964
54,964
[ "macos", "bash", "terminal" ]
453,069
1
484,899
null
20
8,694
# Update see [Using Blur Behind on Windows](http://labs.trolltech.com/blogs/2009/09/15/using-blur-behind-on-windows/) for an example of using Qt and [DWM](http://msdn.microsoft.com/en-us/library/aa969540(VS.85).aspx).[alt text http://labs.trolltech.com/blogs/wp-content/uploads/2009/09/blurbehind2.png](http://labs.trolltech.com/blogs/wp-content/uploads/2009/09/blurbehind2.png) --- ## Original question: I want to create a Windows Aero Glass window with Qt, now it looks like this: ![alt text](https://img-fotki.yandex.ru/get/3203/goodrone.0/0_1ee1c_ecb3fc6e_L.jpg) But after calling some `my_window->repaint()` my window's label becomes broken: ![alt text](https://img-fotki.yandex.ru/get/3201/goodrone.0/0_1ee20_16877c58_L.jpg) But now slightly, it repaints properly. --- : how do I erase the window background, so that widgets would paint themselves on a clean glass? --- The short code to reproduce the problem is (Vista with Aero): ``` class Window(QWidget): def __init__(self, *args): QWidget.__init__(self, *args) self.setLayout(QVBoxLayout()) self.layout().addWidget(QLabel("This is the text")) # let the whole window be a glass self.setAttribute(Qt.WA_NoSystemBackground) from ctypes import windll, c_int, byref windll.dwmapi.DwmExtendFrameIntoClientArea(c_int(self.winId()), byref(c_int(-1))) def mousePressEvent(self, event): self.repaint() ``` You can click the window now, or just hit `Alt-Tab` several times. Anyway, using labels with Aero Glass is not what I need, because QLabel doesn't know how to paint itself with a while glow (like the title of the window). What I need is a general way to clean the "glass".
Qt: Erase background (Windows Aero Glass)
CC BY-SA 2.5
0
2009-01-17T09:36:53.767
2015-04-20T08:41:53.333
2017-02-08T14:09:47.800
-1
13,543
[ "pyqt", "windows-vista", "dwm", "aero-glass" ]
454,600
1
null
null
2
1,319
I've written explorer bars (band object) before and . However, I was amazed when I saw this explorer bar by HP that is docked on the right hand side instead: ![A vertical explorer bar on the right hand side](https://farm4.static.flickr.com/3493/3204746881_58eb9706fc.jpg) I've searched up google for a bit and I can't find any resources on this. Does anyone know how to ?
How to write a Vertical Right-Side IE Explorer Bar
CC BY-SA 2.5
0
2009-01-18T03:40:43.423
2011-06-29T04:15:59.053
2017-02-08T14:09:48.140
-1
53,735
[ "c++", "windows", "internet-explorer", "winapi", "browser" ]
458,384
1
458,426
null
3
2,807
Is there a way with CSS to wrap text on sides of an element (an image for example). I am trying to have an image positioned in the middle of a paragraph and would like text to flow over it. Please see the image for an example. ![http://i42.tinypic.com/14mvp69.jpg](https://i.stack.imgur.com/GKVrR.jpg) Positioning an element typically takes it out of the document flow; so that doesn't work.
Text wrapping around an image (or any element)
CC BY-SA 3.0
null
2009-01-19T17:15:59.280
2015-08-19T15:33:21.773
2015-08-19T15:33:21.773
3,204,551
56,747
[ "html", "css", "word-wrap" ]
461,748
1
481,231
null
5
2,298
My TabItems before attempting to apply a left margin of 10 look like: ![alt text](https://farm4.static.flickr.com/3487/3213045582_6830246427.jpg?v=0) After attempting to apply the left margin of 10 to the blue tab, the blue tab gets cut off like: ![alt text](https://farm4.static.flickr.com/3512/3213045546_20400f1226.jpg?v=0) How do I do this properly?
How do I add horizontal margins to my WPF TabItems without cutting off the tab?
CC BY-SA 2.5
null
2009-01-20T15:27:31.477
2009-01-26T20:33:44.873
2017-02-08T14:09:50.173
-1
51,746
[ "wpf", "wpf-controls" ]
475,779
1
null
null
3
2,354
How do get my sitelinks to appear on Google search results? ![Google sitelinks](https://i.stack.imgur.com/MsYjf.png)
How to get sitelinks to appear on Google Search?
CC BY-SA 3.0
0
2009-01-24T09:20:59.390
2018-08-13T21:43:50.787
2016-12-03T10:42:48.557
502,381
null
[ "google-search" ]
482,904
1
513,946
null
1
874
Is it possible to personalize the My Profile page in it can be done on the My Home page? ![My Profile](https://i.stack.imgur.com/y2B2n.png) I want to remove the default Web Parts and add other ones. I don't want to use SharePoint Designer or edit any files manually.
Is it possible to add Web Parts to the My Profile page of My Site?
CC BY-SA 3.0
0
2009-01-27T10:32:56.037
2012-01-10T20:53:10.233
2012-01-10T20:53:10.233
95
95
[ "sharepoint", "moss", "wss" ]
484,614
1
484,803
null
1
17,155
This is the code I have that HTML Validator is giving me an error on: ``` <input type="text" id="search" name="keywords" /> <input type="submit" value="Search" name="Submit" /> ``` ([full size](https://i.stack.imgur.com/1B67V.png)): ![Screen shot of error in HTML Validator.](https://i.stack.imgur.com/1B67V.png) This is the error message I am receiving: > The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.There are 2 types of elements in the body of a HTML file, inline and block elements. One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").In the following sample, the <font> tag is an inline tag which can only contain other inline tags. But the <p> tag is a block tag. So a <p> tag can not be contained in a <font> tag. This is the block of html that it is from: ``` <li> <form method="post" action="http://site.com/" > <div class='hiddenFields'> <input type="hidden" name="ACT" value="19" /> <input type="hidden" name="XID" value="90ee0994104d8ba87b6ef9b43e998fc8c89e0d9f" /> <input type="hidden" name="RP" value="search/results" /> <input type="hidden" name="NRP" value="" /> <input type="hidden" name="RES" value="" /> <input type="hidden" name="status" value="" /> <input type="hidden" name="weblog" value="forms|alumni_distinguished|housing_faq|international_faq" /> <input type="hidden" name="search_in" value="everywhere" /> <input type="hidden" name="where" value="all" /> <input type="hidden" name="site_id" value="1" /> </div> <input type="text" id="search" name="keywords" /> <input type="submit" value="Search" name="Submit" /> </form> </li> ```
HTML Validator giving me error on form input type, element not allowed in context
CC BY-SA 3.0
0
2009-01-27T18:29:08.227
2012-09-30T12:41:31.447
2012-09-30T12:41:31.447
497,828
26,130
[ "html", "w3c-validation" ]
486,039
1
486,066
null
22
57,793
I have the following text from an academic course I took a while ago about inorder traversal (they also call it pancaking) of a (not BST): > Draw a line around the outside of the tree. Start to the left of the root, and go around the outside of the tree, to end up to the right of the root. Stay as close to the tree as possible, but do not cross the tree. (Think of the tree — its branches and nodes — as a solid barrier.) The order of the nodes is the order in which this line passes underneath them. If you are unsure as to when you go “underneath” a node, remember that a node “to the left” always comes first. Here's the example used (slightly different tree from below) ![tree 1](https://farm4.static.flickr.com/3661/3624141531_094985f47e_o.png) However when I do a search on google, I get a conflicting definition. For example the [wikipedia example](http://en.wikipedia.org/wiki/Tree_traversal): ![Tree definition](https://upload.wikimedia.org/wikipedia/commons/thumb/6/67/Sorted_binary_tree.svg/250px-Sorted_binary_tree.svg.png) > Inorder traversal sequence: A, B, C, D, E, F, G, H, I (leftchild,rootnode,right node) But according to (my understanding of) definition #1, this should be > A, B, D, C, E, F, G, I, H They might be both describing different traversal methods, but happen to be using the same name. I'm having trouble believing the peer-reviewed academic text is wrong, but can't be certain.
Inorder tree traversal: Which definition is correct?
CC BY-SA 4.0
0
2009-01-28T00:56:27.260
2019-04-03T23:57:55.410
2019-04-03T23:57:55.410
1,893,164
21,574
[ "data-structures", "binary-tree", "tree-traversal" ]
491,770
1
null
null
2
3,996
I've used the [VLC ActiveX](http://wiki.videolan.org/ActiveX) (available in the [VLC 0.9.4 installation](http://www.videolan.org/vlc/download-windows.html)) in my VB.NET App. I've noticed that: - - - So my questions are: 1. Is the "Toolbar" property a useless thing or is there a special way to get it to TRUE? 2. Will the Toolbar appear at all or would I have to implement it myself? 3. If I have to make a custom seek slider with control buttons, what are the API calls I can use to control media playback and seek-to-frame? VB.NET? 4. Is there ANY other way I can get the VLC player with its Toolbar in my App? Libvlc? ![alt text](https://wiki.videolan.org/images/Vlc-en.png) ^ This is [the toolbar](https://wiki.videolan.org/images/Vlc-en.png) that I would like to have in my VB.NET App.
Toolbar with VLC ActiveX in VB.NET
CC BY-SA 2.5
null
2009-01-29T14:22:59.687
2011-09-14T09:31:20.710
2017-02-08T14:09:54.690
-1
41,021
[ "vb.net", "api", "activex", "toolbar", "vlc" ]
493,296
1
493,329
null
418
930,820
I want to show an image from an URL with a certain width and height even if it has a different size ratio. So I want to resize (maintaining the ratio) and then cut the image to the size I want. I can resize with html `img` property and I can cut with `background-image`. How can I do both? Example: This image: ![enter image description here](https://i.stack.imgur.com/wPh0S.jpg) Has the size `800x600` pixels and I want to show like an image of `200x100` pixels With `img` I can resize the image `200x150px`: ``` <img style="width: 200px; height: 150px;" src="http://i.stack.imgur.com/wPh0S.jpg"> ``` That gives me this: ``` <img style="width: 200px; height: 150px;" src="https://i.stack.imgur.com/wPh0S.jpg"> ``` And with `background-image` I can cut the image `200x100` pixels. ``` <div style="background-image: url('https://i.stack.imgur.com/wPh0S.jpg'); width:200px; height:100px; background-position:center;">&nbsp;</div> ``` Gives me: ``` <div style="background-image:url('https://i.stack.imgur.com/wPh0S.jpg'); width:200px; height:100px; background-position:center;">&nbsp;</div> ``` How can I do both? Resize the image and then cut it the size I want?
CSS Display an Image Resized and Cropped
CC BY-SA 4.0
0
2009-01-29T20:35:19.777
2021-04-26T10:33:12.507
2020-06-07T15:03:14.340
9,150,652
41,385
[ "html", "css", "background-image", "image" ]
496,195
1
497,463
null
8
6,678
I'm using Linq-to-SQL with a SQL Server backend (of course) as an ORM for a project. I need to get the result set from a stored procedure that returns from a dynamically-created table. Here's what the proc looks like: ``` CREATE procedure [RetailAdmin].[TitleSearch] ( @isbn varchar(50), @author varchar(50), @title varchar(50)) as declare @L_isbn varchar(50) declare @l_author varchar(50) declare @l_title varchar(50) declare @sql nvarchar(4000) set @L_isbn = rtrim(ltrim(@isbn)) set @l_author = rtrim(ltrim(@author)) set @l_title = rtrim(ltrim(@title)) CREATE TABLE #mytemp( [storeid] int not NULL, [Author] [varchar](100) NULL, [Title] [varchar](400) NULL, [ISBN] [varchar](50) NULL, [Imprint] [varchar](255) NULL, [Edition] [varchar](255) NULL, [Copyright] [varchar](100) NULL, [stockonhand] [int] NULL ) set @sql = 'select a.storeid, Author,Title, thirteendigitisbn ISBN, Imprint,Edition,Copyright ,b.stockonhand from ods.items a join ods.inventory b on a.itemkey = b.itemkey where b.stockonhand <> 0 ' if len(@l_author) > 0 set @sql = @sql + ' and author like ''%'+@L_author+'%''' if len(@l_title) > 0 set @sql = @sql + ' and title like ''%'+@l_title+'%''' if len(@L_isbn) > 0 set @sql = @sql + ' and thirteendigitisbn like ''%'+@L_isbn+'%''' print @sql if len(@l_author) <> 0 or len(@l_title) <> 0 or len(@L_isbn) <> 0 begin insert into #mytemp EXECUTE sp_executesql @sql end select * from #mytemp drop table #mytemp ``` I didn't write this procedure, but may be able to influence a change if there's a really serious problem. My present problem is that when I add this procedure to my model, the designer generates this function: ``` [Function(Name="RetailAdmin.TitleSearch")] public int TitleSearch([Parameter(DbType="VarChar(50)")] string isbn, [Parameter(DbType="VarChar(50)")] string author, [Parameter(DbType="VarChar(50)")] string title) { IExecuteResult result = this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), isbn, author, title); return ((int)(result.ReturnValue)); } ``` which doesn't look anything like the result set I get when I run the proc manually: ![Result Set](https://lh5.ggpht.com/_g6k7SWc-6HY/SYMrST6oPaI/AAAAAAAAAE8/KD6-NFPxcN0/s400/storedproc.jpeg) Can anybody tell me what's going wrong here? This is basically the same problem as [this question](https://stackoverflow.com/questions/404186/problem-with-the-return-type-of-a-stored-procedure) but due to the poor phrasing from the OP it was never really answered. --- Thanks Marc for your reply. I will see about making the changes you suggested. The problem was the temp table. Linq to Sql just doesn't know what to do with them. This was particularly difficult to diagnose, because Visual Studio caches information about stored procs, so when it initially failed to find a result set it set the return as a default integer type and didn't update when I made changes to the stored proc. Getting VS to recognize a change requires you to: - - - - - You might not have to do every one of those steps, but that's what worked for me. What you need to do, if you must use a temp table, is to create a barebones proc that simply returns the correct schema, and then alter it to do what you want after you've imported it into the OR Designer.
How do I get Linq to SQL to recognize the result set of a dynamic Stored Procedure?
CC BY-SA 2.5
0
2009-01-30T16:38:51.673
2010-08-23T09:07:49.133
2017-05-23T11:45:25.150
-1
1,249
[ "c#", "sql", "sql-server", "linq-to-sql", "stored-procedures" ]
497,269
1
661,645
null
0
1,131
In Word 2007, a user may update the applied styles by selecting the "Reset to Quick Styles from XYZ Template" in the Change Styles menu option. ![Reset to Quick Styles from XYZ Template](https://farm4.static.flickr.com/3320/3239869162_e6e3cb92ea.jpg) Does anyone know of a way to automate this? I tried adding a macro to the Document_Open() method in the VBA for the Template project, but it errors out.
How to Automatically "Reset to Quick Styles from XYZ Template" in Word 2007?
CC BY-SA 2.5
null
2009-01-30T21:13:14.567
2009-03-19T10:11:44.547
2017-02-08T14:09:56.887
-1
null
[ "automation", "ms-office", "office-2007", "word-2007" ]
499,987
1
500,440
null
0
905
I added a simple dialog window to the install's UI with textboxes. How do I find out what the user entered? @Mitch Wheat: Thank you. I managed to solve the problem with your help. I needed to use the CustomActionData property of the Custom Action. ![CustomActionData](https://www.codeproject.com/KB/install/SetupAndDeployment/AddCustomActionDataValue.JPG)
How to access information entered during setup? (VS2008 setup project)
CC BY-SA 4.0
null
2009-02-01T01:36:39.760
2020-02-11T08:38:05.367
2020-02-11T08:38:05.367
55,267
55,267
[ ".net", "visual-studio", "installation", "windows-installer", "project" ]
500,130
1
500,151
null
3
2,755
I want two tables to have the same height. If the left table contain longer text than the right table I want it to be as long as the left table. This is how it looks now: ![enter image description here](https://i.stack.imgur.com/aCoOR.png) I can't set the height because that would limit how much text you can write... This is how I want it: ![enter image description here](https://i.stack.imgur.com/Ah1iS.png) Code: ``` <table cellspacing="0" width="30%" align="left" class="rowA"> <tr> <td> Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. "Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. </td> </tr> </table> <table cellspacing="0" width="70%" align="right" class="rowB"> <tr> <td> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </td> </tr> </table> ```
How to create two tables of same height?
CC BY-SA 4.0
null
2009-02-01T03:36:37.117
2019-01-04T00:39:08.187
2019-01-04T00:39:08.187
10,757,987
null
[ "html", "html-table" ]
500,540
1
500,547
null
1
2,302
After the previous question "What are the important rules in Object Model Design", now I want to ask this: Suppose that we have this schematic object model: ![object model](https://i.stack.imgur.com/EAwrg.gif) So, each object could have lots of properties due to the set of implemented Interfaces, and then become relatively heavy object. Creating all the possible -and of course reasonable- object can be a way for solving this problem , but I have a large number of interfaces by now, that make it difficult. I wonder if there is a way to have dynamic properties, something like the following dialog to allow the end user to select available functionalities for his/hers new object. ![dialog](https://i.stack.imgur.com/9L9nz.gif)
Dynamic Properties for object instances?
CC BY-SA 3.0
null
2009-02-01T10:15:03.787
2011-06-01T08:29:48.433
2011-06-01T08:29:48.433
83,528
57,897
[ "object", "dynamic", "model", "properties" ]
501,274
1
635,631
null
2
2,307
my main language is vb/c#.net and I'd like to make a console program but with a menu system. If any of you have worked with "dos" like programs or iSeries from IBM then thats the style I am going for. ![alt text](https://media.techtarget.com/digitalguide/images/Misc/qe_iseries.gif) so, was wondering if anyone knows of a "winforms" library that will make my form look like this. I dont mind a "fake winforms look" or a console application but thats how I'd like.
creating iSeries like programs
CC BY-SA 2.5
0
2009-02-01T18:07:25.410
2009-03-11T17:52:41.833
2017-02-08T14:09:59.697
-1
50,312
[ "c#", "ibm-midrange" ]
503,026
1
504,280
null
2
15,074
I know this seams a trivial question, but how can I disable the annoying JavaScript error messages? I am inserting data into an unfinished web application and I keep getting about 30 errors for every form I submit. It's driving me crazy. I'm using IE7. Please note that I already tried "Internet options - Advanced - Browsing", disabled script debugging for IE and other and unchecked the "display a notification for every script error". All I got was a different error message, but I still have to close a LOT of alert messages. I think I am going insane. EDIT: Before and after Image(url omitted to protect the innocents): ![alt text](https://i.stack.imgur.com/SwytR.jpg) I don't have access to the code, I am just inserting data, the application is still being built and the JavaScript is generated from codebehind. There is absolutely nothing I can do to remove this errors.
How to disable JavaScript error messages?
CC BY-SA 3.0
null
2009-02-02T12:21:19.303
2015-06-19T20:20:28.163
2015-06-19T20:20:28.163
1,159,643
32,037
[ "javascript", "internet-explorer", "error-handling" ]
508,356
1
508,401
null
2
1,884
Can anyone suggest a suitable way of figuring out a pieces allowable moves on a grid similar to the one in the image below. ![grid layout](https://farm4.static.flickr.com/3534/3250436085_c91b07c7fd.jpg) Assuming piece1 is at position a1 and piece2 is at position c3, how can I figure out which grid squares are allowable moves if piece1 can move (say) 3 squares and piece2 can move 2? I've spent way too long developing text based MUDS it seems, I simply can't get my brain to take the next step into how to visualise potential movement even in the most simple of situations. If it matters, I'm trying to do this in javascript, but to be perfectly honest I think my failure here is a failure to conceptualise properly - not a failure in language comprehension. It's sloppy and it only works for one item placed on the board so far, but at least the `check_allowable_moves()` function works for this initial run. For those of you wondering why the hell I'm creating those weird alphanumeric objects rather than just using numeric x axis and y axis - it's because an id in HTML can't start with a number. In fact pretending I use numbers to start ids helped a great deal in making sense of the functionality and concepts described by the fantastic answers I got. ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="application/xhtml+xml;utf-8"/> <title>Test page</title> <style> #chessboard { clear: both; border:solid 1px black; height: 656px; width:656px; /*width = 8*40 + 16 for border*/ } #chessboard .row { overflow: auto; clear: both; } #chessboard .row span { display: block; height: 80px; width: 80px; float: left; border:solid 1px black; } .allowable { background: blue; } </style> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load("jquery", "1.2.6"); google.load("jqueryui", "1.5.3"); </script> <script type="text/javascript"> $(document).ready(function() { (function() { var global = this; global.Map = function(container) { function render_board() { var max_rows = 8; var cols = new Array('a','b', 'c', 'd', 'e', 'f', 'g', 'h'); var jqMap = $('<div />'); jqMap.attr('id', 'chessboard'); var x=0; for(x; x<max_rows; x++) { var jqRow = $('<span />'); jqRow.addClass('row'); var i=0; for(i; i<cols.length; i++) { var jqCol = $('<span />'); jqCol.attr('id', cols[i]+(x+1)); jqCol.addClass(cols[i]); jqRow.append(jqCol); } jqMap.append(jqRow); } $('#'+container).append(jqMap); } function add_piece(where, id) { var jqPiece = $('<div>MY PIECE'+id+'</div>'); var jqWhere = $('#'+where); jqPiece.attr('id', 'piece-'+id); jqPiece.addClass('army'); jqPiece.draggable({cursor: 'move', grid:[82, 82], containment: '#chessboard', revert: 'invalid', stop: function(ev, ui) { //console.log(ev.target.id); } }); jqWhere.append(jqPiece); check_allowable_moves(where); } function check_allowable_moves(location) { var x_axis = { 'a':1,'b':2, 'c':3, 'd':4, 'e':5, 'f':6, 'g':7, 'h':8 }; var x_axis_alpha = { 1:'a',2:'b', 3:'c', 4:'d', 5:'e', 6:'f', 7:'g', 8:'h' }; $('.allowable').droppable("destroy"); $('.allowable').removeClass('allowable'); //get the x,y values of the piece just placed var x = parseInt(x_axis[location[0]], 10); var y = parseInt(location[1], 10); var x_min = x-2; var y_min = y-2; for(x_min; x_min<=x+2; x_min++) { for(y_min; y_min<=y+2; y_min++) { var jqCell = $('#'+x_axis_alpha[x_min]+y_min) jqCell.addClass('allowable'); jqCell.droppable({ accept: '.army', drop: function(ev, ui) { //console.log(ev, ui, $(this)); //handle_drop(ev, ui, $(this)); check_allowable_moves($(this).attr('id')); } }); } y_min = parseFloat(y)-2; } } render_board(); add_piece('d5', '2'); } })(); var map = new Map('content'); }); </script> </head> <body id="debug"> <div id="page"> <div id="content"> </div> </div><!-- end page --> </body> </html> ```
Determining allowable moves on a grid
CC BY-SA 2.5
null
2009-02-03T18:38:42.367
2013-10-16T17:38:19.407
2017-02-08T14:10:03.680
-1
60,598
[ "javascript", "grid" ]
510,277
1
510,347
null
26
12,344
Is there an established algorithm for finding redundant edges in a graph? For example, I'd like to find that a->d and a->e are redundant, and then get rid of them, like this: ![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/5/51/Tred-G.png/124px-Tred-G.png) => ![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/1/1f/Tred-Gprime.png/80px-Tred-Gprime.png) Edit: Strilanc was nice enough to read my mind for me. "Redundant" was too strong of a word, since in the example above, neither a->b or a->c is considered redundant, but a->d is.
Algorithm for Finding Redundant Edges in a Graph or Tree
CC BY-SA 2.5
0
2009-02-04T06:29:01.697
2019-06-25T08:53:32.533
2017-02-08T14:10:04.730
-1
55
[ "algorithm", "language-agnostic", "tree", "graph-theory" ]
512,145
1
562,065
null
0
210
Recently I upgraded a couple of CruiseControl.NET server from version 1.3 to version 1.4.2.14. After the upgrade I was pleased to note that the "View Statistics" link from the project's web dashboard sported a new view: ![alt text](https://tvl7tg.blu.livefilestore.com/y1pJXOc5a-GHWftIp_G9K6qZpNnt6H-9XKsjtQRNgUZPuf9iDDBrqx8xJr3dpx43CeFyw8qGG2EnNA/CCNetViewStatsNew.PNG) However, I was quite disappointed to discover that another server that I upgraded in an identical way sported the old-style statistics page: ![alt text](https://tvl7tg.blu.livefilestore.com/y1pVz14MxrzMQ7_4R7p2U92pG79rxcHPuu7nFjlDaeyW5S6ZethkDodIbB4x9vdDa6t9dN33SfQnZw/CCNetViewStatsOld.PNG) It seems that there is some configuration setting that didn't get enabled when I upgraded the second server. Any ideas what controls this?
New-fangled "view statistics" not working on upgraded CruiseControl.NET server
CC BY-SA 2.5
0
2009-02-04T16:32:19.077
2009-02-18T17:27:03.377
2017-02-08T14:10:05.737
-1
2,459
[ ".net", "cruisecontrol.net", "upgrade" ]
516,228
1
null
null
0
437
I'm trying to write a VBScript function that collects the value of a cell ("E1") across all tabs of an Excel document into an array (Reviewers). I wrote the following code, but the data is not being stored into the array, can someone please tell me what I'm doing wrong? This is the code: ![vba screenshot](https://i.stack.imgur.com/ZhiEa.jpg)
How to get the value of a cell across all worksheets
CC BY-SA 3.0
0
2009-02-05T14:55:57.647
2015-05-28T05:36:30.817
2015-05-28T05:26:37.760
4,897,144
null
[ "arrays", "vba", "excel" ]
516,406
1
1,381,050
null
20
13,448
I'm currently looking at different solutions getting 2 dimensional mathematical formulas into webpages. I think that the wikipedia solution (generating png images from LaTeX sourcecode) is good enough until we get support for MathML in webbrowsers. I suddenly realized that it might be possible to create a [Google Charts API](http://code.google.com/apis/chart/) equivalent for mathformulas. Has this already been done? Is it even possible due to the strange characters involved in LaTeX-code? I would like to hit an url like latex2png.org/api/?eq="E = mc^2" and get the following response: ![e=mc^2](https://upload.wikimedia.org/math/f/0/9/f09291a2934068644f41981dd51eb5b0.png) Thanks for the answers sofar. However, I am already aware of several tools to generate png images from latex source code (both online and from my commandline), but what I was looking for was a simple way to get the image via an Http GET request. Perhaps such a service does not exist.
LaTeX equivalent to Google Chart API
CC BY-SA 2.5
0
2009-02-05T15:36:05.570
2022-04-11T08:27:29.330
2017-02-08T14:10:06.073
-1
24,946
[ "math", "latex", "png", "formula" ]
518,447
1
518,469
null
5
12,244
I'm showing a popup menu to select some values in a QTableWidget. The lowest item is a "Modify list" entry, when I select it a new window should automatically appear and the QComboBox should vanish and the cell return to a Qt::DisplayRole state. Now Qt has all those nice API-calls like `QTableWidget.edit()` and `QTableWidget.editItem()`, what I'm really looking for is a `QTableWidget.endEditing()`, preferably without specifying the index of the cell, though I could get that using this call: ``` table.currentIndex() ``` … but I don't know if I can guarantee that the current cell is the cell being edited at all times. Is there an API to close those kind of editors? ![Popup menu](https://i.stack.imgur.com/esRER.png)
How can I tell a QTableWidget to end editing a cell?
CC BY-SA 3.0
0
2009-02-05T23:20:56.410
2021-01-18T17:04:14.070
2014-01-08T15:04:26.263
24,587
24,587
[ "qt", "pyqt" ]
521,881
1
521,944
null
2
939
You know the one I mean: ![Excel has crashed... again!](https://farm4.static.flickr.com/3429/3258031261_1149df469c_o.jpg) Is there a way to disable this? I'm writing an application to automatically test a large number of Excel spreadsheets which are used in a critical environment. Many of these sheets do crazy things which crash Excel. When Excel crashes I want it to terminate ASAP and without user-intervention. - - -
Can you get rid of the "Microsoft Office Excel has encountered a problem" dialog?
CC BY-SA 2.5
null
2009-02-06T19:46:16.063
2009-04-02T14:29:36.677
2017-02-08T14:10:08.113
-1
46,411
[ "windows", "excel", "crash", "ms-office" ]
522,352
1
522,403
null
21
22,486
What is the best pattern for having a select all or deselect all checkboxes. Can someone come up with a better way to have it in this form: ![enter image description here](https://i.stack.imgur.com/16WUB.png)
Most usable select all/deselect all checkbox format
CC BY-SA 3.0
0
2009-02-06T21:55:50.997
2016-07-05T20:09:32.273
2015-08-18T08:46:26.120
4,374,739
5,653
[ "usability" ]
526,898
1
529,894
null
7
3,801
HI all. I am working on some code to send/receive SMS messages through Zeep Mobile ([http://zeepmobile.com/developers/](http://zeepmobile.com/developers/)). I have looked at their google groups and even contacted their support but they've not been very good at communicating back and I am really flying blind now. I have to get integrated with them (work has required it) and I'm not sure why my code is not working. So, I'm wondering if anyone out there has any C# .Net code that they won't mind sharing so that I may integrate that into my app. Of course, this is all dependent on whether you have experience with Zeep or not. If you want me post my code, I can do that too. Let me know. Thanks and I really appreciate the help. ** ## EDIT: I HAVE ADDED SOURCE CODE HERE IN CASE ANYONE CAN HELP WITH THIS! ** Please forgive the sloppy code. Its just something I threw together to test Zeep and I'm hoping someone can give it a shot. (.Net 3.5 console app in case you want to build it). ``` using System; using System.Collections.Generic; using System.Collections.Specialized; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; using System.Net.Security; using System.Web; using System.Web.Handlers; using System.IO; using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; namespace ConsoleApplication1 { class Program { public static string API_KEY = "MY_API_KEY"; public static string SECRET_ACCESS_KEY = "MY_SECRET_KEY"; public static string PATTERN_RFC1123 = "ddd, dd MMM yyyy HH:mm:ss " + "GMT"; static void Main(string[] args) { // URL for sending message - // send_message = "https://api.zeepmobile.com/messaging/2008-07-14/send_message"; // blast_message = "https://api.zeepmobile.com/messaging/2008-07-14/blast_message"; string apiurl = "https://api.zeepmobile.com/messaging/2008-07-14/blast_message"; // FORMAT must be Sun, 06 Nov 1994 08:49:37 GMT string http_date = DateTime.UtcNow.ToString("r"); // Text to send string body = HttpUtility.UrlEncode("Test message.", System.Text.Encoding.UTF8); // NOTE: Use 'user_id=22&body=' instead of just 'body=' when sending a message to a user. // 22 is a user I have previously registered with ZEEP and is used for testing purposes. string parameters = "body=" + body; // String that will be converted into a signature. string canonicalString = API_KEY + http_date + parameters; //------------START HASH COMPUTATION--------------------- // Compute the Base64 HMACSHA1 value HMACSHA1 hmacsha1 = new HMACSHA1(SECRET_ACCESS_KEY.ToByteArray()); // Compute the hash of the input file. byte[] hashValue = hmacsha1.ComputeHash(canonicalString.ToByteArray()); String b64Mac = hashValue.ToBase64String(); String authentication = String.Format("Zeep {0}:{1}", API_KEY, b64Mac); //-----------END HASH COMPUTATION------------------------ // We are using TCPClient instead of an HTTPWebRequest because we need to manually // set the "Headers" such as Date, Authorization etc which cannot easily be done with HTTPWebRequest. Uri reqUrl = new Uri(apiurl); TcpClient client = new TcpClient(reqUrl.Host, reqUrl.Port); NetworkStream netStream = client.GetStream(); // SSLStream is used for secure communication. ZEEP requires the use of SSL to send and SMS. System.Net.Security.SslStream sslStream = new System.Net.Security.SslStream( netStream, false, new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate)); sslStream.AuthenticateAsClient(reqUrl.Host); // POST content we are going to transmit over the SSL channel. // See. http://zeepmobile.com/developers/documentation/messaging/2008-07-14/rest_api#send_message System.IO.StreamWriter s = new System.IO.StreamWriter(sslStream); s.WriteLine(String.Format("POST {0} HTTP/1.1", "/api/blast")); s.WriteLine(String.Format("Host: {0}", "api.zeepmobile.com")); s.WriteLine(String.Format("Authorization: Zeep {0}:{1}", API_KEY, b64Mac)); s.WriteLine(String.Format("Date: {0}", http_date)); s.WriteLine(String.Format("Content-Type: {0}", "application/x-www-form-urlencoded")); s.WriteLine(String.Format("Content-Length: {0}", parameters.Length)); s.WriteLine(String.Format("{0}", parameters)); s.Flush(); System.IO.StreamReader r = new StreamReader(sslStream); string resp = r.ReadToEnd(); Console.WriteLine(resp); r.Close(); } // The following method is invoked by the RemoteCertificateValidationDelegate. // We want to make sure the SSL has no Policy errors and is safe. public static bool ValidateServerCertificate( object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) return true; Console.WriteLine("Certificate error: {0}", sslPolicyErrors); // Do not allow this client to communicate with unauthenticated servers. return false; } } public static class Extensions { public static byte[] ToByteArray(this string input) { UTF8Encoding encoding = new UTF8Encoding(); return encoding.GetBytes(input); } public static string ToBase64String(this byte[] input) { return Convert.ToBase64String(input); } } } ``` ## Error What is happening when I run this code is the error shown in the following image. ![alt text](https://aboutdev.files.wordpress.com/2009/02/error400.jpg)
.NET code for SMS
CC BY-SA 2.5
0
2009-02-09T01:40:43.373
2009-02-09T20:53:24.570
2017-02-08T14:10:11.560
-1
64,015
[ "c#", "sms" ]
527,198
1
527,241
null
6
743
Can anybody please explain how this could possibly happen? I am completely aware of programming with thread safety in mind and as you can see I am catering for UI updates via a form InvokeRequired check here, everything has been working fine and no changes to break this that I am aware, and now suddenly just as I'm programming other parts of the application (perhaps added to this method at one stage? I just can't remember) I intimitently, receive this error: ![alt text](https://dl.getdropbox.com/u/477279/Stackoverflow/invokeIssue.gif) Firstly, if InvokeRequired = true, that should mean BeginInvoke() executed, the method is [queued] to be re-called and InvokeRequired should equal false? I should not receive this exception as it should be catered for? Hope to hear from some multi threading guru's :) Graham
Impossible (how I hate to use this word) cross threading error?
CC BY-SA 2.5
0
2009-02-09T05:43:51.450
2009-04-28T17:34:11.057
2017-02-08T14:10:11.903
-1
41,211
[ ".net", "multithreading" ]
527,209
1
null
null
3
5,118
In Sharepoint document library, when we create a new document library, the default view is 'All Document'. This one: ![alt text](https://i592.photobucket.com/albums/tt5/astri_kusumawardani/crm/docLib_allDOcView_500.jpg) We can make a custom view from (at the upper right corner of document library view). I created a new standard view and named it 'Chromed View'. I edited it, then I saw that this view only applied on current document library: ![alt text](https://i592.photobucket.com/albums/tt5/astri_kusumawardani/crm/docLib_chromedView_500.jpg) The other document libraries cannot use this view. I develop a system that triggers document library creation from CRM (the document library's view from CRM Iframe is using that chromed view). The creation itself went well, I can create document library using Sharepoint web services. But I still cannot apply a custom view automatically for that newly created doc lib. My question is, can we make a view that is global (not in one document library only) so that we can use that global view for any document library. Thanks b4 for any opinion :)
Global Customized View for Document Libraries in Sharepoint
CC BY-SA 2.5
null
2009-02-09T05:53:00.367
2012-05-31T13:50:56.690
2017-02-08T14:10:12.567
-1
61,773
[ "sharepoint" ]
528,883
1
529,063
null
4
5,626
How can I re-direct the user to the standard SharePoint "access denied" page, similar to the image below? Currently, I am throwing an UnauthorizedAccessException, but this error message is not as elegant as SP message. ``` throw new UnauthorizedAccessException("User does not have permission to access this list"); ``` Any help will be highly appreciated. ![alt text](https://lh5.ggpht.com/_6g8ldcvIElU/SjdcWxseJAI/AAAAAAAADXM/r_rAIKUTHeI/s400/SharePoint%20-%20Access%20Denied.JPG)
How to display a standard SharePoint "Access Denied" message
CC BY-SA 2.5
0
2009-02-09T16:35:14.207
2009-06-16T08:50:24.160
2017-02-08T14:10:12.907
-1
55,503
[ "c#", "sharepoint", "exception" ]
529,498
1
null
null
11
45,207
I looking for a GUI Builder for python i know it exist, can see it in this image background ![Image](https://i.stack.imgur.com/cOzBl.gif)
GUI Builder for Python
CC BY-SA 3.0
0
2009-02-09T19:25:11.053
2013-02-18T09:52:51.520
2013-02-18T09:52:51.520
1,931,274
null
[ "python" ]
533,462
1
534,660
null
2
1,967
![alt text](https://farm4.static.flickr.com/3352/3270044482_610eee066a.jpg?v=0) I am using the autocomplete YUI feature. However, as you can see I am having trouble aligning the suggestion drop down with the text input when I put a label in front of the text input. I am following [the example here](http://developer.yahoo.com/yui/examples/autocomplete/ac_basic_array_clean.html) exactly except for this snippet of code where I simply replace the H3 with a label element in the form: ``` <div id="myAutoComplete"> <label>Enter a state:</label> <input id="myInput" type="text"> <div id="myContainer"></div> </div> <script type="text/javascript" src="http://developer.yahoo.com/yui/examples/autocomplete/assets/js/data.js"></script> ``` (I also had to change the data.js path from a relative to absolute path.) What is the best way to have the suggestion drop down to line up with the text input? I would like a solution that works on all popular modern browsers (FF3, Safari, Chrome, IE), plus IE6.
YUI autocomplete misalignment problem
CC BY-SA 2.5
null
2009-02-10T18:01:14.250
2009-11-24T13:37:09.527
2017-02-08T14:10:13.923
-1
32,174
[ "javascript", "html", "css", "yui" ]
533,650
1
533,805
null
1
704
I have a sign-up form in my application with several UITextFields. In order to speed up the process I would like to add a next and previous button to a toolbar pinned above the keyboard and allow the user to "tab" between the fields using these buttons. I know I can navigate through the subviews collection on my view, but I was wondering if there was a cleaner way to do this? This functionality is implemented in safari as seen in the following screenshot: ![alt text](https://dl.getdropbox.com/u/22784/keyboardToolbar.png)
Next and Previous to navigate text fields
CC BY-SA 2.5
null
2009-02-10T18:54:40.533
2009-02-10T19:30:13.507
null
null
8,918
[ "iphone" ]
536,676
1
543,965
null
53
45,005
I'm using the excellent JQuery UI to do a "mapping" so the user can "map" persons from one program to persons from other program. using this simple JQuery: ``` $(document).ready(function() { $("div .draggable").draggable({ revert: 'valid', snap: false }); $("div .droppable").droppable({ hoverClass: 'ui-state-hover', helper: 'clone', cursor: 'move', drop: function(event, ui) { $(this) .addClass('ui-state-highlight') .find("img") .removeAttr("src") .attr("src", "_assets/img/icons/check-user-48x48.png"); $(this).droppable('disable'); $(ui.draggable) .addClass('ui-state-highlight') .find("img") .removeAttr("src") .attr("src", "_assets/img/icons/check-user-48x48.png"); $(ui.draggable).draggable('disable'); } }); $("div .droppable").bind("dblclick", function() { $(this) .removeClass('ui-state-highlight') .find("img") .removeAttr("src") .attr("src", "_assets/img/icons/user-48x48.png"); $(this).droppable('enable'); EnableSource($(this)); }); }); ``` I get to this: ![alt text](https://i.stack.imgur.com/Cyynb.png) was (if possible) create a line between and so it makes the connection between them clear. I can always do it with numbers inside the boxes, but I really wanted to know how to do this using the lines. .
How to draw a line between draggable and droppable?
CC BY-SA 3.0
0
2009-02-11T13:08:37.720
2015-05-11T04:57:50.297
2015-05-11T04:56:47.270
28,004
28,004
[ "jquery", "html", "jquery-ui", "drawing", "svg" ]
538,244
1
538,334
null
12
10,234
I have HTML markup to deal with that consists of multiple tables nested inside another table. I would like the "inner tables" to all be the same width. I would also like all of the "inner tables" to be no wider than the width of the widest "inner table" in its natural state. I do want to simply set the width of all the tables to some fixed percentage, as I do not know in advance what the width of the widest "inner table" should be until the HTML page is actually generated. ![Here is a visual example](https://upload.wikimedia.org/wikipedia/en/0/00/Erasene-screen001.png) [https://en.wikipedia.org/wiki/File:Erasene-screen001.png](https://en.wikipedia.org/wiki/File:Erasene-screen001.png) I want all tables to be the same width as inner-table-zero. Currently, none of the tables have an assigned width, and that's the way I like it, because I want all inner tables to naturally choose the width of whichever table is widest by default. Is there any CSS or JQuery or Javascript trick anyone knows that will obtain this desired styling? I'm about to delete this question because people seem to want to downvote me for not having a good reason for not wanting 100%. I have a good reason ... I also do not know until runtime table will be the "outermost" table (this is a recursively-generated structure of potentially unlimited depth).
How to get multiple separate HTML tables to all be the same width as the widest table
CC BY-SA 3.0
0
2009-02-11T18:58:12.170
2017-09-19T19:27:54.130
2017-09-19T19:27:54.130
42,223
42,223
[ "html", "css", "user-interface", "html-table" ]
541,320
1
541,349
null
0
266
I'm probably thinking about this all wrong but I have the following db tables: ![alt text](https://1ponbw.bay.livefilestore.com/y1pUw3xaKZ7RhtNS3GiC5F1NYMad5ZeYI8Wh-jZ8CDajt7MiKO-6vhVmEm8VhlXMkDZTQz9t5gP4gnskgbvDtAYTA/DBImage.jpg) When I run the EF Wizard in VS2008 I get the following model: ![alt text](https://1ponbw.bay.livefilestore.com/y1pY5xK0aw6ckqcY5IPaIc45Rfjhy-CSMpdd_l4z-4mMGKbhd5N9VIySd72t-0LXBkYseQY0D2W5mEUUaDzhntcQA/EFImage.jpg) You'll notice that in the EF model shows that the Entity has no field for EntityTypeID or EntityStatusId. Instead it shows it as a navigation property, so the field appears to not be addressable when I instantiate an Entity (pardon the terminology confusion: Entity is a Table/Class in my name space not in the EF namespace). How can I assign an EntityTypeID and StatusTypeID when instantiating an Entity?
Entity Framework: Model doesn't reflect DB
CC BY-SA 2.5
null
2009-02-12T13:50:23.040
2009-02-12T14:40:01.313
2017-02-08T14:10:18.860
-1
48,172
[ "entity-framework" ]
541,545
1
559,018
null
9
3,300
When you have a table with a Geometry type field (or Geography), you can call the `Reduce()` function to have the shapes reduced in number of vertices. Works very nicely. However, when sevral of the polygons are adjacent (they share parts of their borders), the reduced polygons do not necessarily do so. ## Example The SQL batch: ``` CREATE TABLE #Shapes ( shape geometry, naam varchar(50) ) -- exact: insert into #Shapes (naam, shape) VALUES ('Area A',Geometry::STGeomFromText('POLYGON ((52.084744368912652 5.1304192959796637, 52.085234231548384 5.1304194002877921, 52.085474282948049 5.1304486630822, 52.0857341082301 5.1304792705923319, 52.086134375073016 5.1306082883384079, 52.086594087770209 5.13079824927263, 52.087194303050637 5.1311187236569822, 52.089074697112665 5.1323992793913931, 52.089834430487826 5.1333390253130347, 52.090353938518092 5.1341692635323852, 52.090254480473 5.1342997345712416, 52.090824429301414 5.13520842681262, 52.09141399711384 5.1360295349486274, 52.091884278226644 5.1365492835175246, 52.092085719574243 5.1367767199408263, 52.092194211203605 5.1368992186617106, 52.092494247804545 5.1372492032188495, 52.092884057915427 5.13754907634854, 52.093083867570385 5.137679290259257, 52.093254011290028 5.1378082139755827, 52.093554640188813 5.1380093733314425, 52.094204571098089 5.1384683684445918, 52.094214495038614 5.1384888619650155, 52.093702809136488 5.1390791568504124, 52.0939114689827 5.1395669728517532, 52.0938675517682 5.1396009074524045, 52.093849835848111 5.1396084928439114, 52.093797143315896 5.1396473892964423, 52.093789743114428 5.1396500989447063, 52.093731224210721 5.13969055645838, 52.093728204024956 5.1396938753314316, 52.093717452138662 5.1397007238119841, 52.09355255169794 5.139717671321705, 52.093311328208074 5.1395945930853486, 52.093306955655407 5.1395602072316251, 52.093115365831181 5.1400826557073742, 52.093052050564438 5.1401469679549336, 52.092979203676805 5.1401289247442037, 52.092756105586886 5.1398569964803755, 52.092737412561 5.1397823067194368, 52.09235419591127 5.1398883965623128, 52.092214386788811 5.1400686172528616, 52.092164272349919 5.1401695687556135, 52.09208471653983 5.1403786691371351, 52.0920239102561 5.1405293103307486, 52.091924546519294 5.1407297900877893, 52.091534494888037 5.1407990844454616, 52.091654436912947 5.1401591910829172, 52.091713753540262 5.1397284107361845, 52.091763769509271 5.1391488309018314, 52.091774359305148 5.1390583129178058, 52.09170373348757 5.1383788494901648, 52.0907391263172 5.1386201300192624, 52.090711282333359 5.1385075189173222, 52.090718721970916 5.1384486802853644, 52.090745792724192 5.1383893731981516, 52.090758387919244 5.1383728119598793, 52.090776969445869 5.1383237342815846, 52.090780415022657 5.1383173598065737, 52.090745287947357 5.1382717578671873, 52.090742629869759 5.1382662602414895, 52.090704807080328 5.1382211977615952, 52.0906867091544 5.1381677808240056, 52.090701617482885 5.1380081428639635, 52.090564404382455 5.138029116065514, 52.09062412660569 5.1386488282587379, 52.090704361908138 5.1396187201607972, 52.09069472597912 5.1397384563460946, 52.090674098813906 5.1398086878471076, 52.090624484543433 5.1397491229489587, 52.090589968811038 5.1397359627815975, 52.090441891923547 5.140045978827402, 52.090305342804641 5.1400443047750741, 52.0902322656475 5.139729289803654, 52.090199632104486 5.1394877941347659, 52.090188750764355 5.1393666968215257, 52.0902532400633 5.1393868076773792, 52.09003754449077 5.1387802169192582, 52.090024582457204 5.1386965749382565, 52.090020758565515 5.1386840578634292, 52.0900124781623 5.1386172670806785, 52.090003480669111 5.1385827830526978, 52.08999918546494 5.1385372205978728, 52.089985796017572 5.1384773049503565, 52.089996868744493 5.1384535257238895, 52.090046249330044 5.138385351980105, 52.090212456043091 5.1382693609882955, 52.090183896290647 5.1379786310671935, 52.090166853580648 5.1378115779987894, 52.0899735938292 5.137785307597369, 52.089885840192437 5.1377143466379493, 52.08985487697646 5.137671007309109, 52.089845903217793 5.1376524229999632, 52.089844238944352 5.1376464897766709, 52.089850628050044 5.1375868958421052, 52.089852778393364 5.137576853302618, 52.089863699774533 5.1374888862706634, 52.089867451693863 5.1373642447870225, 52.089883847394958 5.1373361134901643, 52.089941705111414 5.1372730266302824, 52.090002277167514 5.1372403032146394, 52.090108146462811 5.1372361269295483, 52.09006458793673 5.1368091938053615, 52.089683820260689 5.1369396857917309, 52.089193989204269 5.1364887236994123, 52.088854428613558 5.1373995044268668, 52.088474480202422 5.1383894786704332, 52.088474343996495 5.1383894337341189, 52.088464433038652 5.1383690948872287, 52.088414154422111 5.13834898790222, 52.088394471909851 5.1383694768883288, 52.0883943233639 5.1383694719988853, 52.08832395415709 5.1382487505018526, 52.087933741509914 5.1377592226490378, 52.087544413445592 5.1372594955892383, 52.087484167695806 5.1372292107739481, 52.087364645209163 5.1372284211684018, 52.0869538753575 5.1372190437554366, 52.085683952551335 5.1372596949804574, 52.085304662585258 5.137269108556211, 52.085084051657141 5.1370588609653955, 52.084904317976907 5.137469710316509, 52.084444417446747 5.1384497439414369, 52.084454428168293 5.1385195698547266, 52.084484005579725 5.1385092278942466, 52.084537888644263 5.1385357407853007, 52.084511198022149 5.1389506391238067, 52.084534639492631 5.1391157133039087, 52.084215438459069 5.139372929232195, 52.084103818604156 5.1389697602953825, 52.083964082412422 5.1391396226827055, 52.083963935496286 5.139139630831778, 52.083883681101725 5.1390291205607355, 52.083994359437455 5.1386593720505784, 52.084013982437057 5.1385892418004318, 52.084053878448593 5.1383293403318735, 52.084054407430678 5.1377297231794907, 52.084053982747719 5.1375283871311694, 52.084063940448686 5.1371387927792966, 52.084070490673184 5.13703247718513, 52.084070608951151 5.1370323959272355, 52.084217049471441 5.1370617711960529, 52.0842700656977 5.1370595147110754, 52.084318579515468 5.1370449147663777, 52.084365648221834 5.137017846536426, 52.084410294202549 5.1369791406907863, 52.084451525192954 5.1369308069453, 52.084497402298688 5.1368615722581685, 52.084511263761669 5.1368357082828879, 52.084539652187722 5.1367929205345337, 52.084559679031372 5.1367565956898034, 52.084580525973493 5.1367251129565776, 52.0845936126653 5.1367018828692963, 52.084593039704487 5.1366802926640958, 52.084593520236 5.1366613829106731, 52.084592797560617 5.136602794053033, 52.0845930285151 5.1365417347624449, 52.084591784281656 5.1365062294062227, 52.084592622431977 5.1364672367903337, 52.084591892315075 5.1364289335906506, 52.084595442516729 5.13633631542325, 52.084596794845957 5.1363224481129421, 52.084599652094766 5.13625919749029, 52.084600140111739 5.1362545876124468, 52.084603969780289 5.1361925578721053, 52.084604394622147 5.1361672168131918, 52.084607248043845 5.1361305358165161, 52.084609296828042 5.13606852098146, 52.084609103156254 5.1360535530839115, 52.084611643842678 5.1360064989442122, 52.08461217648793 5.1359452261162533, 52.084612038685009 5.1359415214974433, 52.084614087827504 5.1358594063203782, 52.084640604443848 5.1355516116600484, 52.084642857778817 5.135543460957706, 52.084982043160878 5.1354961035347806, 52.085083917947486 5.1345288194715977, 52.085104202153161 5.1343492493033409, 52.08524441709433 5.1330996853375064, 52.085165794240311 5.1330994283780456, 52.085158604676472 5.1330777355575146, 52.084887840552256 5.1328501671087, 52.084870130718066 5.1327825202649118, 52.084810143569484 5.132734818616882, 52.084766256157309 5.1326845148578286, 52.084753367166229 5.1326649976350005, 52.084720281418413 5.1326657184399664, 52.084673544857651 5.1326567681971937, 52.084627489326522 5.13263783371076, 52.084616634761915 5.1326309095602483, 52.084607382304966 5.1326056816615164, 52.084589018020779 5.1325388213153929, 52.084566780831665 5.1324195361230522, 52.08455663616769 5.1322953840717673, 52.084555578185245 5.1322289216332138, 52.084558193339035 5.1321669477038085, 52.084565328201279 5.1320932512171566, 52.084573237691075 5.1320388016756624, 52.084590001497418 5.1319514436181635, 52.084614846622571 5.1318454830907285, 52.084674907008818 5.1317076328407039, 52.084733415627852 5.1315451303962618, 52.084768428234277 5.1314570531469457, 52.084772500442341 5.131445026723668, 52.084790059469135 5.1313976899708305, 52.084790684864267 5.1313653332182225, 52.084789962507784 5.1313581170979887, 52.084786229995423 5.1313093374080232, 52.084781658835709 5.1312665985897183, 52.084776584757492 5.131205978570506, 52.084776126593319 5.1311985920700378, 52.084773858077824 5.1311737054493278, 52.084770929767942 5.1311195062007151, 52.084764682454988 5.1310441740788519, 52.084762406875207 5.1310067452953634, 52.084759807214141 5.1309909871779382, 52.084745739819482 5.1308908765204251, 52.084737451048568 5.1308199469931424, 52.084731393493712 5.1307550501078367, 52.084726219235463 5.130682019587562, 52.084717591805187 5.130595849588774, 52.084696356672794 5.1304316397290677, 52.084744368912652 5.1304192959796637))', 1) ); insert into #Shapes (naam, shape) VALUES ('Area B', Geometry::STGeomFromText('POLYGON ((52.089193944586441 5.1364884474314749, 52.089683880347387 5.1369394774090678, 52.090064640389755 5.1368089618626982, 52.090064767515287 5.13680902402848, 52.090108351781964 5.1372362461406738, 52.0900023451254 5.137240494616317, 52.089941830607358 5.1372731845887953, 52.089884013120034 5.1373362265352416, 52.089867649300196 5.13736428650584, 52.089863897534087 5.1374888976570219, 52.089852973818779 5.1375768855214119, 52.089850827719964 5.1375869208953633, 52.08984444080243 5.1376464707614575, 52.089846089016071 5.1376523461555816, 52.089855048116348 5.13767090524721, 52.089885986401136 5.1377142074887443, 52.089973680692943 5.137785122508185, 52.090167043032125 5.1378114717081189, 52.090184094849974 5.1379786091856658, 52.090212659211829 5.138269433286041, 52.090046387117965 5.1383854977954284, 52.089997038751484 5.1384536319841185, 52.089986001565585 5.1384773087642488, 52.0899993844796 5.138537187827751, 52.090003677353721 5.1385827515141784, 52.0900126749184 5.1386172289494425, 52.090020956756526 5.1386840232833055, 52.0900247762911 5.1386965326964855, 52.090037737332914 5.1387801609122805, 52.090253500966355 5.1393869426101446, 52.090253373142332 5.1393870580941439, 52.09018895904866 5.1393668668649326, 52.09019982968524 5.1394877681651483, 52.090232462748588 5.1397292593531256, 52.090305473417473 5.1400441225035083, 52.090441768325739 5.1400458008552627, 52.0905898406636 5.1397357748355716, 52.090624607168138 5.1397489595692605, 52.090674059544682 5.1398083794509937, 52.090694529374325 5.1397384163970843, 52.090704163346672 5.1396187301667995, 52.0906239267189 5.1386488468750029, 52.090564216952771 5.1380289690569043, 52.090701825218275 5.138007998932153, 52.090686907175666 5.1381677433547006, 52.090704979235063 5.1382210930865915, 52.090742795495316 5.13826614478603, 52.090745454392028 5.1382716438933382, 52.090780634433031 5.138317345874384, 52.090777151606311 5.1383238151729582, 52.090758565347642 5.1383729032240808, 52.090745967798135 5.1383894728374937, 52.090718918413778 5.1384487237036574, 52.09071148235433 5.1385074989634694, 52.090739235906476 5.1386199161658359, 52.091703911079094 5.1383786785881966, 52.091774561209604 5.1390583219472319, 52.091763966455993 5.1391488551129392, 52.091713952366263 5.1397284283302724, 52.091654634801671 5.1401592225302011, 52.091534660555041 5.1407988700928273, 52.091924405223438 5.1407296329252166, 52.092023730557614 5.1405292234111544, 52.092084533682055 5.1403785903667165, 52.092164086876437 5.1401694919914007, 52.092214212752879 5.1400685210246593, 52.092354092746973 5.1398882211651653, 52.092737518250942 5.1397820895072073, 52.092756280866688 5.1398568955139261, 52.092979332917338 5.1401287692562034, 52.093051998862443 5.14014675848039, 52.093115186976668 5.1400825616937738, 52.093306944705546 5.1395597066730261, 52.093307103263214 5.139559774659574, 52.093311476645688 5.1395944439214718, 52.093552575019729 5.1397174675798443, 52.093717376162488 5.1397005364784905, 52.093728081547653 5.1396937158987059, 52.093731097411364 5.1396904007997364, 52.093789641978219 5.1396499255206436, 52.09379703433958 5.139647218074332, 52.093849730910733 5.139608321711421, 52.0938674450952 5.1396007388582916, 52.093911277158938 5.13956686834194, 52.093702596845105 5.1390791060402989, 52.094214342534542 5.1384887341409922, 52.094234085874632 5.1384696427267045, 52.094364419566851 5.1384893088412067, 52.094364145770669 5.1383595434017479, 52.094394268468022 5.1381287302356213, 52.09443390479516 5.138148912037261, 52.094484106955747 5.1381194878988437, 52.094514668919146 5.1380682252347469, 52.094674076435417 5.1382088991813486, 52.095094393635229 5.1384881954232995, 52.0952940530714 5.1385585838544232, 52.095604252303019 5.1385889891535044, 52.095554116032766 5.1386696371579523, 52.095534724403237 5.1388492132525849, 52.095524277190037 5.1390082753444624, 52.095594465266913 5.1390487975440919, 52.095594199141487 5.1393494226504117, 52.09559461963309 5.1399783839006, 52.095604153974683 5.1410990775805754, 52.095644179129778 5.1413294123732438, 52.09575448022224 5.1416396433487535, 52.095824270925078 5.1419194503811445, 52.096084321906162 5.1429293346052836, 52.096143952025322 5.1430793148784755, 52.096264120657 5.1433793206233531, 52.096193926805284 5.1433798011214318, 52.096113997035054 5.14339920294765, 52.096024247104872 5.1434492955148228, 52.095944452364236 5.1435387324349744, 52.095874538511147 5.14362958598761, 52.095844099589421 5.143679338650661, 52.095844470186279 5.1438587997111922, 52.095854729064243 5.1440396906996444, 52.095894579105732 5.1441883100385768, 52.095964113250375 5.144369007088244, 52.09580374216273 5.144229786732418, 52.095674295010134 5.1441983953353239, 52.095563816432822 5.14421941922198, 52.095403983902024 5.1442888717546564, 52.095254029380158 5.1443597327452153, 52.094414402963594 5.1447291097138077, 52.094194360597214 5.1448091029165, 52.093554132385179 5.1451087987516075, 52.09298392268829 5.14536870829761, 52.092384074527615 5.1456389861371825, 52.091314621968991 5.1461291963244005, 52.091214230906282 5.1462493549551356, 52.091174073517323 5.1464188823010772, 52.0911739426665 5.146418813848868, 52.09113409327086 5.1462687528401041, 52.091084660668564 5.146199182483377, 52.091033940669149 5.1464488115161657, 52.090953806928624 5.1464084108564867, 52.090854425442245 5.1464496781230418, 52.089684411417693 5.1471287335734814, 52.0895846124041 5.1471190678897267, 52.088994233263378 5.1476095448153067, 52.088864096673205 5.1477386702317744, 52.088784483494237 5.1475289191585034, 52.088713807872537 5.1472491544173726, 52.088664193741309 5.1471487923554067, 52.088594123489734 5.1471287621828763, 52.088524112701435 5.1471597642893574, 52.088323859963566 5.1472586041782051, 52.088194384938106 5.1472490853630006, 52.088083737995476 5.147229231428355, 52.087984558660537 5.1470896604005247, 52.0871439545881 5.144788873847574, 52.086584153570342 5.1431184258301306, 52.086113808001116 5.1425490758657, 52.085764196002856 5.142129332292825, 52.085273851326242 5.1414594290601263, 52.084604130359367 5.1405483337584883, 52.08448414108716 5.1403388837352395, 52.084363697096705 5.1399091542698443, 52.084215331124142 5.1393728284165263, 52.084534444796994 5.1391156225659822, 52.084510998101905 5.1389506384730339, 52.084537685041475 5.1385358115798789, 52.084483979582181 5.1385094355204064, 52.084454281721264 5.138519779080525, 52.084444217151031 5.1384497005492449, 52.084904137838336 5.1374696237373572, 52.08508396637626 5.1370586035773158, 52.085304709049147 5.1372689084542849, 52.085683944402767 5.1372594968589222, 52.08695387118496 5.1372188439127058, 52.087364651495307 5.1372282228088277, 52.087484228890389 5.137229019543156, 52.087544555542991 5.1372593543492258, 52.087933897256818 5.1377590987963755, 52.088324117939919 5.1382486345246434, 52.088394418613781 5.138369242607296, 52.088414155179635 5.1383487726561725, 52.0884645585902 5.1383689332287759, 52.0884744236222 5.1383891381781037, 52.088854240353591 5.1373994332191018, 52.089193944586441 5.1364884474314749))', 1) ); insert into #Shapes (naam, shape) VALUES ('Area C', Geometry::STGeomFromText('POLYGON ((52.081104027922265 5.1258389879949391, 52.081314665614627 5.1259588550310582, 52.082414517994039 5.1266395719721913, 52.082954646321014 5.1270186660112813, 52.083513987367041 5.127549389610067, 52.083794155623764 5.1278395495610312, 52.084174386574887 5.1282589976908639, 52.084274505455781 5.1284189013796713, 52.08453426125925 5.1288288246141747, 52.085124507819643 5.1299386160409242, 52.08521465482071 5.1300693768952019, 52.0853342462746 5.1301182725468744, 52.0854241597699 5.1300988405710086, 52.0854743384989 5.1304488354362547, 52.085234220619661 5.130419600171515, 52.084744388967557 5.1304194940048324, 52.08439406089019 5.1305090384557843, 52.083914360133932 5.1306285039224422, 52.083414051565342 5.1307787221157923, 52.082813916262239 5.13094844610896, 52.082724283281529 5.1306586048111562, 52.082483787322417 5.1300093204481527, 52.08225411306649 5.1293789464909949, 52.082194455789093 5.1292188489812043, 52.082134172902443 5.1291885531973094, 52.082084508962 5.1290896165883169, 52.082023798371665 5.1288696515839547, 52.081883911043406 5.1281993770971894, 52.081856097793207 5.12798699515406, 52.081856237724423 5.1279869175050408, 52.082000762340613 5.1280515332473442, 52.082027135184035 5.1280940270517021, 52.0820355968099 5.1281161647869, 52.08205282002023 5.1281410993754166, 52.08213594150827 5.1278323108932256, 52.0820438895719 5.1277594091965328, 52.081953932996839 5.1277496579568833, 52.081884289887846 5.1271693162703134, 52.081813924670755 5.1270196131258938, 52.081552422139794 5.1268787173321471, 52.08152364961375 5.1267665265884057, 52.081485387952739 5.1266524291002371, 52.081442847483068 5.1265567842247837, 52.081396028901857 5.1264795880384764, 52.081344932177927 5.1264208389159505, 52.081293396464417 5.1263833287749234, 52.081279310281388 5.1263776289997622, 52.081249886541627 5.1263603481929749, 52.081222431567454 5.12633884719625, 52.081221418222412 5.1263384295161813, 52.081197269726545 5.126324187265709, 52.081195053295232 5.1263138890499249, 52.081184833077714 5.1262332251062617, 52.0811841667945 5.1261982778874859, 52.081168951815926 5.1261331316782162, 52.081164751928249 5.1260440781433525, 52.081066497950815 5.1259329431923106, 52.081104027922265 5.1258389879949391))', 1) ); insert into #Shapes (naam, shape) VALUES ('Area D', Geometry::STGeomFromText('POLYGON ((52.084103860426694 5.1389694481622428, 52.084363892148971 5.1399091025981294, 52.084484331319835 5.1403388143996294, 52.084604299141489 5.1405482272725367, 52.08527401345782 5.1414593127556145, 52.085764355740025 5.1421292096101565, 52.086113962111995 5.1425489480607212, 52.086584335425869 5.1431183374952525, 52.087144145466013 5.1447888108543749, 52.087984736636635 5.1470895681108679, 52.088083857744529 5.1472290623707631, 52.088194406595086 5.14724888795369, 52.088323822820605 5.1472584035787792, 52.088524032849818 5.14715958177112, 52.088594117900357 5.1471285563893616, 52.08866433496587 5.1471486398950219, 52.088713997742161 5.1472490890882909, 52.088784678140655 5.1475289016962051, 52.088534413350153 5.1477695436890123, 52.088604030199349 5.1479895326774567, 52.08846407078854 5.1481186849763318, 52.088304384844378 5.1482683648355305, 52.087993860917578 5.1484991029959017, 52.087834112113342 5.1486196045298129, 52.0874739959836 5.1487791088875383, 52.087183827068657 5.1488594498950988, 52.087034655727216 5.1488792099405627, 52.086844170233235 5.1489094072021544, 52.086553779430687 5.1488890685141087, 52.086283983197063 5.1488190072122961, 52.086004210880986 5.148699401849246, 52.085884556407109 5.148648968199268, 52.085783737245947 5.148579464526847, 52.085444359574467 5.1483186569530517, 52.08505431888625 5.147909271530807, 52.085063869832084 5.14774867403321, 52.085103993769735 5.1475894195027649, 52.085123664481678 5.1475485048696683, 52.084903807879783 5.1472594002206034, 52.084644382136524 5.1469792136778958, 52.08418409107253 5.1464885615278035, 52.0837237383239 5.1459687419701368, 52.083234543621856 5.145409702023275, 52.082664410911732 5.1448292277490495, 52.082063829526305 5.1443087360821664, 52.082091124779964 5.1440836547198483, 52.081992223858833 5.1440890550147742, 52.08196270884946 5.14405638189055, 52.081944186007604 5.1439888756722212, 52.08194406144986 5.1439872064089114, 52.08192484639585 5.1439289392437786, 52.081920254660311 5.1439031759941996, 52.081906982464716 5.1438652367796749, 52.081898384261621 5.143827152704362, 52.081886463514792 5.1437939475605585, 52.081860758494884 5.143810536588699, 52.081833417158236 5.1438379039788957, 52.081759569933638 5.14407270308584, 52.0816137263635 5.1439596123534246, 52.081454453474372 5.1438598307431391, 52.081304313847795 5.14384896773845, 52.080264462672268 5.1430187125121805, 52.079664091113955 5.1425989381968975, 52.079524534521624 5.14249899610877, 52.079534315969795 5.1424492821097374, 52.079674492839317 5.1419992103874552, 52.079703816364884 5.1418385940623406, 52.079714205814525 5.141648898134008, 52.079727753764018 5.1414623958989978, 52.080252137147674 5.1417998058748831, 52.08029427562046 5.1417563394152745, 52.080314928898588 5.1417286938522011, 52.0803562682122 5.1416860464960337, 52.080404439009726 5.1416505186352879, 52.080450373701751 5.1416298456024379, 52.080458209152553 5.1416284950795994, 52.080495744477957 5.141600257018581, 52.080541761592031 5.141581037081778, 52.080577370766676 5.1415776146752092, 52.080586124956035 5.1415745182313319, 52.080565002281219 5.1411468000151217, 52.080635850084946 5.1411388639826328, 52.081214110314008 5.1410789246463136, 52.081586783519015 5.1409964717458934, 52.081614242866635 5.1412574960850179, 52.081570835318416 5.1413511682767421, 52.08156742547277 5.1413547724810877, 52.081523078051127 5.1414396720759816, 52.081520885843375 5.1414458907124478, 52.0815235725604 5.1414493722841144, 52.081564587075263 5.1415304632391781, 52.081586116692051 5.1416122366208583, 52.081591385416651 5.1417623861789625, 52.081744097638875 5.1417384068481624, 52.081754462670077 5.14239915706246, 52.081888611945665 5.1424242914485125, 52.081887235166505 5.1422738104593009, 52.081907565006986 5.1422072551213205, 52.081948822597042 5.1421398329548538, 52.081990273194968 5.1420943139491024, 52.082000561989844 5.1420720012392849, 52.082041298272088 5.1420040489174426, 52.08205503895892 5.1419854623652519, 52.082057312844228 5.1419532595345077, 52.082057383609936 5.141936854692176, 52.082061406905325 5.1418724298121266, 52.082061399472877 5.1418698709458113, 52.082065169426741 5.1418023992023132, 52.08206505025737 5.1417857583146542, 52.082067978335544 5.1417265709023923, 52.082068552136519 5.1417210444026873, 52.08207146529282 5.1416510321596576, 52.082074348499624 5.1415691960222105, 52.082074102712795 5.1415587870869786, 52.082077217031589 5.141500341455882, 52.082077142713729 5.1414836310842942, 52.082064611044075 5.1414689618560345, 52.08204338257201 5.1414488023146987, 52.0820095549712 5.1414023755017455, 52.08195383178483 5.1413428048418419, 52.0819458400365 5.1413370133377612, 52.081897551489291 5.141270585100548, 52.081845151958987 5.1412304241675884, 52.081783577566966 5.1409387167077512, 52.082063805446388 5.1408189585007031, 52.082534100375206 5.1404983382591407, 52.082604082068428 5.1404395992867649, 52.082693810134288 5.1403690781753832, 52.083284175475136 5.1398683352445742, 52.083963928950048 5.1391394941752653, 52.084103860426694 5.1389694481622428))', 1) ); select naam, shape, shape.Reduce(0.001) as reducedShape from #Shapes drop table #Shapes ``` This returns two sets of polygons. First the unreduced set: ![alt text](https://www.xs4all.nl/~teund/stackoverflow/areas1.png) Then the reduced set: ![alt text](https://www.xs4all.nl/~teund/stackoverflow/areas2.png) These shapes are much simpler and they do have the rough shape correct, but what I would want is to have the border-parts still shared. So they have to be reduced together, in a way. I think you have to break them up into polylines first (from edge to edge), then Reduce the lines and then reassembling them to polygons again. I have no idea how to do this in T-SQL though. Any ideas? I've accepted alphadaogg's answer. Both current answers weren't entirely covincing to me, but alphadogg has certainly put in the most effort and I really appreciate any sharing of thoughts. So the bounty goes to him. I will follow-up with a self-answer later if I find a satisfying method. : I e-mailed with Isaac Kunen, Program Manager on the SqlServer Geo team. His helpfull response is below: > Your problem is not at all rare, but it isn't something we directly support: it's an operation that requires knowledge of the topology of your figures, and we don't have anything like this built in. Essentially, you don't want to store separate polygons for each neighborhood. Rather, you want to store curves representing portions of boundaries, and reuse these boundaries for multiple polygons. When you generalize, you generalize the shared boundary, and all dependent polygons are affected.You could build this yourself---as the posters in the thread you cite hint---but it may be real effort to do so.I don't know the third-party software you're using, but this is the other option. If you don't want a full-fledged GIS, you could use a package like the FME from Safe Software ([http://www.safe.com](http://www.safe.com)). The FME doesn't do general-purpose topology, but I believe it has enough functionality to do what you're looking for. See: [http://www.safe.com/products/desktop/under-the-hood.php#3b](http://www.safe.com/products/desktop/under-the-hood.php#3b).I hope this helps.Cheers,-Isaac
How would I generalize multiple adjacent polygons?
CC BY-SA 3.0
0
2009-02-12T14:40:20.190
2014-06-01T21:46:00.650
2017-02-08T14:10:19.563
-1
64,963
[ "sql-server", "sql-server-2008", "geolocation", "geometry", "geospatial" ]
541,839
1
543,298
null
0
2,238
I've inserted an image below showing were I currently stand (css version) and where I want to be (tabled based version). I originally created this layout with tables and I would like to move to a css based version. I have a long way to go. I'm using Blueprint CSS. Current issues: - - ![https://lh3.ggpht.com/_wyoBVbEFXVg/SZRAGMj-ocI/AAAAAAAAAqw/O6T987pw6Dw/cssVsTable.gif](https://lh3.ggpht.com/_wyoBVbEFXVg/SZRAGMj-ocI/AAAAAAAAAqw/O6T987pw6Dw/cssVsTable.gif) ``` <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Heatmap using BluePrint</title> <!-- Framework CSS --> <link rel="stylesheet" href="/heatmap/styles/blueprint/screen.css" type="text/css" media="screen, projection"> <link rel="stylesheet" href="/heatmap/styles/blueprint/print.css" type="text/css" media="print"> <!--[if IE]><link rel="stylesheet" href="/heatmap/styles/blueprint/ie.css" type="text/css" media="screen, projection"><![endif]--> <style type="text/css"> body{font-size:70%;font-family:Verdana, "Helvetica Neue", Arial, Helvetica, sans-serif;padding:5px;} table.heatmap td {border: 1px solid black;} table.heatmap{border-collapse:collapse;} a {color:black;text-decoration: none;} a:hover {text-decoration: underline;} .list-as-tabs { margin-left:0px; } .list-as-tabs, .list-as-tabs li { display: inline; } .hover-links { background-color:#fffdbf; } .hover-links li a:hover { background-color:yellow; } table.heatmap tr td {text-align:center;} </style> </head> <body> <div class="container"> <div class="span-20"> <div class="prepend-5 span-10"> <h3> Issuer Heatmap</h3> </div> <div class="span-5 last"> <ul class="list-as-tabs"> <li><a href="javascript:popUp('legend.htm')">Legend</a></li> <li><a href="http://localhost/heatmap/default.aspx?level=heatmap&feedback=true"><img src="/heatmap/images/lightbulb.gif" alt="Send Feedback about Heatmap." /></a></li> <li><input type="image" src="/heatmap/images/excel-mini.gif" alt="Export Heatmap to Excel." /></li> <li><a href="print.aspx" target="_blank"><img src="/heatmap/images/printer.gif" alt="Print this page." /></a></li> </ul> </div> <div class="prepend-5 span-15 last"> <ul class="list-as-tabs hover-links"> <li><a href="#">View Draft Heatmap</a></li> <li><a href="#">Manage Security</a></li> <li><a href="#">Edit Heatmap and Platforms</a></li> <li><a href="#">View Revision History</a></li> </ul> </div> </div> </div> </body> </html> ```
How do I format tabs in Blueprint CSS?
CC BY-SA 2.5
0
2009-02-12T15:36:43.157
2012-04-09T18:03:00.850
2017-02-08T14:10:19.920
-1
38,613
[ "css", "blueprint-css" ]
546,010
1
546,140
null
1
1,665
I'm trying to make a little gallery of some school works I've done in my animation class. I want to put 3 images on each line and they are all in divs because I did onion skin wrapping for a dropshadow on them. Unfortunately this makes them all just stick together in two lines across the page. But I want them specifically formatted so I tried to wrap a div of 480px wide around each set of 3. In IE this works great and it looks perfect. However in firefox it does this ![](https://i.stack.imgur.com/TQgQR.jpg) I can't figure out why it is putting that one left aligned on the second line and therefore screwing up the order of the rest. Here's my code: ``` <!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> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Ryan Merl's Portfolio</title> <style type='text/css'> * { padding: 0px; margin: 0px; font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 11px; } body { background-color:#333333; background-image: url('images/head.png'); background-repeat: repeat-x; } a { color:#333333; text-decoration: none; } a:hover { color:#000000; text-decoration:underline; } div.main { width: 800px; background-color:#FFFFFF; margin-top: 10px; color: #000000; height: 1000px; margin-bottom: 10px; } img.thumb { } .wrap1, .wrap2, .wrap3 { display:inline-table; /* \*/display:block;/**/ } .wrap1 { float:left; background:url('images/shadow.gif') right bottom no-repeat; } .wrap2 { background:url('images/corner_bl.gif') left bottom no-repeat; } .wrap3 { padding:0 4px 4px 0; background:url('images/corner_tr.gif' ) right top no-repeat; } </style> <link rel="stylesheet" type="text/css" href="doc/css/style.css" /> <script type="text/javascript" src="src/adapter/shadowbox-base.js"></script> <script type="text/javascript" src="src/shadowbox.js"></script> <script type="text/javascript" src="glossy.js"></script> <script type="text/javascript"> Shadowbox.loadSkin('classic', 'src/skin'); Shadowbox.loadLanguage('en', 'src/lang'); Shadowbox.loadPlayer(['flv', 'html','img', 'swf'], 'src/player'); window.onload = function(){ Shadowbox.init(); }; </script> </head> <body> <center><div class='main'> <img src='images/theantistudio.png' /><br /><br /> <img src='images/gallery.png' /><br /> <div style='text-align:center;width:480px;'> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_particle_fire.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_fire.png' /></a> </div> </div> </div> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_firework.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_firework.png' /></a> </div> </div> </div> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_fountain.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_fountain.png' /></a> </div> </div> </div> </div> <br /> <div style='text-align:center;width:480px;'> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_logo.flv' rel='shadowbox'><img class='thumb' src= 'thumbs/thumb_logo.png' /></a> </div> </div> </div> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_rocket_ship.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_rocket.png' /></a> </div> </div> </div> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_solar_system.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_solar_system.png' /></a> </div> </div> </div> </div> <br /> <div style='text-align:center;width:480px;'> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_space_ship.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_space_ship.png' /></a> </div> </div> </div> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_still_life.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_still_life.png' /></a> </div> </div> </div> <div class="wrap1"> <div class="wrap2"> <div class="wrap3"> <a href='video/rmerl_walkthrough.flv' rel='shadowbox'><img class='thumb' src='thumbs/thumb_walkthrough.png' /></a> </div> </div> </div> </div> </div></center> </body> </html> ```
Firefox doesn't align images correctly
CC BY-SA 4.0
null
2009-02-13T13:54:27.250
2019-03-01T20:02:53.963
2019-03-01T20:02:53.963
4,751,173
2,128
[ "css", "firefox", "html" ]
547,438
1
555,522
null
3
397
We are using a UITextView with a dark background. As such we have made the text white color in order to be easier to read. The problem is the magnify window that pops up when you hold down your finger to move the insertion point uses white for the text color as well. This makes it impossible to see exactly where the insertion point is. Is it possible to independently control the text color used in the magnify window? Here is a screen shot illustrating the problem. ![alt text](https://dl.getdropbox.com/u/22784/magnify-white.png)
How can I control the color of the text used in a magnify window?
CC BY-SA 2.5
null
2009-02-13T19:57:35.737
2009-02-17T04:20:29.300
2009-02-16T23:54:20.937
714
8,918
[ "cocoa-touch" ]
549,451
1
37,389,179
null
100
49,224
I'm trying to create an activity that presents some data to the user. The data is such that it can be divided into 'words', each being a widget, and sequence of 'words' would form the data ('sentence'?), the ViewGroup widget containing the words. As space required for all 'words' in a 'sentence' would exceed the available horizontal space on the display, I would like to wrap these 'sentences' as you would a normal piece of text. The following code: ``` public class WrapTest extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); LinearLayout l = new LinearLayout(this); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams( LinearLayout.LayoutParams.FILL_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT); LinearLayout.LayoutParams mlp = new LinearLayout.LayoutParams( new ViewGroup.MarginLayoutParams( LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT)); mlp.setMargins(0, 0, 2, 0); for (int i = 0; i < 10; i++) { TextView t = new TextView(this); t.setText("Hello"); t.setBackgroundColor(Color.RED); t.setSingleLine(true); l.addView(t, mlp); } setContentView(l, lp); } } ``` yields something like the left picture, but I would want a layout presenting the same widgets like in the right one. ![non-wrapping](https://fnord.se/android/01-have.png) ![wrapping](https://fnord.se/android/01-want.png) Is there such a layout or combination of layouts and parameters, or do I have to implement my own ViewGroup for this?
Line-breaking widget layout for Android
CC BY-SA 4.0
0
2009-02-14T17:56:13.057
2022-05-24T18:41:42.713
2018-12-25T06:35:50.787
1,318,946
2,010
[ "java", "android", "user-interface", "layout" ]
550,845
1
null
null
0
831
I've been looking through the iPhone's UI catalog and cant seem to find what I'm looking for. Essentially I want a customizable version of the 'in call' menu as found on the iPhone so I can use my own icons and call my own functions. Example of 'in call' menu: ![In-call menu](https://i.stack.imgur.com/CqtCG.jpg) UIAlertView is the nearest thing I have found to it but it is still a way off from what I want. A friend said that someone had coded an open source version but he couldn't recall where it was. I've looked but can't find it. Any ideas?
Recreating the call menu on the iPhone
CC BY-SA 3.0
0
2009-02-15T13:10:55.670
2013-07-20T03:40:13.677
2013-07-20T03:40:13.677
707,111
null
[ "cocoa-touch" ]
553,248
1
554,109
null
3
3,058
I'm trying to think an interface for a time-keeping system that will let users see "at a glance" how much time still needs to be completed. This is complicated by the fact that there are no fixed hours - employees must work at least 6 hours on any given week day, and at the end of each month should have worked 7.5 hours for each week day that month. 7.5 hours either way can be carried over to next month. Employees can also take up to 1 morning and 1 afternoon per month 'flex' time. Time needs should be recorded by 10.15 the following day, but this rule is bent during busy times, and end of week and particularly end of month boundaries become more important. So what's the most readable format to display the currently entered time and highlight approaching deadlines for uncompleted entries, while still giving a feeling for how far ahead/behind track the employee is (i.e. if you have a week to go that month and you're 8 hours ahead you could schedule a little extra duvet time). My first take was a bar chart for each day with a red line at 6. But this doesn't give you any idea of how far ahead or behind you are for each day or month or whether you are close to missing a deadline... ![bar chart](https://i.stack.imgur.com/YVeuA.png)(Please excuse the horrible mockup) Maybe I'm trying to convey too much info in one place? -- Here's a mockup of time recorded v.s. time required as suggested by Dickon Reed ![graph of time v.s. target](https://i.stack.imgur.com/BM8ev.png) -- EDIT: this side works great for stuff like this. i'm going to kick some of these ideas around in the morning and hopefully get something posted back here.
UI design for time tracking
CC BY-SA 3.0
0
2009-02-16T13:08:55.683
2014-07-03T19:46:37.467
2014-07-03T19:46:37.467
1,043,380
12,744
[ "user-interface", "ui-design" ]
554,561
1
12,028,699
null
2
231
I'm stuck right now with defining the dimension of each line. The list I want to scrape has various colors in it, and what disturbs me the most a selection: ![Example](https://i.stack.imgur.com/Qapho.jpg) As you can see the picture I try to analyze got a white background with green text. The selection background is grey with black text. And every second line has a slightly greyer background, but I managed to manipulate the contrast with a ColorMatrix. Just for reference, I do have some other ColorMatrizes like Greyscale, Negative, SetContrast, SetBrightness and so on. My method, which is searching the lines does work good with the most part of the picture, but the selection brakes it. So now I'm stuck and don't know what to do. I googled for an hour, but didn't find a solution. --- I thought, that maybe I can transform the background grey from the selection to white without affecting the text and greyscale the rest of the picture. But I can't find a ColorMatrix which does the job. Do you know one or got a better solution?
OCR: How to find the right ColorMatrix to define new colors?
CC BY-SA 3.0
0
2009-02-16T21:09:04.187
2015-06-19T21:01:56.500
2015-06-19T21:01:56.500
1,159,643
66,674
[ "colors", "matrix", "ocr" ]
556,747
1
null
null
4
1,546
I have a UIViewController that allows me to view and edit information of a class. It is only allocated once but it's number of rows,sections and data is passed to it depending on the value the user selected. For example. Here it is editing a name & type property (Header view of table is too big.. I did this so you will see the weirdness underneath) ![alt text](https://farm4.static.flickr.com/3235/3287818468_19a6292d5d.jpg?v=0) So I enter a name and it all displays fine. Then I click on the address property and the detail view now looks like this: ![alt text](https://farm4.static.flickr.com/3345/3286999031_2cc3a8a9b7.jpg?v=0) Everything Ok so far. If i click cancel and go back to edit the name property it displays fine. The problem is this. I scroll down the address table like so: ![alt text](https://farm4.static.flickr.com/3487/3287818072_f5b8255b2c.jpg?v=0) And then click save/cancel. Now when I go back to edit the name property, the tableview looks like this! ![alt text](https://farm4.static.flickr.com/3596/3286998687_3d362759b3.jpg?v=0) It's as though the previous table is still visible through the header view of the table..? My viewWillAppear: method for this uiviewcontroller looks like this: ``` - (void)viewWillAppear:(BOOL)animated { NSLog(@"Retain count of poolcopy is %d\n\n", [self.thePoolFacilityCopy retainCount] ); //This will be a reference to find our which pool Instance field we are editing. self.sectionFromParentTable = self.cellPath.section; //This will only be used by the arrays self.rowFromPreviousTable = self.cellPath.row; NSString *sectionName; switch (self.sectionFromParentTable) { case KNameIndex: sectionName = @"name"; break; case KAddressIndex: sectionName = @"address"; break; case KPhoneNumberIndex: sectionName = @"phone"; break; case KWebAddressIndex: sectionName = @"url"; break; case KPricesIndex: sectionName = @"prices"; break; case KPoolIndex: sectionName = @"pools"; default: break; } self.title = [NSString stringWithFormat:@"Editing %@", sectionName]; // use an empty view to position the cells in the vertical center of the portion of the view not covered by // the keyboard if (self.sectionFromParentTable == KPhoneNumberIndex || self.sectionFromParentTable == KWebAddressIndex) { UIView *singleSectionHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 60)]; self.theTableView.tableHeaderView = singleSectionHeaderView; [singleSectionHeaderView release]; self.theTableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 10)]autorelease]; } else if (self.sectionFromParentTable == KAddressIndex) { UIView *addressHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 0)]; self.theTableView.tableHeaderView = addressHeaderView; [addressHeaderView release]; self.theTableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 250)]autorelease]; } else if (self.sectionFromParentTable == KPoolIndex) { UIView *poolHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 2)]; self.theTableView.tableHeaderView = poolHeaderView; [poolHeaderView release]; self.theTableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 10)]autorelease]; } else { UIView *doubleSectionHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 30)]; self.theTableView.tableHeaderView = doubleSectionHeaderView; [doubleSectionHeaderView release]; self.theTableView.tableFooterView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, 5, 10)]autorelease]; } [self.theTableView reloadData]; ``` } In the picture where the table looks messed up the cellForRowAtIndexPath method is only being called twice, even though there are 3 cells visible (2 normal cells and one weird cell). The weird cell moves with the scroll and is still clickable. I can fix this problem by commenting out the following lines in this method. However I don't want to have to allocate a new controller everytime someone wants to edit a detail: ``` - (PoolFacilityDetailEditController *)childController { // Instantiate the editing view controller if necessary. // if (childController == nil) { PoolFacilityDetailEditController *controller = [[PoolFacilityDetailEditController alloc] initWithNibName:@"PoolFacilityDetailEditController" bundle:nil]; self.childController = controller; [controller release]; // } return childController; } ```
UITableView weirdness! with pictures
CC BY-SA 2.5
null
2009-02-17T13:20:18.410
2012-03-09T14:10:52.510
2017-02-08T14:10:22.680
-1
51,420
[ "iphone", "objective-c", "cocoa-touch", "uitableview" ]
560,016
1
568,183
null
1
2,983
Here is my setup: one navigation controller, two views The first view, the rootview, displays the statusbar and navigation bar (portrait view). When the rootviewController senses rotation, it hides the nav bar and status bar and then it pushes view 2 onto the navigation controller (in landscape now). This part works as expected. When View2 viewcontroller senses rotation (back to portrait), it pops itself of the navigation controller, revealing view 1. View 1 then unhides the status bar and nav bar. From here, it gets weird. Depending on when I unhide the navigation bar, I get strange results. As you can see below (The beaker photo should be just below the navbar at the top of the screen). I have tried unhiding the navigation bar in: - - - Nothing works. Any Idea what is going on? This should be simple, but maybe I am doing things in the wrong places. ![botched screen](https://farm4.static.flickr.com/3642/3289929946_6eca8bed6c.jpg?v=0)
Rotation affecting Navigation Bar unpredictably
CC BY-SA 2.5
0
2009-02-18T06:09:40.493
2009-02-20T03:33:26.360
2017-02-08T14:10:23.397
-1
48,311
[ "iphone", "cocoa-touch" ]
561,300
1
561,440
null
1
1,342
# The Scenario I am building a custom CMS for a communications application. The users can upload images to the server and then later reference them in posts they write using markdown. Images are stored in a database and referenced with a url of the form `images/{id}`. A custom image handler retrieves these and sets a far future expires header so they aren't fetched over and over again. Storing the images in the file system is not an option per the customer. Posts are stored in the database as markdown and as html for performance. ### Markdown ``` ###Header Lorem Ipsum dolor sit amet. ![funny cat](images/25) ``` ### HTML ``` <h3>Header</h3> <p> Lorem Ipsum dolor sit amet. <img alt="funny cat" src="images/25" /> </p> ``` # The Problem These images are also editable. From a caching perspective this presents a problem. When an image is edited I need to ensure that the browser gets the latest version. I have come up with the following solutions, all of which I have found to be lacking. # Possible Solutions ### Version Field Store a version field with the image. Increment it when the image is edited producing urls of the form `images/{id}/version/{version}`. This is nice if image urls are always generated from the database. However, I am storing urls in posts as text and would have to preprocess possibly large swaths of text for these requests. Also, linking an image would be troublesome since a url becomes stale after an image is edited. This is probably not a good idea. ### New Url When an image is edited, store it as a new entry in the database. This means no version upkeep, but old links and old posts suffer from the same issues. They're never updated. The performance would be good, but the problem remains. ### 304 - Not Modified Store a last edited field for each image. When a conditional request comes in return http status 304 - Not Modified, reducing bandwidth usage. This seems like the best solution I've got so far. The image is cached unless edited, but I've never used this approach before. If there are 50 images on the page there are still 50 requests to the server. Bandwidth will be reduced, but the latency remains. Is this approach worth that cost? # The Question I have very little experience in this area and I'm hoping all of you have more. Are any of the above solutions viable? If so what is your experience with them? If not what is a better approach?
Custom Image Handler: Caching Strategy
CC BY-SA 2.5
0
2009-02-18T14:37:58.137
2009-02-26T10:25:36.710
2009-02-18T15:04:03.267
208
208
[ "html", "http", "caching", "httphandler" ]
561,506
1
1,193,914
null
6
6,500
I really enjoyed using the [Developer Toolbar](http://www.microsoft.com/en-us/download/details.aspx?id=18359) with IE7, and recently upgraded to IE8 to take advantage of (what appeared to be) more full-featured [developer tools](http://blogs.msdn.com/ie/archive/2008/03/07/improved-productivity-through-internet-explorer-8-developer-tools.aspx). The IE8 tool is really excellent (finally rivals FireBug), but I can't seem to inspect inside an iframe, which I could with the IE7 toolbar. I'd prefer not to downgrade to IE7 because I like some of the other features of the IE8 tools, but the ability to inspect inside an iframe is a deal breaker. Also, firebug is of limited utility to me because our site is an internally-deployed intranet app, which means "browser compatibility" is a very low priority, major functionality is often broken in FireFox. Here's what the IE8 tools look like around the iframe ![](https://i.stack.imgur.com/MOxok.png) In firebug, I can see an `<html>` element under the iframe, which I can expand just like the rest of the page The `<iframe>` in question has its `src` attribute set server-side (in the ASP.NET code-behind) UPDATE: I get the same result on this [Iframe example page](http://www.htmlcodetutorial.com/frames/_IFRAME.html). If anyone can use the IE8 developer tools to inspect inside that `iframe` then I'd like to hear about it.
Inspect in IFrame in IE8 Developer Tools?
CC BY-SA 3.0
0
2009-02-18T15:28:27.623
2015-06-19T20:50:27.870
2015-06-19T20:50:27.870
1,159,643
17,917
[ "iframe", "internet-explorer-8" ]
561,931
1
1,083,133
null
81
57,134
How to create trapezoid tabs in WPF tab control? I'd like to create non rectangular tabs that look like tabs in Google Chrome or like tabs in code editor of VS 2008. Can it be done with WPF styles or it must be drawn in code? Is there any example of code available on internet? There is lots of examples that show how to round corners or change colors of tabs, but I could not find any that changes geometry of tab like this two examples: ![VS 2008 Code Editor Tabs](https://farm4.static.flickr.com/3470/3290241563_4e45588e10_o.jpg) ![alt text](https://farm4.static.flickr.com/3446/3291059608_3e280a0791_o.jpg) Tabs in this two examples are not rectangles, but trapezes.
How to create trapezoid tabs in WPF tab control
CC BY-SA 2.5
0
2009-02-18T16:55:49.770
2022-03-16T08:30:54.723
2017-02-08T14:10:25.083
-1
25,732
[ "wpf", "xaml", "tabcontrol" ]
562,872
1
562,885
null
3
2,449
Ok I understand that this error mostly comes from sending a method call or trying to access a variable that has already been deallocated. Here is the problem: ``` .h @interface TimeEntry : NSObject <NSCopying, NSCoding> { NSDate *from; NSDate *to; NSString *information; } @property (nonatomic, retain) NSDate *from; @property (nonatomic, retain) NSDate *to; @property (nonatomic, copy) NSString *information; @end ``` And my classes' dealloc. ``` -(void)dealloc{ [super dealloc]; [to release]; [from release]; [information release]; } ``` This is the traceback thing when I get the EXC_BAD_ACCESS error ![alt text](https://farm4.static.flickr.com/3596/3290604341_c78fae9981.jpg?v=0) So I'm sending a message to an object that has been deallocated right? So I turned on NSZombie and this STOPPED my crashes. It didn't give me some lovely crash report like I'd hoped. Instead it just kept the program from crashing. In the dealloc method above if I comment out [to release] and [from release] the app doesnt crash. If I comment out just one of them.. it doesn't crash. In the debug window to and from have different memory addresses. How can memory management be so hard!!!! Any clues anyone? Thanks, Dan
Getting a segfault (EXC_BAD_ACCESS) when deallocating variables
CC BY-SA 2.5
0
2009-02-18T21:16:28.583
2009-06-11T22:47:23.810
2017-02-08T14:10:25.417
-1
51,420
[ "iphone", "objective-c", "cocoa-touch", "memory-management" ]
564,754
1
null
null
0
2,384
Every night my IIS hangs with 3 w3wp.exe processen in the task manager list. It is not possible to kill the w3wp task using the most memory. Not even iisreset helps. I have to reboot the machince to get rid of the w3wp prosess. Any suggestions? ![http://img530.imageshack.us/img530/7417/taskmanagerw3wpjn4.jpg](https://i.stack.imgur.com/NB1MH.jpg) Added: I have reduced the maxmemory of the default app pool to 120, but still the process goes above 200mb.
IIS w3wp process hanging og blocking access to the website
CC BY-SA 3.0
null
2009-02-19T10:52:53.317
2016-01-09T14:53:51.180
2016-01-09T14:53:46.197
3,563,993
null
[ "iis" ]
564,975
1
565,201
null
1
3,498
I want to implement Table Per Type inheritance with Entity framework for an existing database. The database: ![alt text](https://i.stack.imgur.com/bxRDF.png) The inheritance for ImageParagraphs works perfect, but I am not able to make a Table Per Type inheritance with LinkListParagraph because of the different primary keys (ParagraphID; ParagraphID+LinkID): > Error 1 Error 3003: Problem in Mapping Fragment starting at line 113: All the key properties (Paragraphs.ParagraphID) of the EntitySet Paragraphs must be mapped to all the key properties (LinkListParagraph.LinkID, LinkListParagraph.ParagraphID) of table LinkListParagraph. C:\Users\buc\Documents\Visual Studio 2008\Projects\ParagraphTest\ParagraphTest\ParagraphModel.edmx 114 15 ParagraphTest Is there a possiblity to solve this problem without changes to the database? What I want to do is something like this: ![alt text](https://i.stack.imgur.com/0Lkqj.png)
Entity Framework - Table Per Type Inheritance - Existing Database
CC BY-SA 3.0
null
2009-02-19T11:59:13.280
2015-06-19T20:21:05.753
2015-06-19T20:21:05.753
1,159,643
65,451
[ ".net", "entity-framework", "inheritance", "orm" ]
573,086
1
573,150
null
84
82,339
This question applies to Windows Vista! I have an application which normally works without administrative privileges. There is one activity which does need administrative privilege but I don't want to start the application itself with higher privileges when I know most of time user wont even be using that feature. I am thinking about certain method by which I can elevate the privileges of application on some event (such as press of a button). Example: ![](https://i.stack.imgur.com/7wMTs.jpg) If user clicks this button then he is prompted with UAC dialog or consent. How can I do this?
How to elevate privileges only when required?
CC BY-SA 3.0
0
2009-02-21T14:13:34.147
2020-11-03T19:02:04.060
2017-12-20T07:47:46.543
1,401,510
23,671
[ "c#", ".net", "windows-vista", "uac", "privileges" ]
573,346
1
573,355
null
0
550
I use this code to copy and instance of my class ``` //Create the copy and pass it onto edit controller PoolFacility *poolCopy = [self.thePoolFacility copy]; self.childController.thePoolFacilityCopy = poolCopy; [poolCopy release]; ``` Now when I view the variables in the debugger, how come some of the class' fields have the same memory address? Shouldn't they be independent? According to Apple > The NSCopying protocol declares a method for providing functional copies of an object. The exact meaning of “copy” can vary from class to class, but a copy must be a functionally independent object with values identical to the original at the time the copy was made. The two instances are poolCopy & the original thePoolFacility ![alt text](https://farm4.static.flickr.com/3351/3297076791_7db25a3604.jpg?v=0) My class copy method looks like this: ``` - (id)copyWithZone:(NSZone *)zone { PoolFacility *copy = [[[self class] allocWithZone:zone]init]; copy.name = [self.name copy]; copy.type = [self.type copy]; copy.phoneNumber = [self.phoneNumber copy]; //make sure I get proper copies of my dictionaries copy.address = [self.address mutableCopy]; copy.webAddress = [self.webAddress copy]; copy.prices = [self.prices mutableCopy]; copy.pools = [self.pools mutableCopy]; return copy; } ```
Memory management. Copy method
CC BY-SA 2.5
null
2009-02-21T16:43:03.677
2009-02-21T17:01:52.323
2017-02-08T14:10:27.807
-1
51,420
[ "iphone", "objective-c", "cocoa-touch" ]
575,371
1
null
null
0
305
Ok so I've got a really annoying bug in my app. It's driving me crazy and I'm sure it's beyond my skill level as I am learning as I go. Here is the initial rundown of the bug: [A shot in the dark - Application bug](https://stackoverflow.com/questions/573837/a-shot-in-the-dark-application-bug) However I have found a way to consistently reproduce the bug (only on the device not in the simulator) First you create a new Pool and save it. Then add 20 blank time entires into one day. Save it and this is where the problems begin. (when you go back to the main detail view the tableview has put itself out of editing mode with being told to do so). Now if you go back to the day to see the time entries you just added they are still there. If you go back to the main overall tableview listing all pools and now go back to the day you added the times they have dissapeared. Add one time and it all saves fine. Add twenty and it doesn't save. WTF!! Main Menu listing Pools: ![https://farm4.static.flickr.com/3503/3301053744_0325d5bc2c.jpg?v=0](https://farm4.static.flickr.com/3503/3301053744_0325d5bc2c.jpg?v=0) Detail view: ![https://farm4.static.flickr.com/3546/3300222271_223d2c74e9.jpg?v=0](https://farm4.static.flickr.com/3546/3300222271_223d2c74e9.jpg?v=0) Edit View: ![https://farm4.static.flickr.com/3625/3300222887_b02c3e2052.jpg?v=0](https://farm4.static.flickr.com/3625/3300222887_b02c3e2052.jpg?v=0) Time Edit View: ![https://farm4.static.flickr.com/3547/3301056092_8d3ab78225.jpg?v=0](https://farm4.static.flickr.com/3547/3301056092_8d3ab78225.jpg?v=0) Add a time: ![https://farm4.static.flickr.com/3635/3300224157_14c30cf58f.jpg?v=0](https://farm4.static.flickr.com/3635/3300224157_14c30cf58f.jpg?v=0) I'd appreciate any more guesses. But as well as this question I'm offering a bounty of £25 (Sorry I'm a poor student) to whoever is good enough to fix this bug first! if your interested my email is danmorgz[at]gmail.com Thanks, Dan
iPhone Bug App bug Question and challenge
CC BY-SA 2.5
null
2009-02-22T18:17:21.197
2009-02-24T17:10:51.810
2017-05-23T12:33:39.247
-1
51,420
[ "iphone", "objective-c", "cocoa-touch" ]
575,794
1
null
null
4
5,602
I have a tabbed application with each tab having a navigation controller. I use helper code to push a view/controller pair onto the navigation stack yet when I call this same code from two different places I get (suprizingly) different results. In one case the view renders lower than in the other case, seemingly lower by a navigation bar height. Pushed from one tab (in good position) : ![](https://content.screencast.com/users/adam_jack/folders/Jing/media/3f9fb818-5678-47b7-8b83-37d34eae2baf/00000006.png) Pushed from another tab (too low): ![](https://content.screencast.com/users/adam_jack/folders/Jing/media/88382e93-231e-4b7d-a003-b2b1f638f932/00000005.png) The XIB: ![](https://content.screencast.com/users/adam_jack/folders/Jing/media/bba933c4-0a71-4caf-a7a6-a5141f5bc37b/00000007.png) Here is the push code: ``` + (void)navigateToLocation:(Location*)location controller:(UIViewController*)vc withDelegate:(NSObject <LocationEditDelegate> *)delegate { LocationDetailsViewController *detailsController = [[LocationDetailsViewController alloc] initWithNibName:@"LocationDetailsViewController" bundle:nil]; detailsController.title = [location display]; detailsController.location = location; detailsController.delegate = delegate; // Push the detail view controller [[vc navigationController] pushViewController:detailsController animated:YES]; [detailsController release]; } ``` Can anybody help me understand what might be going on, and how I get inside this? I have 2.2.1 installed and build/deploy using 2.2. Since comments do not appear to show, I am annotating at the bottom. Edit this if I am doing things incorrectly: -
iPhone NavigationController - same view pushed, different layouts received
CC BY-SA 2.5
null
2009-02-22T21:06:15.020
2010-01-01T09:39:06.710
2017-02-08T14:10:31.573
-1
29,017
[ "iphone" ]
580,863
1
null
null
1
680
i am doing an editor kind of project application in wpf in which i am allowing user to drag their controls (i have defined my own controls that allows user to customize their screens) to the Canvas window i.e I have toolbar and canvas area.i have placed controls in the toolbar and those controls can be dragged and dropped on the canvas. i am done with dragging and dropping stuff and currently looking for the feature that allows me to snap one control from the boundaries of another control while placing a control to Canvas. i.e. when i am placing 2nd control benith/after of the 1st one and if 2nd control is coming in same vertical/horizontal line in that case system should show floating visible line to properly place control in one line. The feature i have seen in Visual Studio form desigining such as, ![alt text](https://lh6.ggpht.com/_dhQa0bESjYQ/SaOofLCWn_I/AAAAAAAAAF8/itjEAX-EWog/s400/snapObject.JPG) Please, advice me how to do this thing. Thanks in advance, Mandar.........
Snap to Object/Control feature
CC BY-SA 2.5
0
2009-02-24T08:01:09.087
2009-02-24T10:19:19.957
2017-02-08T14:10:33.623
-1
null
[ "c#", "wpf" ]
582,380
1
582,581
null
2
1,692
Can someone give me a bit more information on this error please? Console only logs Program exited with status value:101. If you imagine I have a nsmutablearray: ![alt text](https://farm4.static.flickr.com/3547/3301056092_8d3ab78225.jpg?v=0) It holds TimeEntry objects: ``` #import <Foundation/Foundation.h> #import "Constants.h" /* #define KTimeEntryInformationKey @"TEInformation" #define KTimeEntryFromKey @"TEFrom" #define KTimeEntryToKey @"TETo" */ @interface TimeEntry : NSObject <NSCopying, NSCoding> { NSDate *from; NSDate *to; NSString *information; } @property (nonatomic, retain) NSDate *from; @property (nonatomic, retain) NSDate *to; @property (nonatomic, copy) NSString *information; @end ``` The app gives me the error only when I add 15-20+ TimeEntry objects to the array and gives me the error when the above viewController (pictured) is popped.
"Program has exited with status 101"
CC BY-SA 2.5
null
2009-02-24T16:11:19.987
2009-03-28T06:11:27.757
2017-02-08T14:10:30.180
-1
51,420
[ "iphone", "objective-c", "cocoa-touch", "xcode" ]
583,597
1
null
null
33
28,741
I've got a WPF TextBox into which my users type XHTML. XAML... ``` <TextBox Name="TextBoxContentBody" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" FontFamily="Consolas" ... /> ``` It looks like this: ![enter image description here](https://i.stack.imgur.com/uc4Wv.gif) I'd rather that it looked like this (Photoshopped mock-up): ![enter image description here](https://i.stack.imgur.com/ftHIC.gif) How might I accomplish this?
Can I color different parts of text in a WPF TextBox?
CC BY-SA 3.0
0
2009-02-24T21:04:15.803
2021-04-08T06:23:10.623
2011-08-07T13:30:50.027
1,122
83
[ ".net", "wpf", "xml", "textcolor" ]
586,572
1
586,589
null
138
124,707
I'm currently writing a project report, and to explain the slightly crazy un-intuitive code that I've used I need to put lots and lots of short excerpts of example code in. How I can get code into LaTeX that: - - - EDITED (Figured I'd add the settings so people don't have to try and figure them out themselves (taken from wikibooks (link further down) and edited for niceness)) Nice settings: ``` \usepackage{color} \usepackage{listings} \lstset{ % language=C++, % choose the language of the code basicstyle=\footnotesize, % the size of the fonts that are used for the code numbers=left, % where to put the line-numbers numberstyle=\footnotesize, % the size of the fonts that are used for the line-numbers stepnumber=1, % the step between two line-numbers. If it is 1 each line will be numbered numbersep=5pt, % how far the line-numbers are from the code backgroundcolor=\color{white}, % choose the background color. You must add \usepackage{color} showspaces=false, % show spaces adding particular underscores showstringspaces=false, % underline spaces within strings showtabs=false, % show tabs within strings adding particular underscores frame=single, % adds a frame around the code tabsize=2, % sets default tabsize to 2 spaces captionpos=b, % sets the caption-position to bottom breaklines=true, % sets automatic line breaking breakatwhitespace=false, % sets if automatic breaks should only happen at whitespace escapeinside={\%*}{*)} % if you want to add a comment within your code } \begin{lstlisting} !!code!! \end{lstlisting} ``` An example of these settings: ![](https://i.stack.imgur.com/VqQPo.png)
Make code in LaTeX look *nice*
CC BY-SA 3.0
0
2009-02-25T15:49:17.317
2013-10-02T21:11:02.350
2012-11-13T02:03:16.353
162,273
70,847
[ "latex", "listings" ]
587,703
1
596,743
null
4
4,096
I'm writing some software that automatically connects a Bluetooth device using the Windows [Bluetooth API](http://msdn.microsoft.com/en-us/library/aa362932(VS.85).aspx). When it connects, Windows automatically starts installing the Bluetooth HID device driver, as expected: ![Installing Bluetooth HID drivers](https://i.stack.imgur.com/aZuTq.gif) This takes about 10-15 seconds, after which Windows displays the familar "ready for use" message: ![Hardware installed and ready for use](https://i.stack.imgur.com/Vb5Ex.gif) The problem is that `BluetoothSetServiceState()` returns as soon as the driver install , not when the device is actually ready for use. This causes some problems for my code, because it invokes a separate library for device communication as soon as it's "connected". The first few calls fail because the drivers haven't finished installing, and making those connection attempts appears to interfere with the driver installation, because if I try to use the communication library before the driver installation has finished Windows wants to restart before the device can be used. What I'm looking for is a way to hook that "ready to use" event, when driver installation has actually finished, so I don't make my communication library calls prematurely. Is there some Windows API call I can use to either register a function callback or directly polling the state of driver installation? I'm writing this in vanilla C/C++, no .NET. Thanks for your help!
Windows API: Detecting when a driver install has finished
CC BY-SA 3.0
0
2009-02-25T20:28:28.363
2015-06-19T20:21:08.173
2015-06-19T20:21:08.173
1,159,643
1,384
[ "c++", "windows", "bluetooth", "driver" ]
589,900
1
null
null
32
9,717
By here I mean something resembling these images: ![](https://upload.wikimedia.org/wikipedia/commons/thumb/e/e4/Directed_graph_with_back_edge.svg/298px-Directed_graph_with_back_edge.svg.png) ![](https://upload.wikimedia.org/wikipedia/commons/thumb/d/dc/Directed_cycle.svg/200px-Directed_cycle.svg.png) ![](https://upload.wikimedia.org/wikipedia/commons/thumb/b/bc/UnitedStatesGraphViz.svg/250px-UnitedStatesGraphViz.svg.png) The ideal solution would: - - - - I'm also interested in hearing about projects that could potentially be used as the starting point for this kind of work. If it requires some development to achieve what I want, then I'm prepared to tackle it. The most complex portion of this goal seems to be obtaining the graph layout in a reasonable time frame.
What options are available for the layout of directed or undirected graphs in .NET?
CC BY-SA 2.5
0
2009-02-26T10:04:17.433
2017-03-28T22:51:41.507
2017-03-28T22:51:41.507
1,571,709
24,874
[ ".net", "rendering", "graph-theory", "directed-graph", "graph-layout" ]
593,341
1
null
null
4
4,003
I'm trying to get a notification to pop up something like these bubbles in an : ![unused icons bubble image](https://girtby.net/images/unused-icons.png) [](https://i.stack.imgur.com/ZCjXX.png) [humanized.com](http://www.humanized.com/weblog/images/caps_lock_indication.png) I'm currently making an interface mockup in C# to show some stakeholders, so it would be nice to have it there too. It doesn't necessarily have to be speech-bubble-esque: it could be something like a tooltip - but it does have to appear without mouse-over Cheers!
"Speech bubble" notifications
CC BY-SA 4.0
0
2009-02-27T02:55:30.373
2019-03-04T02:00:14.157
2019-03-04T02:00:14.157
4,751,173
14,902
[ "c#", ".net", "c++", "mfc", "notifications" ]
593,637
1
594,942
null
0
3,298
I'm working on an iPhone game, and trying to use a UIScrollView to display some icons, which I then want to enable the user to drag off the bar being scrolled, onto another view (basically, dragging them from their hand into play on the game board). The problem is that the UIScrollView clips everything outside it's own bounds. Here is a picture of what I'm trying to do: ![alt text](https://farm4.static.flickr.com/3562/3313514304_9378e78527.jpg) Functionally, it actually works, in that you can drag the icons up to the white board fine...but you can't see them as you are dragging...which is not acceptable. Does anyone know if you can temporarily disable the clipping that a scroll view does, or is there some way to get around it? Hacky or not, I would really like to make it happen. Does anyone have any other possible solutions for this? Or maybe any alternate approaches? I've considered if maybe a page view might work, but haven't tried it yet...and it's not at all as good of a solution as the scroll view. Worst case I can just go back to not having the bar scrollable, but that really puts a damper on some of my game mechanics, and I'm really not too excited about that.
iPhone SDK: disabling cllipping for UIScrollView
CC BY-SA 2.5
null
2009-02-27T05:48:53.640
2009-02-27T14:20:44.000
2017-02-08T14:10:37.370
-1
58,516
[ "iphone", "objective-c" ]
594,450
1
595,441
null
12
1,880
Looking for online resources to implement a virtual drive functionality similar to ones implemented in products listed ![here](https://stackoverflow.com/questions/593971/what-online-file-storage-system-do-use-use/593999#593999) The solution should be cross OS (win, pc, linux) preferably using a well behaving framework. Currently the answer to this question is widely dispersed with no clear option on what to use: Current suggestions I've found: 1. Fuse (not really sure on the status of various windows ports) 2. Dokan library 3. Custom namespace extensions (windows only, sources in various CodeProject articles) 4. Commercial frameworks (windows) - LogicNP, Eldos 5. WebDav Please list one suggestion per answer and I'll update the question accordingly. The purpose of the question is to create the best reference point for such questions... It seems WebDav would be easiest to implement cross OS so further information on this would be appreciated.
Cross OS virtual drive functionality
CC BY-SA 2.5
0
2009-02-27T11:52:23.437
2011-01-22T11:52:18.913
2017-05-23T10:29:31.003
-1
23,164
[ "language-agnostic", "cross-platform", "virtual-drive" ]
595,253
1
595,727
null
2
5,044
Given the following HTML page a horizontal line appears at the top of the table where the 1st row would have a 2nd and 3rd cell (if they were defined). ``` <html> <head> <Title>Test Page</Title> <style type="text/css"> table { margin:10px 0 10px 0; padding:0; margin: 0 0 0 0; border-collapse: collapse; border: 0; } td { border:1px solid #CCCCCC; padding:5px; } </style> </head> <body> <table> <tr> <td>Test Title</td> </tr> <tr> <td>Sub Title</td> <td>Sub Title</td> <td>Sub Title</td> </tr> <table> </body> </html> ``` I would like the line (highlighted below) removed by modifying CSS only. This line appears in Firefox but not IE6. ![Example Image](https://i.stack.imgur.com/w5Uzj.jpg) Note that I cannot modify the HTML in any way as this is generated by a third party system (the example above is simply to highlight the issue). This third-party system only allows me to modify the CSS.
Hide border on table where no cell exists in Firefox and border-collapse: collapse;
CC BY-SA 3.0
0
2009-02-27T15:37:41.600
2015-06-19T20:21:37.747
2015-06-19T20:21:37.747
1,159,643
5,993
[ "html", "css", "firefox" ]
596,970
1
597,004
null
5
6,273
I have a DIV container of 100% width holding x divs. The last child DIV floats right, the rest float left. All child DIV's remain in a line so long as they fit in the bar (all oriented left, except for the last div which sits by itself on the right). If the window is resized smaller and the children don't have enough room, they collapse from their horizontal orientation (which I don't want). To fix this, I know I can set a min-width of the DIV container, the issue is that there is a variable amount of DIVs in the container, of variable width. I'd like to simulate being able to set a min-width where of the container where min-width = width of all children, but I cannot compute these because they are variable (which would simulate flexible space between the right div and the rest, but not let them get closer than they should be allowed (hence collapsing the divs)). I know this is a little unclear so here's a picture: ![http://img3.imageshack.us/img3/933/barfuo.jpg](https://i.stack.imgur.com/sCVxE.jpg) Thanks!
CSS: Simulating flexible width (without min-width)-
CC BY-SA 3.0
null
2009-02-27T22:44:19.860
2013-07-20T02:17:07.543
2013-07-20T02:17:07.543
2,556,654
72,065
[ "css" ]
597,369
1
597,401
null
15
23,836
As I see it, there are two ways to handle mouse events to draw a picture. The first is to detect when the mouse moves and draw a line to where the mouse is, shown [here](http://www.cs.iupui.edu/~aharris/pygame/ch05/paint.py). However, the problem with this is that with a large brush size, many gaps appear between each "line" that is not straight since it is using the line's stroke size to create thick lines. The other way is to draw circles when the mouse moves as is shown [here](http://www.ida.liu.se/~ETE257/timetable/LecturePythonPygame2.html). The problem with this is that gaps appear between each circle if the mouse moves faster than the computer detects mouse input. Here's a screenshot with my issues with both: ![http://imgur.com/32DXN.jpg](https://i.stack.imgur.com/7ILzZ.png) What is the best way to implement a brush like MS Paint's, with a decently-big brush size with no gaps in the stroke of the line or no gaps between each circle?
How to create MS Paint clone with Python and pygame
CC BY-SA 3.0
0
2009-02-28T02:13:08.673
2021-02-27T23:47:41.137
2011-12-07T23:44:30.623
84,042
68,185
[ "python", "mouse", "pygame", "draw", "paint" ]
599,348
1
599,370
null
0
2,589
Never asked a question here before, I'll try to lay this out as succinctly as possible. I've got a Recipe class, that contains lists of three different types of Ingredient Uses. These classes all inherit from the base, IngredientUse. So the mapping looks like this: ``` <class name="IngredientUse" table="IngredientUses"> <id name="Id" type="Int64" column="Id"> <generator class="native"/> </id> <!--some other properties--> <property name="RecipeId" column="RecipeId"/> <joined-subclass name="AdditionUse" table="AdditionUses"> <key column="Id" foreign-key="FK_AdditionUses_IngredientUses"/> <many-to-one name="AdditionUsed" column="AdditionUsed" class="Addition" foreign-key="FK_AdditionUses_Additions"/> </joined-subclass> </class> ``` The one causing problems here is the RecipeId. From the recipe, I have three separate lists of uses for different ingredient types, defined like so: ``` <bag name="AdditionsUsed" cascade="all" lazy="false"> <key column="RecipeId"/> <one-to-many class="AdditionUse"/> </bag> ``` Now, I'm running into problems trying to load these lists. It has something to do with the inheritance. When I look at the SQL Generated, I see this: ``` SELECT additionsused0_.RecipeId as RecipeId1_ --other columns not really important FROM AdditionUses additionsused0_ inner join IngredientUses additionsused0_1_ on additionsused0_.Id=additionsused0_1_.Id WHERE additionsused0_.RecipeId=@p0; @p0 = '11' ``` Notice that its' looking for the RecipeId in the subclass' table, and not the base table where the column is actually contained. I know I could just define a separate table for each ingredient type, but that will cause me problems because there are some situations (ie pricing) where I don't need the additional columns in the subclass table, and would like to be able to load all the ingredients into the same list at once. I'm certain I must be missing something here, figured someone more familiar with NHibernate on this site might recognize it right off the bat. Thanks in advance. in case I wasn't clear about what I'm trying to do, this diagram might help (excuse my shoddy UML, hope it doesn't muddy the waters). There is also an Ingredient base class, and the same subtypes off of that. ![diagram](https://farm4.static.flickr.com/3565/3319584915_ac1a3ce005.jpg?v=0)
NHibernate One-To-Many with Joined Subclass
CC BY-SA 2.5
null
2009-03-01T06:07:15.480
2010-01-20T04:43:06.483
2017-02-08T14:10:40.153
-1
794
[ ".net", "nhibernate" ]
600,274
1
600,282
null
61
21,942
I'm a very frequent user of the GNU [Autotools](http://en.wikipedia.org/wiki/GNU_build_system) (mostly [Autoconf](http://en.wikipedia.org/wiki/Autoconf), occasionally [Libtool](http://en.wikipedia.org/wiki/GNU_Libtool)). I'm working on a project where portability is going to be a sticking point.. Yet, the rest of the team is just not comfortable working with [m4](http://en.wikipedia.org/wiki/M4_%28computer_language%29#Free_software_implementations). I got [this](http://xkcd.com/297/) in my inbox from not one, but four people: ![m4 is NOT lisp, dammit!](https://imgs.xkcd.com/comics/lisp_cycles.png) Anyway, perhaps someone could recommend something Python or PHP based? I'm working on the C end of a much larger tree; I can be sure either Python or PHP 5 will be present, as they are prerequisites.
Alternatives to Autoconf and Autotools?
CC BY-SA 3.0
0
2009-03-01T18:52:10.620
2014-07-21T15:50:32.353
2017-02-08T14:07:51.283
-1
50,049
[ "c", "autotools", "autoconf" ]
603,528
1
664,455
null
2
5,131
I've got a `QComboBox` with a custom list object. ![Screenshot.](https://i.stack.imgur.com/r71L2.png) The custom list object has a custom `mousePressEvent` so that when the user click on one of the circles with a +/- (a twisty), the list is expanded/collapsed. When I use the list with the combo box, when the user clicks on a twisty, the list is expanded/collapsed, but the selection is changed, and the list is hidden. How can I filter this so that when the user click on a twisty, the selection is not changed, and the list not hidden. ## Additional screenshots All of the nodes collapsed: ![All nodes collapsed.](https://i.stack.imgur.com/tz1Qs.png) List hidden: ![Screenshot with the list hidden.](https://i.stack.imgur.com/sJFuw.png)
Using PyQT, how do you filter mousePressEvent for a QComboBox with custom list
CC BY-SA 3.0
0
2009-03-02T18:55:19.090
2014-08-20T18:22:53.020
2014-08-20T18:22:53.020
3,489,230
72,911
[ "python", "qt", "qt4", "pyqt", "qcombobox" ]
609,168
1
609,304
null
4
4,781
I have a button that I want to change the background of to show that it is disabled when a user clicks on it. It works fine in IE/FF but in chrome it seems that it can't find the background image and makes the background nothing. ![alt text](https://secure.readyinteractive.com/images/buttons.jpg) I am just doing a simple css set in jQuery 1.2.6 ``` $(".CheckoutBt").css("background-image", "url(/Portals/_default/images/buttons/checkout-end-disabled.gif)"); ```
JQuery in Google Chrome can't find background image
CC BY-SA 2.5
null
2009-03-04T03:57:29.277
2009-04-26T03:44:08.430
2009-04-26T03:44:08.430
38,971
42,707
[ "jquery", "google-chrome", "css" ]
611,298
1
611,309
null
104
146,010
If you set `ResizeMode="CanResizeWithGrip"` on a WPF `Window` then a resize grip is shown in the lower right corner, as below: ![](https://i.stack.imgur.com/kwmCH.png) If you set `WindowStyle="None"` as well the title bar disappears but the grey bevelled edge remains until you set `ResizeMode="NoResize"`. Unfortunately, with this combination of properties set, the resize grip also disappears. I have overridden the `Window`'s `ControlTemplate` via a custom `Style`. I want to specify the border of the window myself, and I don't need users to be able to resize the window from all four sides, but I do need a resize grip. Can someone detail a simple way to meet all of these criteria? 1. Do not have a border on the Window apart from the one I specify myself in a ControlTemplate. 2. Do have a working resize grip in the lower right corner. 3. Do not have a title bar.
How to create a WPF Window without a border that can be resized via a grip only?
CC BY-SA 3.0
0
2009-03-04T16:17:53.320
2020-03-09T15:42:25.897
2017-07-20T12:17:31.657
6,083,675
24,874
[ ".net", "wpf", "window", "controltemplate", "resizegrip" ]
611,472
1
3,956,937
null
29
4,256
: It is not possible to use other trusted certificate authorities now. Question and answer is not obsolete: WinQual still rejects the signature: ![enter image description here](https://i.stack.imgur.com/vkivZ.png) when we've already established that it is a valid digital signature: ![enter image description here](https://i.stack.imgur.com/Ld1JC.png) For completeness, i will leave the edit below that did; just to point out how wrong he was. And he can live with that shame: --- --- In 2005 i tried to establish a WinQual account with Microsoft, so i could pick up our (if any) crash dump files submitted automatically through Windows Error Reporting (WER). i was not allowed to have my crash dumps, because i don't have a Verisign certificate. Instead i have a cheaper one, generated by a Verisign subsidiary: Thawte. --- The method in which you join is: you digitally sign a sample exe they provide. This proves that you are the same signer that signed apps that they got crash dumps from in the wild. Cryptographically, the private key is needed to generate a digital signature on an executable. Only the holder of that private key can create a signature with for the matching public key. It doesn't matter who generated that private key. That includes certificates that are generated from: - - [Wells Fargo](http://en.wikipedia.org/wiki/Wells_Fargo)- - - - [QuoVadis](http://en.wikipedia.org/wiki/QuoVadis)- [GoDaddy](http://en.wikipedia.org/wiki/GoDaddy)- [Entrust](http://en.wikipedia.org/wiki/Entrust)- [Cybertrust](http://en.wikipedia.org/wiki/Cybertrust)- [GeoTrust](http://en.wikipedia.org/wiki/GeoTrust)- [GlobalSign](http://en.wikipedia.org/wiki/GlobalSign)- [Comodo](http://en.wikipedia.org/wiki/Comodo)- [Thawte](http://en.wikipedia.org/wiki/Thawte)- Yet Microsof's WinQual only accepts digital certificates generated by Verisign. Not even Verisign's subsidiaries are good enough (Thawte). Can anyone think of any technical, legal or ethical reason why Microsoft doesn't want to accept code-signing certificates? The WinQual site says: > A digital certificate helps protect your company from individuals who seek to impersonate members of your staff or who would otherwise commit acts of fraud against your company. Using a digital certificate enables proof of an identity for a user or an organization. Is somehow a Thawte digital certificate not secure? --- Two years later, i sent a reminder notice to WinQual that i've been waiting to be able to get at my crash dumps. The response from WinQual team was: > Hello,Thanks for the reminder. We have notified the appropriate people that this is still a request. --- In 2008 i [asked this question](http://social.msdn.microsoft.com/Forums/en-US/isvwindowserrors/thread/92419a64-af22-4527-bcf4-eeeb0d2423cd/) in a Microsoft support forum, and the response was: > We are only setup to accept VeriSign Certificates at this point. We have not had an overwhelming demand to support other types of certificates. What can it possibly mean to not be "setup" to accept other kinds of certificates? If the thumbprint of the key that signed the WinQual.exe test app is the same as the thumbprint that signed the executable who's crash dump you got in the wild: it is proven - And it's not like there's a special API to check if a Verisign digital signature is valid, as opposed to all other digital signatures. A valid signature is valid no matter who generated the key. Microsoft free to not the signer, but that's not the same as identity. --- So that is my question, can anyone think of any practical reason why WinQual isn't setup to support digital signatures? One person theorized that the answer is that they're just lazy: > Not that I know but I would assume that the team running the winQual system is a live team and not a dev team - as in, personality and skillset geared towards maintenance of existing systems. I could be wrong though. They don't want to do work to change it. But can anyone think of anything that would need to be changed? It's the same logic no matter what generated the key: "does the thumbprint match". What am i missing? --- ## Update It is nice to hear the stories of other developers. This way i know that i'm not alone, and the question can serve as a vehicle for change on Microsoft's part. And even if my original intent was a complaining rant, in order to keep this a valid StackOverflow question i'm looking for a technical reason Microsoft could only accept Verisign certificates. The crypto API doesn't care what the name of the company that issued a certificate is: it only cares that the chain of signers leads back to a trusted root. What could possibly be going on that Microsoft specifically isn't using the established crypto infrastructure, but instead is limited itself to Verisign? If anyone could point to any blog entry, where a program manager or developer explains , i would, perhaps, be satisfied. --- ## Update Two People seem to be missing the point of my question. Windows already has the code infrastructure to ensure that a digital signing certificate is trusted by a root authority. Here's a screenshot of a digital signature on one of our signed executables. You can see our certificate was signed by Thawte's Code-Signing authority certificate, which in turn is signed by Thawte: [](https://i.stack.imgur.com/79a2A.png) And the "thawte" certificate ships by default with Windows: [](https://i.stack.imgur.com/rAIpA.png) The is good enough that every copy of Windows and Internet Explorer already trust it. And there already is an established API to check if a certificate is valid (i.e. trusted). When WinQual guys came along, they would have had to have to avoid checking the correct way, and instead rolled their own solution, hard-coding only Verisign as a trusted root. would they go to ignore the other trusted root authorities, authorities that ship that their code is running on, and instead hard-code Verisign? Rather than do it the way everyone else does (Windows Explorer, Firefox, Chrome, Internet Explorer, Opera, CertMgr, etc), they only allow Verisign. And my question is why. `Why would WER not accept code-signing certificates?` If it was simply: - - - - - - - - - - - - ...that would be fine. Except i don't believe it. i don't believe that it was test code that made into production. i get the sense that it is a conscious, specific, decision that made them ignore other signers. And that they do, and will continue to, only honor Verisign. But for the life of me i can't think of the reason.
WinQual: Why would WER not accept code-signing certificates?
CC BY-SA 4.0
0
2009-03-04T16:54:30.453
2019-03-04T23:01:01.543
2019-03-04T23:01:01.543
4,751,173
12,597
[ "windows", "error-reporting", "winqual", "bumptop" ]
611,878
1
612,033
null
34
9,527
I need to make a chart with an optimized axis maximum value. The current method I have of making charts simply uses the maximum value of all the graphs, then divides it by ten, and uses that as grid lines. I didn't write it. These graphs have been changed. As soon as I fixed the code, my dynamic graphs started working, making this question nonsensical (because the examples no longer had any errors in them). I've updated these with static images, but some of the answers refrence different values. Keep that in mind. [](https://i.stack.imgur.com/W5fPK.png) There were between 12003 and 14003 inbound calls so far in February. Informative, but ugly. I'd like to avoid charts that look like a monkey came up with the -axis numbers. Using the Google charts API helps a little bit, but it's still not quite what I want. ![Google API Chart](https://i.stack.imgur.com/RLX3h.png) The numbers are clean, but the top of the y value is always the same as the maximum value on the chart. This chart scales from 0 to 1357. I need to have calculated the proper value of 1400, . --- I'm throwing in [rbobby](https://stackoverflow.com/questions/611878/reasonable-optimized-chart-scaling/611979#611979)'s defanition of a 'nice' number here because it explains it so well. - - - - ## Solution [](https://i.stack.imgur.com/ubIkH.png) I found the way to get the results that I want using a modified version of Mark Ransom's idea. Fist, Mark Ransom's code determines the optimum spacing between ticks, when given the number of ticks. Sometimes this number ends up being more than twice what the highest value on the chart is, depending on how many grid lines you want. What I'm doing is I'm running Mark's code with 5, 6, 7, 8, 9, and 10 grid lines (ticks) to find which of those is the lowest. With a value of 23, the height of the chart goes to 25, with a grid line at 5, 10, 15, 20, and 25. With a value of 26, the chart's height is 30, with grid lines at 5, 10, 15, 20, 25, and 30. It has the same spacing between grid lines, but there are more of them. So here's the steps to just-about copy what Excel does to make charts all fancy. 1. Temporarily bump up the chart's highest value by about 5% (so that there is always some space between the chart's highest point and the top of the chart area. We want 99.9 to round up to 120) 2. Find the optimum grid line placement for 5, 6, 7, 8, 9, and 10 grid lines. 3. Pick out the lowest of those numbers. Remember the number of grid lines it took to get that value. 4. Now you have the optimum chart height. The lines/bar will never butt up against the top of the chart and you have the optimum number of ticks. PHP: ``` function roundUp($maxValue){ $optiMax = $maxValue * 2; for ($i = 5; $i <= 10; $i++){ $tmpMaxValue = bestTick($maxValue,$i); if (($optiMax > $tmpMaxValue) and ($tmpMaxValue > ($maxValue + $maxValue * 0.05))){ $optiMax = $tmpMaxValue; $optiTicks = $i; } } return $optiMax; } function bestTick($maxValue, $mostTicks){ $minimum = $maxValue / $mostTicks; $magnitude = pow(10,floor(log($minimum) / log(10))); $residual = $minimum / $magnitude; if ($residual > 5){ $tick = 10 * $magnitude; } elseif ($residual > 2) { $tick = 5 * $magnitude; } elseif ($residual > 1){ $tick = 2 * $magnitude; } else { $tick = $magnitude; } return ($tick * $mostTicks); } ``` Python: ``` import math def BestTick(largest, mostticks): minimum = largest / mostticks magnitude = 10 ** math.floor(math.log(minimum) / math.log(10)) residual = minimum / magnitude if residual > 5: tick = 10 * magnitude elif residual > 2: tick = 5 * magnitude elif residual > 1: tick = 2 * magnitude else: tick = magnitude return tick value = int(input("")) optMax = value * 2 for i in range(5,11): maxValue = BestTick(value,i) * i print maxValue if (optMax > maxValue) and (maxValue > value + (value*.05)): optMax = maxValue optTicks = i print "\nTest Value: " + str(value + (value * .05)) + "\n\nChart Height: " + str(optMax) + " Ticks: " + str(optTicks) ```
Reasonable optimized chart scaling
CC BY-SA 4.0
0
2009-03-04T18:37:21.690
2019-03-11T19:06:30.967
2019-03-11T19:06:30.967
30
30
[ "algorithm", "math", "charts" ]
613,464
1
613,504
null
1
4,165
In a listbox, when I select an item I still get some kind of border or space around my listboxitem creating the line you see in the image. I want to remove that line I put a circle around. It already has `HorizontalContentAlignment = "Stretch"` by the way. What am I doing wrong? ### The problem: ![alt text](https://lh3.ggpht.com/_ZjKW281-SXM/Sa9CsgxF42I/AAAAAAAAAMg/a2uH99NzAlA/FillProblem.jpg)
WPF ListBoxItem Not Filling
CC BY-SA 2.5
0
2009-03-05T03:15:04.270
2012-02-09T16:46:22.933
2020-06-20T09:12:55.060
-1
1,013
[ "wpf", "listbox" ]
613,759
1
null
null
1
1,196
Now I drag a file to the app icon in the dock, this app is based on document . I found that no little image on the left of window title after the app is run and the mainwindow is open . but when I drag a file to the dock icon before the app run and use this method to run the app , a little image on the left of window title to show the file ,just like the xcode etc. Now I want to show the little image both way or not to show the little image both way , How to do ? I think that it maybe the window property based on document , but I don't know how to fix it ? Thanks![alt text http:///Users/jinxin/Desktop/Mydocument.png](http:///Users/jinxin/Desktop/Mydocument.png) --- I used the `[mainWindow setTitle:tmp];`, but icon still appear. when I used `setTitleWithRepresentedFilename:` I found that both icon and window title name both are modify, in the document class I overload the `-(void)displayName;` so I want to the window title is fixed anytime.
How to show a title of document window without icon?
CC BY-SA 3.0
null
2009-03-05T06:18:33.737
2014-08-19T17:36:08.543
2011-11-17T15:22:14.927
54,680
51,958
[ "cocoa" ]