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
6,418,304
1
6,418,394
null
11
362
I'm working on my solution to the [Cult of the Bound Variable](http://www.boundvariable.org/task.shtml) problem. Part of the problem has you implement an interpreter for the "ancient" Universal Machine. I've implemented an intepreter for the machine they describe and now I'm running a benchmark program that the university provided to test it. My C# implementation of this interpreter is ! I fired up my program in the ANTS profiler to see where the slowdown is and I can see that over 96% of my time is taken up by the "Load Program" operation. ![ANTS Profile Results](https://i.stack.imgur.com/LGAIw.png) The [specification](http://www.boundvariable.org/um-spec.txt) of this operator is as follows: ``` #12. Load Program. The array identified by the B register is duplicated and the duplicate shall replace the '0' array, regardless of size. The execution finger is placed to indicate the platter of this array that is described by the offset given in C, where the value 0 denotes the first platter, 1 the second, et cetera. The '0' array shall be the most sublime choice for loading, and shall be handled with the utmost velocity. ``` Here is my code for this operator: ``` case 12: // Load Program _platters[0] = (UInt32[])_platters[(int)_registers[B]].Clone(); _finger = _registers[C]; break; ``` The source code to my whole "Universal Machine" interpreter is [here](https://gist.github.com/1035661). What can I do to make this faster? There are other implementations of this interpreter written in C which complete the entire benchmark significantly faster.
How can I speed up array cloning in C#?
CC BY-SA 3.0
0
2011-06-20T22:27:05.407
2011-09-17T09:15:00.357
2011-06-20T22:48:52.107
2,635
2,635
[ "c#", ".net", "performance", "interpreter" ]
6,418,309
1
6,441,385
null
0
321
I am creating a link inside the main _Layout.cshtml file inside a MVC3 application. ``` @Html.ActionLink("Security", "Index", "Home", new { area = "Security" }, new { }) ``` When the page is rendered, this is the resultant Html ``` <a href="/Security">Security</a> ``` and if I click on this link, I get a blank page. I have [routedebugger](http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx) installed and here are the results: ![Route Debugger output](https://i.stack.imgur.com/VcwK1.jpg) I have the default route inside the Global.ascx.cs as follows: ``` routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL with parameters new { controller = "Home", action = "Index", id = UrlParameter.Optional }, new string[] { "Eis.Mvc.Web" }// Parameter defaults ); ``` and the Security Area's route: ``` context.MapRoute( "Security_default", "Security/{controller}/{action}/{id}", new { area = "Security", controller = "Home", action = "Index", id = UrlParameter.Optional }, new string[] { "Eis.Mvc.Web.Areas.Security.Controllers" } ); ``` If I directly type in the following URL, [http://localhost:1410/Security/home](http://localhost:1410/Security/home), the correct page is presented. I do have a Home controller with an Index action inside the root portion of the application and had to include the Namespace filters to the route registrations. Thank you, Keith
Why is @Html.ActionLink leaving off the controller and action portions of the link?
CC BY-SA 3.0
null
2011-06-20T22:27:48.410
2011-06-22T14:16:18.083
null
null
1,048
[ "asp.net-mvc-routing", "html.actionlink", "routedebugger" ]
6,418,636
1
null
null
9
3,688
In Visual Studio 2010 project property pages, if I select Common Properties and Framework and References for a C++ project, I can see all the references from a project. They usually have this icon: ![normal reference](https://i.stack.imgur.com/HaJmG.png) Sometimes, though, some references appear as this: ![red exclamation mark](https://i.stack.imgur.com/R2F8F.png) I tried to google it or find any documentation about it in the msdn documentation about references, but cannot find anything related to this. Does someone know about this? Thank you very much in advance!
What do the red exclamation mark icons in front of references mean in VS2010?
CC BY-SA 3.0
0
2011-06-20T23:15:59.923
2014-05-13T10:41:49.900
2014-05-13T10:41:49.900
204,690
807,520
[ "visual-studio-2010", "icons" ]
6,418,647
1
6,418,922
null
0
473
I am using Eclipse for PHP development in the Remote Systems Explorer perspective. I noticed a different icon appearing for only few files in the project explorer window. ![enter image description here](https://i.stack.imgur.com/Sfkgu.png) Notice the icon for logout.php file which is unlike a regular php file icon like for network_setup.php. When opened, the icons on the tabs are same though. ![enter image description here](https://i.stack.imgur.com/7pWk1.png) Anyone has any clue about this?
Eclipse for PHP - What's this icon?
CC BY-SA 3.0
null
2011-06-20T23:18:06.437
2011-06-21T00:01:42.510
2011-06-20T23:29:49.343
640,401
640,401
[ "php", "eclipse", "eclipse-pdt" ]
6,419,077
1
6,419,115
null
0
265
I have a field that has 5 different formatting options. In the app's settings I was originally using a `UISegmentedControl` inside a grouped style `UITableViewCell`. Back when it only had 3 options. But now that there are 5 even with abbreviated text the text won't fit on iPhone sized screen in portrait. They fit fine in landscape, but since the rest of the app works best in portrait it seems really bad practice to force only the settings to be landscape. Also the only way I see to force landscape on only the settings table view is to use `[[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];` which seems to be a undocumented/private API so I shouldn't use it. I have various other settings cells with `UISegmentedControls` in them, and they work fine. If I change the `UISegmentedControl's` style to `UISegmentedControlStyleBar` it fits properly. I'm just not sure that that is a good fit. What way do you think I should go with this? I'm not 100% sure on the % or Over 12 text but I need something similar. Is there some way to adjust the font size with the standard `UISegmentedControl`? ![enter image description here](https://i.stack.imgur.com/NlGM9.png) ![enter image description here](https://i.stack.imgur.com/ZDHZH.png)![enter image description here](https://i.stack.imgur.com/try1Z.png)![enter image description here](https://i.stack.imgur.com/TU9HR.png)
Best way to present 5 choices and still fit in the screen
CC BY-SA 3.0
null
2011-06-21T00:27:31.573
2011-06-21T00:35:05.167
null
null
253,456
[ "iphone", "ios", "uitableview", "uisegmentedcontrol" ]
6,419,317
1
6,419,405
null
0
2,011
I am working on a droid application, and I am using a TableLayout but cannot get it to look how I want. I want to have 2 columns, one for the text and one for the monetary value, but I cannot get them centered (in the table) and showing up next to each other. I am trying to get it to look like this... [http://s2.postimage.org/8wpons46m/whmcs.png](http://s2.postimage.org/8wpons46m/whmcs.png) but since I cannot actually see the borders, I cannot figure out how to fix it. This is what it currently looks like... ![enter image description here](https://i.stack.imgur.com/TFL0b.png) Here is the XML layout for my Table ``` <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="0" android:background="@drawable/round_table"> <TableRow> <TextView android:layout_column="1" android:text="Today's Income:" android:typeface="sans" android:textSize="10sp" android:textColor="#000000" android:gravity="center" android:layout_width="0dip" android:padding="3dip" /> <TextView android:text="$0.00 USD" android:typeface="sans" android:textSize="10sp" android:textColor="#000000" android:gravity="center" android:padding="3dip" /> </TableRow> <View android:layout_height="2dip" android:background="#000000" /> <TableRow> <TextView android:layout_column="1" android:text="Monthly Income:" android:typeface="sans" android:textSize="10sp" android:textColor="#000000" android:gravity="center" android:padding="3dip" /> <TextView android:text="$0.00 USD" android:typeface="sans" android:textSize="10sp" android:textColor="#000000" android:gravity="center" android:padding="3dip" /> </TableRow> <View android:layout_height="2dip" android:background="#000000" /> <TableRow> <TextView android:layout_column="1" android:text="Annual Income:" android:typeface="sans" android:textSize="10sp" android:textColor="#000000" android:gravity="center" android:padding="3dip" /> <TextView android:text="$0.00 USD" android:typeface="sans" android:textSize="10sp" android:textColor="#000000" android:gravity="center" android:padding="3dip" /> </TableRow> </TableLayout> ```
Does TableLayout have Borders?
CC BY-SA 3.0
null
2011-06-21T01:12:35.480
2011-06-21T01:27:30.300
null
null
null
[ "android", "android-layout", "tablelayout" ]
6,419,463
1
null
null
1
4,100
I'm trying to display a set of data in a Grid style, using a TableLayout inside a ListView. What I want is to display each row with a different color (two colors alternatively). It works well when using a normal LinearLayout in the ListView, but for whatever reason when using a TableLayout I end up having all rows having the same background, which I think is the last one set. For this, I am using a BaseAdapter, and in the getView function I have something like: ``` public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.list, parent, false); holder = new ViewHolder(); holder.from = (TextView) convertView.findViewById(R.id.from); holder.to = (TextView) convertView.findViewById(R.id.to); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } if(position%2==0) { convertView.setBackgroundColor(R.color.cell_background); } //alternate background else { convertView.setBackgroundColor(R.color.cell_background_alternate); } // Bind the data efficiently with the holder. holder.from.setText(list.get(position)[0]); holder.to.setText(list.get(position)[1]); return convertView; } ``` Now in my main.xml for the activity, I just have a ListView. In the list.xml used to inflate the list, I have: ``` <?xml version="1.0" encoding="utf-8"?> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TableRow android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/from" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:layout_weight="1"/> <TextView android:id="@+id/to" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="left" android:layout_weight="1"/> </TableRow> </TableLayout> ``` Also, another problem is that the columns are not aligned: it just takes as much space as it needs for every row, every columns, when a TableLayout should align all columns. The only workaround that I came up with was to set a minimal width for the columns, but that's not pretty. Any reason why it does not work here? Edit 21/06: ![cell not aligned](https://i.stack.imgur.com/7eYIl.png) As you can see on the picture, the columns are not aligned (row 2 and 3 are but it's obviously because they have the same data inside).
Android: alternate background color in a TableLayout inside a ListView
CC BY-SA 3.0
null
2011-06-21T01:40:16.270
2012-05-30T06:17:15.270
2011-06-21T09:44:53.240
517,193
517,193
[ "android", "listview", "background-color", "tablelayout", "alternate" ]
6,419,561
1
6,420,295
null
1
764
![enter image description here](https://i.stack.imgur.com/qD5Cq.png) above is the image of appstats of a single GET request to my app, ![enter image description here](https://i.stack.imgur.com/cvRp6.png) this image shows the RPC traces of a single logservice RPC do the number of loservice calls effect the app negatively, for 5 urlfetch RPC's there are around 80 logsservice RPC's while using a backend. i dont know the reason for these logservice rpc calls, how do i reduce the number of logservice RPC's, in the backends documentation there is limited documentation about logservice ``` logservice.flush() ``` how do i contril log flushing in backends, instead of random logservice calls thanks
How to reduce the logservice RPC's in google app engine backends
CC BY-SA 3.0
0
2011-06-21T01:56:25.033
2011-06-21T04:18:53.780
null
null
544,102
[ "google-app-engine", "rpc", "backend" ]
6,419,606
1
6,419,646
null
6
3,478
I'm trying to create a set of custom file templates for IntelliJ. I basically want to go right-click, "New > My File Template" similar to the "New > Java Class" bundled with IntelliJ. I've added my own custom file template via "Settings > File Templates", but they don't appear in my "New" context menu. This is a Java project, and my templates extension is java. Am I missing something? All help greatly appreciated. ![enter image description here](https://i.stack.imgur.com/hv6mG.png) No My Template >>> ![enter image description here](https://i.stack.imgur.com/freWD.png)
IntelliJ IDEA - New Template
CC BY-SA 3.0
0
2011-06-21T02:05:52.003
2012-10-05T20:03:47.077
null
null
244,360
[ "intellij-idea" ]
6,419,840
1
6,419,998
null
1
443
![text fields show inset shadow on Mac, but not on PC](https://i.stack.imgur.com/7tB3J.jpg) I'm trying to standardize the appearance of my text fields and textarea. Below is an image of how my form fields display on Mac, but the textarea displays without the inset shadow. On Windows, the text fields and textarea display the same. I've tried various CSS combinations to standardize them, with no luck. I'm fine with either the inset version or the non-inset version. In case this helps anyone, the form is a WordPress Gravity Form.
Form field renders differently on Mac
CC BY-SA 3.0
null
2011-06-21T02:52:06.270
2011-06-21T04:52:23.273
null
null
318,090
[ "css", "forms", "cross-browser", "field" ]
6,420,255
1
6,420,432
null
2
2,853
I'm having an issue in IE only with a background image for an element in a flexible/fluid layout. Basically, I need the background image (which is 1px by 1px) to tile vertically. When the layout is at full width, the background image sits at from the left which when converted to percentages equals (`676px divide by it's container of 958px`). This in , and however any of the 's (6,7 and 8). The background position only seems to work when the percentage is a full number and not a fraction ie. Background position changes when set to 70% or 71% and so on. Here is what I have and how it appears in the browsers: ``` background:url(link/to/image.gif) repeat-y 70.6680584551148% 0;/*676px/958px*/ ``` I also tried setting the background position as separate X and Y values (same result though): ``` background-position-x:70.6680584551148%;/*676px/958px*/ background-position-y: 0; ``` (v3.6.3): ![enter image description here](https://i.stack.imgur.com/tcxFV.png) (12.0.742.100): ![enter image description here](https://i.stack.imgur.com/WllUz.png) (5.0.2): ![enter image description here](https://i.stack.imgur.com/U6oH0.png) (6, 7 and 8 - all the same result): ![enter image description here](https://i.stack.imgur.com/lDu5q.png) So , is this just an IE problem where the browser can not calculate a percentage that is not whole? Or, is there a fix or something I am missing?
IE (bug) percentages with background-position
CC BY-SA 3.0
null
2011-06-21T04:10:43.497
2015-01-06T09:28:46.643
2015-01-06T09:28:46.643
258,400
605,812
[ "css", "internet-explorer", "background-position" ]
6,420,813
1
6,420,912
null
21
63,868
I can not set the width of bound field. Is there any problem in the following markup. ``` <asp:BoundField DataField="UserName" HeaderText="User Name" meta:resourcekey="BoundFieldUNCUserNameResource1"> <HeaderStyle Width="50%" /> </asp:BoundField> ``` ![enter image description here](https://i.stack.imgur.com/LLkzH.png) Please refer to the image. I set width using the following. The yellow colored numbers are corresponding width. The marked user name is always Wrapped even I set a width to a large value (say 50%) and set Wrap="false". ``` <HeaderStyle Width="20%" Wrap="true" /> <ItemStyle Width="20%" Wrap="true" /> ```
width of grid view boundfield
CC BY-SA 3.0
0
2011-06-21T05:39:16.517
2020-06-29T21:00:04.247
2013-12-06T05:26:27.167
1,459,996
767,445
[ "asp.net", "gridview", "boundfield" ]
6,420,877
1
6,420,915
null
-1
161
![enter image description here](https://i.stack.imgur.com/XU2js.png) i got memoery leak at that multidimensional mutable array i need to remove those leak because due to this leak app is not working in iphone,i dnt how remove this leak > CGRect bounds =[self bounds]; ``` UITouch* touch = [[event touchesForView:self] anyObject]; if (firstTouch) { firstTouch = NO; previousLocation = [touch previousLocationInView:self]; previousLocation.y = bounds.size.height - previousLocation.y; NSMutableArray *temp=[[NSMutableArray alloc]init]; [undo addObject:temp]; /***** add 1st point *********/ [[undo objectAtIndex:[undo count] -1] addObject:[NSValue valueWithCGPoint:previousLocation]]; if(mcount==1) { [masking addObject:[[NSMutableArray alloc]init]]; [[masking objectAtIndex:[masking count]-1] addObject:[NSValue valueWithCGPoint:previousLocation]]; } } else { location = [touch locationInView:self]; location.y = bounds.size.height - location.y; previousLocation = [touch previousLocationInView:self]; previousLocation.y = bounds.size.height - previousLocation.y; [[undo objectAtIndex:[undo count] -1]addObject:[NSValue valueWithCGPoint:previousLocation]]; if(mcount==1) { [[masking objectAtIndex:[masking count]-1] addObject:[NSValue valueWithCGPoint:previousLocation]]; } } ```
Memory leak using multidimensional Array
CC BY-SA 3.0
0
2011-06-21T05:45:50.050
2011-06-23T05:02:55.307
2011-06-23T05:02:55.307
615,960
615,960
[ "iphone" ]
6,421,036
1
6,421,228
null
11
16,018
I want my activity to take smaller area of the screen e.g. toast doesn't cover all of the screen, it is just shown over other things and rest of the contents can be seen behind the toast. But it's a dialog, and I want my screen to be shown above other things e.g. above Home Screen. Below is the idea that is in my mind. ![Activity Taking Smaller Area of the Screen](https://i.stack.imgur.com/MDQ92.jpg) Kindly, guide me if it is even possible. If possible then show me the right path. Thanks.
How to make Activity, not covering full screen
CC BY-SA 3.0
0
2011-06-21T06:07:03.683
2018-11-17T17:00:32.400
null
null
559,090
[ "android", "android-layout", "android-manifest" ]
6,421,437
1
6,421,502
null
3
2,034
This is my query. That show me results as described in the screen shot. Now i want to change it so it show me statues of the month in columns. ``` DECLARE @temp TABLE ( MonthName VARCHAR(10), [Year] VARCHAR(10), StatusTypeId INT, StatusTypeName VARCHAR(50), StatusCount INT ) INSERT INTO @temp SELECT CONVERT(varchar(3), DATENAME(month, w.ExpectedStartDate)) as MonthName, datepart(yyyy, w.ExpectedStartDate) as [Year], w.StatusTypeId, st.StatusTypeName, COUNT(ISNULL(w.StatusTypeId, 0)) AS StatusCount FROM Worksheet w LEFT OUTER JOIN StatusType st ON st.StatusTypeId = w.StatusTypeId WHERE w.ProjectId = 20 AND CONVERT(varchar(3), DATENAME(month, w.ExpectedStartDate)) between ('feb') AND ('mar') GROUP BY datepart(yyyy, w.ExpectedStartDate), CONVERT(varchar(3), DATENAME(month, w.ExpectedStartDate)), w.StatusTypeId, st.StatusTypeName SELECT ISNULL(((CONVERT(VARCHAR(5), [Year])) + '-' + MonthName), 'Unknown') AS MonthName, ISNULL(StatusTypeName, 'Unknown') AS StatusTypeName, StatusCount FROM @temp ``` I think this image will describe well what i need. ![enter image description here](https://i.stack.imgur.com/iZDbE.png) Please let me know how can i sort it by month name.. eg. Jan, feb, mar, jun, dec. etc Thanks.
convert one row into columns
CC BY-SA 3.0
null
2011-06-21T06:49:10.597
2011-06-21T08:49:33.267
null
null
776,216
[ "sql-server", "sql-server-2005" ]
6,421,461
1
6,421,725
null
6
983
What is the best HTML5 element to use when tagging meta data for a blog post? - Posted by John Doeon Dec 12thin DesignLeave a Comment ![enter image description here](https://i.stack.imgur.com/ZGVLi.png)
what is the best HTML5 element to use when tagging meta data for a blog post?
CC BY-SA 3.0
null
2011-06-21T06:51:45.903
2021-10-19T00:27:48.520
2011-06-21T14:56:50.380
666,434
666,434
[ "html" ]
6,421,813
1
6,422,236
null
0
2,202
I've seen from other posts that there are memory leaking issues with UIWebView. However, with the amount of objects that I have leaking, I have to wonder if I'm doing something wrong. 'Leaks' reports about 60 leaks for opening a UIWebView, loading a page and closing (it's the Facebook login page). I've check the stack trace for every one of these objects, and they never touch my code. They're all either in a separate thread (I only use the main thread), or go from 'main' to a bunch of internal methods that are greyed out. Is this expected from UIWebView? I'm running the latest firmware, and I think they would have fixed this by now. I'm seeing this on the device, by the way. I also tried checking for bugs on the apple site, but there's no way to search other than by issue ID..? Shaun Here's a capture of the leaks: ![enter image description here](https://i.stack.imgur.com/Lhd3N.gif)
(lots of) UIWebView memory leaks
CC BY-SA 3.0
0
2011-06-21T07:29:39.957
2017-09-20T16:11:09.347
null
null
244,968
[ "iphone", "memory-leaks", "uiwebview" ]
6,421,933
1
6,422,028
null
0
91
I have this script that work with no problems on my XAMPP local host: ``` <html> <head> <title>Gallery</title> <style type="text/css"> body { margin: 0 auto; padding: 0; width: 500px; color: #000000; position: relative; } .gallery { list-style: none; margin: 0; padding: 0; } .gallery li { margin: 10px; padding: 0; float: left; width: 120px; height: 100px; } .gallery img { background: #fff; border: solid 1px #ccc; padding: 4px; width: 110; height: 90; } .gallery a:hover img {border: 1px solid #0000ff; position: absolute; top: 0; left: 0; width:400; height:300; } </style> </head> <body> <ul class="gallery"> <?php //header("Content-type: image/jpg;\n"); $db_connect = mysql_connect('localhost', 'Beta_tester', 'alfa1gama2'); if(!$db_connect) { die('Не може да се осъществи връзка с базата данни' . mysql_error()); } mysql_select_db("Beta_tester", $db_connect); $rs = mysql_query('SELECT * FROM gallery WHERE oferta_id=2'); while($row = mysql_fetch_array($rs)) { echo '<li><a target="_blank" href="http://mysite/fimage.php?id='.$row['id'].'"><img src='.$row['location'].' alt="image"/></a></li>'; } ?> </ul> </body> </html> ``` On my local server it's ok, but when I upload it on the production server i get this output: Pic1: ![enter image description here](https://i.stack.imgur.com/eznv4.gif) It's not shown very good but this is just an empty block with an icon of broken image.The head(content) is commented - I added it later because I saw a similar problem solved with this, but maybe I'm using it wrong or maybe it's something else. Thanks Leron
Image doesn't show when script is running on production server
CC BY-SA 3.0
null
2011-06-21T07:42:45.017
2012-05-04T11:58:57.483
null
null
649,737
[ "php" ]
6,422,399
1
6,423,359
null
3
15,650
I am using EISK (Employee Info Starter Kit) to develop an application. My entity diagram looks like this ![Entity Diagram](https://i.stack.imgur.com/qOEuW.jpg) I try to update the application table via this code. ``` int apId = Convert.ToInt32(Request.QueryString["ApplicationID"]); ApplicationBLL objGetApplication = new ApplicationBLL(); Appdec.YEP.BusinessEntities.Application objApplication = objGetApplication.GetApplicationByApplicationID(apId); objApplication.Status = (ddlStatus.SelectedValue == "0" ? false : true); new ApplicationBLL(new Appdec.YEP.DataAccessLayer.DatabaseContext()).UpdateApplication(objApplication); ``` now the update method at bussiness logic is ``` [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Update, true)] public void UpdateApplication(Application updatedApplication) { // Validate Parameters if (updatedApplication == null) throw (new ArgumentNullException("updatedApplication")); // Validate Primary key value if (updatedApplication.ApplicationID.IsInvalidKey()) BusinessLayerHelper.ThrowErrorForInvalidDataKey("ApplicationID"); // Apply business rules OnApplicationSaving(updatedApplication); OnApplicationUpdating(updatedApplication); //attaching and making ready for parsistance if (updatedApplication.EntityState == EntityState.Detached) _DatabaseContext.Applications.Attach(updatedApplication); _DatabaseContext.ObjectStateManager.ChangeObjectState(updatedApplication, System.Data.EntityState.Modified);//this line throws the error //ObjectStateManager does not contain an ObjectStateEntry with a reference to an object of type int numberOfAffectedRows = _DatabaseContext.SaveChanges(); if (numberOfAffectedRows == 0) throw new DataNotUpdatedException("No application updated!"); //Apply business workflow OnApplicationUpdated(updatedApplication); OnApplicationSaved(updatedApplication); } ``` Can somebody tell me how to fix this error and update the tables. the same error ocurres when i try to update other tables also. The insert works fine. Hoping not to bother you. Best Regards.
ObjectStateManager does not contain an ObjectStateEntry with a reference to an object of type
CC BY-SA 3.0
null
2011-06-21T08:28:51.557
2020-08-18T19:09:06.777
2020-08-18T19:09:06.777
79,739
2,532,106
[ "c#", "asp.net", "entity-framework", "entity", "eisk" ]
6,422,705
1
null
null
3
62
I will implement a game in which the ball must move across the screen, and its board should reflect that. Example: [http://itunes.apple.com/us/app/blocksclassic/id286136632?mt=8](http://itunes.apple.com/us/app/blocksclassic/id286136632?mt=8) Only in my case the board in the shape of a trapezoid ![enter image description here](https://i.stack.imgur.com/2BNjZ.png) If the ball hits the side of the trapeze, he should rebound in the direction of 180 degrees. Which way do I implement it? Thank you in advance if you need something clarified please ask questions.
The implementation of the game on Iphone
CC BY-SA 3.0
null
2011-06-21T08:54:51.960
2011-06-21T10:28:01.423
2011-06-21T08:57:50.620
914
718,016
[ "iphone", "frame" ]
6,422,760
1
null
null
-3
108
> [convert one row into columns.](https://stackoverflow.com/questions/6421437/convert-one-row-into-columns) This is my query. ``` DECLARE @temp TABLE ( MonthName VARCHAR(10), [Year] VARCHAR(10), StatusTypeId INT, StatusTypeName VARCHAR(50), StatusCount INT ) INSERT INTO @temp SELECT CONVERT(varchar(3), DATENAME(month, w.ExpectedStartDate)) as MonthName, datepart(yyyy, w.ExpectedStartDate) as [Year], w.StatusTypeId, st.StatusTypeName, COUNT(ISNULL(w.StatusTypeId, 0)) AS StatusCount FROM Worksheet w LEFT OUTER JOIN StatusType st ON st.StatusTypeId = w.StatusTypeId WHERE w.ProjectId = 20 AND CONVERT(varchar(3), DATENAME(month, w.ExpectedStartDate)) between ('feb') AND ('mar') GROUP BY datepart(yyyy, w.ExpectedStartDate), CONVERT(varchar(3), DATENAME(month, w.ExpectedStartDate)), w.StatusTypeId, st.StatusTypeName SELECT ISNULL(((CONVERT(VARCHAR(5), [Year])) + '-' + MonthName), 'Unknown') AS MonthName, ISNULL(StatusTypeName, 'Unknown') AS StatusTypeName, StatusCount FROM @temp ``` I want result like this.![enter image description here](https://i.stack.imgur.com/gVdgt.png) Please guide me. Thanks.
how to use PIVOT to get required results
CC BY-SA 3.0
null
2011-06-21T08:58:51.003
2011-06-21T09:33:35.083
2017-05-23T10:30:21.980
-1
776,216
[ "sql", "sql-server", "sql-server-2005" ]
6,422,955
1
null
null
-1
165
![enter image description here](https://i.stack.imgur.com/nR9et.jpg) ``` http://www.idcspy.com/asp-hosting.html ``` when loads over the page , at the bottom of the IE broswer window. it shows an alert(the page has an error), it's an javascript error.but i don't know which js file has the error in and how to correct it. thank you,
which file is the js error in and how to correct it?
CC BY-SA 3.0
null
2011-06-21T09:15:28.230
2011-06-22T00:56:34.990
2011-06-22T00:56:34.990
698,574
698,574
[ "javascript", "jquery" ]
6,422,960
1
6,423,256
null
2
1,592
I've been trying to do this for a good few days now but to no avail. I've kind of got myself into a muddle too. Now I'm really confused how I should approach this. Where to start in a new .h and .m file. :/ My goal is to put a UITextField in a few UITableViewCell. Just like this: ![enter image description here](https://i.stack.imgur.com/y1kvd.png) and this: ![enter image description here](https://i.stack.imgur.com/3GAk7.jpg) Can somebody assist me with some kind of tutorial? Thanks.
A UITextField in a UITableViewCell
CC BY-SA 3.0
0
2011-06-21T09:15:54.467
2011-06-21T09:40:28.273
null
null
735,746
[ "iphone", "xcode", "uitableview", "uitextfield" ]
6,423,165
1
6,459,705
null
0
3,076
I've been tasked with fixing a bug in our product for Safari 5.05 for OSX where a loaded preview of another page (iframe) isn't scaled properly. What's odd is that it works in Safari for windows, aswell as Safari for the ipad. The iframe is cut in half on OSX, and changing the width of the wrapper div really doesn't do any good. If I change scale to 1, or remove the -webkit-transform from css, the iframe is fully rendered (but not scaled down). How it looks in just about any browser except OSX Safari 5.05: How it looks in Safari on Windows and iPad and just about any version of Chrome: ![enter image description here](https://i.stack.imgur.com/KbpJf.png) And the OSX Safari version: ![enter image description here](https://i.stack.imgur.com/PboA5.png) ``` <div id="newsletterPreview" class="scaleDownPreview" style="-webkit-transform: translate(-157px, -267px) scale(0.6); "> <iframe style="width: 1338.3333333333335px; height: 1333px; " frameborder="0" src="controls/NewsletterPreview.ashx?skipIframe=true"> [bla bla bla] </iframe> </div> .scaleDownPreview { zoom: 0.6; } ``` Any suggestions?
-webkit-transform: scale() not displaying properly in OSX Safari
CC BY-SA 3.0
null
2011-06-21T09:33:10.440
2011-06-23T19:41:50.180
2011-06-21T13:06:00.087
16,511
674,626
[ "html", "macos", "safari", "css", "scaling" ]
6,423,400
1
6,423,497
null
0
1,123
I have a problem with data. I have a class where I have setters and getters. Using curl I need to show data and others things. I am using jetty server. This is code from my class which I use to get data: ``` @DateTimeFormat(iso = ISO.DATE_TIME) public Date getDate() { return date; } @DateTimeFormat(iso = ISO.DATE_TIME) public void setDate(Date date) { this.date = date; } ``` and this is results: ![enter image description here](https://i.stack.imgur.com/4OuLF.jpg) This is what I get in console: [{"createdAt":1308649398723,"period":0,"date":1308649398723,"updatedAt":null,"id":null}] I would like to know how I can change data format on YYYY-MM-DD-HH-MM-SS. I add : ``` public void setDate(Date date) { this.date = date; } @Target( { ElementType.METHOD, ElementType.FIELD, ElementType.PARAMETER }) @Retention(RetentionPolicy.RUNTIME) public @interface DateTimeFormat { String style() default "SS"; org.springframework.format.annotation.DateTimeFormat.ISO iso() ; String pattern() default ""; public enum ISO { DATE, TIME, DATE_TIME, NONE } } ``` and change ``` @DateTimeFormat(iso = ISO.DATE_TIME,,pattern="M/d/yy h:mm a") public Date getDate() { return date; } @DateTimeFormat(iso = ISO.DATE_TIME,,pattern="M/d/yy h:mm a") public void setDate(Date date) { this.date = date; } ``` and still not working
Spring and problem with data
CC BY-SA 3.0
null
2011-06-21T09:52:16.787
2011-06-21T10:11:57.470
2011-06-21T10:11:57.470
705,544
705,544
[ "java", "spring", "curl" ]
6,423,412
1
6,423,454
null
0
2,410
Using ASIHTTP, the code below is in the ImageDownloader class. I get a memory leak, which is added at the bottom, but I don't know why. I thought tempImage would be autoreleased without me doing anything? ``` - (void)requestFinished:(ASIHTTPRequest *)request { UIImage *tempImage = [UIImage imageWithData:[request responseData]]; if (tempImage.size.width > 250.0f && tempImage.size.height > 180.0f) { self.image = tempImage; self.circleImage = [UIImage imageNamed:@"hover.png"]; if ([self.delegate respondsToSelector:@selector(addImageToModel:)]) [self.delegate addImageToModel:self]; } else { if ([self.delegate respondsToSelector:@selector(badImage)]) [self.delegate badImage]; } tempImage = nil; } ``` ![Stack trace from Instruments](https://i.stack.imgur.com/Rcog6.png)
UIImage imageWithData memory leak
CC BY-SA 3.0
null
2011-06-21T09:52:46.403
2011-06-21T13:17:13.480
null
null
196,555
[ "iphone", "memory-leaks", "uiimage" ]
6,423,626
1
6,423,853
null
0
1,016
one small issue in my movieplayer..![movieplayer shows like this] [1](https://i.stack.imgur.com/DTIll.png): [http://i.stack.imgur.com/WujxB.png](https://i.stack.imgur.com/WujxB.png) but i want to show as below screenshot![Want to show like this ](https://i.stack.imgur.com/DTIll.png) mycode: ``` moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:videoURL]; moviePlayerController.view.frame = CGRectMake(0,0,320,460); moviePlayerController.fullscreen = YES; [self.view addSubview:moviePlayerController.view]; [moviePlayerController play]; ```
mpmovieplayercontroller issue
CC BY-SA 3.0
null
2011-06-21T10:11:54.063
2012-11-20T18:19:43.290
2011-06-21T10:23:17.507
41,761
756,857
[ "iphone", "movieplayer" ]
6,423,706
1
6,423,751
null
11
7,964
I need to create dialog with both ListView and message, however according to [http://code.google.com/p/android/issues/detail?id=10948](http://code.google.com/p/android/issues/detail?id=10948) it is not possible with standard AlertDialog. So I've decided to create custom view with text and listview, and attach it to dialog. However, my list view is drawn empty. Here is java code: ``` AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Hello, title!"); LayoutInflater factory = LayoutInflater.from(this); View content = factory.inflate(R.layout.dialog, null); ListView lv = (ListView) content.findViewById(R.id.list); lv.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_single_choice, ITEMS)); lv.setChoiceMode(ListView.CHOICE_MODE_SINGLE); builder.setView(content).setPositiveButton("OK", this).setNegativeButton("Cancel", this); AlertDialog alert = builder.create(); alert.show(); ``` Also I have: ``` final String[] ITEMS = new String[] { "a", "b", "c" }; ``` and here is dialog layout: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello, text!" /> <ListView android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/list" ></ListView> </LinearLayout> ``` Here is result: ![dialog_with_empty_list_view](https://i.stack.imgur.com/9BHWR.jpg) Any help is greatly appreciated. Thanks!
Dialog with list view and message
CC BY-SA 3.0
0
2011-06-21T10:17:54.260
2011-06-21T10:24:45.627
null
null
227,024
[ "android", "listview", "dialog", "android-alertdialog" ]
6,423,869
1
6,424,008
null
1
164
This is my code that attempts to make grid but outputs the following: ![enter image description here](https://i.stack.imgur.com/22EzE.jpg) No doubt this not a grid. I am unable to detect where i have got my logic wrong. I have highlighted the part responsible for drawing. ``` import javax.swing.*; import java.awt.*; class tester1 extends JPanel { tester1() { setPreferredSize(new Dimension(400,400)); this.setBackground(Color.black); JFrame fr = new JFrame(); fr.add(this); fr.pack(); fr.setVisible(true); fr.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); repaint(); } public void paintComponent(Graphics g) { // <----- part responsible for drawing g.setColor(Color.red); for(int x = 0 ; x <= 400 ; x += 10 ) { g.drawLine( x , 0 , 400 , x ); } for(int y = 0 ; y <= 400 ; y += 10 ) { g.drawLine( y , 0 , y , 400 ); } } // <---- till here public static void main(String args[]) { new tester1(); } } ``` What mistake have I made in `paintComponent` method ? Also in the output why don't I get color as the background, when I have written `this.setBackground(Color.black)`?
problem getting the grid right and no background Color
CC BY-SA 3.0
null
2011-06-21T10:32:12.527
2011-06-21T11:00:08.360
2011-06-21T10:55:12.663
513,838
648,138
[ "java", "swing", "graphics", "2d" ]
6,424,115
1
6,439,997
null
0
1,276
I am using HTTPService component to call the webservice. I am getting the result in resulthandler but result type is objectProxy. I want to convert them to my value objects which I generated using Data/Service of Flash builder. ![enter image description here](https://i.stack.imgur.com/ip6n2.jpg) I am not able to access the ConnectUserAccess (as shown in attached image) as the Value Object. ``` var hs:HTTPService = new HTTPService(); var url:String = ConfigManager.getProperty("user.project.acess"); hs.method = "GET"; hs.url = url; hs.resultFormat = "object"; var params:Object = {}; params["User_Name"] = "madhur"; hs.addEventListener(ResultEvent.RESULT, getProjectsAccessHandler); hs.addEventListener(FaultEvent.FAULT, getProjectFaultHandler); hs.send(params); private function getProjectsAccessHandler(event:ResultEvent):void{ var connect:ConnectUserAccess = event.result.ConnectUserAccess; } ```
How to map objectProxy Returned by HTTPService to valueobjects
CC BY-SA 3.0
null
2011-06-21T10:53:13.290
2011-06-22T12:41:14.380
null
null
597,983
[ "apache-flex", "actionscript", "air", "httpservice" ]
6,424,128
1
6,424,216
null
0
846
I have successfully implemented a UITextField in a UITableViewCell. Just like this: ![enter image description here](https://i.stack.imgur.com/WkelB.png) . I did the above using code in: `- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath`. Now I would like to place a UIButton underneath these 2 UITableViewCells. Can I code a UIButton in? How can I do this and where? Thanks. ![enter image description here](https://i.stack.imgur.com/Yf66K.png) ![enter image description here](https://i.stack.imgur.com/EBpLr.png)
A UITextField in a UITableViewCell - UIButton
CC BY-SA 3.0
null
2011-06-21T10:54:06.687
2011-06-21T16:02:07.630
2011-06-21T16:02:07.630
735,746
735,746
[ "iphone", "uitableview", "uibutton", "uitextfield" ]
6,424,225
1
6,428,103
null
1
1,303
How to Remove Toolbar from `QToolBox` in Qt? Normal Toolbox looks like this: ![enter image description here](https://i.stack.imgur.com/k3SpV.png) I want to remove this button written with Page 1. Something like this : ![enter image description here](https://i.stack.imgur.com/6Bfzn.png)
How to Remove Toolbar from QToolBox control in Qt?
CC BY-SA 3.0
null
2011-06-21T11:01:34.443
2012-12-04T10:06:38.267
2012-12-04T10:06:38.267
867,349
662,285
[ "qt", "qt-designer" ]
6,424,362
1
6,425,051
null
1
897
I am trying to use a gridsplitter to resize the grid rows, but I don't get the behaviour which I expected. ``` <Grid x:Name="LayoutRoot" Background="White" Width="300"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <StackPanel Grid.Row="0"> <StackPanel Orientation="Horizontal"> <TextBlock Height="23" Text="Inventory:"/> </StackPanel> <sdk:DataGrid AutoGenerateColumns="False" Height="Auto" Name="dataGrid1" HorizontalAlignment="Left" IsReadOnly="True" > <sdk:DataGrid.Columns> <sdk:DataGridTextColumn Binding="{Binding Name}" CanUserReorder="True" CanUserResize="True" CanUserSort="True" Width="Auto" Header="Name" IsReadOnly="True" /> <sdk:DataGridTextColumn Binding="{Binding CreatedDate}" Header="Created Date" /> <sdk:DataGridTextColumn Binding="{Binding ChangedDate}" Header="Last Edited" /> </sdk:DataGrid.Columns> </sdk:DataGrid> </StackPanel> <sdk:GridSplitter Grid.Row="1" Height="10" Width="300" HorizontalAlignment="Stretch"/> <Grid Grid.Row="2"></Grid> </Grid> ``` Before move of splitter ![enter image description here](https://i.stack.imgur.com/bTBB8.jpg) After move of splitter ![enter image description here](https://i.stack.imgur.com/aP8aU.jpg) I would like the datagrid to resize it's content, in which a scrollbar should be present when resizing it.
silverlight resize datagrid datagridsplitter
CC BY-SA 3.0
null
2011-06-21T11:14:03.463
2011-06-21T12:14:33.663
null
null
630,973
[ "silverlight", "datagrid", "resize" ]
6,424,384
1
null
null
4
1,754
I have three images: ![enter image description here](https://i.stack.imgur.com/r5Afy.png) ![enter image description here](https://i.stack.imgur.com/Um1ZD.png) ![enter image description here](https://i.stack.imgur.com/pI5ig.png) I've aligned them spatio-temporally to the best of my ability. I want to detect where the differences (the caption, the RT logo) are. Simple image difference (followed by thresholding, etc) doesn't work here for a couple of reasons: - - Here's the plain image difference between the first two images (using GIMP): ![enter image description here](https://i.stack.imgur.com/0fdMy.png) Any ideas?
Detecting image differences
CC BY-SA 3.0
0
2011-06-21T11:17:14.160
2011-06-21T12:20:25.147
null
null
356,020
[ "image-processing" ]
6,424,499
1
null
null
1
216
I am working with jquery UI tabs to make a tabbed navigation. It has active and hover both stages when the background color should be white. I managed to get this ok, but when I'm hovering the element right beside the current element, a small portion of my arrows' background isn't changing to white but staying blue. You'll understand the program when you see the demo that I'm working on here: [http://arbabpolypackltd.com/erdem/](http://arbabpolypackltd.com/erdem/) . It is supposed to look like this: ![enter image description here](https://i.stack.imgur.com/NpMjh.png) . Please help!! thanks!
Hover and current state with overlapping images?
CC BY-SA 3.0
null
2011-06-21T11:27:19.503
2011-06-21T11:40:41.037
2011-06-21T11:32:43.663
287,047
2,276,736
[ "javascript", "jquery", "css", "navigation" ]
6,424,800
1
10,758,979
null
31
18,754
In my Eclipse installation, the selected entry in the content assist menu is almost unreadable because the colour is white on white-greyish. See image below. ![Highlighted entry unreadable](https://i.stack.imgur.com/fjHOJ.png) I can change the background and text colour of the non-selected entries in the list from eclipse preferences, but the selected entry is always the same colour and is always unreadable. I use the [Eclipse Color Theme](http://www.eclipsecolorthemes.org/) [RecognEyes](http://www.eclipsecolorthemes.org/?view=theme&id=30), but that should only affect the editor as far as I understand. After reading [m1shk4's answer](https://stackoverflow.com/questions/6424800/the-selected-entry-in-eclipse-content-assist-is-unreadable-because-of-colours/6464861#6464861) it does indeed seem that Eclipse takes it's colours from the current gnome theme. However it does this in a kind of weird way. The background colour of the content assist "window" is the input boxes background colour, and the text colour is the input boxes text colour. This all seems logical. However the background colour of the selected entry is the windows background colour, but the text of the selected entry is the background text colour. See image below for an illustration. ![Color mapping from gnome theme to eclipse](https://i.stack.imgur.com/Ho5rS.png) It seems this issue is rather specific with the default gnome theme in Ubuntu. Switching to another gnome theme solves the issue for me.
The selected entry in Eclipse content assist is unreadable because of colours
CC BY-SA 3.0
0
2011-06-21T11:53:43.023
2017-11-03T00:05:45.793
2017-05-23T12:00:17.993
-1
81,398
[ "eclipse", "colors", "menu", "editor" ]
6,424,973
1
6,425,047
null
0
399
I am setting up one git client on Mac (Using Source Tree). While committing the code it is showing the following error(please check the screen-shot). Any idea to solve this error ? ERROR : ![enter image description here](https://i.stack.imgur.com/UGcDv.png)
Git Problem in Mac (Fatal Error)
CC BY-SA 3.0
0
2011-06-21T12:08:46.393
2011-06-21T12:20:33.373
null
null
380,277
[ "iphone", "ios", "xcode", "git", "macos" ]
6,425,098
1
6,436,578
null
0
572
Hey guys I have a box shadow on a div. ``` #overviewDiv { -webkit-box-shadow:0 40px 40px -40px #AAA; -moz-box-shadow:0 40px 40px -40px #AAA; box-shadow:0 40px 40px -40px #AAA; } <div id="overviewDiv" > <br /> <table class="display" id="pkgLineTable" > <thead> <tr> <th style="width:120px">&{'views.overview.location'}</th> <th style="width:200px">&{'views.overview.linename'}</th> <th style="width:200px">&{'views.overview.description'}</th> <th style="width:200px">&{'views.overview.linestatus'}</th> </tr> </thead> </table> </div> ``` The box shadow looks fine normally with 10 rows or so but if not it doesn't display right. ![enter image description here](https://i.stack.imgur.com/mpkzm.png) In this picture the shadow is way under the table. I'm not sure what to do to fix this. Thanks for any help. [http://jsfiddle.net/jZvqe/7/](http://jsfiddle.net/jZvqe/7/)
Problem with box-shadow on div containing table(height problem)
CC BY-SA 3.0
null
2011-06-21T12:17:52.720
2011-06-22T07:53:00.847
2011-06-21T12:58:57.240
505,075
505,075
[ "javascript", "jquery", "datatables", "css" ]
6,425,185
1
6,690,428
null
5
733
I have created a custom Rewrite Provider for IIS 7 following instructions in this article: [Developing a Custom Rewrite Provider for URL Rewrite Module](http://learn.iis.net/page.aspx/804/developing-a-custom-rewrite-provider-for-url-rewrite-module) To simplify deployment, I have created a VS2010 Setup Project and configured it to deploy my assembly to GAC. ![enter image description here](https://i.stack.imgur.com/lL2hI.png) When I run the installer, it completes successfully, and to be registered the assembly in GAC (I have verified using ). However, when I go to IIS Manager to register the new rewrite provider it is not displayed in the list of available providers. I have also tried to install the assembly manually using . This does work and makes assembly visible in the list of available providers in IIS Manager. Am I missing some sort of configuration in my Setup Project?
Setup Project is not correctly registering assembly in GAC
CC BY-SA 3.0
0
2011-06-21T12:25:29.807
2011-07-14T08:27:30.017
2011-06-21T14:11:44.213
169
169
[ ".net-3.5", "iis-7", "url-rewriting", "setup-project", "gac" ]
6,425,293
1
6,425,358
null
2
370
I have been trying to implement a comment engine in my app (UItableView) but have been facing challenges 1) How can I add the comment in the table cell with the format of "user name" + "comment text" whereby the user can click on the username and the corresponding user profile will appear. The comment text will just be a static data in the cell 2) How can I dynamically calculate the height of all the comments which will eventually lead to the determination the entire cell height? I see that Instagram's comment engine is what I have in mind (see below) ![enter image description here](https://i.stack.imgur.com/cIHJb.jpg) Can anyone advise me on how I can implement the comment engine like Instagram? I have tried to subclass a UIControl and add a UILabel (as a property to it). But this approach seems a little confusing and inflexible. So any advise on this will be greatly appreciated.
Objective C: Simplest way of implementing multiple actions in a paragraph of text (like comments)
CC BY-SA 3.0
0
2011-06-21T12:34:18.107
2011-06-21T21:49:46.837
2011-06-21T17:33:23.133
-1
683,898
[ "objective-c", "ios", "uitableview", "comments" ]
6,425,328
1
6,425,471
null
0
175
HTML : ``` <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="generator" content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org"> <meta http-equiv="content-type" content="text/html;charset=utf-8"> <title> Hello </title> <style type="text/css"> div#myDiv { border: 1px solid #bed6f8; background: url(images/image1.gif) no-repeat 5px bottom, #bed6f8 url(images/image2.png) repeat-x; color: #000000; font-weight: bold; } </style> </head> <body> <div id="myDiv"> <br> <br> <br> </div> </body> </html> ``` FireFox : ![enter image description here](https://i.stack.imgur.com/9nEsX.jpg) IE: ![enter image description here](https://i.stack.imgur.com/7uFco.jpg) code related to menu ``` <div id="menu"> <ul class="menu"> <li><a class="leftCornerRound parent menuheader" id="home" href="#"><span>Item 1</span></a> <div> <ul> <li><a class="parent" href="#" id="SubItem1"><span>Sub Item 1</span></a> <div><ul> <li><a class="parent" href="#" id="SubItem1.1"><span>Sub Item 1.1</span></a> <div><ul> <li><a class="ui-widget-header" href="#"><span>Sub Item 1.1.1</span></a></li> <li><a class="ui-widget-header" href="#"><span>Sub Item 1.1.2</span></a></li> </ul></div> </li> . . . . ``` css related to this: ``` div#menu a.parent { border: 1px solid #bed6f8; background: url(images/submenu-pointer-bottom.gif) no-repeat 5px bottom, #bed6f8 url(css/blueSky/images/header.png) repeat-x; color: #000000; font-weight: bold; } div#menu a.parent:hover { border: 1px solid #bed6f8; background: url(images/submenu-pointer-bottom.gif) no-repeat 5px bottom, #c6deff url(css/blueSky/images/default.png) repeat-x; font-weight: bold; color: #000000; } ```
CSS : Two image on one html element in IE
CC BY-SA 3.0
null
2011-06-21T12:37:25.883
2011-07-11T08:53:19.840
2011-06-21T13:15:23.617
555,605
555,605
[ "html", "css" ]
6,425,547
1
6,494,822
null
5
2,609
![enter image description here](https://i.stack.imgur.com/qwtxU.jpg) Ok, in itunesconnect, it says Preview or download your daily and weekly sales information here. but when I click in, I only can preview on the chart? How can I download? if I want to count the total number of downloads for my app, I have to create my own excel and fill in the number everyday myself? thanks
app store - where to download the report of app downloads?
CC BY-SA 3.0
0
2011-06-21T12:55:33.400
2011-06-27T14:57:01.043
2011-06-27T14:29:42.810
19,679
759,076
[ "iphone", "ios", "app-store", "app-store-connect" ]
6,425,678
1
null
null
1
295
this is not yet another "I need a console in my GUI app" that has been discussed quite frequently. My situation differs from that. I have a Windows GUI application, that is run from a command line. Now if you pass wrong parameters to this application, I do want a popup to appear stating the possible switches, but I want that printed into the console that spawned my process. I got that far that I can print into the console (call to AttachConsole(...) for parent process) but the problem is my application is not "blocking". As soon as I start it, the command prompt returns, and all output is written into this window (see attached image for illustration). ![_](https://i.stack.imgur.com/STCLC.png) I played around a bit, created a console app, ran it, and see there, it "blocks", the prompt only re-appears after the app has terminated. Switching my GUI app to /SUBSYSTEM:Console causes strange errors (MSVCRTD.lib(crtexe.obj) : error LNK2019: nonresolved external Symbol "_main" in function "___tmainCRTStartup".) I have seen the pipe approach with an ".exe" and a ".com" file approach from MSDEV but I find it horrible. Is there a way to solve this prettier?
Win GUI App started from Console => print to console impossible?
CC BY-SA 3.0
null
2011-06-21T13:05:20.343
2011-06-29T09:05:30.343
null
null
115,846
[ "winapi", "console-application" ]
6,425,702
1
6,446,631
null
0
4,514
I'm writing an app that requires a TimePicker-based preference (two, actually) and I swiped some (Apache-licensed) code from the [Android Programming Tutorials](http://commonsware.com/AndTutorials/) book. I've modified it to work a little better, but there's one thing puzzling me. I haven't tried it on an actual device yet but on emulators it now takes into account system settings for 24-hour time display, clears focus on the TimePicker dialog so that the time is read even when edited manually instead of using the arrow keys, and - the problematic part - displays the selected time in the PreferenceScreen. The problem is that I've tried this in emulators for API levels 3, 4, 7 and 10 and it only works completely correctly in 10. In the emulators for the earlier versions, if I put a checkbox in the PreferenceScreen with two TimePreferences, the TextViews in the two TimePreferences switch positions every time the checkbox is toggled. So if I click the checkbox the first time the app starts, the start time looks like 10pm and the stop time looks like 8am (even though when I click on the preference, the appropriate time shows up in the TimePicker). Is there a better way to do this? Preferably an elegant way so that the entire class is self-contained and I don't need to create layouts in XML files that are applicable only to the class? Or is there a way to work around/fix this behavior? I'd also like to avoid using setSummary so that there's still opportunity to add a summary to the preference. Most of my experimentation has been inside onCreateView with the layout code but I can't get anything to work completely right. This seems to happen whether I use RelativeLayout or LinearLayout. The full code is as follows: ``` package test.android.testproject2; //imports... public class TimePreference extends DialogPreference { private int lastHour=0; private int lastMinute=0; private boolean is24HourFormat; private TimePicker picker=null; private TextView timeDisplay; public TimePreference(Context ctxt) { this(ctxt, null); } public TimePreference(Context ctxt, AttributeSet attrs) { this(ctxt, attrs, 0); } public TimePreference(Context ctxt, AttributeSet attrs, int defStyle) { super(ctxt, attrs, defStyle); is24HourFormat = DateFormat.is24HourFormat(ctxt); setPositiveButtonText("Set"); setNegativeButtonText("Cancel"); } @Override public String toString() { if(is24HourFormat) { return ((lastHour < 10) ? "0" : "") + Integer.toString(lastHour) + ":" + ((lastMinute < 10) ? "0" : "") + Integer.toString(lastMinute); } else { int myHour = lastHour % 12; return ((myHour == 0) ? "12" : ((myHour < 10) ? "0" : "") + Integer.toString(myHour)) + ":" + ((lastMinute < 10) ? "0" : "") + Integer.toString(lastMinute) + ((lastHour >= 12) ? " PM" : " AM"); } } @Override protected View onCreateDialogView() { picker=new TimePicker(getContext().getApplicationContext()); return(picker); } @Override protected void onBindDialogView(View v) { super.onBindDialogView(v); picker.setIs24HourView(is24HourFormat); picker.setCurrentHour(lastHour); picker.setCurrentMinute(lastMinute); } @Override protected View onCreateView (ViewGroup parent) { View prefView = super.onCreateView(parent); LinearLayout layout = new LinearLayout(parent.getContext()); LinearLayout.LayoutParams lp = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.FILL_PARENT, 2); layout.addView(prefView, lp); timeDisplay = new TextView(parent.getContext()); timeDisplay.setGravity(Gravity.BOTTOM | Gravity.RIGHT); timeDisplay.setText(toString()); LinearLayout.LayoutParams lp2 = new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.FILL_PARENT, 1); layout.addView(timeDisplay, lp2); return layout; } @Override protected void onDialogClosed(boolean positiveResult) { super.onDialogClosed(positiveResult); if (positiveResult) { picker.clearFocus(); lastHour=picker.getCurrentHour(); lastMinute=picker.getCurrentMinute(); String time=String.valueOf(lastHour)+":"+String.valueOf(lastMinute); if (callChangeListener(time)) { persistString(time); timeDisplay.setText(toString()); } } } @Override protected Object onGetDefaultValue(TypedArray a, int index) { return(a.getString(index)); } @Override protected void onSetInitialValue(boolean restoreValue, Object defaultValue) { String time=null; if (restoreValue) { if (defaultValue==null) { time=getPersistedString("00:00"); } else { time=getPersistedString(defaultValue.toString()); } } else { if (defaultValue==null) { time="00:00"; } else { time=defaultValue.toString(); } if (shouldPersist()) { persistString(time); } } String[] timeParts=time.split(":"); lastHour=Integer.parseInt(timeParts[0]); lastMinute=Integer.parseInt(timeParts[1]);; } } ``` An example preferences layout is below: ``` <?xml version="1.0" encoding="UTF-8"?> <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"> <PreferenceCategory android:title="@string/preferences_time_title"> <test.android.testproject2.TimePreference android:key="preferences_start_time" android:showDefault="true" android:defaultValue="08:00" android:summary="When to start" android:title="@string/preferences_start_time"/> <test.android.testproject2.TimePreference android:key="preferences_stop_time" android:showDefault="true" android:defaultValue="22:00" android:summary="When to stop" android:title="@string/preferences_stop_time"/> </PreferenceCategory> <PreferenceCategory android:title="@string/preferences_options_title"> <CheckBoxPreference android:key="preferences_enabled" android:defaultValue="false" android:title="@string/preferences_enabled"/> </PreferenceCategory> </PreferenceScreen> ``` Screenshots: ![Default settings](https://i.stack.imgur.com/8RlP6.png) ![Checked settings](https://i.stack.imgur.com/WwAHV.png) This happens on emulators for APIs 3, 4 and 7. I've also tried it on 10 and it works correctly. It works correctly on an emulator with API 8 as well (2.2/Froyo). I've rewritten the `onCreateView` method as follows. It still fails the same way, but it's more efficient to render and I believe it behaves closer to the requirements specified in the Android documentation. ``` @Override protected View onCreateView (ViewGroup parent) { ViewGroup prefView = (ViewGroup) super.onCreateView(parent); View widgetLayout; int childCounter = 0; do { widgetLayout = prefView.getChildAt(childCounter); childCounter++; } while (widgetLayout.getId() != android.R.id.widget_frame); timeDisplay = new TextView(widgetLayout.getContext()); timeDisplay.setText(toString()); ((ViewGroup) widgetLayout).addView(timeDisplay); return prefView; } ``` My next step is to start some logging in onCreateView, onBindView and getView and see how they're called and what's going on inside the views. If anyone comes up with any ideas in the meantime, please let me know!
Layout for TimePicker-based DialogPreference
CC BY-SA 3.0
0
2011-06-21T13:06:38.190
2011-12-31T15:58:58.777
2011-06-22T20:29:42.183
807,426
807,426
[ "android", "android-layout", "android-widget", "android-preferences" ]
6,425,795
1
6,430,610
null
12
68,388
I am trying to load a properties file into a Spring bean and then inject that bean into a class. The only part I can't get to work seems to be using the reference.Can someone connect the last piece for me? I get a null value every time. Doesn't seem to want to inject the value. [EDIT] - I originally thought using the was the best way but the proposed solution I found easier. I saw this solution in another post: [Inject Property Value into Spring - posted by DON](https://stackoverflow.com/questions/317687/inject-property-value-into-spring-bean) Credit to Don for the post but I just wasn't sure how to finish it with the . The variable value `appProperties` is always null. It's not being injected. ![enter image description here](https://i.stack.imgur.com/Z4VJ3.png) Sample Class: ``` package test; import java.util.Properties; import javax.annotation.Resource; public class foo { public foo() {} @Resource private java.util.Properties appProperties; } ``` Based on the advice in the approved solution below. Here are the changes I made. --- # Solution Update: Spring Config: ![enter image description here](https://i.stack.imgur.com/LEp68.png) Java Class: ![enter image description here](https://i.stack.imgur.com/sQBRT.png)
Injecting Properties using Spring & annotation @Value
CC BY-SA 3.0
0
2011-06-21T13:13:47.820
2013-07-07T10:18:57.680
2020-06-20T09:12:55.060
-1
771,861
[ "java", "spring", "dependency-injection" ]
6,426,066
1
null
null
0
411
I am using a longlistselector control in my WP7 app, to show some products, the problem is that when i scroll to the last few items at the bottom , the application crashes . Any idea why it is happening?![enter image description here](https://i.stack.imgur.com/k3QQR.png)
application crashes while scrolling long list selector
CC BY-SA 3.0
null
2011-06-21T13:31:33.783
2014-06-08T22:10:36.083
2014-06-08T22:10:36.083
759,866
772,897
[ "silverlight", "windows-phone-7" ]
6,426,067
1
6,634,709
null
2
1,103
I'm having trouble with this. I've got "WorkItem" which has a method DoWork. WorkItem can have dependencies which MUST complete before it does, otherwise it throws an exception. Here's a diagram, where each item (A, B, C, etc.) is a WorkItem. The first items off the rank should thus be A, B, E, as they have no dependencies. ![Diagram](https://i.stack.imgur.com/lZDaD.jpg) So I throw "G" to DoWorkForTask, but my exception throws itself, proving that, say, A and B haven't completed before C runs. The whole tiny project is [zipped up here.](http://www.dukecg.net/ThreadedBuilder.zip) ``` private void DoWorkForTask(WorkItem item) { // NOTE: item relies on Dependents to complete before it proceeds Task.Factory.StartNew(() => { foreach (var child in item.Dependents) { Task.Factory.StartNew(child.DoWork, TaskCreationOptions.AttachedToParent); if (child.Dependents.Count > 0) DoWorkForTask(child); } item.DoWork(); }, TaskCreationOptions.AttachedToParent); } ``` Note that I've read [this thread](https://stackoverflow.com/questions/4149873/task-parallel-library-for-directory-traversal) and it does not solve the issue.
Task Parallel Library - building a tree
CC BY-SA 3.0
0
2011-06-21T13:31:34.070
2015-11-23T14:05:50.153
2017-05-23T12:07:02.087
-1
289,442
[ "c#", "tree", "task-parallel-library" ]
6,426,268
1
6,426,426
null
-2
105
Table (ipvote) ![enter image description here](https://i.stack.imgur.com/WKhfb.png) Table (pictures) ![enter image description here](https://i.stack.imgur.com/3x4u1.jpg) What is the SQL query to retrieve all the images that were not voted for such ip '127 .0.0.1 '? Thank you in advance, Jeremie.
PHP/SQL Juste a simple left join?
CC BY-SA 3.0
null
2011-06-21T13:42:29.373
2013-12-24T06:31:36.877
2013-12-24T06:31:36.877
1,829,219
787,389
[ "php", "mysql", "sql" ]
6,426,272
1
6,432,777
null
1
5,323
I store weekly game score in a table called : ``` # select * from pref_money limit 5; id | money | yw ----------------+-------+--------- OK32378280203 | -27 | 2011-44 OK274037315447 | -56 | 2011-44 OK19644992852 | 8 | 2011-44 OK21807961329 | 114 | 2011-44 FB1845091917 | 774 | 2011-44 (5 rows) ``` And for the winners of each week I display medal(s): ![screenshot](https://i.stack.imgur.com/4jiAw.png) I find the number of medals for a user by running: ``` # select count(id) from ( select id, row_number() over(partition by yw order by money desc) as ranking from pref_money ) x where x.ranking = 1 and id='OK260246921082'; count ------- 3 (1 row) ``` And that query is quite costly: ``` # explain analyze select count(id) from ( select id, row_number() over(partition by yw order by money desc) as ranking from pref_money ) x where x.ranking = 1 and id='OK260246921082'; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=18946.46..18946.47 rows=1 width=82) (actual time=2423.145..2423.145 rows=1 loops=1) -> Subquery Scan x (cost=14829.44..18946.45 rows=3 width=82) (actual time=2400.004..2423.138 rows=3 loops=1) Filter: ((x.ranking = 1) AND ((x.id)::text = 'OK260246921082'::text)) -> WindowAgg (cost=14829.44..17182.02 rows=117629 width=26) (actual time=2289.079..2403.685 rows=116825 loops=1) -> Sort (cost=14829.44..15123.51 rows=117629 width=26) (actual time=2289.069..2319.575 rows=116825 loops=1) Sort Key: pref_money.yw, pref_money.money Sort Method: external sort Disk: 4320kB -> Seq Scan on pref_money (cost=0.00..2105.29 rows=117629 width=26) (actual time=0.006..22.566 rows=116825 loops=1) Total runtime: 2425.001 ms (9 rows) ``` That is why (and because my web site is struggling during peak times, with 50 queries/s displayed in pgbouncer log) I'd like to cache that value and have added a column to another table - the : ``` pref=> \d pref_users; Table "public.pref_users" Column | Type | Modifiers ------------+-----------------------------+--------------- id | character varying(32) | not null first_name | character varying(32) | last_name | character varying(32) | female | boolean | avatar | character varying(128) | city | character varying(32) | lat | real | lng | real | login | timestamp without time zone | default now() last_ip | inet | medals | smallint | default 0 logout | timestamp without time zone | Indexes: "pref_users_pkey" PRIMARY KEY, btree (id) Check constraints: "pref_users_lat_check" CHECK ((-90)::double precision <= lat AND lat <= 90::double precision) "pref_users_lng_check" CHECK ((-90)::double precision <= lng AND lng <= 90::double precision) "pref_users_medals_check" CHECK (medals >= 0) ``` I would like to create a cronjob to be run every 15 minutes to update that column for all users in the table: ``` */15 * * * * psql -a -f $HOME/bin/medals.sql ``` As you see, I've got almost everything in-place. My problem is that I haven't come up with the SQL statement yet for updating the column. Any help please? I'm using PostgreSQL 8.4.8 with CentOS Linux 5.6 / 64 bit. Thank you! Alex
PostgreSQL: running a query for each row and saving the result in it
CC BY-SA 3.0
null
2011-06-21T13:42:41.993
2011-06-21T22:27:17.780
null
null
165,071
[ "postgresql", "cron" ]
6,426,374
1
6,426,422
null
0
192
I implemented twitter posting button on my web site using [twitter codeigniter library](http://www.haughin.com/code/twitter/).) using that button, I can posting my writing to twitter. (like social sharing button) It works well. To posting a writing, there are two steps like below. ![enter image description here](https://i.stack.imgur.com/MDJPS.jpg) ![enter image description here](https://i.stack.imgur.com/FcSy8.jpg) but, some kinds of social sharing button skip the first step. they let the user post his writings just 1 page step. (write message and push post button, that's all) So, my question is how can I skip the first step so that users just write message push posting button in one page step?
twitter posting from webpage button (in onestep)
CC BY-SA 3.0
null
2011-06-21T13:49:30.810
2011-06-21T13:52:14.717
null
null
505,345
[ "php", "twitter", "oauth" ]
6,426,398
1
null
null
3
819
I have a project that requires me to create interactive schematic maps for rail networks. Something along the lines of London's tube map (Not the tube map itself. Are there any flash libraries out there that can assist with this sort of thing? ![enter image description here](https://i.stack.imgur.com/b6oMS.png)
Library to create Schematic maps (ie; Tube, metro maps) in flash
CC BY-SA 3.0
0
2011-06-21T13:51:00.563
2011-06-21T15:15:21.920
null
null
177,694
[ "flash", "apache-flex", "actionscript-3", "mapping", "flash-builder" ]
6,426,434
1
6,426,564
null
0
1,530
I want to create a layout which contains TextView , Button and ListView here is the following example ![example](https://i.stack.imgur.com/oaMDY.png) - - - I have created a ListView activity now i don't know how to embed it with TextView and Buttons above my ListView inflate the custom layout.
Textview , Button and ListView in one layout
CC BY-SA 3.0
null
2011-06-21T13:53:10.203
2011-06-21T14:45:44.977
2011-06-21T14:45:44.977
405,383
405,383
[ "android", "android-layout" ]
6,426,478
1
6,440,527
null
2
3,383
I've been given the task of creating an ICAL feed of conference calls for members of our organization. I created a handler in ASP.NET that loops through our database, gets the call data from the database, and creates output that appears valid to me based on what I've read of the ICAL format, and the examples I've seen/disassembled. Outlook 2007 reads the resulting output and displays the calendar, no problem ([screenshot here](http://tinypic.com/images/404.gif) shows how it renders). 30 Boxes also has no problem with it. ([see test here](https://www.30boxes.com/external/widget?refer=ff&url=webcal://www.joshuacarmody.com/temp/icaltest.ics)). But when I try to load the same output into Google Calendar, I get the message "We could not parse the calendar at the url requested": ![We could not parse the calendar at the url requested](https://i.stack.imgur.com/TfduZ.png) You can see the temporary data I'm testing with at this URL: [](http://www.joshuacarmody.com/temp/icaltest.ics)[http://www.joshuacarmody.com/temp/icaltest.ics](http://www.joshuacarmody.com/temp/icaltest.ics). This is a snapshot of the output from my .ASHX file, unaltered except the phone numbers and passcodes have been sanitized. I just tried the following 1. Created a copy of my test file called "icaltest-1googevent.ics" 2. Deleted all the VEVENT data from the file 3. Exported one of my Google calendars to ICS 4. Copied one VEVENT from Google's exported data into my test file 5. Attempted to subcribe to icaltest-1googevent.ics in Google Calendar. I still got an error message. So I'm guessing the issue isn't with my VEVENT data, but with something else about the file. Maybe there's something wrong with my VCALENDAR definition?
Why won't Google Calendar load my dynamically generated ICS file?
CC BY-SA 4.0
null
2011-06-21T13:56:26.587
2019-08-11T09:23:32.497
2019-08-11T09:23:32.497
4,751,173
8,409
[ "asp.net", "google-calendar-api", "icalendar" ]
6,426,896
1
6,427,031
null
3
752
This is the source example table: I would like to have a SQL query to display my result like the given format below. Need a little more help on this... ![Need Help](https://i.stack.imgur.com/dUbor.jpg) Thanks, Yugal
Need help for Cross Tab SQL Query
CC BY-SA 3.0
0
2011-06-21T14:24:49.247
2011-06-22T07:27:52.427
2011-06-22T07:27:52.427
535,422
535,422
[ "mysql", "sql", "sql-server-2005", "sql-server-2008" ]
6,426,960
1
6,427,336
null
2
4,446
Is there a way to have content blocks with the same name? This is the template with the main layout. ``` <html> ... {% block content %} {% endblock %} ... </html> ``` This is the template with the main layout + sidebar on the left. ``` {% extends 'base.html' %} {% block content %} <div class='sidebar'> </div> {% block content %} //This doesn't work because you can't have blocks with the same name// {% endblock %} {% endblock ``` I have a few reason why I am asking this: 1. It's easy to change the parent of a page without having to change the name of the content blocks. 2. I don't have to come up with names for my blocks. Like content-content, sidebar-content, etc I got two solutions for this which I don't like because they ain't DRY: 1. Make the sidebar a partial and include it in the templates you need. 2. Add everything to the base template and overwrite those blocks you don't need. If this isn't possible with Django Template can I do something like this with an other templating engine? ![template diagram](https://i.stack.imgur.com/t2Pt5.png) So what I want to do is to be able to move the templates around in the template tree without to much hassle. It's not possible though without coming up with smart names for my content blocks but I thought I add this pretty diagram anyways.
Django: nested content blocks with the same name
CC BY-SA 3.0
null
2011-06-21T14:28:23.290
2012-08-04T11:00:06.380
2011-06-21T22:41:36.607
145,117
145,117
[ "django", "templates" ]
6,426,990
1
6,912,832
null
6
12,906
I'm setting up Jenkins for the first time and running into an issue where Jenkins does not appear to even attempt to execute the Ant task I've specified. I've defined my JDK and Ant installations under Manage Jenkins.![(jenkins installations)](https://i.stack.imgur.com/l77Ll.png) I've setup my Job to Invoke Ant using the Targets 'war-all'![(job build)](https://i.stack.imgur.com/C92k5.png) Whether I force a build or wait for it to naturally execute after the next commit, there is nothing in the Build Console Output about attempting to execute the ant task. Here is a sample Console Output:![(console output)](https://i.stack.imgur.com/zWaD4.png) Any ideas as to why it might not be executing would be appreciated. Also tips on how I can find more logging from Jenkins which might provide clues as to why it is not executing would be helpful. I'm not sure what Logger I might specify or even then where the logging information is written on the file system.
Jenkins not executing Ant task
CC BY-SA 3.0
null
2011-06-21T14:30:38.347
2015-01-14T10:04:36.837
2011-06-23T14:41:07.353
186,742
186,742
[ "continuous-integration", "jenkins" ]
6,427,155
1
null
null
1
179
I am using a Dynamic Entity to enter a new Event. The basic form works correctly, but I want to pre-populate some of the fields based on user selection. I have done this by setting the field value in the Event object e.g ``` acc.Subject="Test Subject"; ``` This works for all fields except lookup fields. I want to be able to pre fill in the current user as the Assigned To (owner) person, and tried ``` acc.OwnerId="005200054016IZ5AAM"; ``` But this leaves the field blank. Is there any way that I can pre fill in the Assigned To field? The complete code I am using is:- ``` var itemClass : Class = MetadataUtil.getItemClassForType( _selectedEntity ); if ( itemClass == DynamicEntity ){ var acc:DynamicEntity = new itemClass( _selectedEntity ); acc.OwnerId="005200540016IZ5AAM"; acc.Subject="Test Subject"; _createFieldContainer.render(acc); } ``` When I use this the subject is filled in with Test subject, but the Asigned To box is blank. Thanks Roy Additional Information:- When I open the Dynamic Entity ther following screen is displayed:- ![enter image description here](https://i.stack.imgur.com/F0dhu.png) I am trying to populate the field Assigned To with the current user's name.
Dynamic Entity problem
CC BY-SA 3.0
null
2011-06-21T14:41:13.150
2011-07-21T00:46:40.623
2011-06-27T14:54:25.283
628,450
628,450
[ "flash", "apache-flex", "air", "salesforce" ]
6,427,185
1
6,427,351
null
0
413
I've just encountered a weird bug/feature in table cells under Chrome & Firefox. it seems a TD tag with valign=middle is overwritten by the vertical-align css property. Check this jsfiddle example out: [http://jsfiddle.net/8CDFq/1/](http://jsfiddle.net/8CDFq/1/) the first cell has valign=middle in the HTML part. All cells have the vertical-align:bottom property. In Chrome's debug bar it shows the following: ![enter image description here](https://i.stack.imgur.com/9EjRk.jpg) look at the regions in red. it's lying! :D My assumption was that valign vas considered as an inline style == wrong ?
Is a table cell valign property considered as an inline CSS style?
CC BY-SA 3.0
null
2011-06-21T14:43:06.700
2011-06-21T14:55:01.340
null
null
48,500
[ "html", "css" ]
6,427,219
1
null
null
0
323
i want to build a bar chart where the X-axis is month year ( example : NOV 2010) in my dataset i got a column called MonthYear contains the month year value. The problem is when i use the MonthYear column as the X-axis value , in the bar chart X-axis it come out numeric value (example : 14800 ...). I google out and found out that it is the date value in SAS. i would like to know how can i display date as "NOV 2010" form on X-axis in bar chart. - ![enter image description here](https://i.stack.imgur.com/pTOZq.png) ![enter image description here](https://i.stack.imgur.com/5edF3.png)
SAS EG date issue
CC BY-SA 3.0
null
2011-06-21T14:44:59.027
2012-04-30T01:10:30.580
2012-04-30T01:10:30.580
13,793
808,646
[ "date", "sas" ]
6,427,212
1
7,284,224
null
27
70,754
When I open a POM file and click on the "Dependency Hierarchy" tab at the bottom, it gives me the error, "Project read error". It works with other projects in the same workspace, just not with this one. Any ideas? ![enter image description here](https://i.stack.imgur.com/PPUMD.png) In response to @Yhn's answer. 1. Running the compile and package phases outside of Eclipse from the command-line work as expected. It compiles the application and builds the final WAR file. 2. Eclipse is indeed pointing to the default location of the Maven settings.xml file, so it should be aware of the custom repositories that are defined in it (my company has its own Maven repository). 3. I can open and edit the POM file from Eclipse, so it must have read/write permissions to the file. 4. The project is not configured in Eclipse as a Maven project, so I cannot run the package phase from Eclipse (I can only run it from the command-line). I wonder if it has anything to do with the fact that I was having trouble building the project with Maven 3 because apparently some of the transitive dependencies are configured for Maven 1, which [Maven 3 does not support](https://cwiki.apache.org/MAVEN/maven-3x-compatibility-notes.html#Maven3.xCompatibilityNotes-LegacystyleRepositories) (this is my theory anyway, based on some of the error messages). I can build the project with Maven 2, but I still get messages such as the following: ``` Downloading: http://dist.codehaus.org/mule/dependencies/maven2/org/codehaus/xfie/bcprov-jdk14/133/bcprov-jdk14-133.pom [INFO] Unable to find resource 'org.codehaus.xfire:bcprov-jdk14:pom:133' in repsitory mule (http://dist.codehaus.org/mule/dependencies/maven2) ``` It must be able to find these dependences however, because it downloaded the JARs just fine and can build the application. It seems like the problem is that the dependencies don't have POM files associated with them, which is maybe why they cannot be used with Maven 3. This might also be why I cannot view the Dependency Hierarchy in Eclipse. I converted the project to a Maven project by going to "Configure > Convert to Maven Project". When I open the POM file, I see the error: `ArtifactDescriptorException: Failed to read artifact descriptor for woodstox:wst (Click for 140 more)` (woodstox:wst is another transitive dependency of the project). An error appears in the "Markers" view for seemingly every depedency and transitive dependency in my project. However, I can successfully build the project by doing a "Run As > Maven build". ( This might be because this project has no Java source code, but the JARs of the dependencies correctly appear in the final WAR.) The Dependency Hierarchy still gives the same error--"Project read error". About the "Unable to find resource" messages--but this only appears for a handful of transitive dependencies. The project has many more transitive dependencies, but these messages do not appear for them. It seems like, because the dependencies do not have POM files, that Maven tries to search for them every time the project is built. Is this normal not to have POMs?? How might I go about getting a repo manager? Is this something that would have to be installed on the company's Maven repository or can you install it on your own workstation?
Error opening Maven POM file dependency hierarchy in Eclipse - "Project read error"
CC BY-SA 3.0
0
2011-06-21T14:44:33.400
2022-01-13T02:28:10.217
2011-06-23T15:16:05.387
13,379
13,379
[ "java", "eclipse", "maven", "pom.xml" ]
6,427,253
1
6,427,574
null
0
821
Can anyone explain what is the math/physics behind this popular PSP game Locoroco. My understanding about this game collision mechanism is , the whole world is made with bezier curves? If yes - my question is how to build a such a huge endless level , character of these game I guess its blob physics? Is it tile based level? Please help where to start the research on this topic. [http://www.gotoandplay.it/_articles/2003/12/bezierCollision.php](http://www.gotoandplay.it/_articles/2003/12/bezierCollision.php) ![enter image description here](https://i.stack.imgur.com/xuELa.jpg)
Locoroco game collision detection
CC BY-SA 3.0
0
2011-06-21T14:47:01.380
2011-06-21T15:09:20.477
2011-06-21T15:07:10.450
488,156
488,156
[ "math", "physics", "computational-geometry" ]
6,427,379
1
null
null
5
4,388
I have two datasets at the time (in the form of vectors) and I plot them on the same axis to see how they relate with each other, and I specifically note and look for places where both graphs have a similar shape (i.e places where both have seemingly positive/negative gradient at approximately the same intervals). Example: ![enter image description here](https://i.stack.imgur.com/c1cJL.jpg) So far I have been working through the data graphically but realize that since the amount of the data is so large plotting each time I want to check how two sets correlate graphically it will take far too much time. Are there any ideas, scripts or functions that might be useful in order to automize this process somewhat?
Process for comparing two datasets
CC BY-SA 3.0
0
2011-06-21T14:56:46.663
2015-11-23T12:17:36.597
2015-11-23T12:17:36.597
4,370,109
718,531
[ "matlab", "dataset", "compare", "signal-processing", "similarity" ]
6,427,506
1
null
null
-1
1,738
I have an issue with mod_rewrite, I have a `.htaccess` file set up in directory called `cms`: ``` Options +FollowSymLinks RewriteEngine on #rewrite rules for edit RewriteRule ^edit\/(.*) edit.php?page=$1 [QSA,L] ``` I would like to access it like so `sitename.com/cms/edit/2` but when I do I get errors: ![my errors to do with mime types](https://i.stack.imgur.com/fR3lq.png) When I access the natural path (`sitename/css/edit.php?page=2`) everything works fine. Any help would be appreciated.
mod_rewrite changes MIME types .css/.js -> html
CC BY-SA 3.0
0
2011-06-21T15:04:58.760
2015-11-25T13:50:36.967
2013-03-09T01:40:13.837
1,380,918
320,197
[ "apache", ".htaccess", "mod-rewrite", "apache2" ]
6,427,650
1
15,095,377
null
39
10,767
I am using vim in 256 color mode on Solaris (connected via Putty on Windows). Everything looks great and works fine outside of tmux, but within tmux the background color changes periodically when paging/scrolling through a file. Here is how it's supposed to look: ![](https://i.imgur.com/p2VxY.png) Here is how it appears after paging around a bit: ![](https://i.imgur.com/lAI9c.png) Thanks!
vim in tmux background color changes when paging
CC BY-SA 3.0
0
2011-06-21T15:13:21.267
2017-06-12T06:36:03.767
null
null
93,328
[ "vim", "vi", "tmux" ]
6,428,100
1
6,434,932
null
8
2,740
Similar to these questions: - [iOS: Adding a fixed image just below the navigation bar](https://stackoverflow.com/questions/6167871/ios-adding-a-fixed-image-just-below-the-navigation-bar)- [iOS: Positioning navigation bar buttons within custom navigation bar](https://stackoverflow.com/questions/6169474/ios-positioning-navigation-bar-buttons-within-custom-navigation-bar) I've managed to use the 1st questions sample code to add a category on UINavigationBar and change its height, and added a subview where I need it, but I can't see a way to cause the UITableView (or indeed any content views) to take its height into consideration: ![iPhone 4 Simulator Screenshot](https://i.stack.imgur.com/dMMAg.png) (The colors are only to make the different views distinguishable)
iOS: Is is possible to make a UINavigationBar taller and "push" the other views down the screen?
CC BY-SA 3.0
0
2011-06-21T15:41:07.013
2011-06-22T18:56:52.473
2017-05-23T12:19:48.617
-1
86,093
[ "iphone", "ios", "cocoa-touch" ]
6,428,192
1
6,428,625
null
18
21,783
I have Google Maps icons which I need to rotate by certain angles before drawing on the map using [MarkerImage](http://code.google.com/apis/maps/documentation/javascript/reference.html#MarkerImage). I do the rotation on-the-fly in Python using PIL, and the resulting image is of the same size as the original - 32x32. For example, with the following default Google Maps marker: ![icon before rotation](https://i.stack.imgur.com/uvFaG.png) , a 30 degrees conter-clockwise rotation is achieved using the following python code: ``` # full_src is a variable holding the full path to image # rotated is a variable holding the full path to where the rotated image is saved image = Image.open(full_src) png_info = image.info image = image.copy() image = image.rotate(30, resample=Image.BICUBIC) image.save(rotated, **png_info) ``` The resulting image is ![icon rotated 30 degrees counter-clockwise](https://i.stack.imgur.com/ziO3A.png) The tricky bit is getting the new anchor point to use when creating the MarkerImage using the new rotated image. This needs to be the pointy end of the icon. By default, the anchor point is the bottom middle [defined as (16,32) in x,y coordinates where (0,0) is the top left corner]. Can someone please explain to me how I can easily go about this in JavaScript? Thanks. Had posted the wrong rotated image (original one was for 330 degrees counter-clockwise). I've corrected that. Also added resampling (Image.BICUBIC) which makes the rotated icon clearer.
Get new x,y coordinates of a point in a rotated image
CC BY-SA 3.0
0
2011-06-21T15:47:34.093
2016-03-16T12:21:10.357
2011-06-22T07:47:11.643
418,182
418,182
[ "javascript", "python", "api", "google-maps", "image-rotation" ]
6,428,303
1
6,448,532
null
1
568
The problem: A text box has a shorter length than a combobox. so if I draw them vertically it does not look pretty because they are not aligned on their right side edges. so let's make text box a little longer. But I do not want to just type pixels to do it. I think I should be able to do this with setting percentages on some DIVS but I am newbie and could not figure out yet. so here is what I have and I am also attaching it as a sreen shot. so for now our goal is to make that "Alias" text box make larger so it will be right aligned with the "Ancestry" combobox that is below it. P.S: some of these tags you see are not standard html. they are from ZK framework but it is fine. we can still use DIV. ``` <vlayout > <hlayout spacing = "20px"> <vlayout id= "GeneGroup"> <label id= "geneLabel" value = "*Gene Symbol"/> <bandbox id="bdGeneSearch"> </bandbox> </vlayout> <vlayout id= "AliasGroup" > <label id= "lblAlias" value = "Alias"/> <textbox id = "txtAlias"> </textbox> </vlayout> </hlayout> <hlayout spacing = "20px"> <vlayout id= "RefSeqGroup"> <label id= "lblRefSeq" value = "*Reference Sequence"/> <combobox id = "cbRefSeq"> </combobox> </vlayout> <vlayout id= "AncestryGroup"> <label id= "lblAncestry" value = "Ancestry"/> <combobox id = "cbAncestry"> </combobox> </vlayout> </hlayout> </vlayout> </div> ``` ![enter image description here](https://i.stack.imgur.com/rBW8o.png)
Making vertically aligned controsl to all have the same length
CC BY-SA 3.0
null
2011-06-21T15:54:33.330
2011-06-23T01:56:09.227
null
null
320,724
[ "html", "alignment", "zk" ]
6,428,450
1
null
null
0
420
I'm using a layer-drawable and inside it I have one BitmapDrawable that repeats only horizontally. But I need to add borders for this drawable. But I didn't find any solution for this! I tried to create a ShapeDrawable and set my BitmapDrawable as background of my ShapeDrawable, but it's not possible. I tried to find a method that add borders for my ShapeDrawable, but I didn't find it. I also added 2 other images, that would be the box_top_left and box_top_right. With this idea, I only need now to make it appear in this order: box_top_left, box_repeat, box_top_right. But i'm also having trouble to do this! I've found a several ways to change a drawable's padding in my xml but not during the execution. I can't just set it on my xml because I don't know the total width. And I didn't find any way to make my drawable the exactly width of my image. Can somebody help me, plz? I'll post some images to help you to understand what I want to do. The first image is how it should be: ![image 1](https://i.imgur.com/BbXVU.jpg) Inside my Dialog, at the top, above the text "Acesso ao sistema" I have my image that sould repeat. I used a layer-drawable for my Dialog's background with a item that is the shape for my dialog and another item that should have my BitmapDrawable repeating only horizontally. This second image is only missing to add my box_top_left and box_top_right. ![image 2](https://i.imgur.com/R66Mx.png) This third image is what happens when I don't use borders: ![image 3](https://i.imgur.com/00G70.png) And the last image is third image expanded for you to see the problem: ![image 4](https://i.imgur.com/bfLaq.png) Thanks for your attention.
How to set borders for a drawable that repeats horizontally?
CC BY-SA 3.0
null
2011-06-21T16:04:32.310
2012-02-22T06:27:50.090
null
null
599,944
[ "android", "drawable" ]
6,428,508
1
6,428,654
null
2
1,560
I am new to Domain Pattern, I need to ensure that I understand what I had read so far!!, ![enter image description here](https://i.stack.imgur.com/4Vf1O.png) 0) DAL will receive parameters in DTO and return fetched data in LIST of DTO (Entity) 1) De-couple BLL and DAL through repository pattern. 2) Entity is DTO object. 3) ProductCategoryData contains a list of ProductData. 4) It will be Anemic Domain Model ANTI Pattern if BLL.ProductCategory does not contain properties that describe the business object. 5) BLL.ProductCategory contains a List of BLL.Product……I have bad feeling about this 6) I avoid in that design anemic domain model anti pattern. 7) I successfully Apply Domain Model Pattern. 8) I used DTO objects to transfer data between tiers. Please talk to me :)
Understanding DTO and Anemic Domain Model
CC BY-SA 3.0
0
2011-06-21T16:08:24.463
2011-06-21T16:53:04.243
2011-06-21T16:53:04.243
225,537
225,537
[ "architecture", "domain-driven-design", "n-tier-architecture" ]
6,428,670
1
6,428,733
null
8
8,038
Since I can remember, I've been having problems with apps or games that crash because of a different style of parsing decimal numbers. It happens very often, from CAD apps, libraries to web pages. I'm not sure whether it is ignorance or lack of knowledge, but it's really annoying. What's the problem? [Here](http://en.wikipedia.org/wiki/Decimal_mark) is a wiki article about it, but it short: Here is a map that shows what kind of decimal separator (decimal mark) is used around the world. ![map of diffrent decimal separator](https://i.stack.imgur.com/ODeSS.png) Decimal marks: - - - - Most of the Europe, South America write 1 000 000,00 or 1000000,00 sometimes 1.000.000,00 as opposite to "imperial" (marked as blue) write 1,000,000.00 Let me just give you a few from all problems that I encoutered last month. 1. Number on webpages hard to read: Let's take one of the most viewed YT videos. It shows me 390159851. Number above one million are very hard to read, what's the order of magnitude? Is it 39 mln or 390? 2. Mirosoft XNA for Windows Phone 7 example: There is a very neat class that parse XML file to produce XNA animation /// <summary> /// Loads animation setting from xml file. /// </summary> private void LoadAnimiationFromXML() { XDocument doc = XDocument.Load("Content/Textures/AnimationsDefinition.xml"); XName name = XName.Get("Definition"); var definitions = doc.Document.Descendants(name); if (animationDefinition.Attribute("Speed") != null) { animation.SetFrameInvterval(TimeSpan.FromMilliseconds( double.Parse(animationDefinition.Attribute("Speed").Value))); } double.Parse throws an exception, one simple soultion is to use XmlConvert.ToDouble(); or parse with InvariantCulture. 3. .Net app that use CSV files to store input vector as CSV - also throws. 4. Another .Net app that has some parsing inside the class - throws. So how can we fix this? - - - Can I make the app be invariant? Like starting the app in a different environment. PS. I would like to run the app, but I don't have the code.
How to fix an application that has a problem with decimal separator
CC BY-SA 3.0
0
2011-06-21T16:21:45.687
2012-05-04T21:14:34.063
2012-05-04T21:14:34.063
50,776
336,186
[ "c#", ".net", "localization", "decimal-point" ]
6,429,087
1
6,429,175
null
5
22,383
> [How do I edit the axes of an image in MATLAB to reverse the direction?](https://stackoverflow.com/questions/2865600/how-do-i-edit-the-axes-of-an-image-in-matlab-to-reverse-the-direction) ![enter image description here](https://i.stack.imgur.com/pvOuF.jpg) The colour image is plotted using the `image` function based on some information obtained using `imread` function and for the white and blue image basically I am selecting the coordinates of the heat point(red and blue and their variations basically) from the map and then displaying them using `plot` function. The problem is that the plotted values are reversed on the Y axis and I can't figure out how to reverse the Y axis of the plot in order to obtain the same correlation between the images. Could you please explain me how to solve this problem?
Matlab - reverse value of axis in plot
CC BY-SA 3.0
0
2011-06-21T16:59:00.887
2011-06-21T17:48:31.557
2017-05-23T12:30:37.427
-1
442,124
[ "matlab" ]
6,429,251
1
6,549,295
null
7
1,935
In `C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\WinCrypt.h`, the definition for `CERT_CHAIN_ENGINE_CONFIG` is ``` typedef struct _CERT_CHAIN_ENGINE_CONFIG { DWORD cbSize; HCERTSTORE hRestrictedRoot; HCERTSTORE hRestrictedTrust; HCERTSTORE hRestrictedOther; DWORD cAdditionalStore; HCERTSTORE* rghAdditionalStore; DWORD dwFlags; DWORD dwUrlRetrievalTimeout; // milliseconds DWORD MaximumCachedCertificates; DWORD CycleDetectionModulus; *#if (NTDDI_VERSION >= NTDDI_WIN7) HCERTSTORE hExclusiveRoot; HCERTSTORE hExclusiveTrustedPeople; #endif* } CERT_CHAIN_ENGINE_CONFIG, *PCERT_CHAIN_ENGINE_CONFIG; ``` I am using visual studio 2010 in an XP sp3 machine, in which case, i expect that the following two members in the above structure gets greyed out. But this is not happening, ``` #if (NTDDI_VERSION >= NTDDI_WIN7) HCERTSTORE hExclusiveRoot; HCERTSTORE hExclusiveTrustedPeople; #endif ``` `NTDDI_VERSION` in-turn is defined in `sdkddkver.h` as follows, and `_WIN32_WINNT` somehow takes the value of `NTDDI_WIN7` which in my case is incorrect as mine is a XP SP3 machine. ``` #if !defined(_WIN32_WINNT) && !defined(_CHICAGO_) #define _WIN32_WINNT 0x0601 #endif #ifndef NTDDI_VERSION #ifdef _WIN32_WINNT // set NTDDI_VERSION based on _WIN32_WINNT #define NTDDI_VERSION NTDDI_VERSION_FROM_WIN32_WINNT(_WIN32_WINNT) #else #define NTDDI_VERSION 0x06010000 #endif #endif ``` The above two members of the structure `CERT_CHAIN_ENGINE_CONFIG` in question is not present in `C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\WinCrypt.h`But my 2010 visual studio project automatically pulls in the header and lib files from `C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\WinCrypt.h` Because of the conflicting structures, i am getting `parameter is incorrect` Please advise how i can over come this issue? Should i have to install visual studio 2010 sp1? I [found one reference in the web](http://translate.googleusercontent.com/translate_c?hl=en&prev=/search?q=NTDDI_WIN7%2bCertCreateCertificateChainEngine&hl=en&client=firefox-a&hs=QX3&rls=org.mozilla:en-GB:official&prmd=ivns&rurl=translate.google.co.uk&sl=ja&u=http://techwing.wordpress.com/2010/07/06/cryptoapi-%25E3%2581%25AE-cert_chain_engine_config-%25E6%25A7%258B%25E9%2580%25A0%25E4%25BD%2593-%25E3%2581%25AE-windows-7-windows-server-2008-r2-%25E3%2581%25A7%25E3%2581%25AE%25E6%258B%25A1%25E5%25BC%25B5/&usg=ALkJrhjCHAya-NYcIBtn7oExiRr3QPHIIA) where it says initialising the structure will resolve the issue, but it will not, as the two parameters in question will not be greyed out and will be taken in while building. Settings of my project: ![enter image description here](https://i.stack.imgur.com/2Tujs.jpg) $(VCInstalDir) - >C:\Program Files\Microsoft Visual Studio 10.0\VC $(WindowsSdkDir) ->C:\Program Files\Microsoft SDKs\Windows\v7.0A $(FrameworkSdkDir) ->C:\Program Files\Microsoft SDKs\Windows\v7.0A Library file settings, ``` $(VCInstallDir)lib $(VCInstallDir)atlmfc\lib $(WindowsSdkDir)lib $(FrameworkSDKDir)\lib ``` My preprocessor definitions are ``` WIN32;_DEBUG;_WINDOWS;_USRDLL;MY_DLL_EXPORTS;%(PreprocessorDefinitions) ``` %(PreprocessorDefinitions) inherited values as follows ``` _WINDLL _MBCS ``` Thanks
VS2010 - Structure change in CryptoAPI - v7.0A Vs v6.0A - WinCrypt.h
CC BY-SA 3.0
null
2011-06-21T17:12:43.477
2011-07-01T14:28:42.453
2011-06-23T14:22:18.363
119,535
119,535
[ "c++", "visual-studio-2010", "visual-c++", "certificate", "cryptoapi" ]
6,429,450
1
6,429,478
null
1
1,176
I have a large piece of HTML/CSS/JS which gets served to 3rd party sites via a script tag. The script tag has an id which I use to match and insert the content at the correct location (no nasty `document.write`). However, I've come across a really odd error. Any line with a regex in it seem to escape itself from the string. Below is an example of a problem line (one of a few that are causing problems): ``` +" // preceding code" +" var remSpc = new RegExp('[\$%,]', 'ig');" +" // following code" ``` The preceding and following lines are correctly escaped, the syntax for the middle line looks correct to me, but it's throwing an "unexpected end of input" error and WebKit Inspector is showing it as being unescaped. Screen below to show what I mean by unescaped: ![enter image description here](https://i.stack.imgur.com/Uk1B6.png) The purpose of the regex is to remove special characters from $ amounts and percentages (example values might be "$1,000" or "5.5%". I've tried not using a RegExp object and instead just doing `/[\$%,]/ig and I get exactly the same problem.
Escape regex within string
CC BY-SA 3.0
0
2011-06-21T17:29:51.973
2011-06-21T17:32:25.483
null
null
432,193
[ "javascript", "regex" ]
6,429,488
1
6,429,560
null
0
2,066
![enter image description here](https://i.stack.imgur.com/UaITp.png) How can i count all facebook profiles from facebook column? I used this ``` $query = "SELECT COUNT(facebook) FROM members"; $result = mysql_query($query) or die(mysql_error()); foreach(mysql_fetch_array($result) as $fbcount); ``` And it give result 5. How can i make it to count just 3?
How to exclude records from mysql query count?
CC BY-SA 3.0
0
2011-06-21T17:32:55.327
2015-08-28T20:25:12.667
2015-08-28T20:25:12.667
1,743,880
808,955
[ "mysql", "count", "records" ]
6,429,592
1
null
null
8
293
The code is making HTTP calls to an exposed representation of an SVN tree. It is then parsing the HTML and adding files for reference later to pull down and push to the user. This is being done within a WPF application. Below is the code along with an image showing the directory structure. ``` private readonly String _baseScriptURL = @"https://xxxxxxxxxx/svn/repos/xxxxxxxxxx/trunk/scripts/vbs/web/"; private void FindScripts(String url, ref ICollection<String> files) { //MyFauxMethod(); StringBuilder output = new StringBuilder(); HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); request.Credentials = new Credentials().GetCredentialCache(url); _logger.Log("Initiating request [" + url + "]", EventType.Debug); try { using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) using (Stream stream = response.GetResponseStream()) { _logger.Log("Response received for request [" + url + "]", EventType.Debug); int count = 0; byte[] buffer = new byte[256]; while ((count = stream.Read(buffer, 0, buffer.Length)) > 0) { if (count < 256) { List<byte> trimmedBuffer = buffer.ToList(); trimmedBuffer.RemoveRange(count, 256 - count); String data = Encoding.ASCII.GetString(trimmedBuffer.ToArray()); output.Append(data); } else { String data = Encoding.ASCII.GetString(buffer); output.Append(data); } } } String html = output.ToString(); HTMLDocument doc = new HTMLDocumentClass(); IHTMLDocument2 doc2 = (IHTMLDocument2)doc; doc2.write(new object[] { html }); IHTMLElementCollection ul = doc.getElementsByTagName("li"); doc2.close(); doc.close(); foreach (IHTMLElement item in ul) { if (item != null && item.innerText != null) { String element = item.innerText.Trim().Replace(" ", "%20"); //nothing to do with going up a dir if (element == "..") continue; _logger.Log("Interrogating [" + element + "]", EventType.Debug); String filename = System.IO.Path.GetFileName(element); if (String.IsNullOrEmpty(filename)) { //must be a directory; recursively search if honored dir if (!_ignoredDirectories.Contains(element)) { _logger.Log("Searching directory [" + element + "]", EventType.Debug); FindScripts(url + System.IO.Path.GetDirectoryName(element) + "/", ref files); } else _logger.Log("Ignoring directory [" + element + "]", EventType.Debug); } else { //add honored files to list for parsing meta data later if (_honoredExtensions.Contains(System.IO.Path.GetExtension(filename))) { files.Add(url + filename); _logger.Log("Added file [" + (url + filename) + "]", EventType.Debug); } } //MyFauxMethod(); } //MyFauxMethod(); } } catch (Exception e) { _logger.Log(e); } //MyFauxMethod(); } private void MyFauxMethod() { int one = 1; int two = 2; int three = one + two; } ``` ![Directory structure](https://i.stack.imgur.com/0jcYr.png) First off apologies for the lengthy code block; however I wanted to make certain the full method was understood. The problem that exists is only applicable when using the generated executable outside of the IDE. If the build is ran within the IDE, it functions without any problems. In addition the problem does not exist when executing the generated build outside of the IDE or within the IDE; it functions appropriately in both scenarios. The problem is that the recursive calls stop the code continues on past the recursion method. No exception is thrown within the thread; everything simply stops before moving into each directory as it does in the other builds. The log lines of the build look like this... > Initiating request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/]) Response received for request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/]) Interrogating [beq/] Searching directory [beq/] Initiating request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/]) Response received for request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/]) Interrogating [core/] Searching directory [core/] Initiating request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/core/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/core/]) Response received for request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/core/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/core/]) Interrogating [BEQ-Core%20Library.vbs] Added file [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/core/BEQ-Core%20Library.vbs]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/core/BEQ-Core%20Library.vbs]) Interrogating [one-offs/] Searching directory [one-offs/] Initiating request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/one-offs/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/one-offs/]) Response received for request [[https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/one-offs/]](https://xxxxxxxxx/svn/repos/xxxxxxxxx/trunk/scripts/vbs/web/beq/one-offs/]) Recursively finding scripts took [6]s [140]ms for [1 ] Parsing metadata took [0]m [0]s [906]ms for [1 ] Total time took [0]m [7]s [46]ms After adding in approximately 3 additional log lines during debugging, it is now functioning as it should. The outstanding question is why? Attempting to isolate the problem code in a separate application produces no negative results. Any ideas on why this would be happening? Changing the log lines to call a faux method produced the same results. I have added the calls to the faux method and the faux method in the above source, 1 at the entry of the method and 3 near the bottom. The calls themselves are commented to make it easier to locate; they are commented in the actual code. If I comment out any one of the 4 added faux method calls, it will revert to not functioning. Again this is only in via CTRL+F5 or outside of the IDE in its entirety. Added .close() on the `HtmlDocument` instances per fubaar; same behavior is still being exhibited. Added explicit calls to the GC per fubaar; same behavior is still being exhibited.
Recursive HTTP calls exhibit differing behavior in IDE versus deployed executable
CC BY-SA 3.0
null
2011-06-21T17:41:18.877
2011-08-25T17:19:25.933
2011-07-06T22:36:23.497
215,030
215,030
[ "c#", ".net", "wpf", "http", "recursion" ]
6,429,719
1
6,429,841
null
1
728
i'm dealing with HTTPS and i want to get HTTP header for live.com ``` import urllib2 try: email="[email protected]" response = urllib2.urlopen("https://signup.live.com/checkavail.aspx?chkavail="+email+"&tk=1258056184535&ru=http%3a%2f%2fmail.live.com%2f%3frru%3dinbox&wa=wsignin1.0&rpsnv=11&ct=1258055283&rver=6.0.5285.0&wp=MBI&wreply=http:%2F%2Fmail.live.com%2Fdefault.aspx&lc=1036&id=64855&bk=1258055288&rollrs=12&lic=1") print 'response headers: "%s"' % response.info() except IOError, e: if hasattr(e, 'code'): # HTTPError print 'http error code: ', e.code elif hasattr(e, 'reason'): # URLError print "can't connect, reason: ", e.reason else: raise ``` so i don't want all the information from headers i just want `Set-Cookie` information if you asking what is script do : it's for checking if email avilable to use in hotmail by get the amount from this viralbe `CheckAvail=` # after edit thanks for help .. after fixing get only `Set-Cookie` i got problem it's when i get cookie not get `CheckAvil=` i got a lot information without `CheckAvil= after open it in browser and open the source i got it !! see the picture ![enter image description here](https://i.stack.imgur.com/teq4D.jpg)
get HTTPS header in python
CC BY-SA 3.0
null
2011-06-21T17:50:32.173
2014-05-16T06:22:28.640
2011-06-21T22:07:14.210
681,904
681,904
[ "python", "https", "hotmail", "setcookie" ]
6,429,994
1
null
null
1
576
My URL: [illandeistudio](http://www.ilandeistudio.com/store/) If you scroll halfway down you will see a list of categories (Accessories, dinning, lighting...) They are currently vertical. How can I get these to display horizontally? Optimally they would be 4 per line. Below is the PHP code which places all the "categories" into a div "nelson" ![PHP](https://i.stack.imgur.com/Cf4EJ.png) Thanks! This has been hell!
Organize div horizontally
CC BY-SA 3.0
null
2011-06-21T18:13:56.050
2011-06-21T18:29:04.663
2011-06-21T18:19:01.763
639,877
639,877
[ "php", "css" ]
6,430,008
1
6,430,070
null
0
2,859
i try to save user settings in c#. I can read the value and put it in a textbox but i can not change it. This is my WindowsForm with an textbox and a save button: ``` namespace tool { public partial class Form4 : Form { string source = Properties.Settings.Default.Source; public Form4() { InitializeComponent(); } private void Form4_Load(object sender, EventArgs e) { textBox1.Text = source; } private void textBox1_TextChanged(object sender, EventArgs e) { } private void save_Click(object sender, EventArgs e) { Properties.Settings.Default.Source = source; Properties.Settings.Default.Save(); Application.Exit(); } } } ``` And here is a picture with my settings: ![enter image description here](https://i.stack.imgur.com/cylBx.png) I hope someone as an idea :-) Thanks for help
Save user settings in c#
CC BY-SA 3.0
null
2011-06-21T18:14:50.273
2011-06-28T00:17:59.113
null
null
360,155
[ "c#", "settings" ]
6,430,234
1
null
null
0
813
> [Call to a member function on a non-object](https://stackoverflow.com/questions/54566/call-to-a-member-function-on-a-non-object) I'm doing this tutorial here: [http://tv.cakephp.org/video/webtechnick/2011/01/12/nick_baker_--_facebook_integration_with_cakephp](http://tv.cakephp.org/video/webtechnick/2011/01/12/nick_baker_--_facebook_integration_with_cakephp) I baked a new project with `cake bake facebook_app` and set the configuration database file to the correct settings and the default cakePHP screen showed that tmp directory was writable, DB setup was good, etc. I downloaded the CakePHP plugin by WebTechNick here: [https://github.com/webtechnick/CakePHP-Facebook-Plugin](https://github.com/webtechnick/CakePHP-Facebook-Plugin), and filled out app information (app_secret, app_id, etc), adding it to `facebook_app/config/facebook.php` Changed `facebook_app/app_controller.php`: ``` class AppController extends Controller { var $name = 'Facebook'; var $helpers = array('Session', 'Facebook.Facebook'); } ``` Then just exactly as in the tutorial `facebook_app/views/pages/home.ctp': ``` <h1>Facebook_App</h1> <?php $this->Facebook->share(); ?> ``` returning the error message: `Undefined property: View::$Facebook` I realize that means PHP didn't recognize Facebook as an object. But I installed the plugin! Also, it seems not MVCish to have something like `$this->Facebook->share();` in a view (home.ctp). However, this is exactly how WebTechNick does it in his tutorial (I followed it exactly 3x) and it does not work for me. I'm a complete noob at cakePHP (although I've read the entire documentation) and I'm just trying to learn and understand through examples. ![enter image description here](https://i.stack.imgur.com/ThVmB.png)
CakePHP Facebook integration tutorial "Fatal error: Call to a member function share() on a non-object"
CC BY-SA 3.0
null
2011-06-21T18:32:36.003
2012-09-24T15:32:46.177
2017-05-23T12:13:39.697
-1
712,997
[ "php", "facebook", "cakephp" ]
6,430,567
1
6,656,270
null
0
1,007
I'm building an AlertDialog that contains a custom View like so: ``` @Override protected Dialog onCreateDialog(int id) { switch (id) { case DIALOG_INTRO: // setup the dialog AlertDialog.Builder builder = new AlertDialog.Builder(this); View inflatedLayout = ((LayoutInflater) getSystemService(LAYOUT_INFLATER_SERVICE)).inflate(R.layout.intro, null); builder.setView(inflatedLayout); // return the dialog return builder.create(); } return super.onCreateDialog(id); } ``` And the layout XML: ``` <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#000000"> <TableLayout android:layout_height="match_parent" android:layout_width="match_parent" android:stretchColumns="2" android:shrinkColumns="1"> <TableRow> <TextView android:id="@+id/intro_TextView_title" android:layout_height="wrap_content" android:layout_span="2" android:gravity="center" android:text="@string/intro_title" android:textSize="22sp" android:textColor="#FFFFFF" /> </TableRow> <TableRow android:layout_marginTop="20dip" > <ImageView android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_marginLeft="25dip" android:layout_marginRight="25dip" android:paddingTop="2dip" android:src="@drawable/intro_add" /> <TextView android:id="@+id/intro_TextView_add" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="20dip" android:text="@string/intro_add" android:textColor="#FFFFFF" /> </TableRow> <!-- ... --> </TableLayout> </ScrollView> ``` That gives me a dialog that looks something like this (details blurred, sorry): ![blurred AlertDialog screenshot](https://i.stack.imgur.com/CTY03.png) The problem is that big gap at the top (above the dialog). Is there anything I can do to either get rid of it or make the bottom have a similar gap?
Android AlertDialog not centering/scaling vertically
CC BY-SA 3.0
null
2011-06-21T18:59:57.013
2011-09-27T15:02:07.577
2020-06-20T09:12:55.060
-1
76,835
[ "android", "android-alertdialog" ]
6,430,771
1
6,441,819
null
4
2,111
I can produce the below graph with either dot language using [GraphViz](http://www.graphviz.org/) directly or with the PEAR package [Image_GraphViz](http://pear.php.net/package/Image_GraphViz/) using PHP. ![graphviz png image from below code](https://i.stack.imgur.com/VJgod.png) ``` //DOT language digraph test{ URL="http://example.com/fish/"; bgcolor="#BBCAF2"; //defaults for all nodes node[style=filled, fillcolor=white, color="#8A94B4", fixedsize=true, fontname="sans-serif", fontsize=8, URL="?fish_id=\N", margin="0.02,0.02"]; //defaults for all edges edge[arrowsize=0.6, sametail=true, fontsize=8, fontname="sans-serif"]; //a few edges 57->23[color="blue"]; 42->23[color="red"]; 25->26[color="blue", label="10M"]; 25->26[color="red", label="10F"]; //etc. //a few nodes 29[label="100128 AB"]; 38[label="100730 AB"]; 39[label="110208"]; //etc. } ``` Dot files can set attribute defaults for all four element types (graph, cluster, node, edge). It appears that Image_GraphViz can only set defaults for graph level attributes. ``` <?php $gatts=array( //defaults for graph level attributes 'URL'=>"http://example.com/fish/", 'bgcolor'=>"#ff0000", 'font'=>"sans-serif", ); $gv=new Image_GraphViz(true,$gatts,'test',false,true); $q_ne="SELECT parentname, parent_id, childname, child_id, parenttype, parentcount FROM fish_crosses"; $r_ne=$dbii->query($q_ne); while($ne=$r_ne->fetch_assoc()){ $nodeatts=array('label' => $ne['parentname'], 'style'=>"filled", 'fillcolor'=>'#ffffff', 'fixedsize'=>true, 'fontname'=>"sans-serif", 'fontsize'=>8); if(!$ne['child_id']) { $gv->addNode($ne['parent_id'], $nodeatts); continue; } if($ne['parenttype']=='dam'){ $ecolor= '#ff0000'; $elabel= $ne['parentcount'].'F'; } else { $ecolor= '#0000ff'; $elabel=$ne['parentcount'].'F'; } $edgeatts=array('color'=>$ecolor, 'fontname'=>'sans-serif','fontsize'=>8); if($ne['parentcount']) $edgeatts['label']=$elabel; $gv->addEdge(array($ne['parent_id']=>$ne['child_id']), $edgeatts); $gv->addNode($ne['parent_id'], $nodeatts); $gv->addNode($ne['child_id'], $nodeatts); } echo $gv->image('png'); ?> ``` Does anyone know the syntax for adding default attribute values for nodes and edges to a Image_GraphViz object?
setting default node attributes using Image_Graphviz package
CC BY-SA 3.0
null
2011-06-21T19:17:15.883
2011-06-22T14:44:12.407
null
null
128,245
[ "php", "graphviz", "image-graphviz" ]
6,430,975
1
null
null
0
837
As pictured I see the following error when opening my page in IE9. I am on GWT 2.3.0 and IE9. ![enter image description here](https://i.stack.imgur.com/8Dct0.png)
GWT IE9 Dev Mode error
CC BY-SA 3.0
null
2011-06-21T19:35:04.763
2011-06-27T18:15:08.600
null
null
97,901
[ "gwt", "internet-explorer-9", "dev-mode" ]
6,431,262
1
6,447,997
null
3
204
I've coded a engine which is able of drawing with OpenGL ESv2 or OpenGL 3 Core Profile API. But recently the OpenGL 3 part got broken and I can't remember what I changed nor can I look in the svn commitlog, cause I did host it at bountysource which is down now and I carried it over to Google (but with broken OGL3 port). With OpenGL ESv2 everything works fine, but with OpenGL 3 everything is stretched and mirrored horizontally. Both even use the same matrices and vertices. Do not be confused. The OpenGL ESv2 and OpenGL 3 renderers use different ways to render it. OpenGL ESv2 uses VBO. OpenGL 3 uses VAO and VBO. My engine is open source, so, you can look into it here: [Source Code](http://code.google.com/p/photonlibrary/source/browse/#svn/trunk). These should be the important parts: [Sprite Class](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Graphics/Sprite.cpp), [Base Window Class](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Window/WindowBase.cpp), [GL3 Window Class](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Window/WindowWinGL3.cpp), [GL ESv2 Window Class](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Window/WindowWinGLES.cpp) Shaders: GLv2: [frag](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Graphics/esshader.frag), [vert](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Graphics/esshader.vert) GL3: [frag](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Graphics/shader.frag), [vert](http://code.google.com/p/photonlibrary/source/browse/trunk/src/Photon/Graphics/shader.vert) Here are some example pictures: ![OpenGL 3 - Menu](https://i.stack.imgur.com/f6uUQ.png) ![OpenGL 3 - Ingame](https://i.stack.imgur.com/ns9lf.png) ![OpenGL ESv2 - Menu](https://i.stack.imgur.com/7nVVk.png) ![OpenGL ESv2 - Ingame](https://i.stack.imgur.com/INXos.png) I would be really, really glad and thankful if someone would deliver me the solution to this problem and maybe I would give a small reward for it. edit: with a 480x800 window, gldebugger shows this matrix: modviewmat {1, -0, 0, 0} {0, 1, 0, 0} {0, 0, 1, 0} {5, 770, 0, 1} projmat {2, 0, 0, 0} {0, 2, 0, 0} {0, 0, -1, 0} {-1, -1, -0, 1}
Same game in OGL ESv2 doesnt work with OGL3
CC BY-SA 3.0
null
2011-06-21T19:59:08.930
2011-06-23T00:40:03.820
2020-06-20T09:12:55.060
-1
730,223
[ "c++", "opengl", "opengl-es", "opengl-es-2.0", "opengl-3" ]
6,431,568
1
6,433,532
null
6
31,984
I don't understand why I cannot display an image in WPF. Maybe I modified my resources folder accidentally and that is the reason why I does not get displayed. So I created a new wpf application and I have this: ![enter image description here](https://i.stack.imgur.com/QTkD4.png) and when I run the program my picture gets displayed as: ![enter image description here](https://i.stack.imgur.com/Q2AWb.png) Why is it that when I try doing the same thing in my program the image does not show up!? ![enter image description here](https://i.stack.imgur.com/Lr253.png) note how when I run the program there is no image... ![enter image description here](https://i.stack.imgur.com/Bxijk.png) In my other application I just dragged the image control to my main window and then I browsed for a random image on my computer and when I complied and run it it works fine. Why is it that I cannot do the same with the application that I am working with? --- EDIT: with some images it works and with others it does not! why? take a look: ![enter image description here](https://i.stack.imgur.com/IEdt1.png) and when I compile and run one image does not show up! ![enter image description here](https://i.stack.imgur.com/0hjqG.png) and also take a look and see how the files have the same properties. settings for folder image: ![enter image description here](https://i.stack.imgur.com/LAwjX.png) settings for mov image: ![enter image description here](https://i.stack.imgur.com/EhWdi.png)
image problem in wpf (image does not show up)
CC BY-SA 3.0
0
2011-06-21T20:28:08.840
2018-02-02T02:43:21.960
2011-06-21T22:43:09.073
637,142
637,142
[ "c#", "wpf", "resources", "embedded-resource" ]
6,432,197
1
6,435,422
null
5
894
I am working in WPF in .Net 4.0. I have some huge images from camera 1392x1040 pixels. Every frame comes as `System.Drawing.Bitmap` and will be converted into a BitmapImage by using ``` Public Function BitmapToWpfBitmapSource(ByVal bmSrc As System.Drawing.Bitmap) As BitmapSource If bmSrc Is Nothing Then Return Nothing Dim res As BitmapSource Dim Ptr As IntPtr Ptr = bmSrc.GetHbitmap(System.Drawing.Color.Black) 'Create GDI bitmap object res = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(Ptr, IntPtr.Zero, System.Windows.Int32Rect.Empty, BitmapSizeOptions.FromWidthAndHeight(bmSrc.Width, bmSrc.Height)) Dim ret As Integer = DeleteObject(Ptr) 'Delete GDI bitmap object GC.Collect() 'Because the code is not managed, we need to call the collector manually to avoid memory spikes Return res End Function ``` If I update the images in GUI I can get about 7 frames / second. ![image framerate count](https://i.stack.imgur.com/c2PGO.png) There were some possibilities to increase speed by decreasing quality: - `RenderOptions.SetBitmapScalingMode(Me.ucWindow1.VideoPresenter1.img1, BitmapScalingMode.NearestNeighbor)` - Work with threads to update every frameDim dl As New SetImageDelegate(AddressOf UpdateImageInGuiGuiThread) Me.Dispatcher.Invoke(dl, imgSrc)- Tested with 32Bit and 24Bit images - [compare Imageformat](https://stackoverflow.com/questions/6198816/what-is-better-to-use-in-dotnet-rgb24-or-rgb32-for-performance) Using [Performance profiling suite](http://msdn.microsoft.com/en-us/library/aa969767.aspx) for framerate count But CPU is still about 10% and not 100% and framerate is about 12FPS maximum instead of 39 (Winforms). How to improve framerates from camera?
Performance update - Better image framerate in WPF
CC BY-SA 3.0
0
2011-06-21T21:26:32.940
2012-09-08T18:50:49.293
2017-05-23T11:55:51.823
-1
375,368
[ ".net", "wpf", "performance", "image", "image-processing" ]
6,433,349
1
6,597,395
null
1
64
My detail panel is hidden in TortoiseHg 2.0.4. I have tried looking at the options in view and tried selecting various options like "Revision Details" or "Commit", but nothing shows up. How can I make it appear again? ![enter image description here](https://i.stack.imgur.com/qq3MW.png) (Screenshot has had details erased)
Hidden detail panel in TortoiseHg
CC BY-SA 3.0
null
2011-06-21T23:50:48.523
2013-05-06T03:02:37.157
2011-06-21T23:56:29.317
165,495
165,495
[ "tortoisehg" ]
6,433,381
1
6,435,313
null
4
3,026
I have a list of TitledBorder panels that contain textfields that represents point. I've just been asked to add a button to the panel with the TitledBorder, that will alow me delete the panel and its contents. so how can I add a button in the top right corner of a panel with TitledBorder? --- edit here is what I have ![enter image description here](https://i.stack.imgur.com/UJeTn.png) and here is what I would like to add (sorry this no professional photoshop quality :P) ![enter image description here](https://i.stack.imgur.com/fItO5.jpg)
Java Swing: adding button to TitledBorder
CC BY-SA 3.0
null
2011-06-21T23:56:52.820
2011-06-22T05:28:24.473
2011-06-22T00:47:11.200
440,336
440,336
[ "java", "swing", "jpanel", "jbutton", "titled-border" ]
6,433,489
1
null
null
0
404
I am attempting to add a Line to an existing header in the following conceptual model through entity framework. ![data model](https://i.stack.imgur.com/Dvcds.png) I have exposed this model through a wcf data service. I am attempting to add a record like this: ``` SampleModelContainer context = new SampleModelContainer(new Uri("http://localhost:57588/WcfDataService1.svc")); Line newLine = new Line(); newLine.item = 123; // Generate new LineId newLine.LineId = context.Lines.ToList().Last().LineId + 1; // Grab a random header (doesn't matter right now) newLine.Header = context.Headers.ToList().First(); context.AddToLines(newLine); context.SaveChanges(); ``` This fails with an error that states that my HeaderId must not be null. However, shouldn't this be filled in by EF because I set the navigation property? If I fill in the HeaderId, it works, but I don't want to set that every time. Any ideas on what I'm doing wrong? Added connection string
Entity Framework won't set FKs when creating a new record
CC BY-SA 3.0
null
2011-06-22T00:17:21.950
2011-12-04T00:44:32.347
2011-12-04T00:44:32.347
84,042
790,006
[ ".net", "wcf", "entity-framework" ]
6,433,536
1
6,440,578
null
2
18,408
I've noticed while using Google Chrome that if a website such as Facebook, YouTube or Google Docs is inaccessible a certain error page that says "" is served, like the one below. ![enter image description here](https://i.stack.imgur.com/qaYQP.png) Is this internal to Chrome or is it part of an offline web app manifest file?
How are "The app is currently unreachable" error pages served?
CC BY-SA 3.0
0
2011-06-22T00:24:21.163
2017-08-08T10:13:01.483
null
null
154,877
[ "web-applications", "google-chrome", "offline" ]
6,433,720
1
6,443,762
null
2
2,077
I am working with CSS sprites and the jQuery plugin [spritely](http://www.spritely.net/). I have a Super Mario image and when rolled over, I'd like the animation to play. When, you move your mouse away from the Super Mario (which is a `<div>` element), I would like the animation to play in reverse back to the original place it started. Here is what I have so far: ``` <!DOCTYPE html> <html> <head> <title>Mario Planet Spritely Nav</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script> <script src="jquery.spritely-0.5.js"></script> <script> $(document).ready(function() { $('#mario').hover( function() { $('#mario').sprite({ fps: 2, no_of_frames: 6, play_frames: 6 }); }, function() { $('#mario').sprite({ fps: 2, no_of_frames: 6, play_frames: 5, rewind: true }); } ); }); </script> <style> #mario { position: absolute; width: 40px; height: 52px; background: transparent url(mh.png); cursor: pointer; } </style> </head> <body> <div id="mario"></div> </body> </html> ``` I have the fps intentionally slow so I can try and figure out what's going on here. For some reason, the first hover and mouseout work great. But then, during the second hover, something weird happens. It appears to play an extra frame. I don't understand why. Here is my `mh.png` image (I don't have a current webserver to show a live demo): ![mh.png](https://i.stack.imgur.com/pAtFt.png) Do you guys have any idea as to why this is occurring? Thanks.
Why does jQuery spritely animation plays an extra frame on second mouseenter?
CC BY-SA 3.0
null
2011-06-22T00:54:11.360
2012-12-28T15:35:03.807
null
null
403,965
[ "javascript", "jquery", "css-sprites" ]
6,433,760
1
6,434,094
null
2
1,072
I'd like to pack my zodb. I've logged into the zmi from mydomain.com/manage. I used the username 'admin' and the password I specified in the buildout, and it succeeded. However control_panel is not listed when I click on '/' (nor is the site name). What am I missing here? ![enter image description here](https://i.stack.imgur.com/h1I1Z.png)
Control panel and site not listed in zmi, where is it?
CC BY-SA 3.0
null
2011-06-22T00:59:28.760
2011-06-22T10:37:39.790
null
null
573,373
[ "plone" ]
6,433,780
1
6,433,979
null
3
383
I'm working on asset tracking application. I have devices that send update on GPS position every ~5 minutes. Now I need to create report that shows me when asset started to move, when stopped and for how long, etc. Basically, I need to GROUP this data. Problem I have is that GPS data not accurate. If device laying on a same spot - it will send different lat/lon with different accuracy creating noisy data. What is the most efficient way to analyze such data? Or maybe there is ways to make it "clean" as I collect it? Any suggestions? Little bit open-ended question but I'd like any ideas you can give me :) ![enter image description here](https://i.stack.imgur.com/TwxRl.png)
How can efficiently I detect location changes with noisy GPS data?
CC BY-SA 3.0
0
2011-06-22T01:03:24.767
2011-06-22T03:24:22.310
2011-06-22T01:15:54.353
9,453
509,600
[ "sql", "gps", "geospatial" ]
6,433,923
1
6,434,355
null
0
274
I'm encountering a pretty strange problem when creating a CGImageRef from raw data on iphone. I'm trying to create a CGImageRef from a perlin noise generating function that takes x, y, z, and t and returns a value between -1 and 1. For each pixel, I get the noise value between -1 and 1, convert this to a char between 0 and 255, and create a CGImageRef out of the data in the following way... ``` int width = (int)frame.size.width; int height = (int)frame.size.height; char* rgba = (char*)malloc(width * height * 4); //set pixel data int i = 0; for(float x = 0.0; x < width; x+=1.0) { for (float y = 0.0; y < height; y+=1.0) { float perlinF = ABS([perlinGenerator perlinNoiseX:x y:y z:0.0 t:0.0]); char perlin = (char)( perlinF * 255.0 ); rgba[4*i] = perlin; rgba[4*i+1] = perlin; rgba[4*i+2] = perlin; rgba[4*i+3] = 255; i++; } } CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef bitmapContext = CGBitmapContextCreate( rgba, width, height, 8, // bitsPerComponent 4*width, // bytesPerRow colorSpace, kCGImageAlphaNoneSkipLast); CGImageRef cgImage = CGBitmapContextCreateImage(bitmapContext); ``` If I then draw this CGImageRef to a CALayer, I get the following result... ![CGImageRef created from data](https://i.stack.imgur.com/X6mLR.png) The horizontal artifacts were created by my screen capture (not in the actual image), however those 2 vertical lines that split the image into 3 identical sections are the problem! What could cause the image to repeat 3 times at and have those 2 vertical discontinuities?! Even stranger is that if I render the perlin noise manually without creating a CGImageRef, like this... ``` for (CGFloat x = 0.0; x<size.width; x+=1.0) { for (CGFloat y=0.0; y< size.height; y+=1.0) { float perlinF = ABS([perlinGenerator perlinNoiseX:x y:y z:0.0 t:0.0]); char perlin = (char)( perlinF * 255.0 ); CGContextSetRGBFillColor(context, 1.0, 1.0, 1.0, (float)perlin / 255.0); CGContextFillRect(context, CGRectMake(x, y, 1.0, 1.0)); } } ``` Note, I purposely casted to char and then divided by 255.0 to make sure that the cast to char wasn't causing the problem. Anyway, I get the following result... ![Drawing noise manually](https://i.stack.imgur.com/itj0H.png) So you seem I'm creating the noise exactly the same in both of the above approaches, and I've even printed the values from each method side by side to confirm that they are identical! So Somehow creating a CGImageRef out of the data rather than drawing it straight to a context is create weird visual problems that destroy the image. I need to be able to generate a series of these images at application start and cannot manually draw them to get the good results. Anyone have any idea what could cause such problems???
Strange CGImage creation problem
CC BY-SA 3.0
null
2011-06-22T01:30:26.413
2012-02-16T06:12:57.053
null
null
418,925
[ "iphone", "core-graphics", "cgimage", "perlin-noise" ]
6,434,005
1
7,061,127
null
9
1,226
i have portions of my program that require administrative access (settings that affect all users, stored in HKLM, and are limited to administrative access). i've changed my software to indicate that elevation is required: ![enter image description here](https://i.stack.imgur.com/c6q8p.jpg) In response i am going to launch my executable while prompting for elevation: ``` SHELLEXECUTEINFO shExecInfo; shExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); shExecInfo.fMask = NULL; shExecInfo.hwnd = NULL; shExecInfo.lpVerb = L"runas"; shExecInfo.lpFile = L"myapp.exe"; shExecInfo.lpParameters = NULL; shExecInfo.lpDirectory = NULL; shExecInfo.nShow = SW_MAXIMIZE; shExecInfo.hInstApp = NULL; ShellExecuteEx(&shExecInfo); ``` What i was to do is pass the name of a named pipe on the command line, telling myself where it can connect back to in order to get instructions on what it's supposed to be doing: ``` myapp.exe /uac 6C844671-E262-46DD-939E-47517F105FB6 ``` (Yes, using a GUID as the name of the pipe). Through this pipe i would tell my elevated clone what database, e.g.: - - - My concern was then that anyone could launch `myapp.exe`, and then feed it all kinds of requests - things i don't want it to do cause didn't launch it, e.g.: : ``` ShellExecute("myapp.exe /uac HahaYouDoWhatISayNow") ``` i remember during the Longhorn beta there was a Channel9 video, or an article, talking about UAC and the dangers of the wrong of doing IPC (Inter-process communication). i don't want to re-invent the wheel, making security mistakes that have already been solved. But i cannot find any existing guidance on the "" way to do IPC with UAC elevation. What't he accepted pattern for doing IPC to communicate with spawned elevated process for temporary elevated actions? --- Combined followers of `uac` and `ipc` tags: 53
How to do IPC with UAC elevation safely?
CC BY-SA 3.0
0
2011-06-22T01:44:27.010
2011-08-15T02:12:21.263
null
null
12,597
[ "windows", "security", "design-patterns", "ipc", "uac" ]
6,434,082
1
6,434,224
null
1
3,584
## Problem - - - - If you do this you can see that the new first item is disabled. See the attached screenshots: ![Before filtering](https://i.stack.imgur.com/4fRTE.png) ![After filtering](https://i.stack.imgur.com/RjRw5.png) The problem is that when the ListView filters actually changes the position of the items so the item that use to have position 10 now has position 0 which is what causes the problem. So how do I best work around this? Below is the smallest possible sample code that demonstrates the problem, just filter for something other than the first three items. ``` package com.example.bug; import android.app.ListActivity; import android.os.Bundle; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; public class CustomListActivity extends ListActivity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); String items[] = new String[100]; for(int i = 0; i < items.length; ++i) items[i] = "Item " + (i+1); setListAdapter(new ArrayAdapter<String>(this, R.layout.list_item, items) { @Override public View getView(int position, View convertView, ViewGroup parent) { View view = super.getView(position, convertView, parent); view.setEnabled(isEnabled(position)); return view; } @Override public boolean areAllItemsEnabled() { return false; } @Override public boolean isEnabled(int position) { return position >= 3; } }); getListView().setTextFilterEnabled(true); } } ``` ``` <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.example.bug"> <uses-sdk android:minSdkVersion="7" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <activity android:name="CustomListActivity" android:label="@string/app_name"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest> ``` ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_enabled="false" android:color="#777" /> <item android:color="#fff" /> </selector> ``` ``` <?xml version="1.0" encoding="utf-8"?> <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="10sp" android:textSize="16sp" android:textColor="@color/list_item_colors" /> ```
Having disabled items in a ListView with filtering
CC BY-SA 3.0
0
2011-06-22T01:58:57.370
2011-06-25T05:17:47.643
null
null
699,304
[ "android", "listview" ]
6,434,097
1
null
null
0
89
I am trying to develop an application with mini app inside it. The main application functions like an platform (OS) which allows mini apps (Software) to be installed inside it. How should I design such application? This main application has some basic functionality while the mini app provides some additional functions. (Update) Included a picture for clearer information. ![enter image description here](https://i.stack.imgur.com/YBOhv.png)
Apps inside app
CC BY-SA 3.0
null
2011-06-22T02:01:35.907
2011-06-22T08:00:10.587
2011-06-22T08:00:10.587
387,736
387,736
[ "c#", "wpf" ]
6,434,178
1
6,434,953
null
8
7,169
There are several places that talk about how to get an icon from a file extension such as [this](http://www.codeproject.com/KB/files/fileicon.aspx) one and [this other](http://www.codeproject.com/KB/cs/GetFileTypeAndIcon.aspx) one. After several hours of playing around with this kind of projects I have managed to build something like: ``` private void addButton_Click(object sender, System.EventArgs e) { System.Drawing.Icon temp = IconReader.GetFileIcon(".cs", IconReader.IconSize.Large, false); pictureBox1.Image = temp.ToBitmap(); } ``` the execution of that button gets me: ![enter image description here](https://i.stack.imgur.com/T2TQm.png) but I am trying to actually get the large icon. Note how the icons on windows are much bigger: ![enter image description here](https://i.stack.imgur.com/LBZcU.png) How could I get that icon instead of the smaller one. I have spend so much time changing the other programs. Moreover I will like to make it work with wpf and most of the examples are with windows forms. I would appreciate if I can get an example of how to extract a files icon instead of modifying and entire project. If that is not possible that would still be very helpful and I will appreciate. It's just that I am not that good of a programmer and it took me a lot of time to modify the other examples.
Get large icon from file extension
CC BY-SA 3.0
0
2011-06-22T02:16:07.720
2016-09-29T09:16:01.470
null
null
637,142
[ "c#", "wpf", "icons", "file-extension" ]
6,434,273
1
6,435,203
null
1
511
Is it possible to show users custom message with a single OK button in a Facebook-style dialog box, say, in an iframe app? Is this dialog box available in the Facebook (Javascript) API? Example: ![enter image description here](https://i.stack.imgur.com/8ZKfM.png)
Facebook popup dialog available?
CC BY-SA 3.0
null
2011-06-22T02:34:27.543
2011-06-22T05:15:50.233
null
null
88,597
[ "facebook" ]
6,434,284
1
6,434,964
null
13
13,133
I need to build a function drawing gridline on the canvas in WPF: ![example gridline](https://i.stack.imgur.com/XHVJv.png) ``` void DrawGridLine(double startX, double startY, double stepX, double stepY, double slop, double width, double height) { // How to implement draw gridline here? } ``` How would I go about this?
How to draw gridline on WPF Canvas?
CC BY-SA 3.0
0
2011-06-22T02:36:01.537
2013-08-19T23:15:19.230
2011-06-22T02:42:20.613
105,971
772,580
[ "c#", "wpf", "algorithm", "draw" ]
6,434,335
1
null
null
1
11,399
This is what I usually do when I want to open a new form from a ToolStripMenu ``` private void alumnoToolStripMenuItem_Click(object sender, EventArgs e) { frmAlumno x = new frmAlumno(); x.ShowDialog(); } ``` but a teacher told me that it´s wrong because this shouldn´t happen.. ![Image](https://i.stack.imgur.com/aJ7Gw.jpg) So I guess I have to use MdiContainer but I´m not sure of how to write the code now... Please some help...
How to use MdiContainer
CC BY-SA 3.0
null
2011-06-22T02:43:58.163
2011-06-22T18:00:50.287
2011-06-22T18:00:50.287
732,945
647,399
[ "c#", ".net", "winforms", "mdi" ]