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
list
4,640,502
1
4,643,165
null
0
5,776
> [Cannot connect to UserPC\SQLExpress](https://stackoverflow.com/questions/4638222/cannot-connect-to-userpc-sqlexpress) I have been struggling to find a solution for this from long but in vain. I recently installed SQL Server Management Studio Express and tried to login with SQL authentication with 'sa' username. It was giving me error 233, so I enabled NamedPipes, Shared Memory and TCP IP from Configuration Manager. Now, I when I try to login, it shows an Error: > Login failed for the user ''. Erorr: 18456 Screenshot: ![http://i.stack.imgur.com/IUzox.jpg](https://i.stack.imgur.com/InfJC.jpg) I checked the server error logs and they were showing me > 2011-01-07 01:35:12.47 spid17s Error: 17054,
Login failed in SQL Server Express
CC BY-SA 2.5
null
2011-01-09T17:13:07.517
2011-01-10T02:11:23.920
2017-05-23T11:48:25.477
-1
458,790
[ "sql-server" ]
4,640,588
1
null
null
27
39,447
I am doing a lot of researching lately about how to get a different looking with nice effects `UITabBar` on my iPhone app, but unfortunately I am only finding things on how to replace background color etc. Well, I've checked out this app called [Momento](http://www.momentoapp.com/) which is pretty cool and presents a very slick tabBar: ![Momento's UITabBar](https://dzwonsemrish7.cloudfront.net/items/2E250E1m2e0T2A0V0H1B/Screen%20shot%202011-01-09%20at%2015.31.57.png) So there are a couple of elements here I would like to ask you guys if you could help me by giving me the right directions on how to get a similar effect :) - as you can see this app has this animated arrow that runs above the selected item with a very smooth animation.- is not that blue- default one neither the default state which displays in a different shade of brown and gray version.- with beveled vertical lines.- for the tabBar- for the tabBar At this point after some research I am able to set the height and background image by subclassing `UITabBarController` but I'm still not sure on how to accomplish the other items specially the first one related to the nice arrow effect. How do I do this? Please clarify what can or can't be done by subclassing the `UITabBarController` and specially if can be done in Interface Builder.
Really cool way to create custom UITabBar for iPhone app?
CC BY-SA 4.0
0
2011-01-09T17:30:41.343
2020-02-23T13:20:31.283
2020-02-23T13:20:31.283
1,033,581
165,750
[ "iphone", "ios", "customization", "uitabbar", "uitabbaritem" ]
4,640,605
1
4,640,710
null
1
5,914
I am trying to place data into text area that is inside hidden input but watin does not find it. When I search for inputs my program shows this: ![alt text](https://i.stack.imgur.com/tWcbG.jpg) ``` var ie = new WatiN.Core.IE("http://facebook.com", true); ie.ClearCookies(); ie.TextField(WatiN.Core.Find.ById("email")).TypeText(textBoxUsername.Text); ie.TextField(WatiN.Core.Find.ById("pass")).TypeText(textBoxPassword.Text); ie.Button(WatiN.Core.Find.ByValue("Login")).Click(); ie.Link(WatiN.Core.Find.ByText("Status")).Click(); ie.TextField(WatiN.Core.Find.ById("u362110_11")).TypeText(textBoxPassword.Text); ``` Exception ``` Could not find INPUT (hidden) or INPUT (password) or INPUT (text) or INPUT (textarea) or TEXTAREA element tag matching criteria: Attribute 'id' equals 'u493403_13' at http://www.facebook.com/home.php ```
Watin; Get element by id not working
CC BY-SA 3.0
null
2011-01-09T17:32:49.263
2013-01-08T14:44:56.930
2013-01-08T14:44:56.930
337,315
430,167
[ "c#", "watin" ]
4,640,650
1
6,382,419
null
1
3,989
I'm not really sure if ERD is the proper term, but occasionally I see diagrams created where the line in between two entities is labeled with text to describe the relationship. For example if I had `User`, `Item`, `ItemRating`, I may want to describe the line between `User` and `ItemRating` as "rates" and the line between `Item` and `ItemRating` as "is rated by". ![](https://i.stack.imgur.com/qICZX.png) I found I can make a text object in mysql workbench, and place it where I want, but I can't find a way to attach it to a line so that it moves with the line if I rearrange things. using mysql workbench 5.2.3
labeling relationship lines in mysql workbench erd
CC BY-SA 2.5
null
2011-01-09T17:40:42.003
2015-04-18T02:19:20.920
null
null
249,538
[ "entity-relationship", "mysql-workbench" ]
4,640,705
1
null
null
9
1,325
I'm trying understand how to interpret the output of, and use, the Lisp debugger. I've got a pretty simple Backtrace for the evaluation of my function, but I cann't seem to work out how to use it to find out in which Lisp 'form' in my function the exception occurred. I'd appreciate any clues as to what I should be doing, to find where in my code the error originated. Also - why does the second frame display as "no debug information available for frame"? I've attached a screen shot with the debugger, and repl (I've also included my function below - I know it's very wrong - but I'm just interested in learning to use the debugger properly). In addition, I hit 'v' on the first frame to go to the source, but this resulted in the error below the repl. (EDIT - the missing source code issue is fixed by downloading & copying it to the correct path) ![alt text](https://i.stack.imgur.com/PqKJv.png) (horrible function - no comments please!) ``` (defun myquicksort2 (lst) (if (eql 1 (length lst)) lst (let ((mid (middle lst))) (do ((i 0 (+ i 1))) ((>= i mid) (append (myquicksort2 (subseq lst 0 mid)) (myquicksort2 (subseq lst mid (length lst))))) (if (> (ltval i lst) (nth 100 lst)) (let ((tmp (ltval i lst))) (setf (nth i lst) (gtval i lst)) (setf (nth (- (- (length lst) i) 1) lst) tmp))))))) (defun ltval (i lst) (nth i lst)) (defun gtval (i lst) (nth (- (- (length lst) i) 1) lst)) (defun middle (lst) (round (/ (length lst) 2))) ```
Help using Lisp debugger
CC BY-SA 2.5
null
2011-01-09T17:49:01.783
2011-01-11T08:35:20.457
2011-01-11T08:35:20.457
60,956
60,956
[ "lisp", "common-lisp", "sbcl" ]
4,641,353
1
4,641,562
null
0
785
I'd like to render a map such as: ![alt text](https://i.stack.imgur.com/uIZTl.jpg) with different color, not just gradients, with a map that has 0...1 value of temperature, without using ranged values, this is, if t = 0...0.2 use red*t, if t > 0.2 and t < 0.4 use orange * t, etc. Any tip? EDIT: example code of "ranges": ``` else if (layerType == "temperature") { if (value <= 0.2) { r = Math.round(value * 200)+100; g = Math.round(value * 200)+100; b = Math.round(value * 250)+150; a = 1; } else if (value > 0.2 && value <= 1) { r = Math.round(value * 250); g = Math.round(value * 250); b = Math.round(value * 200); a = 1; } ```
Render temperature map without using range values
CC BY-SA 2.5
null
2011-01-09T19:48:02.323
2011-01-09T20:41:24.247
2011-01-09T20:12:39.380
162,414
162,414
[ "algorithm", "rendering" ]
4,642,010
1
4,642,192
null
1
931
I have a problem that seem unsolvable, due to HTML limitations. Here is a capture that may explain you the whole thing: ![imgage](https://i.stack.imgur.com/Yu9rD.png) ### # As you can see, I want a transparent part to move above the mouseovered menu item. But as I am thinking that, I find out that this won't work cause the menu item will loose the :hover stat as soon as the transparent part will arrive below the mouse. If where were with actionscript3, this would be easily done by setting the .mouseEnabled property on my transparent part, so that it isn't considered by the mouse. Do you know if something similar is possible with html? Do you have other solutions/track to follow, to success what I wanted to do? Thank you for your help!
Menu mouse over animation: having an highlight reflect displayed above the menu link
CC BY-SA 2.5
null
2011-01-09T21:40:12.260
2011-12-21T04:02:08.923
2011-12-21T04:02:08.923
3,043
337,286
[ "html", "css", "mouseover" ]
4,642,059
1
4,642,111
null
1
53
Can anybody tell me what is going on? ![alt text](https://i.stack.imgur.com/gaNV6.png)
What is going on in VS2010? I have some asian characters poping up!
CC BY-SA 2.5
null
2011-01-09T21:47:46.403
2011-01-10T09:06:37.197
null
null
103,682
[ "visual-studio-2010" ]
4,642,084
1
null
null
4
1,323
I am using the Flex ColumnChart with multiple ColumnSeries. I want to add space between the ColumnSeries bars/columns. What do I mean? If you look at the [Adobe LiveDocs for ColumnChart](http://livedocs.adobe.com/flex/3/html/help.html?content=charts_types_06.html), I have a chart similar to the 1st chart. I want to add margin/padding between the orange and green columns (not the months). ![alt text](https://i.stack.imgur.com/9ibv4.png) I've looked through the LiveDocs and I can't find anything on it.
How to add space between ColumnSeries in a Flex/Flash ColumnChart?
CC BY-SA 2.5
null
2011-01-09T21:52:16.197
2013-07-31T16:23:04.230
null
null
86,895
[ "flex3", "charts" ]
4,642,148
1
null
null
0
135
I am creating a form, with colorwheel, and text colour selection. Essentially, we have a logo that will load dynamically in the element ( div ) container. The colorwheel, will create the bg colour The radio buttons allow to select text colour. Any js gurus, know how to create the js to create the div, that changes bg colour and text colour of the preview div as per the image. ![alt text](https://i.stack.imgur.com/ZfUoD.png) Very basic example ( image paths changed ) but works. [http://www.jsfiddle.net/QZuA5/](http://www.jsfiddle.net/QZuA5/) Essentially its the preview div, I want to create. We can place logo dynamically using absolute positioning. So essentially its the js to create the div placeholder bg colour and font text colour, that will parse valuse when we submit the form. Cheers
update element , with selection choices
CC BY-SA 2.5
0
2011-01-09T22:06:47.780
2011-01-10T06:21:31.137
null
null
501,173
[ "javascript", "jquery", "css" ]
4,642,521
1
4,642,974
null
2
5,835
Download source code here: [http://www.eyeClaxton.com/download/delphi/ColorSwap.zip](http://www.eyeClaxton.com/download/delphi/ColorSwap.zip) Yes, I want to convert something "mostly blue" to something "mostly green". I would like to take a original bitmap (light blue) and change the colors (Pixel by Pixel) to the red, green, blue and gray equivalence relation. To get an idea of what I mean, I have include the source code and a screen shot. Any help would be greatly appreciated. If more information is needed, please feel free to ask. If you could take a look at the code below, I have three functions that I'm looking for help on. The functions "RGBToRed, RGBToGreen and RGBToRed" I can't seem to come up with the right formulas. ![alt text](https://i.stack.imgur.com/AJnGM.png) ``` unit MainUnit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TMainFrm = class(TForm) Panel1: TPanel; Label1: TLabel; Panel2: TPanel; Label2: TLabel; Button1: TButton; BeforeImage1: TImage; AfterImage1: TImage; RadioGroup1: TRadioGroup; procedure FormCreate(Sender: TObject); procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var MainFrm: TMainFrm; implementation {$R *.DFM} function RGBToGray(RGBColor: TColor): TColor; var Gray: Byte; begin Gray := Round( (0.90 * GetRValue(RGBColor)) + (0.88 * GetGValue(RGBColor)) + (0.33 * GetBValue(RGBColor))); Result := RGB(Gray, Gray, Gray); end; function RGBToRed(RGBColor: TColor): TColor; var Red: Byte; begin // Not sure of the algorithm for this color Result := RGB(Red, Red, Red); end; function RGBToGreen(RGBColor: TColor): TColor; var Green: Byte; begin // Not sure of the algorithm for this color Result := RGB(Green, Green, Green); end; function RGBToBlue(RGBColor: TColor): TColor; var Blue: Byte; begin // Not sure of the algorithm for this color Result := RGB(Blue, Blue, Blue); end; procedure TMainFrm.FormCreate(Sender: TObject); begin BeforeImage1.Picture.LoadFromFile('Images\RightCenter.bmp'); end; procedure TMainFrm.Button1Click(Sender: TObject); var Bitmap: TBitmap; I, X: Integer; Color: Integer; begin Bitmap := TBitmap.Create; try Bitmap.LoadFromFile('Images\RightCenter.bmp'); for X := 0 to Bitmap.Height do begin for I := 0 to Bitmap.Width do begin Color := ColorToRGB(Bitmap.Canvas.Pixels[I, X]); case Color of $00000000: ; // Skip any Color Here! else case RadioGroup1.ItemIndex of 0: Bitmap.Canvas.Pixels[I, X] := RGBToBlue(Color); 1: Bitmap.Canvas.Pixels[I, X] := RGBToRed(Color); 2: Bitmap.Canvas.Pixels[I, X] := RGBToGreen(Color); 3: Bitmap.Canvas.Pixels[I, X] := RGBToGray(Color); end; end; end; end; AfterImage1.Picture.Graphic := Bitmap; finally Bitmap.Free; end; end; end. ``` Okay, I apologize for not making it clearer. I'm trying to take a bitmap (blue in color) and swap the blue pixels with another color. Like the shots below. ![alt text](https://i.stack.imgur.com/0kIda.png) ![alt text](https://i.stack.imgur.com/DHEDF.png)
Programmatically swap colors from a loaded bitmap to Red, Green, Blue or Gray, pixel by pixel
CC BY-SA 2.5
0
2011-01-09T23:23:35.990
2019-07-30T10:51:23.743
2011-01-10T01:57:43.020
567,318
567,318
[ "delphi", "colors", "bitmap" ]
4,642,916
1
5,072,894
null
3
6,687
Can you please tell how can I configure Aptana, to autocomplete CSS after automatically adding the colon as well add a space (very inconvenient to manually enter each time). ![](https://i.stack.imgur.com/EvkK5.png) → ![](https://i.stack.imgur.com/CSkIL.png)
Aptana, CSS editor (configuration)
CC BY-SA 3.0
null
2011-01-10T01:06:55.410
2016-06-23T21:41:03.403
2011-11-14T20:24:03.373
219,883
183,431
[ "css", "configuration", "ide", "editor", "aptana" ]
4,643,350
1
null
null
1
2,410
Does anyone know how to change the placement of the legend in color2D.matplot (plotrix)? I have a12 x 12 correlation matrix. I noticed I had to reverse the row names and change the margin to get the long names to fit. But now I am stumped on how to move the legend (without increasing the margin even more and making the graph look odd with so much white space at the bottom. Thanks! ``` cors<-cor(train)cellcol<-color.scale(cbind(cors,c(-1,rep(1,11))),c(0,1),0,c(1,0))[,1:12] par(mar = c(10,8,4,2) + 0.1) color2D.matplot(cors,cellcolors=cellcol,show.legend=TRUE,show.values=2, axes=FALSE, xlab="",ylab="") axis(1,at=0.5:11.5,las=2,labels=colnames(cors)) axis(2,at=0.5:11.5,las=2,labels=rev(rownames(cors))) ``` ![alt text](https://i.stack.imgur.com/QBnA1.jpg)
color2D.matplot Legend in R
CC BY-SA 2.5
0
2011-01-10T03:00:39.453
2011-01-10T15:56:26.167
null
null
569,313
[ "r" ]
4,643,469
1
4,648,209
null
2
1,269
I'm using this one: [https://github.com/agarzola/jQueryAutocompletePlugin](https://github.com/agarzola/jQueryAutocompletePlugin) The only problem is that when you type the 1st character in the input field, it will display all term suggestions, including terms which don't contain this character. And only after you type the 2nd character it will behave normally, displaying tag suggestions containing only those 2 characters. I'm using this configuration: ``` $('input.autocomplete').autocomplete("localhost/boo/?get_suggestions=1", { width: 250, max: 100, matchContains: true, minChars: 1, selectFirst: true, cache: false, multiple: true, multipleSeparator: " " }); ``` Does anyone know a workaround for this? ![alt text](https://i.stack.imgur.com/Ayak4.jpg) Also when I type a random string, which I know it's not in the list, for eg. `*&@FGBHFHBOFUBF*UB#` it will display the entire list again :( The back-end: ``` if($_GET['get_suggestions']): $terms = get_all_terms(); foreach ($terms as $term) echo $term['title']."\n"; die(); endif; ```
jQuery - autocomplete plugin
CC BY-SA 2.5
null
2011-01-10T03:30:39.303
2011-01-10T15:08:49.810
2011-01-10T03:57:24.437
376,947
376,947
[ "javascript", "jquery", "autocomplete" ]
4,643,872
1
4,647,854
null
14
590
Suppose I have an application a search for all gas stations within 10 mile radius of a certain location. However one side of this location is surrounded by a mountain range that you have to drive 50 miles to get around. You would not want to return results from the other side of the mountain. What are some good algorithms/techniques to deal with such a problem? I know with point to point searches you can use path costs but I am not sure what the technique is with radius searches. Here is an example: ![alt text](https://i.stack.imgur.com/acMXp.gif) The red line is a chord on the radius circle from 40,-74 to 41,-72 lat long (not accurate just saying) The user at 40,-73 performs a geographic radius search for something which also encompasses areas across the LI sound in Connecticut which are impractical to get to. The algorithm should know that there exists a chord completely intersecting the search circle and not return results that are on the other side of that chord. So only points in the green area would get returned. This should be able to be done without any road network analysis if the programmer defines these bounding lines. For instance there may be an area in some country that is dangerous to pass through and you would want people on either side of that area to be restricted to that side. Or an international border etc. I am just asking this because I am pretty sure people are doing this.
Geographic obstructions in radius searches
CC BY-SA 2.5
0
2011-01-10T05:12:31.403
2011-01-24T13:44:06.787
2011-01-21T20:11:02.220
569,374
569,374
[ "mapping", "gis", "geospatial" ]
4,644,002
1
null
null
0
834
![alt text](https://i.stack.imgur.com/1l4or.png) ![alt text](https://i.stack.imgur.com/YIZpU.png) This (above) error occurs when I am trying to start my eclipse, on Fedora 12. my jdk and eclipse both are of 32 bit. And eclipse.ini as ````` -startup plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar --launcher.library plugins/org.eclipse.equinox.launcher.gtk.linux.x86_1.0.200.v20090520 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile -vmargs -Dosgi.requiredJavaVersion=1.5 -XX:MaxPermSize=256m -Xms40m -Xmx512m ```
Eclipse startup problem on Fedora 12
CC BY-SA 2.5
null
2011-01-10T05:42:54.010
2011-01-14T13:11:47.537
2011-01-10T07:18:03.770
550,966
550,966
[ "eclipse" ]
4,644,041
1
4,644,108
null
0
11,640
I am trying to locally install a CMS for my website. During this installation process, it shows me an error "User or role does not exist in the database. Screenshot of the error: ![alt text](https://i.stack.imgur.com/Intaa.jpg) Here's the screenshot of the database properties from Management Studio. ![alt text](https://i.stack.imgur.com/rHn0B.jpg) How can I add a new role or user to this database?
User or role does not exist in the database
CC BY-SA 2.5
null
2011-01-10T05:50:13.690
2011-01-10T20:26:15.020
null
null
458,790
[ "sql-server" ]
4,644,084
1
4,644,134
null
0
212
Hi guys i have this query ``` SELECT currency_code, SUM( CASE WHEN TYPE = 'cash_in' THEN amount END ) AS cash_in, SUM( CASE WHEN TYPE = 'cash_out' THEN amount END ) AS cash_out, SUM( CASE WHEN TYPE = 'cash_in' THEN amount ELSE - amount END ) AS balance FROM tb_cash_transaction LEFT JOIN tb_currency ON tb_currency.CURRENCY_ID = tb_cash_transaction.CURRENCY_ID WHERE TYPE IN ( 'cash_in', 'cash_out' ) GROUP BY currency_code ``` That will output this: ![alt text](https://i.stack.imgur.com/5tYbC.jpg) The problem is the query dont display another currency_code KRW which dont have data in tb_cash_transaction. Example in tb_currency ![alt text](https://i.stack.imgur.com/fgNyq.png) How to solve this?
Left join in complicated sql query
CC BY-SA 2.5
null
2011-01-10T05:57:37.987
2011-01-10T06:12:22.067
null
null
417,899
[ "mysql", "left-join" ]
4,644,201
1
null
null
1
1,093
How can I extract simple polygons out of a polygon which contains collinear edges? For the very simple case below, edge 2-3 and 6-0 are collinear. I want to separate this as 0, 1, 2 and 3, 4, 5, 6. I could compare collinearity of every edge against every other edge, but that is a slow O(n^2) approach. Is there a faster method? ![alt text](https://i.stack.imgur.com/kAM1q.png)
Extracting polygons from a polygon with collinear edges
CC BY-SA 2.5
null
2011-01-10T06:21:37.703
2011-12-08T15:07:02.767
null
null
256,405
[ "algorithm", "geometry", "polygon", "computational-geometry" ]
4,644,233
1
4,645,070
null
62
213,023
I am trying to give all the permissions to a user in the User Mapping section of a database. But, I am encountering this error: "Cannot use special principal dbo" ![alt text](https://i.stack.imgur.com/e5Svl.jpg) Server roles of the user: ![alt text](https://i.stack.imgur.com/kTGxS.jpg)
Cannot use special principal dbo: Error 15405
CC BY-SA 2.5
0
2011-01-10T06:27:46.823
2020-05-05T20:35:21.753
null
null
458,790
[ "sql-server" ]
4,644,306
1
null
null
2
1,220
![alt text](https://i.stack.imgur.com/952EI.png) Can some CSS guru help me getting this layout. What I have here is ``` <div class="movieList"> <div class="image" selected = true> <img class="poster" src="image1" selected = true/> </div> <div class="image"> <img class="poster" src="image1"/> </div> <div class="image"> <img class="poster" src="image2"/> </div> . . </div> ``` Thanks
Center aligning list of images
CC BY-SA 2.5
null
2011-01-10T06:40:35.727
2011-01-10T07:29:02.987
2011-01-10T06:49:44.433
336,767
336,767
[ "html", "css", "asp.net-mvc" ]
4,644,342
1
4,668,433
null
-1
1,991
![alt text](https://i.stack.imgur.com/BY5Z1.png)Hi, I am using iframes in flex 4 but it is shows always top.i am not able to show the tooltip.how to solve this? please look at the picture.Here i wnat to show the full tooltip of the button but it's hide half becouse of the iframe i need to solve this,how to do this?
Flex iframe shows always top
CC BY-SA 2.5
null
2011-01-10T06:47:08.330
2011-01-13T07:27:23.553
2011-01-11T11:22:14.873
128,124
128,124
[ "apache-flex", "flex3", "flex4" ]
4,644,542
1
4,644,699
null
0
960
I am integrating a Google Maps display using the JavaScript API, but I notice that it doesn't show the little icons for well known locations, like hotels, restaurants etc. What are these icons called (?), and is there an option to turn them on? I would like to have them on the display, because I want to offer users a way to put a marker on such a location if the Google geolocator doesn't give accurate enough results. ![Example of places](https://i.stack.imgur.com/SCaRM.png) Thanks
How to show places on an integrated Google Maps display (venues, accommodations, shops etc.)
CC BY-SA 2.5
null
2011-01-10T07:22:44.910
2011-01-12T09:07:07.187
2011-01-12T09:07:07.187
4,830
4,830
[ "google-maps" ]
4,644,556
1
null
null
0
101
![alt text](https://i.stack.imgur.com/aeyaK.png) ![alt text](https://i.stack.imgur.com/OzW5k.png)
increasing object allocations in instruments
CC BY-SA 2.5
null
2011-01-10T07:24:41.320
2011-04-30T23:32:40.293
null
null
318,403
[ "ios4", "ios-simulator" ]
4,644,620
1
4,645,133
null
1
433
I have generated an edm file that looks like the following: ![alt text](https://i.stack.imgur.com/LVy9Z.png) How do I convert this to a many to many edm? I'll be using POCO, so I want it to look something like: ``` public class User{ public List<Role> Roles {get; set;} /* Other prop here */ } public class Role{ public List<User> Users {get; set;} /* Other prop here */ } ``` Using EF4.
Generate many to many in entity framework
CC BY-SA 2.5
0
2011-01-10T07:37:59.300
2011-01-10T11:33:14.437
2011-01-10T09:08:35.383
321,946
400,861
[ "entity-framework", "entity-framework-4", "many-to-many", "poco" ]
4,644,640
1
4,648,896
null
0
662
I'm developing a facebook-based jquery theme but I'm having some trouble getting the calendar widget to look right in IE. ![http://i55.tinypic.com/1zzswi.png](https://i.stack.imgur.com/zebga.png) Here's the demo page: [http://ilsken.com/fbui/](http://ilsken.com/fbui/) In IE8 the calendar widgets dates all get squished to the left and just look plain wrong. The only part the CSS I can imagine causing this are here: ``` .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { background: #D8DFEA; color: #3B5998; font-size: 14px; border: 1px #D8DFEA solid; border-bottom: none; border-radius: 0px !important; font-weight: bold; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { background: #627AAD; border: 1px solid #627AAD; border-bottom: none; color: #fff; border-radius: 0px !important; } ```
Why does my jQuery theme make the calendar widget mess up in IE?
CC BY-SA 2.5
null
2011-01-10T07:40:11.083
2011-01-10T16:19:25.583
2011-01-10T13:34:47.747
148,766
148,766
[ "css", "internet-explorer", "jquery-ui" ]
4,645,016
1
4,645,043
null
0
518
I am learning to create pure CSS3 ribbons I have ``` .dialog h1 { position: relative; z-index: 10; } .dialog h1:before, .dialog h1:after { position: absolute; z-index: -10; } ``` but my CSS triangles (`.dialog h1:before/after`) are still shown in front of the `h1`. why is that? [http://jsfiddle.net/w9Hqd/2/](http://jsfiddle.net/w9Hqd/2/) ![](https://imgur.com/6NTtd.jpg)
Why is z-index not working even on a positioned element?
CC BY-SA 2.5
null
2011-01-10T08:51:37.620
2011-01-10T08:57:14.603
null
null
292,291
[ "css" ]
4,645,166
1
4,664,426
null
2
2,622
I'm working on the BLOG functionality in MVC. I need to be able to create 'blog comments'. So each comment may have a parent comment etc. Given table "Comments": CommentId -> int -> identity autoincrement PostId -> int ParentId -> int Comment -> string ![alt text](https://i.stack.imgur.com/nxi2T.png) Is there a way to get a list of comments for a given article ordered by CreateDate and ParentId? Or maybe there is a better table design you may suggest. What is the best design when inserting Post comments like this? I'm using Entity framework. thanks
LINQ parent child relation
CC BY-SA 2.5
0
2011-01-10T09:12:04.247
2012-10-31T11:53:46.210
2012-10-31T11:53:46.210
727,208
455,042
[ "asp.net-mvc", "linq", "entity-framework", ".net-3.5" ]
4,645,202
1
4,645,240
null
1
644
With CSS Mega Menus, there are many possibilities. But it also mean that I need to handle things like I want to style children `<ul>` as nav only if they are not in a div. I created a jsFiddle [http://jsfiddle.net/av5zr/](http://jsfiddle.net/av5zr/) demonstrating the problem The list in the 2nd menu should be a normal list. How can I style children ul's as lists only if they are not part of a div? 1 way might be to reset list styles with `.megaMenu-hor div ul` but I will need to duplicate "normal" list styles in 2 places, in the menu style and in the site's main style, which I prefer to keep separate ![](https://imgur.com/tXaMh.jpg)
CSS Mega Menus: How to target ul's except those in divs
CC BY-SA 2.5
null
2011-01-10T09:18:20.540
2011-01-10T10:00:13.760
null
null
292,291
[ "css" ]
4,645,229
1
4,646,638
null
1
2,492
Morning folks, I have a temporary table with 135,000 rows and 24 columns, of those rows I need to insert about 8,000 of them into an 8 column table. If run my insert the first time round (i.e. when my 8 column table is empty) it runs in about 6 seconds. When I run the same query again (this time round it shouldn't insert anything as the rows have already been inserted) it takes 30 minutes!! I've been unable to re-create this with a small simplified sample, but here's some sql for you to run anyway. It's running the last insert when the programme table has entries which causes the problems. Can anyone shed some light as to why this might be? ``` CREATE TEMPORARY TABLE TVTEMPTABLE ( PROGTITLE TEXT, YR YEAR, DIRECTOR TEXT, GENRE TEXT ); CREATE TABLE GENRE ( GENREID INT NOT NULL AUTO_INCREMENT, GENRE TEXT, PRIMARY KEY(GENREID) ) ENGINE=INNODB; CREATE TABLE PROGRAMME ( PROGRAMMEID INT NOT NULL AUTO_INCREMENT, GENREID INT NOT NULL, PROGTITLE TEXT, YR YEAR, DIRECTOR TEXT, PRIMARY KEY(PROGRAMMEID), INDEX (GENREID), FOREIGN KEY (GENREID) REFERENCES GENRE(GENREID) ) ENGINE=INNODB; INSERT INTO GENRE(GENRE) VALUES ('Consumer'),('Entertainment'),('Comedy'),('Film'),('Drama'),('Sport'), ('Sitcom'),('Travel'),('Documentary'),('Factual'); INSERT INTO TVTEMPTABLE(PROGTITLE, YR, DIRECTOR, GENRE) VALUES ('Breakfast','2011','n/a','Consumer'),('Breakfast','2011','n/a','Consumer'), ('Wanted Down Under','2011','n/a','Entertainment'),('Wanted Down Under','2011','n/a','Entertainment'), ('Lorraine','2011','n/a','Comedy'),('Lorraine','2011','n/a','Comedy'), ('Supernanny USA','2011','n/a','Film'),('Supernanny USA','2011','n/a','Film'), ('Three Coins in the Fountain','2011','n/a','Drama'),('Three Coins in the Fountain','2011','n/a','Drama'), ('The Wright Stuff','2011','n/a','Sport'),('The Wright Stuff','2011','n/a','Sport'), ('This Morning','2011','n/a','Sitcom'),('This Morning','2011','n/a','Sitcom'), ('Homes Under the Hammer','2011','n/a','Travel'),('Homes Under the Hammer','2011','n/a','Travel'), ('LazyTown','2011','n/a','Documentary'),('LazyTown','2011','n/a','Documentary'), ('Jeremy Kyle','2011','n/a','Factual'),('Jeremy Kyle','2011','n/a','Factual'); INSERT INTO PROGRAMME ( PROGTITLE, GENREID, YR, DIRECTOR) SELECT T.PROGTITLE, MAX(G.GENREID), MAX(T.YR), MAX(T.DIRECTOR) FROM TVTEMPTABLE T INNER JOIN GENRE G ON G.GENRE=T.GENRE LEFT JOIN PROGRAMME P ON P.PROGTITLE=T.PROGTITLE WHERE P.PROGTITLE IS NULL GROUP BY T.PROGTITLE; ``` Edit: Is this what you mean by index? ``` CREATE TEMPORARY TABLE TVTEMPTABLE ( PROGTITLE VARCHAR(50), YR YEAR, DIRECTOR TEXT, GENRE VARCHAR(50), INDEX(PROGTITLE,GENRE) ); CREATE TABLE PROGRAMME ( PROGRAMMEID INT NOT NULL AUTO_INCREMENT, GENREID INT NOT NULL, PROGTITLE VARCHAR(50), YR YEAR, DIRECTOR TEXT, PRIMARY KEY(PROGRAMMEID), INDEX (GENREID,PROGTITLE), FOREIGN KEY (GENREID) REFERENCES GENRE(GENREID) ) ENGINE=INNODB; ``` Edit 2: This is the result from the desc extended. After indexing (I may have done this wrong?). The insert still takes a long time ![alt text](https://i.stack.imgur.com/zfYOC.jpg)
Insert into table from temporary table takes a long time
CC BY-SA 2.5
null
2011-01-10T09:21:52.673
2011-01-10T12:08:55.123
2011-01-10T11:10:01.233
564,045
564,045
[ "sql", "mysql", "performance", "select", "insert" ]
4,645,329
1
4,645,616
null
0
3,891
I'm using CSS3PIE to apply some rounded corners to elements in Internet Explorer that will get them by stylesheet in other browsers. I've run into some issues with it though. In IE8, I discovered that any element that had the PIE behaviour would behave strangely. The container would jump a few pixels to the right, but the content would stay in its original position, giving the appearance that the content had all shifted left relative to its container. This would be especially problematic on elements with no or small amounts of padding. I was able to hack my way around the problem in IE8 by using X-UA-Compatible, but I'd rather avoid this solution if at all possible. I don't have access to IE9 for testing but my understanding hacks like PIE aren't necessary and it would be wasteful to force a compatibility mode in a browser that doesn't need it. I have worse issues in IE6, with the PIE layout breaking down completely on a list that is set up to use `display:inline; zoom:1;` list items (to simulate inline-block, which works in IE8 and the other browsers). Here the borders of the list items get rendered in completely the wrong place. So ideally, I'd like to have PIE work properly in IE6, and in IE8 without having to resort to compatibility mode. As far as IE6 goes, a graceful fallback where PIE is just not applied will do. IE7 is the only browser where the page displays as intended. I can't provide an example page just at the moment unfortunately, I can add one later though. Here are some screen grabs made with IE Tester. I'm hoping they will make things a little more clear for everybody. As you can see, IE7 is fine. However, in IE8, the containers are offset to the left relative to their content, and in IE6 the list elements (with the rounded 1 pixel border) are a complete mess! ![Internet Explorer 8 with offset boxes](https://i.stack.imgur.com/0aRbE.png) ![IE7 is correct](https://i.stack.imgur.com/MJR2o.png) ![IE6 is really mangled!](https://i.stack.imgur.com/nfvkg.png) Full size versions for [IE8](http://www.thiscanthappen.com/temp/so/ie8.png), [IE7](http://www.thiscanthappen.com/temp/so/ie7.png) and [IE6](http://www.thiscanthappen.com/temp/so/ie6.png) are also available Here's a link to a demo page. As other designers are working on the stylesheets and other parts of the design I can't promise it will remain fully reflective for very long, but hopefully it will for long enough to solve the problem. (Yes, I'm aware there's JS errors in IE6, those aren't my problem). [Example page](http://www.equanet.co.uk/cms/assets/example.html)
CSS3PIE issues in IE6 and 8
CC BY-SA 2.5
null
2011-01-10T09:34:25.183
2014-01-15T04:45:50.857
2014-01-15T04:45:50.857
881,229
477,127
[ "html", "css", "internet-explorer", "css3pie" ]
4,645,440
1
null
null
9
6,327
Is it possible to have vim's tab list presented vertically on the left side of the editor? ![alt text](https://i.stack.imgur.com/yJqp6.png) It'd be really helpful, but I haven't managed find any plugins that can do this yet. (do i suck at google?)
Vim: Is vertical tab list possible?
CC BY-SA 2.5
0
2011-01-10T09:48:23.447
2013-07-26T05:08:39.650
null
null
168,502
[ "vim", "plugins", "editor", "tabs", "vim-plugin" ]
4,645,447
1
4,645,996
null
1
968
I am creating an custom preference which contains an `EditText`. The problem is when user clicks the `EdiText` for input suggestion box opens up and `EditText` looses focus. When `EditText` is clicked again for input, no problem occurs until 'blank space' is entered, which results in suggestion box and hence loss of focus. What I mean by suggestion box is the box which pops up when entering text in `EditText` ![Suggestion Box on EditText](https://i.stack.imgur.com/9i782.png)
Custom Preference Including EditText
CC BY-SA 2.5
null
2011-01-10T09:49:40.143
2011-10-14T05:02:58.047
2011-10-14T05:02:58.047
157,882
447,238
[ "android", "input", "android-edittext", "autosuggest" ]
4,645,614
1
4,646,021
null
7
10,976
I am using a `ToolTip` control on my form, but have discovered that even though my cursor is on one control, the tooltip is showing somewhere else. I would like to show this within the control my cursor is on. ![alt text](https://i.stack.imgur.com/DzKSa.png) As shown in the image above, when my cursor is over `Textbox3`, the tooltip is showing on `Textbox4`. I would like for it to be displayed pointing at `Textbox3`. I'm currently using the following code to display the tooltip in 3 different events: ``` private void txtImmediateddest_Enter(object sender, EventArgs e) { ttpDetail.Show("Ex:111000025", txtImmediateddest); } private void txtImmediateddest_MouseHover(object sender, EventArgs e) { ttpDetail.Show("Ex:111000025", txtImmediateddest); } private void txtImmediateddest_MouseUp(object sender, MouseEventArgs e) { ttpDetail.Show("Ex:111000025", txtImmediateddest, e.Location); //toolTipimmeddest.Show("Required & Must be 9 Digits", txtImmediateddest); } ``` Edit ``` private void textBox1_MouseHover(object sender, EventArgs e) { ttpDetail.AutoPopDelay = 2000; ttpDetail.InitialDelay = 1000; ttpDetail.ReshowDelay = 500; ttpDetail.IsBalloon = true; //ttpDetail.SetToolTip(textBox1, "Ex:01(Should be Numeric)"); ttpDetail.Show("Ex : 01(Should Be Numeric)", textBox1,textBox1.Width, textBox1.Height/10,5000); } ``` This works fine but when the mouse initially on to the control it is displaying the normal if i had for second time it is displaying correctly Look at the following images ![alt text](https://i.stack.imgur.com/JdRxX.png) ![alt text](https://i.stack.imgur.com/ejNtP.png)
Why aren't balloon tips shown pointing at the correct control?
CC BY-SA 2.5
0
2011-01-10T10:12:51.273
2015-06-05T09:41:40.943
2011-01-11T08:46:02.373
388,388
388,388
[ "c#", ".net", "winforms", "textbox", "tooltip" ]
4,646,045
1
null
null
0
157
![alt text](https://i.stack.imgur.com/EHOmM.png) ![alt text](https://i.stack.imgur.com/65t4s.png) I need to know on my navigationItem i add back, title uiSegmentedController and itemAdd button's. Is it proper way to add that? If it is yes..... how to add sigmentedcontroller near to ItemAdd button
standard way of adding button
CC BY-SA 3.0
null
2011-01-10T10:55:53.743
2012-01-14T16:35:48.807
2012-01-14T16:35:48.807
344,570
465,800
[ "iphone" ]
4,646,047
1
4,646,698
null
0
3,215
For instance, why this script works on but not ? `display dialog "a lot of text just to break to line 4 whatever continuing... few more... argh... there!" with title "just a test" buttons {"Cancel", "Uninstall", "Continue"} default button 3 with icon caution` Commenting out everything after the just on Automator, this is the difference I get: ![alt text](https://i.stack.imgur.com/trFrT.png) I the and more than if possible, but those are not the only weird inconsistent behaviors I've seem in the past hour about applescript between and . The icon is another one. In the instance, the error I get for trying it in Automator is this: ![Syntax Error](https://i.stack.imgur.com/KWV7d.png) Recording, questions here are: 1. Why? Why oh Apple, why? 2. Any way to at least make the title work?
Why AppleScript display dialog behaves so differently between Editor and Automator?
CC BY-SA 2.5
0
2011-01-10T10:55:56.917
2011-01-10T12:22:28.137
null
null
274,502
[ "applescript", "automator" ]
4,646,063
1
4,648,412
null
1
1,582
So here's my image: ![raw](https://i.stack.imgur.com/jDk6A.png) The problem is, draw9patch can't create normal 9 patch from this (shows errors in padding). Neither does android scale it correctly if I create 9 patch manually, like so: ![manual 9 patch](https://i.stack.imgur.com/vrDUI.png) I believe that it's a color issue, that android sees the borders of my original image as a part of 9 patch paddings and thus, scales incorrectly. Is there a way, to create a 9 patch from this? Thanks in advance :) There must be NO extra empty border around original image, or it will persist and will have a white lines around it. There must be 1 extra pixel added to every side of the raw image to contain 9 patch paddings, so if the original width was 50px, it will be now 52 px. It's not the first time I'm making a nine patch< just this time it doesn't work. If you don't believe me, try and do it in draw9patch.bat and you'll see that it doesn't add extra border at the top and shows error even on the original image. Ok. NVM, just had to make raw image a bit wider. Now it scales right,
9 patch drawable
CC BY-SA 3.0
null
2011-01-10T10:58:22.743
2017-09-24T14:50:10.117
2017-09-24T14:50:10.117
1,033,581
495,663
[ "android" ]
4,646,147
1
4,646,304
null
39
22,979
In facebook, when you share a link, a neat little preview is created with an image headline, and text excerpt. Here's an example.. ![Example Link](https://i.stack.imgur.com/IZX89.png) Does anyone know if there's any open-source code (pref. php & javascript/jquery) that can generate something like this? Or should I just write it myself.. Cheers!
Is there open-source code for making 'link preview' text and icons, like in facebook?
CC BY-SA 2.5
0
2011-01-10T11:06:44.097
2013-01-17T08:07:36.833
null
null
228,109
[ "php", "jquery", "facebook", "javascript" ]
4,646,222
1
5,648,032
null
2
6,836
I have wrote a code that can read an excel 2007 file using Microsoft Data Access Engine the below code snippet works fine for most of the files but it happens to work for most of the excel files i.e. .xls but when it fails at objConn.Open(); for excel files that have excel formatting problems please refer to the image below ![Excel file with formatting errors](https://i.stack.imgur.com/jx2Ue.jpg) It would failed to open the ole Db Connection stating error . One more problem with this import procedure is that ``` OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM "+ SelectionSheet, objConn); ``` is not able to read sheets starting with spaces any help with solving this issue would be highly appreciated. ``` public DataTable ReadExcel(string Path, ArrayList IgnoreString, ArrayList IgnoreColumn) { DataTable dtReturn = new DataTable(); DataTable dtPrintable = new DataTable(); DataTable dtTemp = new DataTable(); try { string sConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" + "Data Source=" + Path + ";" + "Extended Properties=\"Excel 12.0 Xml;HDR=YES;IMEX=1;\""; OleDbConnection objConn = new OleDbConnection(sConnectionString); objConn.Open(); DataTable dtSheetnames = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null); DataTable dtTesting = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.DbInfoLiterals, new object[] {}); DataTable dtTesting2 = objConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables_Info, new object[] { }); string SelectionSheet = dtSheetnames.Rows[0][2].ToString(); if (SelectionSheet.Contains("'") ) { SelectionSheet = SelectionSheet.Remove(0, 1); SelectionSheet = "[" + SelectionSheet; SelectionSheet = SelectionSheet.Remove(SelectionSheet.Length - 1, 1); // -- Mod by zeemz on 23 dec // string PrintArea = SelectionSheet + "Print_Area]"; SelectionSheet = SelectionSheet + "]"; } else { SelectionSheet = "["+ SelectionSheet + "]"; } //OleDbCommandBuilder objCmdBuilder = new OleDbCommandBuilder( OleDbCommand objCmdSelect = new OleDbCommand("SELECT * FROM "+ SelectionSheet, objConn); OleDbDataAdapter objAdapter = new OleDbDataAdapter(); DataSet objDataSet = new DataSet(); DataSet PrintAreads = new DataSet(); objAdapter.SelectCommand = objCmdSelect; objAdapter.Fill(objDataSet); // -- Mod by zeemz on 23 dec //objCmdSelect.CommandText = "SELECT * FROM " + PrintArea; //objAdapter.Fill(PrintAreads); objConn.Close(); dtReturn = objDataSet.Tables[0].Copy(); // dtPrintable = PrintAreads.Tables[0].Copy(); // -- Mod by zeemz on 23 dec //if (dtPrintable.Columns.Count != dtReturn.Columns.Count) //{ // int TotalPrintable = dtPrintable.Columns.Count; // int TotalComing = dtReturn.Columns.Count; // int StartRemovingPos = TotalComing - TotalPrintable; // for (int i = TotalPrintable; dtPrintable.Columns.Count != dtReturn.Columns.Count; i++) // { // dtReturn.Columns.RemoveAt(i); // i = i - 1 ; // } //} int iCount = 0; while (iCount <= dtReturn.Rows.Count - 1) { if (isRowEmpty(dtReturn.Rows[iCount])) { dtReturn.Rows.RemoveAt(iCount); } else { iCount += 1; } } //now applying the filters //column ignore for (int i = IgnoreColumn.Count - 1; i >= 0; i--) { dtReturn.Columns.RemoveAt((int)IgnoreColumn[i]); } //string ignore for (int i = IgnoreString.Count - 1; i >= 0; i--) { for (int j = dtReturn.Rows.Count - 1; j >= 0; i--) { foreach (DataColumn dCol in dtReturn.Columns) { if (dtReturn.Rows[j][dCol.ColumnName].ToString().ToLower().Contains(IgnoreString[i].ToString().ToLower())) { dtReturn.Rows.RemoveAt(j); break; } } } } /* Hack to get rid of DateTime Columns */ // added by zeemz dtTemp = dtReturn.Clone(); dtTemp.Clear(); foreach (DataColumn tempColumn in dtTemp.Columns) { // if (tempColumn.DataType == typeof(DateTime)) // { tempColumn.DataType = typeof(String); // } } foreach (DataRow tempRow in dtReturn.Rows) { DataRow insRow = dtTemp.NewRow(); foreach (DataColumn tempColumn in dtReturn.Columns) { if (tempColumn.DataType == typeof(DateTime)) { if (!String.IsNullOrEmpty(tempRow[tempColumn.ColumnName.ToString()].ToString())) { insRow[tempColumn.ColumnName.ToString()] = Convert.ToDateTime(tempRow[tempColumn.ColumnName.ToString()].ToString()).ToString("yyyyMMddhhmmss"); } else { insRow[tempColumn.ColumnName.ToString()] = ""; } } else { insRow[tempColumn.ColumnName.ToString()] = tempRow[tempColumn.ColumnName.ToString()].ToString(); } } dtTemp.Rows.Add(insRow); } } catch (Exception ex) { throw ex; } return dtTemp; } ```
Microsoft OLEDB Error External table is not in the expected format
CC BY-SA 3.0
null
2011-01-10T11:15:18.073
2013-07-27T19:14:26.507
2013-07-27T19:14:26.507
1,065,525
6,351
[ "c#", ".net", "excel", "ms-office", "ole" ]
4,646,271
1
null
null
-2
591
can any body create a this type opf rating control using vb.net ajaxcontrol toolkit with mssql2005 and with retriction of one vote per person ... ? ![alt text](https://i.stack.imgur.com/tkIfA.gif) if 10 people voted for the service using rating star then the average would be displayed in rating control..
i want this type of rating feature in gridview using vb.net?
CC BY-SA 2.5
null
2011-01-10T11:22:29.397
2011-01-10T21:43:27.110
2011-01-10T11:30:32.567
522,211
522,211
[ "asp.net", "vb.net" ]
4,646,274
1
null
null
0
446
I am using jqgrid in one of my application. Right now i am facing a strange problem and do not know how to rectify it? Actually in one of the reports (having multiple link) jqgrid is showing wrong footer information that is its showing Page 0 of 0 even if there are records in the table. This is the code which runs: ``` if( isset($this->params['named']['ajax']) && $this->params['named']['ajax'] == '1' ) { $this->autoRender = false; // get how many rows we want to have into the grid - rowNum parameter in the grid $limit = $this->params['url']['rows']; // get index row - i.e. user click to sort. At first time sortname parameter - // after that the index from colModel $sidx = $this->params['url']['sidx']; // sorting order - at first time sortorder $sord = $this->params['url']['sord']; $page = $this->params['url']['page']; // if we not pass at first time index use the first column for the index or what you want if( !$sidx ) $sidx = 1; // calculate the number of rows for the query. We need this for paging the result $findconditions = array(); if(!empty($this->params['named']['batch'])) array_push(&$findconditions, array('Batch.id' => $this->params['named']['batch'] )); $row = $this->Placement->find('count',array( 'link' => array( 'Student' => array( 'Batch' ) ), 'conditions'=> $findconditions )); $count = $row; // calculate the total pages for the query if( $count > 0 ) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } // if for some reasons the requested page is greater than the total // set the requested page to total page if( $page > $total_pages ) $page = $total_pages; // calculate the starting position of the rows $start = $limit * $page - $limit; // if for some reasons start position is negative set it to 0 // typical case is that the user type 0 for the requested page if( $start < 0 ) $start = 0; // the actual query for the grid data $limit_range = $start . "," . $limit; $sort_range = $this->modelClass . '.' . $sidx . " " . $sord; $this->Placement->recursive = -1; $where=''; if( $this->params['url']['_search'] == 'true' ) { //pr($this->params); $searchconditions = array(); if( isset($this->params['named']['batch']) && !empty($this->params['named']['batch']) ) { $where.= " Batch.id =".$this->params['named']['batch']; } if( isset($this->params['url']['isstillworking']) && !empty($this->params['url']['isstillworking']) ) { $where.= " AND Placement.isstillworking ='".$this->params['url']['isstillworking']."'"; } if( isset($this->params['url']['studentname']) && !empty($this->params['url']['studentname']) ) { $where.=" AND Student.fullname LIKE '" .$this->params['url']['studentname'] . "%'"; } if( isset($this->params['url']['companyname']) && !empty($this->params['url']['companyname']) ) { $where.=" AND Company.name LIKE '" .$this->params['url']['companyname'] . "%'"; } if( isset($this->params['url']['salary']) && !empty($this->params['url']['salary']) ) { $where.= " AND Placement.salary =".$this->params['url']['salary']; } if( isset($this->params['url']['contactnumber1']) && !empty($this->params['url']['contactnumber1']) ) { $where.= " AND Student.contactnumber1 =".$this->params['url']['contactnumber1']; } if( isset($this->params['url']['batchname']) && !empty($this->params['url']['batchname']) ) { $where.=" AND Batch.name LIKE '" .$this->params['url']['batchname'] . "%'"; } $sql="SELECT Student.fullname, Placement.isstillworking, Company.id, Company.name, Placement.id, Placement.salary, Placement.created, Student.id, Student.contactnumber1, Batch.id, Batch.name FROM placements Placement INNER JOIN ( SELECT student_id, isstillworking, max( created ) AS other_col FROM placements GROUP BY student_id ) AS b ON Placement.student_id = b.student_id AND Placement.created = b.other_col INNER JOIN students Student ON ( Student.id = Placement.student_id ) INNER JOIN batches Batch ON ( Student.batch_id = Batch.id ) INNER JOIN companies Company ON ( Company.id = Placement.company_id ) WHERE ".$where. " AND Student.type='student' AND Student.trainingcompleted=1 ORDER BY ".$sort_range." LIMIT ".$limit_range ; $result=$this->Placement->query($sql); } else { $sql="SELECT Student.fullname, Placement.isstillworking, Company.id, Company.name, Placement.id, Placement.salary, Placement.created, Student.id, Student.contactnumber1, Batch.id, Batch.name FROM placements Placement INNER JOIN ( SELECT student_id, isstillworking, max( created ) AS other_col FROM placements GROUP BY student_id ) AS b ON Placement.student_id = b.student_id AND Placement.created = b.other_col INNER JOIN students Student ON ( Student.id = Placement.student_id ) INNER JOIN batches Batch ON ( Student.batch_id = Batch.id ) INNER JOIN companies Company ON ( Company.id = Placement.company_id ) WHERE Batch.id = ".$this->params['named']['batch']. " AND Student.type='student' AND Student.trainingcompleted=1 ORDER BY ".$sort_range." LIMIT ".$limit_range ; $result=$this->Placement->query($sql); } $i = 0; $response->page = $page; $response->total = $total_pages; $response->records = $count; //pr($result); foreach($result as $result) { $response->rows[$i]['id'] = $result['Placement']['id']; $student = "<a href='" . APP_URL . "placements/report18/studentid:" . $result['Student']['id']."'>" . $result['Student']['fullname'] . "</a>"; $company = "<a href='" . APP_URL . "companies/view/" . $result['Company']['id'] . "'>" . $result['Company']['name'] . "</a>"; $batch = "<a href='" . APP_URL . "batches/view/" . $result['Batch']['id'] . "'>" . $result['Batch']['name'] . "</a>"; $contactnumber1 =$result['Student']['contactnumber1']; $response->rows[$i]['cell'] = array($student, $result['Placement']['isstillworking'], $result['Company']['name'], $result['Placement']['salary'], $contactnumber1, $batch); $i++; } echo json_encode($response); } ``` I am also attaching the screen shot for reference. ![alt text](https://i.stack.imgur.com/snvdn.png) Please help me on this. Regards, Pankaj
How do i correct jqgrid footer information?
CC BY-SA 2.5
null
2011-01-10T11:22:53.333
2011-05-20T08:57:40.720
null
null
146,192
[ "cakephp", "jqgrid" ]
4,646,340
1
null
null
20
25,464
I’m trying to implement an order entry form using ASP.NET MVC but facing a lot of difficulties. All the samples that I found are related to viewing master detail forms, and none for adding or editing. Suppose I have two tables: Order and OrderLines that are related to each others with one-to-many relationship. In the main view I had a “New” button when clicked it should show a new order view composed of the order fields, a grid that shows the order lines, and a “Save” button that when clicked will persist the whole order along with its lines into a database. The grid should have three buttons: “Add Line”, “Edit Line”, and “Delete Line”. When the “Add Line” is clicked a new view should be shown that allows the user to add the line to the order view grid lines –at this stage the database is not affected-. When the user clicks “Edit Line” a view will be shown that allows the user to edit the selected line and when done update the order grid lines. The most difficult problems are: How to pass the order and its lines collection between the order view and the order line views? How to update the order view based on changes in the order line view? And how to persist changes between views without the database being involved? Is there a concrete example that shows how to implement this using MVC? ![Views](https://i.stack.imgur.com/7y9tq.png) Your help and feedback is appreciated.
ASP.NET MVC Master Detail Entry Form
CC BY-SA 2.5
0
2011-01-10T11:31:57.653
2020-08-29T05:33:06.700
2011-01-10T11:44:27.920
545,176
545,176
[ "asp.net-mvc", "forms", "master-detail", "data-entry" ]
4,646,745
1
4,647,170
null
0
604
I am absolutely totally news to Rails and to MongoDB. I have been following tutorials from a good book and create my first Rails app with a light Twitter copy. Everything went fine and smooth. But as part of my learning process I wanted to build the same app using MongoDB rather than the default SGBD. I therefore configured mongo and installed the mongo_mapper gem. Everything has been configured properly following this tutorial: [http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started](http://www.mongodb.org/display/DOCS/Rails+3+-+Getting+Started). Then I struggled a little bit to allow Rails generate to work without throwing me the --orm not specified error. In order to get past this I had to add the rails3-generators gem and add it to the Gemfile. Once all this was done, everything worked fine. I was able to successfully launch the Rails server. I added a User controller thanks to the generate. The page works fine and even lists the users I have previously added: ![alt text](https://i.stack.imgur.com/zXlFM.jpg) However all the other actions, showing, editing, deleting, etc. are not working (creating works, but then it goes to show and the errors comes): ![alt text](https://i.stack.imgur.com/n6GbK.jpg) It's virtually the same error for all different actions. The one difference I can notice right off the bat is that with the non MongoDB db, the id's of the user was starting at 1, etc. but here with MongoDB it looks like a randomly generated id that is much more complex and that is not of type int: 4d2ae91d4403baa84a000002 I am thinking that this may be creating the issues, since all action are using the id as a parameter... but I have no idea how to fix this. I have looked at the ruby generated code and it looks alright to me (extremely similar to the code generate for the default db). Any help would be greatly appreciated ! I don't know how to go forward with my project without solving a simple generate code with mongodb. Thanks, Alex ps: please that I did not write any of this code at all. everything has been generated, which is kinda why I expected to work from the get go... as asked here is the code for users_controllers: ``` class UsersController < ApplicationController # GET /users # GET /users.xml def index @users = User.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @users } end end # GET /users/1 # GET /users/1.xml def show @user = User.first(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @user } end end # GET /users/new # GET /users/new.xml def new @user = User.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @user } end end # GET /users/1/edit def edit @user = User.first(params[:id]) end # POST /users # POST /users.xml def create @user = User.new(params[:user]) respond_to do |format| if @user.save format.html { redirect_to(@user, :notice => 'User was successfully created.') } format.xml { render :xml => @user, :status => :created, :location => @user } else format.html { render :action => "new" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end # PUT /users/1 # PUT /users/1.xml def update @user = User.first(params[:id]) respond_to do |format| if @user.update(params[:user]) format.html { redirect_to(@user, :notice => 'User was successfully updated.') } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @user.errors, :status => :unprocessable_entity } end end end # DELETE /users/1 # DELETE /users/1.xml def destroy @user = User.first(params[:id]) @user.destroy respond_to do |format| format.html { redirect_to(users_url) } format.xml { head :ok } end end end ```
Rails code generated with ORM mangomapper throws NoMethodError (undefined method `each' for "4d2aeaea4403baa84a000005":String)
CC BY-SA 2.5
null
2011-01-10T12:19:37.513
2011-01-10T13:10:05.467
2011-01-10T12:34:55.307
523,811
523,811
[ "ruby-on-rails", "mongodb", "mongomapper", "mongodb-ruby" ]
4,647,454
1
4,647,597
null
3
5,057
I am making my own class diagram app in Swing/AWT but i stopped at this functionality: - ![alt text](https://i.stack.imgur.com/S7pSg.jpg) A general guideline or a sample code is highly appreciated
Drawing a line connecting two rectangles
CC BY-SA 2.5
0
2011-01-10T13:46:43.000
2022-07-18T15:33:50.790
null
null
1,525,050
[ "java", "swing", "graphics", "awt" ]
4,647,747
1
4,647,788
null
11
2,899
I'm adding a map next to a form on my web page. The idea is that people can sign up, and when they type in their address and click search, it place-marks their house, they must do this before they submit the form (geolocation has a large role on my site). Unfortunately, I have added the map, but within the map window the map itself appears to be offset. See the image below to illustrate what I mean: ![alt text](https://i.stack.imgur.com/0WuNK.png) I can only drag the map from within the "mapped" part of the box. If I select the grey area to drag the map around, it fails. Any ideas what could cause this? Here is my map-initialising Javascript, called on page load. ``` geocoder = new google.maps.Geocoder(); var latlng = new google.maps.LatLng(52.428385,-3.560257); var myOptions = { zoom: 7, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP } map = new google.maps.Map(document.getElementById("adminMap"), myOptions); ``` Here is my map CSS ``` #adminMap{ float:left; width:270px; height:370px; margin-left:20px; } ``` Here is my map HTML ``` <div id="adminMap"> </div> ```
Google Maps API - Strange Map "Offset" Behaviour
CC BY-SA 2.5
0
2011-01-10T14:22:54.090
2014-08-04T10:46:01.253
null
null
418,146
[ "javascript", "css", "google-maps-api-3" ]
4,647,724
1
null
null
0
270
I have modified a VBA array function given to me here: [Excel Generate Normalized Data](https://stackoverflow.com/questions/4633024/excel-generate-normalized-data) That question will explain what I am after. --- Download the excel I am using to completely understand: [http://www.mediafire.com/?smq5tl9poitdacc](http://www.mediafire.com/?smq5tl9poitdacc) --- I am using the following data (The left side are values I enter for the data to be based upon, the right side is the results of the generated data): ![alt text](https://i.stack.imgur.com/kY6Vm.png) As you can see, the % Diff is very good for Avg Click, but Click/Time is off when there is a high Day StdDev (Day +/-). The difference when there is a low Day Stddev is close to 0. I think this is because the var becomes inaccurate because the (Which is used indirectly to determine the running avg) is "guessed" at the start, and needs to be reassessed each click because the high StdDev adds randomness and the original "guess" becomes more and more inaccurate. I am not sure if this is the problem, or if it is how I can even solve it. I am just looking for advice on the best way to do what it is I want. I am not sure why the stdDev are so far off either, but thats not a big deal. I'd rather have a more accurate Click/Time than anything else- reguardless what the Day StdDev is. --- here is the function in my VBA: ``` Function ClickSpacer(Total_Days As Long, ClicksPerDay_Desired_Avg As Double, Clicks_Desired_Deviation As Double, Clicks_Min As Integer, Clicks_Max As Integer, TotalClicksOverTotalDays_Desired_Avg As Double, NoClickDays_Desired_Deviation As Double, NoClickDays_Min As Integer, NoClickDays_Max As Integer) Dim Day_Array() As Integer ReDim Day_Array(1 To Total_Days, 1 To 1) Dim NumDaysToGetClicks As Double Dim ClickOffset As Long Dim Clicks_Total As Long Dim Clicks_SoFar As Long Dim Clicks_Remaining As Long Dim NoClickDaysPerClick_Desired_Avg As Double ' Number of clicks that are needed to Achieved desired Avg of clicks over time Clicks_Total = Round(Total_Days * TotalClicksOverTotalDays_Desired_Avg, 0) ' Number of days in which the user has to click atleast once to achieve desired Avg. clicks per day NumDaysToGetClicks = Round(Clicks_Total / ClicksPerDay_Desired_Avg, 0) ' The number of non-click days in order fill out the total days NoClickDays_Total = Round(Total_Days - NumDaysToGetClicks, 0) ' The guessimated average of non-click days per click to fill out total non-click days ' This is never used, just used for comparsion of the running Avg NoClickDaysPerClick_Desired_Avg = NoClickDays_Total / NumDaysToGetClicks 'This variable is here to achieved closer results to the desired StdDev. 'a higher multiplyer will not limit the deviation but just give an average deviation 'For example, if the Average was 3 with a +/- 2, then with a StdDevMulti of 1 'ALL numbers will be 1 (3-2) through 5 (3+2) with an avg of 3 and stddev of 2, the numbers will NEVER exceed the StdDev. 'With a StdDevMulti of 2, the numbers will be 0 through 6, but should still have an 'Avg deviation of 2. StdDevMulti = 1 NoClickDays_Desired_Deviation = NoClickDays_Desired_Deviation * StdDevMulti Clicks_Desired_Deviation = Clicks_Desired_Deviation * StdDevMulti 'Set the obvious defaults ClickedDaysSoFar = 0 Clicks_SoFar = 0 NoClickDays_SoFar = 0 'Give the ClickOffset a starting value ClickOffset = NoClickDaysPerClick_Desired_Avg Do 'used to find the "running" average of days not clicked NoClickDays_Remaining = NoClickDays_Total - NoClickDays_SoFar 'used to find the "running" average of clicks per day Clicks_Remaining = (Clicks_Total - Clicks_SoFar) 'used in both "running" averages mentioned above and also will 'mark the end of the while loop. RemainingClickedDays = (NumDaysToGetClicks - ClickedDaysSoFar) ' Find what the average num. click should be based on the remaining ' and then apply the deviation. Only accept a click below its max ' above its min. Do ' Generate a random number between -1 and 1 SignChanger = Rnd() - Rnd() ' Apply the randomized StdDev Clicks_Deviation = Clicks_Desired_Deviation * SignChanger 'Figure out the "running" average ClicksPerDay_Running_Avg = Clicks_Remaining / RemainingClickedDays 'Figure out a click value and round to the nearest whole number Generated_Clicks = Round(ClicksPerDay_Running_Avg + Clicks_Deviation, 0) ' Make sure it meets the requirements, if not, try again Loop While Generated_Clicks < Clicks_Min Or Generated_Clicks > Clicks_Max ' Set the click value to the spaced-out array index Day_Array(ClickOffset, 1) = Generated_Clicks 'Find a random space based upon the "running" avg. and desired deviation 'Make sure it between the min and max required. Do ' Generate a random number between -1 and 1 SignChanger = Rnd() - Rnd() ' Apply the randomized StdDev NoClickDays_Deviation = NoClickDays_Desired_Deviation * SignChanger 'Figure out the "running" average NoClickDaysPerClick_Running_Avg = NoClickDays_Remaining / RemainingClickedDays 'Figure out a space value and round to the nearest whole number Generated_NoClickDays = Round(NoClickDaysPerClick_Running_Avg + NoClickDays_Deviation, 0) ' Make sure it meets the requirements, if not, try again Loop While Generated_NoClickDays < NoClickDays_Min Or Generated_NoClickDays >= NoClickDays_Max 'Define the array index based upon the spacing previously generated. ' Make sure to "add" upon the already known index. Add 1 because you 'have to account for the index the click occupies ClickOffset = ClickOffset + Generated_NoClickDays + 1 'These should be self-explaintory ClickedDaysSoFar = ClickedDaysSoFar + 1 Clicks_SoFar = Clicks_SoFar + Generated_Clicks NoClickDays_SoFar = NoClickDays_SoFar + Generated_NoClickDays Loop While ClickOffset < Total_Days And RemainingClickedDays > 0 'Set the array equal to the clicks so that it returns the array as 'we want. Ideally this will be just replace Total_Days fields under 'the base, so not to require a array-function. Neither of these work: 'ClickSpacer = Range("P1:P" & UBound(Day_Array) + 1).Value 'Range("P1:P" & UBound(Day_Array) + 1) = Application.Transpose(Day_Array) ClickSpacer = Day_Array End Function ```
VBA: Generating Data that mimics specific parameters (Avg, StdDev..etc)
CC BY-SA 2.5
null
2011-01-10T14:20:57.163
2014-05-05T17:14:01.377
2017-05-23T12:30:36.590
-1
130,204
[ "excel", "vba", "excel-2007" ]
4,647,791
1
4,650,195
null
4
11,278
I'm trying to use LibTiff in a C++ Program in Visual Studio 2010. I downloaded tiff-3.9.2.zip from [ftp://ftp.remotesensing.org/pub/libtiff](ftp://ftp.remotesensing.org/pub/libtiff). To test LibTiff it would be nice if someone could give me a step by step instruction how to import libtiff to visual Studio and build the Fax2Tiff tool. There are so many files so that I am totally confused. What I already have done: 1) Created a new Empty Win32 Console Application Project named "TiffTest" 2) Copied the folder "libtiff" from the tiff-3.9.2.zip to the Project Folder 3) Copied the file "fax2tiff.c" to the Project Folder 4) Added those files to the Project ![alt text](https://i.stack.imgur.com/NfNX9.png)![alt text](https://i.stack.imgur.com/K8PMq.png) 5) Added the "libtiff" folter to the additional include folders 6) Renamed the files "tif_config.vc.h" and "tiffconf.vc.h" to "tif_config.h" and "tiffconf.h" 7) Tried to compile it. This does not really work. All I do to get rid of the error messages causes new error messages. Can anyone tell me how I can get libtiff to work? I really need help... Thank you so much!
Using LibTiff in Visual Studio 2010
CC BY-SA 2.5
0
2011-01-10T14:27:05.437
2011-01-10T18:41:06.553
2011-01-10T14:49:40.667
461,872
461,872
[ "c++", "visual-studio-2010", "libtiff" ]
4,648,033
1
4,655,958
null
0
1,351
I have a header where I have the text: "Huidige Locatie" and beneath that I have an image of a country flag. I declared the TextView and ImageView in the layout as follows: ``` <LinearLayout android:id="@+id/locatiebalk" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="5sp" android:orientation="horizontal"> <LinearLayout android:id="@+id/vlaggenlocatie" android:layout_width="105sp" android:layout_height="fill_parent" android:paddingLeft="14sp" android:orientation="vertical"> <TextView android:id="@+id/huidiglocatie" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Huidige locatie" android:textColor="#000000" android:textSize="12sp"/> <ImageView android:id="@+id/flag" android:layout_width="fill_parent" android:layout_height="46sp" android:gravity="left" android:src="@drawable/nl"/> </LinearLayout> ``` (I close the tags correctly later on, just showing the relevant part) In the Graphical Layout of Eclipse it shows it the right way: ![alt text](https://i.stack.imgur.com/31mJ1.png) But in the Simulator and on my phone it showes it like this: ![alt text](https://i.stack.imgur.com/IUx4Q.png) What is the best way to do this?
Align dynamic Image and Text in Android
CC BY-SA 2.5
null
2011-01-10T14:49:37.347
2011-01-11T09:17:19.120
null
null
517,460
[ "android", "layout", "alignment" ]
4,648,098
1
4,715,416
null
1
325
I'm drawing a graph like behind using core-plot. I wanted to put de Y axe out of the "plotAreaFrame", like that I'll be able to see it all the time, even when I'm scrolling on the X axe. If it's not possible could you give me a clue to make the Y Axe always visible. ![alt text](https://i.stack.imgur.com/0XnUX.png) Edit: May I do this by drawing an other chart an displaying only the axes of the second graph and no datas on it?
Y axe always visible
CC BY-SA 3.0
null
2011-01-10T14:57:12.323
2016-11-10T08:49:36.527
2016-11-10T08:49:36.527
155,005
475,772
[ "iphone", "core-plot" ]
4,648,255
1
4,648,331
null
0
151
I'm using jQuery AJAX to grab some data from a PHP page and using a loading GIF image in the placeholder to let the user know the results are on the way. ``` $(".project").change(function(){ $(".custName").html("<img src='/admin/images/ajax-loader.gif' />"); $(".projectDesc").html("<img src='/admin/images/ajax-loader.gif' />"); var project_num=$(this).val(); var dataString = 'project='+ project_num; $.ajax ({ type: "POST", url: "customerfilter.php", dataType: "json", data: dataString, cache: false, success: function(data) { $(".custName").html(data.message1); $(".projectDesc").html(data.message2); } }); }); ``` When i click the trigger and open up Firebug console i can see the POST go and come back and the data is correct. However the loading gif never goes away and never gets replaced by the correct data - no idea why!? This is a screenshot of Firebug and the RESPONSE window: ![alt text](https://i.stack.imgur.com/cpd2g.jpg) Relative PHP: ``` while ($row = mysql_fetch_array($result)) { echo json_encode(array( "message1" => $row['cust_name'], "message2" => $row['description'], )); ``` $result is a mysql_query
Strange jQuery AJAX problem
CC BY-SA 2.5
null
2011-01-10T15:14:14.167
2011-01-10T15:23:45.467
2011-01-10T15:20:15.620
478,144
478,144
[ "php", "jquery", "ajax", "post", "preloader" ]
4,648,494
1
4,648,573
null
2
2,138
How do I obtain the metadata for a png or jpg image? I have a few thousand images that get processed by a perl script. One of the things that I need to be able to get from each image is the metadata for them. The most important information is the date listed in bold. I would like to have a script I can run that will grab the date info from each of the pictures that I process. It would be ideal if it is in perl, but php would work too. this is running on a Linux system. Any help would be appreciated. Thank you Here is an example of one of the images: ![alt text](https://i.stack.imgur.com/6IOY1.png) Here is the metadata for this image: 849×571 pixels – 825KB Filename: EA_A02_N_1-4_5mM_Xgal_7d_B.cropped.resized.grey.png Camera: Canon Model: Canon EOS DIGITAL REBEL XSi ISO: 200 Exposure: 1/50 sec Aperture: 2.8 Focal Length: 60mm
How to obtain picture metadata using perl, php
CC BY-SA 2.5
0
2011-01-10T15:40:18.857
2011-01-10T16:04:40.087
null
null
241,314
[ "php", "linux", "perl", "image-processing", "metadata" ]
4,648,724
1
4,653,419
null
1
2,009
I'm looking to implement a facebook style messaging system (thread messages) into a site of mine. Do you think this schema markup looks okay? ![alt text](https://i.stack.imgur.com/zNWeJ.jpg) Doctrine schema.yml: ``` UserMessage: tableName: user_message actAs: [Timestampable] columns: id: { type: integer(10), primary: true, autoincrement: true } sender_id : { type: integer(10), notnull: true } sender_read: { type: boolean, default: 1 } subject: { type: string(255), notnull: true } message: { type: string(1000), notnull: true } hash: { type: string(32), notnull: true } relations: UserMessageRecipient as Recipient: type: many local: id foreign: message_id UserMessageReply as Reply: type: many local: id foreign: message_id UserMessageReply: tableName: user_message_reply columns: id: { type: integer(10), primary: true, autoincrement: true } user_message_id as message_id: { type: integer(10), notnull: true } message: { type: string(1000), notnull: true } sender_id: { type: integer(10), notnull: true } relations: UserMessage as Message: local: message_id foreign: id type: one UserMessageRecipient: tableName: user_message_recipient actAs: [Timestampable] columns: id: { type: integer(10), primary: true, autoincrement: true } user_message_id as message_id: { type: integer(10), notnull: true } recipient_id: { type: integer(10), notnull: true } recipient_read: { type: boolean, default: 0 } ``` When I a new reply is made,i'll make sure the boolean for "recipient_read" for each recipient is set to false and of course i'll make sure sender_read is set to false too. I'm using a hash for the URL: [http://example.com/user/messages/aadeb18f8bdaea49882ec4d2a8a3c062](http://example.com/user/messages/aadeb18f8bdaea49882ec4d2a8a3c062) (As the id will be starting from 1, i don't wish to have [http://example.com/user/messages/1](http://example.com/user/messages/1). Yeah, I could start incrementing from a bigger number, but i'd prefer to start at 1.) Is this a good way to go about it? Your thoughts and suggestions would be hugely appreciated. Thanks guys!
Facebook style messaging system schema design
CC BY-SA 2.5
0
2011-01-10T16:02:19.737
2012-02-29T20:21:32.133
2011-01-11T01:26:57.170
212,159
212,159
[ "mysql", "database-design", "symfony1", "doctrine" ]
4,649,264
1
4,649,685
null
1
2,485
I have the following list of fonts: ![Font list](https://i.stack.imgur.com/4py2Z.jpg) I have no issues with using them via ``` new Font("XXXX Sans", 21, FontStyle.Bold, GraphicsUnit.Pixel) ``` However, what do i do when i need to use a non-standard font style like light? All that is provided is an enumeration and that is not suitable.
Custom font styles with graphics
CC BY-SA 3.0
null
2011-01-10T16:56:39.710
2013-03-19T04:19:51.727
2013-03-19T04:19:51.727
41,956
468,214
[ "c#", ".net", "windows", "fonts", "gdi+" ]
4,649,294
1
null
null
0
212
![alt text](https://i.stack.imgur.com/xvRDu.png) i would like to know if it is possible to have a letter that is made up of multiple colors. for example above you will see a hebrew letter. the DOT underneath it is actually part of the letter, but it is a different color. is it possible to have this same functionality in flash? what i would need to do is upload an XML file with all the words, and i would need all the dots below the letters to be a different color. the letter came from this site: [http://www.oryanit.com/site/2.1.asp?user=oryanit&site=56](http://www.oryanit.com/site/2.1.asp?user=oryanit&site=56)
half the letter is one color and half another color
CC BY-SA 2.5
null
2011-01-10T16:58:58.353
2011-01-10T17:56:03.227
2011-01-10T17:04:54.740
458,368
518,201
[ "flash" ]
4,649,330
1
4,650,571
null
9
651
I'm trying to make a bunch of buttons behave somewhat like float:left in CSS. So whenever the view changes size, on orientation change for example, the buttons should adjust so they fit within their container view. In landscape mode, this UIScrollView should scroll horizontally, in portrait mode, it should scroll vertically. I'm trying to make an ScrollView similar to the "Featured" tab in the iPad YouTube app. Landscape has 4 columns, portrait: 3 columns, "Subscriptions" tab, portrait, the same view has 2 columns. ![alt text](https://i.stack.imgur.com/KclsB.png)
float:left in objective-c
CC BY-SA 2.5
0
2011-01-10T17:02:07.180
2011-01-10T23:25:36.960
null
null
147,163
[ "objective-c", "cocoa-touch", "interface-builder", "ipad" ]
4,649,376
1
4,649,415
null
0
1,267
I have the following problem: A program displays a picture using a `PictureBox`. The picture contains two rectangles A and B that are drawn after the image is loaded. ![Illustration](https://i.stack.imgur.com/Tp1Vr.png) The image inside the picture box is zoomed and the rectangles A and B are painted using the `Graphics` object of the loaded image. Is there a simple method to determinate if a user clicked the area inside these rectangles e.g. converting screen coordinates to picture coordinates.
Convert screen coordinates to picture coordinates
CC BY-SA 2.5
null
2011-01-10T17:07:25.960
2011-01-13T12:12:15.943
2011-01-13T12:12:15.943
11,387
11,387
[ "c#", "winforms", "graphics", "windows-mobile", "coordinates" ]
4,649,491
1
null
null
0
867
I hope to create an entry form that provides multiple entry fields like it appears in microsoft excel where the column headers are up there and several rows below for data input. i know textboxes have to be placed one at a time and only accept one input per text box and that would take awfully long to just create a form with probably just 10 rows and 10 columns. how do i go about this.?is there any tool from the toolbox that can help design this form? Id also like to pass entries from the form into the database all in one shot so id appreciate it if the control supports that too... this is a picture of what id like the form to look like... ![alt text](https://i.stack.imgur.com/NoUOJ.jpg) Please help out.
creating forms with multiple entry fields
CC BY-SA 2.5
null
2011-01-10T17:18:17.230
2011-01-11T09:35:03.273
2011-01-11T09:35:03.273
569,285
569,285
[ "wpf", "forms", "c#-4.0", "webforms", "data-entry" ]
4,649,526
1
4,681,208
null
0
549
I have an application that keeps rent periods of a parking lot. I have a SQL database with this information: ``` idLot dateFrom dateTo ------------------------------------------ 1 01/03/2011 30/07/2011 2 01/01/2011 30/05/2011 3 01/02/2011 30/07/2011 6 01/02/2011 30/06/2011 ``` And I need to display the information like the image below. ![alt text](https://i.stack.imgur.com/eDIw2.gif)1 I cannot achive the goal with Excel or Crystal Reports. I also use ComponentOne FlexGrid. Any ideas? Thanks in advance.
Displaying a timeline in crystal reports or excel
CC BY-SA 2.5
null
2011-01-10T17:22:16.907
2011-01-13T14:37:11.277
2011-01-13T14:10:37.030
124,367
309,466
[ "sql-server-2005", "excel", "crystal-reports" ]
4,649,597
1
null
null
0
1,131
is it possible to format a textview for a widget so that it looks like the text below the apps. like in this screenshot: ![alt text](https://i.stack.imgur.com/94DYd.png) i am looking for the exact textcolor, the exact dropshadow and the rounded background.
android: format textview
CC BY-SA 2.5
null
2011-01-10T17:32:09.197
2011-01-10T18:22:59.357
null
null
97,688
[ "android", "textview" ]
4,649,651
1
null
null
1
711
I would like to make graph like this in Python: ![alt text](https://i.stack.imgur.com/PB5u9.png) I have made the program in C that will give me combinations I need (here N=2n+|m| iirc), so could I integrate that here somehow? I made something in Mathematica, but that's a pain in the butt... Any help is appreciated.
How to draw a 2D graph in Python - horizontal bars
CC BY-SA 2.5
0
2011-01-10T17:37:25.403
2011-05-26T20:47:58.780
null
null
560,366
[ "python", "graph" ]
4,650,076
1
null
null
0
121
Please,can anyone help me for this problem: I have built the code in the way that each time I press one of the radio buttons on of the 5 tables I have must be visible in the window while the other 4 are invisible. The only problem I have is to make the content of this table which has 2 colomns,,,Emer and Nota in the center of the second panel,,,because I have separated the window in 3 panels, The first panel contains the radio buttons which are ok:) The second panel contains the 5 tables,,,1 for each radioButton,,,I only need that when I press one of the buttons the selected table to show on the CENTER of the second panel. The third panel contains only one button,but it's fine;) Plz help me. If you need the code tell me to write it here and I would like to put a print screen on it,so you can understand better...I hope so. ![alt text](https://i.stack.imgur.com/GEMh2.png)
How to set the tables in the CENTER of the window
CC BY-SA 2.5
null
2011-01-10T18:26:35.753
2011-09-08T08:12:39.973
2011-09-08T08:12:39.973
714,968
569,057
[ "java", "swing", "layout-manager" ]
4,650,177
1
null
null
8
6,013
What are the meanings of the icons displayed in the Netbeans IDE navigator? Is there a legend posted somewhere online? I did google before asking, thank you. Here's a screenshot: ![Screenshot](https://i.stack.imgur.com/7HtfO.png)
Meaning of netbeans ide navigator icons?
CC BY-SA 3.0
0
2011-01-10T18:38:27.790
2014-02-18T22:39:16.510
2011-06-06T15:11:05.527
160,665
559,577
[ "netbeans", "netbeans-6.9" ]
4,650,421
1
4,650,641
null
2
1,275
Download the source code with compiled executable here (Size: 161 KB (165,230 bytes)): [http://www.eyeClaxton.com/download/delphi/ColorSwap.zip](http://www.eyeClaxton.com/download/delphi/ColorSwap.zip) Original bitmap size is just 28x15 pixels, and the color is light blue. I would like to be able to click on any of the colored panels to the right and change the original bitmap color from light blue to the color of the panel. If you click on the gray panel you can see this in action, I just can't figure out how to do this correctly with the other colors. Any help would be greatly appreciated. If more information is needed, please feel free to ask. I have [asked this question before](https://stackoverflow.com/questions/4642521) but I was unable to make clear what I was trying to do, so I hope this one is a little bit more clear. ![alt text](https://i.stack.imgur.com/WWoPD.png) ``` unit MainUnit; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, ExtCtrls, StdCtrls; type TMainFrm = class(TForm) Panel1: TPanel; Label1: TLabel; Panel2: TPanel; Label2: TLabel; BeforeImage1: TImage; AfterImage1: TImage; Panel3: TPanel; Panel4: TPanel; Panel5: TPanel; Panel6: TPanel; Panel7: TPanel; Panel8: TPanel; Panel9: TPanel; Image1: TImage; Label3: TLabel; Panel10: TPanel; Memo1: TMemo; Label4: TLabel; procedure FormCreate(Sender: TObject); procedure Panel4Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var MainFrm: TMainFrm; implementation uses Math; {$R *.DFM} function Min(const A, B, C: Integer): Integer; begin Result := Math.Min(A, Math.Min(B, C)); end; function Max(const A, B, C: Integer): Integer; begin Result := Math.Max(A, Math.Max(B, C)); end; function RGBToGray(theRed, theGreen, theBlue: Byte): Byte; begin Result := (Max(theRed, theGreen, theBlue) + Min(theRed, theGreen, theBlue)) div 2; end; function BlueToGray(theColor: TColor): TColor; var R, G, B, X: Byte; begin R := (theColor and $FF); G := (theColor and $FF00) shr 8; B := (theColor and $FF0000) shr 16; X := RGBToGray(R, G, B); Result := TColor(RGB(X, X, X)); end; procedure TMainFrm.FormCreate(Sender: TObject); begin Image1.Picture.Graphic := BeforeImage1.Picture.Bitmap; end; procedure TMainFrm.Panel4Click(Sender: TObject); var Bitmap: TBitmap; I, X: Integer; Color: Integer; begin Bitmap := TBitmap.Create; try Bitmap.Assign(BeforeImage1.Picture.Bitmap); Panel4.Caption := ''; Panel5.Caption := ''; Panel6.Caption := ''; Panel7.Caption := ''; Panel8.Caption := ''; Panel9.Caption := ''; (Sender as TPanel).Caption := 'X'; for X := 0 to (Bitmap.Height - 1) do begin for I := 0 to (Bitmap.Width - 1) do begin Color := Bitmap.Canvas.Pixels[I, X]; case (Sender as TPanel).Tag of 1: ; // I need a function something like BlueToRed(Color); 2: ; // I need a function something like BlueToGreen(Color); 3: ; // I need a function something like BlueToYellow(Color); 4: ; // I need a function something like BlueToFuchsia(Color); 5: ; // I need a function something like BlueToCyan(Color); 6: Bitmap.Canvas.Pixels[I, X] := BlueToGray(Color); end; Image1.Picture.Graphic := Bitmap; end; Application.ProcessMessages(); Sleep(100); end; AfterImage1.Picture.Graphic := Bitmap; finally Bitmap.Free; end; end; end. ```
Programmatically swap colors from a small bitmap (original), pixel by pixel
CC BY-SA 2.5
0
2011-01-10T19:03:47.830
2011-01-10T19:35:55.227
2017-05-23T12:01:09.563
-1
567,318
[ "delphi", "colors", "bitmap" ]
4,650,626
1
5,716,200
null
11
6,028
Recently I came across a .NET color chart based on their hue and brightness value. What stroke me is the crazy grayscale chart. For example, DarkGray is actually lighter then Gray ? Also, I can't see any logic in the gradation of rgb values, it goes from 0 to 105 to 128 ? ``` 0 : Black 105 : DimGray 128 : Gray 169 : DarkGray! 192 : Silver 211 : LightGray 220 : Gainsboro 245 : Ghostwhite 255 : White ``` [http://sites.google.com/site/cdeveloperresources/](http://sites.google.com/site/cdeveloperresources/) ![color chart - see link above](https://i.stack.imgur.com/WK3w9.png) What I want is a GrayScaleBrushes class which behaves exactly like the Brushes class, but with my custom scheme, like : ``` GrayScaleBrushes.Pct05 GrayScaleBrushes.Pct10 GrayScaleBrushes.Pct15 ..all the way to.Pct95 ... ie: e.FillRectangle( GrayScaleBrushes.Pct05, exampleRect ); ``` How to do that, making sure that the brushes will dispose correctly ? The .NET Brushes class looks like the following (disassembled using reflector ). ``` public sealed class Brushes { // Fields private static readonly object AliceBlueKey = new object(); // Methods private Brushes() { } // Properties public static Brush AliceBlue { get { Brush brush = (Brush) SafeNativeMethods.Gdip.ThreadData[AliceBlueKey]; if (brush == null) { brush = new SolidBrush(Color.AliceBlue); SafeNativeMethods.Gdip.ThreadData[AliceBlueKey] = brush; } return brush; } } } ``` SafeNativeMethods seems unaccessible to me. Suppose I just returned a SolidBrush in a static method, would that make everything dispose correctly ? (And how to test that?) ``` public sealed class GrayScaleBrushes { private static SolidBrush pct05 = null; public static SolidBrush Pct05 { get { if (pct05 == null) { int rgbVal = GetRgbValFromPct( 5 ); pct05 = new SolidBrush(Color.FromArgb(rgbVal, rgbVal, rgbVal)); } return pct05; } } private static int GetRgbValFromPct(int pct) { return 255 - (int)(((float)pct / 100f) * 255f); } } ```
Building a GrayScaleBrushes class
CC BY-SA 2.5
0
2011-01-10T19:27:14.290
2011-06-24T14:38:00.237
2011-06-24T14:38:00.237
9,453
171,953
[ "c#", ".net", "gdi+" ]
4,650,984
1
4,651,044
null
4
2,439
I'm running through a few tutorials that describe ways of applying custom images to UIButtons in iPhone programming using Obj-C. One method i like is to place a UIButton (Round Rect Button) on a XIB using Interface Builder then in the 'viewDidLoad' method of the XIB's view controller skin the button thus: ``` UIImage *ButtonImageNormal = [UIImage imageNamed:@"button_blue.png"]; UIImage *StretchableButtonImageNormal = [ButtonImageNormal stretchableImageWithLeftCapWidth:24 topCapHeight:24]; [self.Button setBackgroundImage:StretchableButtonImageNormal forState:UIControlStateNormal]; UIImage *ButtonImagePressed = [UIImage imageNamed:@"button_orange.png"]; UIImage *StretchableButtonImagePressed = [ButtonImagePressed stretchableImageWithLeftCapWidth:24 topCapHeight:24]; [self.Button setBackgroundImage:StretchableButtonImagePressed forState:UIControlStateHighlighted]; ``` The trouble with this method is that the button doesn't lose its 'Round Rect' background and at the side of the buttons you can still see the white of the 'Round Rect' button peeping through past the custom images. If however, i create a custom button from scratch using this code: ``` UIButton *CustomButton = [UIButton buttonWithType:UIButtonTypeCustom]; [CustomButton setFrame:CGRectMake(20, 100, 280, 45)]; [CustomButton.titleLabel setFont:[UIFont boldSystemFontOfSize:15]]; [CustomButton setTitle:@"Custom Button" forState:UIControlStateNormal]; [CustomButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; [CustomButton setBackgroundImage:[UIImage imageNamed:@"button_blue.png"] forState:UIControlStateNormal]; [CustomButton setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; [CustomButton setBackgroundImage:[UIImage imageNamed:@"button_orange.png"] forState:UIControlStateHighlighted]; [self.view addSubview:CustomButton]; ``` There is no such white background peeping through. I really would like to use the 'Round Rect' method of placing and skinning buttons because i'd like to see their positions in Interface builder. Is there a method i need to use or a property i need to amend to get rid of the white background of a 'Round Rect' button in code. Here's an image showing the problem: ![alt text](https://i.stack.imgur.com/XjqmQ.png)
Problems applying custom coded images to a Round Rect Button in Interface Builder
CC BY-SA 2.5
0
2011-01-10T20:06:48.983
2011-02-12T03:59:11.387
null
null
13,227
[ "iphone", "objective-c", "uibutton" ]
4,651,078
1
4,651,119
null
0
457
I created a FontDialog.cs Windows Form where my users can choose colors among other things for the text. I need to capture what the user has selected on the dialog: ![alt text](https://i.stack.imgur.com/lMl3X.png) Here's how I'm calling the dialog: ``` DialogsTestingGrounds.FontDialog dialog = new FontDialog(); dialog.ShowDialog(); ``` How can I capture the selected values, I imagine I have to create properties for everything I want to transfer on the FontDialog.cs form end, right?
How to capture selected values from a dialog?
CC BY-SA 2.5
null
2011-01-10T20:18:20.927
2011-01-13T16:59:38.777
null
null
null
[ "c#", "winforms", "dialog" ]
4,651,092
1
4,651,196
null
5
17,356
I am trying to get the list of files sorted by modification date. I modified the sample program from [Sort Directory and list files based on date and time](http://forums.devshed.com/perl-programming-6/sort-directory-and-list-files-based-on-date-and-time-317220.html) and tried to run it. ``` sub get_sorted_files { my $path = shift; opendir my($dir), $path or die "can't opendir $path: $!"; my %hash = map {$_ => (stat($_))[9]} map { "$dir$_" } grep { m/.*/i } readdir $dir; closedir $dir; return %hash; } my %files = get_sorted_files("."); foreach my $keys (sort{$files{$a} <=> $files{$b}} keys %files) { print "$keys\t", scalar localtime($files{$keys}), "\n"; } ``` I am running this on my Windows XP 32-bit machine using [Strawberry Perl](http://en.wikipedia.org/wiki/Strawberry_Perl) version 5.12.1.0. The directory listing on Windows is: ![alt text](https://i.stack.imgur.com/Jgs2b.png) The output is: ![alt text](https://i.stack.imgur.com/vo7x2.png) The output doesn't make much sense to me. What is going wrong with this piece of code and how exactly is the `foreach` loop sorting the list of files?
Getting the list of files sorted by modification date in Perl
CC BY-SA 3.0
0
2011-01-10T20:19:25.857
2023-02-21T17:21:32.773
2014-01-08T16:12:20.513
63,550
263,266
[ "perl", "sorting", "date" ]
4,651,705
1
4,651,963
null
3
894
How can I write an own resize corner/handle for an NSWindow? I'm using a subclass of an NSWindow without the default resize corner, but I need it for my window. ![alt text](https://i.stack.imgur.com/f7bYq.png)
How to write an own resize corner/handle for an NSWindow?
CC BY-SA 2.5
0
2011-01-10T21:30:02.077
2011-01-10T21:57:21.940
2011-01-10T21:31:24.697
21,234
239,936
[ "cocoa", "resize", "nswindow", "resizegrip" ]
4,651,914
1
4,652,256
null
15
438
I'm looking for an algorithm to do this effect, but it's not helping that I don't even know what to look for. I use PHP, so any existing code samples would be great. I want to specify the borders of the shape and have php auto fill it with letters. I'm also open to other ideas to accomplish the same thing. Does this algorithm have a name? ![http://robertbasic.com/img/sign-letters.gif](https://i.stack.imgur.com/FazVH.gif)
What's the name of an algorithm that would produce this graphic fill
CC BY-SA 2.5
0
2011-01-10T21:52:56.463
2011-01-12T17:42:58.203
null
null
507,387
[ "php", "graphics" ]
4,652,202
1
null
null
2
4,419
I am working through some existing code for a project i am assigned to. I have a successful call to `glTexImage2D` like this: `glTexImage2D(GL_TEXTURE_2D, 0, texture->format, texture->widthTexture, texture->heightTexture, 0, texture->format, texture->type, texture->data);` I would like create an image (preferably a `CGImage` or `UIImage`) using the variables passed to `glTexImage2D`, but don't know if it's possible. I need to create many sequential images(many of them per second) from an OpenGL view and save them for later use. Should i be able to create a `CGImage` or `UIImage` using the variables i use in `glTexImage2D`? If i should be able to, how should i do it? If not, why can't i and what do you suggest for my task of saving/capturing the contents of my opengl view many times per second? edit: i have already successfully captured images using some techniques provided by apple with `glReadPixels`, etc etc. i want something faster so i can get more images per second. edit: after reviewing and adding the code from Thomson, here is the resulting image: ![resulting image from Thomson's code](https://i.stack.imgur.com/xJJTb.jpg) the image very slightly resembles what the image should look like, except duplicated ~5 times horizontally and with some random black space underneath. note: the video(each frame) data is coming over an ad-hoc network connection to the iPhone. i believe the camera is shooting over each frame with the YCbCr color space edit: further reviewing Thomson's code I have copied your new code into my project and got a different image as result: ![image 2](https://i.stack.imgur.com/8nCJi.jpg) width: 320 height: 240 i am not sure how to find the number of bytes in texture-> data. it is a void pointer. edit: format and type texture.type = `GL_UNSIGNED_SHORT_5_6_5` texture.format = `GL_RGB`
iOS OpenGL using parameters for glTexImage2D to make a UIImage?
CC BY-SA 3.0
null
2011-01-10T22:23:42.357
2011-11-18T22:35:11.237
2011-11-18T22:35:11.237
416,412
416,412
[ "objective-c", "cocoa-touch", "ios", "opengl-es" ]
4,652,335
1
4,817,555
null
1
912
I have inherited an application that was started as an MDI program, but the necessary background work was never put in place to fully support MDI. I'm trying to build in just enough MDI support to make the application look good and work properly as an SDI application. Here's what I am observing, and I don't know how this is happening or how to fix it. 1. The MDIchild form's border is shown above the MDIparent form's menu strip. 2. The MDIchild form has two icons in the upper left. 3. The MDIchild form has two ControlBoxes in the upper right. ![alt text](https://i.stack.imgur.com/HFSku.jpg) Any ideas why this would be? I'd be really happy if the MDIChild window border (including the icons and control boxes) was removed entirely. Thanks, SH
Duplicate ControlBox
CC BY-SA 2.5
null
2011-01-10T22:42:07.013
2011-02-08T15:58:46.173
null
null
548,805
[ "mdi", "mdichild", "mdiparent", "controlbox" ]
4,652,721
1
4,653,666
null
16
7,137
i read about responder chains, and basically i read about how the events from the UI are passed up on the responder chain, how to handle them and how to pass along. I also used -becomeFirstResponder and -resignFirstResponder, but i was using these only for basic tasks, like showing keyboard on iOS and handling shake events. What I would like to know is how can I use the "First Responder" proxy object in the MainWindow.xib that Xcode generates. I see some received actions and also i see that i can create actions on the Identity inspector tab. So my question is: how can I use these actions, and ?! ![Interface Builder Screenshot](https://i.stack.imgur.com/eNhyr.png) Thanks in advance.
How can "First Responder" be used in a xib file?
CC BY-SA 3.0
0
2011-01-10T23:29:43.590
2015-01-31T14:37:48.890
2015-01-31T14:37:48.890
1,779,477
560,491
[ "iphone", "objective-c", "ios", "first-responder" ]
4,652,793
1
null
null
13
5,559
Seeing that `<div>` elements render border/border-radius correctly, but any `<a>` or `<button>` that has a background, border and border-radius set shows the background color or image as a square, and only the border is round. Tried setting `<a>` & `<button>` to `display: block` or `display: inline-block` but that didn't work. Is there a known workaround? Here is a link to the computed style from Webkit: [https://gist.github.com/773719](https://gist.github.com/773719) ![alt text](https://i.stack.imgur.com/wQmlO.png) Here is the computed style from IE9 dev tools: ![alt text](https://i.stack.imgur.com/Ft1wv.png) Using the filter:; or -ms-filter:; property to have gradients in IE make the background break out of the defined border-radius.
Border-radius bug on <a> in IE9
CC BY-SA 2.5
0
2011-01-10T23:40:33.217
2012-08-28T08:19:34.727
2011-01-11T00:25:21.450
255,256
255,256
[ "internet-explorer-9", "css" ]
4,653,018
1
4,822,981
null
6
7,061
I'm using iText in Java to select a few pages out of a big PDF document and save as a new, smaller PDF. At the same time I'd like to change their colours. For example, suppose my pages all use shades of grey, and I'd like to make it green. All the colours used are shades of gray. I'd like to replace each of those colours with a corresponding colour in green. --- > What exactly are you trying to accomplish? Turn this... into this: ![gray page](https://i.stack.imgur.com/ftRsu.png)![green page](https://i.stack.imgur.com/IdfkU.png) I have [some documents](http://charactersheets.minotaur.cc/), on which I'm already using iText to select a smaller set of pages from the document based on user input - cutting more than 100 pages down to about 5. At the same time I wish to produce green, blue, yellow, pink etc versions of them. Not every page is in grayscale, but all the ones that matter are, so I can force their colour space if need be. --- Following Mark Storer's suggestion of blending modes, here's what I have: ``` val reader = new PdfReader(file.toURL) val document = new Document val writer = PdfWriter.getInstance(document, outputStream) document.open() /* draw a white background behind the page, so the blend always has something to transform, otherwise it just fills. */ val canvas = writer.getDirectContent canvas.setColorFill(new CMYKColor(0.0f, 0.0f, 0.0f, 0.0f)) canvas.rectangle(10f, 0f, 100f, 100f) canvas.fill /* Put the imported page on top of that */ val page = writer.getImportedPage(reader, 1) canvas.addTemplate(page, 0, 0) /* Fill a box with colour and a blending mode */ canvas.setColorFill(new CMYKColor(0.6f,0.1f,0.0f,0.5f)) val gstate = new PdfGState gstate.setBlendMode(PdfGState.BM_SCREEN) canvas.setGState(gstate) canvas.rectangle(0f, 0f, 100f, 100f) canvas.fill document.close() ``` (It's in Scala, but the iText library is just the same as in Java) The problem is, all the blending modes iText has available are "separable" modes: they operate on each colour channel independently. That means I can separately adjust the cyan, magenta, yellow or black values, but I can't turn gray into green. To do that, I'd need to use the Color blending mode, which is "non-separable", ie the colour channels affect each other. As far as I can tell, iText doesn't offer that - none of the non-separale blending modes are listed among the constants in `PdfGState`. I'm using iText 5.0.5, which is the latest version as of writing this. Is there a way of accessing these blending modes in iText, or even of hacking them in? Is there another way of achieving the result? - [This adobe document described blending modes](http://www.adobe.com/content/dam/Adobe/en/devnet/pdf/pdfs/pdf_reference_archives/blend_modes.pdf) --- Even setting the blend mode to Color didn't work. I did this in code to force it: ``` val gstate = new PdfGState gstate.put(PdfName.BM, new PdfName("Color")) canvas.setGState(gstate) ``` and I checked the resulting PDF in a text editor to make sure it said the right thing. Sadly the result on screen just didn't work. I've no idea why, according to the PDF specification that should be the right blend mode. --- > "Color" didn't work? Funky. Can we see the PDF? [Here's a PDF](http://www.basingstokeanimesociety.com/sadie/blending-test.pdf). Putting it on the web, I can now see that the "Color" mode works correctly in Chrome, but doesn't work in Acrobat 9 Pro (CS4). So the technique is correct, but Adobe fails at rendering! I wonder if there isn't some way of "flattening" the effect of the blending mode, so the PDF contains the desired colour object directly rather than a blending intended to result in the right colour. > Idea: Turn this upside down. Use the existing page as an alpha channel on a page filled entirely with the desired color rather than the other way around. How? I'm not sure the GState applies to adding a template? Also, the imported page would need the white background adding first, or it will simply flood with colour wherever there isn't an object rather then blending. I tried doing this: ``` val canvas = writer.getDirectContent canvas.setColorFill(new CMYKColor(0.6f,0.1f,0.0f,0.0f)) canvas.rectangle(10f, 0f, 500f, 500f) canvas.fill val template = canvas.createTemplate(500f, 500f) template.setColorFill(new CMYKColor(0f, 0f, 0f, 0f)) template.rectangle(0f, 0f, 500f, 500f) template.fill val page = writer.getImportedPage(reader, 1) template.addTemplate(page, 0, 0) val gstate = new PdfGState gstate.put(PdfName.BM, new PdfName("Color")) canvas.setGState(gstate) canvas.addTemplate(template, 0, 0) ``` And [here's the PDF it produced](http://www.basingstokeanimesociety.com/sadie/blending-test2.pdf). Not quite right, either in Chrome or Acrobat :) : Silly me. I changed the mode to "Luminosity", [producing this file](http://www.basingstokeanimesociety.com/sadie/blending-test2.pdf). As before, this looks correct in Chrome but not in Acrobat. --- I just checked, and even Adobe Reader X doesn't render it properly. Which probably means what I'm asking for is impossible. :( --- Leonard Rosenthal from Adobe got back to me, and clarified the problem: the "Color" blend mode only works when the transformation space is RGB, not CMYK. My PDF wasn't specifying the space, so Adobe products default to CMYK, while others default to RGB. The solution in iText was to add this line near the top: ``` writer.setRgbTransparencyBlending(true) ``` Of course, for the sake of colour accuracy you don't want any more colour space conversions than absolutely necessary, so only use this line if you really do need to use RGB blend modes. The colour pages produced look a little strange from a Photoshop user's perspective: it looks like light greys have been made more saturate than dark greys. I'm investigating ways of combining filters to adjust that output. [Here's the result!](http://charactersheets.minotaur.cc/) Many thanks to Mark Storer for helping me reach this solution.
iText PDF: replace / transform colours
CC BY-SA 3.0
0
2011-01-11T00:23:24.223
2013-11-19T15:04:14.070
2013-11-19T15:04:14.070
1,000
1,000
[ "pdf", "colors", "itext" ]
4,653,513
1
4,653,631
null
3
3,983
This question is messy, i dont need a working solution, i need some psuedo code. How would i solve this maze? This is a homework question. I have to get from point green to red. At every fork i need to 'spawn a thread' and go that direction. I need to figure out how to get to red but i am unsure how to avoid paths i already have taken (finishing with any path is ok, i am just not allowed to go in circles). Heres an example of my problem, i start by moving down and i see a fork so one goes right and one goes down (or this thread can take it, it doesnt matter). Now lets ignore the rest of the forks and say the one going right hits the wall, goes down, hits the wall and goes left, then goes up. The other thread goes down, hits the wall then goes all the way right. The bottom path has been taken twice, by starting at different sides. How do i mark this path has been taken? Do i need a lock? Is this the only way? Is there a lockless solution? Implementation wise i was thinking i could have the maze something like this. I dont like the solution because there is a LOT of locking (assuming i lock before each read and write of the haveTraverse member). I dont need to use the MazeSegment class below, i just wrote it up as an example. I am allowed to construct the maze however i want. I was thinking maybe the solution requires no connecting paths and thats hassling me. Maybe i could split the map up instead of using the format below (which is easy to read and understand). But if i knew how to split it up i would know how to walk it thus the problem. How do i walk this maze efficiently? The only hint i receive was dont try to conserve memory by reusing it, make copies. However that was related to a problem with ordering a list and i dont think the hint was a hint for this. ``` class MazeSegment { enum Direction { up, down, left, right} List<Pair<Direction, MazeSegment*>> ConnectingPaths; int line_length; bool haveTraverse; } MazeSegment root; class MazeSegment { enum Direction { up, down, left, right} List<Pair<Direction, MazeSegment*>> ConnectingPaths; bool haveTraverse; } void WalkPath(MazeSegment segment) { if(segment.haveTraverse) return; segment.haveTraverse = true; foreach(var v in segment) { if(v.haveTraverse == false) spawn_thread(v); } } WalkPath(root); ``` ![alt text](https://i.stack.imgur.com/114WD.gif)
Solve a maze using multicores?
CC BY-SA 2.5
0
2011-01-11T02:12:08.320
2011-01-11T02:48:59.247
2011-01-11T02:34:20.973
438,544
null
[ "multithreading", "multicore" ]
4,653,768
1
4,653,863
null
34
25,069
I have `archive.zip` with two files: `hello.txt` and `world.txt` I want to overwrite `hello.txt` file with new one with that code: ``` import zipfile z = zipfile.ZipFile('archive.zip','a') z.write('hello.txt') z.close() ``` but it won't overwrite file, somehow it creates another instance of `hello.txt` — take a look at winzip screenshot: ![alt text](https://i.stack.imgur.com/KCJjE.png) Since there is no smth like `zipfile.remove()`, what's the best way to handle this problem?
overwriting file in ziparchive
CC BY-SA 2.5
0
2011-01-11T03:00:23.583
2023-01-12T23:13:28.213
2011-01-11T03:06:21.723
277,262
277,262
[ "python", "ziparchive" ]
4,653,786
1
4,653,930
null
2
2,458
I have this query ``` SELECT currency_code, SUM(CASE WHEN TYPE = 'buy'THEN to_amount END ) AS BUY, SUM(CASE WHEN TYPE = 'sell' THEN to_amount END ) AS SELL, SUM(CASE WHEN TYPE = 'sell' THEN rate END ) AS SELL_RATE, SUM(CASE WHEN TYPE = 'buy' THEN rate END ) AS BUY_RATE, AVG(CASE WHEN TYPE = 'buy' THEN rate END ) AS AVG_BUY_RATE, AVG(CASE WHEN TYPE = 'sell' THEN rate END ) AS AVG_SELL_RATE FROM tb_currency LEFT JOIN tb_bill ON tb_currency.CURRENCY_ID = tb_bill.CURRENCY_ID AND tb_bill.TYPE IN ('buy', 'sell') AND date( DATE_TIME ) >= '2011-01-01' AND date( DATE_TIME ) <= '2011-01-11' GROUP BY currency_code ``` that will output this: ![alt text](https://i.stack.imgur.com/n852u.png) Right now i want to join this query with another table called the tb_user have PK called and the that is use in the query above also have foreign key called ``` user_id (pk)| user_name | branch_id ``` ``` bill_id (pk) | user_id (fk)| ``` I tried several times but still cant join it correctly. Hope you guys can help. Thanks.
how to join after left join complex mysql queries
CC BY-SA 2.5
null
2011-01-11T03:02:46.053
2011-01-11T06:02:50.780
2011-01-11T03:18:03.593
372,871
417,899
[ "mysql", "left-join" ]
4,653,919
1
null
null
1
483
How can I change the font size of an NSTextView automatically so that the longest paragraph is always not broken? The NSTextView is resizable, so the size of the font should always change to the maximal possible size in which the text is not broken. For example: ![alt text](https://i.stack.imgur.com/r6bul.png) ![alt text](https://i.stack.imgur.com/CeQjv.png)
How to change the font size of an NSTextView automatically so that the longest paragraph is always not broken?
CC BY-SA 2.5
null
2011-01-11T03:28:31.353
2011-01-11T20:46:00.877
null
null
239,936
[ "cocoa", "nstextview" ]
4,654,179
1
4,654,198
null
1
217
I'm getting Intellisense in .NET 4 that is allowing me to do something with function parameters such as "category:" below in VS2010. What does this mean, and what can I do with this? ![alt text](https://i.stack.imgur.com/bVhzB.png)
Why does VS2010 allow you to type in the function parameter followed by a colon?
CC BY-SA 2.5
0
2011-01-11T04:28:38.527
2011-01-11T04:38:16.257
null
null
328,397
[ "visual-studio-2010", ".net-4.0", "intellisense" ]
4,654,337
1
null
null
-1
562
``` <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <title>to patch omnigrid style</title> <style type="text/css"> .pDiv{ border : 1px solid #ccc; padding : 2px 5px; font-size : 12px; font-family : "Microsoft YaHei", "宋体",Arial, Helvetica, sans-serif; } .pButton{ width : 16px; height : 16px; border : none; background-position : 0px 3px; -webkit-background-position : 0px 1px; background-color : #fff; background-repeat : no-repeat; cursor : pointer } .pInput{ text-align:center } #first{ background-image : url(imgs/first.gif); } #prev{ background-image : url(imgs/prev.gif); } #next{ background-image : url(imgs/next.gif); } #last{ background-image : url(imgs/last.gif); } </style> </head> <body> <div style="padding: 100px 100px 100px 100px"> <div class="pDiv">每页显示: <SELECT class=rp name=rp> <OPTION selected value=10>10</OPTION> <OPTION value=20>20</OPTION> <OPTION value=50>50</OPTION> <OPTION value=100>100</OPTION> <OPTION value=200>200</OPTION> </SELECT>&nbsp;~ <button id="first" class="pButton" title="第一页"></button> <button id="prev" class="pButton" title="上一页"></button> 第<input class="pInput" type="text" size="2" />页共10页 <button id="next" class="pButton" title="下一页"></button> <button id="last" class="pButton" title="最后一页"></button> </div> </div> </body> </html> ``` IE: ![alt text](https://i.stack.imgur.com/yl5q8.jpg) FireFox: ![alt text](https://i.stack.imgur.com/UTJdR.jpg)
please help make this html page looks same in firefox
CC BY-SA 2.5
null
2011-01-11T04:57:48.273
2011-01-11T05:10:11.357
null
null
386,208
[ "html", "css" ]
4,654,351
1
4,655,047
null
3
1,531
I currently would like to expand my knowledge on Spring MVC so I am investigating the sample web apps that the spring distribution has. I am basically checking the Petclinic application. In the GET method, the Pet object was added into the model attributes so the JSP can access the javabean properties. I think I understand this one. ``` @Controller @RequestMapping("/addPet.do") @SessionAttributes("pet") public class AddPetForm { @RequestMapping(method = RequestMethod.GET) public String setupForm(@RequestParam("ownerId") int ownerId, Model model) { Owner owner = this.clinic.loadOwner(ownerId); Pet pet = new Pet(); owner.addPet(pet); model.addAttribute("pet", pet); return "petForm"; } @RequestMapping(method = RequestMethod.POST) public String processSubmit(@ModelAttribute("pet") Pet pet, BindingResult result, SessionStatus status) { new PetValidator().validate(pet, result); if (result.hasErrors()) { return "petForm"; } else { this.clinic.storePet(pet); status.setComplete(); return "redirect:owner.do?ownerId=" + pet.getOwner().getId(); } } } ``` But the thing that I cannot understand is during the POST operation. I look up at my firebug, and I notice that my post data are only the data that was entered by the user which to me is fine. ![alt text](https://i.stack.imgur.com/C2bRG.jpg) But when I inspect the data on my controller. The owner info is still complete. I look up at the generated HTML from the JSP but I cannot see some hidden information about the Owner object. I am quite not sure where does Spring gather the info on the owner object. Does this mean that Spring is caching the model objects per each thread request? ![alt text](https://i.stack.imgur.com/6RPln.jpg) This is for Spring MVC 2.5.
How to understand Spring MVC Workflow?
CC BY-SA 3.0
0
2011-01-11T04:59:41.887
2018-03-29T21:57:48.893
2018-03-29T21:57:48.893
472,495
373,784
[ "java", "spring", "spring-mvc" ]
4,654,887
1
null
null
1
896
I want to create a blogger design with 2 column layout, the right column positioned top as same as header but also I want its height to be approaching on the footer regardless of the the content of left column. Here's the layout I want to be: ![alt text](https://i.stack.imgur.com/BZ10l.gif) ### CSS Code: ``` #center { float: left; overflow: hidden; background: #f0f0f0; } #center div { float: left; margin-bottom: -2000px; padding-bottom: 2000px; } #center .col1 { width:700px; margin-right: 5px; } #center .col2 { margin-right: 0; width:200px; background:#000000; overflow:hidden; } .clear { clear:both; display:block; overflow:hidden; visibility:hidden; width:0; height:0 } .content { padding:10px; } .footer { background:#99FF99; } .sidebar { margin-left: 5px; margin-right: 5px; color:#FFFFFF; } #Image1 { position:absolute; top:10px; } ``` ### HTML Code: ``` <div class="container"> <div class="header-wrapper"> <div class="header"> <h1>Blog Title</h1> Integer nec neque. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent dictum venenatis velit. Morbi interdum eleifend sapien. Morbi a mauris</div> </div> </div> <div class="clear"></div> <div class="container"> <div id="center" class="grid"> <div class="col1"> <div class="content"> <p>Left Content</p> </div> </div> <div class="col2"> <div class="content sidebar"> <div id="Image1" class="widget Image"> <div class="widget-content"> <img width="180" height="201" src="Image SRc" id="Image1_img" alt=""> <br> </div> </div> <p>righ text</p> </div> </div> </div> </div> <div class="clear"></div> <div class="container"> <div class="footer">Footer</div> </div> ```
how to make a two layout columns with same height with right column offset to header
CC BY-SA 2.5
0
2011-01-11T06:38:50.113
2011-01-11T22:10:21.563
2011-01-11T06:42:05.910
126,039
132,707
[ "css" ]
4,655,262
1
4,655,306
null
0
2,580
I'm trying to compute a value from 2 given values quantity and price. I used the keyup event in jquery to compute the total from the current value of the qty and price. How will I be able to reference the current textbox which initiates the keypress event. And put the corresponding total to the assigned box. Do you know of any jquery plugins that will make it easier for me to achieve the result. ``` <script type="text/javascript"> $(function(){ $('input[name^=qty]').keyup(function(){ var curprice=$('input[name^=price]').val(); var curqty=$('input[name^=qty]').val(); var curtotal=curprice * curqty; $('input[name^=comp]').val(curtotal); }); }); </script> </head> <body> <?php for($a=0;$a<=5;$a++){ ?> Price:<input type="text" name="<?php echo 'price'.$a; ?>" value="<?php echo $a; ?>"/> Quantity:<input type="text" name="<?php echo 'qty'.$a; ?>" value="<?php echo $a; ?>"/> Computed:<input type="text" id="<?php echo 'a'.$a; ?>" name="<?php echo 'comp'.$a ?>" value="" /> <?php echo "<br/>"; } ?> </body> </html> ``` Heres a screenshot. ![alt text](https://i.stack.imgur.com/vEeiR.png) If you need more details, feel free to ask, thanks.
how to get current value of textbox in jquery
CC BY-SA 2.5
null
2011-01-11T07:39:08.030
2011-01-11T07:55:12.393
null
null
472,034
[ "php", "javascript", "jquery" ]
4,655,334
1
4,666,225
null
12
14,883
Can anybody please show me how to use RANSAC algorithm to select common feature points in two images which have a certain portion of overlap? The problem came out from feature based image stitching. ![alt text](https://i.stack.imgur.com/Ew0sV.jpg) ![alt text](https://i.stack.imgur.com/s9E6D.jpg)
RANSAC Algorithm
CC BY-SA 2.5
0
2011-01-11T07:50:02.643
2016-02-16T22:49:20.627
2016-02-16T22:49:20.627
1,803,551
436,515
[ "image-processing", "detect", "homography", "ransac", "corner-detection" ]
4,655,619
1
4,656,067
null
2
1,301
Feels like bugs and problems are attracted to me lately! =P So I finally took some time off today to explore a little Rx. Heres what I did: ![alt text](https://i.stack.imgur.com/RXGqL.jpg) Here's the only piece of running code: ``` private void button1_Click(object sender, EventArgs e) { var txtc = Observable.FromEvent<EventArgs>(textBox1, "TextChanged") .Throttle(TimeSpan.FromSeconds(0.5)) .SubscribeOnDispatcher();//**also tried .SubscribeOn(this) var t = from x in txtc select textBox1.Text; t.Subscribe(x => listBox1.Items.Add(x)); } ``` Now, when run Debug (F5) I click the Button, all good, I then type something, poof! The form just silently dies!! Note: I removed the code from the Form.Load event because of the known bug with VS not breaking on exceptions in that event on (and yes thats my machine) This is what the debug output looks like: > > The thread 'vshost.NotifyLoad' (0x1438) has exited with code 0 (0x0).The thread 'vshost.LoadReference' (0x155c) has exited with code 0 (0x0).'RxWinForms.vshost.exe' (Managed (v4.0.30319)): Loaded '\RxWinForms\bin\Debug\RxWinForms.exe', Symbols loaded.A first chance exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dllThe program '[5228] RxWinForms.vshost.exe: Managed (v4.0.30319)' has exited with code 0 (0x0).The program '[5228] RxWinForms.vshost.exe: Program Trace' has exited with code 0 (0x0).
simple rx code silently fails in windows forms only during debugging in visual studio 2010
CC BY-SA 2.5
null
2011-01-11T08:32:39.750
2011-01-11T10:30:31.783
2011-01-11T08:42:36.047
368,070
368,070
[ "c#", "winforms", "system.reactive" ]
4,655,662
1
null
null
3
25,886
What happens when I close my app, which uses webbrowser. The following url uses flash player. ![alt text](https://i.stack.imgur.com/0El4I.jpg) Everything works fine. This error shows on app close. How do I ignore it?
How to ignore script errors in Webbrowser
CC BY-SA 2.5
0
2011-01-11T08:38:38.437
2017-05-29T20:21:31.537
2015-10-29T14:56:21.710
1,294,207
566,868
[ "c#", "browser" ]
4,655,800
1
4,659,802
null
0
1,455
I use NSIS to create installer . In my script `!define MUI_FINISHPAGE_NOAUTOCLOSE` so that user can see the installation file logs. But here my issue is even the progress text shows completed . progress bar underneath doesn't reflect 100%. Please find this ![screenshot](https://i.stack.imgur.com/3HyaW.jpg) issue happens only in windows 7 , in Windows Xp its fine. AFAIK pidgin uses NSIS installer script and for that I could able to see its Progressbar showing 100 % when gets completed.
NSIS, progress bar not showing 100% on completion
CC BY-SA 2.5
null
2011-01-11T08:57:07.240
2011-03-12T18:37:50.667
2011-01-11T11:34:47.947
137,400
137,400
[ "nsis" ]
4,656,017
1
null
null
1
1,000
I have a window, which only contains one groupbox, which contains several more groupboxes in a QVBoxLayout (the content of those doesnt have a fixed size either). Those inner groupboxes are checkable, and unchecking them collapses them (collapsed groupbox has a reduced (maximum)height of 30px and isFlat==true). What i am trying to achieve is: When one of the inner groupboxes is collapsed, the outer groupbox and the window should shrink accordingly (currently the other non-collapsed groupboxes grow instead). But the user should still be able to resize the window, which should cause the groupboxes to grow accordingly: ![alt text](https://i.stack.imgur.com/6OlVb.png) I was toying around with `QWidget::setSizePolicy` and `QLayout::setSizeConstraint` of the different layouts/widgets, but havent come to a satisfying result yet.. Whats the best way to achieve this ? Can this be done without implementing your own size-hint functions ?
shrink the parent window instead of having other widgets grow
CC BY-SA 2.5
0
2011-01-11T09:23:15.987
2011-01-11T12:48:03.560
2011-01-11T09:36:33.990
231,717
231,717
[ "qt", "user-interface", "layout", "qt4" ]
4,656,031
1
null
null
0
1,647
I have installed Instant Q&A wordpress theme for one of my website. There is a Find a Question search box, i want to change the query which runs in the background that is which retrieves the records. I am attaching the screen shot of the same. I have traced that there is a searchform.php which is loading the search form but i am unable to trace the code which fetches the records. ![alt text](https://i.stack.imgur.com/fOmEr.png) Please help me on this. Thanks, Pankaj
How do i change search query?
CC BY-SA 2.5
null
2011-01-11T09:24:50.427
2011-05-17T18:49:15.963
null
null
146,192
[ "wordpress", "wordpress-theming" ]
4,656,165
1
4,659,236
null
0
575
I am currently experiencing a weird caching problem it would seem. When I load my data intially, I return all the data within given dates and my graph looks as follows: ![alt text](https://i.stack.imgur.com/aSejL.png) Then I filter the data to return a subset of the original data for the same date range (not that it matters) and I get the following view of my data: ![alt text](https://i.stack.imgur.com/vEqpl.png) However, I intermittently get the following when I refresh the same filterd view of the data: ![alt text](https://i.stack.imgur.com/e0VrB.png) One can see that not all the data gets cached but only some of it i.e. for 12 Dec 2010 and 5 dec 2010(not shown here). I've looked at my queries and the correct data is getting pulled out. It is only on the presentation layer i.e. on Mainpage.xaml.cs that this erroneous data seems to exist. I've stepped through the code and the data is corect through all the layers except on the presentation layer. Has anyone experienced this before? Is there some sort of caching going in the background that is keeping that data in the background as I've got browser caching off? I am using the LoadOperation in the callback method within the Load method of the DomainContext if that helps...
Silverlight 4 caching issue?
CC BY-SA 2.5
null
2011-01-11T09:40:23.227
2016-01-19T19:52:04.087
2016-01-19T19:52:04.087
4,370,109
509,727
[ "caching", "silverlight-4.0" ]
4,656,474
1
4,656,821
null
2
3,899
i have a huge file and as an output some columns doesn't have a value, i need to fill these columns with 0 for further analysis. I can separate the columns with space or tab, now below it is seen separated with tab. ![alt text](https://i.stack.imgur.com/cLFia.png)
Filling space/tab separated, empty columns with 0
CC BY-SA 2.5
0
2011-01-11T10:13:41.730
2019-07-09T13:11:13.573
2011-01-11T10:32:36.370
169,895
169,895
[ "regex", "perl", "file", "sed", "awk" ]
4,656,457
1
4,658,109
null
2
1,331
I am able to use the MVCContrib Grid Pager as in the following sample ``` Html.Pager(Model.CustomerList) .First("First") .Last("Last") .Next("Next") .Previous("Previous") ``` Is there any way to modify the links to show clickable images instead of plain text? I have applied Darin solution and it works very nice except for the image not being showed by the browser. This is the markup generated by the pager helper ``` <div class="pagination"> <span class="paginationLeft">1-2 di 4</span> <span class="paginationRight"> <span class="first"></span> | <span class="previous"></span> | <a href="/x/Hearing/HomeSummary?page=2"> <span class="next"></span> </a> | <a href="/x/Hearing/HomeSummary?page=2"> <span class="last"></span> </a> </span> </div> ``` and these are the CSS rules defined ``` .pagination span.paginationRight span.first { width: 12px; height: 12px; background-image: url('../images/disabled-pager-first.png') } .pagination span.paginationRight span.next { width: 12px; height: 12px; background-image: url('../images/disabled-pager-next.png') } .pagination span.paginationRight span.last { width: 12px; height: 12px; background-image: url('../images/disabled-pager-last.png') } .pagination span.paginationRight span.previous { width: 12px; height: 12px; background-image: url('../images/disabled-pager-previous.png') } .pagination span.paginationRight a span.first { width: 12px; height: 12px; background-image: url('../images/pager-first.png') } .pagination span.paginationRight a span.next { width: 12px; height: 12px; background-image: url('../images/pager-next.png') } .pagination span.paginationRight a span.last { width: 12px; height: 12px; background-image: url('../images/pager-last.png') } .pagination span.paginationRight a span.previous { width: 12px; height: 12px; background-image: url('../images/pager-previous.png') } ``` As you can see from the following images the correct CSS rules match the markup generated. Still I can't see images on the browser. Any idea? For disabled images ![alt text](https://i.stack.imgur.com/yiCEm.png) For enabled images ![alt text](https://i.stack.imgur.com/liLoA.png)
MVCContrib pager images
CC BY-SA 2.5
null
2011-01-11T10:12:04.913
2011-01-12T11:45:31.253
2011-01-12T08:47:48.583
431,537
431,537
[ "asp.net-mvc", "asp.net-mvc-2", "asp.net-mvc-3", "mvccontrib", "mvccontrib-grid" ]
4,656,669
1
4,656,861
null
0
1,169
I am trying to implement UISearch bar but I have some problems. When app starts I add table view like this: ``` ChannelTableViewRootController *firstViewController = [[ChannelTableViewRootController alloc] initWithStyle:UITableViewStylePlain]; navigationController = [[UINavigationController alloc]initWithRootViewController:firstViewController]; navigationController.navigationBar.hidden = NO; UIView *uv = self.view; [uv addSubview:[navigationController view]]; ``` I add UISearch bar in xib. Connect it to UISearchBar variable from my header file. Set delegate to self, and try to add it to header of tableview: ``` self.tableView.tableHeaderView = searchBar; searchBar.autocorrectionType = UITextAutocorrectionTypeNo; ``` And when I make object manually '`searchBar = [[UISearchBar alloc]init]; // + code from above`' I got displayed search bar like on image but nothing happends and can't put it over that header. I am trying to make search like in address book with scopes etc. ![alt text](https://i.stack.imgur.com/5Abov.png)
Problem with adding UISearch bar
CC BY-SA 2.5
null
2011-01-11T10:35:12.687
2011-01-11T11:09:11.883
null
null
480,231
[ "iphone", "objective-c", "uitableview", "uisearchbar" ]
4,656,747
1
4,656,795
null
1
2,887
EditText doesn't fill the whole height of the window. Here is the code: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical"> <LinearLayout android:id="@+id/LinearLayout02" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > <Button android:id="@+id/bItalic" android:layout_width="wrap_content" android:layout_height="wrap_content" ></Button> <Button android:id="@+id/bBold" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/bUnderline" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/bStrike" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="S" /> <Button android:id="@+id/bSub" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/bSup" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <ImageButton android:id="@+id/bInsertImage" android:src="@drawable/insertimage" android:layout_width="wrap_content" android:layout_height="wrap_content"/> <ImageButton android:id="@+id/bInsertTable" android:src="@drawable/table" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> <FrameLayout android:id="@+id/FrameLayout02" android:layout_height="fill_parent" android:layout_width="fill_parent" > <TabHost android:id="@+id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="fill_parent" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:paddingTop="62px"> <ScrollView android:id="@+id/scroll01" android:layout_width="fill_parent" android:layout_height="fill_parent"> <HorizontalScrollView android:id="@+id/scroll_hor01" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/VisualPane" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </HorizontalScrollView> </ScrollView> <ScrollView android:id="@+id/scroll02" android:layout_width="fill_parent" android:layout_height="fill_parent"> <HorizontalScrollView android:id="@+id/scroll_hor02" android:layout_width="fill_parent" android:layout_height="fill_parent"> <EditText android:id="@+id/HTMLPane" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </HorizontalScrollView> </ScrollView> </FrameLayout> </TabHost> </FrameLayout> </LinearLayout> ``` Here is a screenshot: ![http://s48.radikal.ru/i122/1101/a4/030018887e7b.jpg](https://i.stack.imgur.com/gQkhW.jpg) Why doesn't EditText fill the whole height of the window?
EditText doesn't fill the whole height of the window
CC BY-SA 2.5
0
2011-01-11T10:44:59.653
2011-01-11T23:17:44.463
null
null
565,447
[ "android", "android-edittext" ]
4,656,791
1
4,656,856
null
2
236
![alt text](https://i.stack.imgur.com/VxBNO.png) As described in the image, I got a `parent-Children relation` and since the `ParentID` not accepting null values (and I can't change to nullabel due to some restriction in the UI I have), how can I remove an existence relation between ReportDataSources in order to change the parent for them (here i want to set the parentId for one of them = 0) how could i do that since `i cant change the ParentID directly` and setting `Parent = null` is not valid ``` public void SetReportDataSourceAsMaster(ReportDataSource reportDataSource) { //Reset Master this.ReportDataSources.ToList().ForEach(rds => rds.IsMaster = false); //Set Master reportDataSource.IsMaster = true; //Set Parent ID for the rest of the Reports data sources this.ReportDataSources.Where(rds => rds.ID != reportDataSource.ID).ToList().ForEach(rds => { //Change Parent ID rds.Parent = reportDataSource; //Remove filttering data rds.FilteringDataMembers.Clear(); //Remove Grouping Data rds.GroupingDataMembers.Clear(); }); //Delete parent HERE THE EXCEPTION THROWN AFTER CALLING SUBMITCHANGES() reportDataSource.Parent = null; } ``` Exception thrown after calling `SubmitChanges()`: > An attempt was made to remove a relationship between a ReportDataSource and a ReportDataSource. However, one of the relationship's foreign keys (ReportDataSource.ParentID) cannot be set to null.
How to let a column accept null values as zero (0) in Self-Relation table
CC BY-SA 2.5
0
2011-01-11T10:49:17.033
2011-01-11T11:09:32.420
2011-01-11T11:09:32.420
41,956
480,107
[ "c#", "linq-to-sql", "foreign-key-relationship" ]
4,656,891
1
4,658,910
null
3
2,430
Without much luck I've been trying to attach the HTMLTidy c++ library dll within Visual Studio, however everytime I get various errors with different builds. I'm adding a reference to the project and then manually selecting the dll, which has been copied into a lib folder within the project folder. The first dll I tried was from Mark Beaton, and I'm using his HTMLTidy wrapper as it seems the most up to date. The standard Win32 one was built. [Mark Beaton Builds](https://github.com/markbeaton/TidyManaged/downloads) I've also tried the build from the official HTMLTidy page, again the dll [Official Build](http://www.paehl.com/open_source/?HTML_Tidy_for_Windows) The error when referencing, please help! I've tried compiling from source, but the source doesn't seem compatible with VS 2010. ![alt text](https://i.stack.imgur.com/bmguS.png)
Unable to attach HTMLTidy dll (libtidy.dll) to Visual Studio
CC BY-SA 2.5
null
2011-01-11T11:03:28.503
2011-01-11T14:55:12.607
2011-01-11T14:33:46.660
271,200
271,200
[ "c#", "visual-studio-2010", "htmltidy" ]
4,657,088
1
4,657,169
null
-1
854
I'm trying to make sense of the Visual Studio options: What's the difference between "Save all changes" and "Save Changes To Open Documents Only"? ![alt text](https://i.stack.imgur.com/pIeCr.png) How could you have unsaved changes in a document while it is NOT open in the IDE?
Visual Studio: Difference between "Save all changes" and "Save Changes To Open Documents Only"?
CC BY-SA 2.5
0
2011-01-11T11:25:37.723
2011-01-11T11:34:47.697
null
null
59,301
[ "visual-studio" ]
4,657,105
1
4,659,805
null
2
731
This is a really odd one that has been annoying me for some time, I use CodeRush and Refactor Pro at home and at work, since the switch to Visual Studio 2010 I have been unable to use the keyboard shortcut (Ctrl+') for the Refactor/CodeRush context menu: ![alt text](https://i.stack.imgur.com/ekIP9.png) For a long time I blamed VS2010 or CodeRush/Refactor! Pro for the issue and just worked round it with the mouse. At some point in time I realised that if Notepad++ was open the shortcut key didn't work. Depending on what type of file is loaded in Notepad++ alters the effect; for example, if I have an XML/HTML/XAML file open a tag and all of it's children are removed.
Ctrl+' (Apostrophe) Refactor! binding doesn't work when Notepad++ is open?
CC BY-SA 4.0
0
2011-01-11T11:28:09.433
2019-11-17T15:10:21.250
2019-11-17T15:10:21.250
1,033,581
74,302
[ "visual-studio-2010", "notepad++", "coderush", "refactorpro" ]
4,657,648
1
4,657,727
null
30
32,161
I've come across the in SQL Server 2008, and is somewhat confused about it. I'm currently reading [MCTS Self-Paced Training Kit (Exam 70-433): Microsoft SQL Server 2008-Database Development](https://rads.stackoverflow.com/amzn/click/com/0735626391), where authors discuss the concept, but in a limited way. From MSDN "[Understanding Pages and Extents](http://msdn.microsoft.com/en-us/library/ms190969.aspx)" I get an answer which doesn't really help. The web-page describes the size (8kb) of a page and how rows are stored in the page, and how columns will be moved automatically (by SQL Server) if the rows doesn't fit in the page. But still, I wonder if the page-level is something I should pay attention to designing a database with ER-diagrams, tables and data types? Or, should I simply rely on that SQL Server handles pages automatically and in the best way possible? ![alt text](https://i.stack.imgur.com/LHVSg.jpg) Thanx for listening!
What is a page in SQL Server and do I need to worry?
CC BY-SA 2.5
0
2011-01-11T12:34:16.657
2014-06-09T21:26:50.053
null
null
286,244
[ "sql-server" ]
4,657,803
1
null
null
2
2,891
I have got an application which create free sms alerts in one tab and show list of alerts on second tab. List of alerts is fetched from server once I click refresh button see image below. ![alt text](https://i.stack.imgur.com/68Fry.png) What I want to do is that once I create alert in tab 1 then when I switch to tab 2, refresh button is automatically clicked or some technique which allow me to call particular function once tab is switched to 2nd tab. Each tab have separate Activity class and my refresh function is written in activity for 2nd tab.
android perform action on tab switch
CC BY-SA 2.5
null
2011-01-11T12:52:13.347
2011-01-11T13:00:16.220
null
null
340,002
[ "android", "tabview" ]