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
5,432,395
1
5,442,036
null
7
1,566
Is there any way to create a custom `FrameworkContentElement` (or an `Inline`) that draws a diagonal line over its content? Something like Strike-through decoration but with a diagonal shape: ![example of strike-through and diagonal decorations](https://i.stack.imgur.com/OqEK2.png) It is not possible to inherent from `TextDecoration` or `TextEffect` (they are sealed). Any idea?
Create custom FrameworkContentElement to add diagonal line over text in WPF
CC BY-SA 2.5
0
2011-03-25T12:27:12.440
2011-11-18T03:16:16.093
null
null
383,515
[ "wpf", "custom-controls", "inline", "decorator", "effects" ]
5,432,449
1
5,432,588
null
0
117
when I want to save a T4 template Visual studio return me this warning below: ![Warning](https://i.stack.imgur.com/pjrqi.jpg) What does this mean? Visual Studio 2010 (installed service pack) Windows 7 64 bit
T4 Visual studio 2010 Warning Error
CC BY-SA 4.0
null
2011-03-25T12:32:24.340
2018-05-09T03:11:09.583
2018-05-09T03:11:09.583
1,033,581
369,161
[ "visual-studio", "visual-studio-2010", "t4" ]
5,432,749
1
5,433,056
null
0
2,996
I have a Gridview like this; ![enter image description here](https://i.stack.imgur.com/lQS3j.png) In my .cs file i calculate value of `BV`, `MV`, `KV` total value with this code and i assign to a `Label`. Labels are under the `Gridview`. BUT, some customer names long some of short, because of that, labels location changing according to `Gridview`. Because of that i don't want use `Label`. I calculate a value with this code, and how can i assing BV, MV and KV columns footer this value? ``` double sumRISK = 0; foreach (GridViewRow gvr in GridView1.Rows) { CheckBox cb = (CheckBox)gvr.FindControl("NameCheckBoxField1"); if (cb.Checked == true) { double amountBV = Convert.ToDouble(gvr.Cells[7].Text); if (amountBV != -1) { sumRISK += amountBV; } } } RISK_Label.Text = String.Format("{0:n}", sumRISK); ```
Assign a value to special footer column in Gridview
CC BY-SA 2.5
0
2011-03-25T13:02:05.680
2011-03-25T13:40:32.017
null
null
447,156
[ "c#", ".net", "asp.net", "gridview" ]
5,432,854
1
5,437,910
null
1
376
I'm super new to rails and javascript, I have a table of venues with each belonging to a type and an area. They are displayed as partials on the index page and also each has its own icon on a map to the left of the screen. I have just added a new table of mapicons which just holds an image uploaded using paperclip to my app so each venuetype has a differant icon. This all works fine however the javascript I was using to place the icons on the map breaks when I include the new mapicon. ``` <%= link_to venue do %> <div class="venue_partial"> <span class="venue_partial_name"><%= venue.name %></span> <div id="venue_map_icon_<%= venue.id %>" class="venue_map_icon" style="position:absolute;"></div> </div> <% end %> <script type="text/javascript"> document.getElementById("venue_map_icon_<%= venue.id %>").style.left= "<%= venue.iconleftpx %>px"; document.getElementById("venue_map_icon_<%= venue.id %>").style.top= "<%= venue.icontoppx %>px"; </script> ``` Displays the map icon correctly on the map but as black stars as I have set in the css. ``` <%= link_to venue do %> <div class="venue_partial"> <span class="venue_partial_name"><%= venue.name %></span> <div id="venue_map_icon_<%= venue.id %>" <%= image_tag venue.venuetype.mapicon.mapicon.url(:mapicon), :style => "position:absolute;", :class => "venue_map_icon" %></div> </div> <% end %> <script type="text/javascript"> document.getElementById("venue_map_icon_<%= venue.id %>").style.left= "<%= venue.iconleftpx %>px"; document.getElementById("venue_map_icon_<%= venue.id %>").style.top= "<%= venue.icontoppx %>px"; </script> ``` Displays the correct mapicons that I uploaded and assigned to each venuetype but they are positioned at the top right corner of their venue partial and not on the map to the left of the screen. Hope I've asked this well, any clarification needed please ask. Thanks for any help its much appreciated! Heres a couple of screenshots I hope will help, The first is how the mapicons are currently. The venue partials show as Tester1, Tester2 etc with a large coloured icon to the left of the name, the grayed lettering under the name is the type (Type 1, 2 or 3). And the map icons are the black stars to the left positioned absolutely with the top and left values taken from their respective venue records. ![enter image description here](https://i.stack.imgur.com/8vDQU.jpg) The second screenshot is when I change the code as shown above, the partials show the same but the mapicons instead of being black stars show correctly as smaller coloured squares but aren't positioning correctly. They are sticking to the top right corner of their own venue partials. ![enter image description here](https://i.stack.imgur.com/YvtjF.jpg) This is what I want it to display as: (this is a mocked-up image) ![enter image description here](https://i.stack.imgur.com/Lh2zQ.jpg) The CSS for the mapicons is just: ``` .venue_map_icon { width: 19px; height: 18px; padding: none; margin: none; background-image:url(/images/mapicon.png); border: none; } .venue_map_icon:hover { background-image:url(/images/mapicon_hover.png); } ``` Venues ``` class Venue < ActiveRecord::Base belongs_to :venuetype end ``` Venuetypes ``` class Venuetype < ActiveRecord::Base has_many :venues belongs_to :mapicon has_attached_file :icon, :styles => { :thumb=> "100x100>", :small => "150x150>", :medium => "300x300>", :large => "400x400>" }, :default_url => '/images/noimage.png' end ``` Mapicons ``` class Mapicon < ActiveRecord::Base has_many :venuetypes has_attached_file :mapicon, :styles => { :large => "640x480", :medium => "300x300", :thumb => "100x100", :mapicon => "20x20" } end ```
How can I absolutely position a related image_tag?
CC BY-SA 2.5
0
2011-03-25T13:10:50.297
2011-03-25T20:41:19.247
2011-03-25T18:24:33.970
570,613
570,613
[ "javascript", "jquery", "ruby-on-rails", "activerecord", "css-position" ]
5,432,882
1
null
null
1
243
I'm having trouble on adding a UserControl to my Form. UserControl Code: ``` using System; using System.Windows.Forms; namespace Most.Mobile.AFV.UI.Controls { public partial class ListActionBar : UserControl { public ListActionBar() { InitializeComponent(); } public bool ShowKeyboardButton { get { return mtbKeyboard.Visible; } set { mtbKeyboard.Visible = value; } } public bool ShowOpenButton { get { return mtbMenu.Visible; } set { mtbMenu.Visible = value; } } public bool ShowDeleteButton { get { return mtbDelete.Visible; } set { mtbDelete.Visible = value; } } public bool ShowBackButton { get { return mtbBack.Visible; } set { mtbBack.Visible = value; } } public bool ShowEditButton { get { return mtbEdit.Visible; } set { mtbEdit.Visible = value; } } public bool ShowNewButton { get { return mtbNew.Visible; } set { mtbNew.Visible = value; } } public event EventHandler NewClick; public event EventHandler DeleteClick; public event EventHandler EditClick; public event EventHandler OpenClick; private void mtbBack_Click(object sender, EventArgs e) { if (Parent == null) return; if (Parent is Form) (Parent as Form).DialogResult = DialogResult.Cancel; } private void mtbKeyboard_Click(object sender, EventArgs e) { inp.Enabled = !inp.Enabled; } private void mtbNew_Click(object sender, EventArgs e) { if (NewClick != null) NewClick(sender, e); } private void mtbEdit_Click(object sender, EventArgs e) { if (EditClick != null) EditClick(sender, e); } private void mtbDelete_Click(object sender, EventArgs e) { if (DeleteClick != null) DeleteClick(sender, e); } private void mtbMenu_Click(object sender, EventArgs e) { if (OpenClick != null) OpenClick(sender, e); } } } ``` Below a picture of the error ![Error image](https://i.stack.imgur.com/cetNl.jpg) Error description: Failed to create component '' 'System.IO.FileLoadException:Could not load file or assembly 'Microsoft.WindowsCE.Forms, Version=3.5.0.0, CUlture=neutral, PublicKeyToken=969db8053d3322ac' or one of its dependencies.
Error on trying add UserControl into my Form
CC BY-SA 2.5
null
2011-03-25T13:13:08.627
2011-03-25T13:16:48.203
null
null
491,181
[ "forms", "user-controls", "windows-mobile", "compact-framework", ".net-cf-3.5" ]
5,433,339
1
5,434,544
null
1
90
I have a working app that I have ran on the iPhone countless times. Everything has worked and the app will run on the iPad in compatibility mode. The problem came when I duplicated my iPhone target and hit "Transion to iPad" When building to my iPad device I get 1 error - Apple Mach-O Linker Error.Does anyone have any advice on a fix for this? ![Screen shot 2011-03-24 at 9.48.29 PM.png](https://i.stack.imgur.com/trG8E.png) Thanks Tanner
Fully Working iPhone Project Fails When Transioned To iPad
CC BY-SA 2.5
0
2011-03-25T13:50:10.923
2011-03-25T15:32:21.807
2011-03-25T14:43:14.893
458,489
458,489
[ "ipad", "ios4", "xcode4" ]
5,433,345
1
5,449,628
null
0
160
I created a UIViewController (based on [How to switch views when rotating](https://stackoverflow.com/questions/2267117/how-to-switch-views-when-rotating)) to switch between 2 views when the device rotates. Each view is "specialized" for a particular orientation. It uses the UIDeviceOrientationDidChangeNotification notification to switch views: ``` -(void) deviceDidRotate: (NSNotification *) aNotification{ UIDeviceOrientation orientation = [[UIDevice currentDevice] orientation]; NSLog(@"Device rotated to %d!", orientation); if ((orientation == UIDeviceOrientationPortrait) || (orientation == UIDeviceOrientationPortraitUpsideDown)) { [self displayView:self.portraitViewController.view]; }else if ((orientation == UIDeviceOrientationLandscapeLeft) || (orientation == UIDeviceOrientationLandscapeRight)) { [self displayView:self.landscapeViewController.view]; } } ``` and sort of works. The problems shows up when I rotate to Landscape and then back to Portrait. When going back to portrait the subviews aren't displayed in the right place, specially the UIPickerView: : ![enter image description here](https://i.stack.imgur.com/k7REc.png) : ![enter image description here](https://i.stack.imgur.com/4WNUx.png) : ![enter image description here](https://i.stack.imgur.com/N2qv0.png) If I repeat the rotation process, things just get worse. What am I doing wrong? The source code is here: [http://dl.dropbox.com/u/3978473/forums/Rotator.zip](http://dl.dropbox.com/u/3978473/forums/Rotator.zip) Thanks in advance!
Views moved out of place when rotating
CC BY-SA 2.5
null
2011-03-25T13:50:35.053
2011-03-27T13:52:01.887
2017-05-23T10:30:21.840
-1
74,415
[ "uiview", "uiviewcontroller", "uipickerview" ]
5,433,459
1
null
null
0
1,383
Is there any possibility to add notification in android tab bar like in iPhone Badges for tabs. I am not mean notification.Here i will place the iPhone badges screen shot also.![enter image description here](https://i.stack.imgur.com/H51RT.jpg) If badges is not available in android, is placing a view in front of tab bar a fine solution?
Android Tab Bar
CC BY-SA 2.5
0
2011-03-25T14:00:53.613
2013-08-11T12:12:49.433
2011-03-28T05:13:06.520
454,665
454,665
[ "android" ]
5,433,726
1
5,434,080
null
0
806
Can you comment on the below design. Am I setting myself up for destruction with this sort of design? I have been designing systems over and over again because of completely new requirements that can't be hacked in designs so now I'm looking long term solution to have the most flexible system. With this design I could dynamically create complexity and designs like below now I realize the implementation won't be straight forward so before I spend days on it I wanted to get some real input. Is that a common no-no or is that common? Any input would be appreciated. ![schema](https://i.stack.imgur.com/qWwWS.jpg) ``` instance firstname bob lastname gates scoreone 20 scoretwo 90 scorethree scorethreePart1 30 scoreThreePart2 32 CREATE DATABASE uni; use uni; CREATE TABLE instance ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ParentID INT DEFAULT NULL, FOREIGN KEY (ParentID) REFERENCES instance(ID) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE keyval_connector ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ParentID INT NOT NULL, TextKey VARCHAR(255) NOT NULL, Note TEXT DEFAULT NULL, UNIQUE(ParentID, TextKey), FOREIGN KEY (ParentID) REFERENCES instance(ID) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE keyval_int ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ParentID INT NOT NULL, Value INT DEFAULT NULL, UNIQUE(Value), FOREIGN KEY (ParentID) REFERENCES keyval_connector(ID) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE keyval_varchar ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ParentID INT NOT NULL, Value VARCHAR(255) DEFAULT NULL, UNIQUE(Value), FOREIGN KEY (ParentID) REFERENCES keyval_connector(ID) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE keyval_double ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ParentID INT NOT NULL, Value DOUBLE DEFAULT NULL, UNIQUE(Value), FOREIGN KEY (ParentID) REFERENCES keyval_connector(ID) ON DELETE CASCADE ) ENGINE=InnoDB; CREATE TABLE keyval_datettime ( ID INT NOT NULL AUTO_INCREMENT PRIMARY KEY, ParentID INT NOT NULL, Value DATETIME DEFAULT NULL, UNIQUE(Value), FOREIGN KEY (ParentID) REFERENCES keyval_connector(ID) ON DELETE CASCADE ) ENGINE=InnoDB; ```
universal db schema
CC BY-SA 3.0
null
2011-03-25T14:23:42.483
2017-12-13T15:24:08.007
2017-12-13T15:24:08.007
4,284,627
391,986
[ "mysql" ]
5,433,734
1
11,002,047
null
5
2,201
I have a view with 1 dropdown generated from Model property and 3 additional dropdowns that are generated from array property ``` @Html.DropDownListFor(m => m.AgentType, Model.AgentTypeListItems) @for (int i = 0; i < Model.AgentTypes.Length; i++) { @Html.DropDownListFor(m => m.AgentTypes[i], Model.AgentTypeListItems) } ``` The controller method initializes AgentTypeListItems collection + sets default values for AgentType dropdown and 3 dropdowns for the collection: ``` var model = new OptionsViewModel(); // for DropDownListFor model.AgentTypeListItems = new[] { new SelectListItem { Text = "1", Value = "1" }, new SelectListItem { Text = "2", Value = "2" }, new SelectListItem { Text = "3", Value = "3" }, }; // 1 dropdown in the model model.AgentType = "2"; // 3 dropdowns in array model.AgentTypes = new[] { "3", "2", "1" }; return View(model); ``` When I open it in browser I get "2" everywhere though AgentTypes array was initialized with different values(!): ![this is wrong](https://i.stack.imgur.com/2HSvi.png) When I replace DropDownListFor with TextBoxFor: ``` @Html.TextBoxFor(m => m.AgentTypes[i]) ``` I get the correct values in the inputs (!): ![this is how it should be](https://i.stack.imgur.com/hJbDQ.png) It means the TextBoxFor works as expected, but DropDownListFor doesn't. Is it a bug in MVC DropDownListFor? Here is the model class: ``` public class OptionsViewModel { public SelectListItem[] AgentTypeListItems { get; set; } public string AgentType { get; set; } public string[] AgentTypes { get; set; } } ```
ASP.NET MVC bug binding collection of DropDownList?
CC BY-SA 2.5
0
2011-03-25T14:24:50.780
2013-03-21T19:38:06.733
2013-03-21T19:38:06.733
727,208
149,288
[ "asp.net-mvc", "collections" ]
5,434,237
1
5,434,666
null
0
712
I have a problem with EXC_BAD_ACCESS. I have a UIWebView that loads a local HTML file and as the app is loading the contents of the view I display a UIView on top of it as a "splash screen". Then when the contents of the UIWebView are loaded I run an animation to fade-out the UIView and remove it from memory. ``` - (void) webViewDidFinishLoad:(UIWebView *)webView { [UIView animateWithDuration:1 animations:^{ loadingView.alpha = 0.0; } completion:^(BOOL finished){ [loadingView removeFromSuperview]; [loadingView release]; }]; } ``` The issue is, that when I use the my app fails on the two lines within the completion method. The full error: ``` Program received signal: “EXC_BAD_ACCESS”. warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.3 (8F190)/Symbols/Developer/usr/lib/libXcodeDebuggerSupport.dylib (file not found). ``` The loadingView is built through interface builder. Here's the heirarchy: ![Image](https://i.stack.imgur.com/kYsdl.png)
EXC_BAD_ACCESS when removing a view
CC BY-SA 2.5
null
2011-03-25T15:00:34.010
2011-03-25T15:34:38.363
2011-03-25T15:22:04.770
418,146
418,146
[ "objective-c", "uiview", "exc-bad-access" ]
5,434,550
1
5,434,633
null
1
2,214
Why `information_schema.columns` always duplicates the result? For instance, ``` SELECT column_name FROM information_schema.columns WHERE table_name = 'root_blocks' ``` I will get this, ``` column_name blc_id blc_email cat_id blc_created blc_updated blc_id blc_email cat_id blc_created blc_updated ``` The duplicates go unpredictable on other tables when I try to query through phpmyadmin. How can I make it not to duplicate? Thanks. ![enter image description here](https://i.stack.imgur.com/mQV00.jpg)
MySQL: information_schema.columns bugs?
CC BY-SA 2.5
null
2011-03-25T15:26:33.337
2015-05-22T18:48:49.300
2011-03-25T15:57:48.657
413,225
413,225
[ "php", "mysql", "information-schema" ]
5,434,559
1
5,435,395
null
0
102
I was wondering how to create visual key pad with PHP. I am talking about normal kepad only alphabettical letters. ![enter image description here](https://i.stack.imgur.com/Oqdcw.png)
visual key pad with PHP
CC BY-SA 2.5
null
2011-03-25T15:27:28.977
2012-12-21T03:25:05.260
2012-12-21T03:25:05.260
367,456
604,941
[ "php" ]
5,434,635
1
5,459,624
null
4
3,175
I'm been reading, and have now seen two different implementations of the Unit of Work pattern. The first pattern has the Repository talking to the Unit of Work to a domain object. ![Unit of Work Repository called](https://i.stack.imgur.com/Z82fY.png) The other implementation has the Service layer registering the domain object as modified: ![Unit of Work Service Layer called](https://i.stack.imgur.com/13kC5.png) I guess my question is, what are the benefits/drawbacks to each? I know that is lot to answer without providing some implementation code for the repositories/mappers/etc... but in general, who/what should really be responsible for "newing up" the UoW and then working with it? My thought is if you let the Repository handle it, it should be provided as a injectable interface to the repository(s) so the same UoW can span multiple repositories (aka, multiple domain objects)... If the service layer handles it, then you're kind of "stuck" with only one UoW implementation per Service Layer call (example, ServiceLayer.AddCustomer(customer)). In the web world, I can't see multiple service layers being called for different domain objects... but maybe in the non-web world I can. I imagine something eventually has to call "commit()", so it makes the most sense to have that tied into the Service Layer. Thanks, Mike
Unit of Work: created by/managed by Service Layer or Repository layer? C#/.NET
CC BY-SA 2.5
0
2011-03-25T15:32:35.587
2011-03-28T13:24:47.340
2011-03-25T15:56:52.870
264,697
618,056
[ ".net", "design-patterns", "unit-of-work" ]
5,434,786
1
5,435,851
null
0
4,202
could anyone please answer my 3 DataTables-related questions? I'm trying to use DataTables [in the PHP script](http://preferans.de/top20.php) displaying weekly players of my game in Russian language, but: ![enter image description here](https://i.stack.imgur.com/Csur3.png) 1. I can't find the option for localizing the Showing 1 to 20 of 3,558 entries string 2. My buttons for First Next 1 2 3 4 5 Prev Last are way too the right in MSIE 7 and Chrome and even make the horizontal scrollbar appear, how could I move them to the left a bit? In Firefox 3.6.15 the page looks completely broken :-( 3. How do you enable the jQuery UI ThemeRoller support? For the last item I've tried: ``` <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script> <script type="text/javascript" language="javascript" src="/jquery.dataTables.min.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#rating").dataTable( { "bJQueryUI": true, ``` but it hasn't produced the nice looking table. Thank you for your help! Alex
jQuery DataTables: localize "Entries", move "Prev/Next", enable ThemeRoller
CC BY-SA 2.5
0
2011-03-25T15:45:43.627
2013-01-22T08:25:44.060
2011-03-25T17:08:53.210
165,071
165,071
[ "jquery", "jquery-ui", "datatables" ]
5,434,962
1
null
null
3
891
I an displaying Stopwatch data using TextView as 01:00:45 on the format hh:mm:ss iPhone has the API to shown the Label in an inverted format which gives the impression of a reflection. In iPhone , a label is first displayed on the screen. Below the first label , the second label is displayed with the data of the first label in an inverted manner , which gives an impression of a data having reflection. Is there any API to display the TextView in inverted manner on Android? ![enter image description here](https://i.stack.imgur.com/YiVFu.png) ![enter image description here](https://i.stack.imgur.com/5ByzF.png) After referring to the link - [How can you display upside down text with a textview in Android?](https://stackoverflow.com/questions/2558257/how-can-you-display-upside-down-text-with-a-textview-in-android) Kindly provide your inputs/sample code.
Display TextView data in inverted manner
CC BY-SA 3.0
0
2011-03-25T16:01:37.513
2016-03-20T06:53:08.550
2017-05-23T12:26:39.493
-1
443,141
[ "android" ]
5,435,078
1
5,435,934
null
2
13,887
![Weather Icon](https://i.stack.imgur.com/SXKDF.png) Is there away to display just the Yahoo weather icon above on a webpage? I'm using geektool on my Mac and it can be displayed on my desktop but I'm wondering if it is possible to just have that icon in a webapge??? ANy ideas :)
Yahoo Weather Icon
CC BY-SA 2.5
0
2011-03-25T16:12:22.293
2015-03-19T00:44:55.200
null
null
616,176
[ "javascript", "html", "icons", "weather", "yahoo-weather-api" ]
5,435,084
1
null
null
0
180
i am using jquery ui tabs for my own custom image gallery, so i didn't load the css it comes with. in firefox there is nothing wrong, but in IE and chrome there is this dash character. in the view source you don't see it, but Inspect Element in chrome shows me: ``` <li class="ui-state-default ui-corner-top"><a href="#tab-9">_</a></li> ``` I tried doing something like `.ui-corner-top{display:none !important;}` but that kills off the tabs completely. ![enter image description here](https://i.stack.imgur.com/EZ2FN.jpg)
unwanted character in jquery ui tabs
CC BY-SA 2.5
null
2011-03-25T16:12:54.027
2011-03-25T16:18:58.717
null
null
42,589
[ "jquery", "jquery-ui", "user-interface", "tabs" ]
5,435,806
1
5,439,410
null
9
2,021
I'm working on a Tetris-type HTML5 game and need to beef up a space optimization algorithm. Rectangular blocks of varying size need to be added to the canvas in the most space efficient way. I know how much space the block takes, I need to find the closest spot the block can be added with a fixed x coordinate- the absolute closest spot is a nice to have. I've implemented a version that searches using pixel by pixel value checking on the canvas that pushes down until it finds enough free space for the shape and then adds it. This works (slowly) only if the space fills left to right- the algorithm can safely assume if the first pixel column is safe then the entire block can be added. I need to make this more robust, here's where I think this should go. Storing a quad tree to represent the board state gives me a quicker way to identify where there's space. ![Search Space](https://i.stack.imgur.com/OTTmf.gif) 4 nodes are stored for each level of depth- each node is either 0 for completely empty, or 1 for 'has some stuff somewhere'. Each progressive level of depth gives more and more information about the board. ``` given(boardstate, block width, block height) -calculate the largest grid space the block must span // a block which is 242x38 MUST span a 16x16 free space // (based on 1/2 of smallest dimension) -the block width requires n consecutive free spaces // (242/16) = 15 -find the first available 15x1 spaces in the board -check the surrounding tiles at the next level of depth for collisions -check the surrounding tiles at the next level of depth for collisions... etc -if there's a fit draw the block mark all affected nodes at all depths as 'filled' ``` Things I've considered so far: A. Build a full `tree` object with pointers to children and values and a set of methods to navigate it. This would be intuitive and probably space-efficient, but I suspect horribly slow. B. Look at each grid as 4 bits and store the depths as hex arrays or objects. If done by a person more clever than myself, this probably optimizes not just the storage but makes clever bit operations available to compare adjacent cells, turn blocks on and off, etc. I imagine it would be incredibly fast, incredibly efficient, but it's beyond my skills to build. C. Store each depth in an array. `Depth[0]=[1,0,0,0]; Depth[1][1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0]` etc. This is where I'm headed at the moment. It's not very space efficient and it probably won't be incredibly fast, but I think I can get my head around it. There's a practical limit to any structure to the number of depths (the array to store availability of 4x4 spaces in my last approach is more than 65 thousand) after which making the expensive call to check the last few pixels of image data from the canvas with a regular iterator is unavoidable. So, A,B,C, other? As usual, all insights appreciated.
Optimized data structure for 2d spatial search and Javascript implementation?
CC BY-SA 2.5
0
2011-03-25T17:12:18.153
2011-03-26T21:18:24.553
2011-03-26T21:18:24.553
340,457
526,133
[ "javascript", "algorithm", "bin-packing" ]
5,435,850
1
null
null
1
389
I need a text editor that I can add as a component to my ASP.net web application, but I need an extra feature in it, it's watermarking. Can you help me? ![Text Watermark](https://i.stack.imgur.com/a0RxL.png)
Add Text editor to my web application
CC BY-SA 2.5
null
2011-03-25T17:14:56.080
2011-03-25T17:49:25.810
2011-03-25T17:49:25.810
274,601
274,601
[ "asp.net" ]
5,435,883
1
5,439,487
null
14
7,301
My troubles started when I had a variable with more than 6 values because that is the current maximum value for the scale_shape function in ggplot2. Due to that problem I tried a work-around with another variable that I just wrapped around the length of the original variable. Here is my example code: ``` dataf <- structure(list(Municipality = structure(c(2L, 4L, 10L, 11L, 6L, 8L, 3L, 1L, 5L, 9L, 7L), .Label = c("Boyuibe", "Cabezas", "Camiri", "Charagua", "Cuevo", "Gutierrez", "Huacaya", "Lagunillas", "Machareti", "Vallegrande", "Villa Vaca Guzman"), class = "factor"), Growth = c(3.05, 2.85, 0.14, 1.21, 1.59, 2.35, -0.41, 0.81, 0.9, 2.89, 1.8), Density = c(3.0390920594, 0.260984024187, 5.20069847261, 2.50828556783, 3.43964629267, 3.69768961375, 32.4496626479, 2.06145019368, 4.2139578988, 0.740736713557, 1.67034079825)), .Names = c("Municipality", "Growth", "Density"), class = "data.frame", row.names = c(NA, -11L)) dataf <- dataf[with(dataf, order(Municipality)), ] # create a new column with values 1 to 6 and same length as Municipality modulus <- function(x) (x - 1) %% 6 + 1 indeces <- 1:length(dataf$Municipality) dim(indeces) <- length(dataf$Municipality) dataf$Shape <- apply(indeces, 1, modulus) dataf$Shape <- factor(dataf$Shape, levels=unique(dataf$Shape)) plot1 <- ggplot(dataf, aes(x=Density, y=Growth, colour=Municipality, shape=Shape)) plot1 <- plot1 + geom_point(size=3) plot1 <- plot1 + scale_x_continuous(expression(paste( "Population Density [people per km"^2, "]", sep=""))) plot1 <- plot1 + scale_y_continuous("Growth Rate [ratio population 2001 / population 1992]") plot1 <- plot1 + scale_colour("Municipality") plot1 ``` that produces the following output: ![enter image description here](https://i.stack.imgur.com/7mTGn.jpg) I would like the legend to be just like the points in the plot. Is that possible, or is there a smart solution to my first problem with the list of municipalities being too long? Thanks in advance.
How to merge colour and shape?
CC BY-SA 2.5
0
2011-03-25T17:18:07.870
2012-03-21T21:37:13.727
2011-03-25T23:36:44.243
636,656
677,122
[ "r", "ggplot2" ]
5,436,392
1
null
null
1
2,803
Herro. I have a strange problem that I am dealing with that involves two buttons, an HTML (client-side "Export to Excel") and an ASP (server-side "Go") button: ![enter image description here](https://i.stack.imgur.com/vkiSZ.png) Here is the html for the two buttons: ``` <asp:Button ID="btnGo" runat="server" Text="Go" OnClick="btnGoClick" Width="35px" /> <input id="btnExport" type="button" value="Export to Excel" disabled="disabled" onclick="btnExClick(this)" onmouseover="return doHover(this)" onmouseout="this.style.backgroundColor='';" style="width: 125px" /> ``` Basically the user selects in the drop down, what loans to load, and clicks "Go", which queries the database and loads the data grid. When a datagrid is loaded the "Export to Excel" button becomes enabled and will turn to and from the color green when the user hovers the mouse over and off. When clicked, it fires and event that just calls `__doPostBack(btnEx.id, '');` Here is my btnExClick(): ``` function btnExClick(btn) { document.forms[0].target = "_blank"; //newly added line from shadowwizard __doPostBack(btn.id, ''); } ``` In my code-behind, I have the following code: ``` protected void Page_Load(object sender, EventArgs e) { ..... if (Request.Form["__EVENTTARGET"] == "btnExport") { this.ExportExcel(); } } protected void ExportExcel() { Response.Clear(); Response.Buffer = true; Response.ContentType = "application/vnd.ms-excel"; Response.AddHeader("content-disposition", "attachment;filename=Optoma Loaner Report.xls"); Response.Charset = ""; this.EnableViewState = false; System.IO.StringWriter sw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw); dgResults.RenderControl(htw); Response.Write(sw.ToString()); Response.End(); } ``` This all works fine, and I get a nice looking Excel sheet. The only problem is after I "Export to Excel", my "Go" button no longer works. It just performs a "postback" with an __EVENTTARGET still = "btnExport", so it attempts to export to excel again.. It doesn't even go to its server-side onclick event handler! Does anyone know why this is happening? I'm assuming it has something to do with the way I export my datagrid to an excel sheet, because when I comment out `this.ExportExcel();`, it continues to work fine (although the "Export to Excel" button goes back to being disabled after I click it, and I'm not sure why. It doesn't normally do that).
Strange __EVENTTARGET behavior, possible bug?
CC BY-SA 2.5
null
2011-03-25T18:09:39.037
2017-03-03T17:40:31.390
2011-03-25T22:36:00.470
550,309
550,309
[ "c#", "javascript", "asp.net", "postback" ]
5,436,468
1
5,441,289
null
0
2,394
Currently I have the following button, when using facebook javascript: ![enter image description here](https://i.stack.imgur.com/PV45H.jpg) and I want to get this one: ![enter image description here](https://i.stack.imgur.com/3x2hX.jpg) What should I change? Currently the way I did this is using the following code: ``` <div id="fb-root"></div> <script src="http://connect.facebook.net/en_US/all.js"></script> <script> FB.init({ appId:'YOUR_APP_ID', cookie:true, status:true, xfbml:true }); </script> <fb:login-button>Login with Facebook</fb:login-button> ```
changing facebook login button type
CC BY-SA 2.5
null
2011-03-25T18:17:06.313
2011-03-26T10:28:21.300
2011-03-25T22:43:12.963
95,265
95,265
[ "facebook" ]
5,436,615
1
5,468,505
null
0
628
I'm having some trouble with the titles of my pages. ![Title](https://i.stack.imgur.com/xWt88.png) ``` $items['mymodule/admin'] = array( 'title' => 'Administrate', 'page callback' => 'mymodule_admin_home', 'access arguments' => array('access content'), 'type' => MENU_NORMAL_ITEM, // ... ); $items['mymodule/admin/settings/english'] = array( 'title' => 'English Settings', 'page callback' => 'drupal_get_form', 'page arguments' => 'mymodule_makeEnglishSettingsForm', 'type' => MENU_DEFAULT_LOCAL_TASK, ); ``` The title I set for my page in my `hook_menu` module doesn't stick, instead, it sets the title to it's parent-most item. I know that I can use `drupal_set_title($my-new-title)` to fix it. But why is this misbehaving? What did I do wrong?
hook_menu Title
CC BY-SA 2.5
null
2011-03-25T18:30:49.967
2011-03-29T06:00:13.160
null
null
449,902
[ "drupal-6", "title", "hook-menu" ]
5,436,665
1
5,436,871
null
2
957
I am wondering is there any way to solve this by changing XAML code? Please look at this sample picture: ![enter image description here](https://i.stack.imgur.com/9JzKH.png) What I wants to do is when user dragging GridSeparater No.1, I want to resize thr 3rd row of grid. This is because in this application, the first and third rows are variable size, but second one is fixed size. Is that possible?
Resizing another grid row size in WPF
CC BY-SA 2.5
0
2011-03-25T18:35:26.080
2011-03-25T18:55:54.227
null
null
474,350
[ "wpf", "grid", "resize" ]
5,436,661
1
null
null
0
199
> [Open new popup window without address bars in firefox & IE](https://stackoverflow.com/questions/2909645/open-new-popup-window-without-address-bars-in-firefox-ie) I have the following code which works in ie(no addressbar, status bar, etc but not firefox... any suggestions? ``` function popUpDetails(trackNum) { var newWindow = (window.open('popUpDetails.aspx?trackNum=' + trackNum, 'Title', 'width=540,height=265, location=no, menubar=no, status=no, toolbar=no, scrollbars=no, resizable=no, modal=no')); } ``` ![enter image description here](https://i.stack.imgur.com/kXEAO.png) ![enter image description here](https://i.stack.imgur.com/P3Nqq.png)
Javascript not excecuted in Firefox
CC BY-SA 2.5
null
2011-03-25T18:35:09.270
2011-03-25T21:28:52.940
2017-05-23T12:07:07.397
-1
54,197
[ "javascript", ".net", "asp.net" ]
5,436,842
1
5,437,827
null
0
442
I have created a Table layout with a number of rows and each row is assigned a background image to simulate rounded corner borders. This works all fine except in QVGA where the top image doesn't repeat vertically. Anyone run into this kind of problem? I have tried resaving the image and verifying the patch was correct. ![QVGA](https://i.stack.imgur.com/ZF6qy.png) ![HVGA](https://i.stack.imgur.com/AtEMC.png)
Nine-patch image not repeating vertically in QVGA
CC BY-SA 2.5
null
2011-03-25T18:51:43.787
2011-03-25T20:32:36.083
null
null
602,030
[ "android", "nine-patch" ]
5,436,897
1
5,437,509
null
3
3,226
I'm creating a webpage where I need a content column in the center of the page (including a fixed width) and two non-scrollable (fixed) columns at the left and the right side of that content column (including a fixed width also). The left column needs to be aligned to the left side of the middle content column. The right column needs to be aligned to the right side of the middle content column. If the content column gets a lot of content the middle content column should be scrollable with a scrollbar at the right side of the browser. But the left and right columns must not scroll, but stay fixed against the top of the browser. When resizing the browser width then the left+middle+right columns keeps their width and centered in the middle of the webpage. At the left side of the left column and at the right side of the right column the whitespace will increase/decrease on both sides with same width. In my screen example you find the concept of what I'm trying to solve. ![screen example](https://i.stack.imgur.com/dCjtZ.png) I tried to search for this problem at stackoverflow and google, but I only found examples wich are a bit different. Who knows how to solve this problem?
Howto create css columns that incl. a scrollable middle column and floating left and right columns
CC BY-SA 4.0
0
2011-03-25T18:58:49.977
2019-07-07T13:07:36.767
2019-07-07T13:07:36.767
6,332,958
372,487
[ "css", "css-float" ]
5,437,009
1
null
null
2
1,236
I have a view with a `UIWebView` as a sub-view, along with some other (fixed) subviews. I want the `UIWebView` to be scrollable in every direction, but I don't want the user to be able to drag the contents past their natural boundaries, as illustrated here: ![enter image description here](https://i.stack.imgur.com/fcehq.png) In this image, I'm dragging the webview's contents down and to the right, and as you can see the contents go past their top and left boundaries. I want the contents to just stop right at the edges when this happens, so that no gray area is exposed underneath. Is this possible?
How to prevent UIWebView from scrolling past its boundaries?
CC BY-SA 2.5
0
2011-03-25T19:09:44.547
2011-03-25T19:26:50.030
null
null
14,606
[ "iphone", "ios", "uiwebview" ]
5,437,072
1
5,437,239
null
7
11,047
I am working with a WPF application, and I am working on a DataGrid that incorporates the use of dynamic content that must react to events,etc. I have the following ViewModel for the View that contains the DataGrid ``` public class HiddenFieldPanelViewModel { public List<HiddenFieldComponent> HiddenFieldList { get; set; } public HiddenFieldComponent Component { get; set; } public bool IsVisible { get; set; } public enum FieldTypes{Constant,Variable} public HiddenFieldPanelViewModel() { HiddenFieldList = new List<HiddenFieldComponent>(); IsVisible = false; } } ``` The only property on this model that applies to this example is the following enum property ``` public enum FieldTypes {Constant,Variable} ``` What I need to do when the DataGrid is populated is to bind the enum types to the dropdown that is in the DataGrid cell, here is an example of one of the DataGrid collection items after it would have been added ![enter image description here](https://i.stack.imgur.com/Z7NiJ.png) So for example, in the picture above, I would like it to have both of the Enum Values from the FieldTypes enum. In my XAML, I have specified the following: ``` <DataGridTemplateColumn Header="Field Type" CanUserResize="False"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ComboBox Height="20" SelectedIndex="0" ItemsSource="{Binding Path=FieldTypes}"> <ComboBox.ItemTemplate> <DataTemplate> <Label Content="{Binding Path=Value}"></Label> </DataTemplate> </ComboBox.ItemTemplate> </ComboBox> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> ``` The other columns are binding the data correctly, but this one is not. I am not sure if there is a better way to do it or not. I have also written a EnumConverter from the IValueConverter to handle the string-enum-string conversions if that is ever needed. Thanks
Binding Enums to DataGrid ComboBox View
CC BY-SA 3.0
0
2011-03-25T19:15:31.580
2016-05-21T08:37:34.880
2016-05-21T08:37:34.880
4,397,397
180,253
[ "c#", ".net", "wpf" ]
5,437,479
1
null
null
0
321
I need a text editor that I can add as a component to my ASP.net web application, but I need an extra feature in it, it's watermarking. Can you help me? I mean text watermark like "Confidential" word in the following image. ![enter image description here](https://i.stack.imgur.com/0RCew.png)
Add Text editor to my web application
CC BY-SA 2.5
null
2011-03-25T19:34:52.223
2011-03-25T19:57:02.857
null
null
274,601
[ "asp.net" ]
5,437,598
1
5,437,788
null
9
4,652
I'm using `Microsoft.Win32.OpenFileDialog` in my WPF application for selecting file: ``` var dlg = new Microsoft.Win32.OpenFileDialog { Title = "Select configuration", DefaultExt = ".xml", Filter = "XML-file (.xml)|*.xml", CheckFileExists = true }; if (dlg.ShowDialog() == true) { //... } ``` According to [MSDN](http://msdn.microsoft.com/en-us/library/aa969773.aspx#Common_Dialogs) screenshots on Windows 7 dialog must have modern style, but I'm getting the old one: ![enter image description here](https://i.stack.imgur.com/MlRgu.png) Adding manifest like in [this](https://stackoverflow.com/questions/5289328/wpf-messagebox-window-style) question doesn't works. How to get dialogs like in MSDN shown? First of all, I'm interested in "native" solution, not using third-party components.
WPF Open FIle Dialog theme
CC BY-SA 2.5
0
2011-03-25T20:10:18.453
2011-03-26T22:56:35.033
2017-05-23T12:19:48.617
-1
438,180
[ "wpf", "dialog", "themes", "openfiledialog" ]
5,437,990
1
5,438,359
null
0
122
How is it that when i use LIMIT, mysql checks the same number of rows? and how do i solve this? ![enter image description here](https://i.stack.imgur.com/7Xf15.png)
Mysql LIMIT operator - equal efficency when not using it?
CC BY-SA 2.5
null
2011-03-25T20:49:22.627
2011-03-25T21:35:02.870
null
null
537,943
[ "mysql", "myisam" ]
5,438,474
1
42,327,274
null
39
8,708
Is it (reasonably) possible to plot a [sequence logo plot](http://en.wikipedia.org/wiki/Sequence_logo) using ggplot2? There is a package to do it which is based on "grid" called "[seqLogo](http://www.bioconductor.org/packages/2.3/bioc/html/seqLogo.html)", but I was wondering if there could be a ggplot2 version of it. Thanks. ![enter image description here](https://i.stack.imgur.com/oJ6te.jpg)
Plotting a "sequence logo" using ggplot2?
CC BY-SA 2.5
0
2011-03-25T21:47:11.820
2022-01-18T04:03:55.030
2011-03-25T23:30:50.963
636,656
256,662
[ "r", "graphics", "ggplot2" ]
5,438,487
1
5,438,595
null
0
1,073
I have a the following situation: a div, with bars in it (divs with a certain height) to show a chart. On top of the main div with the bars, an image a mask is placed, so you can see figures instead of bars. (I have a man and a woman to show stats, see attached image for example). The bars are attached to a mousemove event to show information about the bars in a tooltip. If I hover over the bars my mousemove does not show, because the image is blocking it. Is it possible to hover over the image, and still have the mousemove event bound to the bars to get the information I want? The end result is to show a tooltip with the info from the bars. ![enter image description here](https://i.stack.imgur.com/OQiZi.png)
mousemove over a div under an image
CC BY-SA 2.5
null
2011-03-25T21:49:12.753
2011-03-26T00:04:20.350
null
null
30,759
[ "javascript", "mousemove" ]
5,438,567
1
5,438,653
null
262
135,941
I noticed that if I style my buttons with CSS using radius, colors and borders, they look good but in the iphone/ipad/ipod they look terrible...shouldn't be the same rendering as in Safari Desktop?? ![enter image description here](https://i.stack.imgur.com/PsQOV.jpg)
CSS submit button weird rendering on iPad/iPhone
CC BY-SA 2.5
0
2011-03-25T21:58:26.653
2021-07-24T21:52:26.200
2011-03-25T22:04:32.707
282,772
282,772
[ "iphone", "css", "ipad", "mobile-safari", "mobile-webkit" ]
5,439,007
1
5,441,388
null
1
2,224
I'm trying to get the following data from a TFS OLAP cube in a single query ``` [Work Item].[System_ID] | [Work Item].[System_Title] | [Measures].[BaselineWork] 13426 | Do some work | 5 ``` Sounds pretty simple huh? That's what I thought too, but having 0 knowledge of OLAP, TFS and MDX has made this pretty daunting. ![SSMS Hierchy](https://i.stack.imgur.com/DPphG.jpg) So, I can get this... ``` SELECT [Measures].[Microsoft_VSTS_Scheduling_BaselineWork] ON COLUMNS, [Work Item].[System_Id].MEMBERS ON ROWS FROM [Team System] WHERE [Work Item].[System_WorkItemType].&[WPS Task] ``` and this... ``` SELECT [Measures].[Microsoft_VSTS_Scheduling_BaselineWork] ON COLUMNS, [Work Item].[System_Title].MEMBERS ON ROWS FROM [Team System] WHERE [Work Item].[System_WorkItemType].&[WPS Task] ``` but combining the two has got me stumped.
Displaying multiple hierarchy levels in an MDX query
CC BY-SA 3.0
null
2011-03-25T23:05:07.830
2017-09-05T16:22:30.113
2017-09-05T16:22:30.113
1,033,581
467,384
[ "mdx", "olap" ]
5,439,096
1
null
null
2
1,219
I'm working on an Android game and would like to implement a 2D grid to visualize the effects of gravity on the playing field. I'd like to distort the grid based on various objects on my playing field. The effect I'm looking for is similar to the following from the Processing library: ![gravity](https://i.stack.imgur.com/Zy93s.png) Except that my grid will be simpler- 2D, and viewed strictly from the top, as if looking down at the playfield. Can someone point me to an algorithm for drawing such a grid? The one idea that I came up with was to draw the lines as if they were "particles"- start at one end of the screen and draw the line in multiple segments, treating each segment as a particle, calculating the effect of gravity at each segment's location. The application is intended to run on Android. Thanks
algorithm for visualizing gravity distortion (2D)
CC BY-SA 2.5
0
2011-03-25T23:18:48.590
2011-05-10T18:15:49.123
null
null
93,995
[ "java", "android", "graphics", "gravity" ]
5,439,707
1
5,462,944
null
0
345
We are upgrading from CF 8 Ent to 9 Ent - the following example runs fine on CF 8, but once in CF 9 it fails with "Error retreiving markup for selected element.. not found", the page returns a 404. Here's the interesting part - as soon as I remove the "source=" argument in cflayoutarea, the error goes away. It only happens when I specify a source. Does anyone have any suggestion on what might be going on? The basic stuff already set: - - ![enter image description here](https://i.stack.imgur.com/7vZA1.png)
CF 9 cflayout ajax error
CC BY-SA 2.5
null
2011-03-26T01:16:35.417
2011-03-28T17:48:12.743
null
null
397,423
[ "coldfusion" ]
5,440,362
1
5,441,278
null
5
2,305
I have this code: ``` <button class='arrow month'>&#x25C2;</button> <button name='nv' value='2011' class='month selected'>2011</button> <button class='arrow month'>&#x25B8;</button> ``` ...to output this: ![enter image description here](https://i.stack.imgur.com/HhPHO.jpg) Everything's groovy, except the unicode "entities" are making the line fatter! Why is this happening and is there a fix? To illustrate further, here's the same HTML, with an entity included: ``` <button name='nv' value='2011' class='month selected'>2011&#x25B8;</button> ``` ![enter image description here](https://i.stack.imgur.com/nVpfy.jpg)
HTML CSS Unicode "entity" different line height than standard font?
CC BY-SA 4.0
null
2011-03-26T04:17:16.943
2021-12-27T11:34:29.570
2021-12-27T11:34:29.570
11,769,765
385,273
[ "html", "unicode", "entities", "css" ]
5,440,587
1
5,440,627
null
0
27
![enter image description here](https://i.stack.imgur.com/VtQNb.jpg) ``` import java.net.*; class check { public static void main(String args[])throws Exception { InetAddress address=InetAddress.getLocalHost(); System.out.println(address); } } ``` Please help me in this.
Different Outputs_networking
CC BY-SA 2.5
null
2011-03-26T05:49:34.523
2011-03-26T06:11:53.067
null
null
648,138
[ "java" ]
5,440,721
1
5,443,951
null
1
2,663
I have a conflict when merging a .js file - Tortoise SVN says a conflict occured but no edit conflict button is shown. What does this mean, and how do I fix it if there is no edit conflict button? Screenshot of missing edit conflict button: ![enter image description here](https://i.stack.imgur.com/9MFHi.png)
Tortoise SVN conflict occurs but no edit conflict button is shown
CC BY-SA 2.5
0
2011-03-26T06:27:22.270
2011-03-26T17:26:23.023
null
null
325,727
[ "svn", "merge", "tortoisesvn", "conflict" ]
5,440,744
1
5,440,915
null
2
1,329
I'm just trying to write to a file with the following function: ``` (defun test-save () (with-open-file (stream "test.txt" :if-does-not-exist :create) (format stream "success!"))) ``` However, entering in `(test-save)` generates the following stuff: ![errors galore](https://i.stack.imgur.com/mDanB.png) What am I doing wrong here? I'm using Cusp for Eclipse with SBCL on a Mac, if it matters. UPDATE: now this new error: ![new error](https://i.stack.imgur.com/51D9e.png) And the repl: ``` COMMON-LISP-USER> (with-open-file (stream "test.txt" :direction :output :if-does-not-exist :create) (format stream "success!")) error opening #P"/Applications/eclipse/Eclipse.app/Contents/MacOS/test.txt": File exists [Condition of type SB-INT:SIMPLE-FILE-ERROR] 0: [ABORT] Return to SLIME's top level. 1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {12539CB1}>) ]> 0 ``` UPDATE 2: Solved! I just had to use `:if-exists :supersede`
Saving to file in Lisp
CC BY-SA 2.5
null
2011-03-26T06:32:27.570
2011-03-27T00:18:34.490
2011-03-27T00:18:34.490
257,583
257,583
[ "file-io", "lisp", "common-lisp" ]
5,440,752
1
5,440,791
null
1
7,457
OK so I'm using FancyBox(.net) and I'm trying to make a header without no margin and padding and it's NOT doing it. Here is what I get: ![there should be no whitespace on top or both sides of blue header](https://i.stack.imgur.com/f0XSk.png) As you can see, there is whitespace near the top and sides of the blue header... and there should not be... Here is what I have so far, thanks: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="imagetoolbar" content="no" /> <title>FancyBox 1.3.4 | Demonstration</title> <script type="text/javascript" src="jquery-1.5.1.min.js"></script> <script type="text/javascript" src="scripts/fancybox/jquery.mousewheel-3.0.4.pack.js"></script> <script type="text/javascript" src="scripts/fancybox/jquery.fancybox-1.3.4.pack.js"></script> <link rel="stylesheet" type="text/css" href="scripts/fancybox/jquery.fancybox-1.3.4.css" media="screen" /> <link rel="stylesheet" href="style.css" /> <script type="text/javascript"> $(document).ready(function() { $("#various1").fancybox({ 'transitionIn' : 'fade', 'transitionOut' : 'fade', 'speedIn' : 300, 'height': '300', 'width': '300', 'speedOut' : 300, 'opacity' : true, 'centerOnScroll': true, 'autoDimensions': false }); }); </script> <style> .header { background:#789FCC; color:#fff; font:16px verdana; font-weight:700; padding:5px; } h3 { font-weight: bold; font-size: 17px; display: block; padding:0; margin:0; } #inline1 { padding:0; margin:0; } </style> </head> <body> <a id="various1" href="#inline1">Report Answer</a> <div style="margin:0;padding:0;display:none;"> <div id="inline1" style="padding:0;marging-top:10px;"> <div class="header"><h3>Report this content</h3></div> Testing... </div> </div> </body> </html> ```
CSS - There is still margin and padding
CC BY-SA 2.5
null
2011-03-26T06:34:12.003
2017-10-17T10:48:37.690
null
null
272,501
[ "jquery", "html", "css", "fancybox" ]
5,440,900
1
6,000,894
null
0
284
i have parsed my XML file that is locally stored,now i also want to parse HTML data from that same file the portion of my XML file is like this ![enter image description here](https://i.stack.imgur.com/xsSTj.png)
android HTML parsing
CC BY-SA 2.5
null
2011-03-26T07:08:54.303
2011-05-14T09:15:00.623
2011-03-26T07:24:45.693
510,491
674,530
[ "android", "html", "parsing", "local" ]
5,441,017
1
5,441,369
null
1
4,199
hi i my app i have placed two edit text boxes, when i touch on it the date picker dialog box gets appeared. Now the problem is when i touch the first edit box the dialog opens and after setting it displays at the EditText1. Then when i touch the second edit box the dialog opens and after setting some other date, it is not displayed in EditText2, instead it is show in the EditText1 and the former date gets changed I want the dates to be displayed in respective boxes. The following is my code ``` { et1 =(EditText)findViewById(R.id.widget29); et1.setHint("DOB"); et2 =(EditText)findViewById(R.id.widget32); et2.setHint("DOF"); et1.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showDialog(DATE_DIALOG_ID); } }); et2.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { showDialog(DATE_DIALOG_ID); } }); // get the current date final Calendar c = Calendar.getInstance(); mYear = c.get(Calendar.YEAR); mMonth = c.get(Calendar.MONTH); mDay = c.get(Calendar.DAY_OF_MONTH); } private void updateDisplay() { this.et1.setText( new StringBuilder() // Month is 0 based so add 1 .append(mMonth + 1).append("-") .append(mDay).append("-") .append(mYear).append("-")); } private void updateDisplay1() { this.et2.setText( new StringBuilder() // Month is 0 based so add 1 .append(mMonth + 1).append("-") .append(mDay).append("-") .append(mYear).append("-")); } private DatePickerDialog.OnDateSetListener mDateSetListener = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year,int monthOfYear, int dayOfMonth) { mYear = year; mMonth = monthOfYear; mDay = dayOfMonth; updateDisplay(); } }; private DatePickerDialog.OnDateSetListener mDateSetListener1 = new DatePickerDialog.OnDateSetListener() { public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) { mYear = year; mMonth = monthOfYear; mDay = dayOfMonth; updateDisplay1(); } }; @Override protected Dialog onCreateDialog(int id) { switch (id) { case DATE_DIALOG_ID: return new DatePickerDialog(this, mDateSetListener, mYear, mMonth, mDay); } return null; } } ``` the following are some more problems i am facing here, 1. Whenever i touch the edit text box the keyboard also gets opened how to hide the keyboard 2. in the EditText box i want the order to be viewed as Year/Month/Date 3. Is there any way to change the date picker dialog box as the below figure ![enter image description here](https://i.stack.imgur.com/w5U2V.png) please help me in this
problems with date picker in an android app
CC BY-SA 2.5
0
2011-03-26T07:40:53.227
2013-09-06T15:16:04.383
2011-03-26T07:47:25.273
488,241
596,364
[ "java", "android", "datepicker" ]
5,441,061
1
5,477,681
null
7
5,047
Does anyone have a good algorithm for calculating the end point of `ArcSegment`? This is not a circular arc - it's an elliptical one. For example, I have these initial values: - - - - - - I know the location that my arc should end up at is right around X=0.92 and Y=0.33 (through another program), but I need to do this in an `ArcSegment` with specifying the end point. I just need to know how to calculate the end point so it would look like this: ``` <ArcSegment Size="0.436,0.593" Point="0.92,0.33" IsLargeArc="False" SweepDirection="Clockwise" /> ``` Does anyone know of a good way to calculate this? (I don't suppose it matters that this is WPF or any other language as the math should be the same). Here is an image. All values are known in it, except for end point (the orange point). ![image depicting arc](https://i.stack.imgur.com/CbCmZ.png) --- I've found that there is a routine called [DrawArc with an overload in .NET GDI+](http://msdn.microsoft.com/en-us/library/xxw9hsz1.aspx) that pretty much does what I need (more on the "pretty much" in a sec). To simplify viewing it, take the following as an example: ``` Public Sub MyDrawArc(e As PaintEventArgs) Dim blackPen As New Pen(Color.Black, 2) Dim x As Single = 0.0F Dim y As Single = 0.0F Dim width As Single = 100.0F Dim height As Single = 200.0F Dim startAngle As Single = 180.0F Dim sweepAngle As Single = 135.0F e.Graphics.DrawArc(blackPen, x, y, width, height, startAngle, sweepAngle) Dim redPen As New Pen(Color.Red, 2) e.Graphics.DrawLine(redPen, New Point(0, 55), New Point(95, 55)) End Sub Private Sub ImageBox_Paint(sender As Object, e As System.Windows.Forms.PaintEventArgs) Handles ImageBox.Paint MyDrawArc(e) End Sub ``` This routine squarely puts the end point at `X=95, Y=55`. Other routines mentioned for circular ellipses would result in `X=85, Y=29`. If there was a way to Not have to draw anything and have `e.Graphics.DrawArc` return the end-point coordinates, this is what I would need. So now the question gains some clarity - does anyone know how `e.Graphics.DrawArc` is implemented?
Getting End Point in ArcSegment with Start X/Y and Start+Sweep Angles
CC BY-SA 2.5
null
2011-03-26T07:50:02.880
2021-04-14T15:07:08.977
2011-03-29T00:20:28.957
353,716
353,716
[ ".net", "wpf", "geometry", "drawing", "geometric-arc" ]
5,441,089
1
5,441,180
null
2
2,113
i am displaying a numeral keypad in on a winform to enter code. i am displaying nummpad with buttons... The users will be using only keyboards numpad to enter the code\password\? but off-course you can use mouse... ![enter image description here](https://i.stack.imgur.com/Nc2mD.png) If we use mouse to click button we get a blue-ish effect to display hover & down states.. i was thinking if i can according to he key that user pressed on the numpad...
C# Winforms: programatically display Button's Hover State
CC BY-SA 2.5
null
2011-03-26T07:55:21.747
2011-03-26T09:49:09.767
2011-03-26T08:05:09.997
158,455
158,455
[ "c#", "winforms", "uibutton", "state" ]
5,441,192
1
null
null
2
3,777
I am trying to edit my .edmx model in Visual Studio 2010 however, the symbol is not correct and when I click to edit it does not present the designer where I can update the model etc ![enter image description here](https://i.stack.imgur.com/71LWB.jpg) What I get is just the XML model info as follows: ![enter image description here](https://i.stack.imgur.com/VSPHB.jpg) Does anyone have any ideas why this may be. The same solution opened on another machines gives me no such issues so its the visual studio set up that is causing this?
Visual Studio 2010 Entity Framework .edmx not available to edit
CC BY-SA 2.5
0
2011-03-26T08:29:56.767
2014-05-07T20:56:03.763
null
null
492,035
[ "c#", "visual-studio-2010", "entity-framework", "edmx" ]
5,441,208
1
5,466,926
null
2
487
I am trying to align a custom View object above and aligned_left of a RelativeLayout. My (snipped) code looks something like this: ``` int bored = board.getId(); //board is the RelativeLayout Border border = new Border(); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.ALIGN_LEFT, bored); params.addRule(RelativeLayout.ABOVE, bored); this.addView(border,params); ``` This gives me a Border object aligned_left with my RelativeLayout but NOT "ABOVE" (technically, it is above it, but it's at the top of the screen not aligned the way it's supposed to be). And, even stranger, when I do this: ``` int bored = board.getId(); Border border = new Border(); RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT); params.addRule(RelativeLayout.ALIGN_LEFT, bored); params.addRule(RelativeLayout.BELOW, bored); //<---The only difference this.addView(border,params); ``` ...it works perfectly. it is aligned left and below in the ways that are expected. Why is the ABOVE attribute giving me such a hard time? Edit: ABOVE is supposed to align the bottom edge of one view with the top edge of the target. Here is a screen shot of how my project is not working as intended. ![enter image description here](https://i.stack.imgur.com/3Fw26.png) The green bar at the top of the screen is the Border object I am trying to align. As you can see, its left edge is aligned with "board" however it is in the wrong place at the top of the screen.
Only some Layout Params work
CC BY-SA 2.5
null
2011-03-26T08:33:53.907
2011-03-29T01:29:36.740
2011-03-28T20:04:56.313
431,327
431,327
[ "java", "android", "layout", "android-layout" ]
5,441,483
1
5,441,503
null
0
385
hi the following image is the UI of the date picker i am currently using ![enter image description here](https://i.stack.imgur.com/klblz.png) But i want the date picker to be as follows ![enter image description here](https://i.stack.imgur.com/teaua.png) the second one is the image of an iPhone App. how can i get like this. Is there any possibilities. pls help me....
how to set change the date picker's UI
CC BY-SA 2.5
null
2011-03-26T09:34:17.180
2011-03-26T09:38:30.127
null
null
596,364
[ "java", "android", "user-interface", "datepicker" ]
5,441,662
1
5,441,867
null
3
26,632
Sorry to bring this up again since I am quite sure it was answered in threads like [here](https://stackoverflow.com/questions/4353398/changing-the-property-of-outer-div-while-hovering-over-inner-a-element), yet posting in older threads appears to be pointless. But I'd like to know whether this is still true that I will in fact need jQuery (or something similar) in order to change the properties of one div-element when hovering above some other div-element? If the answer would still be yes, please have a look at the following picture: ![enter image description here](https://i.stack.imgur.com/cIVq3.jpg) This is part of my navigation I am trying to bring to life right now. As you can see there is some kind of mirror effect underneath the buttons. I want those buttons to be clickable while having a "hover" background-position / background-image change. I tried to do that with a single div-element which didn't work out since the button-area itself is smaller than the entire graphic so even when I was hovering above the reflection the button was ready to be used which was not very intuitive. Currently I am using a div-element to display the background image including the hover effect and - sorry but I don't really know how to describe the following - some kind of "invisible" text link which is forced to a specific size in order to simulate a clickable area. Here a small visualization: ![enter image description here](https://i.stack.imgur.com/k8lkX.jpg) Green is the area of the background image which is changing upon hovering above the div-element and the red area is the "button". So again the question ... do I still need something like jQuery to get this hover effect working only when I hover above the button area, are there different approaches to this or ... is something like jQuery really the only answer to that?
Changing properties of one div element when hovering above other div elements
CC BY-SA 3.0
0
2011-03-26T10:20:30.097
2013-07-27T19:57:38.393
2017-05-23T10:32:35.693
-1
676,730
[ "css", "html", "hover" ]
5,441,938
1
5,442,005
null
170
231,113
I want to add a table header (not section headers) like in the contacts app for example: ![enter image description here](https://i.stack.imgur.com/EM6YP.jpg) exactly like that - a label beside an image above of the table. I want the all view be scrollable so I can't place those outside of the table. How can I do that?
Adding iOS UITableView HeaderView (not section header)
CC BY-SA 2.5
0
2011-03-26T11:16:25.360
2015-06-29T21:01:05.153
2011-03-26T17:59:18.373
633,263
633,263
[ "iphone", "ios", "uitableview" ]
5,441,962
1
5,441,982
null
1
53
when I tried to download jquery from jquery.com by clicking on the download link, the file opened in the browser (see image below) but didn't download. I'm a very newbie at all this, so I'm not 100% sure this is not what's supposed to happen, but I think there's a problem. Can anyone explain? ![image of download](https://i.stack.imgur.com/suw3y.png)
Jquery downloading
CC BY-SA 2.5
null
2011-03-26T11:19:59.857
2011-03-26T11:23:31.900
null
null
577,455
[ "jquery" ]
5,442,171
1
5,442,186
null
0
1,200
> [Adding iOS UITableView HeaderView (not section header)…](https://stackoverflow.com/questions/5441938/adding-ios-uitableview-headerview-not-section-header) I want to make a tableview header like in the contacts app: ![enter image description here](https://i.stack.imgur.com/7QuiN.jpg) Exactly like there, am image beside a label above the table. Any way doing that? Thanks!
UITableView Header (not section header) problem
CC BY-SA 2.5
null
2011-03-26T12:00:57.343
2011-04-05T03:40:28.333
2017-05-23T12:13:39.697
-1
633,263
[ "iphone", "ios", "uitableview" ]
5,442,183
1
23,923,473
null
234
296,928
I am currently using in my application a listview that need maybe one second to be displayed. What I currently do is using the @id/android:empty property of the listview to create a "loading" text. ``` <TextView android:id="@id/android:empty" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#FF0000" android:text="Loading..."/> ``` Now, I would like to replace that with the animated circle that is used in a loading dialog instead of this text, i guess you all know what I mean: Edit: I do not want a dialog. I want to show that inside my layout. ![http://flexfwd.com/DesktopModules/ATI_Base/resources/images/loading_blue_circle.gif](https://i.stack.imgur.com/h6viz.gif) Thank a lot for your help!
Using the "animated circle" in an ImageView while loading stuff
CC BY-SA 3.0
0
2011-03-26T12:03:24.407
2018-07-17T00:56:05.107
2011-06-24T10:26:46.603
194,309
327,402
[ "android", "loading", "android-asynctask", "geometry" ]
5,442,659
1
null
null
1
492
If you show the to-do as a calendar - on a php site, possibility to edit daily tasks, etc. ![1](https://i.stack.imgur.com/K0ppe.jpg) Is it made with AJAX or some PHP/CSS library/application? Are there any good php plugins for to-do calendars?
How to do to-do calendars for php site - any good AJAX or php libraries for that?
CC BY-SA 2.5
null
2011-03-26T13:39:06.940
2011-03-26T14:48:51.313
2011-03-26T13:43:37.103
333,786
546,063
[ "php", "jquery", "calendar", "todo" ]
5,442,846
1
null
null
2
7,153
I've got three matrix which contain values of time and corresponding function. I need function values summed over time. Here is my data set(Data columns are marked with red): ![](https://i.stack.imgur.com/SBWzp.jpg) As you see, columns have different time and function values, so I need to interpolate them first. I tried this model, that had no effect: ![enter image description here](https://i.stack.imgur.com/D65tw.jpg) Will appreciate any help in solving my problem
Interpolation in Simulink[Matlab]
CC BY-SA 2.5
null
2011-03-26T14:10:30.350
2011-03-29T15:44:26.103
null
null
null
[ "matlab", "simulink" ]
5,443,135
1
5,443,235
null
0
804
I want to know how to add a UIRect Button on top of a table view using Interface Builder, like the one in this image: ![enter image description here](https://i.stack.imgur.com/dGVDz.png) It's a + (plus) button on top of a table view. How to do this in Interface Builder? I can not drag the button onto the Table View. It can only placed below the table view.. Or it must be done only in the code?
Adding Button on top of Table View - Interface Builder
CC BY-SA 3.0
null
2011-03-26T15:02:49.497
2012-03-05T10:03:51.833
2012-03-05T10:03:51.833
689,356
667,233
[ "iphone", "cocoa-touch", "interface-builder" ]
5,443,176
1
5,478,467
null
0
633
Just curious, I've always been using `TBXML` & `NSXMLParser` to do my parsing, but I just found out about `GDataXMLNode`, and what intrigues me is that it has the capability to use `XPath`. That's a huge bonus in my opinion. However, I don't want to make my app unnecessarily slow just to make it easier for myself. Any opinions? Oops, I just found this: ![enter image description here](https://i.stack.imgur.com/6uQt1.png) But please, I would still like to hear any opinions about using this library.
Is GDataXMLNode fast?
CC BY-SA 2.5
null
2011-03-26T15:08:02.710
2011-03-29T20:23:00.467
2011-03-26T15:17:11.990
456,851
456,851
[ "iphone", "objective-c", "xml" ]
5,443,155
1
5,523,711
null
0
1,676
I typically use the bindings / code below to synchronize an MVVM type master-detail association, taking advantage of a CollectionViewSource. For a DataGrid presentation I have a collection of Activities that are rows in the grid. The last eight columns in the grid are a collection of Allocation.Amounts to a given Activity. I have resorted to using code behind in the grid, using the CurrentCellChanged event where I cast the DataContext of the row (to an ActivityViewModel) and then use the CurrentColumn property of the grid to set the selected item (SelectedAllocationVm). It works but... Can I do better? Something like what I am doing below for rows? # ViewModels ![class diagram](https://i.stack.imgur.com/xaj5J.png) # DataGrid xaml bindings ``` <DataGrid ItemsSource="{Binding ActivityVms}" IsSynchronizedWithCurrentItem="True" ... > <DataGrid.Columns> <ColumnSubclasses:TimeSheetTextColumn /> <!-- Days of the Week --> <ColumnSubclasses:DayOfTheWeekColumn DowIndex="0" /> ... <ColumnSubclasses:DayOfTheWeekColumn DowIndex="6" /> <ColumnSubclasses:DaysOfTheWeekColumnTotal /> </DataGrid.Columns> </DataGrid> ``` # synchronization code (ActivityCollectionViewModel) ``` #region Detail View Models & Selected Item private ObservableCollection<ActivityViewModel> _activityVms; private ICollectionView _collectionView; void _setupCollections(ActivityCollectionComposite composite, IEntityValidator validator) { _activityVms = composite.ToActivityViewModels(validator); // react to additions & deletions to the list _activityVms.CollectionChanged += OnActivityCollectionChanged; // retrieve the ICollectionView associated with the ObservableCollection _collectionView = CollectionViewSource.GetDefaultView(_activityVms); if (_collectionView == null) throw new NullReferenceException("_collectionView"); //listen to the CurrentChanged event to be notified when the selection changes _collectionView.CurrentChanged += OnCollectionViewCurrentChanged; } private void OnCollectionViewCurrentChanged(object sender, EventArgs e) { NotifyOfPropertyChange(() => SelectedActivityVm); } /// <summary>Returns a collection of all the view models we know about.</summary> public ObservableCollection<ActivityViewModel> ActivityVms { get { return _activityVms; } } public ActivityViewModel SelectedActivityVm { get { return _collectionView.CurrentItem as ActivityViewModel; } } #endregion ```
DataGrid selected column / cell
CC BY-SA 3.0
null
2011-03-26T15:05:29.153
2012-09-18T13:09:21.133
2012-09-18T13:09:21.133
546,730
95,245
[ "wpf", "silverlight", "datagrid", "master-detail" ]
5,443,196
1
null
null
1
868
HI, I am reading some C text at the address: [https://cs.senecac.on.ca/~btp100/pages/content/files_p.html](https://cs.senecac.on.ca/~btp100/pages/content/files_p.html) In the text, they mention about file data structure as the image: ![enter image description here](https://i.stack.imgur.com/HeSEr.png) I don't understand what contains in the file data structure and how it connects to the physical file? Can anyone elaborate on that, please? Thanks.
Question about file data structure?
CC BY-SA 2.5
null
2011-03-26T15:10:42.910
2011-04-26T12:25:01.767
null
null
253,656
[ "file" ]
5,443,334
1
5,443,443
null
7
4,217
In some of my books that I've read, it is stated that it is good to hide yellow screens of death (obviously), but not only for the reason in that it is quite informal to users, but also because hackers can use the information to hack your website. My question is this. How can a hacker use this information? How does a call stack of basic operations of the .NET call stack help hackers? I attached a yellow screen of death that I encountered on one of the websites that I created a long time ago and it sparked my interest. (The error is that it fails when attempting to cast a query string parameter to an int. Yea, I know its bad code, I wrote it many years ago ;) ![enter image description here](https://i.stack.imgur.com/vhISD.jpg)
ASP.NET - Hacking the yellow screen of death
CC BY-SA 2.5
0
2011-03-26T15:34:13.047
2014-08-18T02:30:51.323
2014-08-18T02:30:51.323
3,366,929
175,057
[ "asp.net", "security", "yellow-screen-of-death" ]
5,443,345
1
null
null
3
3,024
I have some problems figuring out where my error is. I got the following: Have an image and corresponding GPS coordinates of its top-left and bottom-right vertices. E.g: ``` topLeft.longitude = 8.235128; topLeft.latitude = 49.632383; bottomRight.longitude = 8.240547; bottomRight.latitude = 49.629808; ``` Now a have an Point that lies in that map: ``` p.longitude = 8.238567; p.latitude = 49.630664; ``` I draw my image in landscape fullscreen (1024*748). Now I want to calculate the exact Pixel position (x,y) of my point. For doing that I am trying to use the great circle distance approach from here: [Link](http://dotnet-snippets.de/dns/c-berechnung-der-entfernung-zwischen-gps-koordinaten-SID1179.aspx). ``` CGFloat DegreesToRadians(CGFloat degrees) { return degrees * M_PI / 180; }; - (float) calculateDistanceP1:(CLLocationCoordinate2D)p1 andP2:(CLLocationCoordinate2D)p2 { double circumference = 40000.0; // Erdumfang in km am Äquator double distance = 0.0; double latitude1Rad = DegreesToRadians(p1.latitude); double longitude1Rad = DegreesToRadians(p1.longitude); double latititude2Rad = DegreesToRadians(p2.latitude); double longitude2Rad = DegreesToRadians(p2.longitude); double logitudeDiff = fabs(longitude1Rad - longitude2Rad); if (logitudeDiff > M_PI) { logitudeDiff = 2.0 * M_PI - logitudeDiff; } double angleCalculation = acos(sin(latititude2Rad) * sin(latitude1Rad) + cos(latititude2Rad) * cos(latitude1Rad) * cos(logitudeDiff)); distance = circumference * angleCalculation / (2.0 * M_PI); NSLog(@"%f",distance); return distance; } ``` Here is my code for getting the Pixel position: ``` - (CGPoint) calculatePoint:(CLLocationCoordinate2D)point { float x_coord; float y_coord; CLLocationCoordinate2D x1; CLLocationCoordinate2D x2; x1.longitude = p.longitude; x1.latitude = topLeft.latitude; x2.longitude = p.longitude; x2.latitude = bottomRight.latitude; CLLocationCoordinate2D y1; CLLocationCoordinate2D y2; y1.longitude = topLeft.longitude; y1.latitude = p.latitude; y2.longitude = bottomRight.longitude; y2.latitude = p.latitude; float distanceX = [self calculateDistanceP1:x1 andP2:x2]; float distanceY = [self calculateDistanceP1:y1 andP2:y2]; float distancePX = [self calculateDistanceP1:x1 andP2:p]; float distancePY = [self calculateDistanceP1:y1 andP2:p]; x_coord = fabs(distancePX * (1024 / distanceX))-1; y_coord = fabs(distancePY * (748 / distanceY))-1; return CGPointMake(x_coord,y_coord); ``` } x1 and x2 are the points on the longitude of p and with latitude of topLeft and bottomRight. y1 and y2 are the points on the latitude of p and with longitude of topLeft and bottomRight. So I got the distance between left and right on longitude of p and distance between top and bottom on latitude of p. (Needed for calculate the pixel position) Now I calculate the distance between x1 and p (my distance between x_0 and x_p) after that I calculate the distance between y1 and p (distance between y_0 and y_p) Last but not least the Pixel position is calculated and returned. The Result is, that my point is on the red and NOT on the blue position: ![Screenshot](https://i.stack.imgur.com/1p8gL.jpg) Maybe you find any mistakes or have any suggestions for improving the accuracy.
Map GPS Coordinates to an Image and draw some GPS Points on it
CC BY-SA 3.0
0
2011-03-26T15:36:46.933
2014-11-14T15:46:54.017
2012-05-20T14:26:11.390
1,028,709
678,145
[ "objective-c", "ipad", "dictionary", "gps", "great-circle" ]
5,443,470
1
null
null
1
877
I want to know whether is there any way to hide (1) and (2) in my attached picture. 1. When you tap on a text field twice this "select", "copy", "replace", etc. pop-up comes up, is it possible to disable via HTML5/CSS3 on iPhone browser? 2. When a keyboard pops up, it contains the dark top part which contains "next", "previous", "done" buttons by default at the top of keyboard. Is it possible to disable via HTML5/CSS3 on iPhone browser? Thank you. ![enter image description here](https://i.stack.imgur.com/rgXss.png)
Disabling iPhone Specific Controls in Web Browser
CC BY-SA 2.5
null
2011-03-26T15:59:34.767
2011-03-26T16:09:32.423
null
null
333,878
[ "jquery", "html", "iphone" ]
5,443,795
1
5,444,668
null
5
1,810
I have installed a new xcode last night when i was checking for new functions. There was a lock image next to the name of the files and above the editor on the right most side. I clicked that lock and then i noticed that the space is replaced with some unknown character. I have attached the image below. Now how can i remove these characters and make it normal space. If anyone can help me out with this it will be great. ![enter image description here](https://i.stack.imgur.com/BRerw.png) Thanks in advance
Space problem in Xcode 4.0
CC BY-SA 2.5
0
2011-03-26T16:56:45.220
2011-07-15T10:56:52.023
2011-03-26T17:20:12.673
616,666
616,666
[ "objective-c", "xcode", "whitespace", "space" ]
5,444,450
1
5,445,806
null
10
10,179
I have been having previous issues regards to class inheritance and structuring a database around this and using the entity framework to no success. So I have tried to create the entities inside visual studio and see what database tables it creates automatically. I have a Entity MediaItem which is Abstract and Game Inherits from this. Game has a Console (Int) which corresponds to ConsoleID. However, when I generate the database I get an extra unwanted column (ConsoleTypes_ConsoleID) inside MediaItems_Game table. Why is this and how can I prevent this from happening? Thanks. ![enter image description here](https://i.stack.imgur.com/aMauF.jpg)
ADO.Net EF - how to define foreign key relation in model first approach?
CC BY-SA 2.5
0
2011-03-26T18:46:07.900
2011-04-14T15:27:43.840
2011-04-14T15:27:43.840
413,501
null
[ "database", "visual-studio-2010", "entity-framework", "ado.net", "entity-framework-4" ]
5,445,149
1
5,445,183
null
0
1,258
Recently upgraded to the awesome FireFox 4. However, I would like to disable the automatically embedded resize function that brwosers automatically assign to text input fields, as I already have my own resizing functions... How to I disable automatic Form Resize of text input fields done by browsers like FireFox 4, Safari & Chrome?? Any suggestions how to disable this feature would be great! ![enter image description here](https://i.stack.imgur.com/TE7iZ.png)
How to disable automatic WebMail Form Resize of Text Input fields by browsers like FireFox 4, Safari & Chrome?
CC BY-SA 2.5
0
2011-03-26T20:38:25.570
2011-03-26T20:44:04.773
null
null
509,670
[ "firefox", "forms", "input", "textbox", "resize" ]
5,445,420
1
5,452,281
null
0
2,654
I am trying to programmatically add a Navigation Controller to my View based Application. This is the code I am using (this code gets called after a button press in a view controller): ``` MainMenu *control = [[MainMenu alloc] initWithNibName: @"MainMenu" bundle: nil]; UINavigationController *navControl = [[UINavigationController alloc] initWithRootViewController: control]; [self.view addSubview:navControl.view]; [control release]; ``` That works, but this ends up happening: ![enter image description here](https://i.stack.imgur.com/ljsz7.png) Notice the odd margin above the Navigation control.... My View controller that I am adding the Navigation Controller to has a gray background which you can see. Any ideas?? If you have a better way of adding a Navigation Controller to a View based Application I am very open to suggestions! Thank you in advance!
Adding a Navigation Controller to a View based Application adds top margin
CC BY-SA 2.5
null
2011-03-26T21:23:37.607
2012-07-23T06:41:02.363
2011-03-26T21:46:38.497
125,361
630,996
[ "objective-c", "cocoa-touch", "ios4" ]
5,445,435
1
5,445,487
null
4
3,731
I'm looking for a system-wide graphic that (I think) is in android.R.drawable. I am looking for this one: ![Android Graphic](https://i.stack.imgur.com/PzAQ0.png) I realize that graphics differ between systems, however I am fairy sure that it is system wide because I have seen it in multiple programs. I want to use the one Android provides so that my app looks good no matter what phone it runs on. Does anyone know where I can find that image to use in my program?
Looking for image in android.R.drawable
CC BY-SA 2.5
0
2011-03-26T21:28:00.060
2015-07-09T14:59:31.160
null
null
265,510
[ "android", "image", "drawable" ]
5,445,481
1
5,656,562
null
2
7,499
There seems to be some problem with jquery UI buttons in IE 9? This is how they look normally: ![enter image description here](https://i.stack.imgur.com/1K85F.png) In IE 9 they look like this: ![enter image description here](https://i.stack.imgur.com/aUZBt.png) Html of the button is: ``` <input type="submit" name="submit_intermediate_question" id="submit-intermediate-question" value="Odoslať" class="input-submit" > ``` jquery code: ``` $(document).ready(function() { $('.input-submit').button(); }); ``` Is this a known problem? I am using the latest jquery UI (downloaded yesterday). How to solve it?
jquery UI button not working in IE 9?
CC BY-SA 2.5
0
2011-03-26T21:33:54.623
2011-05-24T18:45:53.690
null
null
95,944
[ "jquery", "jquery-ui", "internet-explorer-9" ]
5,445,744
1
5,522,370
null
20
11,851
How can i fill one gradient for a `<g>` in an SVG image instead of fill all the `<g>`s in the selected `<g>`? In this case, I'd like to show africa, filled with just one gradient from yellow to red, but because of the sub-groups the fill makes many of gradients. The javascript: ``` <script type="text/javascript"> function svgOver() { var what = $(this).attr("id"); $("#world #"+what, svg.root()).attr("fill", "url(#red_black)"); } function svgOut() { $(this).attr("fill", ""); } ... $("#map").svg({ loadURL: 'http://teszt.privilegetours.hu/skins/privilege/svg/worldmap.svg', onLoad: function(svg) { $("#world > g", svg.root()).bind('mouseover', svgOver).bind('mouseout', svgOut).bind('click', svgZoom); }, settings: {} }); ``` The SVG: ``` <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" mlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="570px" height="300px" viewBox="146.605 71.42 570 300" enable-background="new 146.605 71.42 570 300" xml:space="preserve"> <defs> <linearGradient id="red_black" x1="0%" y1="0%" x2="0%" y2="100%"> <stop offset="0%" style="stop-color:rgb(255,0,0);stop-opacity:1"/> <stop offset="100%" style="stop-color:rgb(255,255,0);stop-opacity:1"/> </linearGradient> </defs> <g id="world" transform="scale(1)" fill="#AAAAAA" stroke="#FFFFFF" stroke-width="0.1"> <g id="africa" name="africa"> // < i want to fill this <g id="er" transform="translate(-29.9017, -45.0745)"> // < instead of theese <path d="..."/> </g> <g id="yt"> // < instead of theese <path d="..."/> </g> ... ``` ![this is the africa](https://i.stack.imgur.com/Sxmvb.png) How can I fix this problem? How can I fix this problem without adding an another `<g>` tag to the original image?
Is it possible to linear-gradient-fill a grouped path in SVG (by css or attr on jQuery event)
CC BY-SA 2.5
0
2011-03-26T22:27:18.757
2019-08-09T19:30:40.500
2011-03-30T13:48:49.290
273,792
273,792
[ "javascript", "jquery", "image", "svg", "linear-gradients" ]
5,445,752
1
5,445,839
null
0
557
# Solved `this` wasn't the problem, since it's being implicitly cast to `IFramework` anyway. I was concerned it may have to do with my methods not returning `HRESULT`, or with my stubby implementations of `IUnknown::QueryInterface`, but the real problem was merely a compiler setting that had overridden several macros I needed for common calling conventions (perhaps I should have included them in the question). This had corrupted the stack. It's interesting though, that it worked will all compilers I tested, even without implementing IUnknown at all - a little research suggests that all serious Windows compilers handle abstract C++ interfaces the same way - namely as a virtual table specifically to be used as a COM interface. --- Hi. I'm trying to create an extensible application framework. My basic concept is this: ![Framework Schematics](https://i.stack.imgur.com/goGcl.png) The "Framework" box will build an .exe whereas the multiple "Plugin" boxes will build .dll files. However, my implementation is apparently flawed. I have an idea what's the problem, but I'm running out of workarounds. I've done it exactly like this with .NET projects, but the problem I have now didn't apply to the C# environment. Consider these interfaces: ``` class IFramework { public: virtual void FrameworkMethod() = 0; }; class IPlugin { public: virtual void PluginMethod() = 0; virtual void PluginCallbackTest() = 0; virtual void SetFramework(IFramework *framework) = 0; }; ``` Implementation of the framework: ``` class CFramework : IFramework { public: void FrameworkMethod(); // printf("FrameworkMethod"); void DoSomething(); // this is the testbench basically, see below }; ``` And the implementation of the plugin: ``` class CPlugin : public IPlugin { IFramework *Framework; public: void PluginMethod(); // printf("PluginMethod"); void PluginCallbackTest(); // Framework->FrameworkMethod(); void SetFramework(IFramework *framework); // Framework = framework; }; // plugin factory -> COM interface extern "C" PLUGIN_API IPlugin *GetPlugin(); // return new CPlugin; ``` Now to demonstrate that this concept doesn't work: ``` void CFramework::DoSomething() { HMODULE PluginHandle = LoadLibrary(...); // explicit linking auto GetPlugin = ((IPlugin *)(*)())GetProcAddress(...); IPlugin *plugin = GetPlugin(); plugin->PluginMethod(); // up until here everything's perfectly COM-compliant and works super plugin->SetFramework(this); // <-- that is the problem plugin->PluginCallbackTest(); // <-- runtime crash if compiler differs FreeLibrary(PluginHandle); } ``` The problem is that the `SetFramework(this)` doesn't work like COM. It's not that it just feels wrong to write it like this - I can't implement a working plugin with a compiler that differs from the one I used to build CFramework (runtime crashes).
DLL-based application framework with bi-directional interfaces (Windows)
CC BY-SA 2.5
null
2011-03-26T22:27:52.490
2011-03-27T16:40:49.243
2020-06-20T09:12:55.060
-1
653,473
[ "c++", "windows", "plugins", "com", "interface" ]
5,445,909
1
5,445,936
null
1
172
I'm new to Microsoft Visual C#, so I hope my following question is not sound stupid. I have removed a button from my form. However, it's still showing when I running the 'Start Debugging' (F5) in microsoft visual c# 2010 (see attach pictures for more details). does anyone know what is going there? and how can I solve this issue? ![enter image description here](https://i.stack.imgur.com/PENIL.jpg) ![enter image description here](https://i.stack.imgur.com/Hy2kL.jpg)
Removed button still showing when running the 'Start Debugging' (F5) in microsoft visual c# 2010 express
CC BY-SA 2.5
null
2011-03-26T22:56:39.163
2011-12-19T05:35:24.097
2011-12-19T05:35:24.097
3,043
52,745
[ "c#", "winforms", "visual-studio-2010" ]
5,446,487
1
5,446,500
null
0
177
I have created a Entity named MediaItem which is Abstract and Game inherits form it. I create the database automatically and I get a table MediaItems and MediaItems_Game. The issue is when I do the following in my ASP.Net Controller: private Models.DBContainer dataModel = new DBContainer(); dataModel. ---> Intellisense shows me MediaItem but I can find no way to either navigate to or use MediaItems_Game, how can I solve this? i.e. How can I grab a list of 'Games' with some 'WHERE' constraints on another table (not pictured). Any info is appreciated, thanks. ![enter image description here](https://i.stack.imgur.com/Dtp7n.jpg)
ADO.Net EF, Inheritance Table shows, but not the model
CC BY-SA 2.5
null
2011-03-27T01:01:39.603
2011-03-27T01:05:23.307
null
null
null
[ "asp.net", "database", "entity-framework", "inheritance", "ado.net" ]
5,446,730
1
null
null
1
1,637
Is there a way to make Eclipse show up in its Console the "top" exception instead of just printing all the stack trace and leaving me always with the screen filled with basically useless stuff? Here's a picture: ![enter image description here](https://i.stack.imgur.com/Tybvb.png) There are basically 2 things I might want to know in 99% of the times when there's an exception: it's name+message plus in which method it ocorred. None of them is visible without having to scroll up. This is how I feel the data should be shown: ![enter image description here](https://i.stack.imgur.com/HIZcR.png) Is there a way to change this Eclipse's behaviour?
Making Eclipse show the topmost exception in its console instead of the full stack trace
CC BY-SA 2.5
0
2011-03-27T02:00:22.600
2013-02-05T16:37:57.963
null
null
130,758
[ "java", "eclipse", "exception" ]
5,446,687
1
5,447,075
null
0
675
I use hibernate as the ORM framework,and this is my first time use it for writing operation. Befor this appliction,I just use hibernate to read data from the db. In my struts action,I try to update a entity named "Task",this is the form in the update page: ``` <s:form action="task_update" namespace="/common" cssStyle="width:95%"> <s:textfield value="%{task.id}" cssStyle="display:none" name="task.id"></s:textfield> <s:textfield name="task.name" value="%{task.name}" label="TaskName"/> <s:select list="task.managers" listKey="id" listValue="name" label="Manager" value="%{task.manage}" name="task.department.id"> </s:select> <s:select list="#session.current_user.departments" listKey="id" listValue="name" label="Departmentn of this task" value="%{task.department.{id}}" name="task.department.id"> </s:select> <table> <caption align="left">Steps</caption> <tr> <th>Name</th> <th>End Time</th> <th>Operators</th> <th>Status</th> <th>Set the order</th> <th><span id="addStep" style="cursor:pointer" >Add Steps</span></th> </tr> <s:iterator value="task.steps"> <tr class="step"> <td> <s:textfield name="task.steps[0].name" value="%{#this.name}" theme="simple"/> <s:textfield name="task.steps[0].id" value="%{#this.id}" theme="simple" cssStyle="display:none"/> <s:textfield name="task.steps[0].position" value="%{#this.position}" theme="simple" cssStyle="display:none" class="position"/> </td> <td><s:textfield name="task.steps[0].end" value="%{#this.end}" theme="simple"/></td> <td> <s:select list="allOpIndb" listKey="id" listValue="name" value="%{#this.operator.{id}}" name="task.steps[0].operator.id" multiple="true" theme="simple" id="a"> </s:select> </td> <td> <s:select list="@com.infomanager.entity.TaskStepStatus@values()" theme="simple" name="task.steps[0].status" listValue="cnValue" value="%{#this.status}" id="b"/> </td> <td> <span class="up">up</span> <span class="down">down</span> <span class="del">del</span> </td> <td></td> </tr> </s:iterator> <tr> <td colspan="6"> <s:submit value="Submit"></s:submit> </td> </tr> </table> </s:form> ``` The whole codes of this page can be found [here](https://github.com/hguser/TaskManager/blob/master/WWW/jspa/tiles/tiles_task_detail.jsp): Then in the struts2 action,I get the task object created by struts2(The "task" object in the following example),and find the being updated object in the db(the "task_db" object in the following example): ``` public String task_update{ DozerBeanMapper dbm = new DozerBeanMapper(); // the 'task' object is created by struts2 taskid = task.getId(); String name_st = task.getName(); int dep_id_st = task.getDepartment().getId(); List<TaskStep> steps_st = task.getSteps(); TaskDaoImpl tkDao = new TaskDaoImpl(); TaskStepDaoImpl tsDao = new TaskStepDaoImpl(); OperatorDaoImpl opDao = new OperatorDaoImpl(); DepartmentDaoImpl depDao = new DepartmentDaoImpl(); List<TaskStep> step_db = new ArrayList<TaskStep>(); for (TaskStep step_st : steps_st) { int tsid = step_st.getId(); TaskStep ts_db = tsDao.queryStepById(tsid); if (ts_db == null) { ts_db = step_st; } else dbm.map(step_st, ts_db); // sest the operators List<Operator> ops_to_db = new ArrayList<Operator>(); for (Operator op_st : step_st.getOperator()) { ops_to_db.add(opDao.queryOperatorById(op_st.getId())); } ts_db.setOperator(ops_to_db); step_db.add(ts_db); } //set the id of the task have the same id with task_db,so set its id to a unimpossible value task.setId(-100); //set it to null! task=null; Task task_db = tkDao.queryTaskById(taskid); task_db.setName(name_st); task_db.setDepartment(depDao.queryDepartById(dep_id_st)); task_db.setSteps(step_db); tkDao.updateTask(task_db); } ``` When I submit the form,I got the "org.hibernate.NonUniqueObjectException:": a different object with the same identifier value was already associated with the session: [com.infomanager.entity.Task#4]. I wonder why? I have set the task's id to -100,and set it to null. What is the problem? THe following is the realation ship of the tabls in my db: ![enter image description here](https://i.stack.imgur.com/00btF.png) And the whole project can be found here:[https://github.com/hguser/TaskManager](https://github.com/hguser/TaskManager)
get NonUniqueObjectException when update entity using struts2 and hibernate
CC BY-SA 2.5
null
2011-03-27T01:49:11.737
2011-03-27T03:50:13.097
null
null
306,719
[ "hibernate", "struts2" ]
5,447,050
1
5,449,860
null
3
4,013
I'm trying to use the GridBagLayout layout manager to achieve this: ![enter image description here](https://i.stack.imgur.com/qjunT.png) However, what I am currently getting is this: ![enter image description here](https://i.stack.imgur.com/KX49a.png) The problem being that the orange and brown/gray panels are supposed to occupy the second column, but seem to only want to occupy the third when it comes to running the code. The code that I'm using for the layout: ``` Container contentPane = form.getContentPane(); contentPane.setLayout(new GridBagLayout()); GridBagConstraints c = new GridBagConstraints(); JPanel pnlGame = new JPanel(); pnlGame.setBackground(Color.green); //temp c.gridx = 0; c.gridy = 0; c.gridwidth = 2; c.gridheight = 2; c.fill = GridBagConstraints.BOTH; c.weightx = 0.85; c.weighty = 0.65; contentPane.add(pnlGame, c); JPanel pnlBuy = new JPanel(); c.gridx = 2; pnlBuy.setBackground(Color.blue); //temp c.gridy = 0; c.gridwidth = 1; c.gridheight = 1; c.fill = GridBagConstraints.BOTH; c.weightx = 0.15; c.weighty = 0.46; contentPane.add(pnlBuy, c); JPanel pnlUpgrade = new JPanel(); pnlUpgrade.setBackground(Color.yellow); //temp c.gridx = 2; c.gridy = 1; c.gridwidth = 1; c.gridheight = 1; c.fill = GridBagConstraints.BOTH; c.weightx = 0.15; c.weighty = 0.19; contentPane.add(pnlUpgrade, c); JPanel pnlStats = new JPanel(); pnlStats.setBackground(Color.red); //temp c.gridx = 0; c.gridy = 2; c.gridwidth = 1; c.gridheight = 2; c.fill = GridBagConstraints.BOTH; c.weightx = 0.61; c.weighty = 0.35; contentPane.add(pnlStats, c); JPanel pnlSpeed = new JPanel(); pnlSpeed.setBackground(Color.orange); //temp c.gridx = 1; c.gridy = 2; c.gridwidth = 2; c.gridheight = 1; c.fill = GridBagConstraints.BOTH; c.weightx = 0.38; c.weighty = 0.04; contentPane.add(pnlSpeed, c); JPanel pnlRounds = new JPanel(); pnlRounds.setBackground(Color.gray); //temp c.gridx = 2; c.gridy = 3; c.gridwidth = 2; c.gridheight = 1; c.fill = GridBagConstraints.BOTH; c.weightx = 0.38; c.weighty = 0.31; contentPane.add(pnlRounds, c); ``` So, what am I doing wrong? Sorry if my English is a bit shitty, and/or the mistake I'm making is blindingly obvious... it's 20 to 5 in the morning, and I've had a long day. Should probably be hitting the hay, fairly shortly. UPDATE: It appears that if I change the gridwidth of the brown/gray panel, everything seems to align properly, but I end up with a nasty gap in my layout. Here: i.imgur.com/6JUx2.png And the code for the panel (including the amendment suggested by Kevin S): ``` JPanel pnlRounds = new JPanel(); pnlRounds.setBackground(Color.gray); //temp c.gridx = 1; c.gridy = 3; c.gridwidth = 1; c.gridheight = 1; c.fill = GridBagConstraints.BOTH; c.weightx = 0.38; c.weighty = 0.31; contentPane.add(pnlRounds, c); ``` So, is there anything that I'm doing wrong, or is this just some weird behaviour of the GridBagLayout that I'm going to have to live with? Unfortunately, thanks to me editing, I've lost all the embeds that Bala R kindly put in there. So, we're back to the links for images, I'm afraid. And now it seems that I can't post more than two hyperlinks, so the link has been killed in the last one, you need to copy and paste it in. Thanks, Sam
GridBagLayout in Java Column Issue
CC BY-SA 2.5
0
2011-03-27T03:43:25.277
2011-03-27T15:04:45.947
2011-03-27T14:07:49.897
273,200
678,606
[ "java", "swing", "gridbaglayout" ]
5,447,180
1
5,657,849
null
5
1,562
If you use Windows Vista or up, you have probably seen this kind of tooltip, with the coloured text and icon: ![enter image description here](https://i.stack.imgur.com/a2nq5.png) I've searched using various keywords e.g. Explorer, Aero, Windows, tooltips, and haven't come across any useful information on how to achieve this. Preferably, I'd like the solution to be for WinForms. Has anyone had any luck?
Windows Explorer/Aero style tooltips in C#?
CC BY-SA 3.0
0
2011-03-27T04:16:39.170
2020-08-15T07:04:53.380
2013-12-19T06:50:07.120
77,922
77,922
[ "c#", "winforms", "tooltip" ]
5,447,169
1
5,447,261
null
3
6,612
Hi im wondering if its possible to add a asp button to the code below, the code below adds an image and text from my database to a dynamic div on my asp page: ``` using System.Data.Odbc; using System.IO; public partial class UserProfileWall : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { string theUserId = Session["UserID"].ToString(); PopulateWallPosts(theUserId); } private void PopulateWallPosts(string userId) { using (OdbcConnection cn = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=gymwebsite2; User=root; Password=commando;")) { cn.Open(); using (OdbcCommand cmd = new OdbcCommand("SELECT wp.WallPostings, p.PicturePath FROM WallPosting wp LEFT JOIN User u ON u.UserID = wp.UserID LEFT JOIN Pictures p ON p.UserID = u.UserID WHERE wp.UserID=" + userId + " ORDER BY idWallPosting DESC", cn)) { //("SELECT wp.WallPostings, p.PicturePath FROM WallPosting wp LEFT JOIN [User] u ON u.UserID = wp.UserID LEFT JOIN Pictures p ON p.UserID = u.UserID WHERE UserID=" + userId + " ORDER BY idWallPosting DESC", cn)) using (OdbcDataReader reader = cmd.ExecuteReader()) { test1.Controls.Clear(); while (reader.Read()) { System.Web.UI.HtmlControls.HtmlGenericControl div = new System.Web.UI.HtmlControls.HtmlGenericControl("div"); div.Attributes["class"] = "test"; //div.Style["float"] = "left"; div.ID = "test"; Image img = new Image(); img.ImageUrl = String.Format("{0}", reader.GetString(1)); // this line needs to be represented in sql syntax //img.ImageUrl = "~/userdata/2/uploadedimage/batman-for-facebook.jpg"; img.AlternateText = "Test image"; div.Controls.Add(img); div.Controls.Add(ParseControl(String.Format("&nbsp&nbsp&nbsp;"+"{0}", reader.GetString(0)))); div.Style["clear"] = "both"; test1.Controls.Add(div); } } } } } protected void Button1_Click(object sender, EventArgs e) { string theUserId = Session["UserID"].ToString(); using (OdbcConnection cn = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver}; Server=localhost; Database=gymwebsite2; User=root; Password=commando;")) { cn.Open(); using (OdbcCommand cmd = new OdbcCommand("INSERT INTO WallPosting (UserID, Wallpostings) VALUES (" + theUserId + ", '" + TextBox1.Text + "')", cn)) { cmd.ExecuteNonQuery(); } } PopulateWallPosts(theUserId); } } ``` Here is the strange thing tho, if I do manage to add a button similar to the way I have added an image, how would I call that button, for example: I want to call this button "delete" and add code to delete the text in my database related to that div, but if there is multiple divs(there all named the same div id=test) with text and they all have the same asp button how would I be able to tell the button to only delete the current text(in the db) for the current div?? My database stores the information like so: ![enter image description here](https://i.stack.imgur.com/VCmC1.jpg) Im thinking I would have to use idwallposting but not sure how? Also to give a visual representation of how it looks it may help aid in the understanding: ![enter image description here](https://i.stack.imgur.com/RDf5f.jpg) My css and asp: ``` div#test1 { } div .test { width:90%; z-index:1; padding:27.5px; border-top: thin solid #736F6E; border-bottom: thin solid #736F6E; color:#ffffff; margin:0 auto; white-space: pre; white-space: pre-wrap; white-space: pre-line; word-wrap: break-word; } <asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server"> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js" type="text/javascript"></script> <p> <asp:TextBox ID="TextBox1" name="TextBox1" runat="server" Rows="3" Height="47px" Width="638px"></asp:TextBox> </p> <p> <asp:Button ID="Button1" runat="server" Text="Post Message" Width="98px" onclick="Button1_Click" /> </p> <p> </p> <style type="text/css"> img {border-width:0px; width:100px; height:100px;} </style> <div id="test1" runat="server" /> </div> </asp:Content> ```
Add button to webpage via code behind in asp.net and delete dynamic db entrys
CC BY-SA 2.5
0
2011-03-27T04:14:26.877
2012-08-30T13:51:27.407
null
null
477,228
[ "c#", "asp.net", "mysql", "html", "css" ]
5,447,297
1
5,452,744
null
1
4,199
I'm trying to make a iPad like toobar at the bottom of my webpage, using the free [jqTouch](http://www.jqtouch.com/) framework. Here's an example I was trying to copy off (first random iphone image i googled for). ![enter image description here](https://i.stack.imgur.com/VkWI7.jpg) Now, [a previous StackOverflow question](https://stackoverflow.com/questions/1055539/how-to-create-dock-type-toolbar-at-the-bottom-of-the-page) sorta answers it .. but i'm not sure how to extended that answer to include 1. 4 or so sections (eg. friends, person logged in (if they are), etc.).. 2. Keep that toolbar at the bottom, no matter what. The middle content is scrollable. but the header and this footer should always be visible. Can this be done?
How can i make a bottom toolbar with jqTouch for my webpage
CC BY-SA 2.5
null
2011-03-27T04:47:23.293
2012-02-27T04:36:05.110
2017-05-23T12:01:09.963
-1
30,674
[ "iphone", "css", "jqtouch" ]
5,447,301
1
5,447,860
null
17
7,141
I am getting DragLeave Events when dragging from a parent to child control. I would only expect to get this event when moving outside the bounds of a control. How can I implement this? Please refer to this simple sample application. ``` <Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <StackPanel> <TextBox Height="50" >Hilight and Drag this text</TextBox> <Border BorderBrush="Blue" BorderThickness="2"> <StackPanel AllowDrop="True" Name="Stack" > <Label >If I drag text across the gray line, Stack.DragLeave will fire.</Label> <Separator></Separator> <Label>I only expect to get this event when leaving the blue rectangle. </Label> </StackPanel> </Border> <TextBlock >Stack.DragLeave Count: <Label x:Name="countLabel" /></TextBlock> </StackPanel> </Window> ``` and in the code behind ``` Class MainWindow Private Sub Stack_DragLeave(ByVal sender As Object, ByVal e As System.Windows.DragEventArgs) Handles Stack.PreviewDragLeave countLabel.Content = countLabel.Content + 1 End Sub End Class ``` ![enter image description here](https://i.stack.imgur.com/M7051.jpg)
WPF Drag Drop - When Does DragLeave Fire?
CC BY-SA 2.5
0
2011-03-27T04:48:09.083
2018-06-20T14:21:00.720
null
null
635,906
[ ".net", "wpf", "vb.net" ]
5,447,524
1
null
null
0
142
I have the following code: ``` <html> <head> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"> </script> <script type="text/javascript"> function displayTweet(){ var i = 0; var limit = $("#twitter-results > div").size(); var myInterval = window.setInterval(function () { var element = $("#twitter-results div:last-child"); $("#twitter-results").prepend(element); element.fadeIn("slow"); i++; if(i==limit){ window.setTimeout(function () { clearInterval(myInterval); }); } },2000); } $("form#twittersearch").submit(function() { twitterq = $('#twitterq').attr('value'); $.ajax({ type: "POST", url: "search.php", cache: false, data: "twitterq="+ twitterq, success: function(html){ $("#twitter-results").html(html); displayTweet(); } }); return false; }); }); </script> </head> <div class="twitter_container"> <form id="twittersearch" method="post" action=""> <input name="twitterq" type="text" id="twitterq" /> <button type="submit">Search</button> </form> <div id="twitter-results"></div> </div> </html> /***************THIS IS search.php***************************/ <?php include('twitterapi.php'); if($_POST['twitterq']){ $twitter_query = $_POST['twitterq']; $search = new TwitterSearch($twitter_query); $results = $search->results(); foreach($results as $result){ echo '<div class="twitter_status">'; echo '<img src="'.$result->profile_image_url.'" class="twitter_image">'; $text_n = toLink($result->text); echo $text_n; echo '<div class="twitter_small">'; echo '<strong>From:</strong> <a href="http://www.twitter.com/'.$result->from_user.'">'.$result->from_user.'</a&glt;: '; echo '<strong>at:</strong> '.$result->created_at; echo '</div>'; echo '</div>'; } } ?> ``` Why is it that when I do a `var_dump($_POST['twitterq'])` it is always NULL? firebug gave me this, not sure how to fix it though: ![enter image description here](https://i.stack.imgur.com/bQj4v.jpg) ![enter image description here](https://i.stack.imgur.com/jgRjz.jpg)
PHP and javascript POST
CC BY-SA 2.5
null
2011-03-27T05:55:04.467
2011-03-27T06:50:04.460
2011-03-27T06:18:42.617
95,265
95,265
[ "php", "javascript", "ajax" ]
5,447,626
1
null
null
1
2,352
I have centos installed on myserver and for development i have installed NetBeans IDE 6.9.1. Now as glassfish 3 was not present on my server i tried to download it from netbeans itself using add server panel but when i click on download i am getting I/O exception , following is the screen shot can anyone tell me how to get rid off it .. ![enter image description here](https://i.stack.imgur.com/PQzLp.png)
unable to download glassfish 3 from netbeans
CC BY-SA 2.5
null
2011-03-27T06:30:23.430
2015-07-19T00:41:16.440
null
null
405,383
[ "netbeans", "glassfish", "glassfish-3", "netbeans-6.9" ]
5,447,554
1
5,447,565
null
10
10,137
I'm having difficulty getting the GUI layout results I want in an Android app. A brief description of what I want: The GUI is to include two TextViews and four Buttons. The four Buttons are to be laid out horizontally, all in the same row, and fixed at the bottom-right of the screen. The first of the two TextViews is to start at the top of the screen, with text contents varying from one line to many dozens of lines - more than will fit on the screen without scrolling. So, scrolling is sometimes necessary to see all of the contents. Even when scrolling is necessary, the buttons are not to participate in the scrolling: they are to always remain fixed in a single row at the bottom-right of the screen. When scrolling is necessary, the scrolling text is to always be above the buttons - the buttons are not to overlay the text. The second of the two TextViews is to appear immediately beneath the first TextView, and will normally only add one or two lines to the total length of text. When scrolling is necessary, the second TextView is to scroll with the first TextView, always appearing immediately beneath the first TextView. Additional constraints include that I want the layout to look decent on all of the following Android devices, in both vertical and horizontal screen layouts: - - - - - I'll worry about tablets another day (like tomorrow). -- I've tried many different combinations of Layouts, but nothing yet has come very close to the goal. (With some of the layout combinations I tried, I can fix the buttons at the bottom-left of the screen with RelativeLayout, but everything I try with the scolling text always results with the text scrolling behind the buttons - the buttons overlay the text. I haven't figured out getting the buttons to align to the bottom-right.) If anyone is up for helping me figure this out, the layout example xml below is a conversation starting point, but it definately fails to achieve the goal result, as demonstrated in the following screen shots, generated using this same layout example xml. (While some of the screen shots demonstrate the same problem, they help to show where I'm at with the different screens.) ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Text View 1. Text varies from a few lines to many more lines than what fits on the screen. Scrolling is necessary to see it all." /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Text View 2. Short text entry sits below Text View 1." /> </LinearLayout> </ScrollView> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <Button android:id="@+id/button_1" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 1" /> <Button android:id="@+id/button_2" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 2" /> <Button android:id="@+id/button_3" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 3" /> <Button android:id="@+id/button_4" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 4" /> </LinearLayout> </LinearLayout> ``` 1.5_API3_HVGA_Horizontal_MDPI - short_text: ![1.5_API3_HVGA_Horizontal_MDPI - short_text](https://lh4.googleusercontent.com/_VZJksQ6kepc/TY65pTl8ecI/AAAAAAAAABE/Y84OunOllao/s800/1.5_API3_HVGA_Horizontal_MDPI-short_text.png) Issue: The buttons should align with the bottom-right of the screen. -- 1.5_API3_HVGA_Vertical_MDPI - short_text: ![1.5_API3_HVGA_Vertical_MDPI - short_text](https://lh6.googleusercontent.com/_VZJksQ6kepc/TY65pSPa2wI/AAAAAAAAABI/QGkbOTL8Gyg/s800/1.5_API3_HVGA_Vertical_MDPI-short_text.png) Issue: The buttons should align with the bottom-right of the screen. -- 1.5_API3_QVGA_240x320_MDPI - short_text: ![1.5_API3_QVGA_240x320_MDPI - short_text](https://lh6.googleusercontent.com/_VZJksQ6kepc/TY65pdTip7I/AAAAAAAAABM/8HDis-AfaHs/s800/1.5_API3_QVGA_240x320_MDPI-short_text.png) Issue: 4th Button is smashed. Prefer text on first three buttons to wrap when necessary, leaving enough room to display 4th button. -- 1.5_API3_QVGA_320x240_MDPI - short_text: ![1.5_API3_QVGA_320x240_MDPI - short_text](https://lh6.googleusercontent.com/_VZJksQ6kepc/TY65p4Mg_nI/AAAAAAAAABQ/Ai-uCh0us7M/s800/1.5_API3_QVGA_320x240_MDPI-short_text.png) Issue: The buttons should align with the bottom-right of the screen. -- 1.6_API4_QVGA_Horizontal_LDPI - long_text: ![1.6_API4_QVGA_Horizontal_LDPI - long_text](https://lh6.googleusercontent.com/_VZJksQ6kepc/TY65p-RgDLI/AAAAAAAAABU/EBqe-uyqQyI/s800/1.6_API4_QVGA_Horizontal_LDPI-long_text.png) Issue: When the text almost fills the screen, the row of buttons get smashed. The row of buttons should not be smashed, and should be fixed at the bottom-right of the screen. The text should scroll above the buttons. -- 1.6_API4_QVGA_Horizontal_LDPI - short_text: ![1.6_API4_QVGA_Horizontal_LDPI - short_text](https://lh6.googleusercontent.com/_VZJksQ6kepc/TY65qJuHhPI/AAAAAAAAABY/s3TffmnFXic/s800/1.6_API4_QVGA_Horizontal_LDPI-short_text.png) Issue: The buttons should align with the bottom-right of the screen. -- 1.6_API4_QVGA_Horizontal_LDPI - very_long_text, scrollbar at top: ![1.6_API4_QVGA_Horizontal_LDPI - very_long_text, scrollbar at top](https://lh5.googleusercontent.com/_VZJksQ6kepc/TY65qO4uGGI/AAAAAAAAABc/Kc0iQcwUp_U/s800/1.6_API4_QVGA_Horizontal_LDPI-very_long_text-1.png) Issue: The buttons are not on the screen. They should be fixed at the bottom-right of the screen. -- 1.6_API4_QVGA_Horizontal_LDPI - very_long_text, scrollbar at bottom: ![1.6_API4_QVGA_Horizontal_LDPI - very_long_text, scrollbar at bottom](https://lh3.googleusercontent.com/_VZJksQ6kepc/TY65qGJgMqI/AAAAAAAAABg/tGzvN_mAOP8/s800/1.6_API4_QVGA_Horizontal_LDPI-very_long_text-2.png) Issue: The buttons are no where to be found, though the text scrollbar is at the bottom. They should be fixed at the bottom-right of the screen. -- 1.6_API4_QVGA_Vertical_LDPI - short_text: ![1.6_API4_QVGA_Vertical_LDPI - short_text](https://lh3.googleusercontent.com/_VZJksQ6kepc/TY65qXjXBZI/AAAAAAAAABk/16LpbSw7bXw/s800/1.6_API4_QVGA_Vertical_LDPI-short_text.png) Issue: The buttons should align with the bottom-right of the screen. -- Any advice? -- Additional Info: When I try to use RelativeLayout, and fix the buttons at the bottom of the screen with `android:layout_alignParentBottom="true"`, then my problem is that I don't know how to fix the bottom of the scroll view with the top of the buttons. Using `android:layout_alignBottom="@id/buttons"` just aligns the bottom of the scroll view with the bottom of the buttons, but then the buttons overlay the text, like this:![](https://lh5.googleusercontent.com/_VZJksQ6kepc/TY_HJ8LGbJI/AAAAAAAAACg/SVcZyrJs3yE/s800/buttons_overlay_text.png) -- Update: The problem of fixing the buttons to the bottom-right, with the scrolling text above the buttons is resolved. Here's the changed layout XML that works so far (paste more text into text view 1 if you want to see the scrolling):``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ScrollView android:layout_width="fill_parent" android:layout_height="0dp" android:layout_weight="1"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Text View 1. Text varies from a few lines to many more lines than what fits on the screen. Scrolling is necessary to see it all." /> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Text View 2. Short text entry sits below Text View 1." /> </LinearLayout> </ScrollView> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right"> <Button android:id="@+id/button_1" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 1" /> <Button android:id="@+id/button_2" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 2" /> <Button android:id="@+id/button_3" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 3" /> <Button android:id="@+id/button_4" android:layout_height="fill_parent" android:layout_width="wrap_content" android:text="Button 4" /> </LinearLayout> </LinearLayout> ``` I have a remaining problem for which I'll post a new question.
Scrolling Text Above Buttons, Buttons Fixed At Bottom
CC BY-SA 2.5
0
2011-03-27T06:06:14.740
2011-03-28T00:02:27.760
2011-03-27T23:54:54.337
519,818
519,818
[ "android", "user-interface", "android-layout" ]
5,447,669
1
5,447,734
null
1
2,037
Ok, I'm using C# on MonoDevelop 2.4 and I got this weird error: ![Weird Error](https://i.stack.imgur.com/8bJru.png) The tooltip says that it's a 'Parser Error: ")" expected.' Funny thing is: it works! Compiles and runs without a hitch. The only problem is, the entire class doesn't show up in the classes pad. How do I resolve this problem?
Parser Error: ")" expected
CC BY-SA 2.5
null
2011-03-27T06:41:47.600
2011-03-27T07:02:03.303
null
null
139,284
[ "c#", "monodevelop" ]
5,448,107
1
5,493,938
null
1
392
I am trying to step into the .NET4 source code. I have recently installed SP1 for VS2010. I cannot get this to work. After reading articles such as [this](https://stackoverflow.com/questions/5248281/visual-studio-2010-sp1-and-changes-to-the-net-framework) I'm assuming its because the source symbols VS is downloading do not match the version of the framework I have installed. Can someone confirm this? Secondly, I downloaded the .NET4 source and tried to manually load the pdb's from the module window. ![enter image description here](https://i.stack.imgur.com/ScC13.jpg) however for all possible selections (3) I get this error: ![enter image description here](https://i.stack.imgur.com/o3R9U.jpg) If the SP1 is the cause of my woes, I don't want to revert to non-SP1.
visual studio 2010 sp1 source server support
CC BY-SA 2.5
null
2011-03-27T08:36:57.883
2011-03-31T00:11:38.960
2017-05-23T11:48:22.880
-1
224,410
[ "c#", "visual-studio-2010", "debugging" ]
5,448,277
1
5,448,295
null
0
6,646
For my larger project i need to start with creating a IPv4 network packet ( for simulation ) for the same I need to write a function that creates a header out of the passed data which has the source ip , dest ip and all the necessary fields ``` def convertIpv4( data ): pass ``` For this I need you to guide me in the right direction. Firstly I need to store the IP in 32 bits so for that if I have a string "192.168.2.1" what is the most efficient way to convert it into bytes and that too a size of 32 ?? Also if I create first a normal class with stuff like version = 4 and sourceip and dest ip then is there a way to convert it directly into a byte array with the position of objects just like the following header ![IPHeader](https://i.stack.imgur.com/wY4py.gif) Please tell how should i proceed....
Creating a IPv4 packet header in python
CC BY-SA 2.5
null
2011-03-27T09:15:51.053
2011-03-27T11:41:28.583
2011-03-27T09:24:50.623
179,669
null
[ "python", "ipv4" ]
5,448,451
1
null
null
3
12,928
I would like to create annotations on a Map like this: ![img](https://i.stack.imgur.com/skjBF.jpg) If you click on the blue arrow a menu should open. In the menu should be two menu points. First a Telephone number (if I click on the number the iphone dial/call this number) and second a "Directions to here". At the moment I run on this code ``` MKCoordinateRegion region4 = { {0.0, 0.0 }, { 0.0, 0.0 } }; region4.center.latitude = 48.13479 ; region4.center.longitude = 11.582111; region4.span.longitudeDelta = 0.01f; region4.span.latitudeDelta = 0.01f; DisplayMap *ann4 = [[DisplayMap alloc] init]; ann4.title = @"The Title!"; ann4.subtitle = @"The Subtitle!"; ann4.coordinate = region4.center; [mapView addAnnotation:ann4]; ``` How do I show blue-arrow as shown in the image? Can you please suggest me on this..
MapKit iPhone Development - Adding Annotations to a Map - iOS SDK
CC BY-SA 3.0
0
2011-03-27T09:50:44.880
2012-12-31T13:29:15.747
2012-12-31T13:29:15.747
215,234
678,609
[ "iphone", "xcode", "ios4", "mapkit" ]
5,448,702
1
5,448,843
null
29
36,833
I have an issue with deletion in Entity Framework. In short, EF explicitly tries to delete an entity from the database even though I've explcitly configured EF to use cascading deletes in the database. I have three entity types, `MainEntity`, `EntityTypeA` and `EntityTypeB`. EF has been configured to use cascade deletion when deleting `EntityTypeA` and `EntityTypeB`. In other words, if I delete an instance of `MainEntity`, I want all related `EntityTypeA` and `EntityTypeB` instances to be deleted as well. I never delete `EntityTypeA` or `EntityTypeB` without also deleting their parent. My problem is that EF explictly issues a `DELETE` statement for `EntityTypeA`, which causes my application to crash. This is what my model look like: ![](https://i.stack.imgur.com/KC43E.png) The relations have the following non-default config: - `MainEntity -> EntityTypeA OnDelete: Cascade`- `MainEntity -> EntityTypeB OnDelete: Cascade` The relation `EntityTypeA -> EntityTypeB` has `OnDelete: None` ``` INSERT INTO MainEntities (Name) values ('Test') insert into EntityTypeA (MainEntityID) VALUES (1) insert into EntityTypeB (MainEntityID, EntityTypeAId) VALUES (1, 1) insert into EntityTypeB (MainEntityID, EntityTypeAId) VALUES (1, 1) ``` ``` class Program { static void Main(string[] args) { var context = new Model1Container(); var mainEntity = context.MainEntities.Include("EntityTypeA").SingleOrDefault(); context.DeleteObject(mainEntity); context.SaveChanges(); } } ``` When I call SaveChanges, Entity Framework executes the following in the database: ``` exec sp_executesql N'delete [dbo].[EntityTypeA] where ([Id] = @0)',N'@0 int',@0=1 ``` This causes an foreign key violation, because there are items in EntityTypeB's table referencing EntityTypeA instances. Why does Entity Framework issue an explicit delete for the instance of EntityTypeA even though I've configured Entity Framework to use cascading deletes? If I remove the Include("EntityTypeA") it starts working again.
Cascading deletes with Entity Framework - Related entities deleted by EF
CC BY-SA 3.0
0
2011-03-27T10:39:44.303
2017-07-25T15:18:58.650
2016-10-27T20:11:30.603
3,997,611
115,904
[ "entity-framework", "cascading-deletes" ]
5,448,746
1
null
null
7
6,991
I have a simple window containing an outer border with a corner radius, and an inner border with a background. The border is basically just a placeholder for any type of content I would like to place inside the rounded corner outer border. ``` <Window x:Class="TestRunner.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" WindowStyle="None" Background="{x:Null}" > <Border BorderThickness="2" BorderBrush="Black" CornerRadius="8" > <Border Background="White"> </Border> </Border> </Window> ``` The problem is that the inner control does not inherit the rounded corner so it draws on top of the rounded corner, like this: ![Bad corner rendering](https://i.stack.imgur.com/2N1Qq.png) How do I adjust my outer control, so inner controls do not attempt to draw on top of the rounded corner. Setting rounded corner on the inner control is not a viable option as it will lead to horrible duplication of corner radius.
How to style a control inside a border with a corner radius
CC BY-SA 2.5
0
2011-03-27T10:48:17.933
2014-06-25T11:15:12.957
null
null
158,483
[ "wpf" ]
5,448,835
1
null
null
0
349
I have a set of vertices to draw a circle, but I want to draw a high-res circle by drawing twice the number of vertices, I cant just increase the number of vertices what I need is to calculate the mid points from the supplied vertices, if that makes sense ![enter image description here](https://i.stack.imgur.com/f7vR3.jpg) So from that image how can I calculate the points A, B, C, ... given the points V0, V1, V2, ... and the center point of the circle ? Please note that I cant just calculate the mid-points by rotating the vertices they need to be calculated using their position Thanks
How to calculate mid point vertices?
CC BY-SA 2.5
null
2011-03-27T11:10:23.970
2011-03-27T11:19:32.520
2011-03-27T11:16:34.043
659,149
659,149
[ "geometry", "vertices" ]
5,448,896
1
5,448,955
null
2
1,798
I have an problem in Visual Studio 2010: ![Visual studio error](https://i.stack.imgur.com/iRVWl.png) I created an custom user control, that show some data, then I tryed to add it on a page. When I did this, this error showed up... when I run (start debugging) my application, everything works fine, the only thing that is not working is Visual Studio design view. What should I do to solve this?
Visual studio 2010: Can't show design view
CC BY-SA 2.5
null
2011-03-27T11:23:46.387
2011-03-27T11:34:33.060
null
null
424,923
[ "visual-studio-2010", "silverlight-4.0", "user-controls" ]
5,449,179
1
null
null
0
516
I have created a website, when the admin dblclick on the image then he can choose for a new one. That I will accomplish with javascript. But, I don't have any idea to do that, the following code is the html. ![enter image description here](https://i.stack.imgur.com/lVyBE.png) ``` <form action="controller.php" method="post" class="popupform" id="form_changeillustration" enctype="multipart/form-data"> <dl> <dt><label for="newillustration">choose a new photo: </label></dt> <dd><input type="file" name="newillustration" id="newillustration" /></dd> <dt>&nbsp;</dt> <dd class="buttonrow"> <input type="hidden" name="page" value="{$PAGE}" /> <input type="hidden" name="module" value="newillustration" /> <input type="submit" class="btnOk" value="edit" /> <input type="button" class="btnCancel" value="cancel" /> </dd> </dl> </form> ```
select image on drive with javascript
CC BY-SA 2.5
null
2011-03-27T12:22:09.627
2011-03-27T15:18:50.727
2011-03-27T13:02:59.703
642,760
642,760
[ "php", "javascript", "jquery" ]
5,449,235
1
null
null
1
845
OK, so there can be 4-6 players which i'd like to place around a circular table (the table is just a background i suppose). My problem is, since each player can have many cards (up to 10) i'd like that the user will always see himself at the bottom with his cards opened, and see the rest of the players with hidden cards. Now, a player can join the table if it has room, i need then to adjust the sits accordingly so if a player clicks on the top left join button, when he starts playing i need him to see himself at the bottom. How can i approach this? I suppose placing static views is not the right way. I've attached a scratch image of my desire UI. ![enter image description here](https://i.stack.imgur.com/fJ59a.jpg)
Asking for advice for UI of multiplayer card game (Android)
CC BY-SA 2.5
null
2011-03-27T12:37:49.593
2011-07-17T05:23:35.223
null
null
410,548
[ "android", "user-interface" ]
5,449,573
1
5,449,685
null
0
272
I have the following ADO.Net Entities: ![enter image description here](https://i.stack.imgur.com/AKGbD.jpg) What I want to be able to do is Select a group of Games depending on the LoanedTo ID. I.E Get all the games where LoanedTo == 1. I cant quite seem to figure out how I would do this? Here is an example of how I tried it, but I get a list for LibraryItems and no option for .loanedTo (I hope this makes sense) Here is an example: ![enter image description here](https://i.stack.imgur.com/59Gm6.jpg) How Would I achieve this? What SQL Syntax? Thanks! :)
ADO.Net EF, Class Inheritance LINQ-SQL Query Syntax?
CC BY-SA 2.5
null
2011-03-27T13:42:31.710
2011-03-27T14:00:58.577
null
null
null
[ "sql", "database", "linq", "entity-framework", "ado.net" ]
5,449,943
1
5,456,188
null
0
353
I am using the opengl es to display objects. when the object is near to the camera, everything is perfect. but if the objects are moved faraway from the camera, the surface of objects would break. The broken objects will be like: ![the broken object at (0,0,-500.0)](https://i.stack.imgur.com/1R7V1.png) the code snippet of draw objects is: ``` glVertexPointer(3, GL_FLOAT, 32, self.vertices); glNormalPointer(GL_FLOAT, 32, &(self.vertices[3])); glTexCoordPointer(2, GL_FLOAT, 32, &(self.vertices[6])); glDrawElements(GL_TRIANGLES, self.indexNumber, GL_UNSIGNED_SHORT, &(self.faces[0])); ``` I guess the reason could be the precision of float number. Anyone have a solution for this? thanks
surfaces got broken when object is far away in iphone
CC BY-SA 2.5
null
2011-03-27T14:43:39.567
2011-03-28T08:06:49.660
null
null
434,527
[ "iphone", "opengl-es" ]
5,450,228
1
5,460,164
null
30
9,902
I've scanned an old photo with paper texture pattern and I would like to remove the texture as much as possible without lowering the image quality. Is there a way, probably using Image Processing toolbox in MATLAB? I've tried to apply FFT transformation (using [Photoshop plugin](http://www.skeller.ch/ps/fft_action.php)), but I couldn't find any clear white spots to be paint over. Probably the pattern is not so regular for this method? You can see the sample below. If you need the full image I can upload it somewhere. ![photograph sample](https://i.stack.imgur.com/JzJMS.jpg)
Remove paper texture pattern from a photograph
CC BY-SA 2.5
0
2011-03-27T15:36:00.347
2012-05-05T19:01:21.227
null
null
163,080
[ "matlab", "image-processing", "design-patterns", "textures" ]
5,450,255
1
5,451,212
null
1
354
First the sample data: ``` bbbv[1:25] <-1 bbbv[26:50] <-2 bbbw <- 1:25 bbbx <- sample(1:5, 50, replace=TRUE) bbby <- sample(1:5, 50, replace=TRUE) bbb <- data.frame(pnum=bbbv, trialnum=bbbw, guess=bbbx, target=bbby) ``` If the target is the same number as the guess then we score 1, else 0. ``` bbb$hit <- ifelse(bbb$guess==bbb$target, 1, 0) ``` ![enter image description here](https://i.stack.imgur.com/wpmhY.png) This is the problem. I want to calculate four more columns: ``` bbb$hitpone trialnum(n) guess == trial(n+1) target bbb$hitptwo trialnum(n) guess == trial(n+2) target bbb$hitmone trialnum(n) guess == trial(n-1) target bbb$hitmtwo trialnum(n) guess == trial(n-2) target ``` To be clear. For hitmone we look at the trial guess and compare it to the target for the trial before (-1 from the current trial). For hitmtwo we look at the trial guess and compare it to the target 2 back (-2 from the current trial). hitpone and hitptwo are the same but in a positive direction (+1 and +2 from current trial). And just to be clear, as before we're interested in determining If the target is the same number as the guess then we score 1, else 0 (according to our new calculations). Now there is some minor difficulty with this task. Each pnum has 25 trials. For hitpone we cannot calculate a +1 for trial 25. For hitptwo we cannot calculate a +2 for trials 25 nor trial 24. The same follows for the hitmone: we cannot calculate -1 for trial 1, nor -2 for trials 1 and 2. This is how I want the table to look. I have mocked it up by hand, showing the first 1-3 trials and last 23-25 trials. ![Wanted output](https://i.stack.imgur.com/c48QE.png) ``` dput(bbb) structure(list(pnum = c(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2), trialnum = c(1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L, 1L, 2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 15L, 16L, 17L, 18L, 19L, 20L, 21L, 22L, 23L, 24L, 25L), guess = c(5L, 1L, 1L, 3L, 1L, 3L, 1L, 5L, 2L, 3L, 1L, 1L, 5L, 3L, 5L, 1L, 2L, 2L, 3L, 1L, 4L, 1L, 4L, 4L, 3L, 4L, 5L, 2L, 4L, 5L, 5L, 5L, 4L, 5L, 2L, 3L, 1L, 1L, 5L, 1L, 1L, 3L, 1L, 2L, 4L, 1L, 2L, 3L, 1L, 1L), target = c(4L, 3L, 4L, 5L, 5L, 1L, 1L, 1L, 1L, 1L, 1L, 3L, 1L, 2L, 5L, 1L, 3L, 2L, 1L, 4L, 4L, 1L, 1L, 3L, 4L, 4L, 2L, 3L, 2L, 1L, 1L, 5L, 4L, 3L, 5L, 1L, 1L, 1L, 2L, 5L, 2L, 4L, 3L, 1L, 1L, 2L, 5L, 3L, 3L, 3L), hit = c(0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0)), .Names = c("pnum", "trialnum", "guess", "target", "hit"), row.names = c(NA, -50L), class = "data.frame") ```
Calculate scores across columns
CC BY-SA 2.5
0
2011-03-27T15:40:59.860
2011-03-28T00:26:34.203
2011-03-28T00:26:34.203
21,461
471,431
[ "r" ]
5,450,714
1
6,603,309
null
7
2,204
I am making an app that has an MKMapView. I have a translucent UIToolbar on top of the MKMapView. The problem is that the Google logo is beneath it. Is there a way to show the Google logo above (in Y direction, not Z) the UIToolbar instead of beneath it? ![screenie](https://i.stack.imgur.com/5V3De.png)
Can I change the position of the Google logo in an MKMapView?
CC BY-SA 2.5
0
2011-03-27T16:56:03.053
2011-07-06T21:34:56.350
null
null
null
[ "objective-c", "cocoa-touch", "ios", "mkmapview" ]