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
784,123
1
785,116
null
1
424
[WP-o-Matic](http://wordpress.org/extend/plugins/wp-o-matic/) is a wordpress plugin to auto post based on some configured feeds, it read feeds everything time interval i setup, its working on my blog, my blog is on shared windows web hosting, i want to know how it auto work like that, and because i am on a shared hosting, so sure i didn't setup any windows services on the server, so its just keep working just after activating, seams strange idea for me. ![alt text](https://content.screencast.com/users/amrelgarhy/folders/Jing/media/92cf4caa-da32-4451-b1a0-65538a7b2c72/2009-04-24_0327.png)
How WP-o-Matic works and how to do the same using ASP.Net? Cron job equivalent in .NET?
CC BY-SA 2.5
null
2009-04-24T00:34:57.327
2009-04-24T09:16:21.207
2017-02-08T14:11:38.747
-1
20,126
[ "asp.net", "wordpress" ]
784,920
1
784,930
null
0
375
Accidentally I pressed some keys while writing C# code in VS2008 and space characters replaced by . and enter key replaced by some square boxes, now how do I reset the editor ![alt text](https://lh4.ggpht.com/_M5W2QFQgto4/SfFzUDSaH5I/AAAAAAAADUg/cieNm6UXXHQ/dots.jpg)
How to avoid dots in VS2008
CC BY-SA 2.5
null
2009-04-24T08:11:22.533
2009-04-25T10:33:36.567
2017-02-08T14:11:39.080
-1
85,606
[ "c#", "visual-studio-2008" ]
786,783
1
null
null
2
1,539
I've got a database table with one huge column: . ![One Entity](https://i.stack.imgur.com/uDktk.gif) I'd rather lazy load that one column so I'm not querying all that when I get a list of all my images. I know I can put the data into its own column and entity like this: ![Two Entities](https://i.stack.imgur.com/1aJ3v.gif) But, do I have to?
Can I lazy load scalar properties with the ADO.Net Entity Framework?
CC BY-SA 3.0
0
2009-04-24T17:08:21.493
2015-06-19T21:01:15.070
2015-06-19T20:44:03.020
1,159,643
83
[ ".net", "entity-framework", "lazy-loading" ]
786,885
1
786,894
null
0
489
: Visual Studio 2008 SP1 with Resharper 4.1, .NET 3.5 I have a class with a static method, `GetProperty<T>` that returns a property value lazily. ``` private static T GetProperty<T>(T backingField, Func<T> factory) where T : class { if (backingField == null) backingField = factory(); return backingField; } ``` But when I use above method to return a property, I am getting two warnings that says that private backing fields are not assigned. But they are assigned later on only when they are needed. ![alt text](https://farm4.static.flickr.com/3616/3470693703_71b6cc553b_o.png) Is this warning ? -- Or -- Is my appoach to loading a property flawed?
Is my approach to lazy loading flawed?
CC BY-SA 2.5
0
2009-04-24T17:41:05.130
2009-04-24T18:56:15.243
2017-02-08T14:11:40.100
-1
4,035
[ "c#", "resharper", "lazy-loading", "warnings" ]
787,156
1
null
null
0
7,901
I have 2 tables, ticket and ticket_custom. Here are how the tables are set up.![alt text](https://lh3.ggpht.com/_BExRqkFgz70/SfIKYSErMxI/AAAAAAAAAHk/pALtXucgIS8/howTablesAreDefined.jpg) I have a web interface where I can change the state (value in the table ticket_custom) The web interface adds a new entry instead of updating the original entry. ``` ticket name value 1 state Ready for Final Verification 2 state Ready for Final Verification 1 state Verified ``` The last row is added So I need to modify the queries. ``` SELECT p.value AS __color__, id AS ticket, summary, component, version, c.value AS state, milestone, t.type AS type, owner, status, time AS created, changetime AS _changetime, description AS _description, reporter AS _reporter FROM ticket t, ticket_custom c LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' AND id = c.ticket WHERE status <> 'closed' AND id = c.ticket ORDER BY CAST(p.value AS int), milestone, t.type, time, c.ticket ``` The query now returns both entries. I tried to add a nested select in the where clause. ``` SELECT g.ticket FROM ticket_custom g WHERE g.ticket = id ORDER BY g.ticket DESC LIMIT 1 ``` So - ``` SELECT p.value AS __color__, id AS ticket, summary, component, version, c.value AS state, milestone, t.type AS type, owner, status, time AS created, changetime AS _changetime, description AS _description, reporter AS _reporter FROM ticket t, ticket_custom c LEFT JOIN enum p ON p.name = t.priority AND p.type = 'priority' AND id = c.ticket WHERE status <> 'closed' AND id = c.ticket and ( SELECT g.ticket FROM ticket_custom g WHERE g.ticket = id ORDER BY g.ticket DESC LIMIT 1 ) ORDER BY CAST(p.value AS int), milestone, t.type, time, c.ticket ``` Clearly I'm doing something wrong.
SQL - Nested select statement?
CC BY-SA 2.5
null
2009-04-24T19:08:26.590
2009-04-25T03:37:50.187
2017-02-08T14:11:40.440
-1
7,617
[ "sql", "nested" ]
789,816
1
null
null
14
78,915
I'm doing a job for a guy with a site online. It's an alien site to me, and I'm slowly working through the strange code. I have MAMP locally and my [http://localhost/](http://localhost/) has many client folders coming off from that. Inside this code there is a lot of $_SERVER['document_root'] commands and references like ![](/images/shopping.gif) which are just getting lost on my local PHP dev area. How can I easily set the document_root reference to what it should be (just locally though, don't really want to mess with the site files, as I'll need to upload them again and don't want to break live site! And is there a way of indirect setting where PHP thinks the root of the site is so the image's src references "/images/..." will show up properly... My local PHP dev URL for this site is: [http://localhost:8888/_CLIENTS/clientsite/www/](http://localhost:8888/_CLIENTS/clientsite/www/) ...but in the code the '/' at the beginning of '/images/...' is referencing [http://localhost:8888/](http://localhost:8888/) ?? Thank you.
How to set the DOCUMENT_ROOT and site root in my local PHP dev setup?
CC BY-SA 2.5
0
2009-04-25T22:12:15.280
2016-06-29T19:11:54.980
null
null
null
[ "php", "settings", "document", "localhost", "root" ]
790,951
1
790,972
null
5
361
I'm used to git, where you can run gitk and get something like the following: ![gitk showing the difference between the local and remote branches](https://1.bp.blogspot.com/_nzN39P0Ykuk/SfRuvDcGsOI/AAAAAAAABEs/nbPb0Jtd-7I/s200/gitk-diff-branch.png) Here you can see that there are a couple of changes that need pushing to the remote branch. Alternatively, I can use `git log --decorate` and the output would be: ``` b8c2926... (refs/heads/next) Update instructions 6d9f914... Add a first go at generic x compiling 49a6dac... (refs/remotes/github/next) Ignore temp files ``` Is there anything like this with Mercurial?
Using Mercurial, how can I see what changes have yet to be pushed?
CC BY-SA 2.5
0
2009-04-26T14:35:11.050
2009-04-26T14:42:45.883
2017-02-08T14:11:42.143
-1
4,596
[ "mercurial" ]
791,036
1
null
null
3
251
I'm not sure if this question is appropriate for Stack Overflow but I'll give it a try anyway. I have some data as follows: ![alt text](https://i.stack.imgur.com/c2Jaz.png) I also have another set of data that I believe follows a similar distribution but I only know the total percent (e.g. 30% rather than 17%.) Can anyone suggest an algorithm to estimate the %s for each individual tier based on the new total % and the original distribution?
Statistical estimation algorithm
CC BY-SA 3.0
null
2009-04-26T15:20:09.477
2015-06-19T20:59:45.537
2015-06-19T20:59:45.537
1,159,643
80,825
[ "algorithm", "math" ]
791,709
1
791,740
null
0
160
I am interested in the floating effect of SO when pressing the newest link: ![alt text](https://i.stack.imgur.com/3eJgh.png)
Unable to make a SO floating effect for browsing messages in jQuery
CC BY-SA 3.0
null
2009-04-26T22:15:26.623
2012-01-31T10:24:49.333
2012-01-31T10:24:49.333
368,070
54,964
[ "javascript", "jquery" ]
792,891
1
792,906
null
6
1,628
I'm not sure exactly what went wrong here, but ReSharper 4.5 RTM seems to have stolen my Visual Studio colour theme. I normally use [Fredrik Kalseth's wicked theme](http://www.frickinsweet.com/tools/Theme.mvc.aspx), and I've been using ReSharper since version 2.0. Never before has this happened - not even while using the 4.5 Beta. My scheme remained intact without detrimental interference - well, actually ReSharper did its normal highlighting which was actually quite complimentary! But this time, when building my new machine, the outcome looks like this: ![Dark colours meant for a light theme](https://i.stack.imgur.com/gjf8i.jpg) Yes I know that ReShaper colours can be configured under Tools->Font and Colors, but firstly, I don't want to have to do that, and secondly, I want to understand why this has happened only now, and never before. When I uninstall ReSharper, the colours go back to normal. I have tried removing the theme and resharper and reinstalling in different orders to no avail. I apply the theme with a code file open, and see a brief flash of the correct colours how they used to look, and then ReSharper takes over. I've tried [Ryan and Joel's AWESOME theme generator](http://www.frickinsweet.com/tools/Theme.mvc.aspx), but I see the same brief flash of the correct colours being applied after importing, and then the crappy colours overlay themselves again. I say they are crappy only in the context of a dark theme, on a light theme they look just fine. I just want to know how to have my cake and eat it like it's been all this time. I must stress, that the theme and resharper have been working hand in hand perfectly together all the time I've used it (6 months at least), it's only happened on my new machine - my old machine looks and works fine. Oh - and I have a fully licensed version of ReSharper - not a trial. Any help is much appreciated.
Resharper 4.5 has broken my colour scheme
CC BY-SA 3.0
null
2009-04-27T09:55:41.477
2015-06-19T21:12:44.733
2015-06-19T21:12:44.733
1,159,643
1,107
[ "visual-studio-2008", "resharper", "themes", "colors" ]
794,128
1
794,154
null
3
4,204
I am trying to create a general method for disposing an object that implements [IDisposable](http://msdn.microsoft.com/en-us/library/system.idisposable(loband).aspx), called `DisposeObject()` To make sure I am disposing an object pointed by original reference, I am trying to pass an object by reference. But I am getting a compilation error that says > The 'ref' argument type doesn't match parameter type In the below (simplified) code, both `_Baz` and `_Bar` implement [IDisposable](http://msdn.microsoft.com/en-us/library/system.idisposable(loband).aspx). ![alt text](https://farm4.static.flickr.com/3576/3479637489_d92cf9f406_o.png) So the questions are, 1. Why am I getting this error? 2. Is there a way to get around it? From provided answers so far, as long as I do not set an IDisposable argument to null, I can simply pass an object by value without using `ref`. I am now having another trouble whether to set disposable objects to `null` or not within `DisposeObject` method. Here is the full source for completeness: ``` public class Foo : IDisposable { private Bar _Bar; private Baz _Baz; private bool _IsDisposed; ~Foo() { Dispose(false); } public void Dispose(bool disposing) { if (!_IsDisposed) { if (disposing) { DisposeObject(ref _Baz); DisposeObject(ref _Bar); } } _IsDisposed = true; } private void DisposeObject(ref IDisposable obj) { try { if (obj == null) return; obj.Dispose(); obj = null; } catch (ObjectDisposedException) { /* Already Disposed... */ } } public void Dispose() { Dispose(true); GC.SuppressFinalize(this); } } public class Bar : IDisposable { public void Dispose() {} } public class Baz : IDisposable { public void Dispose() {} } ``` I removed the code that sets argument to null (`obj = null;`) within `DisposeObject` So the final code became. ``` public void Dispose(bool disposing) { if (!_IsDisposed) { if (disposing) { DisposeObject(_Baz); DisposeObject(_Bar); } } _IsDisposed = true; } private void DisposeObject(IDisposable obj) { try { if (obj == null) return; obj.Dispose(); } catch (ObjectDisposedException) { /* Already Disposed... */ } } ```
Passing an IDisposable object by reference causes an error?
CC BY-SA 2.5
0
2009-04-27T15:47:24.300
2022-03-11T11:44:33.450
2017-02-08T14:11:42.817
-1
4,035
[ "c#", "dispose", "idisposable", "pass-by-reference" ]
794,263
1
null
null
3
225
I am hoping that someone (or some people) could help us with a problem that we have wrangled with for a few days. How to organize our business objects given the attached diagram? We are looking for any assistance (ideas about where to or how to search for the design pattern(s)/object model(s) we could use in order to solve this problem. Our situation is slightly more complex, but we have tried to simplify it best we could for the purposes of asking this question. Some Details: Some companies have product lines and some don't. Each company has a list of contacts. If a company has at least one product line, some of those company contacts are ALSO associated with at least one product line. A few of the contacts are references (business/personal) for other contacts. Each company and each contact can have zero or more addresses. Thank you for any assistance finding a more appropriate solution (My assumption is that we will need to use multiple models/patterns). ![Entity Diagram](https://farm4.static.flickr.com/3540/3480423086_deafb0e200.jpg) [Larger view of diagram (flickr.com)](http://www.flickr.com/photos/9844492@N08/3480423086/sizes/o/) ** (from the diagram) Our company has employees/internal application users who are included with contacts because they can also be references, etc.
Company & Contacts Object Design Help
CC BY-SA 2.5
0
2009-04-27T16:28:38.337
2009-04-27T16:38:09.670
2017-02-08T14:11:43.160
-1
35,555
[ "design-patterns", "ooad" ]
796,824
1
7,143,467
null
107
30,668
I love the syntax of [railroad diagrams](https://en.wikipedia.org/wiki/Syntax_diagram) on [json.org](https://www.json.org/) which are a graphical representation of the BNF language. I haven't found any tools that can produce results as eloquently. ## Can anyone identify the tool used to generate these diagrams? ![](https://i.stack.imgur.com/e3RRI.png) ![](https://i.stack.imgur.com/7Zcxu.png)
Tool for generating railroad diagram used on json.org
CC BY-SA 4.0
0
2009-04-28T08:31:36.210
2021-05-16T09:13:44.163
2021-05-16T09:13:44.163
153,049
50,475
[ "bnf", "diagramming" ]
801,740
1
801,794
null
79
109,524
What algorithms can be used to draw a binary tree in the console? The tree is implemented in C. For example, a BST with numbers: 2 3 4 5 8 would be shown in the console as: ![alt text](https://i.stack.imgur.com/8a1M8.jpg)
C How to "draw" a Binary Tree to the console
CC BY-SA 3.0
0
2009-04-29T10:19:32.357
2016-10-04T14:07:16.240
2015-07-09T11:42:09.967
3,198,508
1,205,130
[ "c", "algorithm", "layout", "binary-tree" ]
804,740
1
805,187
null
1
1,014
I'm rather new to working with multiple threads in a database (most of my career has been spent on the frontend). Today I tried testing out a simple php app I wrote to store values in a mysql db using ISAM tables emulating transactions using Table Locking. I just wrote a blog post on the procedure Here: [Testing With JMeter](http://leeand00.tiddlyspot.com/#[[Testing%20With%20JMeter]]) From my results my simple php app appears to keep the transactional integrity intact (as seen from the data in my csv files being the same as the data I re-extracted from the database): # CSV Files: ![alt csv for al](https://i9.photobucket.com/albums/a58/Maskkkk/AL_CSV_Data.png) ![alt csv for bl](https://i9.photobucket.com/albums/a58/Maskkkk/BL_CSV_Data.png) # Query Of Data for Both Users After JMeter Test Run: ![alt ](https://i9.photobucket.com/albums/a58/Maskkkk/AL_Query_Result.png) ![alt ](https://i9.photobucket.com/albums/a58/Maskkkk/BL_Query_Result.png) Am I right in my assumption that the transactional data integrity is intact? How do you test for concurrency?
Testing for concurrency and/or transactional integrity in a web application with JMeter
CC BY-SA 2.5
null
2009-04-29T23:18:55.413
2009-04-30T04:33:54.330
2017-02-08T14:11:46.257
-1
18,149
[ "mysql", "concurrency", "transactions", "myisam", "data-integrity" ]
807,428
1
808,251
null
21
11,683
How might I create a brush that paints a regular, repeated grid of 1-unit thick lines spaced evenly in both the horizontal and vertical axes? Imagine graph paper, if you will. Ideally the solution would allow control over the brushes used for the lines and the background (the regions within the squares). In this way the background could be transparent, so that the grid could serve as an overlay. Here is an image that shows the result of Tom's answer below: ![](https://i.imgur.com/OE0GL.png) For this example a grid was used to composite three layers to show that the grid is truly transparent.
WPF - How can I make a brush that paints graph-paper-like squares?
CC BY-SA 3.0
0
2009-04-30T15:12:28.587
2013-01-11T21:52:10.213
2013-01-11T21:52:10.213
24,874
24,874
[ ".net", "wpf", "grid", "brush" ]
809,706
1
809,760
null
3
2,233
I'm trying to create a sitemap in an ASP.NET MVC project. This code in my Node controller... ``` Function Sitemap() As ContentResult Dim db As New EfrDotOrgEntities Dim Nodes = db.Node.ToList Dim RequestUrl As Uri = Url.RequestContext.HttpContext.Request.Url Dim AbsoluteRoot As String = String.Format("{0}://{1}", RequestUrl.Scheme, RequestUrl.Authority) Dim map As XDocument = <?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> </urlset> For Each n As Node In Nodes map.Add(<url> <loc><%= AbsoluteRoot + Url.RouteUrl("IdOnly", New With {.id = n.Id}) %></loc> </url>) Next Return Content(map.ToString, "text/xml", Encoding.UTF8) End Function ``` (here's an image because Stack Overflow doesn't color VB code well) ![Visual Basic inline XML](https://i.stack.imgur.com/yQ3Oy.gif) ...produces this error: > This operation would create an incorrectly structured document. It wouldn't know to add that content. How do I tell it to insert that bit of XML into the `<urlset>`?
How do I insert a bit of XML into an XDocument using Visual Basic?
CC BY-SA 3.0
null
2009-05-01T00:22:46.097
2015-06-19T21:31:57.503
2015-06-19T21:31:57.503
385,996
83
[ ".net", "asp.net-mvc", "xml", "vb.net", "sitemap" ]
812,532
1
812,548
null
1
1,150
I'm building a UITableView programmatically without NIB files here. I'm doing something silly however, as my navigationBar shows up fine, as does my UITableView. However, the UITableView is not properly fitting onto the screen. You'll see roughly 20 pixels separating the UINavigationBar and the UITableView. I set my window's backgroundColor to black, as you can see in this screen shot: ![enter image description here](https://i.stack.imgur.com/wFfQW.png) Here's the code to reproduce the problem: ``` - (void)loadView { [super loadView]; // TableViews that wish to utilize tableView footers/headers should override this method. UITableView *aTableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain]; aTableView.autoresizingMask = (UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight); aTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; aTableView.delegate = self; aTableView.dataSource = dataSource; self.tableView = aTableView; [self.view addSubview:self.tableView]; [aTableView release]; // style navigation bar. //self.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; } ```
Why is my UITableView not occupying the bounds of the screen?
CC BY-SA 3.0
null
2009-05-01T18:16:58.133
2011-08-03T10:26:59.087
2011-08-03T10:26:59.087
128,662
40,882
[ "iphone", "objective-c", "cocoa-touch" ]
814,088
1
null
null
0
384
I'm trying to figure out a simple drawing program in Flash and it's giving me trouble. The main drawing area is a MovieClip named drawZone. However, when displaying something, the author uses another MovieClip embedded in the drawZone Symbol named zone. The drawZone Symbol has 2 layers, a mask layer and a masked sublayer that contains the zone Symbol. 1. Why does the author do this instead of simply drawing everything in the drawZone MovieClip? 2. The only place the zone Symbol shows up is in the Movie Explorer. Where do I access it, and how would I add such an embedded Symbol to my own code? Here's a screenshot: ![enter image description here](https://i.stack.imgur.com/YxoKi.png)
MovieClip inside another MovieClip for a drawing applet. Why and how?
CC BY-SA 3.0
null
2009-05-02T03:46:37.390
2013-04-19T11:18:53.100
2013-04-19T11:18:53.100
664,177
89,812
[ "flash", "actionscript" ]
815,973
1
816,002
null
13
1,093
How do you create the special links which show under sites in search results? Say I search for at , I get a result close to this: ![alt text](https://i.stack.imgur.com/RE3nB.jpg) The links I am asking about are outlined in red in the image above. What do you put in your page to have them show in search results, or how are they created? Thank you, Brett
How to create special links in search results?
CC BY-SA 3.0
0
2009-05-03T00:16:48.527
2017-11-28T15:24:38.540
2017-11-28T15:24:38.540
5,836
5,836
[ "html", "seo" ]
816,256
1
816,421
null
2
10,295
In ZedGraph, how do I show text labels for each point and in the `XAxis` all together? If I do ``` myPane.XAxis.Type = AxisType.Text; myPane.XAxis.Scale.TextLabels = array_of_string; ``` I get labels on the XAxis like this ![Enter image description here](https://i.stack.imgur.com/RdFvG.png) And if I do ``` for (int i = 0; i < myCurve.Points.Count; i++) { PointPair pt = myCurve.Points[i]; // Create a text label from the Y data value TextObj text = new TextObj( pt.Y.ToString("f0"), pt.X, pt.Y + 0.1, CoordType.AxisXYScale, AlignH.Left, AlignV.Center); text.ZOrder = ZOrder.A_InFront; text.FontSpec.Angle = 0; myPane.GraphObjList.Add(text); } ``` I get labels on the curve, like this ![Alt text, Pointlabel.png](https://i.stack.imgur.com/3i6dC.png) But if I do both at the same time, labels on the curve disappear. Is there a way to combine both kind of labels?
ZedGraph labels
CC BY-SA 3.0
0
2009-05-03T03:28:35.740
2019-03-14T14:00:44.083
2012-09-02T18:13:29.847
63,550
32,173
[ "asp.net", "controls", "charts", "zedgraph" ]
819,990
1
858,274
null
2
2,598
I have a WPF application (.NET 3.0, VS2008) that displays data in a tab control. Custom colors are required on virtually all controls in this application : basically white foreground and green background. My problem is that when an XP theme (say Luna) is active, it is automatically applied to render controls so that my white text is written on ... a white background. For instance on the active tab item header : ![Unreadable tab item header](https://lh6.ggpht.com/_dR4_IBKyRV0/Sf7kTth9ZaI/AAAAAAAAAD8/sUrspncvXek/s800/Sigp3d-WPF-Luna.png) I have tried : - - to force the use of the Windows Classic theme in the application resources :``` <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Classic;V3.0.0.0;31bf3856ad364e35;component/themes/classic.xaml" /> </ResourceDictionary.MergedDictionaries> ``` This last attempt worked great for all controls, except the tab control which still displays as above. Any idea ? : I am suspecting this behaviour is due to the custom style I have to apply to the tab control : ``` <Window.Resources> <Style x:Key="Custom"> <Setter Property="Control.Background" Value="#FF47C7C8" /> <Setter Property="Control.Foreground" Value="White" /> </Style> <Style TargetType="TabControl" BasedOn="{StaticResource Custom}" /> </Window.Resources> ``` So how can I get the classic theme with custom colors ?
How to disable XP themes in WPF application?
CC BY-SA 2.5
0
2009-05-04T13:00:45.017
2009-05-13T15:03:58.080
2017-02-08T14:11:51.127
-1
8,696
[ "wpf", "windows-xp", "themes", "tabcontrol" ]
820,473
1
820,580
null
3
493
Im trying to think how to do this with html elements. ![alt text](https://i.stack.imgur.com/pip4W.png) There is nothing special about the colors, so I don't need to make them images. Do note that the text is right aligned. Also, the color bar goes up to the text from the left. So this could be implemented by having the text float right with background color white, and a div with the background color set right next to it (and then a clear). Or instead of floats, I can do text align-right and get a similar effect. Here is the kicker. I'm using a javascript library (shouldn't matter which one) to create an animation. The animation is the bars shrink to the left, and end up like so: ![alt text](https://i.stack.imgur.com/Fjzol.png) The problem with the float or text-align methods are that too many values have to be changed to transition between the two states. The javascript animation effects tend to want to change a couple predefined values, like width or font-size. In order to transfer from picture 1 to picture 2 using the float or text-align methods, I must remove the floating/text-align then set the width of the bar color, but that doesn't work if I want to keep the javascript overhead minimal for such a simple task. I've tried absolute positioning/widths, but I can't get anything to make the text right aligned AND have the bars meet at the same point on the left. I'm hoping maybe I'm just blind of a simple solution, but as I see it, I need one element that has the text positioned to the right somehow, and an element that takes up as much room possible beside it for the color... AND the element that has the color should be able to take a width, while having the text follow beside it. Thank you.
Width absorbing HTML elements
CC BY-SA 3.0
null
2009-05-04T14:57:52.580
2015-06-19T20:48:37.877
2015-06-19T20:48:37.877
1,159,643
93,380
[ "javascript", "html", "css" ]
822,899
1
3,110,836
null
38
52,180
I've always wanted to create custom components in Java, or customize existing ones, but my searches never resulted in anything useful. So I decided to ask the StackOverflow community: And when I mean customizing, I'm not talking about changing colors, fonts etc. I mean customize them. Here are two mockup example components: ![Custom Components Mockup](https://i.stack.imgur.com/t36RA.jpg) I started this question mainly to find how to create the above two custom components. But then I realized that there isn't a general question about hacking swing components. So I thought it would be better to have a list of resources. In case you are wondering how do the two components in the mockup work, here it is: A customized JScrollPane that has two Scrollbars for each orientation. Each scrollbar can act differently. For example, the outer ones scroll normally and the inner ones move the view in a more [Picasa](http://picasa.google.com/)-like way. I actually got a working(!) answer from google groups [here](http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/7a3c3558d7924661/11e7beb95c003575?#11e7beb95c003575), but that was just code. The second one is a custom JComboBox which, when the popup list is expanded, has a JComponent at the end. This can be anything, from a simple JLabel with an icon, to a JButton that manipulates the list in a way. But this question isn't about those specific components. It's about .
How to create a custom Swing Component
CC BY-SA 3.0
0
2009-05-05T01:19:23.400
2020-08-18T14:26:20.843
2015-07-27T14:47:19.223
411,022
2,644
[ "java", "swing", "jcomponent" ]
823,080
1
1,266,131
null
13
25,292
How to create that black/gray modal popup kind of view that many apps use, when some long pending operation is in progress? Like when using location based services, loading a webpage, the screen goes dim and there is a modal view showing a spinning icon "Please wait..." Example in the following screenshot: ![Screenshot](https://farm4.staticflickr.com/3379/3503268688_0064567134_m.jpg)
Creating a "loading..." view using iPhone SDK
CC BY-SA 3.0
0
2009-05-05T02:41:07.447
2019-08-19T09:07:13.043
2017-02-08T14:11:51.463
-1
90,165
[ "iphone", "cocoa-touch" ]
829,601
1
829,871
null
2
261
I'm not that familiar with COM and was hoping that someone out there, who is, could help verify what I have below is correct. If I have two completely separate Requests (request 1 & request 2), then this creates two separate instances of my WebApplication. So far so boring. If each instance then contacts the SAME web service, then presumably two instances of the Web Service are also instantiated. This is where it gets interesting. These web services create a .NET assembly which then references an in-process (registered via regsvr32) COM-dll (via Interop). Is my diagram correct? ![alt text](https://i.stack.imgur.com/CuVik.png) This COM-DLL connects to the database, performs a query, returns data to the web service which then returns the data in JSON to the client. All done AJAXy. The other question I have is - is this okay performance-wise? I don't see why it shouldn't scale, and be able to return data to the user
ASP.NET, IIS and COM
CC BY-SA 3.0
null
2009-05-06T13:36:20.687
2015-06-19T20:44:13.273
2015-06-19T20:44:13.273
1,159,643
7,140
[ "asp.net", "iis", "com" ]
830,366
1
830,449
null
4
1,595
I have a probably very basic problem with PIL's crop function: The cropped image's colors are totally screwed. Here's the code: ``` >>> from PIL import Image >>> img = Image.open('football.jpg') >>> img <PIL.JpegImagePlugin.JpegImageFile instance at 0x00 >>> img.format 'JPEG' >>> img.mode 'RGB' >>> box = (120,190,400,415) >>> area = img.crop(box) >>> area <PIL.Image._ImageCrop instance at 0x00D56328> >>> area.format >>> area.mode 'RGB' >>> output = open('cropped_football.jpg', 'w') >>> area.save(output) >>> output.close() ``` The original image: ![enter image description here](https://i.stack.imgur.com/xJCt3.jpg) [and the output](http://lh6.ggpht.com/_6sm8225Z3w8/SgG0AWKPUaI/AAAAAAAAAjw/SWP360wFo1M/cropped_football.jpg). As you can see, the output's colors are totally messed up... Thanks in advance for any help! -Hoff
Python's PIL crop problem: color of cropped image screwed
CC BY-SA 3.0
null
2009-05-06T16:07:18.340
2011-07-26T16:50:04.430
2011-07-26T15:39:13.540
128,662
102,181
[ "python", "image-processing", "colors", "python-imaging-library", "crop" ]
830,645
1
830,676
null
22
9,193
I'd like to be able to highlight the wrap margin/text width in vim by changing the background color (or maybe just a line?). A lot of IDEs have this. I mocked up what I'm talking about: ![](https://farm4.static.flickr.com/3598/3508086136_6c075936a5_o.jpg) Anyone know if this can be done in macvim or gvim?
Changing background color in vim at a certain column
CC BY-SA 2.5
0
2009-05-06T16:59:00.823
2013-04-17T14:28:41.483
2017-02-08T14:11:53.160
-1
3,029
[ "vim", "macvim" ]
830,943
1
831,068
null
2
892
So the last couple of days my dev webpage for ssrs has been looking really weird, as if it's not getting styled by css at all. I'm not the only person that is seeing it like this. We just rebooted the server and it didn't have any effect. If you know what it causing this, please help. another symptom is that i can't modify security settings now. ![Prod](https://i630.photobucket.com/albums/uu24/Thirster42/screen2.jpg) ![Dev](https://i630.photobucket.com/albums/uu24/Thirster42/screen1.jpg)
SSRS css messing up?
CC BY-SA 2.5
0
2009-05-06T18:16:28.360
2009-06-05T16:50:35.010
2017-02-08T14:11:53.833
-1
95,710
[ "sql-server", "css", "reporting-services", "reportingservices-2005" ]
830,921
1
830,948
null
1
3,429
I am developing a website using forms and one of the browsers being targeted is unfortunately IE 6 and 7. I am having an issue with CSS and IE's rendering of form elements that are styled. I have written a test case, and it is as such (also available online at [http://xistence.osnn.net/testcases/ie67fieldset/](http://xistence.osnn.net/testcases/ie67fieldset/)): ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> <title>IE [6|7] Wha?</title> <style type="text/css"> html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td { margin: 0; padding: 0; border: 0; outline: 0; font-weight: inherit; font-style: inherit; font-size: 100%; font-family: inherit; vertical-align: baseline; } /* remember to define focus styles! */ :focus { outline: 0; } body { line-height: 1; color: black; background: white; } #req fieldset { border: 0; border-top: 1px solid #000; padding: 0em 1em 0em 1em; } #req legend + label { margin-top: 0.5em; } #req legend { font-size: 1.2em; } #req label { display: block; background: none; } #req input, #req textarea { position: relative; display: block; left: 200px; top: -1em; margin-bottom: -0.3em; } #req input[type="text"], #req textarea { width: 300px; } #req textarea { height: 3.6em; } #req input[type="text"], #req textarea { border: 1px solid #0a0; } #req label.required + input[type="text"], #req label.required + textarea { border: 1px solid #a00; } #req input[type="submit"] { position: relative; top: 0; margin: 0; left: 200px; margin-top: 0.5em; } #req input[type="hidden"] { display: none; } </style> </head> <body> <form id="req"> <fieldset> <legend>Contact Information</legend> <label for="name" class="required">Name: </label> <input type="text" id="name" name="name"></input> <label for="phone" class="required">Phone Number: </label> <input type="text" id="phone" name="phone"></input> <label for="email">Email: </label> <input type="text" id="email" name="email"></input> </fieldset> <fieldset> <legend>Personal Info</legend> <label for="sports">Sports:</label> <input type="text" id="sports" name="sports"></input> <label for="spentonline">Hours spent online: </label> <input type="text" id="spentonline" name="spentonline"></input> <label for="moreinfo">Tell us about yourself: </label> <textarea id="moreinfo" name="moreinfo"></textarea> </fieldset> <fieldset> <input type="submit" value="Submit" /> </fieldset> </form> </body> </html> ``` I have also taken two screen shots, one of IE 7 and one of IE 8, IE 7 and IE 6 agree on this styling so I have not bothered to take a screen shot of IE 6. IE [6|7]: ![enter image description here](https://i.stack.imgur.com/5Zkud.png) IE 8: ![enter image description here](https://i.stack.imgur.com/0FHSK.png) Has anyone seen this bug before? Where did I go wrong? What do I have to remove to make it work in IE 6/7 without having extra lines going through my input boxes. The extra lines are removed when the border-top is gone on the fieldset, but that is not a solution since doing so removes the whole visual separation. --- It is fixed. the margin-bottom on the textarea and input[type="text"] was causing IE 6/7 to have a rendering bug. Removed those and all is well. I guess I can deal with the extra space between the elements on the page!
CSS Styling Forms -- IE 6/7 bug
CC BY-SA 3.0
null
2009-05-06T18:10:31.277
2013-04-18T08:21:53.593
2013-04-18T08:21:53.593
664,177
13,986
[ "css", "xhtml", "internet-explorer-7", "rendering", "internet-explorer-6" ]
837,351
1
838,298
null
5
15,664
I'm getting this error when I run or debug my GA/AI from MyEclipse: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space eclipse.ini looks like this: ``` -showsplash com.genuitec.myeclipse.product --launcher.XXMaxPermSize 256m -vmargs -Xms128m -Xmx512m -Duser.language=en -XX:PermSize=128M -XX:MaxPermSize=256M ``` MyEclipse is called like this: ``` "C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe" -vm "C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exe" -vmargs -Xms1448M -Xmx1448M ``` bumping the vm settings up from this: ``` "C:\Program Files\MyEclipse 6.0\eclipse\eclipse.exe" -vm "C:\Program Files\MyEclipse 6.0\jre\bin\javaw.exe" -vmargs -Xms80M -Xmx1024M ``` has had no effect. So I'm trying to get it to dump the heap to a file, but placing these: ``` -XX:+HeapDumpOnCtrlBreak -XX:+HeapDumpOnOutOfMemoryError ``` in the Program arguments has had no effect. How do I get something to work with more memory usage analysis? jstack, for instance, is not currently available on Windows platforms. And using SendSignal has no effect that I can see. ![a screen shot](https://imgur.com/KV4d.jpg)
How do I Save the Heap (Dump to a File) in Eclipse?
CC BY-SA 2.5
0
2009-05-07T22:17:19.550
2021-09-26T18:25:05.210
2021-09-26T18:25:05.210
5,459,839
43,199
[ "java", "memory-leaks", "heap-memory" ]
837,454
1
null
null
0
2,489
I'm writing a console program that can accept 1 to 3 files. I'm using `OpenFileDialog` three times to accept the files, but the second and third time the file dialog is behind the console window, making it hard to notice. Any way to get it to appear above? An image of the problem: ![enter image description here](https://i.stack.imgur.com/PiqmW.png) The relevant code is: ``` static bool loadFile(ref List<string> ls) { OpenFileDialog f = new OpenFileDialog(); if (f.ShowDialog() == DialogResult.OK) { Console.WriteLine("Loaded file {0}", f.FileName); ls.Add(f.FileName); return true; } else { return false; } } [STAThread] static void Main(string[] args) { // sanity check if (args.Length > 3) { Console.WriteLine("Sorry, this program currently supports a maximum of three different reports to analyze at a time."); return; } else if (args.Length == 0) { List<string> fL = new List<string>(); for (int k = 0; k < 3; k++) { if (!loadFile(ref fL)) break; } if (fL.Count == 0) { InfoDisplay.HelpMessage(); return; } else { args = fL.ToArray(); } } // main program ... } ```
Making the second and third OpenFileDialog appear above the console in .NET/C#?
CC BY-SA 3.0
null
2009-05-07T22:46:31.057
2012-01-09T10:12:02.793
2011-12-18T19:44:35.717
214,668
103,168
[ "c#", ".net", "winforms", "console", "openfiledialog" ]
838,265
1
839,906
null
2
5,417
I want to make voronoi treemaps for statistics data, like ![alt text](https://codezine.jp/static/images/article/3516/09.png) [newsgraphy](http://newsgraphy.com/) Do you know how I can do that in Perl, PHP, Ruby, or Python?
How can I make voronoi treemaps?
CC BY-SA 2.5
0
2009-05-08T04:38:48.963
2014-08-16T13:07:13.537
2017-02-08T14:11:55.177
-1
76,509
[ "statistics", "voronoi", "treemaps" ]
839,085
1
839,187
null
4
17,316
I have a problem about div position relative alignment. I want the second div to be fixed in position even if I remove the first div. The problem is that the second div adjusts its position when the first div is removed. My question is how can I retain the position of the second div even if I remove the first div? Thanks :) This code: ``` <div style="border: 1px solid red;width:400px;height:150px;margin:0px auto;" > <div style="border: 1px solid red; position: relative; width: 262px; height: 20px; top: 20px; left: 20px;">div-1</div> <div style="border: 1px solid red; position: relative; width: 262px; height: 20px; top: 60px; left: 20px;">div-2</div> </div> ``` Will output: ![alt text](https://farm4.static.flickr.com/3660/3512692766_539e6b4f8d_o.jpg) Then if the first div is removed, the second div adjusts its position. This code: ``` <div style="border: 1px solid red;width:400px;height:150px;margin:0px auto;" > <div style="border: 1px solid red; position: relative; width: 262px; height: 20px; top: 60px; left: 20px;">div-2</div> </div> ``` Will output: ![alt text](https://farm4.static.flickr.com/3645/3512692796_2e0a7afb1d_o.jpg)
CSS: Div position:relative alignment problem
CC BY-SA 2.5
0
2009-05-08T09:53:41.170
2014-06-26T21:09:37.763
2017-02-08T14:11:55.850
-1
95,322
[ "html", "css" ]
841,206
1
1,719,307
null
2
14,479
I'm want to create a CRM app for me just for fun and to learn more about Cocoa, because CRM application evolve based on a Calendar, I wonder where can I get that cool Calendar control that iCal has in the iPhone. I can't see it in my Library and I'm using SDK 3.0 beta 5. And by the way, where can I get a free/paid controls collection like there are so many for the .NET world? ![alt text](https://i.stack.imgur.com/pINrH.png)
Calendar control for cocoa touch
CC BY-SA 3.0
null
2009-05-08T18:36:05.493
2015-06-19T21:50:42.020
2015-06-19T21:50:42.020
1,159,643
28,004
[ "iphone", "cocoa-touch", "controls", "calendar" ]
843,016
1
843,027
null
2
2,526
I have a site that lists several upcoming events, and each event has a comment button to leave comments. It looks like this (it's in swedish, but I think you can figure out the structure): ![](https://i.stack.imgur.com/trals.png)[shipit.se](http://www.shipit.se/dump/event.png) The div containing the textarea for writing the comment is initially hidden, and when clicking the 'comment'-icon it is displayed using the following javascript: ``` <script language="javascript" type='text/javascript'> function showhide_comment(comment_id, change_id) { if (document.getElementById(comment_id).style.display == 'none') { if (document.getElementById(change_id).style.display == 'block') { document.getElementById(change_id).style.display = 'none'; document.getElementById(comment_id).style.display = 'block'; document.getElementById(change_id).style.display = 'block'; } else { document.getElementById(comment_id).style.display = 'block'; } } else { if (document.getElementById(change_id).style.display == 'block') { document.getElementById(change_id).style.display = 'none'; document.getElementById(comment_id).style.display = 'none'; document.getElementById(change_id).style.display = 'block'; } else { document.getElementById(comment_id).style.display = 'none'; } } } ``` The script contains a hack to display the hidden div correctly in IE when another (initially hidden) div is also displayed in which changes can be made to the event. But never mind that. The php-code to display the comment form looks like this: ``` //Comment form, initially hidden echo "<div id=\"comment" . $row->id . "\" class=\"submit-comment\" style=\"display: none\">"; echo "<form name=\"make_comment\" method=\"post\" action=\"submit_comment.php\">"; echo "Kommentar:<br/>"; echo "<textarea name=\"comment\" class=\"comment\" rows=\"0\" cols=\"0\"></textarea><br/>"; echo "<input type=\"hidden\" name=\"event_id\" value=\"$row->id\"/>"; echo "<input class=\"comment\" type=\"submit\" name=\"submit_comment\" value=\"Skicka\" />"; echo "</form>"; echo "</div>"; ``` This code lies inside a loop which displays all upcoming events that are stored in a mySQL database. As can be seen, the divs are given variable names like comment1, comment2, etc. in order to bind the comments to the correct event. This is the code to display the comment-icon and linking it to the javascript: ``` echo "<li class=\"icon-left\"> <a href=\"javascript:showhide_comment('comment" . $row->id . "', 'change" . $row->id . "')\"> <img src=\"images/comment-24x24.png\" title=\"Kommentera körning\" alt=\"Kommentera körning\" /> </a></li>"; ``` What I would like to do is to put the focus inside the correct textarea field that becomes visible when the comment-icon is clicked so that the user can start typing directly. I have tried to modify the javascript above using focus(), but I just can't get it to work. Any ideas on how I can achieve what I want? Thanks. /Linus
Put focus inside a textarea with variable name using javascript
CC BY-SA 4.0
null
2009-05-09T09:19:20.083
2019-03-16T02:00:08.360
2019-03-16T02:00:08.360
4,751,173
91,098
[ "php", "javascript", "html" ]
843,683
1
843,713
null
21
11,452
Using interface builder you can select the corners an object should stick to when resizing. How can you do this programatically? ![Interface Builder](https://i.stack.imgur.com/Jsp4f.png)
Cocoa NSView changing autosizing properties
CC BY-SA 3.0
0
2009-05-09T17:15:56.827
2015-06-19T21:42:17.260
2015-06-19T21:42:17.260
1,159,643
null
[ "objective-c", "cocoa", "macos" ]
843,779
1
844,669
null
0
419
I'm not 100% sure it wasn't always this way and I never noticed... but I'm pretty sure this is new and something got messed up somewhere. I am able to assign work items to a user named LOCAL SERVICE (see screenshot) in TFS 2008 (Workgroup Edition). This seems wrong, but I have no idea how to fix the issue. It's not the end of the world, but it's bugging me. Thanks in advance for any help. ![TFS - LOCAL SERVICE user](https://i.stack.imgur.com/ANOgW.jpg)
Why am I able to assign tasks to LOCAL SERVICE in TFS 2008?
CC BY-SA 3.0
null
2009-05-09T18:12:50.920
2015-06-19T21:11:55.097
2015-06-19T21:11:55.097
1,159,643
4,050
[ "tfs" ]
845,480
1
null
null
3
846
I'm an artist involved with building various sorts of computer controlled machines. I've started prototyping a gimble-based XY painting machine and have realized that the maths needed are out of my reach. I'm a decent enough programmer but not strong in math- esp. 3D math. To get a sense of what I'm needing to do, it might be helpful to look at the rig: Early prototype: ![http://roypardi.com/gimble/IMG_2803.JPG](https://i.stack.imgur.com/ZAu76.jpg) ![http://roypardi.com/gimble/IMG_2805.JPG](https://i.stack.imgur.com/FfvLr.jpg) ![http://roypardi.com/gimble/IMG_2806.JPG](https://i.stack.imgur.com/B5Dx4.jpg) [http://roypardi.com/gimble/gimbleSmall.MOV](http://roypardi.com/gimble/gimbleSmall.MOV) (small video) [http://roypardi.com/gimble/gimbleLarge.mov](http://roypardi.com/gimble/gimbleLarge.mov) (larger video) The two inner rings represent the X/Y axes and are controlled by stepper motors. I want to be able to use both raster images and vector data (gcode). So I need to be able to address a point in 2D space on the paper/from my data and have the gimble figure out what orientation it needs to be at in order to get there (i.e. how much to step each motor). I've been searching out 2D > 3D projection, Euler angles, etc. but I'm out of my depth. Any pointers, pushes in the right direction, or code snippets would be most welcome. I can make sense of most programming languages.
Math programming help for a gimble-based painting machine
CC BY-SA 3.0
0
2009-05-10T14:57:06.087
2013-07-19T14:09:58.873
2013-07-19T14:09:58.873
1,053,021
null
[ "math", "printing", "vectormath" ]
847,666
1
847,929
null
9
5,798
Are there any frameworks for building squarified treemaps in C# 2.0 WinForms? Something similar to this: ![](https://www.codeproject.com/KB/recipes/treemaps/smartmoney2.gif) (from [http://www.codeproject.com/KB/recipes/treemaps.aspx](http://www.codeproject.com/KB/recipes/treemaps.aspx))
Visual Treemap in Winforms
CC BY-SA 2.5
0
2009-05-11T11:18:33.680
2009-08-06T07:30:40.330
2017-02-08T14:11:57.927
-1
4,653
[ "c#", "winforms", "data-visualization", "treemap" ]
849,149
1
null
null
367
342,422
Is there a way in SQL Server Management Studio 2005 (or later) to change the Windows Authentication user (as you could in SQL Server 2000 and older)? This is the general connection properties dialog(note the greyed out UID/PWD when selecting Windows Auth): ![dialog](https://i.stack.imgur.com/ontH5.png) FYI - One workaround is to use `runas` but I'm looking for a solution that will allow me to work with multiple Windows accounts across multiple servers (and across multiple domains).
Connect different Windows User in SQL Server Management Studio (2005 or later)
CC BY-SA 3.0
0
2009-05-11T17:31:21.540
2021-07-07T16:18:09.977
2016-04-22T00:10:58.523
6,083,675
104,925
[ "sql", "sql-server-2008" ]
849,323
1
864,894
null
1
3,243
I feel really stupid for asking this but I have been thrashing for over 8 hours. How do I get the Selected Item to show its text in my WPF combo box when selected? ![Diplay Options](https://i86.photobucket.com/albums/k83/Aaronls79/DisplayerOptions.jpg) Above is an option dialog that allows users to select and configure the available tournament displays. The problem is the selected combo box item shows the UserControl instead of the Display name. : ``` //_displayer is a private member populated using MEF //[ImportMany(typeof (IDisplayer))] //private IEnumerable<IDisplayer> _displayers; DisplayTypeComboBox.ItemsSource = _displayers; ``` ``` <ComboBox Name="DisplayTypeComboBox" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" IsEditable="False" SelectionChanged="DisplayTypeComboBox_SelectionChanged"> <ComboBox.ItemTemplate> <DataTemplate> <ComboBoxItem Content="{Binding DisplayerName}" /> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> ``` ``` public interface IDisplayer { string DisplayDataLocation { get; set; } string DisplayerName { get; } string DisplayerDescription { get;} bool WatcherEnabled { get; } UserControl View { get; } string DisplayerImageLeft { get; set; } string DisplayerImageRight { get; set; } void Update(); } ```
Text Will not show for selected Item in ComboBox
CC BY-SA 2.5
0
2009-05-11T18:10:51.117
2009-06-11T15:05:08.680
2017-02-08T14:11:58.957
-1
71,608
[ "wpf", "windows", "wpf-controls" ]
857,916
1
857,975
null
103
99,090
I have outer div and inner div. I need to place inner div at the bottom of the outer one. Outer div is elastic (width: 70% for example). I also need to center inner block. Simple model of described make-up is shown on the picture below: ![enter image description here](https://i.stack.imgur.com/CJWr9.png)
Positioning a div near bottom side of another div
CC BY-SA 3.0
0
2009-05-13T13:22:46.403
2015-08-15T04:02:11.623
2014-12-04T12:58:10.377
100,516
100,516
[ "html", "css", "layout" ]
870,627
1
886,594
null
3
2,780
Why is my table view blank? It was fine until I added "initWithStyle" Here is what it looks like: ![alt text](https://i.stack.imgur.com/6ox52.png) And here is what my code looks like: Here is my .h: ``` #import <UIKit/UIKit.h> @interface TableViewController : UITableViewController { NSMutableArray *jokes; IBOutlet UITableView *jokeTableView; } @property (nonatomic, retain) NSMutableArray *jokes; @property (retain) UITableView *jokeTableView; @end ``` And here is my implementation file: ``` #import "TableViewController.h" #import "Joke.h" @implementation TableViewController @synthesize jokes; @synthesize jokeTableView; - (void)awakeFromNib { [jokeTableView init]; } - (id)initWithStyle:(UITableViewStyle)style { if (self = [super initWithStyle:style]) { self.jokes = [NSMutableArray arrayWithObjects: [Joke jokeWithValue:@"If you have five dollars and Chuck Norris has five dollars, Chuck Norris has more money than you"], [Joke jokeWithValue:@"There is no 'ctrl' button on Chuck Norris's computer. Chuck Norris is always in control."], [Joke jokeWithValue:@"Apple pays Chuck Norris 99 cents every time he listens to a song."], [Joke jokeWithValue:@"Chuck Norris can sneeze with his eyes open."], nil]; self.jokeTableView.rowHeight = 30.0; // self.jokeTableView.separatorStyle = UITableViewCellSeparatorStyleSingleLine; self.jokeTableView.sectionHeaderHeight = 0; } return self; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { // Saying how many sections wanted (Just like in address, where sorts by first name) return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [jokes count]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Team"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; } Joke *j = (Joke *)[jokes objectAtIndex:indexPath.row]; if( j ) cell.text = j.joke; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; } - (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (void)dealloc { [jokes release]; [jokeTableView release]; [super dealloc]; } @end ```
Cocoa: Why is my table view blank?
CC BY-SA 3.0
0
2009-05-15T20:04:39.090
2015-09-14T16:37:52.540
2015-09-14T16:37:52.540
1,527,934
null
[ "ios", "objective-c", "iphone", "uitableview", "cocoa-touch" ]
872,461
1
872,490
null
5
13,435
I am overloading the delegate method `-tableView:heightForRowAtIndexPath:` and using `-sizeWithFont:constrainedToSize:` to programmatically set the height of the cell, based on the text in that cell: ``` - (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { switch (indexPath.section) { case(kAboutViewOverviewSection): { switch (indexPath.row) { case(kAboutViewOverviewSectionRow): { NSString *text = NSLocalizedString(@"kAboutViewOverviewSectionFieldText", @""); CGSize s = [text sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(280, 500)]; return s.height + 13; } default: { break; } } break; } default: { break; } } return 44.0; } ``` This works when the table is first drawn. However, when I change the orientation of the device, from portrait to landscape, the cell height does not change. I tried overriding the `-shouldAutorotateToInterfaceOrientation:` method in my table view controller: ``` - (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { [self.tableView reloadData]; return YES; } ``` This should reload the table data and (presumably) redraw the table cell views. But this does not have any effect. Is there a way to force a cell to redraw with a new height, when the device is rotated? : I have tried the following, to no effect: ``` - (void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { [self.tableView reloadData]; } ``` Here is what the application looks like in portrait orientation: ![Portait](https://farm4.static.flickr.com/3541/3536323854_3f835c12b8.jpg) Here is what the application looks like in landscape orientation: ![Landscape](https://farm4.static.flickr.com/3614/3535508503_bf8f2608fa.jpg) There is a gap between the top and bottom edges of the content. : Adjusting the size parameter via the table frame's width helped fix this display issue: ``` CGSize s = [text sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake([tableView frame].size.width,500)]; ```
Resetting custom UITableViewCell height when iPhone is rotated
CC BY-SA 2.5
0
2009-05-16T13:44:56.030
2011-07-21T14:16:26.890
2017-02-08T14:12:04.680
-1
19,410
[ "iphone", "uitableview" ]
874,662
1
875,509
null
2
626
I have been trying very hard to achieve rounded corners with IE6+jquery ui tabs. I have this page prepared: [http://jsbin.com/uzoko](http://jsbin.com/uzoko) (w/out dd_roundies) Ofcourse, the rounded corners work in FF but not IE6. Because some of the properties used in CSS are specific to FF and Chrome. I had asked this question yesterday ![as well](https://stackoverflow.com/questions/872816/how-to-work-with-jquery-ui-tabs-in-ie-6) and based on that suggestion I used the DD_Roundies library. However, the sample page I provided up top doesnt have the ability to add DD_Roundies library so I cant really 'show' what exactly is wrong with the page when it is openeing in css. But after implementing DD_Roundies I can see the rounded corners in IE6 fine. HOWEVER, I have following problems: 1. ONLY the 'First' tabs seems to have rounded corners. When i click on second tab, it doesnt have rounded corners and so doesnt the third. 2. when I move away from First tab, it seems to have a border with color #990000. All of this does not happen in FF @#$%@$!! Since I am unable to put DD_Roundies library code in jsbin I will put what I have relative to dd_roundies on my page, here: ``` DD_roundies.addRule('.ui-corner-all', '4px'); DD_roundies.addRule('.ui-corner-top', '2px 2px 0px 0px'); DD_roundies.addRule('.ui-corner-bottom', '0 0 4px 4px'); DD_roundies.addRule('.ui-corner-right', '0 4px 4px 0'); DD_roundies.addRule('.ui-corner-left', '4px 0 0 4px'); DD_roundies.addRule('.ui-corner-tl', '4px 0 0 0'); DD_roundies.addRule('.ui-corner-tr', '0 4px 0 0'); DD_roundies.addRule('.ui-corner-br', '0 0 4px 0'); DD_roundies.addRule('.ui-corner-bl', '0 0 0 4px'); ``` I am not good at CSS to begin with and then correcting css so it works with freaking ie6 is whole another battle that I can use some help in. Please! Also, as suggested in the question I asked yesterday, I tried using images as well. I used cornershop website to create two rounded corner images. [http://tinypic.com/r/30j1rgz/5](http://tinypic.com/r/30j1rgz/5) and [http://tinypic.com/view.php?pic=50joqq&s=5](http://tinypic.com/view.php?pic=50joqq&s=5) but with these when I changed 'Interaction States' section of the css and property `.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited` to the following ``` background: #990000; font-weight: bold; color: #ffffff; text-decoration: none; outline: none; background: url(nw.gif) no-repeat top left; background: url(ne.gif) no-repeat top right; ``` then I got even weirder restuls :(
fixing css for ie6 need help!
CC BY-SA 2.5
null
2009-05-17T13:59:17.363
2009-05-17T21:05:20.653
2017-05-23T11:53:15.420
-1
null
[ "jquery", "html", "css", "internet-explorer-6" ]
875,035
1
null
null
2
2,234
Does anyone have an example of how to draw the blue "unread dot" used in Apple's Mail App? This one in specific: ![enter image description here](https://i.stack.imgur.com/CDVms.jpg) Drawing an ellipse is straight forward with Quartz2d, but the subtle use of shadows+gradients make this look really 3d.
Drawing the blue "unread dot" on the iPhone Mail app
CC BY-SA 3.0
0
2009-05-17T17:25:52.590
2012-09-04T03:44:18.723
2011-08-03T10:03:52.200
128,662
40,882
[ "iphone", "objective-c", "cocoa-touch", "quartz-graphics" ]
875,027
1
881,439
null
8
5,750
I'm onto [problem 245](http://projecteuler.net/index.php?section=problems&id=245) now but have hit some problems. I've done some work on it already but don't feel I've made any real steps towards solving it. Here's what I've got so far: We need to find n=ab with a and b positive integers. We can also assume gcd(a, b) = 1 without loss of generality and thus phi(n) = phi(ab) = phi(a)phi(b). We are trying to solve: ![\frac{n-\phi(n)}{n-1}=\frac1k](https://chart.apis.google.com/chart?cht=tx&chl=%5Cfrac%7Bn-%5Cphi%28n%29%7D%7Bn-1%7D%3D%5Cfrac1k) ![\frac{n-1}{n-\phi(n)}=k](https://chart.apis.google.com/chart?cht=tx&chl=%5Cfrac%7Bn-1%7D%7Bn-%5Cphi%28n%29%7D%3Dk) Hence: ![n\equiv1\ (\text{mod }n-\phi(n))](https://chart.apis.google.com/chart?cht=tx&chl=n%5Cequiv1%5C%20%28%5Ctext%7Bmod%20%7Dn-%5Cphi%28n%29%29) At this point I figured it would be a good idea to actually see how these numbers were distributed. I hacked together a brute-force program that I used to find all (composite) solutions up to 10: ``` 15, 85, 255, 259, 391, 589, 1111, 3193, 4171, 4369, 12361, 17473, 21845, 25429, 28243, 47989, 52537, 65535, 65641, 68377, 83767, 91759 ``` Importantly it looks like there [won't be too many](http://www08.wolframalpha.com/input/?i=15%2C+85%2C+255%2C+259%2C+391%2C+589%2C+1111%2C+3193%2C+4171%2C+4369%2C+12361%2C+17473%2C+21845%2C+25429%2C+28243%2C+47989%2C+52537%2C+65535%2C+65641%2C+68377%2C+83767%2C+91759) less than the 10 limit the problem asks. The most interesting/ useful bit I discovered was that k was quite small even for the large values of n. In fact the largest k was only 138. (Additionally, it seems k is always even.) Considering this, I would guess it is possible to consider every value of k and find what value(s) n can be with that value of k. Returning to the original equation, note that it can be rewritten as: ![\frac{\phi(n)-1}{n-1}=\frac{k-1}k](https://chart.apis.google.com/chart?cht=tx&chl=%5Cfrac%7B%5Cphi%28n%29-1%7D%7Bn-1%7D%3D%5Cfrac%7Bk-1%7Dk) Since we know k: ![k\cdot\phi(n)\equiv k\ (\text{mod }n-1)](https://chart.apis.google.com/chart?cht=tx&chl=k%5Ccdot%5Cphi%28n%29%5Cequiv%20k%5C%20%28%5Ctext%7Bmod%20%7Dn-1%29) And that's about as far as I have got; I'm still pursuing some of my routes but I wonder if I'm missing the point! With a brute force approach I have found the sum up to 10 which is 5699973227 (only 237 solutions for n). I'm pretty much out of ideas; can anyone give away some hints? --- : A lot of work has been done by many people and together we've been able to prove several things. Here's a list: n is always odd and k is always even. k <= 10. n must be squarefree. I have found every solution for when n=pq (2 prime factors) with p>q. I used the fact that for 2 primes q = k+factor(k^2-k+1) and p = k+[k^2-k+1]/factor(k^2-k+1). We also know for 2 primes k < q < 2k. For n with 2 of more prime factors, all of n's primes are greater than k.
Project Euler Problem 245
CC BY-SA 2.5
0
2009-05-17T17:20:00.097
2021-03-07T16:29:09.843
2017-02-08T14:12:07.790
-1
null
[ "python", "algorithm", "math" ]
876,504
1
876,537
null
2
483
I need to run an application on the server. I have an executable file, which runs perfectly well on my own permissions through terminal services. It also runs well on my own machine through the asp.net when I run the site with my VS. When I tried running my site on the real IIS it just hanged. I tried changing the credentials of the StartInfo to my own, and also tried Impresonate=true in the web.config to myself. In both cases it still didn't work. I keep getting the following error (when run under my credentials and entering the server on /console) ![alt text](https://i.stack.imgur.com/ijQlM.png) I also have "Allow service to interact with desktop" checked in the IIS options. Anyone here knows what I am missing? Some option I should check, or maybe some other way of doing what I need? Thanks.
trying to run a process from an asp.net application
CC BY-SA 3.0
null
2009-05-18T06:52:40.227
2015-06-19T20:58:39.400
2015-06-19T20:58:39.400
1,159,643
93,031
[ "asp.net", "iis" ]
878,775
1
878,842
null
3
12,758
I'm taking a look at this widget, and it appears to be a UIPickerView, however I haven't seen anything provided by the iPhone SDK API that allows for horizontal scrolling only. Mostly it's all done vertically. Also there appears to be a custom graphic around this picker, so it might not be that either. I'm curious if anyone is able to determine if this is indeed a UIPickerView or perhaps a hacked up UIScrollView? The widget is handy -- and I like its use. I found it in some random groceries app in the app store. Here is the screenshot: ![enter image description here](https://i.stack.imgur.com/bCLRa.jpg) Thanks all.
UIPickerView that scrolls horizontally on the iPhone?
CC BY-SA 3.0
0
2009-05-18T17:09:38.280
2013-01-23T21:32:00.493
2011-07-28T15:50:21.810
128,662
null
[ "iphone", "objective-c", "cocoa-touch" ]
883,510
1
885,053
null
4
11,575
I think I've found the cause: Document Info window in IB has a warning: Bummer. --- I've built nib in Interface Builder that has `UITabBarController` at top level and switches between `UINavigationController`s. It works fine when everything is in a single `nib` file, but I'd like to use separate `nib` files for `UINavigationController`s. Starting with Apple's TabBar template, if I just change class of SecondView to `UINavigationController`, it all breaks: ![second nib](https://imgur.com/g6t59.png) and all I get is this: ``` // imgur has lost the image, sorry // ``` Is it possible to have separate file for `UINavigationController` without programmatically setting everything? I would like `TabBarController` to handle loading and unloading of nibs.
Loading UINavigationController from another nib automatically by UITabBarController
CC BY-SA 3.0
0
2009-05-19T15:38:39.033
2012-12-10T11:37:14.280
2012-12-10T11:37:14.280
27,009
27,009
[ "iphone", "cocoa-touch", "xib" ]
886,853
1
888,330
null
0
1,439
![alt text](https://lh5.ggpht.com/_M5W2QFQgto4/ShPATpz_zXI/AAAAAAAADzc/4oPbuX2xNhY/Login.png) in above image you would notice that, doted rectangle indicating ComboBox is focused But the problem is it exceeding the text area of ComboBox... how do I align it with text area ? Thanks
Control focus styling
CC BY-SA 2.5
null
2009-05-20T08:39:45.887
2011-08-16T16:31:51.787
2017-02-08T14:12:08.127
-1
85,606
[ "wpf", "wpf-controls", "styles" ]
891,292
1
891,364
null
1
641
What's the best way to implement an interface that looks like this in rails? ![interface example](https://i.stack.imgur.com/r39Jh.png) Currently I'm using Searchlogic, and it's a tad painful. Problems include: - Making sure certain operations remain orthogonal -- for example, if you select "Short Posts" and then search, your search results should be restricted to short posts.- Making sure the correct link gets the "selected" class. Right now the links are `<a>`'s, so maintaining this state client-side is tricky. I'm hacking it by having the AJAX response to, say, sorting return a new sort links section with the correct link "selected". Using radio buttons instead of `<a>` tags would make it easier to maintain state client-side -- maybe I should do that?
Best way to implement simple sorting / searching in Rails
CC BY-SA 3.0
0
2009-05-21T03:29:30.083
2015-06-19T21:10:25.143
2015-06-19T21:10:25.143
1,159,643
25,068
[ "ruby-on-rails", "search", "sorting", "searchlogic" ]
891,643
1
929,360
null
597
97,890
: That's it folks! Bounty deadline is here, and after some tough deliberation, I have decided that [Boojum's entry](https://stackoverflow.com/questions/891643/twitter-image-encoding-challenge/929360#929360) just barely edged out [Sam Hocevar's](https://stackoverflow.com/questions/891643/twitter-image-encoding-challenge/904874#904874). I will post more detailed notes once I've had a chance to write them up. Of course, everyone should feel free to continue to submit solutions and improve solutions for people to vote on. Thank you to everyone who submitted and entry; I enjoyed all of them. This has been a lot of fun for me to run, and I hope it's been fun for both the entrants and the spectators. I came across [this interesting post](http://www.flickr.com/photos/quasimondo/3518306770/in/set-72057594062596732/) about trying to compress images into a Twitter comment, and lots of people in that thread (and a [thread on Reddit](http://www.reddit.com/r/programming/comments/8lwmw/guy_encodes_an_image_in_a_single_tweet140_chars/)) had suggestions about different ways you could do it. So, I figure it would make a good coding challenge; let people put their money where their mouth is, and show how their ideas about encoding can lead to more detail in the limited space that you have available. I challenge you to come up with a general purpose system for encoding images into 140 character Twitter messages, and decoding them into an image again. You can use Unicode characters, so you get more than 8 bits per character. Even allowing for Unicode characters, however, you will need to compress images into a very small amount of space; this will certainly be a lossy compression, and so there will have to be subjective judgements about how good each result looks. Here is the result that the original author, [Quasimondo](http://www.flickr.com/photos/quasimondo/), got from his encoding (image is licensed under a [Creative Commons Attribution-Noncommercial license](http://creativecommons.org/licenses/by-nc/2.0/deed.en)): ![Mona Lisa](https://farm4.static.flickr.com/3346/3518306770_1de2bc2970.jpg?v=0) Can you do better? ### Rules 1. Your program must have two modes: encoding and decoding. 2. When encoding: Your program must take as input a graphic in any reasonable raster graphic format of your choice. We'll say that any raster format supported by ImageMagick counts as reasonable. Your program must output a message which can be represented in 140 or fewer Unicode code points; 140 code points in the range U+0000–U+10FFFF, excluding non-characters (U+FFFE, U+FFFF, U+nFFFE, U+nFFFF where n is 1–10 hexadecimal, and the range U+FDD0–U+FDEF) and surrogate code points (U+D800–U+DFFF). It may be output in any reasonable encoding of your choice; any encoding supported by GNU iconv will be considered reasonable, and your platform native encoding or locale encoding would likely be a good choice. See Unicode notes below for more details. 3. When decoding: Your program should take as input the output of your encoding mode. Your program must output an image in any reasonable format of your choice, as defined above, though for output vector formats are OK as well. The image output should be an approximation of the input image; the closer you can get to the input image, the better. The decoding process may have no access to any other output of the encoding process other than the output specified above; that is, you can't upload the image somewhere and output the URL for the decoding process to download, or anything silly like that. 4. For the sake of consistency in user interface, your program must behave as follows: Your program must be a script that can be set to executable on a platform with the appropriate interpreter, or a program that can be compiled into an executable. Your program must take as its first argument either encode or decode to set the mode. Your program must take input in one or more of the following ways (if you implement the one that takes file names, you may also read and write from stdin and stdout if file names are missing): Take input from standard in and produce output on standard out. my-program encode <input.png >output.txt my-program decode <output.txt >output.png Take input from a file named in the second argument, and produce output in the file named in the third. my-program encode input.png output.txt my-program decode output.txt output.png 5. For your solution, please post: Your code, in full, and/or a link to it hosted elsewhere (if it's very long, or requires many files to compile, or something). An explanation of how it works, if it's not immediately obvious from the code or if the code is long and people will be interested in a summary. An example image, with the original image, the text it compresses down to, and the decoded image. If you are building on an idea that someone else had, please attribute them. It's OK to try to do a refinement of someone else's idea, but you must attribute them. ### Guidelines These are basically rules that may be broken, suggestions, or scoring criteria: 1. Aesthetics are important. I'll be judging, and suggest that other people judge, based on: How good the output image looks, and how much it looks like the original. How nice the text looks. Completely random gobbledigook is OK if you have a really clever compression scheme, but I also want to see answers that turn images into mutli-lingual poems, or something clever like that. Note that the author of the original solution decided to use only Chinese characters, since it looked nicer that way. Interesting code and clever algorithms are always good. I like short, to the point, and clear code, but really clever complicated algorithms are OK too as long as they produce good results. 2. Speed is also important, though not as important as how good a job compressing the image you do. I'd rather have a program that can convert an image in a tenth of a second than something that will be running genetic algorithms for days on end. 3. I will prefer shorter solutions to longer ones, as long as they are reasonably comparable in quality; conciseness is a virtue. 4. Your program should be implemented in a language that has a freely-available implementation on Mac OS X, Linux, or Windows. I'd like to be able to run the programs, but if you have a great solution that only runs under MATLAB or something, that's fine. 5. Your program should be as general as possible; it should work for as many different images as possible, though some may produce better results than others. In particular: Having a few images built into the program that it matches and writes a reference to, and then produces the matching image upon decoding, is fairly lame and will only cover a few images. A program that can take images of simple, flat, geometric shapes and decompose them into some vector primitive is pretty nifty, but if it fails on images beyond a certain complexity it is probably insufficiently general. A program that can only take images of a particular fixed aspect ratio but does a good job with them would also be OK, but not ideal. You may find that a black and white image can get more information into a smaller space than a color image. On the other hand, that may limit the types of image it's applicable to; faces come out fine in black and white, but abstract designs may not fare so well. It is perfectly fine if the output image is smaller than the input, while being roughly the same proportion. It's OK if you have to scale the image up to compare it to the original; what's important is how it looks. 6. Your program should produce output that could actually go through Twitter and come out unscathed. This is only a guideline rather than a rule, since I couldn't find any documentation on the precise set of characters supported, but you should probably avoid control characters, funky invisible combining characters, private use characters, and the like. ### Scoring rubric As a general guide to how I will be ranking solutions when choosing my accepted solution, lets say that I'll probably be evaluating solutions on a 25 point scale (this is very rough, and I won't be scoring anything directly, just using this as a basic guideline): - - - - - - - - - - - - - - - - - - ### Reference images Some folks have asked for some reference images. Here are a few reference images that you can try; smaller versions are embedded here, they all link to larger versions of the image if you need those: [](http://www.cs.cmu.edu/~chuck/lennapg/lena_std.tif) [](http://upload.wikimedia.org/wikipedia/commons/6/6a/Mona_Lisa.jpg) [](http://upload.wikimedia.org/wikipedia/commons/2/24/Cornell_box.png) [](http://ephemera.continuation.org/stackoverflow/challenge/so-logo.png) ### Prize I am offering a (plus the 50 that StackOverflow kicks in) for the solution that I like the best, based on the above criteria. Of course, I encourage everyone else to vote on their favorite solutions here as well. ### Note on deadline This contest will run until the bounty runs out, about 6 PM on Saturday, May 30. I can't say the precise time it will end; it may be anywhere from 5 to 7 PM. I will guarantee that I'll look at all entries submitted by 2 PM, and I will do my best to look at all entries submitted by 4 PM; if solutions are submitted after that, I may not have a chance to give them a fair look before I have to make my decision. Also, the earlier you submit, the more chance you will have for voting to be able to help me pick the best solution, so try and submit earlier rather than right at the deadline. ### Unicode notes There has also been some confusion on exactly what Unicode characters are allowed. The range of possible Unicode code points is `U+0000` to `U+10FFFF`. There are some code points which are never valid to use as Unicode characters in any open interchange of data; these are the and the . Noncharacters are defined in the [Unidode Standard 5.1.0 section 16.7](http://www.unicode.org/versions/Unicode5.0.0/ch16.pdf) as the values `U+FFFE`, `U+FFFF`, `U+``FFFE`, `U+``FFFF` where is `1`–`10` hexadecimal, and the range `U+FDD0`–`U+FDEF`. These values are intended to be used for application-specific internal usage, and conforming applications may strip these characters out of text processed by them. Surrogate code points, defined in the [Unicode Standard 5.1.0 section 3.8](http://www.unicode.org/versions/Unicode5.0.0/ch03.pdf) as `U+D800`–`U+DFFF`, are used for encoding characters beyond the Basic Multilingual Plane in UTF-16; thus, it is impossible to represent these code points directly in the UTF-16 encoding, and it is invalid to encode them in any other encoding. Thus, for the purpose of this contest, I will allow any program which encodes images into a sequence of no more than 140 Unicode code points from the range `U+0000`–`U+10FFFF`, excluding all noncharacters and surrogate pairs as defined above. I will solutions that use only assigned characters, and even better ones that use clever subsets of assigned characters or do something interesting with the character set they use. For a list of assigned characters, see the [Unicode Character Database](http://unicode.org/Public/UNIDATA/UnicodeData.txt); note that some characters are listed directly, while some are listed only as the start and end of a range. Also note that surrogate code points are listed in the database, but forbidden as mentioned above. If you would like to take advantage of certain properties of characters for making the text you output more interesting, there are a [variety of databases of character information](http://unicode.org/Public/UNIDATA/) available, such as a [list of named code blocks](http://unicode.org/Public/UNIDATA/Blocks.txt) and [various character properties](http://unicode.org/Public/UNIDATA/PropList.txt). Since Twitter does not specify the exact character set they support, I will be lenient about solutions which do not actually work with Twitter because certain characters count extra or certain characters are stripped. It is preferred but not required that all encoded outputs should be able to be transferred unharmed via Twitter or another microblogging service such as [identi.ca](http://identi.ca/). I have seen some documentation stating that Twitter entity-encodes <, >, and &, and thus counts those as 4, 4, and 5 characters respectively, but I have not tested that out myself, and their JavaScript character counter doesn't seem to count them that way. ### Tips & Links - - [ImageMagick](http://www.imagemagick.org/)[Python Imaging Library](http://www.pythonware.com/products/pil/)- [this quick guide](http://www.azillionmonkeys.com/qed/unicode.html)[this detailed FAQ on UTF-8 in Linux and Unix](http://www.cl.cam.ac.uk/~mgk25/unicode.html)- - [PPM format](http://en.wikipedia.org/wiki/Netpbm_format)[ImageMagick](http://www.imagemagick.org/)
Twitter image encoding challenge
CC BY-SA 3.0
0
2009-05-21T06:37:52.093
2017-07-17T12:55:56.927
2017-07-17T12:55:56.927
229,044
69,755
[ "twitter", "unicode", "compression" ]
895,382
1
null
null
12
4,678
I'm using the ASP.NET MVC and the ADO.NET Entity Framework together. I want my Views and Controllers strongly-typed. But how am I supposed to handle entity associations? Here's a simple example: A Person has one Department. A Department has zero or more People. ![Entity Data Model of Person and Department entities](https://i.stack.imgur.com/G8m7Z.gif) My controller passes an instance of a Person object and a collection of all the Department objects to the View. ``` public class PersonController : Controller { ... // // GET: /Person/Create public ActionResult Create() { Person Model = new Person(); Model.Id = Guid.NewGuid(); ViewData["Departments"] = db.Department; return View(Model); } ... } ``` My View has a "Department" DropDownList with all departments as options. ``` <% using (Html.BeginForm()) {%> <fieldset> <legend>Fields</legend> <p> <label for="Id">Id:</label> <%= Html.TextBox("Id") %> <%= Html.ValidationMessage("Id", "*") %> </p> <p> <label for="Name">Name:</label> <%= Html.TextBox("Name") %> <%= Html.ValidationMessage("Name", "*") %> </p> <p> <label for="Department">Family:</label> <%= Html.DropDownList("Department", new SelectList((IEnumerable)ViewData["Departments"], "Id", "Name"))%> <%= Html.ValidationMessage("Department", "*")%> </p> <p> <input type="submit" value="Create" /> </p> </fieldset> <% } %> ``` But, the Person object posted to the controller has ``` public class PersonController : Controller { ... // // POST: /Person/Create [AcceptVerbs(HttpVerbs.Post)] public ActionResult Create(Person Model) { try { db.AddToPerson(Model); db.SaveChanges(); return RedirectToAction("Index"); } catch { return View(); } } ... } ``` Why isn't the selected Department from DropDownList "Department" automatically added to the model Person? How do I use the ADO.NET Entity Framework and ASP.NET MVC with strongly-typed Views and Controllers?
Entity Framework with strongly-typed MVC
CC BY-SA 3.0
0
2009-05-21T21:49:29.403
2015-06-19T20:44:21.183
2015-06-19T20:44:21.183
1,159,643
83
[ "c#", ".net", "asp.net", "asp.net-mvc", "entity-framework" ]
903,637
1
903,645
null
2
7,326
The code below working for only first div. I can't display other divs when i clicked on the other "img"s. Do you know a method to reach second (next) element? ``` $(document).ready(function() { $('.imgOpenClose').click(function() { if ($(this).attr("src") == "images/openTree.gif") { $(this).attr("src", "images/closeTree.gif"); $(this).parent().find('div').eq(0).show(); } else { $(this).attr("src", "images/openTree.gif"); $(this).parent().find('div').eq(0).hide(); } }); }); ``` ![Wanna open table when i clicked on plus images](https://content.screencast.com/users/uzay95/folders/Jing/media/f055b873-714e-4d29-a605-05dabddd1cee/2009-05-24_1455.png) ![And wanna see the table inside this div](https://content.screencast.com/users/uzay95/folders/Jing/media/289bd853-26e0-43fc-bc2a-c3a21f5837c3/2009-05-24_1457.png)
How to select second element with JQUERY when clicked on image?
CC BY-SA 2.5
0
2009-05-24T12:08:03.410
2009-05-24T13:05:00.050
2017-02-08T14:12:13.567
-1
104,085
[ "jquery" ]
904,381
1
904,784
null
23
809
Why on sites like Stack Overflow, Techcrunch, Smashing Magazine, etc. are the page titles (i.e. the text at the top of the page) clickable URLs that redirect to the same page that the user is on? Some examples: ![enter image description here](https://i.stack.imgur.com/rgMCc.png) I believe that this does not effect SEO as search engines ignore internal links. Is it for usability purposes?
Why are page titles on some websites clickable URLs?
CC BY-SA 4.0
0
2009-05-24T18:29:03.183
2019-02-02T04:18:35.383
2019-02-02T03:55:34.463
712,334
2,699
[ "usability", "standards" ]
907,887
1
907,955
null
0
784
I am currently designing a role based authentication system for resources where many users have different access rights to it. A role may be a single user, or a group of roles (so a role is a tree of roles). (see graphic below) ![The other image here](https://yuml.me/diagram/scale:65/class/%5BAdministration%5D-%3E%5BSite1Admins%5D,%20%5BAdministration%5D-%3E%5BSite2Admins%5D,%20%5BSite1Admins%5D-%3E%5BSally%5D,%20%5BSite1Admins%5D-%3E%5BJoe%5D,%20%5BSite2Admins%5D-%3E%5BMike%5D,%20%5BSite2Admins%5D-%3E%5BMax%5D,%20%5BSite2Admins%5D-%3E%5BHarry%5D) A resource can have multiple authentication properties (like read, write, delete), where each of this is a list of roles allowed to do access the operation. (see graphic below) ![Image goes here](https://yuml.me/diagram/scale:65/class/%5BResource%5D+-%3E%5Bread%5D,%20%5Bread%5D-%3E%5BAdministrators%5D,%20%5Bread%5D-%3E%5BManagement%5D,%20%5Bread%5D-%3E%5BMarketing%5D,%20%5BResource%5D+-%3E%5Bwrite%5D,%20%5Bwrite%5D-%3E%5BAdministrators%5D,%20%5Bwrite%5D-%3E%5BManagement%5D,%20%5BResource%5D+-%3E%5Bdelete%5D,%20%5Bdelete%5D-%3E%5BAdministrators%5D) The problem is if I want to check if a user has the right to access a property, i have to traverse n trees in worst case (where n is the number of roles assigned to an property). So for example to check if 'Max' may read the property I might have to check the Marketing, Management and Administration trees if they contain 'Max'. --- Do you know of any algorithm or alternative approach which removes the quite expensive tree searches while maintaining the role system or something equally powerful. The perfect case would be some lookup like O(log(n)) for n roles. Thanks, Fionn
Scalable role based authentication
CC BY-SA 2.5
null
2009-05-25T20:04:39.250
2009-05-26T04:36:02.803
2017-02-08T14:12:15.990
-1
21,566
[ "authentication", "scalable", "role-based" ]
911,137
1
911,285
null
21
27,289
I'd like to create a pop-up menu similar to the one found in the mail app when you want to reply to a message. I've seen this in more than one application so I wasn't sure if there was something built into the framework for it or some example code out there. ![UIActionSheet example](https://i.stack.imgur.com/ia15x.jpg)
Creating iPhone Pop-up Menu Similar to Mail App Menu
CC BY-SA 3.0
0
2009-05-26T14:56:02.723
2019-06-15T00:25:24.007
2016-04-01T11:15:23.253
709,671
26,861
[ "ios", "objective-c", "cocoa-touch", "uiview" ]
911,644
1
911,775
null
12
37,440
Assuming the following markup: ``` <fieldset> <legend>Radio Buttons</legend> <ol> <li> <input type="radio" id="x"> <label for="x"><!-- Insert multi-line markup here --></label> </li> <li> <input type="radio" id="x"> <label for="x"><!-- Insert multi-line markup here --></label> </li> </ol> </fieldset> ``` How do I style radio button labels so that they look like the following in most browsers (IE6+, FF, Safari, Chrome: ![Radio Button Labels](https://i.stack.imgur.com/sfsfW.png)
How can I make multi-line, vertically and horizontally aligned labels for radio buttons in HTML Forms with CSS?
CC BY-SA 3.0
0
2009-05-26T16:44:38.650
2020-09-21T11:24:23.863
2015-06-19T21:00:31.033
1,159,643
94,120
[ "html", "css", "cross-browser", "radio-button", "label" ]
912,356
1
912,378
null
4
7,738
I am getting married this coming Saturday (May 30 2009). We are poor. So, instead of hiring a DJ, I want my friend to kick off mp3 playlists from a laptop to be played through a PA system. Well I had a vision for some software that would be perfect for this. Here is that vision: ![alt text](https://lh3.ggpht.com/_1RtF2lqDv2g/ShxExPnO1FI/AAAAAAAAFg0/wW_pnSNT-bY/s800/may30mediaplayer.jpg) I want this to be so that my friend can't screw this up and I think that if my vision were a reality then there would be no screwing up. And now for the programming question? How can I play mp3's from .net code? I am currently experimenting with NAudio, but I don't know if I can make it fade the files in/out. Are there any other free libraries out there that could help me? Thanks for any input. Time is of the essence. # PEOPLE! Focus on the programming question! If I ever need to work with audio in the future, your answers could be the keys to my destiny.
Play MP3 from .net code
CC BY-SA 2.5
null
2009-05-26T19:44:55.527
2010-08-24T19:49:24.603
2020-06-20T09:12:55.060
-1
64,334
[ ".net", "audio", "mp3" ]
912,793
1
913,280
null
1
158
I am using Windows XP and flex builder 3. Here is the error I am receiving: ![Error Screenshot](https://i.stack.imgur.com/Tpw5t.jpg) I am trying to debug a flex application by toggling a break point. When I try to debug, I get the above error. so far the only thing I installed is flex builder 3.
Error when trying to debug Flex Application
CC BY-SA 3.0
null
2009-05-26T21:13:57.030
2015-09-30T10:57:29.957
2015-09-30T10:57:29.957
1,213,296
1,748,769
[ "apache-flex", "flex3" ]
916,145
1
916,195
null
4
3,596
Have been scatching my head about this - and I reckon it's simple but my geometry/algebra is pretty rubbish, and I can't remember how to do this stuff from my school days! EDITED: I have a list of coordinates with people stood by them - I need an algorithm to order people from top left to bottom right in a list (array), and the second criteria demands that coordinates that are closer towards the top left origin take prescendance over all others - how would you do this? The code should show the order as: 1. Tom 2. Harry 3. Bob 4. Dave See diagram below: ![alt text](https://rantincsharp.files.wordpress.com/2009/05/diagram.png)
Ordering coordinates problem
CC BY-SA 3.0
0
2009-05-27T14:46:11.497
2016-01-24T06:46:42.947
2017-02-08T14:12:17.347
-1
5,175
[ "java", "arrays", "algorithm", "coordinates" ]
917,610
1
917,636
null
361
945,604
How do I put an icon inside a form's input element? ![Screenshot of a web form with three inputs which have icons in them](https://i.stack.imgur.com/V0Tjp.png) Live version at: [Tidal Force theme](http://www.elegantthemes.com/preview/TidalForce/?p=9)
Put icon inside input element in a form
CC BY-SA 3.0
0
2009-05-27T19:36:46.683
2023-02-24T15:03:09.263
2020-06-23T07:52:18.597
2,214,789
80,222
[ "html", "css", "forms", "input", "icons" ]
918,483
1
918,544
null
2
4,341
I have the following html/css that is causing problems in Firefox 1.5 and 2, but is working correctly in IE6/7/8, Safari, Chrome, Opera and Firefox 1 and 3. ``` <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Firefox Bug</title> <style type="text/css"> * { border: 0; padding: 0; margin: 0; } #wrapper { width: 500px; min-height: 550px; height: auto !important; height: 550px; border: 5px solid blue; position: relative; display: inline; overflow: auto; float: left; } #content { border: 5px solid green; } #bottom { border: 5px solid red; position: absolute; bottom: 0; right: 0; width: 200px; height: 100px; } </style> </head> <body> <div id="wrapper"> <div id="content"> Foo </div> <div id="bottom"> Bar </div> </div> </body> </html> ``` In the browsers that are working correctly, the bottom element shows up on the bottom right of the wrapper element. However, in Firefox 2, the bottom element is at the bottom of the content element. I cannot figure out why this is happening, any help would be greatly appreciated. ![Expected Results](https://farm4.static.flickr.com/3417/3571798464_94955cc5f5_o.png) ![Firefox Bug](https://farm3.static.flickr.com/2410/3570991369_1303035317_o.png)
Firefox 1.5 and 2 css absolute position bug
CC BY-SA 2.5
null
2009-05-27T23:29:00.677
2009-05-28T02:37:41.980
2017-02-08T14:12:18.033
-1
57,639
[ "css", "firefox", "firefox2" ]
918,734
1
918,862
null
2
2,137
in my (puzzle) game the pieces are drawn on-screen using a `CALayer` for each piece. There are 48 pieces (in an 8x6 grid) with each piece being 48x48 pixels. I'm not sure if this is just too many layers, but if this isn't the best solution I don't know what is, because redrawing the whole display using Quartz2D every frame doesn't seem like it would be any faster. Anyway, the images for the pieces come from one big PNG file that has 24 frames of animation for 10 different states (so measures 1152 x 480 pixels) and the animation is done by setting the `contentsRect` property of each `CALayer` as I move it. This actually seems to work pretty well with up to 7 pieces tracking a touch point in the window, but the weird thing is that when I initially start moving the pieces, for the first 0.5 a second or so, it's very jerky like the CPU is doing something else, but after that it'll track and update the screen at 40+ FPS (according to Instruments). So does anyone have any ideas what could account for that initial jerkiness? The only theory I could come up with is it's decompressing bits of the PNG file into a temporary location and then discarding them after the animation has stopped, in which case is there a way to stop Core Animation doing that? I could obviously split the PNG file up into 10 pieces, but I'm not convinced that would help as they'd all (potentially) still need to be in memory at once. OK, as described in the comment to the first answer, I've split the image up into ten pieces that are now 576 x 96, so as to fit in with the constraints of the hardware. It's still not as smooth as it should be though, so I've put a bounty on this. I've linked one of the images below. Essentially the user's touch is tracked, the offset from the start of the tracking is calculated (they can one move horizontal or vertical and only one place at a time). Then one of the images is selected as the content of the layer (depending on what type of piece it is and whether it's moving horizontally or vertically). Then the `contentsRect` property is set to chose one 48x48 frame from the larger image with something like this:- ``` layer.position = newPos; layer.contents = (id)BallImg[imgNum]; layer.contentsRect = CGRectMake((1.0/12.0)*(float)(frame % 12), 0.5 * (float)(frame / 12), 1.0/12.0, 0.5); ``` btw. My theory about it decompressing the source image a-fresh each time wasn't right. I wrote some code to copy the raw pixels from the decoded PNG file into a fresh `CGImage` when the app loads and it didn't make any difference. Next thing I'll try is copying each frame into a separate `CGImage` which will get rid of the ugly `contentsRect` calculation at least. ![Sample image](https://i.stack.imgur.com/Wxm6J.png) Further back-to-basics investigation points to this being a problem with touch tracking and not a problem with Core Animation at all. I found a basic sample app that tracks touches and commented out the code that actually causes the screen to redraw and the `NSLog()` shows the exactly the same problem I've been experiencing: A long-ish delay between the `touchesBegin` and first `touchesMoved` events. ``` 2009-06-05 01:22:37.209 TouchDemo[234:207] Begin Touch ID 0 Tracking with image 2 2009-06-05 01:22:37.432 TouchDemo[234:207] Touch ID 0 Tracking with image 2 2009-06-05 01:22:37.448 TouchDemo[234:207] Touch ID 0 Tracking with image 2 2009-06-05 01:22:37.464 TouchDemo[234:207] Touch ID 0 Tracking with image 2 2009-06-05 01:22:37.480 TouchDemo[234:207] Touch ID 0 Tracking with image 2 ``` Typical gap between `touchesMoved` events is 20ms. The gap between the `touchesBegin` and first `touchesMoved` is ten times that. And that's with no computation or screen updating at all, just the `NSLog` call. Sigh. I guess I'll open this up a separate question.
Core Animation with contentsRect jerkiness
CC BY-SA 3.0
0
2009-05-28T01:12:34.960
2012-10-21T17:18:37.667
2012-10-21T17:18:37.667
249,690
47,612
[ "iphone", "core-animation" ]
920,279
1
921,440
null
2
2,453
I'm building a software repository on top of the Django framework. Because it will contain a lot of files, i want it to make some sense when looking at it through a file manager. So i grouped the files first by the URL of a program they belong to and then by first two letters of that URL. Here's how it looks: ![screenshot of my directory structure](https://imgur.com/BPdEd.png) The schema looks like this: ``` class File(models.Model): # If called like upload_to, don't put a slash in front of the result # because we already have one in settings.MEDIA_ROOT def get_absolute_url(self, filename=None): return '%sfiles/%s/%s/%s' % ('' if filename else '/', self.download.url[:2], self.download.url, filename or self.name) name = models.FileField(upload_to=get_absolute_url, max_length=255) size = models.IntegerField() title = models.CharField(blank=True, max_length=255) download = models.ForeignKey('Download', related_name='files') class Download(models.Model): url = models.SlugField(unique=True, max_length=255) title = models.CharField(max_length=255) ``` There is, however, a minor problem: FileField will store the entire generated path instead of just the name, which i would rather like to avoid. Is there any way to override (probably in my own field class) what FileField writes to the database and how it reconstructs the path after loading the raw field?
File uploads in Django: prevent FileField from writing the full path to the database
CC BY-SA 2.5
0
2009-05-28T10:57:36.293
2009-05-28T17:59:03.433
2009-05-28T17:40:37.917
60,655
60,655
[ "django" ]
921,106
1
921,303
null
1
2,045
I'd like to create the context extension methods described in [Cesar de la Torre's blog post](http://blogs.msdn.com/cesardelatorre/archive/2008/09/04/updating-data-using-entity-framework-in-n-tier-and-n-layer-applications-short-lived-ef-contexts.aspx). But I'm not sure how to declare the class that holds my extension methods. [Griff Townsend](http://grifftownsend.blogspot.com/2008/08/small-extension-to-entity-framework.html) wrote: > If I include a reference to this class (or have the class in my namespace), any ObjectContext references will be able to execute these extensions:![ADO.NET Entity Framework extension method intellisense](https://4.bp.blogspot.com/_wtz1ml2FXzY/SLtQloSs0KI/AAAAAAAAABI/X5RSyF3awxQ/s400/ExtensionScreen.png)If you look at the tool tip in the photo above, you should be able to see that I can now cleanly access any function that I add to the EntitySet that I create. How do I declare the class that holds my extension methods?
How to create ADO.NET Entity Framework ObjectContext extensions
CC BY-SA 2.5
null
2009-05-28T14:22:39.063
2009-05-28T16:24:37.633
2017-02-08T14:12:18.720
-1
83
[ "c#", ".net", "entity-framework" ]
921,416
1
923,070
null
8
2,333
Greetings. I've been using vim for years, and I've recently started toying with XCode. One of the things I really like about XCode is that it will complete words me hitting `<TAB>`. For instance, in this image below I only need to type `NSSObj` and the rest is filled in automatically, no special keystroke required. ![alt text](https://content.screencast.com/users/natemurray/folders/Jing/media/8c5dcc35-6908-4dd4-9bd8-7aea1e315e5a/00000005.png) I'd like to reproduce this effect in vim. To be clear, this question is not about how to get tab/omni-completion working in vim. I've already got tab/omni completion working just fine and that's not a problem. The question is: does anyone know how to get vim to autocomplete ?
XCode-like auto completion in vim (without tab)?
CC BY-SA 2.5
0
2009-05-28T15:17:50.247
2012-11-29T03:28:06.750
2017-02-08T14:12:19.073
-1
110,644
[ "xcode", "vim", "autocomplete" ]
921,455
1
921,473
null
23
6,655
In this [xkcd comic](http://xkcd.com/378/): ![Real Programmers](https://imgs.xkcd.com/comics/real_programmers.png) they mention that real programmers use `cat`. Well, I was asking myself: how could you program using the `cat` command?
How do I program using cat?
CC BY-SA 2.5
0
2009-05-28T15:22:26.993
2015-04-03T16:45:27.573
2017-02-08T14:07:59.957
-1
63,825
[ "bash", "command-line", "code-golf" ]
925,311
1
959,503
null
1
5,550
Im writing my jasper report problem with . Following is the code that I'm trying to execute : struts.xml contains : ``` <action name="myJasperTest1" class="temp.JasperAction1"> <result name="success" type="jasper"> <param name="location">/jasper/our_compiled_template.jasper</param> <param name="dataSource">myList</param> <param name="format">PDF</param> </result> </action> ``` My JasperAction1 contains : ``` import java.util.ArrayList; import java.util.List; import java.io.FileInputStream; import com.opensymphony.xwork2.ActionSupport; import com.sufalam.business.model.util.LegacyJasperInputStream; import com.sufalam.business.finance.model.bean.Account; import net.sf.jasperreports.engine.JasperCompileManager; import net.sf.jasperreports.engine.design.JasperDesign; import net.sf.jasperreports.engine.xml.JRXmlLoader; public class JasperAction1 extends ActionSupport { /** List to use as our JasperReports dataSource. */ private List<Account> myList; public String execute() throws Exception { // Create some imaginary persons. Account a1 = new Account(); Account a2 = new Account(); a1.setId(77); a1.setName("aaa"); a2.setId(88); a2.setName("bbb"); // Store people in our dataSource list (normally would come from database). myList = new ArrayList<Account>(); myList.add(a1); myList.add(a2); // Normally we would provide a pre-compiled .jrxml file // or check to make sure we don't compile on every request. try { JasperDesign design = JRXmlLoader.load( new LegacyJasperInputStream(new FileInputStream("F://backup//report2.jrxml"))); JasperCompileManager.compileReportToFile(design, "F://backup//our_compiled_template1.jasper"); } catch (Exception e) { e.printStackTrace(); return ERROR; } return SUCCESS; } public List<Account> getMyList() { return myList; } } ``` I am using plugin of for generation .jrxml file. After Designing my page using wizard my our_jasper_template.jrxml file contains following code : ``` <?xml version="1.0" encoding="UTF-8"?> <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"> <queryString language="SQL"> <![CDATA[SELECT account_master."name" AS account_master_name, account_master."id" AS account_master_id FROM "public"."account_master" account_master]]> </queryString> <field name="account_master_name" class="java.lang.String"/> <field name="account_master_id" class="java.lang.Integer"/> <title> <band height="58"> <line> <reportElement x="0" y="8" width="555" height="1"/> </line> <line> <reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/> </line> <staticText> <reportElement x="65" y="13" width="424" height="35"/> <textElement textAlignment="Center"> <font size="26" isBold="true"/> </textElement> <text><![CDATA[Classic template]]> </text> </staticText> </band> </title> <detail> <band height="40"> <staticText> <reportElement x="0" y="0" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[account_master_name]]> </text> </staticText> <textField> <reportElement x="139" y="0" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{account_master_name}]]> </textFieldExpression> </textField> <staticText> <reportElement x="0" y="20" width="139" height="20"/> <textElement> <font size="12"/> </textElement> <text><![CDATA[account_master_id]]> </text> </staticText> <textField> <reportElement x="139" y="20" width="416" height="20"/> <textElement> <font size="12"/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$F{account_master_id}]]> </textFieldExpression> </textField> </band> </detail> <pageFooter> <band height="26"> <textField evaluationTime="Report" pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]> </textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="342" y="6" width="170" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement textAlignment="Right"> <font size="10"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]> </textFieldExpression> </textField> <textField pattern="" isBlankWhenNull="false"> <reportElement key="textField" x="1" y="6" width="209" height="19" forecolor="#000000" backcolor="#FFFFFF"/> <box> <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/> </box> <textElement> <font size="10"/> </textElement> <textFieldExpression class="java.util.Date"><![CDATA[new Date()]]> </textFieldExpression> </textField> </band> </pageFooter> </jasperReport> ``` Now the problem I'm facing is when I execute this action class it gives me following output as pdf format : ![alt text](https://i.stack.imgur.com/XFhYf.jpg)
JasperReport Issue using with struts2 - getting null in final PDF file
CC BY-SA 3.0
null
2009-05-29T10:14:49.860
2016-03-18T08:01:11.937
2016-03-18T08:01:11.937
876,298
87,942
[ "java", "jasper-reports" ]
925,440
1
925,634
null
2
1,490
I am quite new to Cocoa and to iPhone programming. I am using the Xcode template to implement a simple app that has: - - I think this represents my in the MVC pattern. I created a simple class to store the username and to do all connection work that represents my and instantiated it inside the AppDelegate. Here a really simplified sketch: ![simplified sketch](https://i.stack.imgur.com/c2e6L.png) It is not really clear to me how can I get data nested deep into subviews (username) or how can I trigger actions in nested parent views (connect button). My question is: How do I implement the ? Thanks in advance for any help, Paull
Cocoa Touch App Architecture - MVC controller?
CC BY-SA 3.0
0
2009-05-29T10:55:28.750
2015-06-19T21:32:35.460
2015-06-19T21:32:35.460
1,159,643
114,181
[ "cocoa", "cocoa-touch", "model-view-controller", "controller" ]
926,172
1
926,192
null
34
32,297
I discovered that it is possible to extract the hard-coded strings from a binary. For example the properties view of [Process Explorer](http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx) displays all the string with more than 3 characters. Here is the code of a simple executable that I wrote to simply test it: ``` #ifndef _WIN32_WINNT #define _WIN32_WINNT 0x0501 #endif #include <stdio.h> #include <tchar.h> #include <Windows.h> int _tmain(int argc, _TCHAR* argv[]) { _TCHAR* hiddenString1 =_T("4537774B-CC80-4eda-B3E4-7A9EE77991F5"); _TCHAR* hiddenString2 =_T("hidden_password_or_whatever"); for (int i= 0; i<argc; i++) { if (0 == _tcscmp(argv[i],hiddenString1)) { _tprintf (_T("The guid argument is correct.\n")); } else if (0 == _tcscmp(argv[i],hiddenString2)) { _tprintf (_T("Do something here.\n")); } } _tprintf (_T("This is a visible string.\n")); //Keep Running Sleep(60000); return 0; } ``` The strings can clearly be extracted from the corresponding executable: ![alt text](https://i.stack.imgur.com/3k8mN.png) I think that it is a little too easy to find the strings. My questions are: 1. How to simply hide hiddenString1 or hiddenString2 in the executable? 2. Is there a more secure way to use "cheat code" than with some obscure hidden input?
How to hide strings in a exe or a dll?
CC BY-SA 3.0
0
2009-05-29T14:10:17.407
2022-09-28T12:21:09.800
2015-06-19T20:57:52.810
1,159,643
113,438
[ "c++", "security", "obfuscation", "reverse-engineering", "defensive-programming" ]
926,729
1
926,735
null
2
5,829
I recently encountered a problem with my Profile provider: it wouldn't retrieve profiles correctly (see error below). It worked locally, but when I put the code compiled by a Web Deployment project on a server it would crash. > Value cannot be null. Parameter name: type Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. [ArgumentNullException: Value cannot be null. Parameter name: type] System.Activator.CreateInstance(Type type, Boolean nonPublic) +2796915 System.Web.Profile.ProfileBase.CreateMyInstance(String username, Boolean isAuthenticated) +76 System.Web.Profile.ProfileBase.Create(String username, Boolean isAuthenticated) +312 ![Hosted by imgur.com](https://imgur.com/WJNkO.png) --- I found the solution, but it's far from being obvious (see my answer below).
Activator.CreateInstance throws ArgumentNullException for parameter 'Type'
CC BY-SA 2.5
0
2009-05-29T15:53:49.830
2017-08-05T18:38:37.667
null
null
810
[ "asp.net", "profile", "web-deployment-project", "activator" ]
930,815
1
930,835
null
1
739
I have and an AJAX script in a page that works just fine with no bugs in firefoex, but IE6 loads the page with an ugly error icon on the status bar. What is the best way i can go about fixing/debugging this? Here is the error report: ![alt text](https://i.stack.imgur.com/CGbyR.jpg) I have checked line 323 many times Here is the function: ``` function checkAvailability(){ var card_select = document.getElementById('card_select').value; var price_select = document.getElementById('price_select').value; var num_of_cards = document.getElementById('num_of_cards').value; var url = 'checkAvailability.php?cardName=' + card_select + '&value=' + price_select + '&amount=' + num_of_cards; var xmlhttp; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); } else if (window.ActiveXObject) { // code for IE6, IE5 xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); } else { alert("Your browser does not support XMLHTTP!"); } xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.responseText) /**** line 323 ****/ { document.getElementById('submit_button').className = 'hidden'; document.getElementById('div_error_massage').className = 'anounce_div'; document.getElementById('error_massage').innerHTML = xmlhttp.responseText; document.getElementById('num_of_cards').className = 'red_inputs'; } else if(isNaN(num_of_cards)) { document.getElementById('submit_button').className = 'hidden'; document.getElementById('num_of_cards').className = 'red_inputs'; document.getElementById('div_error_massage').className = 'hidden'; } else if(num_of_cards != "" && !xmlhttp.responseText) { document.getElementById('submit_button').className = ''; document.getElementById('error_massage').innerHTML = 'Total: $' + document.getElementById('price_select').value * document.getElementById('num_of_cards').value + '.00'; document.getElementById('div_error_massage').className = 'anounce_div'; } else { document.getElementById('submit_button').className = 'hidden'; document.getElementById('num_of_cards').className = 'red_inputs'; } } xmlhttp.open("GET",url,true); xmlhttp.send(null); } ```
How can i debug this ajax script for IE?
CC BY-SA 3.0
null
2009-05-30T22:54:37.760
2015-06-19T21:16:56.300
2015-06-19T21:16:56.300
1,159,643
98,204
[ "javascript", "ajax", "internet-explorer" ]
931,807
1
931,830
null
3
2,631
: I was recently playing around with GDI+ to draw a "Disc" displaying a sweeping color change through 360 degrees. (I dug up some HSL to RGB code to loop through HSL(1,1,1) -> HSL(360,1,1)) Regarding the disc, I first drew a full solid circle using the above, and then a second circle in Grey over the center to give the following ![alt text](https://i206.photobucket.com/albums/bb284/cambo1982/disc.jpg) So this is all fine... but I realised that GDI+ is insulating us from a lot of the tricky match that's going on here by way of the `FillPie` method. Also, `FillPie` requires you to supply a bounding rectangle for the pie as opposed to a Radius Length. It also does a full segment fill and doesnt allow you to specify a part of that segment only. Can anyone point me in the direction of some Math functions or give any explanation on what forumla I would need to calculate the area & plot points of the following "Green Filled Area" given: ``` Point `c` - an x,y co-ordinate Angle `A` - an angle from horizontal Angle `B - an angle from horizontal where `B` - `A` == the sweep angle Length `r` - a distance from `c` Length `r2` - a distance from `c` where `r2` - `r` == the `height` of the segment to be filled. ``` ![alt text](https://i206.photobucket.com/albums/bb284/cambo1982/FillPie.jpg) Links to Math sources are fine but I've had a quick google & look at Wolfram Math and could find what I was looking for. Also, if there was some way to generate a sequence of bounding (x,y) co-or's that could be passed as a `Point[]` to Graphics.FillPolygon, that'd be cool too.
Calculating the bounding points for the area of a "Pie Segment" and "sub areas"
CC BY-SA 2.5
0
2009-05-31T10:26:05.537
2012-03-13T15:39:56.833
2017-02-08T14:12:22.123
-1
30,155
[ "c#", "math", "gdi+", "pie-chart" ]
933,088
1
933,271
null
2
5,034
Audio processing is pretty new for me. And currently using Python Numpy for processing wave files. After calculating FFT matrix I am getting noisy power values for non-existent frequencies. I am interested in visualizing the data and accuracy is not a high priority. Is there a safe way to calculate the clipping value to remove these values, or should I use all FFT matrices for each sample set to come up with an average number ? regards Edit: ``` from numpy import * import wave import pymedia.audio.sound as sound import time, struct from pylab import ion, plot, draw, show fp = wave.open("500-200f.wav", "rb") sample_rate = fp.getframerate() total_num_samps = fp.getnframes() fft_length = 2048. num_fft = (total_num_samps / fft_length ) - 2 temp = zeros((num_fft,fft_length), float) for i in range(num_fft): tempb = fp.readframes(fft_length); data = struct.unpack("%dH"%(fft_length), tempb) temp[i,:] = array(data, short) pts = fft_length/2+1 data = (abs(fft.rfft(temp, fft_length)) / (pts))[:pts] x_axis = arange(pts)*sample_rate*.5/pts spec_range = pts plot(x_axis, data[0]) show() ``` Here is the plot in non-logarithmic scale, for synthetic wave file containing 500hz(fading out) + 200hz sine wave created using Goldwave. ![](https://i.stack.imgur.com/rr9OE.png)
Clipping FFT Matrix
CC BY-SA 3.0
0
2009-05-31T23:15:35.170
2019-03-19T11:01:09.103
2015-06-19T20:59:42.773
1,159,643
40,948
[ "python", "audio", "signal-processing", "fft" ]
934,050
1
null
null
2
234
I am making a favorite list where you can add items through javascript and remove them again. The values are stored in cookies to remember the list when the user returns. The problem I have is that the method to remove the items from the list doesn't get run, unless there has been a postback first. My code to remove items look like this: ``` function removeFavorite(OrderId) { debugger; var cookieValues = jQuery.cookie('FavoriteList'); var cookieArray = cookieValues.split(","); for (var i = 0; i < cookieArray.length; i++) { if (cookieArray[i] == OrderId) { cookieArray.splice(i, 1); } } jQuery('li#liFavoriteOrder_' + OrderId).remove(); jQuery.cookie('FavoriteList', cookieArray.join(",")); } ``` and the code to call the method looks like this: ``` <a onclientclick="removeFavorite(1272331)" style="cursor: pointer;"> ``` ![](/Images/Icons/bullet_toggle_minus.png) and the list looks like ``` <ul id="ulFavoriteList"> <li id="FavoriteId_1272331"> Milk <a onclientclick="removeFavorite(1272331)" style="cursor: pointer;"> <img src="/Images/Icons/bullet_toggle_minus.png"/> </a> </li> </ul> ``` The code to add to to the list looks a bit like this (short version): ``` jQuery('<li id=\"liFavorite_' + OrderId + '\"><a target=\"_blank\" href=\"' + url + '\">' + OrderName + '</a><a style="cursor:pointer;" onclientclick="removeFavorite(' + OrderId+ ')"><img src="/Images/Icons/bullet_toggle_minus.png" /></a></li>').appendTo('ul#ulFavoriteList'); ```
Javascript method
CC BY-SA 2.5
0
2009-06-01T08:55:56.510
2009-06-01T10:04:42.907
null
null
79,465
[ "javascript", "methods" ]
934,873
1
934,960
null
5
11,769
So I have a StackPanel that I am using as a ContentControl. I have a place where I want buttons to be generated based on data that I am binding to, and that is all working good, but I want the buttons to be laid out horizontally, not vertically as is what is currently happening. Here's a screenshot: ![alt text](https://img.photobucket.com/albums/v428/acousticshredder/releaseButtons.jpg) And here is the code from my ContentTemplate description: ``` <StackPanel Name="wpReleaseButtons" Orientation="Horizontal" Grid.Row="2"> <ItemsControl IsTabStop="False" ItemsSource="{Binding Path=BranchCommands}"> <ItemsControl.ItemTemplate> <DataTemplate> <Button Tag="{Binding}" Padding="3"> <TextBlock Text="{Binding Path=DisplayValue}" /> </Button> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> </StackPanel> ``` Not sure what I'm doing wrong here. Any info would be greatly appreciated. Thanks!
Using StackPanel as ContentControl (WPF)
CC BY-SA 2.5
0
2009-06-01T13:41:30.597
2011-08-01T15:52:30.617
2017-02-08T14:12:23.473
-1
39,337
[ ".net", "wpf", "xaml", "itemscontrol", "stackpanel" ]
935,202
1
935,213
null
2
1,207
How do you build your own FastCGI interface in PHP? I'd like to do something similar to what [they're doing in Perl](http://www.perl.com/doc/manual/html/lib/CGI/Fast.html), but in PHP. Is it even possible? Would it be faster? (That is, I'd like to be able to load a web app framework into memory, and then just have FastCGI call a method I provide for every request. So not the more generic preloading of the PHP-interpreter that is happening in the "default" PHP FastCGI setup.) cheers! (: Isn't Mongrel and RoR doing this as well?) Ok I've made a freakin' diagram now :) ![alt text](https://i635.photobucket.com/albums/uu71/drheyw00d/phpfcgi_so.png)
Custom PHP FastCGI interface? (Faster?)
CC BY-SA 2.5
null
2009-06-01T15:01:45.333
2012-07-12T05:31:49.190
2017-02-08T14:12:23.807
-1
111,647
[ "php", "apache", "fastcgi", "lighttpd" ]
937,957
1
937,967
null
1
1,706
I created a plist that contains an NSDictionary structure. The key is a label (which I use to populate tableview cell.text) and the value is a file name that I want to use to 'dynamically' populate cell.image. The exact png filenames are loaded into the project. To make things easier (so I thought), I load the plist into an NSDictionary, then pull that apart into two arrays (using allKeys and allValues). In attempting to set a cell image, I dont understand why this works: ``` cell.image = [UIImage imageNamed:@"bad.png"]; ``` and this does not (in simulator - I get an app crash and barfing in debugger): ``` cell.image = [UIImage imageNamed:[rowImageList objectAtIndex:indexPath.row]]; ``` I can put this next line right before the second piece of code and it works just fine, so it appears that I am getting an NSString from objectAtIndex: ``` NSLog(@"Image name: %@", [rowImageList objectAtIndex:indexPath.row]); ``` I have also tried creating a temp NSString and assigning [rowImageList objectAtIndex:] to it, then using that NSString to supply imageNamed:. Here is some info from debugger: > -[NSCFArray length]: unrecognized selector sent to instance 0x262d910Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSCFArray length]: unrecognized selector sent to instance 0x262d910' Let me know if you need more info/code. Edit: Here's how I populate rowImageList: ``` NSArray *myRowImages = [[NSArray alloc] init]; myRowImages = [searchFilterList allValues]; self.rowImageList = [myRowImages copy]; [myRowImages release]; //where searchFilterList is an NSDictionary that I loaded from a plist ``` Here's a screenshot of my plist: [IMG][![http://i42.tinypic.com/14uwffa.jpg](https://i.stack.imgur.com/XlPcb.jpg)][1](https://i.stack.imgur.com/XlPcb.jpg) [/IMG] Edit: revised rowImageList population: ``` NSMutableArray *myRowImages = [[NSMutableArray alloc] init]; NSEnumerator *enumerator = [searchFilterList objectEnumerator]; id object; while ((object = [enumerator nextObject])) { [myRowImages addObject:[object objectAtIndex:0]]; } self.rowImageList = myRowImages; //edit: added self. prefix [myRowImages release]; ```
Baffled at trying to set cell.image using UIImage: imageNamed:
CC BY-SA 4.0
null
2009-06-02T04:59:36.343
2019-03-19T14:01:31.317
2019-03-19T14:01:31.317
4,751,173
112,317
[ "iphone", "uiimage" ]
938,169
1
938,253
null
1
219
I want to create a component as below: ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/061f1a24-06f0-412f-a322-f9b755a20589/2009-06-02_0922.png) It will be something like dropdownlist. I want to use this component every cell (td) of table rows. So my problem that to show second div(item list) under the first div but above the table rows. Would you please help me about its css?
Different dropdownlist component
CC BY-SA 2.5
null
2009-06-02T06:30:16.553
2009-06-02T07:04:04.863
2017-02-08T14:12:25.597
-1
104,085
[ "css", "html" ]
942,164
1
942,181
null
1
97
I moved my project from my computer to another computer, and when I opened it I was faced with this problem with LINQ: ![enter image description here](https://i.stack.imgur.com/m7pT3.gif) > Expression of type System.Data.Linq.Table(Of Homework) is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider. Please, how can I solve it?
Error mentioning LINQ
CC BY-SA 3.0
null
2009-06-02T22:13:37.083
2012-05-09T01:34:44.070
2012-05-09T01:34:44.070
105,971
null
[ "asp.net", "linq" ]
946,915
1
946,971
null
0
992
Attached Firefox to fiddler and got following error. What would cause this error? ![alt text](https://lh3.ggpht.com/_iyd5d9iK650/SibmdZG_AeI/AAAAAAAAARs/YQTup02cLXs/s800/response_does_not_start_with_http.PNG) Interesting thing to note is that the HTTP header is getting rendered on the page ![alt text](https://lh4.ggpht.com/_iyd5d9iK650/SibWlZ24iHI/AAAAAAAAARk/zV89V-aTmvE/s800/header_rendered.JPG) So Fiddler says that there is a protocol violation because response does not start with HTTP. But the HTTP response is rendered on page.
Response does not start with HTTP
CC BY-SA 2.5
null
2009-06-03T20:08:37.767
2014-01-11T08:02:35.247
2017-02-08T14:12:26.627
-1
37,759
[ "asp.net", "http", "iis", "firefox", "httpresponse" ]
948,336
1
949,097
null
10
1,887
Calculating the [k-core](http://en.wikipedia.org/wiki/K-core) of a graph by iteratively pruning vertices is easy enough. However, for my application, I'd like to be able to add vertices to the starting graph and get the updated core without having to recompute the entire k-core from scratch. Is there a reliable algorithm that can take advantage of the work done on previous iterations? For the curious, the k-core is being used as a preprocessing stage in a clique finding algorithm. Any cliques of size 5 are guaranteed to be part of the 4-core of a graph. In my data set, the 4-core is much smaller than the whole graph so brute-forcing it from there might be tractable. Incrementally adding vertices lets the algorithm work with as small of a data set as possible. My set of vertices is infinite and ordered (prime numbers), but I only care about the lowest numbered clique. Edit: Thinking about it some more based on akappa's answer, detecting the creation of a loop is indeed critical. In the graph below, the 2-core is empty before adding F. Adding F does not change the degree of A but it still adds A to the 2-core. It's easy to extend this to see how closing a loop of any size would cause all of the vertices to simultaneously join the 2-core. Adding a vertex can have an effect on the coreness of vertices an arbitrary distance away, but perhaps this is focusing too much on worst-case behavior. ![A -- B; A -- C; A -- D -- E; B -- F; C -- F;](https://lh5.ggpht.com/_fJRu319XW2Q/SjB1a5xBDLI/AAAAAAAAAJ8/f9zxhnavB3U/s800/kcorexample1.png)
incremental k-core algorithm
CC BY-SA 2.5
0
2009-06-04T02:39:51.770
2013-06-26T20:57:36.423
2017-02-08T14:12:28.390
-1
40,180
[ "algorithm", "language-agnostic", "graph-theory" ]
951,233
1
null
null
0
839
Good afternoon, we're having a semi-weird problem here with a legacy activex dll that needs to be used in a .net project and strangely it works perfectly fine (adding it as a reference and all its functionality) on one developer's machine, but on no other ones, the build-server complains about a faulty reference etc etc. Whenever e.g. I try to re-add the .dll, I get the following, kinda shy-on-details error-message: ![alt text](https://farm3.static.flickr.com/2446/3595584914_9b03562f08_o.png) Any ideas / suggestions why it might not work in e.g. my environment? The project file etc is a standard class library one for .net 3.5, and we all use the same files/code-base. Cheers & Thanks, -Jörg
Adding an ActiveX dll to a .Net project as reference works on one dev's machine, but not on another one?
CC BY-SA 2.5
null
2009-06-04T15:20:23.687
2009-10-12T13:00:01.403
2017-02-08T14:12:31.123
-1
2,591
[ ".net", "assemblies", "reference", "activex" ]
952,263
1
952,324
null
19
25,318
I'm trying to put some folders on my hard-drive into an array. For instance, vacation pictures. Let's say we have this structure: - - - - - - - - - - - - I want to have something like that, as an array. Meaning I have 1 big array and in that array are more arrays. Each set and subset gets its own array. I'm trying to make it look something like this: ``` Array ( [Set 1] => Array([0] => Item 1 of Set 1, [1] => Item 1 of Set 1,...) [Set 2] => Array([Subnet 1] => Array([0] => Item 1 of Subset 1 of Set 2,[1] => ...), [Subnet 2] => Array([0] => ..., ..., ...), ..., [0] => Random File) [set 3] => Array(...) ... ) ``` I came across this: [http://www.the-art-of-web.com/php/dirlist/](http://www.the-art-of-web.com/php/dirlist/) But that's not what I'm looking for. I've been meddling with it but it's giving me nothing but trouble. Here's an example, view source for larger resolution(no clicking apparently...). ![Example](https://i637.photobucket.com/albums/uu91/Vordreller/IMG_6038.jpg)
Deep recursive array of directory structure in PHP
CC BY-SA 2.5
0
2009-06-04T18:23:16.527
2022-10-18T12:05:54.623
2017-02-08T14:12:31.460
-1
80,907
[ "php", "arrays", "recursion" ]
952,607
1
952,623
null
27
62,427
Where am i doing wrong? This is the normal print preview: ![this is the first picture](https://content.screencast.com/users/uzay95/folders/Jing/media/94cfeaca-046d-4301-a2df-0fbf3941474f/2009-06-04_2219.png) But I want to see this picture (without dragging margin arrows) ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/66e4b8e3-ec71-4770-8070-69bc9998b17d/2009-06-04_2244.png) This is the css codes and preview: ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/0d7879fb-e216-461e-a404-a5eb59496495/2009-06-04_2305.png)
How to set margins 0 on print preview?
CC BY-SA 2.5
0
2009-06-04T19:24:28.123
2017-10-12T11:11:20.223
2017-02-08T14:12:32.473
-1
104,085
[ "css", "internet-explorer", "margins" ]
953,396
1
953,420
null
5
24,600
I need to display some HTML content as it will be printed. Basically, I want to emulate the browser print preview feature. I'm not sure how to do this just with HTML/CSS/JavaScript. The only solution I came up is to convert the HTML to PDF so it´s split into pages and then convert that PDF to images and print each image one bellow the other. It will be really helpfull if someone can point a more straight forward method. I'm not even sure if this is posibble. BTW, I'm using PHP in the backend, so if there is a PHP class for this it will be helpfull. The page size for diplaying it will be letter no matter what the user have configured This how it should look in the browser: ![alt text](https://imgur.com/ynoXq.jpg)
How to display a print preview of an HTML document
CC BY-SA 2.5
0
2009-06-04T22:12:30.780
2011-05-26T00:14:18.530
2009-06-04T22:22:42.850
25,578
25,578
[ "html", "browser", "printing", "preview" ]
953,602
1
953,689
null
1
908
I'm using TinyMCE textareas or textboxes for an event logger app, and I need the text to be formatted a certain way. Something like this: ![alt text](https://imgur.com/on27Z.jpg) I can't figure out how to do this without a table, which I cannot nest in the textarea or textbox. Any suggestions?
How do I get table-like formatting in a textbox or textarea?
CC BY-SA 2.5
0
2009-06-04T23:21:24.433
2009-06-05T00:35:16.420
null
null
856
[ "html", "formatting" ]
954,634
1
954,648
null
0
3,484
![alt text](https://i239.photobucket.com/albums/ff175/mlakilud/Graph.jpg) Hi guys, I am making some iPhone graph thingy. Here is my problem. I have one view controller and inside it two views graphView and segmented control view. I first draw graph view, than segmented control one. I want to have the functionality that when I click on some of the segmented control's buttons, I reload data and draw new graph. Right now I am doing that inside - (void)segmentAction:(id)sender just by adding another view like [self addSubview: aGraphView]. The problem is that this view is now covering segmented control like this ![alt text](https://i239.photobucket.com/albums/ff175/mlakilud/graph2.jpg) The question is how to not to lose segmented control in this process? :)
iPhone - views and segmented control
CC BY-SA 2.5
0
2009-06-05T07:20:11.903
2011-06-16T06:13:07.300
2017-02-08T14:12:33.483
-1
115,873
[ "iphone", "graph" ]
954,857
1
955,113
null
0
654
I was just wondering how to handle a lot of states using ASP .NET and postbacks. See this image: ![see the image](https://i.stack.imgur.com/OJy6h.jpg) I know someone can use: - `<input type="text" style="display:none"/>`- - This introduce a lot of overhead, variables, states, messing and confusing code. I would normally do it: - - - -
How to handle multpile ASP .NET events, states, and postbacks on the same page?
CC BY-SA 3.0
null
2009-06-05T08:40:07.797
2013-07-21T02:23:57.340
2013-07-21T02:23:57.340
2,556,654
113,934
[ "asp.net", "postback" ]
954,936
1
955,149
null
4
4,625
How do I get the "Copy to Output Directory" property for content files in a C++/CLI Windows Forms Project? ![alt text](https://sites.google.com/site/roughnotebook/Home/crop.png?attredirects=0) I am presently using the post-build event to copy my content files.
"Copy to Output Directory" in a C++/CLI Project
CC BY-SA 2.5
null
2009-06-05T09:04:48.933
2009-06-05T10:38:04.767
2017-02-08T14:12:33.833
-1
45,603
[ "visual-studio", "ide" ]
958,888
1
958,928
null
3
10,706
Whenever I add the min0height property to the DIVs to make them 100%, it doesn't work. I have added them to all of the DIVs, including height: 100%; and min-height: 100%; but nothing works. What would I do to make it extend all the way? It just cuts off the background of the sidebar and the background color of the content area. ![alt text](https://i.stack.imgur.com/HdZpR.jpg) (Forgot to label a part. The content area with the white background is .col1) ``` @charset "UTF-8"; /* CSS Document */ img { border-style: none; color: #FFF; text-align: center; } body { background-color:#000; margin:0; padding:0; border:0; /* This removes the border around the viewport in old versions of IE */ width:100%; } .sidebar { background-image:url(../images/sidebar/background.png); background-repeat:repeat-y; font: 12px Helvetica, Arial, Sans-Serif; color: #666; z-index:1; } .menu { background-image:url(../images/top_menu/background.png); background-repeat:repeat-x; height:25px; clear:both; float:left; width:100%; position:fixed; top:0px; z-index:5; background-color:#000; } .bottom_menu { background-image:url(../images/bottom_menu/background.png); background-repeat:repeat-x; height:20px; z-index:2; font: 12px Helvetica, Arial, Sans-Serif; clear:both; float:left; width:100%; position:fixed; bottom:0px; } .colmask { position:relative; /* This fixes the IE7 overflow hidden bug and stops the layout jumping out of place */ clear:both; float:left; width:100%; /* width of whole page */ overflow:hidden; /* This chops off any overhanging divs */ } .sidebar .colright { float:left; width:200%; position:relative; left:225px; background:#fff; } .sidebar .col1wrap { float:right; width:50%; position:relative; right:225px; } .sidebar .col1 { margin:30px 15px 0 225px; /* TOP / UNKNOWN / UNKNOWN / RIGHT */ position:relative; right:100%; overflow:hidden; } .sidebar .col2 { float:left; width:225px; position:fixed; top:0px; left:0px; margin-top:25px; margin-left:5px; right:225px; } .clear { clear: both; height: 1px; overflow: hidden; } ``` ``` <body> <div id="container"> <div class="menu">Header Content</div> <div class="colmask sidebar"> <div class="colright"> <div class="col1wrap"> <div class="col1" id="contentDIV"> Content </div> </div> <div class="col2"> Sidebar Content </div> </div> </div> <div class="bottom_menu">Footer Content</div> </div> </body> ```
CSS: min-height does not work
CC BY-SA 3.0
null
2009-06-06T02:57:19.693
2015-06-19T20:50:05.037
2015-06-19T20:50:05.037
1,159,643
118,342
[ "css", "height", "html" ]
959,024
1
959,027
null
48
26,042
Does anyone know what the keyboard shortcut to scroll a method's overloads that appears in the tooltip is? I presently have to resort to using the mouse to click the ^ and v labels in the tooltip, which isn't particularly effective. Thanks! ![alt text](https://i.stack.imgur.com/5DJvG.png)
Visual Studio keyboard shortcut to scroll method overloads tooltips?
CC BY-SA 3.0
0
2009-06-06T04:50:56.777
2022-04-06T14:56:31.773
2017-08-15T08:38:14.053
1,000,551
90,755
[ "visual-studio", "keyboard-shortcuts" ]
962,003
1
963,847
null
4
2,942
I'm trying to save data with following structure: ![alt text](https://i.stack.imgur.com/EyLMV.png) As you can see, there is HABTM association between and table. And another HABTM between and . I created following form: ``` <?php echo $form->create('Experience', array('action' => 'addClassic'));?> <?php echo $form->input('Experience.date', array('dateFormat' => 'DMY')); echo $form->input('Experience.time', array('timeFormat' => '24', 'empty' => array(-1 => '---'), 'default' => '-1')); echo $form->input('Experience.name'); echo $form->input('ExperiencesUser.1.note'); echo $form->input('ExperiencesUser.1.rating'); //echo $form->input('Tags.Tags', array('multiple' => 'multiple', 'options' => $tags)); //echo $form->input('ExperiencesUser.1.Tags', array('multiple' => 'multiple', 'options' => $tags)); //echo $form->input('ExperiencesUser.1.Tags.Tags', array('multiple' => 'multiple', 'options' => $tags)); echo $form->input('ExperiencesUser.1.confirmed', array('type' => 'hidden', 'value' => '1')); echo $form->input('ExperiencesUser.1.user_id', array('type' => 'hidden')); echo $form->input('ExperiencesUser.2.user_id', array('type' => 'hidden')); ?> <?php echo $form->end(__('Add', true));?> ``` And everything works well. method creates new Experience, assings this new experience to two users (via ) and sets the stuff around. What bothers me is that I want to assign some to newly created record (to the first one). I thought, that should be done via some of the commented stuff. Every line of this commented code creates form and sends data to , but it never gets saved. So my question is: What is the right syntax of or in my example to save data into ?
How do I write data to a HABTM association of a HABTM join table in CakePHP?
CC BY-SA 3.0
0
2009-06-07T14:45:11.463
2015-06-19T21:03:02.243
2015-06-19T21:03:02.243
1,159,643
69,535
[ "cakephp", "has-and-belongs-to-many" ]
962,545
1
962,551
null
87
107,700
So I think I'm going to get buried for asking such a trivial question but I'm a little confused about something. I have implemented quicksort in Java and C and I was doing some basic comparissons. The graph came out as two straight lines, with the C being 4ms faster than the Java counterpart over 100,000 random integers. ![Results](https://lh4.ggpht.com/_EW60jqE5_B0/SiwLQa3-rYI/AAAAAAAAAEA/o0-NsWLr1xc/s800/Quicksort.png) The code for my tests can be found here; [android-benchmarks](http://code.google.com/p/android-benchmarks/source/browse/#svn/trunk) I wasn't sure what an (n log n) line would look like but I didn't think it would be straight. I just wanted to check that this is the expected result and that I shouldn't try to find an error in my code. I stuck the formula into excel and for base 10 it seems to be a straight line with a kink at the start. Is this because the difference between log(n) and log(n+1) increases linearly? Thanks, Gav
O(N log N) Complexity - Similar to linear?
CC BY-SA 2.5
0
2009-06-07T18:59:16.417
2015-11-19T08:33:37.010
2017-02-08T14:12:38.240
-1
111,734
[ "language-agnostic", "complexity-theory", "quicksort" ]
963,279
1
963,408
null
0
7,827
The directory 'C:\temp' has two files named 'GZ96A7005.tif' and 'GZ96A7005001.tif'. They have different length with the same extension. Now I run below code: ``` string[] resultFileNames = Directory.GetFiles(@"C:\temp", "????????????.tif"); ``` The 'resultFileNames' return two items 'c:\temp\GZ96A7005.tif' and 'c:\temp\GZ96A7005001.tif'. But the Window Search will work fine. This is why and how do I get I want? ![alt text](https://zpyqvw.bay.livefilestore.com/y1plco_9EnbGdI97M2tObwSkOoVHgipbPP6ua25keeVkFAItA7XbERyK5IneTWK_QM9abXfWUryZ11HQv5q8Br8l9EGqoQdehN-/SearchResults.bmp)
C#: Using Directory.GetFiles to get files with fixed length
CC BY-SA 2.5
null
2009-06-08T02:47:00.387
2009-06-08T14:18:40.090
2017-02-08T14:12:39.253
-1
20,910
[ "c#", ".net", "windows", "filenames", "long-filenames" ]
968,303
1
968,409
null
0
117
I have an app I must write that will utilize a database for each company we are able to get as a client. Unfortunately, the schemas for all the companies databases's are not identical, even though for this app they all have the basic information I need (even if their column names are different/in a different table). My solution to handling the multiple databases is to create an IRepository interface like: ``` List<User> getUsers(); List<Account> getAccounts(); void UpdateAccount(Account account); ``` etc. I'll write a DAL class for each database which will implement this interface. This class will use the appropriate LINQ datacontext for it's own database: ![alt text](https://imgur.com/jRyBh.png) Here you can see the folders for Lowes, HomeDepot, and FrankLumber. Each one has a DAL class which implements IRepository. My question is, where should I handle the instantiation of the factory method so I can persist a new DAL class instance for each user who logs in, based on what "company" they belong to. So, if a lowes customer logs in it will call the RepositoryFactory passing it the user and return the appropriate DAL, which I can then call methods on polymorphically since I know they will implement the above methods. I'm new to ASP.NET MVC and MembershipProviders and could use some tips on how I should persist the instance of the DAL for each user after they log in.
How do I persist which database a user is associated with it using LINQ and ASP.NET MVC?
CC BY-SA 2.5
null
2009-06-09T05:32:07.683
2009-06-09T06:06:01.377
2009-06-09T06:03:38.197
64,878
64,878
[ "c#", "asp.net-mvc", "linq", "asp.net-membership", "membership" ]
970,918
1
971,608
null
1
3,080
I've done this with and asp.net grid view and header templates and I need to port this same concept over to my winform application. I'm trying to find a way to have a cell or label span the width of several sub-headers. There are third party controls that do this but buying one is not an option at this time. Here is an example of the web version I made:![alt text](https://farm4.static.flickr.com/3314/3611274726_5671718c92_o.png)
How to draw a custom DataGridView multi-column header
CC BY-SA 2.5
0
2009-06-09T15:49:51.200
2009-06-09T18:05:13.460
2017-02-08T14:12:41.660
-1
59,017
[ "c#", "winforms", "datagridview" ]