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,816,369
1
null
null
1
1,297
Recently I found a small problem in IE. In ie7 browser whenever I press enter(return) key in url bar it refreshes the current page. But same behavior is not happening if the url contains "#" token. We use the "#" token for javascript history support. If we remove the "#" token it works well. Is this the issue with ie7 or it is the expected behaviour? I tested with other browser like firefox and chrome. Seems to be only in IE7 it happens. When we press enter we get the feeling like browser is refreshing. But really not. ![enter image description here](https://i.stack.imgur.com/KBXHO.png) Any ideas?!!
Internet explorer refresh is not happening on press of enter key in url bar
CC BY-SA 3.0
null
2011-04-28T09:19:52.053
2012-08-13T21:51:09.323
2011-04-28T09:43:38.970
40,945
40,945
[ "web-applications", "browser", "cross-browser", "internet-explorer-7" ]
5,816,787
1
5,816,814
null
1
3,280
I create a DataTable and bind it to a DataGrid. My DataSource consist of one Table (FooTable) which consist of one column (FooName). The following codes runs fine - except that each time I add a new row, there is a duplicate Column fill in with the same data, which I don't know how to get rid of. See below image and code. I have only one FooName column and a duplicate column comes out. ![enter image description here](https://i.stack.imgur.com/Aa5uk.png) ``` /* Create a DataGrid dg1 */ DataGrid dg1 = new DataGrid(); DataGridTextColumn col = new DataGridTextColumn(); col = new DataGridTextColumn(); colA.Binding = new Binding("FooName"); colA.Header = "FooName"; dg1.Columns.Add(colA); dataGrid1.Children.Add(dg1); /* Create a DataTable and bind it to DataGrid */ SqlCeDataAdapter da = new SqlCeDataAdapter(); string sqlStr = @"SELECT * FROM FooTable"; da.SelectCommand = new SqlCeCommand(sqlStr, conn); da.Fill(ds, "FooTable"); dt = ds.Tables["FooTable"]; DataRow newRow = dt.NewRow(); newRow["FooName"] = "Donkey"; dt.Rows.Add(newRow); dg1.ItemsSource = ds.Tables[0].DefaultView; ```
Duplicate column in DataTable when adding row
CC BY-SA 3.0
null
2011-04-28T09:56:19.990
2011-04-28T09:59:47.810
null
null
529,310
[ "c#", "wpf", "datatable" ]
5,816,782
1
10,298,786
null
1
1,354
I have a WPF billing solution that is deployed using ClickOnce for more than 500 users, CrystaReports2010 were used for reporting, 85% of the users have WindowsXP installed on their machines :( The Crystal Reports works just fine on the WindowsXP machines until the user exports a report with the built-in export button in the Crystal Reports Viewer, if he did this the export process complete successfully but he is not able to open any other report in the solution until he restarts the application. ![Export Button](https://i.stack.imgur.com/HGLdg.jpg) This is the error when trying to open a new report after the export: ![The Error Message](https://i.stack.imgur.com/i8PLO.jpg) I save the reports in my solution as content external resources outside the application .exe file, and I load them on demand, something like this: ``` var report = new ReportDocument(); report.Load(@"Reports\MyReport.rpt"); ``` I made sure that after the user close a report to close and dispose of the report document object, so no memory leaks or exceeding the max number of open reports. If I changed my implementation so that I save the reports inside my solution as embedded resources, the problem is solved, but this is not an option because the reports are relatively big in size (200KB-450KB), it will be a big DLL file that will be downloaded to the clients through ClickOnce whenever we release a new version that has any change to any report!. Another variation is to group each let's say four reports into one DLL, and still the same problem (1MB-2MB is still a big chunk). Knowing that we have a lot of reports and we get frequent change request for these reports according to changes in our client's policies. Please Help!
Crystal Reports 2010 All Reports Fail to Load Once the Report has been Exported to Any Format In WindowsXP
CC BY-SA 3.0
null
2011-04-28T09:56:07.530
2012-04-24T13:24:12.977
2011-04-28T10:03:17.103
313,452
313,452
[ "wpf", "crystal-reports", "reportviewer", "crystal-reports-export", "crystal-reports-2010" ]
5,816,884
1
null
null
0
1,863
I am using UltraWinGrid control and I want to customize its filtering. ![Custom Filter](https://i.stack.imgur.com/aLY0O.png) I am able to get all the values from the ValueList property . ``` private void dgridData_BeforeRowFilterDropDown(object sender, BeforeRowFilterDropDownEventArgs e) { // Get each item from the list foreach (ValueListItem item in e.ValueList.ValueListItems) { // Do Something } } ``` I want to show the values in the dropdown ( see picture ) as follows :- (All) (Custom) (Blanks) (NonBlanks) ********* ********* ********* . One of the option I can think is to [attach a masked editor to the current editor](http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.2/CLR2.0/html/Infragistics2.Win.UltraWinGrid.v10.2~Infragistics.Win.UltraWinGrid.UltraGridColumn~MaskDataMode.html) , to change the display. But I dont know how to attach an editor control in this scenario. Sharing some links on I was going through :- 1. Filtering Rows in Ultragrid 2. Removing default entries from Infragistics UltraWinGrid RowFilterDropDown You are welcom to let me know of other options to acheive the same.
How to change the cell appearence of the filter in UltraWinGrid
CC BY-SA 3.0
null
2011-04-28T10:04:23.813
2011-12-24T22:57:08.130
2011-04-29T08:04:17.930
102,062
102,062
[ "c#", "infragistics", "ultrawingrid" ]
5,817,002
1
5,817,104
null
1
1,421
RichFaces 4.0 skins won't work. System default style displayed instead. Here is a xhtml-file content: ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core" xmlns:rich="http://richfaces.org/rich" xmlns:a4j="http://richfaces.org/a4j"> <head> <title>RichFaces</title> <h:outputStylesheet name="/panel.ecss"/> </head> <body> <h:form> <rich:panel> <f:facet name="header"> Just some users </f:facet> <rich:dataTable value="#{userBean.users}" var="user"> <h:column> <h:outputText id="name" value="#{user.name}"/> </h:column> <h:column> <h:outputText id="email" value="#{user.email}"/> </h:column> </rich:dataTable> </rich:panel> </h:form> </body> </html> ``` Output looks like this: ![output](https://i.stack.imgur.com/m26Ms.jpg) My web.xml: ``` <?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0"> <display-name>richfacesPrj</display-name> <welcome-file-list> <welcome-file>index.html</welcome-file> <welcome-file>index.htm</welcome-file> <welcome-file>index.jsp</welcome-file> <welcome-file>default.html</welcome-file> <welcome-file>default.htm</welcome-file> <welcome-file>default.jsp</welcome-file> </welcome-file-list> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Faces Servlet</servlet-name> <url-pattern>/faces/*</url-pattern> </servlet-mapping> <context-param> <description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description> <param-name>javax.faces.STATE_SAVING_METHOD</param-name> <param-value>client</param-value> </context-param> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>resources.application</param-value> </context-param> <listener> <listener-class>com.sun.faces.config.ConfigureListener</listener-class> </listener> <context-param> <param-name>org.richfaces.skin</param-name> <param-value>blueSky</param-value> </context-param> <context-param> <param-name>org.richfaces.enableControlSkinning</param-name> <param-value>true</param-value> </context-param> </web-app> ```
RichFaces 4.0 skins won't work
CC BY-SA 3.0
null
2011-04-28T10:13:03.777
2011-04-28T10:21:45.177
null
null
313,448
[ "java", "jsf-2", "richfaces" ]
5,817,233
1
5,817,282
null
142
556,936
I want to align my button at the bottom right corner of my div. How can I do that? ![enter image description here](https://i.stack.imgur.com/p6hy8.png) Current css of div: ``` float: right; width: 83%; margin-right: 0px; font-family: Arial, Helvetica, sans-serif; font-size: 12px; height:625px; overflow:auto; ```
Align button at the bottom of div using CSS
CC BY-SA 3.0
0
2011-04-28T10:33:21.543
2022-08-18T10:48:29.733
null
null
559,070
[ "css", "button", "alignment" ]
5,817,228
1
5,817,360
null
0
13,556
I have a `HTML` page in which I have a button; pressing that button a `javascript` function is called - here results a String which is the representation of an xml. I want to represent this xml on the same page with the button, similar with what is in the picture below:!![enter image description here](https://i.stack.imgur.com/xd4V6.png) Here is the simplified code I've tried but did not worked (see under the code the result of it - nothing displayed): ``` <html> <head> <script type="text/javascript"> function xml_test() { var xmlString = "<note><name>Kundan Kumar Sinha</name><place>Bangalore</place><state>Karnataka</state></note>"; var my_div = document.getElementById("labelId"); alert(xmlString) my_div.innerHTML += xmlString; } </script> </head> <body> <input type="button" value="TEST" onclick="xml_test()"/> <br><br> <label id="labelId">XML: </label> </body> </html> ``` ![enter image description here](https://i.stack.imgur.com/yFfhV.png) I've tried with an iframe also, but I do not have an file for the src attribute. What I've tried is: ``` <html> <head> <script type="text/javascript"> function populateIframe() { var xml = "<?xml version='1.0' encoding='UTF8' standalone='yes'?><note><name>Kundan Kumar Sinha</name><place>Bangalore</place><state>Karnataka</state></note>"; var iframe = document.getElementById('myIframe'); var idoc= iframe.contentDocument || iframe.contentWindow.document; // IE compat idoc.open("text/xml"); // I know idoc.open(); exists but about idoc.open("text/xml"); I'm not sure if exists; idoc.write('<textarea name="xml" rows="5" cols="60"></textarea>'); //idoc.write(xml); // doesn't work idoc.getElementsByTagName('textarea')[0].value= xml; idoc.close(); } </script> </head> <body onload="populateIframe();"> <iframe id="myIframe" width="900" height="400"></iframe> </body> </html> ``` and the result is: ![enter image description here](https://i.stack.imgur.com/DLlEU.png) I've already looked over [How to display XML in a HTML page as a collapsible and expandable tree using Javascript?](https://stackoverflow.com/questions/1366179/how-to-display-xml-in-a-html-page-as-a-collapsible-and-expandable-tree-using-java) I took some ideas from [here](https://stackoverflow.com/questions/1453950/how-to-post-xml-to-an-iframe-with-javascript) Thank you for helping me!
Display HTML and XML content on the same HTML page
CC BY-SA 3.0
0
2011-04-28T10:32:55.970
2015-12-03T08:45:38.643
2017-05-23T12:19:48.617
-1
500,096
[ "javascript", "html", "xml", "parsing" ]
5,817,325
1
5,960,613
null
4
560
I am trying to create a new provisioning profile to test Push notification. I crated a new APP ID without wildcard. After creating the APP ID I am trying to configure it for push notification. Unfortunately configure button/link is missing in the Action column. It is showing as enabled for the Game center and In App purchase but for Push notification service its showing as configurable with a yellow indicator. Please check the image attached (In the image I am hiding the APP ID description.).![enter image description here](https://i.stack.imgur.com/OsdcV.png) Any clue what I am missing? Please help Thanks,
iOS provisioning portal - Configure link missing under the action Section fo configuring APP ID for Push Notification
CC BY-SA 3.0
0
2011-04-28T10:41:14.150
2011-05-11T07:18:21.373
null
null
487,372
[ "iphone", "push-notification", "apple-push-notifications" ]
5,817,642
1
5,817,713
null
0
858
I have a problem I want to control the backBarButtonItem when I click on it Action backAction "works ``` - (void)viewDidLoad { [self.navigationItem.backBarButtonItem setTarget:self]; [self.navigationItem.backBarButtonItem setAction:@selector(backAction)]; [super viewDidLoad]; } - (void)backAction { if ((isSaveCarte==NO)&&(isNewCarte)) { UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"Voulez vous Enregistrer la Carte" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"Save",nil]; [alertView show]; [alertView release]; } } ``` ![enter image description here](https://i.stack.imgur.com/g0d3z.png)
Problem in navigation Controller
CC BY-SA 3.0
null
2011-04-28T11:10:02.040
2011-04-28T11:15:28.917
2011-04-28T11:11:24.607
137,350
673,352
[ "iphone", "objective-c" ]
5,817,712
1
5,823,414
null
1
944
I do have I simple Silverlight Task: Display a List of Supplier objects in a DataGrid. If a supplier is "deactivated" (which is indicated by the Supplier's property ) show a hand icon and set the foreground Color to Gray. Otherwise set the foreground color to some blue. The row should look something like this: ![enter image description here](https://i.stack.imgur.com/KjIs9.png) The colums specified are template Columns as shown here: ``` <sdk:DataGridTemplateColumn IsReadOnly="True"> <sdk:DataGridTemplateColumn.CellTemplate> <DataTemplate> <TextBlock Padding="3" Text="{Binding City}" /> </DataTemplate> </sdk:DataGridTemplateColumn.CellTemplate> </sdk:DataGridTemplateColumn> ``` To set the Foreground color after assigning the datasource I implemented the and events: ``` private void LoadingDataGridRow(object sender, DataGridRowEventArgs e) { var supplier = (Supplier)e.Row.DataContext; e.Row.Foreground = supplier.IsDeactivated ? new SolidColorBrush(Colors.Gray) : new SolidColorBrush(Color.FromArgb(255, 65, 85, 155)); } private void UnLoadingDataGridRow(object sender, DataGridRowEventArgs e) { var supplier = (Supplier)e.Row.DataContext; e.Row.ClearValue(ForegroundProperty); } ``` However, when I now change the to true, the hand icon is invisible - as required - however, the foreground color is still on gray: ![enter image description here](https://i.stack.imgur.com/5YbO9.png) I already tried to fix this issue by doing a or approach, however, this overwrites custom VisualState Styles set for or . I heard this may have something to do with ? Does anybody have an idea on how to fix the issue?
Issue setting foreground of DataGridRow in Silverlight
CC BY-SA 3.0
null
2011-04-28T11:15:27.133
2011-04-28T18:40:19.977
null
null
450,711
[ "c#", "silverlight", "xaml", "datagrid", "styling" ]
5,817,840
1
5,988,357
null
5
10,453
I'm using following code to print HTML content containing text and images. ``` if (![UIPrintInteractionController isPrintingAvailable]) { UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Printer Availability Error Title", @"") message:NSLocalizedString(@"Printer Availability Error Message", @"") delegate:nil cancelButtonTitle:NSLocalizedString(@"OK", @"OK") otherButtonTitles:nil] autorelease]; [alertView show]; return; } UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController]; if(!pic) { NSLog(@"Couldn't get shared UIPrintInteractionController!"); return; } pic.delegate = self; UIPrintInfo *printInfo = [UIPrintInfo printInfo]; printInfo.outputType = UIPrintInfoOutputGeneral; printInfo.jobName = @"Sample"; pic.printInfo = printInfo; NSString *htmlString = [self prepareHTMLText]; UIMarkupTextPrintFormatter *htmlFormatter = [[UIMarkupTextPrintFormatter alloc] initWithMarkupText:htmlString]; htmlFormatter.startPage = 0; // 1-inch margins on all sides htmlFormatter.contentInsets = UIEdgeInsetsMake(72.0, 72.0, 72.0, 72.0); // printed content should be 6-inches wide within those margins htmlFormatter.maximumContentWidth = 6 * 72.0; pic.printFormatter = htmlFormatter; [htmlFormatter release]; pic.showsPageRange = YES; void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) = ^(UIPrintInteractionController *printController, BOOL completed, NSError *error) { if (!completed && error) { NSLog(@"Printing could not complete because of error: %@", error); } }; if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { [pic presentFromBarButtonItem:self.myPrintBarButton animated:YES completionHandler:completionHandler]; } else { [pic presentAnimated:YES completionHandler:completionHandler]; } ``` See attached for results (the scaled down version may not be very clear, but, hopefully, you get the picture). Here are my questions: 1. How is the print paper size determined by AirPrint? What if I want to specifically format and print data for A4 paper? 2. The result of using the above code and printing using different simulated printers (Printer Simulator) is that, in all cases, I get a 1 inch margin on the top of first page, but not on consecutive pages. Why? 3. The result of using the above code and printing using different simulated printers (Printer Simulator) is that, in some cases, the font style is lost. As a result, the content is shifted down. Why? ![Screen-shot](https://i.stack.imgur.com/IhI92.png)
Print paper size and content inset
CC BY-SA 3.0
0
2011-04-28T11:26:28.597
2016-10-14T12:18:33.863
2016-10-14T12:18:33.863
239,219
49,739
[ "html", "ios", "printing", "airprint", "uiprintinteractioncntrler" ]
5,818,331
1
5,823,518
null
7
4,749
Just came across an interesting effect while debugging a View. The scenario is easy to reproduce - I have a breakpoint in a `View`, in the Watch window I add `ViewBag.ViewData` and the value is `null`. However, if I just add `ViewBag` and expand the object, I can see the `ViewData` and it is not `null`. I can also successfully expand it and see its properties. Can anyone explain whether it's a bug or what causes this behavior? ![ViewBag.ViewData in Watch window](https://i.stack.imgur.com/60muo.png) `ViewBag.ViewData` is actually `null`. E.g. if I have this code in the View: ``` if (ViewBag.ViewData == null) { <span>ViewBag.ViewData is null</span> } ``` it displays the span. So the weird part is that I can expand it in the watch window and see the properties. In response to @Darin Dimitrov's answer - I tried to reproduce this behavior with a custom test class and I get a `RuntimeBinderException` when trying to access the private property: `'SomeClass.SomeProperty' is inaccessible due to its protection level`: ``` public class SomeClass { private string SomeProperty; } dynamic dynamicObject = new SomeClass(); if (dynamicObject.SomeProperty == null) { Console.WriteLine("dynamicObject.SomeProperty is null"); } ``` In this case, shouldn't I be getting the same exception when accessing `ViewBag.ViewData` in the View (the line with `if (ViewBag.ViewData == null)`)?
How can my ViewData be null, but expandable in the debugger?
CC BY-SA 3.0
0
2011-04-28T12:06:59.653
2013-03-18T15:30:19.853
2013-03-18T15:30:19.853
3,619
240,424
[ "c#", "asp.net-mvc", "dynamic", "viewbag" ]
5,818,387
1
5,920,609
null
4
2,860
I was wondering how to create (using PyQt4) a derived `QTabWidget` with a check box next to each tab title? Like this: ![](https://i.stack.imgur.com/RqIGn.png)
QTabWidget with CheckBox in title
CC BY-SA 3.0
0
2011-04-28T12:11:19.707
2015-09-24T12:44:42.397
2013-02-20T22:10:14.270
1,258,041
340,754
[ "python", "checkbox", "qt4", "pyqt4", "qtabwidget" ]
5,818,501
1
5,818,641
null
0
103
When I write this: ``` var loc = "a,a\n"; alert(loc); ``` It shows "`a...`" in alert. Then after I add some values in loc as ``` loc = loc + "abc," + valueFromFunc; alert(loc); ``` It shows "`ab...a,a\nabc,value`" in alert. Why I get `a..` and `ab..` in loc? I want loc to be "`a,a\nabc,value`" --- Screen shot of my google chrome: ![enter image description here](https://i.stack.imgur.com/U1lRg.png)
Odd behavior in javascript
CC BY-SA 3.0
null
2011-04-28T12:21:39.883
2011-04-28T12:34:46.837
2011-04-28T12:34:46.837
559,070
559,070
[ "javascript", "var" ]
5,818,715
1
5,818,911
null
0
280
I am creating mobile application in asp.net webform targeting IPhone, Android and blackberry. I am using JQuery-Mobile for the same. Below is my first page I have developed with jquery-mobile. ![JQuery-mobile page](https://i.stack.imgur.com/49hv7.jpg) I don't have iphone, android and blackberry. So my questions are: 1. Best Simulator I can use on windows XP/ Windows Server 2008 for Iphone, Andriod and Blackberry 2. Also, when I am running the application on the browser it is looking wierd. I mean textbox size, buttons. Is this the way it looks on normal webpage or it's my faulty design? 3. As I am developing application in asp.net, do I need to install latest browser which support HTML5 and CSS3 because below browser is IE7.
Designing issue in JQuery mobile with asp.net
CC BY-SA 3.0
null
2011-04-28T12:38:45.210
2011-04-28T13:26:17.957
2011-04-28T12:48:49.917
609,582
609,582
[ "asp.net", "windows-xp", "ios-simulator", "jquery-mobile" ]
5,818,850
1
5,834,918
null
6
18,059
I am populating a spinner from the database like this ``` // Populating the City Spinner Cursor cities = db.cityList(); startManagingCursor(cities); // create an array to specify which fields we want to display String[] from = new String[] { DBAdapter.KEY_NAME }; // create an array of the display item we want to bind our data to int[] to = new int[] { android.R.id.text1 }; Spinner cityList = (Spinner) this.findViewById(R.id.citySpiner); SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cities, from, to); adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); cityList.setAdapter(adapter); ``` When i try to get the content from the selected item of the spinner like this ``` // Get the City Spinner getCity = (Spinner) findViewById(R.id.citySpiner); String cityName = getCity.getSelectedItem().toString(); ``` i get the following. Is there a way i can get the city name or the city id from the database. ![enter image description here](https://i.stack.imgur.com/7hheA.png)
Android Spinner Selected Item
CC BY-SA 3.0
0
2011-04-28T12:48:38.213
2022-12-24T14:33:57.900
2021-12-30T13:17:28.273
4,294,399
155,196
[ "android", "spinner", "android-cursor" ]
5,818,745
1
null
null
4
6,199
I created 4 textures and attach them to FBO, named fbo_texture0 - fbo_texture3. All of them are successfully created, as given by the following screenshot: ![Textures in the FBO](https://i.stack.imgur.com/7SXy7.png) Now, i wanted to create the 5th texture which is obtained from the previous textures (fbo_texture0 - fbo_texture3) using GLSL. For now, i just want to copy the first texture into the fifth texture. Unfortunately, here is what i got: ![texture fail](https://i.stack.imgur.com/NdMnx.png) The question is: 1. How can i access these fbo textures in GLSL? 2. How can i create the 5th texture? (or copy from the first texture to the fifth texture?) Here's the complete code of the program (in case needed): ``` #include <windows.h> #include <GL/glew.h> // Include the GLEW header file #include <GL/glut.h> // Include the GLUT header file #include <iostream> // Allow us to print to the console using namespace std; bool* keyStates = new bool[256]; // Create an array of boolean values of length 256 (0-255) unsigned int fbo; // The frame buffer object unsigned int fbo_depth; // The depth buffer for the frame buffer object unsigned int fbo_texture0; // The texture object to write our frame buffer object to unsigned int fbo_texture1; unsigned int fbo_texture2; unsigned int fbo_texture3; unsigned int fbo_texture4; GLhandleARB shaderProgram; GLhandleARB vertexShader; GLhandleARB fragmentShader; int window_width = 500; // The width of our window int window_height = 500; // The height of our window void initFrameBufferDepthBuffer(void) { glGenRenderbuffers(1, &fbo_depth); // Generate one render buffer and store the ID in fbo_depth glBindRenderbuffer(GL_RENDERBUFFER, fbo_depth); // Bind the fbo_depth render buffer glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, window_width, window_height); // Set the render buffer storage to be a depth component, with a width and height of the window glBindRenderbuffer(GL_RENDERBUFFER, 0); // Unbind the render buffer } void initFrameBufferTextures(void) { glGenTextures(1, &fbo_texture0); // Generate one ture glBindTexture(GL_TEXTURE_2D, fbo_texture0); // Bind the ture fbo_texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, window_width, window_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Create a standard ture with the width and height of our window glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); glGenTextures(1, &fbo_texture1); // Generate one ture glBindTexture(GL_TEXTURE_2D, fbo_texture1); // Bind the ture fbo_texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, window_width, window_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Create a standard ture with the width and height of our window glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); glGenTextures(1, &fbo_texture2); // Generate one ture glBindTexture(GL_TEXTURE_2D, fbo_texture2); // Bind the ture fbo_texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, window_width, window_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Create a standard ture with the width and height of our window glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); glGenTextures(1, &fbo_texture3); // Generate one ture glBindTexture(GL_TEXTURE_2D, fbo_texture3); // Bind the ture fbo_texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, window_width, window_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Create a standard ture with the width and height of our window glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); glGenTextures(1, &fbo_texture4); // Generate one ture glBindTexture(GL_TEXTURE_2D, fbo_texture4); // Bind the ture fbo_texture glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, window_width, window_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); // Create a standard ture with the width and height of our window glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); } void printInfoLog(GLhandleARB obj) { int infologLength = 0; int charsWritten = 0; char* infoLog; glGetObjectParameterivARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB, &infologLength); if (infologLength > 0) { infoLog = (char*)malloc(infologLength); glGetInfoLogARB(obj, infologLength, &charsWritten, infoLog); printf("%s\n",infoLog); free(infoLog); } } void initFrameBuffer(void) { initFrameBufferDepthBuffer(); // Initialize our frame buffer depth buffer initFrameBufferTextures(); // Initialize our frame buffer ture glGenFramebuffers(1, &fbo); // Generate one frame buffer and store the ID in fbo glBindFramebuffer(GL_FRAMEBUFFER, fbo); // Bind our frame buffer glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fbo_texture0, 0);// Attach the ture fbo_texturen to the color buffer in our frame buffer glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT1, GL_TEXTURE_2D, fbo_texture1, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT2, GL_TEXTURE_2D, fbo_texture2, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT3, GL_TEXTURE_2D, fbo_texture3, 0); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT4, GL_TEXTURE_2D, fbo_texture4, 0); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, fbo_depth); // Attach the depth buffer fbo_depth to our frame buffer GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER); // Check that status of our generated frame buffer if (status != GL_FRAMEBUFFER_COMPLETE) // If the frame buffer does not report back as complete { cout << "Couldn't create frame buffer" << endl; // Output an error to the console exit(0); // Exit the application } glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind our frame buffer } void init(void) { //glEnable(GL_TEXTURE_2D); // Enable turing so we can bind our frame buffer ture glEnable(GL_DEPTH_TEST); // Enable depth testing initFrameBuffer(); // Create our frame buffer object } void keyOperations (void) { if (keyStates['a']) { // If the a key has been pressed // Perform 'a' key operations } } void renderTextures(void) { glBindFramebuffer(GL_FRAMEBUFFER, fbo); // Bind our frame buffer for rendering glPushAttrib(GL_VIEWPORT_BIT | GL_ENABLE_BIT); // Push our glEnable and glViewport states glViewport(0, 0, window_width, window_height); // Set the size of the frame buffer view port glDrawBuffer(GL_COLOR_ATTACHMENT0); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); // Set the clear colour glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear the depth and colour buffers glLoadIdentity();// Reset the modelview matrix glTranslatef(0.0f, 0.0f, -5.0f); //Add ambient light GLfloat ambientColor[] = {0.2f, 0.2f, 0.2f, 1.0f}; //Color(0.2, 0.2, 0.2) glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor); //Add positioned light GLfloat lightColor0[] = {0.5f, 0.5f, 0.5f, 1.0f}; //Color (0.5, 0.5, 0.5) GLfloat lightPos0[] = {4.0f, 0.0f, 8.0f, 1.0f}; //Positioned at (4, 0, 8) glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor0); glLightfv(GL_LIGHT0, GL_POSITION, lightPos0); //Add directed light GLfloat lightColor1[] = {0.5f, 0.2f, 0.2f, 1.0f}; //Color (0.5, 0.2, 0.2) //Coming from the direction (-1, 0.5, 0.5) GLfloat lightPos1[] = {-1.0f, 0.5f, 0.5f, 0.0f}; glLightfv(GL_LIGHT1, GL_DIFFUSE, lightColor1); glLightfv(GL_LIGHT1, GL_POSITION, lightPos1); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_LIGHT1); glEnable(GL_DEPTH_TEST); glutSolidTeapot(2.0); glColor3f(0.1,0.2,0.7); glDrawBuffer(GL_COLOR_ATTACHMENT1); glClearColor(0.5f, 0.5f, 0.0f, 1.0f); // Set the clear colour glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear the depth and colour buffers glLoadIdentity();// Reset the modelview matrix glTranslatef(0.0f, 0.0f, -5.0f); glutSolidTorus(0.80, 1.6, 50, 100); glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ; glEnable ( GL_COLOR_MATERIAL ) ; glDrawBuffer(GL_COLOR_ATTACHMENT2); glClearColor(0.5f, 0.0f, 0.0f, 1.0f); // Set the clear colour glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear the depth and colour buffers glLoadIdentity();// Reset the modelview matrix glTranslatef(0.0f, 0.0f, -2.0f); glutSolidTetrahedron(); glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ; glEnable ( GL_COLOR_MATERIAL ) ; glDrawBuffer(GL_COLOR_ATTACHMENT3); glClearColor(0.5f, 0.0f, 0.3f, 1.0f); // Set the clear colour glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);// Clear the depth and colour buffers glLoadIdentity();// Reset the modelview matrix glTranslatef(0.0f, 0.0f, -2.0f); glutSolidOctahedron(); glColorMaterial ( GL_FRONT_AND_BACK, GL_EMISSION ) ; glEnable ( GL_COLOR_MATERIAL ) ; glBindFramebuffer(GL_FRAMEBUFFER, 0); // Unbind our ture glActiveTexture(GL_TEXTURE0); //glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, fbo_texture0); glUniform1i(glGetUniformLocation(shaderProgram, "tex0"), 0); glActiveTexture(GL_TEXTURE1); //glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, fbo_texture1); glUniform1i(glGetUniformLocation(shaderProgram, "tex1"), 1); glActiveTexture(GL_TEXTURE2); //glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, fbo_texture2); glUniform1i(glGetUniformLocation(shaderProgram, "tex2"), 2); glActiveTexture(GL_TEXTURE3); //glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, fbo_texture3); glUniform1i(glGetUniformLocation(shaderProgram, "tex3"), 3); glPopAttrib(); // Restore our glEnable and glViewport states glutSwapBuffers(); } static char* textFileRead(const char *fileName) { char* text; if (fileName != NULL) { FILE *file = fopen(fileName, "rt"); if (file != NULL) { fseek(file, 0, SEEK_END); int count = ftell(file); rewind(file); if (count > 0) { text = (char*)malloc(sizeof(char) * (count + 1)); count = fread(text, sizeof(char), count, file); text[count] = '\0'; } fclose(file); } } return text; } void initShader(){ char* vsSource = textFileRead("./shader/multitexture.vs"); char* fsSource = textFileRead("./shader/multitexture.fs"); printf("%s\n",fsSource); vertexShader = glCreateShader(GL_VERTEX_SHADER); glShaderSource(vertexShader, 1, (const GLchar **)(&vsSource), NULL); glCompileShader(vertexShader); printInfoLog(vertexShader); fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); glShaderSource(fragmentShader, 1, (const GLchar **)(&fsSource), NULL); glCompileShader(fragmentShader); printInfoLog(fragmentShader); delete [] vsSource; delete [] fsSource; shaderProgram = glCreateProgram(); glAttachShader(shaderProgram, vertexShader); glAttachShader(shaderProgram, fragmentShader); glLinkProgram(shaderProgram); } void display (void) { keyOperations(); // Perform any key presses glUseProgram(0); renderTextures(); // Render our teapot scene into our frame buffer GLsync s = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); glUseProgram(shaderProgram); glClearColor(0.0f, 1.0f, 0.0f, 1.0f); // Clear the background of our window to red glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); //Clear the colour buffer (more buffers later on) glLoadIdentity(); // Load the Identity Matrix to reset our drawing locations glTranslatef(-4.7f, 1.0f, -4.0f); glWaitSync(s, 0, GL_TIMEOUT_IGNORED); glDeleteSync(s); glBindTexture(GL_TEXTURE_2D, fbo_texture0); // Bind our frame buffer ture glBegin(GL_QUADS); glColor4f(1, 1, 1, 1); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // The bottom left corner glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); // The top left corner glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.0f); // The top right corner glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); // The bottom right corner glEnd(); glBindTexture(GL_TEXTURE_2D, 0); // Unbind any tures glLoadIdentity(); glTranslatef(-2.5f, 1.0f, -4.0f); glBindTexture(GL_TEXTURE_2D, fbo_texture1); // Bind our frame buffer ture glBegin(GL_QUADS); glColor4f(1, 1, 1, 1); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // The bottom left corner glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); // The top left corner glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.0f); // The top right corner glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); // The bottom right corner glEnd(); glBindTexture(GL_TEXTURE_2D, 0); // Unbind any tures glLoadIdentity(); glTranslatef(-0.3f, 1.0f, -4.0f); glBindTexture(GL_TEXTURE_2D, fbo_texture2); // Bind our frame buffer ture glBegin(GL_QUADS); glColor4f(1, 1, 1, 1); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // The bottom left corner glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); // The top left corner glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.0f); // The top right corner glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); // The bottom right corner glEnd(); glBindTexture(GL_TEXTURE_2D, 0); // Unbind any tures glLoadIdentity(); glTranslatef(1.9f, 1.0f, -4.0f); glBindTexture(GL_TEXTURE_2D, fbo_texture3); // Bind our frame buffer ture glBegin(GL_QUADS); glColor4f(1, 1, 1, 1); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // The bottom left corner glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); // The top left corner glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.0f); // The top right corner glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); // The bottom right corner glEnd(); glBindTexture(GL_TEXTURE_2D, 0); // Unbind any tures glLoadIdentity(); glTranslatef(4.1f, 1.0f, -4.0f); glBindTexture(GL_TEXTURE_2D, fbo_texture4); // Bind our frame buffer ture glBegin(GL_QUADS); glColor4f(1, 1, 1, 1); glTexCoord2f(0.0f, 0.0f); glVertex3f(-1.0f, -1.0f, 0.0f); // The bottom left corner glTexCoord2f(0.0f, 1.0f); glVertex3f(-1.0f, 1.0f, 0.0f); // The top left corner glTexCoord2f(1.0f, 1.0f); glVertex3f(1.0f, 1.0f, 0.0f); // The top right corner glTexCoord2f(1.0f, 0.0f); glVertex3f(1.0f, -1.0f, 0.0f); // The bottom right corner glEnd(); glBindTexture(GL_TEXTURE_2D, 0); // Unbind any tures glutSwapBuffers(); } void reshape (int width, int height) { glViewport(0, 0, (GLsizei)width, (GLsizei)height); // Set our viewport to the size of our window glMatrixMode(GL_PROJECTION); // Switch to the projection matrix so that we can manipulate how our scene is viewed glLoadIdentity(); // Reset the projection matrix to the identity matrix so that we don't get any artifacts (cleaning up) gluPerspective(60, (GLfloat)width / (GLfloat)height, 1.0, 100.0); // Set the Field of view angle (in degrees), the aspect ratio of our window, and the new and far planes glMatrixMode(GL_MODELVIEW); // Switch back to the model view matrix, so that we can start drawing shapes correctly } void keyPressed (unsigned char key, int x, int y) { keyStates[key] = true; // Set the state of the current key to pressed } void keyUp (unsigned char key, int x, int y) { keyStates[key] = false; // Set the state of the current key to not pressed } int main (int argc, char **argv) { glutInit(&argc, argv); // Initialize GLUT glutInitDisplayMode (GLUT_DOUBLE | GLUT_DEPTH | GLUT_RGBA); // Set up a basic display buffer (only single buffered for now) glutInitWindowSize (1280, 500); // Set the width and height of the window glutInitWindowPosition (100, 100); // Set the position of the window glutCreateWindow ("OpenGL FBO"); // Set the title for the window if (GLEW_OK != glewInit()) { std::cout << "Couldn't initialize GLEW" << std::endl; exit(0); } initShader(); init(); glutDisplayFunc(display); // Tell GLUT to use the method "display" for rendering glutIdleFunc(display); // Tell GLUT to use the method "display" for rendering glutReshapeFunc(reshape); // Tell GLUT to use the method "reshape" for reshaping glutKeyboardFunc(keyPressed); // Tell GLUT to use the method "keyPressed" for key presses glutKeyboardUpFunc(keyUp); // Tell GLUT to use the method "keyUp" for key up events glutMainLoop(); // Enter GLUT's main loop } ``` Here is the vertex shader: ``` void main(void) { gl_TexCoord[0] = gl_MultiTexCoord0; gl_Position = ftransform(); } ``` And here is the fragment shader: ``` uniform sampler2D tex0; uniform sampler2D tex1; uniform sampler2D tex2; uniform sampler2D tex3; void main(void) { gl_FragColor = texture2D(tex0, gl_TexCoord[0].st); } ``` After modifying the code as suggested by @Damon (the code has been edited as well) , here's the screenshot of the result: ![enter image description here](https://i.stack.imgur.com/2mxom.png) Now, I don't really know what the problem actually is. I tried to change the fragment shader to access another texture e.g. `gl_FragColor = texture2D(tex2, gl_TexCoord[0].st);` but i still got the same display as above. So i think it is definitely not the modelview/projection problem. The problem still left unclear. However, I tried to give only one `glActiveTexture(GL_TEXTUREn);` command at the program, and comment out other `glActiveTexture` command (without shader modification), and got the following result: ![enter image description here](https://i.stack.imgur.com/pY5Vf.png) Only `glActiveTexture(GL_TEXTURE0);`activated. ![enter image description here](https://i.stack.imgur.com/MNAuh.png) Only `glActiveTexture(GL_TEXTURE1);`activated. ![enter image description here](https://i.stack.imgur.com/28zUy.png) Only `glActiveTexture(GL_TEXTURE2);`activated. ![enter image description here](https://i.stack.imgur.com/0Po4Y.png) Only `glActiveTexture(GL_TEXTURE3);`activated. When at least 2 `glActiveTexture(GL_TEXTUREn);` activated, i got the same result as . That left me wondering what the problem actually is.
Accessing Multiple FBO Textures in GLSL to create another texture
CC BY-SA 3.0
0
2011-04-28T12:41:03.237
2013-01-15T19:06:13.283
2011-04-29T22:39:04.497
548,451
548,451
[ "opengl", "glsl", "textures", "fbo" ]
5,818,925
1
5,819,064
null
3
4,801
Question: I need to draw pictures as below in C#/VB.NET Note that my problem is NOT drawing circles in C#. ![Ishihara transformation](https://i.stack.imgur.com/Pj3NC.jpg) My problems is drawing them without much whitespace and without intersection. My thought would be using "Orbits" and then draw the circles with center on the "orbit" lines. (with some orbit lines for bigger and some only for smaller circles) The problem is that there should be no intersections. ![Orbit](https://i.stack.imgur.com/GuD27.png) Anyone has a better idea ? Or how would I test whether a to be drawn circle of given radius would intersect with an already present circle ?
How to draw ishihara-transformations (circles in circle without intersection)?
CC BY-SA 3.0
0
2011-04-28T12:54:54.787
2011-04-28T14:12:15.563
null
null
155,077
[ "c#", ".net", "vb.net", "drawing", "geometry" ]
5,819,183
1
5,822,322
null
0
928
I am trying to update the table as new records come in for table below: ![enter image description here](https://i.stack.imgur.com/GQkeU.jpg) I have got the part where I need to get live information using Ajax. I am using the `<tr id = {$university}>` as ids to create new rows or update existing. But the updating doesn't seem to work. i.e. If a new student entry is made for University A, than adding a new HTML code. So my existing HTML code looks like ``` <tr id = "A"> <td>A</td> <td>Mr. X</td> <td>[email protected]</td> </tr> <tr id = "A"> <td></td> <td>Mr. Y</td> <td>[email protected]</td> </tr> <tr id = "A"> <td></td> <td>Mr. S</td> <td>[email protected]</td> </tr> ``` and when I add new data using same `<tr id = "A">`, it does not append information, but creates a new row: ``` <tr id = "A"> <td>A</td> <td>Mr. Z</td> <td>[email protected]</td> </tr> ``` will not append information but create another row in UI. How can I append new information to existing rows? Added the js code: [http://pastebin.com/4tjyUgZa](http://pastebin.com/4tjyUgZa)
Updating Table dynamically - Ajax HTML
CC BY-SA 3.0
null
2011-04-28T13:13:55.780
2017-11-20T22:54:24.660
2017-11-20T22:54:24.660
4,370,109
183,717
[ "html", "ajax", "html-table" ]
5,819,307
1
null
null
6
2,649
![Broken](https://i.stack.imgur.com/8oxgD.png) Consider the screenshot above of a standard Netbeans Install on a standard Ubuntu 10.10 distribution. Notice the following: 1. The main menu-bar fonts are not consistent with the rest of the system. 2. Drop down menus do not have frames (This is very noticeable from the File menu) 3. The "grayed out" menus are "embossed", not grayed out. 4. The keyboard short-cuts are unreadable unless you actually hover over the menu. 5. The editor fonts are ugly. I'm using the latest Java(TM) SE Runtime Environment (build 1.6.0_25-b06), 64 bit from sun/oracle installed in /opt/... My netbeans_jdkhome points to the correct JDK installed in /opt/, points to the correct java in the JDSK as I added a profile to /etc/profile.d. The system is AMD 64 bit Ubuntu 10.10 install. The Default Ambiance theme is used, switching to Clearlooks fixes some of the issues at the cost of screwing the L&F of everything else, not a solution... --laf Nimbus works as expected, fonts are still unusable, not a solution, especially as I'm developing NB Platform apps and L&F is important. I have none of these issues on Fedora 13 with Netbeans 7.0. The best I can do currently is with the Nimbus LAF ``` --laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd ``` So my netbeans_default_options in netbeans.conf looks like this: ``` netbeans_default_options="-J-client -J-Xss2m -J-Xms512m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true --laf Nimbus -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd" ```
How do I fix the deeply broken look and feel Issues with Netbeans 7.0 on Ubuntu 10
CC BY-SA 3.0
0
2011-04-28T13:23:09.177
2012-06-29T05:51:29.867
2012-06-29T05:51:29.867
203,449
203,449
[ "java", "netbeans", "ubuntu" ]
5,819,310
1
5,819,448
null
3
1,216
I have profile pages for users of my little card game, like [this one](http://preferans.de/user.php?id=OK138970940958) - where I display their position by looking up their city. My current jQuery code is here: ``` <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script type="text/javascript"> $(function() { // the city name is inserted here by the PHP script findCity('New-York'); }); function createMap(center) { var opts = { zoom: 9, center: center, mapTypeId: google.maps.MapTypeId.ROADMAP }; return new google.maps.Map(document.getElementById("map"), opts); } function findCity(city) { var gc = new google.maps.Geocoder(); gc.geocode( { "address": city}, function(results, status) { if (status == google.maps.GeocoderStatus.OK) { var pos = results[0].geometry.location; var map = createMap(pos); var marker = new google.maps.Marker({ map: map, title: city, position: pos }); } }); } </script> ...... <div id="map"></div> ``` and it works well, but I only get a simple red marker with a dot displayed: ![map with a marker](https://i.stack.imgur.com/vxyWe.png) Is there please a way to display the user avatar instead of the simple marker? I have URLs for user pictures in my database (together with names, cities, etc.) They are mostly big images (bigger than 200x300).
Google maps Javascript: adding user photo to a marker
CC BY-SA 3.0
null
2011-04-28T13:23:18.007
2016-05-16T22:17:39.097
2016-05-16T22:17:39.097
437,763
165,071
[ "javascript", "jquery", "google-maps", "google-maps-markers", "avatar" ]
5,819,437
1
null
null
0
160
ETA: I'm thinking that my question needs some clarification. I don't want to sort my arrays. I want to be sure that a given array that is in order by a particular criterion, is also in order by another criterion. I made a graphic to illustrate. Each row is an array ordered by number. If the letters are also in order, the array passes the test. ![enter image description here](https://i.stack.imgur.com/bOOE4.png) --- # Original Question I have a parent class PhysicalCount with 2 properties: `date`, `count`. I also have subclasses of PhysicalCount: `ClutchCount`, `FryCount` and `MatCount`. When I have a mixed array of PhysicalCounts and subclasses I need to verify (not set!) that the order matches these criteria: 1. objects are in order by date 2. 0 to 1 objects of each child class may exist 3. 0 to many objects of PhysicalCount may exist 4. if a ClutchCount is present it must have an earlier date than a FryCount or MatCount if those exist 5. if a FryCount is present it must have an earlier date than a MatCount if that exists Boiled down, the question is something like: Given a list sorted by one criterion (`$o->date` in my case), what is the most efficient way to ascertain that sorting that same list by another criterion (`get_class($o)`in my case) will result in the same order? I'd prefer a solution in PHP, but I'm thinking this is a fairly common problem that has a standard solution that I just don't know the name of. (Here is me regretting my degree choice [not CS]).
how to verify order of elements in a list or array
CC BY-SA 3.0
null
2011-04-28T13:32:14.983
2011-04-28T15:44:07.087
2020-06-20T09:12:55.060
-1
128,245
[ "php", "sorting" ]
5,820,085
1
5,820,114
null
5
1,295
I'm using jQuery to change between clases when an image is clicked. In chrome & FF everything is fine but in ie9 (probably also earlier) when i click one of the image some ugly gray border appears. This is the html code: ``` <a id="PASTWINS" href="improve.php" class="PastWin_Unmarked"></a> ``` This is the style: ``` .PastWin_Unmarked{border:0px;display: block;background-image:url('images/tomgui3_08.png');background-repeat:no-repeat;width:206px;height:43px;text-decoration:none;} ``` And here is an image with the ugly border that appears: ![enter image description here](https://i.stack.imgur.com/jvjyU.png)
ie shows border when image is clicked
CC BY-SA 3.0
0
2011-04-28T14:19:47.773
2011-04-28T14:52:03.260
null
null
537,943
[ "jquery", "html", "css" ]
5,820,102
1
null
null
1
2,986
I've just installed Python 2.7.1 on my MacBook (running Snow Leopard), and I've also installed the [scipy superpack](http://stronginference.com/scipy-superpack/). NumPy and matplotlib import just fine, but when I invoke pyplot.show(), either in the interpreter or in a script, a blank window appears for just a second and then IDLE restarts. No graph appears. I wrote an extremely simple test script which appears in the screenshot below. It creates two lists, prints them, plots the two lists against each other, and outputs the plot to a png. This it does successfully, and you can see that the png indeed exists in the appropriate folder. So pyplot.savefig() works as expected. But then I invoked pyplot.show(), and you can see that the interpreter has restarted. How can I fix this? ![screen shot of python output](https://i.stack.imgur.com/swfKP.png) ## Update As per @Blender's suggestion, I added plt.show() to the script and ran it from Terminal. This time it produced the following error message: ``` Exception in Tkinter callback Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk/Tkinter.py", line 1410, in __call__ return self.func(*args) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.1.0-py2.6-macosx-10.6-universal.egg/matplotlib/backends/backend_tkagg.py", line 235, in resize self.show() File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.1.0-py2.6-macosx-10.6-universal.egg/matplotlib/backends/backend_tkagg.py", line 239, in draw tkagg.blit(self._tkphoto, self.renderer._renderer, colormode=2) File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/matplotlib-1.1.0-py2.6-macosx-10.6-universal.egg/matplotlib/backends/tkagg.py", line 19, in blit tk.call("PyAggImagePhoto", photoimage, id(aggimage), colormode, id(bbox_array)) TclError ```
pyplot.show() fails to produce graph, causes IDLE to restart
CC BY-SA 3.0
0
2011-04-28T14:20:50.727
2016-08-09T06:22:35.830
2011-04-28T14:55:15.913
115,543
115,543
[ "python", "matplotlib" ]
5,820,173
1
5,820,240
null
2
1,983
I want to have a JTree in my swing application that does not have an icon for leaf nodes, so I wrote the following code: ``` DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) jtree.getCellRenderer(); renderer.setLeafIcon(null); jtree.setCellRenderer(renderer); ``` This correctly removes the icons for leaves, but it also results in the following rendering error: ![Badly rendered tree](https://i.stack.imgur.com/MnOy9.png) You can see that the labels attached to the branch nodes are truncated, and they are bunched too close together. If I expand and then collapse all the branch nodes, the problem fixes itself: ![enter image description here](https://i.stack.imgur.com/Rs1gh.png) If I comment out the line: ``` renderer.setLeafIcon(null); ``` The problem goes away (but the leaf icon, which I don't want, is present.) Any ideas how to fix this? Edit: I'll add all the relevant code. ``` public class StepChooserPanel extends JScrollPane { private JTree rules; public StepChooserPanel(TabPanel parent){ super(); this.setBackground(Color.white); DefaultMutableTreeNode top = new DefaultMutableTreeNode("top"); rules = new JTree(); rules.getSelectionModel() .setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION); rules.setRootVisible(false); rules.setScrollsOnExpand(false); rules.setToggleClickCount(1); rules.addTreeSelectionListener(parent); rules.putClientProperty("JTree.lineStyle", "None"); DefaultTreeCellRenderer renderer = (DefaultTreeCellRenderer) rules.getCellRenderer(); renderer.setLeafIcon(null); rules.setCellRenderer(renderer); this.setViewportView(rules); } public void populateFilterRules(InferenceSystem system){ DefaultMutableTreeNode root = new DefaultMutableTreeNode(); TreeModel treeModel = new DefaultTreeModel(root); rules.setModel(treeModel); List<Rule> systemRules = system.getSortedRules(); for(int i = 0; i < systemRules.size(); i++){ if(!(systemRules.get(i) instanceof InferenceRule)){ continue; } DefaultMutableTreeNode rule = new DefaultMutableTreeNode (systemRules.get(i).getName()); root.add(rule); } rules.expandPath(new TreePath(root.getPath())); this.repaint(); } public void populateRewriteList(Collection<Rewrite> choices){ DefaultMutableTreeNode root = (DefaultMutableTreeNode) rules.getModel() .getRoot(); for(Rewrite rr : choices){ for (int i = 0; i < root.getChildCount(); i++){ String ruleName = (String) ((DefaultMutableTreeNode)root.getChildAt(i)) .getUserObject(); if(rr.getRule().getName().equals(ruleName)){ ((DefaultMutableTreeNode)root.getChildAt(i)) .add(new DefaultMutableTreeNode(rr)); } } } this.repaint(); } ``` All the setup is done in the constructor. populateFilterRules is called, which adds in the branch nodes. Then populateRewriteList is called, which adds in the leaf nodes to the right places. repaint is called after these changes are made. The containing JScrollPane class is wrapped into a JSplitPane, which is rendered into the frame.
Swing JTree icon rendering
CC BY-SA 3.0
null
2011-04-28T14:26:40.473
2011-12-15T00:31:08.680
2011-12-15T00:31:08.680
606,664
284,741
[ "java", "swing", "icons", "rendering", "jtree" ]
5,820,234
1
5,820,944
null
4
10,260
I am working on Managed C++ for the first time... I have made a form using Winform which has a button to browse through directories for file and whichever path the user selects, the path should be visible on the text box. I wanted to know how to create the file browser dialog box in Managed C++. Attaching the image of the form if required. ![enter image description here](https://i.stack.imgur.com/rITgl.jpg)
Browse files dialog box using winforms and Managed C++
CC BY-SA 3.0
null
2011-04-28T14:30:58.540
2011-04-28T15:18:28.910
null
null
667,851
[ "winforms", "visual-c++", "managed" ]
5,820,239
1
5,820,253
null
5
2,907
How can I design the following layout in WPF? ![enter image description here](https://i.stack.imgur.com/nc2Ou.png)
WPF - How to design a Border that contains a Label on the corner
CC BY-SA 3.0
null
2011-04-28T14:31:08.247
2012-12-05T19:57:44.287
2012-12-05T19:57:44.287
180,529
510,435
[ "wpf" ]
5,820,283
1
5,825,537
null
1
4,689
I've got a VBA application that throws an "ActiveX component can't create object" exception when trying to run. ![enter image description here](https://i.stack.imgur.com/lhrDi.png) The breakpoint is set on the line that throws the exception: ![enter image description here](https://i.stack.imgur.com/CxzoH.png) I'm assuming that it has something to do with Me.Recordset (Me being the Access form). The recordset is probably related to the Microsoft DAO Library, which is referenced. Here are the current references: ![enter image description here](https://i.stack.imgur.com/ECLxG.png) The application is running on a Windows 98 machine, and the Access .mdb allegedly ran fine before (noone remembers what other computer it was originally on or the configuration of it. The form itself just scrolls through records of data (which works fine), but when firing the above Calc_Confidence_Level() subroutine, it tosses an error on the recordset that I thought would be the same one that it was scrolling through. Does anyone know what's going wrong here? Even a push in the right direct to be able to debug this better would be great, as I don't exactly work with VBA/Access very often. Thanks! --- ## Update 1 I looked in "C:\Program Files\Common Files\microsoft shared\DAO\" and don't see a .dll at all, only a .tlb file. There should be a .dll in there, right? ![enter image description here](https://i.stack.imgur.com/CWOwv.png)
"ActiveX component can't create object" in Access 2000 VBA app
CC BY-SA 3.0
null
2011-04-28T14:33:56.497
2011-04-28T21:57:23.737
2011-04-28T15:56:22.623
403,661
403,661
[ "ms-access", "vba", "recordset" ]
5,820,372
1
null
null
1
734
Here is my site: [http://smartpeopletalkfast.co.uk/pp/](http://smartpeopletalkfast.co.uk/pp/) The 'Shop by Category' menu on the left is made of images and uses PNGs. The PNGs look fine at normal zoom but when I zoom out in FF and also on my Ipad white lines appear where the transparency begins. I know PNGs can cause lots of headaches cross browser but this seems like a different issue. I havn't tested with other browsers. Thanks UPDATE - Does anyone know a link to a site where a PNG with transparency is shown over a background image or color? I want to see if this issue happens to other people in case its impossible to fix. UPDATE2- I think this only happens on ipad and mac, but not pc. UPDATE 3 - Here is a screen grab from firefox mac when Im zoomed out: ![enter image description here](https://i.stack.imgur.com/WemQn.jpg)
White outline on PNGs but only when zoomed out
CC BY-SA 3.0
null
2011-04-28T14:40:28.663
2011-04-30T11:34:54.203
2011-04-30T11:34:54.203
467,875
467,875
[ "png" ]
5,820,444
1
5,820,645
null
0
541
How do I combine multiple queries into one? For example: ``` //Successful Sales: SELECT username, count(*) as TotalSales, sum(point) as Points FROM sales where submit_date >= 1301612400 AND submit_date <= 1304204400 AND status = 1 group by username /Return Sales: SELECT username, count(*) as Return FROM sales where submit_date >= 1301612400 AND submit_date <= 1304204400 AND status = 2 group by username //Unsuccessful Sales: SELECT username, count(*) as UnsuccessfulSales FROM sales where submit_date >= 1301612400 AND submit_date <= 1304204400 AND (status = 3 OR status = 6) group by username ``` So the report look something like this: ![enter image description here](https://i.stack.imgur.com/LTMBX.jpg) Also How do I add percentage of return? Note: Fixed SQL queries I have tried doing this but couldn't get it to work? ``` SELECT username, TotalSales, Points, Return FROM ( SELECT username, count(*) as TotalSales, sum(point) as Points FROM sales where submit_date >= 1301612400 AND submit_date <= 1304204400 AND status = 1 group by username UNION SELECT count(*) as Return FROM sales where submit_date >= 1301612400 AND submit_date <= 1304204400 AND status = 4 group by username ) ``` .. ``` // Example Data Structure CREATE TABLE IF NOT EXISTS `sales2` ( `salesid` int(11) NOT NULL AUTO_INCREMENT, `username` varchar(50) NOT NULL, `point` int(11) NOT NULL, `status` int(11) NOT NULL, PRIMARY KEY (`salesid`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ; INSERT INTO `sales2` (`salesid`, `username`, `point`, `status`) VALUES (1, 'User1', 2, 1), (2, 'User1', 2, 1), (3, 'User2', 11, 1), (4, 'User2', 1, 2), (5, 'User3', 5, 6); ``` field status = 1, successful Sales and show point status 2 - return sales status 3/6 - unsuccessful sales:
Multiple queries into one (Report)?
CC BY-SA 3.0
null
2011-04-28T14:45:42.163
2013-02-06T23:33:46.500
2013-02-06T23:33:46.500
394,322
622,378
[ "mysql", "sql", "database" ]
5,820,578
1
5,848,565
null
18
10,652
How can I make [RichTextBox](http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx) with no Margin, Border, Padding etc. ? In another words to display content in the same way as [TextBlock](http://msdn.microsoft.com/en-us/library/system.windows.controls.textblock.aspx) does it ? I have tried this: ``` <RichTextBox Margin="0" Padding="0" Grid.Row="0" BorderThickness="0" > <FlowDocument > <Paragraph>LLL</Paragraph> </FlowDocument> </RichTextBox> <TextBlock>LLL</TextBlock> ``` But the result produces is still not what I want: ![enter image description here](https://i.stack.imgur.com/oKGJ6.png) There is still some space before document content (and also maybe after, on the top or bottom of the document...). How can I remove it ? --- If you are interested why I need this: I trying to make [H.B.'s answer](https://stackoverflow.com/questions/5796457/create-guitar-chords-editor-in-wpf-from-richtextbox/5797833#5797833) to my question [Create guitar chords editor in WPF](https://stackoverflow.com/questions/5796457/create-guitar-chords-editor-in-wpf-from-richtextbox) to work with [kerning](http://en.wikipedia.org/wiki/Kerning) and I don't want to have unnatural space between characters. --- ## Edit So it is not `ControlTemplate` at least not only that because following code will produce exactly the same result (as the one on the picture above): ``` <RichTextBox Margin="0" Padding="0" Grid.Row="0" BorderThickness="0"> <RichTextBox.Template> <ControlTemplate> <ScrollViewer Padding="0" Margin="0" x:Name="PART_ContentHost"/> </ControlTemplate> </RichTextBox.Template> <FlowDocument PagePadding="0"> <Paragraph Padding="0" Margin="0" >LLL</Paragraph> </FlowDocument> </RichTextBox> ``` And I thought this will be question easy to answer... when I have template set and I set `PagePadding="0"` on `FlowDocument` in the VisualStudio designer - . In the demo it is wrong again... And when I close the demo it is wrong again in the designer. This is a small bug of VS or is it actually set to the right layout for a while but then something changes value of `PagePadding` back to some wrong value ? --- ## Edit#2 Daniel Rose's edited answer is also not working for me. This is XAML: ``` <FlowDocument PagePadding="{Binding PagePadding}"> <Paragraph x:Name="paragraph" Padding="0" TextIndent="0" Margin="0,0,0,0" >hello</Paragraph> </FlowDocument> ``` And this is in code: ``` public static DependencyProperty PagePaddingProperty = DependencyProperty.Register("PagePadding", typeof(Thickness), typeof(EditableTextBlock), new PropertyMetadata(new Thickness(0))); public Thickness PagePadding { get { return (Thickness)GetValue(PagePaddingProperty); } set { SetValue(PagePaddingProperty, value); } } ``` . Space remains. --- ## Edit#3 After adding Two-Way binding as Daniel Rose suggested in his las edit it works. Still I don't really think it is very clear (to have dependency property because I need to keep `PagePadding` at 0 value). If somebody has better solution please share it. Obviously "changing `PagePadding`" of `FlowDocument` to `0,5` is a bug. If somebody has MSDN account it would be nice if they reported this bug.
WPF: How to make RichTextBox look like TextBlock?
CC BY-SA 3.0
0
2011-04-28T14:53:12.387
2021-03-12T18:54:30.550
2017-05-23T10:30:21.840
-1
311,865
[ "c#", ".net", "wpf", "richtextbox", "padding" ]
5,820,736
1
null
null
0
700
I am trying to access an object with form data sent to my controller. However, when I try to access objects I get values of null or 0. I used two methods, the first by serializing and the second by storing names and values in one object. (the code below sends/posts serialized) Here is my JS... ``` $("#createUser").click(function() { //store input values var inputs = $('#newUserForm :input'); var input = $('#newUserForm :input').serializeArray(); console.log(input); //if I want just the values in one object var values = {}; $(inputs).each(function() { values[this.name] = $(this).val(); }); console.log(values); if(LiveValidation.massValidate( validObj )){ $.post('./adminPanel/createUser', function(input){ alert('Load was performed.'); //test confirmation box $("#msgbox").html("Grrrrreat"); //drop down confirmation $("#msgbox").slideDown(); }); } else { //test fail box $("#failbox").html("Fail"); $("#failbox").slideDown(); } }); ``` In the controller side I try to access data the following way... ``` $this->input->post("firstName") ``` where firstName is the name of the field. Below is an image of the objects passed. Top being serialized array and the bottom a single object with all the names and values of form... ![objects created](https://i.stack.imgur.com/SGHdZ.jpg)
How to access object data posted by ajax in codeigniter
CC BY-SA 4.0
null
2011-04-28T15:04:40.823
2019-11-20T14:35:19.710
2019-11-20T14:35:19.710
1,033,581
448,967
[ "ajax", "codeigniter" ]
5,820,757
1
5,820,862
null
0
4,607
I'm developing an application in Eclipse and WindowBuilder. I tried to add a look and feel to GUI application. I used `Synthetica BlueMoon Look and Feel` . I added the Synthetica.jar to the class path and I added this code to the main: ``` import de.javasoft.plaf.synthetica.SyntheticaBlueMoonLookAndFeel; try { UIManager.setLookAndFeel(new SyntheticaBlueMoonLookAndFeel()); } catch (Exception e) { e.printStackTrace(); } ``` So I got this error message after the import `The type de.javasoft.plaf.synthetica.SyntheticaLookAndFeel cannot be resolved. It is indirectly referenced from required .class files` This is a screenshot from Eclipse. ![enter image description here](https://i.stack.imgur.com/4bLRI.png)
LookAndFeel Java Synthetica in Eclipse
CC BY-SA 3.0
null
2011-04-28T15:06:19.213
2015-12-30T15:17:16.653
2012-03-26T17:56:13.953
604,156
604,156
[ "java", "eclipse", "jar", "look-and-feel" ]
5,820,802
1
null
null
1
106
I'm creating an upload webpage. I set the controler's opacity=0 and set it's position to be abosolute and on top of an image. So that users won't see the ugly controler, but click the controler when they click the image. Everything works fine, however, when and only when the upload succeeds message pop out, the ugly controler shows.And when you click OK, the controler dispears with the pop out message. What more weird is, it doesn't show every time. But it does shows some time like once every two counts. Any idea? My code: ``` $(document).ready(function() { var left = $('#browseButton').offset().left; var top = $('#browseButton').offset().top; $("[id$='File1']").css('left', left); $("[id$='File1']").css('top', top); $("[id$='File1']").css('position', 'absolute'); $("[id$='File1']").css('z-index', '999'); }); <div align="center">Please choose attachment to upload <input id="Text1" type="text" style="width: 400px" /><img src="../images/browse.jpg" id="browseButton" style="cursor:pointer;" width="24px" height="24px"/>&nbsp;&nbsp; <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/upload-eng.gif" onclick="ImageButton1_Click" /> <input type=file id="File1" name=File1 runat="server" onchange="Text1.value=this.value" style="filter:alpha(opacity=0);width:24px;height:24px;" /> ``` ![enter image description here](https://i.stack.imgur.com/213Kx.jpg)
Why is the upload file controller not hidden?
CC BY-SA 3.0
0
2011-04-28T15:09:12.330
2011-05-20T20:01:58.473
2011-04-28T15:14:23.253
117,658
695,101
[ "javascript", "jquery", "upload" ]
5,820,834
1
5,820,914
null
1
1,471
i drew this layout scheme, but now i need to convert for a "`mysql` layout". So the `generalization` must use two `junction tables`, correct? (one for student and other for worker) An about the `multiplicity`, users can be workers or students, but one user only can be one worker and one worker only can be an user? this does not make much sense...? basically, how i can convert this `generalization` for something that can be executable for `mysql` code. thanks ![enter image description here](https://i.stack.imgur.com/E48pb.jpg)
convert generalization to mysql scheme
CC BY-SA 3.0
0
2011-04-28T15:10:56.790
2011-04-28T15:20:48.353
null
null
455,318
[ "mysql", "database", "database-design", "uml" ]
5,820,993
1
5,821,430
null
5
3,834
I have a page with an HTML table. When I use print preview in IE8, the table borders do not print starting on the 2nd page. So this is one and the same table, but it has a page break, and on the 2nd page there are no borders. ![enter image description here](https://i.stack.imgur.com/7wYa0.png) ![enter image description here](https://i.stack.imgur.com/QoBXI.png) It seems to me that this ought to be a bug in IE that affects how the style sheets are applied across page breaks when is used. I will have to get to the bottom of this so that I can find a workaround. In the meantime, if somebody has seen this and know how to address it, please let me know.
IE8 Bug with @media print? Table border disappears on pages greater than 1
CC BY-SA 3.0
0
2011-04-28T15:21:27.590
2011-06-08T16:27:19.390
null
null
58,880
[ "css", "printing", "internet-explorer-8", "media" ]
5,821,435
1
5,825,017
null
0
629
I have 3 computers. I have installed windows server + Active Directory on one pc. There are two other PCs registered with active directory. Those two PCs have installed SQL server(express) 2008 and Visual Studio 2010 separately. Here is my network. :) ![enter image description here](https://i.stack.imgur.com/oZFU0.jpg) Now I want to communicate with SQL server to access db through my development machine. Do I have to install SQL in that machine too ? How ever I need to use PC1 as my SQL server machine. How do I connect to SQL db located in PC1 from PC2 ?? Thank You!!
SQL Server 2008 (express edition) Configuration - with Active directory
CC BY-SA 3.0
null
2011-04-28T15:51:58.730
2011-04-28T21:05:27.997
null
null
441,628
[ "visual-studio-2010", "sql-server-2008", "networking", "configuration", "active-directory" ]
5,821,545
1
5,821,704
null
137
217,071
Could someone please explain to me the idea of in the build process? I have the workspace directory where I check out the code to compile and run my ant scripts etc. At the end, in my case, I get a jar file that's ready to install. Is that considered to be the artifact? Where should I tell my build script to put the jar file? In the workspace directory? My jar file gets a unique filename depending on variables like `BUILD_ID` and such, how can I tell Jenkins which jar file to pick? EDIT: Okay, so i tried doing something like this: ![enter image description here](https://i.stack.imgur.com/rPNno.png) The path does not exist yet in my workspace, because the build script is supposed to create it, and of course, the `.jar` and `.properties` files are not there because they haven't been generated yet. Why does it give me an error then? Seems like I'm missing something. Also, does Jenkins delete the artifacts after each build (not the archived artifacts, I know I can tell it to delete those)? Otherwise it will clog the hard drive pretty quickly.
Archive the artifacts in Jenkins
CC BY-SA 3.0
0
2011-04-28T15:59:59.623
2018-10-23T08:54:03.207
2017-11-20T07:11:10.490
599,912
599,912
[ "continuous-integration", "hudson", "archive", "jenkins", "artifacts" ]
5,821,724
1
5,821,783
null
1
4,448
I would like to change the color of a cell in a JTable. I wrote my own class that extends DefaultTableCellRenderer. However, my class has really inconsitent behavior. All it does is if a entry appears twice in a column, it marks it red. This is the result I get: ![enter image description here](https://i.stack.imgur.com/3ACs9.png) Notice that in this class I am also setting the font for a particular column. That works fine. I am wondering why I get this behavior when trying to simply set the color. Here is my class: ``` /* * To change this template, choose Tools | Templates * and open the template in the editor. */ package inter2; import java.awt.Color; import java.awt.Component; import java.awt.Font; import java.util.List; import javax.swing.JTable; import javax.swing.table.DefaultTableCellRenderer; /** * Used to display different fonts for different cells in the table */ public class CustomCellRenderer extends DefaultTableCellRenderer { private final int TRANSLATION_COL = 1; private final int VARIABLE_COL = 2; public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { Component cell = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); //set it so it can display unicode characters if (column == TRANSLATION_COL) { cell.setFont(new Font("MS Mincho",Font.PLAIN, 12)); } //marks a cell red if it is a duplicate variable name if(column == VARIABLE_COL) { MyTable theTable = (MyTable)table; String cellValue = theTable.getValueforCell(row, column); boolean dup = false; String[] columnData = theTable.getColumnData(column); //check if this is already in the list for(int i =0; i < columnData.length; i++) { String currTableValue = columnData[i]; if(currTableValue.equals(cellValue) && i != row) { dup = true; break; } } //we found a dup if(dup == true) { cell.setBackground(Color.red); } } return cell; } } ``` ````
Changing color of cell in JTable
CC BY-SA 3.0
0
2011-04-28T16:13:47.987
2015-09-25T08:24:26.850
null
null
663,321
[ "java", "swing", "jtable" ]
5,822,061
1
null
null
5
20,651
I am writing a VBA function to import data from one table to another in Access. The table I'm importing into has more strict data constraints (i.e. types, size etc.), so I'm expecting a lot of errors. Rather than sift through every VBA error that comes up, I want my recordset loop to skip the entire current record and make a note of it in a separate table whenever it runs into an error. So every other line I've inserted `On Error GoTo RecordError`. But for some reason it's not handling every error. My code just breaks and tells me what the error is. I have the "Break on Unhandled Exceptions" option checked already. Here's a screenshot that should explain it. ![Even by itself, this screenshot seems to make no sense to me.](https://i.stack.imgur.com/Jqjp6.png) Why would it be breaking on the line immediately following an Error handler?
On Error GoTo not working; Code breaks
CC BY-SA 3.0
0
2011-04-28T16:41:53.400
2015-02-15T10:02:47.077
2011-04-28T17:08:13.320
13,295
95,209
[ "ms-access", "error-handling", "vba" ]
5,822,080
1
null
null
0
689
I'm trying to write a piece of software to grab strings and pack them in and ordered layout, like in the image below ![enter image description here](https://i.stack.imgur.com/Bh51T.jpg) I think that to achieve that result the first step I'd take would be being able to calculate the size of a single string in the canvas in order to modify the font-size to fit the desired width. so, if any1's got a solution to some built-in function, or a way to perform it so that I can code it myself that would be nice (very nice). thanks in advance k
html5 text manipulation
CC BY-SA 3.0
null
2011-04-28T16:43:30.887
2011-04-28T17:22:16.450
null
null
596,983
[ "javascript", "html", "text", "fonts", "canvas" ]
5,822,420
1
5,822,589
null
0
465
The website at [http://belbelila.com](http://belbelila.com) is a simple wordpress blog. The website displays fine on FireFox but in IE 8 or 9 it is cut after the first post and I have no idea why. Here are screenshots of the difference: Firefox: ![enter image description here](https://i.stack.imgur.com/dVvGJ.jpg) IE8: ![enter image description here](https://i.stack.imgur.com/yIJrd.jpg) Can anyone give me a hint - what is causing this ?
IE fails to display part of Wordpress website
CC BY-SA 3.0
null
2011-04-28T17:10:25.360
2011-04-28T17:35:55.897
2011-04-28T17:35:55.897
405,015
259,989
[ "html", "css", "internet-explorer", "wordpress", "wordpress-theming" ]
5,822,583
1
5,871,868
null
6
1,062
I have a class that has many child collections, which are all lazy loaded using Lazy < T >. When debugging is it possible to have those child collections display even if they are not loaded? Or to force evaluation when debugging? Here is a screenshot of the quick watch on one of the child collections. The message the debugger displays is "The function evaluation requires all threads to run.", which makes sense to me, I just want these child collections to be more debugger friendly. ![Screenshot](https://i.stack.imgur.com/XxgwB.jpg)
Lazy<T> evaluation within debugger display. "The function evaluation requires all threads to run."
CC BY-SA 3.0
0
2011-04-28T17:25:02.790
2011-05-03T15:27:09.503
null
null
171,485
[ ".net", "c#-4.0" ]
5,822,675
1
5,822,836
null
2
6,419
I would like to implement a click listener for the CheckBoxes of a ListView that uses a custom adapter. Like this: ![enter image description here](https://i.stack.imgur.com/wtur8.png) I know about the existence of the choiceMode, but I would like to implement myself. I'm trying to apply good practices. This is how my adapter looks like: ``` public class TaskListAdapter extends ArrayAdapter<ListTask> { private ArrayList<ListTask> mItems; private ArrayList<Boolean> mChecked; private LayoutInflater mInflater; public TaskListAdapter(Context context, int textViewResourceId, ArrayList<ListTask> items) { super(context, textViewResourceId, items); this.mItems = items; // Cache the LayoutInflate to avoid asking for a new one each time mInflater = LayoutInflater.from(context); // Initialize all checkboxes with false value mChecked = new ArrayList<Boolean>(); for (int i = 0; i < this.getCount(); i++) { mChecked.add(i, false); } } @Override public View getView(final int position, View convertView, ViewGroup parent) { final ViewHolder holder; if (convertView == null) { convertView = mInflater.inflate(R.layout.list_row, null); holder = new ViewHolder(); holder.checkbox = (CheckBox) convertView.findViewById(R.id.mycheckbox); holder.text = (TextView) convertView.findViewById(R.id.mytext); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } MyList mylist = mItems.get(position); holder.text.setText(mylist.getMyText()); // Create a listener for the CheckBox holder.checkbox.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { if (holder.checkbox.isChecked()) { mChecked.set(position, true); } else { mChecked.set(position, false); } } }); holder.checkbox.setChecked(mChecked.get(position)); return convertView; } static class ViewHolder { CheckBox checkbox; TextView text; } } ``` When I run my app, I get this error: > java.lang.IndexOutOfBoundsException: Invalid location 0, size is 0 That errors is thrown by the line ``` holder.checkbox.setChecked(mChecked.get(position)); ``` that is just before the return statement. If I comment it and re-run the app, it shows the list, but when I click on a checkbox it throws also a IndexOutOfBoundsException for this line: ``` mChecked.set(position, true); ``` that is inside the "if" statement that checks if the checkbox is checked. What am I doing wrong?
ListView with CheckBoxes and a click listener
CC BY-SA 3.0
0
2011-04-28T17:32:01.480
2011-04-28T19:33:36.473
null
null
267,705
[ "android" ]
5,822,808
1
5,823,947
null
0
362
I have been attempting to implement the JQuery Hover Implementation for a page that now uses JavaScript. mousing over the Thumb Image should change the Lower Image accordingly, and when you mouse out the background-color should return to the background color #FFFFFF. I think that Im still missing something in the JavaScript and if someone sees the problem, I would really greatly appreciate it. Here is my JSFiddle: [http://jsfiddle.net/NinjaSk8ter/P8baa/](http://jsfiddle.net/NinjaSk8ter/P8baa/) Here is the link to the site which illustrates the behavior: [http://www.odontex.net/Ingles/mexico/aboutus-mexicoci.html](http://www.odontex.net/Ingles/mexico/aboutus-mexicoci.html) ![enter image description here](https://i.stack.imgur.com/7ZJM4.jpg)
JQuery Hover Image Swap Problem
CC BY-SA 3.0
null
2011-04-28T17:41:58.607
2011-04-28T19:30:54.243
2011-04-28T19:19:53.640
598,931
598,931
[ "jquery" ]
5,822,886
1
5,961,372
null
20
17,071
![Class does not support Automation or does not support expected interface](https://i.stack.imgur.com/fbjM6.png) I compiled some VB6 code on my Win7 x64 machine and the result .exe will not run correctly on any other machine. VB6 code is just a new template .exe file with one button, a reference to "Microsoft ActiveX Data Objects 2.6 Library" and the following code in the button press event: ``` Dim db Set db = New ADODB.Connection ``` It runs correctly on my machine, but no others (even other Win7 x64 machines) (Update: I found TWO other users where it runs and one of them is Jeff Atwood!, but most machines have the same problem) I checked the references screen on both machines to see if a reference failed (it wouldn't compile then though and it compiles fine). Everything looks legit. On the 64 bit machines, the references go into SysWow64 instead of system32. I've even compiled this successfully on a Vista 64 bit machine and had it run correctly. It's only the compile on the Windows 7 and then running on any other machine where the error happens. Here are the results of running CompChecker on my box: ![comp checker results on box](https://i.stack.imgur.com/RtbNg.png) Registry info: ADODB.Connection has GUID HKEY_CLASSES_ROOT\CLSID{00000514-0000-0010-8000-00AA006D2EA4} InprocServer32 is %CommonProgramFiles%\System\ado\msado15.dll
If I compile a VB6 app on win7, ADODB.Connection errors with "Class does not support Automation or does not support expected interface"
CC BY-SA 3.0
0
2011-04-28T17:48:12.757
2013-03-06T09:56:41.297
2012-01-05T18:50:55.403
3,043
245
[ "vb.net", "automation", "64-bit" ]
5,823,055
1
5,823,074
null
2
450
I'm trying to create a tooltip like the one that youtube shows you when you hover over their "like" button, for example. ![enter image description here](https://i.stack.imgur.com/mYhv9.png) How can I achieve this in a simple and browser compatible way?
How to create a simple and browser independent tooltip?
CC BY-SA 3.0
0
2011-04-28T18:03:22.940
2011-04-28T18:46:53.580
2011-04-28T18:46:53.580
224,734
711,096
[ "jquery", "html", "css", "youtube" ]
5,823,300
1
null
null
0
794
Hey guys as you know there facebook like box button this code... ``` <iframe src="http://www.facebook.com/plugins/like.php?href=www.mercedes.com&amp;send=false&amp;layout=standard&amp;width=300&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font=verdana&amp;height=35" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:300px; height:35px;" allowTransparency="true"></iframe> ``` ![enter image description here](https://i.stack.imgur.com/qxJDd.png) but When I joined and clicked the like button from iphone or iPad, Because of I m not online facebook opening login box...But different page I want to open login box on the same page and popup frame.... I hope you understand me.. I mean Look at the picture.. When clicked the like.. I want to black border page open popup frame..( login box ) not different page on the same page
facebook like problem Open popup frame facebook login
CC BY-SA 3.0
null
2011-04-28T18:29:24.817
2011-04-28T18:41:24.343
null
null
701,855
[ "javascript" ]
5,823,345
1
5,823,542
null
3
4,682
I'm looking for a way to combine affine transforms in such a way so that the effect is equivalent to using each transform to manipulate a shape in succession. The problem is that if I simply concatenate the transforms, then each successive transform's effect is interpreted in the existing transform's co-ordinate space. For example, consider a square around the origin (-50,-50, 100,100). I want to rotate it, and then translate it down 100px. If I take a transform and rotate and then translate, the translation gets interpreted in the rotated coordinates. Instead, if I transform the shape itself to rotate it, and then transform that shape again to translate it, both translations are interpreted in the "normal" un-translated plane, and it gives me what I want. The problem is that for what I'm doing many transforms may take place, each of which needs to be interpreted in the normal coordinate plane, but I don't want to store a stack of transforms, nor can I simply keep manipulating a shape, because I need to at any time be able to create the final transformed shape from the original starting shape. ![Example: normal concatenation on the left, successive transforms on the right](https://i.stack.imgur.com/FRGIa.png) I'm aware that for this simple example if I did the translate before the rotate I'd get the same result, but that's missing the point. I'm dealing with an arbitrary set of successive scale, translate, and rotate transforms, so simply putting them in a certain order doesn't cut it. I have an inkling that there should be a way to concatenate transforms in such a way that you modify the new transform before you concatenate it, correcting for the existing transform so that the effect is that the new transform appears to have been applied as if it were referencing the un-transformed coordinate plane. For example, if you translate by (70.7, 70.7) in the above example instead of (0,100), the result becomes equivalent. I just can't seem to figure out what the math is to figure out in general how to alter the new transform so it works out correctly. Thanks for reading - hope this made sense. Heres the source of the example that created the screenshot: ``` public class TransformExample extends JPanel { @Override protected void paintComponent(Graphics _g) { super.paintComponent(_g); Graphics2D g = (Graphics2D) _g; g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); g.translate(150, 100); // translate so we can see method 1 clearly paintConcatenate(g); g.translate(200, 0); // translate again so we can see method 2 to the right of method 1 paintSuccessive(g); } private void paintConcatenate(Graphics2D g) { AffineTransform tx = new AffineTransform(); Shape shape = new Rectangle(-50, -50, 100, 100); // Draw the 3 steps, altering the transform each time draw(g, shape, tx, Color.GRAY); tx.rotate(Math.PI / 4); draw(g, shape, tx, Color.GREEN); tx.translate(70.7, 70.7); draw(g, shape, tx, Color.PINK); } private void paintSuccessive(Graphics2D g) { Shape shape = new Rectangle(-50, -50, 100, 100); // Draw the 3 steps, altering the shape each time with a new transform draw(g, shape, null, Color.GRAY); shape = AffineTransform.getRotateInstance(Math.PI / 4).createTransformedShape(shape); draw(g, shape, null, Color.GREEN); shape = AffineTransform.getTranslateInstance(0, 100).createTransformedShape(shape); draw(g, shape, null, Color.PINK); } private void draw(Graphics2D g, Shape shape, AffineTransform tx, Color color) { if (tx != null) { shape = tx.createTransformedShape(shape); } g.setColor(color); g.fill(shape); } public static void main(String[] args) { JFrame f = new JFrame("Transform Example"); f.setSize(500, 350); f.setContentPane(new TransformExample()); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); f.setVisible(true); } } ``` (I'm working with Java2D, although I don't think the language or 2d library is all that pertinent here.)
Method to combine multiple affine transforms as if each was specified in un-transformed space
CC BY-SA 3.0
null
2011-04-28T18:33:05.443
2011-09-12T16:28:48.450
null
null
106,431
[ "2d", "transform", "java-2d", "affinetransform" ]
5,823,469
1
null
null
8
2,345
I know similar issue has been answered at this link [Help me fix this C++ std::set comparator](https://stackoverflow.com/questions/1061152/help-me-fix-this-c-stdset-comparator) but unfortunately I am facing exactly same issue and I am unable to understand the reason behind it thus need some help to resolve it. I am using VS2010 and my release binary is running fine without any issue but the debug binary reports: ![enter image description here](https://i.stack.imgur.com/xjpty.png) My comparator looks like this: ``` struct PathComp { bool operator() (const wchar_t* path1, const wchar_t* path2) const { int c = wcscmp(path1, path2); if (c < 0 || c > 0) { return true; } return false; } }; ``` My set is declared like this: ``` set<wchar_t*,PathComp> pathSet; ``` Could somebody suggest me why my debug binary is failing at this assertion? Is it because I am using wcscmp() function to compare the wide character string getting stored in my set? Thanks in advance!!!
Getting "Debug Assertion Failed!" for set comparator
CC BY-SA 3.0
null
2011-04-28T18:44:48.717
2011-05-06T07:18:55.100
2017-05-23T11:53:13.470
-1
416,369
[ "c++", "c++-standard-library" ]
5,823,806
1
5,824,300
null
1
241
I just installed .net micro framework SDK, but when I make a new project and run it ( even without any code of my own ), VS crashes. ![enter image description here](https://i.stack.imgur.com/tajRr.jpg)
VS2010 crashes with .NET Micro framework projects
CC BY-SA 3.0
0
2011-04-28T19:18:32.163
2012-03-07T03:03:54.143
2012-03-07T03:03:54.143
140,328
651,418
[ ".net", "visual-studio-2010", ".net-micro-framework" ]
5,823,854
1
5,824,141
null
22
12,908
I'm trying to figure out how to sample all of the pixels in an image and generate a palette of colors from it, something like [this](http://www.degraeve.com/color-palette/) or [this](http://bighugelabs.com/colors.php). I have no idea where to even begin. Can anyone point me in the right direction? __EDIT: __ This is what I've ended up with so far: I used this [Pixelate](http://notes.ericwillis.com/2009/11/pixelate-an-image-with-csharp/) function to get large block sections like joe_coolish suggested. It's working perfectly and giving me a pretty good sample of colors to work with (this is from the windows sample jelly fish picture): ![](https://i.imgur.com/HcdmH.png) Now, if someone could help me get the 5 most distinct colors (darkest blue, lightest blue, orange, gray and peach(?)), I would love you forever. I really don't understand how to or colors together. I also can't figure out how to tell if a color is similar programatically, there are some many numbers and variables in you explanations that I get lost trying to figure out what's doing what to whom.
How can I generate a palette of prominent colors from an image?
CC BY-SA 3.0
0
2011-04-28T19:22:39.020
2018-10-08T13:09:48.770
2016-11-21T01:48:02.573
815,724
53,007
[ "c#", "image-processing", "colors", "color-palette" ]
5,824,101
1
5,824,161
null
0
1,599
I have requirment in which i am showing Master- Detail information into DataGridView. I have add the foriegn key relationship to the Dataset. But Detail Grid is not flitering it self based on the selection of master. I dont know what I am missing here! Just to verify if the relationship exist , I have checked them using DataGrid. I shows up there. ![enter image description here](https://i.stack.imgur.com/JXUIc.jpg) ``` namespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } DataSet CreateTableAndFill() { DataSet ds = new DataSet(); DataTable Header = ds.Tables.Add("Header"); DataTable Line = ds.Tables.Add("Line"); DataColumn dataColumn = Header.Columns.Add("ID", typeof(int)); dataColumn.AutoIncrement = true; dataColumn.AutoIncrementSeed = 1; Header.Columns.Add("Name", typeof(string)); Line.Columns.Add("ID", typeof(int)); Line.Columns.Add("Phone", typeof(string)); DataRelation dataRelation = new DataRelation("ID_FK", Header.Columns["ID"], Line.Columns["ID"]); ds.Relations.Add(dataRelation); Header.Rows.Add(null, "Huzaiafa"); Header.Rows.Add(null, "Arthur"); Line.Rows.Add(1, "4253068516"); Line.Rows.Add(1, "4252746864"); Line.Rows.Add(2, "5654034"); Line.Rows.Add(2, "12563"); return ds; } private void button1_Click(object sender, EventArgs e) { DataSet ds = CreateTableAndFill(); dataGridView1.DataSource = ds; dataGridView2.DataSource = ds; dataGridView1.DataMember = "Header"; dataGridView2.DataMember = "Line"; } } } ``` Even after applying the walk through from msdn it does not work ! Same result. ``` private void button1_Click(object sender, EventArgs e) { DataSet ds = CreateTableAndFill(); BindingSource masterBindingSource = new BindingSource(); BindingSource detailsBindingSource = new BindingSource(); masterBindingSource.DataSource = ds; detailsBindingSource.DataSource = masterBindingSource.DataSource; masterBindingSource.DataMember = "Header"; detailsBindingSource.DataMember = "Line"; dataGridView1.DataSource = masterBindingSource; dataGridView2.DataSource = detailsBindingSource; } ```
DataGridView not flitering detail record and ignoring foreign key relationship
CC BY-SA 3.0
null
2011-04-28T19:46:58.207
2011-04-28T20:31:26.603
2011-04-28T20:05:23.727
389,288
389,288
[ "c#", ".net", "ado.net", "datagridview", "datatable" ]
5,824,275
1
5,824,385
null
1
335
i am using this [tutorial](http://p-xr.com/android-tutorial-how-to-parse-read-json-data-into-a-android-listview/) please guide me how can i customized it for my mysql table which is like this ![enter image description here](https://i.stack.imgur.com/3ufhY.png) i am unable to understand how to get this sort of out from my table . ``` {"earthquakes": [ { "eqid": "c0001xgp", "magnitude": 8.8, "lng": 142.369, "src": "us", "datetime": "2011-03-11 04:46:23", "depth": 24.4, "lat": 38.322 }, { "eqid": "2007hear", "magnitude": 8.4, "lng": 101.3815, "src": "us", "datetime": "2007-09-12 09:10:26", "depth": 30, "lat": -4.5172 } <--more --> ]} ``` i am using php . Thanks
Json output for android
CC BY-SA 3.0
0
2011-04-28T20:02:27.990
2011-04-28T20:13:21.330
2011-04-28T20:10:16.613
667,340
667,340
[ "php", "android" ]
5,824,325
1
null
null
4
8,763
I'm searching a way to add a button into the accessory view of a keyboard, the one that comes up when touching an input field into a , without using some private functions or some questionable tricks. ![enter image description here](https://i.stack.imgur.com/qJ4Bq.png) Do you know how I may do this ?
iPhone - Adding a button to keyboard existing accessory view (keyboard from UIWebView)
CC BY-SA 3.0
null
2011-04-28T20:06:23.347
2014-11-24T11:44:30.887
2011-11-13T21:49:08.957
499,417
499,417
[ "iphone", "button", "uiwebview", "keyboard", "accessoryview" ]
5,824,374
1
5,825,072
null
0
186
I am creating a website project. But my visual studio 2008 suddenly messed up everything. I don't know what I did. In fact, I didn't change anything. But each page seems messed up. The interface just like be destroyed. It shows everything, but everything is not in a correct position, correct size. Does anyone happened to know how to resolve this? I'm sorry, I really don't know how to discribe what I have faced. It's not a code problem, but it does have something to do with code. Any help is appreciated. OMG! Two pics show as follows. See the second screen shot? All item concentred to the left connor, and become very small. What I found is, all child pages effected by this issue, but for those pages without using masterpage, no effect at all. ![enter image description here](https://i.stack.imgur.com/jJZle.jpg) ![enter image description here](https://i.stack.imgur.com/gZZVp.jpg)
visual studio 2008 suddenly messed up everything?
CC BY-SA 3.0
null
2011-04-28T20:11:11.120
2011-04-28T21:12:12.463
2011-04-28T21:12:12.463
695,101
695,101
[ "visual-studio-2008" ]
5,825,341
1
5,825,547
null
2
345
I'm taking over some code for a project and I've seen a bunch of copied code in multiple classes. The owner is very weary about refactoring this code but I came up with an idea that sounded good to him. Multiple "Client" classes that do NOT have the exact same interface but fairly close: ``` class Client1 { public static string FunctionA(a); public static string FunctionB(a, b, c); public static string FunctionC(a, b); } class Client2 { public static string FunctionA(a); public static string FunctionB(a, b, c); public static string FunctionC(a, b); } class Client3 { public static string FunctionA(a); public static string FunctionC(a, b); public static string FunctionD(); } ... etc ``` Lets say that `FunctionA` is function that is EXACTLY the same in each class. The owner somehow thinks that this function needs to be in each class because "it could be different for another client in the future" (fyi: FunctionA converts standard time to military time... so I highly doubt this). Each of his clients has a special code (i.e. "abc" or "xyz" in the `web.config` file so when the client's code is accessed, it gets the correct behavior using code similar to this: ``` public static string FunctionA(string a) { switch(getClientCode()) { case "abc": return Client1.FunctionA(a); case "xyz": return Client2.FunctionA(a); case "def": return Client3.FunctionA(a); default: throw new Exception("code not supported"); } } ``` I've actually fought with my client (who owns this code) in some fairly heated discussions about the decisions he has made with this project My client believes this way of doing things is useful when, say, I want to implement a new Client, I can just run the application and go through some steps until I find and "fix" these thrown exceptions. This is why the owner likes how the code is set up this way. However, about half the functions in each Client class are the same for each client OR they are the same for about 80% of the clients. I asked him why he just didn't have an abstract class and the reason being was that not every derived class needs to implement any of the base classes functions. Also, all of the public functions are static (and there are no member variables) so it doesn't make sense to instantiate objects. Using the client classes from above, I would like to implement something like this: ``` class Client1 { // FunctionA is the same for each class //public static string FunctionA(a); public static string FunctionB(string a, string b, string c); // Client1 and Client3 share the same code. //public static string FunctionC(a, b); } class Client2 { // FunctionA is the same for each class //public static string FunctionA(a); public static string FunctionB(string a, string b, string c); public static string FunctionC(string a, string b); } class Client3 { // FunctionA is the same for each class //public static string FunctionA(a); // Client1 and Client3 share the same code. //public static string FunctionC(a, b); public static string FunctionD(); } ... etc. class DefaultClient { public static string FunctionA(string a); public static string FunctionB(string a, string b, string c); public static string FunctionC(string a, string b); } class ProxyUtility { private static string getClientCode(); public static string FunctionA(string a) { switch (getClientCode()) { case "abc": case "def": case "xyz": return DefaultClient.FunctionA(a); default: throw new Exception("code not supported"); } } public static string FunctionB(string a, string b, string c) { switch (getClientCode()) { case "abc": case "xyz": return DefaultClient.FunctionB(a, b, c); case "def": return string.Empty; // or throw an exception since they don't support this default: throw new Exception("code not supported"); } } public static string FunctionC(string a, string b) { switch (getClientCode()) { case "abc": case "def": return DefaultClient.FunctionC(a, b); case "xyz": return Client2.FunctionC(a, b); default: throw new Exception("code not supported"); } } public static string FunctionD() { switch (getClientCode()) { case "abc": case "xyz": return string.Empty; // or throw an exception since they don't support this function. case "def": return Client3.FunctionD(); default: throw new Exception("code not supported"); } } } ``` Here's a flow chart as well to get an understand of how this works: ![Some type of Proxy Pattern?](https://i.stack.imgur.com/I1k5E.png)
Is this a design pattern? If so, what is it?
CC BY-SA 3.0
0
2011-04-28T21:36:44.257
2011-04-29T11:27:41.913
2011-04-28T22:23:10.893
43,792
43,792
[ "c#", "design-patterns" ]
5,825,429
1
5,825,504
null
3
394
Hello trusty StackOverflow users, I am creating a sample webpage and was wondering how to elongate a rotated header that extends off the page in css3. I can provide more code if necessary. I would show a picture of what i am looking for but haven't accumulated enough rep (Just got enough rep to show a picture)... Thanks for any help in advance! Here is what i want: ![enter image description here](https://i.stack.imgur.com/VESkh.png) 'h4' is the header i'm trying to elongate and here is what i have it doing now: ``` h4 { color: #fbff00; background-color: #858585; -webkit-transform: rotate(315deg); -moz-transform: rotate(315deg); float:left; text-align:center; -webkit-box-shadow: 0px 0px 10px #d1cfd1; -moz-box-shadow: 0px 0px 10px #d1cfd1; box-shadow: 0px 0px 10px #d1cfd1; } ``` -Nate
Rotated Header CSS3
CC BY-SA 3.0
0
2011-04-28T21:44:57.070
2011-04-28T21:53:33.573
null
null
683,143
[ "html", "css" ]
5,825,489
1
5,825,590
null
5
10,488
I have a problem with finding the current color under the cursor. My code: ``` import java.awt.Color; import java.awt.MouseInfo; import java.awt.Point; import java.awt.PointerInfo; import java.awt.Robot; public class Test { public static void main(String[] args) throws Exception { PointerInfo pointer; pointer = MouseInfo.getPointerInfo(); Point coord = pointer.getLocation(); Robot robot = new Robot(); robot.delay(2000); while(true) { coord = MouseInfo.getPointerInfo().getLocation(); Color color = robot.getPixelColor((int)coord.getX(), (int)coord.getX()); if(color.getGreen() == 255 && color.getBlue() == 255 && color.getRed() == 255) { System.out.println("WHITE FOUND"); } robot.delay(1000); } } } ``` When I run it, even when I hold my mouse on the gray area, I am getting “WHITE FOUND WHITE FOUND” message. What can be the problem? Can you guys test if it does not work for you also? Added Picture: I am holding my cursor on Eclipse gray area but getting “WHITE FOUND” message. ![enter image description here](https://i.stack.imgur.com/YtAg0.png)
Java get color of pixel LIVE
CC BY-SA 3.0
null
2011-04-28T21:50:49.040
2012-01-02T15:39:11.967
2012-01-02T15:39:11.967
4,714
625,189
[ "java", "colors", "mouse" ]
5,825,558
1
5,825,610
null
1
948
I have a Listview and a button like this ![enter image description here](https://i.stack.imgur.com/zeUeN.png) Below is the code I have used for deletion of Data from Listview ``` Private Sub btnDelete_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDelete.Click If lvNotesList.SelectedItems.Count > 0 Then Dim Result = MsgBox("Are sure you want to Delete the Selected Item ?", MessageBoxButtons.YesNo + vbQuestion) If Result = DialogResult.Yes Then Dim ID As String = lvNotesList.SelectedItems(0).SubItems(0).Text Try Dim sqlConnection As New SQLite.SQLiteConnection() Dim sqlCommand As New SQLiteCommand("", sqlConnection) Dim sqlPath As String = "Data Source=" & Application.StartupPath & "\Database\SimpleDB.db3" Dim sqlQuery As String = "DELETE FROM Notes WHERE NoteID = " & ID sqlConnection.ConnectionString = sqlPath sqlConnection.Open() sqlCommand.CommandText = sqlQuery sqlCommand.ExecuteNonQuery() sqlConnection.Close() MsgBox("Operation Successfull", vbInformation) Catch ex As Exception MsgBox("Error: Operation Unsuccessfull." & Chr(13) & "Sumamry:" & ex.Message, vbExclamation) End Try Else Exit Sub End If Else MsgBox("Select an Item First", vbExclamation) End If End Sub ``` For some Reason it produces an Error like this ![enter image description here](https://i.stack.imgur.com/A9j2p.png) How can I fix this ?
Unable to delete Listview item
CC BY-SA 3.0
0
2011-04-28T22:00:30.303
2011-04-28T22:16:51.170
null
null
722,000
[ "vb.net", "winforms" ]
5,825,803
1
null
null
1
102
i have a problem PHP/MySQL somebody help me to fix it plz iam using this code to show a number of letters from a field in my database ``` $news_whole= $row_news['smalltext']; echo substr($news_whole,0,600); ``` but sometimes the result ..at the end there is like a square ..i don't know what is it. how can i remove it!!!? ![enter image description here](https://i.stack.imgur.com/3XCKE.png)
show a specific number of letters from the database
CC BY-SA 3.0
null
2011-04-28T22:32:47.240
2011-04-30T04:02:23.433
2011-04-30T04:02:23.433
725,473
725,473
[ "php", "mysql", "database" ]
5,825,799
1
5,826,696
null
7
10,528
I implemented a bidirectional 1:1 relationship based on this answer: [Primary /Foreign Key in Entity Framework](https://stackoverflow.com/questions/5388077/primary-foreign-key-in-entity-framework/5388658#5388658) I define the bidirectional relation this way: ``` public class Student { public virtual int StudentId { get; set; } public virtual Anamnesis Anamnesis { get; set; } . . . } public class Anamnesis { [Key, ForeignKey("Student")] public int AnamnesisId { get; set; } public virtual Student Student { get; set; } . . . } ``` where, Student is the principal entity and Anamnesis it the entity that shares the PK. Now I'd like that the relationship created had a Delete Rule = CASCADE. Actually, the relationship that is being created has Delete Rule = NO ACTION as seen in the following picture: ![enter image description here](https://i.stack.imgur.com/Y9juR.jpg) If I manually delete this relation inside the Table Properties window and add other relation with Delete Rule = CASCADE, the code works as I expect allowing me to delete a Student and it's shared Anamnesis that has the same ID. So, here goes my question: Is there a way of using Data Annotation (not Fluent API) in my class so that I get a Relation with CASCADE delete rule? I'd prefer using Data Annotation but if it's not possible, I'd be happy with some Fluent API code that makes this work. I have tried the Fluent API code that is shown in this [post](http://weblogs.asp.net/manavi/archive/2011/04/14/associations-in-ef-4-1-code-first-part-3-shared-primary-key-associations.aspx). It doesn't work in my case where I have bidirectional properties.
Cascade Delete Rule in EF 4.1 Code First when using Shared Primary Key Association
CC BY-SA 3.0
0
2011-04-28T22:32:36.573
2015-07-23T15:00:19.890
2017-05-23T11:48:23.740
-1
114,029
[ "ef-code-first", "sql-server-ce", "entity-framework-4.1", "cascade", "cascading-deletes" ]
5,825,816
1
null
null
0
93
I'm trying to use an ActionBar library project in my app but I keep getting errors when trying to add the library reference. I do it as described on the Android Developers website ([here](http://developer.android.com/guide/developing/projects/projects-eclipse.html#ReferencingLibraryProject)) but it only copies the classes across to a folder called "actionbar_src". The error then comes when it tries to find the library's resources within the classes, which it didn't copy across. What am I doing wrong? Here's a screenshot: ![enter image description here](https://i.stack.imgur.com/8eCVj.png)
Issues with referencing Android library projects
CC BY-SA 3.0
null
2011-04-28T22:34:21.293
2014-09-10T21:05:25.890
2014-09-10T21:05:25.890
321,731
428,665
[ "android" ]
5,825,895
1
5,913,429
null
6
3,227
Given an binary mask with an object in Matlab. I am going to find the concavity point of the object boundary. The concavity point I mean here is the deepest concavity point with respect to the Euclidean distance to the convex hull chords K_1, K_2 ,and K_3 in the concavity regions B_1, B_2, B_3, respectively. The red dot indicates the concavity point I want to find, where in concavity region B_1 I draw three lines perpendicular to the chord K_1, the deepest concavity point is the middle one since it has the largest length. ![enter image description here](https://i.stack.imgur.com/BvrZk.jpg) Anyone have efficient way/code to do that? Thanks. Another figure below gives an example with the convex hull, where the red dot indicates the valid concavity point. ![enter image description here](https://i.stack.imgur.com/RXxgt.jpg)
Finding the concavness pixel/point in binary map using Matlab
CC BY-SA 3.0
0
2011-04-28T22:46:53.880
2011-05-06T15:15:52.187
2011-04-29T05:46:02.967
695,402
695,402
[ "matlab", "image-processing", "detection" ]
5,825,914
1
null
null
1
707
I am doing an image zoom and pan MODAL. All working fine, we use this for floor plans. What I would like is to add a print button ( same style ) to the viewer. See example: [http://test.dpetroff.ru/jquery.iviewer/test/](http://test.dpetroff.ru/jquery.iviewer/test/) Need it to appear next to the [ 200% ] button. Any suggestions ? The js is here: [http://test.dpetroff.ru/jquery.iviewer/jquery.iviewer.js](http://test.dpetroff.ru/jquery.iviewer/jquery.iviewer.js) My html code: ``` var $ = jQuery; $(document).ready(function(){ $("#viewer").iviewer( { src: "images/floorplan.gif", update_on_resize: false, zoom: 200, initCallback: function () { var object = this; $("#in").click(function(){ object.zoom_by(1);}); $("#out").click(function(){ object.zoom_by(-1);}); $("#fit").click(function(){ object.fit();}); $("#orig").click(function(){ object.set_zoom(100); }); $("#update").click(function(){ object.update_container_info();}); console.log(this.img_object.display_width); //works* console.log(object.img_object.display_width); //getting undefined.* }, onFinishLoad: function() { $("#viewer").data('viewer').setCoords(-500,-500); //this.setCoords(-0, -500); } // onMouseMove: function(object, coords) { }, // onStartDrag: function(object, coords) { return false; }, //this image will not be dragged // onDrag: function(object, coords) { } }); ``` --- OK It isn't 100% not sure why. Here is the HTML ``` <div class="wrapper"> <div id="viewer" class="viewer"></div> <div class="iviewer_zoom_print iviewer_common iviewer_button2"><a href="javascript:window.print()">PRINT</a></div> </div> ``` Here is the CSS: ``` .iviewer_zoom_print { left: 170px; font: 1em/28px "HelveticaNeue","Helvetica Neue",Helvetica,Arial,"Lucida Grande",sans-serif; color: #ec008c; background-color: #fff; text-align: center; text-decoration:none width: 60px; ``` Link css ``` .iviewer_zoom_print a:link { text-decoration:none !important;color:#ec008c !important;} ``` Here is preview. ![enter image description here](https://i.stack.imgur.com/TwOTs.png) Ok Issue I have, is this code the best way of accomplishing this ? How would I position the print button better. JS must be enabled because its a modal window, so non js print functionality isnt really a prerequisite. Also I need that on click of the print button it prints the entire image. At the moment it prints only that in view. Any help appreciated.
javascript PRINT functionality
CC BY-SA 3.0
0
2011-04-28T22:48:44.877
2011-12-16T03:06:39.177
2011-12-16T03:06:39.177
214,668
501,173
[ "jquery" ]
5,826,068
1
5,826,120
null
0
57
I am trying to upload two files to a webserver so my teacher can see it. I am using winsp since my filezila doesnt work. But for some reason it is telling me that i don't have access to that page. Can anyone tell me why is it doing that.Here is a picture of my screen. ![what my winsp looks like](https://i.stack.imgur.com/k3ffg.jpg) I am just not understanding why it is telling me that i don't have to access it.
Access error uploading file using winsp
CC BY-SA 3.0
null
2011-04-28T23:07:35.247
2011-04-28T23:17:41.747
2011-04-28T23:15:00.293
198,536
1,088,313
[ "permissions", "ftp" ]
5,826,555
1
5,826,864
null
0
518
Problem: How to get rid of the event drop down? When I comment it out in the view I get Model validation errors. It doesn't know which Event to associate it with. Even though I'd told it in the create action - as shown because it has selected the correct drop down option. ![enter image description here](https://i.stack.imgur.com/gLnZt.png) ``` public ActionResult Create(Guid idEvent) { ViewBag.EventName = uow.Events.Single(e => e.Id == idEvent).Name; RaceViewModel racesViewModel = new RaceViewModel(); SetupDropDownsStronglyTyped(racesViewModel); Race race = new Race(); racesViewModel.RaceInVM = race; Event _event = uow.Events.Single(e => e.Id == idEvent); racesViewModel.RaceInVM.EventU = _event; return View(racesViewModel); } ``` view ``` <div class="editor-field"> @Html.DropDownListFor(x => x.RaceInVM.EventUId, new SelectList(Model.ListOfEvents, "Id", "Name")) ``` post: ``` [HttpPost] public ActionResult Create(RaceViewModel raceViewModel, Guid idEvent) { if (!ModelState.IsValid) { SetupDropDownsStronglyTyped(raceViewModel); return View(raceViewModel); } uow.Add(raceViewModel.RaceInVM); uow.SaveChanges(); return RedirectToAction("Index"); } ```
How to get rid of DropDownListFor MVC3
CC BY-SA 3.0
null
2011-04-29T00:20:58.227
2011-04-29T01:17:38.220
2011-04-29T00:54:06.050
26,086
26,086
[ "asp.net-mvc-3" ]
5,826,592
1
5,826,914
null
36
74,339
When using matplotlib with a contour plot, I'm having trouble getting the colorbar to display as I want. I've read through numerous similar examples, but have still not been able to get what I want. In the image below, I want two things changed. I want the minimum value and maximum values to be display on the color bar (the max should be 2.0 and the min -0.1). These two values should be at the very edge of the colorbar. Also, I want the colorbar to display the value at every color transition. For example. in the plot below, between 2.1 and 1.8, there is another color transition where the value isn't displayed. I think I may need to use norm, but it hasn't worked for me so far. ![enter image description here](https://i.stack.imgur.com/MFxkL.png) Code: ``` import numpy as np import matplotlib.pyplot as plt xi = np.array([0., 0.5, 1.0]) yi = np.array([0., 0.5, 1.0]) zi = np.array([[0., 1.0, 2.0], [0., 1.0, 2.0], [-0.1, 1.0, 2.0]]) plt.contour(xi, yi, zi, 15, linewidths=0.5, colors='k') plt.contourf(xi, yi, zi, 15, cmap=plt.cm.jet) plt.colorbar() plt.show() ```
Python/Matplotlib - Colorbar Range and Display Values
CC BY-SA 4.0
0
2011-04-29T00:28:29.897
2023-01-14T21:25:42.747
2023-01-14T21:25:42.747
4,621,513
563,299
[ "python", "matplotlib", "contour", "colorbar" ]
5,826,606
1
5,833,586
null
4
2,265
All, I am writing a rather non conventional ray tracer to calculate heat transfer properties of various objects in a scene. In this ray tracer random rays are shot from the surface of my primitive objects into a scene to check for intersections. This particular algorithm requires each ray to be developed in primitive space then affine transformed by the source object into world space then subsequently affine transformed back into the primitive space of other objects in the scene to check for intersection. All is good until I do a anisotropic scale for example scaling a object by [2 2 1] (isotropic scales are fine). This leads me to believe I am not transforming the directional component of the ray correctly. Currently I transform the ray direction from primitive space to world space by multiplying the directional component by the transpose of the source objects inverse transformation matrix and then I transform the ray from world space to each primitive space by multiplying by the transpose of the destination objects transformation matrix. I have also tried multiplying by the source primitive's transformation matrix to go from primitive to world space and multiplying by the the destinations inverse transformation to go from world space to primitive space but this was unsuccessful. I believe a ray launched from the surface of a primitive object (at a random point and in a random direction) should be transformed in the same manner as a surface normal in 'regular' ray tracing however I am not certain. Any of the experts out there know what the flaw in my methodology is? Feel free to ask if more information is required. --- The basic algorithm for this ray tracer is as follows: ``` For each object, i, in scene { for each ray, r, in number of rays per object { determine random ray from primitive i convert ray from primitive space of i to world space for each object, j, in scene { convert ray to primitive space of object j check for intersection with object j } } } ``` Hopefully to clear up the question lets look at an example. Lets assume I have a cylinder extending along the z-axis (unit radius and height) and an annulus lying in the x-y plane with inner diameter 7 and outer diameter 8. I want the scale the cylinder by a factor 6 in the x and y directions (but not the z direction) so my affine transformation matrix are as follows: ``` M(cylinder) = |2 0 0 0| M^-1(cylinder) = | .5 0. 0. 0. | |0 2 0 0| | 0. .5 0. 0. | |0 0 1 0| | 0. 0. 1. 0. | |0 0 0 1| | 0. 0. 0. 1. | M(annulus) = |1 0 0 0| M^-1(annulus) = |1 0 0 0| |0 1 0 0| |0 1 0 0| |0 0 1 0| |0 0 1 0| |0 0 0 1| |0 0 0 1| ``` Now assume I have a ray which has a random starting point on the surface of the cylinder s and a random direction away from the surface of the cylinder c giving the ray r(os) = s + ct. I want to transform this ray from primitive (object) space to world space and then test for intersection with the other objects in the scene (the annulus). The first question is what is the correct way to transform the ray, r(os), to world space, r(ws), using M(cylinder) or M^-1(cylinder). The second question is what is the correct way to then transform the ray, r(ws), from world space to object space to check for intersection with the other objects using M(annulus) and M^-1(annulus). --- Some additional background information: This application is for calculating radiative heat transfer between N objects. The ray is launched from a random point on the object with its direction being randomly selected to lie within a hemispherical distribution orientated with the surface normal at the random point. --- Here is some visualisation of my problem. The ray directional distribution when it is first generated: ![Initial ray directional distribution](https://i.stack.imgur.com/EopxZ.png) If I apply the transformation to world co-ordinates using the transformation matrix M: ![Direction transformed by M](https://i.stack.imgur.com/9Ojzc.png) If I apply the transformation to world co-ordinates using the inversetransformation matrix M^-1 ![Direction transformed by M^-1](https://i.stack.imgur.com/ni5bl.png)
3D Affine transformation problem in raytracing
CC BY-SA 3.0
0
2011-04-29T00:31:14.730
2011-05-01T03:15:06.410
2011-05-01T03:15:06.410
730,264
730,264
[ "math", "raytracing", "matrix-multiplication", "montecarlo", "affinetransform" ]
5,826,731
1
5,827,345
null
2
2,293
The following are the two layouts that I want have in my application. It would be nice if when the application switches from portrait to landscape that it keeps the UILabels, BOOLs, and other objects. Because the buttons are situated differently I cannot just have the portrait view autoresize on an auto rotate. I also want to implement my own rotation lock using a BOOL and the button on the top right. I thought about using a with a however these didn't copy over the objects and seemed to cause [more harm then good and didn't appear to work properly](https://stackoverflow.com/questions/5764850/rotation-problems-using-2-xibs-and-1-view-controller-ios). Thanks for the help! ![Portrait xib](https://i.stack.imgur.com/qrLtT.png) ![Landscape xib](https://i.stack.imgur.com/gwx0z.png) I added the landscape view to the ViewController, having both views in the view controller. I linked it up to File's Owner under the UIView *landscapeView that I added in the @interface section of the ViewController. I added [self.view addSubview:landscapeView] to the viewDidLoad method. Then I added this piece of code: ``` - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { if (orientationLock) return NO; else { if (interfaceOrientation == UIInterfaceOrientationPortrait) { [landscapeView setHidden:YES]; //[self.view setHidden:NO]; removed } else { //[self.view setHidden:YES]; removed [landscapeView setHidden:NO]; } return YES; } } ``` However this is not the correct solution. When I run the simulator and rotate it, the screen is not properly placed. ![Bad Image](https://i.stack.imgur.com/XWOcw.png)
Rotation with Different Layouts - iOS 4
CC BY-SA 3.0
0
2011-04-29T00:55:04.820
2011-04-30T16:37:23.053
2017-05-23T12:13:39.697
-1
557,358
[ "objective-c", "xcode", "ios4", "rotation", "xib" ]
5,826,841
1
5,827,169
null
7
9,466
I'm trying to create a View with rounded corners (and a background color of choice) that I can reuse with different background colors; hard to explain, so here's my code: ``` package com.packagename.whatever; import android.content.Context; import android.content.res.TypedArray; import android.graphics.Canvas; import android.graphics.drawable.PaintDrawable; import android.util.AttributeSet; import android.view.View; public class CustomDrawableView extends View { private PaintDrawable mDrawable; int radius; private void init(AttributeSet attrs) { TypedArray a = getContext().obtainStyledAttributes(attrs,R.styleable.RoundedRect); radius = a.getInteger(R.styleable.RoundedRect_radius, 0); } public CustomDrawableView(Context context, AttributeSet attrs) { super(context, attrs); init(attrs); mDrawable = new PaintDrawable(); } protected void onDraw(Canvas canvas) { mDrawable.setCornerRadius(radius); mDrawable.draw(canvas); } } ``` Here's the XML to display the custom component: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ny="http://schemas.android.com/apk/res/com.packagename.whatever" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="#ffffff" android:padding="10dp"> <com.packagename.whatever.CustomDrawableView android:id="@+id/custom" android:layout_width="200dp" android:layout_height="200dp" android:background="#b80010" ny:radius="50" /> </LinearLayout> ``` I'm wanting the red box to have 50px rounded corners, but as you'll see, it does not: ![Red box without rounded corners](https://i.stack.imgur.com/7BSGR.png) The idea is that I could easily change the background color in the XML and automatically have a nice View with rounded corners, without having to create multiple drawables. Thanks for the help!
Android Custom Component View w/Rounded Corners
CC BY-SA 3.0
0
2011-04-29T01:13:15.593
2011-04-29T02:13:29.980
null
null
204,499
[ "android", "android-layout" ]
5,827,115
1
8,333,442
null
3
1,052
I'm trying to debug MVC source code in Visual Studio 2010 using the Microsoft Symbols Server. I've configured Debugging options as seen below: ![Debugging - General Setup](https://i.stack.imgur.com/qhqbC.jpg) ![Debugging - Symbols Setup](https://i.stack.imgur.com/sq6jq.jpg) and my project is targeting .NET Framework 4.0. (as said in [Debug .NET Framework's source code only shows disassembly in Visual Studio 2010](https://stackoverflow.com/questions/2733313/debug-net-frameworks-source-code-only-shows-disassembly-in-visual-studio-2010)) When I try to load the symbols of System.Web.MVC.dll, some window pops up saying that they're being loaded. But in the end, the Modules window says they couldn't be found, call stack lines are still grayed out and I only get code from disassembly window. ![Modules, Call Stack and Source Code](https://i.stack.imgur.com/G2Iwo.jpg) Anyone knows what is happening?
Unable to debug MVC source code in Visual Studio 2010
CC BY-SA 3.0
null
2011-04-29T02:02:08.550
2011-11-30T21:52:09.297
2017-05-23T11:48:23.740
-1
712,598
[ "visual-studio-2010", "debug-symbols" ]
5,827,105
1
5,847,125
null
0
219
![Core Data entity diagram](https://i.stack.imgur.com/zRLn2.png) In [AcaniUsers](https://github.com/acani/AcaniUsers), I'm downloading the closest 20 users to me and displaying their profile pictures as thumbnails in a table view. User & Photo are both Resources because they each have an `id` (MongoDB BSON ObjectId) on the server. Each user has a unique_id. Each Photo has four different sizes (images) on the server: square: 75x75, square@2x: 150x150, large: 320x480, large@2x: 640x960. But, each device will only have two of these sizes, depending on whether it's an iPhone 3 or 4 (retina display). Each of these sizes has their own MongoDB collection. And, all four images for each Photo have the same BSON ObjectId's across these four collections. In the future, I may give User a relationship called `photos` to allow a user to have more than one photo. Also, although I don't foresee this, I may add more Image sizes (types). The `fresh` attribute on `Image` tells me whether I've downloaded the latest Image. I set this to `NO` whenever the `Photo`'s ID has changed, and then back to yes after I've finished downloading the Image. 1. Should I store the four different images in Core Data or on the file system and just store their URLs in Core Data? I read somewhere that over 1 or 2MB, you should store in file system, not Core Data. So, I was thinking of storing the square images in Core Data and the large images in the file system, but I'd rather store them all the same way to make things easier. So, maybe I'll just store them all in the file system? What do you think? 2. Do you think I should discard the 75x75 & 320x480 sizes since pretty soon iPhone 3's will be gone? 3. How can I improve my design of the entities, and their attributes and relationships. For example, is the Resource entity even beneficial at all? 4. I'm displaying the Users with an NSFetchedResultsController. However, it doesn't know when the User's image gets updated, so the images don't show up until I scroll aggressively the first time. How do I let the NSFetchedResultsController know that a user's thumbnail has finished downloading? Do I have to use KVO?
Enhance my Core Data design. Experts only!
CC BY-SA 3.0
null
2011-04-29T02:00:38.003
2011-05-01T07:30:24.730
2011-04-29T13:07:59.497
242,933
242,933
[ "core-data", "nsfetchedresultscontroller", "key-value-observing" ]
5,827,142
1
null
null
1
2,544
So I just finished my app and I wanted to as the final few steps run some diagnostics on it. In terms of what its memory usage, allocations, leaks, etc are. I have a few questions: 1) Is there a standard list of instruments/checks I should run on my app be fore its submitted to make sure its robust? If so could someone point me to some links and/or tell me some names so I can google the stuff. 2) One of the tools I know to run is NSZombieEnabled. I followed the steps I found online on some sites to set up this NSZombie test but it doesn't seem to be working. I looked at this site: [NSZombieEnabled](http://www.cocoadev.com/index.pl?NSZombieEnabled) This is what my XCode looks like after I tried the steps listed there: ![enter image description here](https://i.stack.imgur.com/Go8pX.png) ![enter image description here](https://i.stack.imgur.com/ZFlUp.png) But why is the zombies choice not highlighted? Once I get it to work how do I actually use NSZombies?
How to use NSZombie?
CC BY-SA 3.0
null
2011-04-29T02:07:48.267
2011-07-27T06:19:03.370
2011-04-29T02:55:17.027
657,514
657,514
[ "nszombie" ]
5,827,149
1
5,827,168
null
1
83
I have the following code: ``` <?php if ($foo) { echo $foo; } ?> ``` However, my page is throwing a 500 internal server error (I know this generally means there's an error being logged and the page is aborting prematurely) I do not have access to the error log (as the host is logging to syslog). I can fix it by doing the following: ``` <?php if (isset($foo) && $foo) { echo $foo; } ?> ``` but that's not my question. Is there a server setting that would kill a page attempting to use an unset variable? AFAIK, it only logs a 'Notice', which is normally not enough to kill the page. Here is the first bit of the phpinfo() output (disclaimer: I have no Windows + FastCGI setup experience) ![enter image description here](https://i.stack.imgur.com/MPrJk.png) I added a custom error handler and simply output the $errno and $errstr. As expected, it was an E_NOTICE (8) with message 'Undefined variable'. I'm guessing the 500 internal error has something to do with how it's logging to the syslog.
Is there a PHP configuration setting that would prevent use of variable before it's set?
CC BY-SA 3.0
null
2011-04-29T02:09:19.263
2011-04-29T12:52:10.393
2011-04-29T12:46:26.150
527,212
527,212
[ "php" ]
5,827,268
1
5,852,980
null
0
2,301
I'm using the Date Picker from the Telerik MVC library. It appears and works fine in Firefox and IE8+ in standards mode. ![Correct display](https://i.stack.imgur.com/HIpVD.jpg) In IE6, IE7, and IE8 in Quirks or IE7 Standards modes the `input` field is displayed, but not the calendar icon. ![Incorrect display](https://i.stack.imgur.com/wJOG9.jpg) I think I've narrowed it down to a problem rendering the span that contains the icon. The HTML for this span is: ``` <span class="t-icon t-icon-calendar" title="Open the calendar">Open the calendar</span> ``` and the CSS applied to the `span` is: ![css rules](https://i.stack.imgur.com/HT9Jx.jpg) The problem seems to be that the `span` is being rendered with width and height of 0px, regardless of what's specified in the CSS. Why is this happening, and what can I do to fix it? I've tried setting `font-size` and `line-height` to `12px`, but it didn't help. It turns out that the styling on the span wasn't the problem at all. I had some styling on the input element (float: left) which caused the span containing the image to end up behind the input.
Telerik Date Picker in IE <8
CC BY-SA 3.0
0
2011-04-29T02:37:49.030
2014-01-14T17:27:15.900
2014-01-14T17:27:15.900
881,229
377,639
[ "telerik", "datepicker", "internet-explorer-7", "internet-explorer-6", "html" ]
5,827,522
1
5,827,619
null
1
1,168
![enter image description here](https://i.stack.imgur.com/1LiUZ.png) I need to get the data from the web service to the TCP server ... what is the concept for that ? im using C#.net
Web service to TCP Server
CC BY-SA 3.0
null
2011-04-29T03:28:11.197
2011-04-29T03:46:09.673
null
null
296,231
[ "c#", "web-services", "tcp" ]
5,827,627
1
5,852,615
null
0
1,024
Is it possible to fill in the area between a Dataset plotting a XY line and a ValueMarker ? See picture for the general idea(Warning: My MS Paint skills are lacking). ![enter image description here](https://i.stack.imgur.com/p21aK.jpg)
Filling in the Area between of two lines which intersect?
CC BY-SA 3.0
null
2011-04-29T03:47:28.613
2011-05-02T01:04:27.553
2011-04-29T03:49:05.180
273,200
653,950
[ "java", "jfreechart" ]
5,827,699
1
5,827,712
null
0
47
I want to be able to have the following UI. When you click on the close button on top, the row below it moves to the top and so on. ![enter image description here](https://i.stack.imgur.com/Ut8A4.png) Is there a library for this?
what jQuery library does this?
CC BY-SA 3.0
null
2011-04-29T04:02:36.397
2011-04-29T04:12:04.763
null
null
721,937
[ "jquery" ]
5,827,875
1
5,827,942
null
0
5,784
How to create Charts in vb.net. Is it possible to have a chart like this without any additional components ? If yes then how ? ![enter image description here](https://i.stack.imgur.com/lwnE0.jpg) Using this VS component for real time manipulation ![enter image description here](https://i.stack.imgur.com/Pqd5Z.png)
how to create charts in vb.net
CC BY-SA 3.0
0
2011-04-29T04:27:02.810
2011-05-01T13:24:12.270
2011-05-01T13:24:12.270
722,000
722,000
[ "vb.net", "winforms", "charts" ]
5,827,891
1
5,828,079
null
1
1,930
I want to create a small window where a user will : 1. Enter some text in JTextField1. 2. Then he will enter a regular expression in JTextField2 to check if the text in JTextField1 has some text matching this Regex. 3. And another field JTextField3 that he can enter a formating for the matching text 4. The user will then get the final text matching this and formatted in JTextField4. This seems to be complicated, but i hope this screenshot will clarify my needs : ![enter image description here](https://i.stack.imgur.com/DVk6d.png) Implementing the first 2 fields was easy, but the third field, that is what i want to ask about. I have read about Back references that can help me do that, but it is not so clear to me. What i understand is that if i wrote \2, \1 as it appears in the screenshot, then it will grab the second bracket in the Regex then adds a comma + a space then grabs the first bracket in the Regex, giving the right final result.
Java - How to format a regular expression?
CC BY-SA 3.0
null
2011-04-29T04:29:01.740
2011-04-29T04:58:52.377
2011-04-29T04:53:12.710
147,381
147,381
[ "java", "regex", "formatting" ]
5,828,007
1
5,828,050
null
3
13,376
I want be able to select any color I want, just like the attached pic. ![COLOR PICKER](https://i.stack.imgur.com/RUy5N.jpg) Yes I want to learn this C++ or MFC. I find it more powerful. Could you explain to me exactly how to add it to my project? I also want the color itself and it code appears in picture box and textbox.
How to add color picker in mfc?
CC BY-SA 4.0
null
2011-04-29T04:46:21.947
2023-03-02T22:36:05.103
2023-03-02T18:29:52.247
2,287,576
644,073
[ "visual-c++", "mfc" ]
5,828,008
1
null
null
8
2,737
There is a button at bottom right of iPad keyboard which is to hide the keypad. ![enter image description here](https://i.stack.imgur.com/znJTL.png) How can I interact with it programmatically? (get the button then send `UIControlEventTouchUpInside` to it). Does anyone know this? [Edit] In my case, the keyboard is shown on a modal view.
How can I interact with "iPad keyboard hiding button" programmatically?
CC BY-SA 3.0
null
2011-04-29T04:46:35.830
2013-01-04T19:57:43.057
2011-05-24T10:12:23.360
374,885
374,885
[ "objective-c", "ipad" ]
5,828,151
1
5,828,346
null
0
1,807
I ma having a view whose xib is in landscape mode.In my one view controller I want to show the view in landscape mode and it is working f9.In another view controller on a button click I want that view to come in portrait from bottom to top so basically I need to transform that landscape view to portrait view .I have done by shouldAuto rotate methodbut it does not work.i have attached the screenshot so that the question will be more understood![enter image description here](https://i.stack.imgur.com/UvOeU.png) the landscape view is coming as it is . Please help me in sort outing this problem Thanks in advance!!
Rotating view from landscape to portrait
CC BY-SA 3.0
null
2011-04-29T05:11:57.370
2011-05-06T12:40:16.293
null
null
633,676
[ "iphone", "objective-c", "rotation", "landscape-portrait" ]
5,828,237
1
5,931,247
null
0
388
I'm having problems making my app iPad compatible. I have an implementation of a custom Tab Bar, based on the post here [http://www.wiredbob.com/blog/2009/4/20/iphone-tweetie-style-navigation-framework.html](http://www.wiredbob.com/blog/2009/4/20/iphone-tweetie-style-navigation-framework.html) That all works fine apart from when the device is rotated. The currently selected view rotates and resizes perfectly. Every other view rotates but does not resize to fill the space. There is a large white column down the right hand side. I've tried adding ``` self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight; self.view.autoresizesSubviews = YES; ``` to the tab controller view. I've added similar code to the tab's views viewDidLoad methods. I've tried to make the willRotateToInterfaceOrientation call all the subviews rotation methods but still no luck. Any suggestions would be more than welcome at this stage. I'm hoping i'm not overlooking something obvious but i might be. I've been at it for a few hours now Screenshot 1 - ![Rotating the selected tab works fine see below for what the other tabs look like](https://i.stack.imgur.com/9ewl6.png) Screenshot ![Screenshot of the result of rotating and selected a different tab](https://i.stack.imgur.com/McWY0.png)
Non Selected Tab Bar View Controllers aren't resized when device rotated
CC BY-SA 3.0
null
2011-04-29T05:25:44.520
2011-05-09T00:04:58.457
null
null
631,549
[ "iphone", "xcode", "ipad", "uitabbar", "rotation" ]
5,828,300
1
5,830,548
null
1
1,214
Problem: I have 2 sidebars (widget-areas). In the admininistration-backend sidebar 1 is always open, but sidebar 2 is closed by default, when I navigate to "Design -> Widgets". See this screenshot: ![the second sidebar "Teaser Sidebar" is closed by default (red area)](https://i.stack.imgur.com/I8rWP.png) Question: Is there a way to configure to keep the second sidebar open by default? Wordpress version 3.1.2.
Wordpress: How to keep a widget-sidebar open by default?
CC BY-SA 3.0
null
2011-04-29T05:38:08.803
2011-04-29T09:50:02.777
null
null
268,479
[ "wordpress", "widget", "sidebar", "area" ]
5,828,650
1
5,828,867
null
4
17,205
I am getting the following error on click of a button ![input string was not in a correct format](https://i.stack.imgur.com/S8jBM.png), On click of a button i am calling the following method: ``` using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.IO; using iTextSharp.text.html.simpleparser; using iTextSharp.text; using iTextSharp.text.pdf; using iTextSharp.text.html; /// <summary> /// Summary description for pdfgeneration /// </summary> public class pdfgeneration { public pdfgeneration() { // // TODO: Add constructor logic here // } public void pdfgenerator(String name1, AjaxControlToolkit.HTMLEditor.Editor Editor1) { HttpContext.Current.Response.Clear(); HttpContext.Current.Response.ContentType = "application/pdf"; // Create PDF document Document pdfDocument = new Document(PageSize.A4, 70, 55, 40, 25); PdfWriter wri = PdfWriter.GetInstance(pdfDocument, new FileStream("e://" +name1 + ".pdf", FileMode.Create)); PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream); pdfDocument.Open(); string htmlText = Editor1.Content; System.Collections.Generic.List<IElement> htmlarraylist = HTMLWorker.ParseToList(new StringReader(htmlText), null); for (int k = 0; k < htmlarraylist.Count; k++) { pdfDocument.Add((IElement)htmlarraylist[k]); } pdfDocument.Close(); HttpContext.Current.Response.End(); } } ``` the stack trace is: ``` [FormatException: Input string was not in a correct format.] System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal) +7471335 System.Number.ParseSingle(String value, NumberStyles options, NumberFormatInfo numfmt) +115 System.Single.Parse(String s, NumberStyles style, NumberFormatInfo info) +192 iTextSharp.text.html.simpleparser.CellWrapper..ctor(String tag, ChainedProperties chain) +148 iTextSharp.text.html.simpleparser.HTMLTagProcessor_TD.StartElement(HTMLWorker worker, String tag, IDictionary`2 attrs) +84 iTextSharp.text.html.simpleparser.HTMLWorker.StartElement(String tag, Dictionary`2 attrs) +79 iTextSharp.text.xml.simpleparser.SimpleXMLParser.ProcessTag(Boolean start) +30 iTextSharp.text.xml.simpleparser.SimpleXMLParser.Go(TextReader reader) +1008 iTextSharp.text.xml.simpleparser.SimpleXMLParser.Parse(ISimpleXMLDocHandler doc, ISimpleXMLDocHandlerComment comment, TextReader r, Boolean html) +48 iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(TextReader reader, StyleSheet style, IDictionary`2 tags, Dictionary`2 providers) +94 iTextSharp.text.html.simpleparser.HTMLWorker.ParseToList(TextReader reader, StyleSheet style) +9 pdfgeneration.pdfgenerator(String name1, Editor Editor1) in C:\inetpub\wwwroot\dcis\App_Code\pdfgeneration.cs:37 EntryForm.Button4_Click(Object sender, EventArgs e) in C:\inetpub\wwwroot\dcis\EntryForm.aspx.cs:224 System.Web.UI.WebControls.Button.OnClick(EventArgs e) +111 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +110 System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565 ``` How can I resolve this error? @ geek for error in the code he has posted ![enter image description here](https://i.stack.imgur.com/YBVIM.png)
Error as Input string was not in a correct format
CC BY-SA 3.0
0
2011-04-29T06:24:29.537
2011-06-28T15:16:24.253
2011-05-02T10:11:55.460
243,680
243,680
[ "c#", "asp.net", "itext" ]
5,828,691
1
5,828,747
null
0
1,513
How do I create a delete confirmation like the one shown below? ![](https://i.stack.imgur.com/T2kbj.jpg)
How do I create a "delete" actionsheet in xcode?
CC BY-SA 3.0
0
2011-04-29T06:30:00.950
2015-07-23T15:00:51.373
2015-07-23T15:00:51.373
4,370,109
719,380
[ "ios", "cocoa-touch", "uiactionsheet", "confirmation" ]
5,828,968
1
5,829,323
null
2
10,014
I am using VS2008 for ASP.NET apps. My Solution Explorer has hierarchy like this: ![enter image description here](https://i.stack.imgur.com/Ioxkx.png) The start-up page, Default.aspx, displays a Login form. When I press Login button, another Page with the name, selectCompany, should open. selectCompany is a Web Content Form whose master page is Master1.Master. But it is not opening, instead I am getting this error: ``` Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: Could not load type 'FlexStock.Forms.master1'. Source Error: Line 1: <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="~/Forms/selectCompany.aspx" Inherits="FlexStock.Forms.master1" %> Line 2: Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Source File: /Forms/master1.Master Line: 1 ``` The first line of Master1.master is like this: ``` <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %> ``` And the first line of Web Content Form, selectCompany.aspx, is like this: ``` <%@ Page Title="" Language="C#" MasterPageFile="~/Forms/master1.Master" AutoEventWireup="true" CodeBehind="selectCompany.aspx.cs" Inherits="FlexStock.Forms.selectCompany" %> ``` I am not following where is the problem.
Master page gives error
CC BY-SA 3.0
null
2011-04-29T07:04:23.010
2016-01-12T22:00:51.483
null
null
194,328
[ "asp.net", "master-pages" ]
5,829,266
1
5,829,491
null
0
4,119
Cutting to the case. ``` <?xml version="1.0" encoding="UTF-8"?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" version="2.0"> <persistence-unit name="fishsticks" transaction-type="RESOURCE_LOCAL"> <class>model.Customer</class> <etc etc> <properties> <property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /> <property name="javax.persistence.jdbc.url" value="jdbc:mysql://127.0.0.1:3306/fishsticks" /> <property name="javax.persistence.jdbc.user" value="user" /> <property name="javax.persistence.jdbc.password" value="pass" /> <!-- EclipseLink should create the database schema automatically --> <property name="eclipselink.ddl-generation" value="drop-and-create-tables" /> <property name="eclipselink.ddl-generation.output-mode" value="database" /> <property name="eclipselink.logging.level" value="OFF" /> </properties> </persistence-unit> </persistence> ``` ![enter image description here](https://i.stack.imgur.com/T8TQE.png) ![enter image description here](https://i.stack.imgur.com/jwm71.png) [enter link description here](https://imgur.com/U9FGe) The page is made with `jsp` And I have no idea how to fix this... This is my DAO-file: ``` import java.util.List; import javax.persistence.EntityManager; import javax.persistence.EntityManagerFactory; import javax.persistence.EntityTransaction; import javax.persistence.Persistence; import javax.persistence.PersistenceContext; import model.Customer; import model.Milestone; import model.Project; import model.Task; import model.User; public class JpaDAO implements DAO { private static JpaDAO dao; public static JpaDAO getInstance() { if (dao == null) dao = new JpaDAO(); return dao; } private EntityManagerFactory emf = Persistence.createEntityManagerFactory("fishsticks"); @PersistenceContext(name="fishsticksEM") private EntityManager em = emf.createEntityManager(); private EntityTransaction tx = em.getTransaction(); private JpaDAO() { // singleton } } ```
MySQL driver problem in my dynamic web project (JPA, JSP)
CC BY-SA 3.0
0
2011-04-29T07:33:09.923
2011-04-29T08:25:31.967
null
null
515,772
[ "mysql", "eclipse", "jsp", "jpa", "jdbc" ]
5,829,298
1
5,829,416
null
6
2,828
We have an SVN repository which is stored online with all our tickets, wikis, etc. For deployment purposes, we need to use a second SVN repository on which we have no control: we cannot use svndump, svnload, svnsync, etc. We can update and commit basically. At deployment time, I would like to export a working copy from Dev Repo and then commit it to Staging+Live repo. Please see following sketch for a rough idea of what I need to do. ![SVN Workflow](https://i.stack.imgur.com/fuuKy.jpg) Is there an SVN command doing just that? I could use the svn export command but then I would have to add all new files by hand I believe. Also, I would like to avoid to export all the files when only few changed. So I would like to avoid recreating the S working copy each time I want to deploy the site. Or maybe there is a much simpler solution? Best regards
Export SVN dir from one repository and commit to another one
CC BY-SA 3.0
null
2011-04-29T07:36:57.953
2018-01-16T09:00:00.590
null
null
348,388
[ "svn" ]
5,829,317
1
5,829,613
null
1
1,932
I need to change the android's default Google input method's skin, including the buttons' style and image, background color, and maybe delete one or two button or make them to perform a different action when clicked. Default Input Method: ![System's Input Method](https://i.stack.imgur.com/Umu6l.png) I want to change it to the style: ![I want to change it to the style](https://i.stack.imgur.com/TxPLp.png) Is it possible to customize system's input method? Any article to read? What classes to edit? And actually what I want to modify is the Google's default Chinese Pinyin Input Method, which looks almost the same to the English input keyboard. If you know there was a difference to modify this form the English keyboard, please tell me too. Thank you !
How to customize the keyboard skin of Google's Input Method on Android?
CC BY-SA 3.0
0
2011-04-29T07:38:10.703
2011-04-29T08:10:40.307
null
null
218,275
[ "android", "coding-style", "skin", "customization", "android-input-method" ]
5,829,403
1
5,837,018
null
1
349
I'm reading through the [Professional iPhone Programming with MonoTouch and .NET/C#](http://au.wiley.com/WileyCDA/WileyTitle/productCd-047063782X.html) book, but I'm having trouble getting the example with section indexes with tables working. The book has [sample code available](http://www.wrox.com/WileyCDA/WroxTitle/Professional-iPhone-Programming-with-MonoTouch-and-NET-C-.productCd-047063782X,descCd-DOWNLOAD.html). When I try to run the code in chapter 6 ([download here](http://media.wiley.com/product_ancillary/2X/04706378/DOWNLOAD/637827_c06_download_New.zip)) in the folder "Tables03", no section index is displayed however the index still appears to function when I slide my finger down it. There is also a gap where it should be, just no letters are there. See below, I'm scrolling using the index but no letters are visible. Has there been a change in the api that has broken this since the book was released? Or is the problem something else? (Note to run the code I had to change the iPhone Build SDK version in project settings, since it was using 3.0). ![table problem](https://i.stack.imgur.com/0mfNY.png)
Section index working but not visible on a table in a monotouch application
CC BY-SA 3.0
null
2011-04-29T07:47:12.067
2011-04-29T20:22:45.470
null
null
66,131
[ "xamarin.ios" ]
5,829,436
1
null
null
0
576
How can I build transparent form look like windows vista weather gadget? Is there any example for this? This is basically what I'm trying to achieve: ![enter image description here](https://i.stack.imgur.com/pP3Gv.jpg)
C# transparent forms
CC BY-SA 3.0
null
2011-04-29T07:50:31.133
2012-08-11T21:16:09.867
2012-08-11T21:16:09.867
389,966
730,670
[ "winforms", "c#-4.0" ]
5,829,671
1
6,212,239
null
7
9,681
I know that there is already some apps can do this, such as: [WidgetLocker Lockscreen](https://market.android.com/details?id=com.teslacoilsw.widgetlocker) ![enter image description here](https://i.stack.imgur.com/tCG4Q.png) [Flyscreen](https://market.android.com/details?id=com.flydroid.FlyScreen&feature=search_result) ![enter image description here](https://i.stack.imgur.com/jG9ux.png) I want to know how to do this in my app? What classes I can use? Or what articles I should read? I don't want to change the Android's source code. And I wonder if it will be different to deal with when the screen is locked by draw pattern?
How to customize Android's LockScreen?
CC BY-SA 3.0
0
2011-04-29T08:16:47.893
2015-04-11T06:17:03.330
null
null
218,275
[ "android", "coding-style", "customization", "lockscreen", "unlock" ]
5,829,801
1
null
null
2
12,526
I'm working on a Mac 10.6.6 with MAMP installed. Previously, I have been able to connect to mysql using this from my command line ``` mysql --host=127.0.0.1 --port=8889 --user=root -p ``` but now it is saying ``` -bash: mysql: command not found ``` Do you have any idea how I can fix this problem? ![mysql directory](https://i.stack.imgur.com/vg0PW.png)
Terminal Command not working to connect to MySQL
CC BY-SA 3.0
0
2011-04-29T08:29:59.253
2012-04-20T13:14:16.697
2011-04-29T08:54:21.287
577,455
577,455
[ "mysql", "mamp" ]
5,829,811
1
5,830,673
null
1
1,956
I found this strange behaviour when using gnuplot (ver 4.4), it repeats the same y-axis ticks labels when command is used and y range is relatively low. If I set it up to "%10.5f" the numbers don't repeat but the "0.5" rounding isn't logical in my case. So I'm looking for a solution with minimal changes to the following script, any help appreciated! Example with repeating y-axis ticks labels: ![Example with repeating y axis tics-labels](https://i.stack.imgur.com/u2ktJ.jpg) Data: ``` 0.5 - 1 3.000 2 4.000 3 4.000 4 2.000 5 1.000 ``` Script: ``` set encoding cp1250 set datafile separator "\t" set datafile missing "-" set terminal png font "arial" small size 1090,282 xffffff x000000 x404040 x00aa66 xdd3300 set output "output.png" set key off set grid set boxwidth 0.9 relative set style data histograms set style fill solid 0.6 border -1 set decimalsign "," set format y "%10.0f" set xtics ('28.02.2011-06.03.2011' 1,'07.03.2011-13.03.2011' 2,'14.03.2011-20.03.2011' 3,'21.03.2011-27.03.2011' 4,'28.03.2011-03.04.2011' 5) set ylabel 'Label' set xrange [0.5:5.5] plot "data.dat" using 2 ```
Repeating y-axis tick labels
CC BY-SA 3.0
null
2011-04-29T08:31:23.750
2011-05-09T08:49:29.727
2011-05-09T08:49:29.727
420,055
106,218
[ "gnuplot" ]
5,829,857
1
5,830,170
null
3
322
I have a table like this: ![Sample Table](https://i.stack.imgur.com/p10VR.png) I need a query to return only those ProjectID's that have only State=21. i.e I want only ProjectID 2 & 5. I do not want those records with ProjectID 1, 3, 4 & 6, because in those case, the state is also equal to other numbers
SQL Query to get only those rows with only 1 value in another column
CC BY-SA 3.0
null
2011-04-29T08:36:09.637
2017-02-14T14:08:09.100
2017-02-14T14:08:09.100
1,033,581
895
[ "sql" ]
5,830,094
1
5,867,878
null
1
709
I just discovered this problem today, and I had no idea what caused this problem. My project had been developed for few months. I have a project(solution), with several projects in there, it works well if I write and debug, by pressing F5. The problem occur is when I press Ctrl+F5 (to skip debug mode), or run directly from double click the exe, it crashed. The errors dialogs that pop up every times are different, but OutOfMemoryException is the most frequent one. 1. I had checked to make sure all my projects are .Net 3.5 2. I put a MessageBox.Show("something") at the beginning of my main project constructor, but it never reach. 3. I use some registry cleaner to clean/fix my registry, scan for viruses. 4. I had try to read the meaning of each error and exception, but still no clue why it happen. These are a series of screenshots if I press Ctrl + F5. (FutureGenerator is some random name I gave to my project.) ![One of the error(note that my application is .Net 3.5, why it loads 4.0 assembly?)](https://i.stack.imgur.com/Nwcr6.png) ![Stop working window](https://i.stack.imgur.com/KZMfZ.png) ![After I click OK from the first screen shot](https://i.stack.imgur.com/hOW0z.png) ![in visual studio, unexpected exception unhandled](https://i.stack.imgur.com/vyQIZ.png) Series of screenshot if I run the app from my debug folder, FutureGenerator.exe ![OutOfMemoryException](https://i.stack.imgur.com/YwyhD.png) ![stop working](https://i.stack.imgur.com/782Vq.png) ![Visual Studio OutOfMemoryException window](https://i.stack.imgur.com/M0tDN.png) ![Detail View, which is not detail at all.](https://i.stack.imgur.com/OdAfk.png) I suspect this is caused by framework crashed during Windows Update, but I removed those update that I performed recently, still same. The exe file works on other non development PC, but I don't want to reformat my PC or reinstall my VS, yet, because it's a painful process. Any idea, anyone?? Million thanks.
System.OutOfMemoryException and a few exceptions happen during application run, Visual Studio 2010 WPF C#
CC BY-SA 3.0
null
2011-04-29T09:01:02.383
2011-05-03T09:59:15.203
2011-04-29T09:05:10.857
81,076
415,885
[ "wpf", "visual-studio-2010", "out-of-memory", ".net-3.5" ]
5,830,106
1
null
null
0
765
> Hi there, i have those 4 radio buttons in 2 different RadioGroup and i need as usual that only one per group can be selected, but it doesn't work, any suggestions? ![enter image description here](https://i.stack.imgur.com/djVPZ.png) ``` <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollView1" android:layout_width="match_parent" android:layout_height="match_parent"> <TableLayout android:background="#ffffff" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns="1"> <RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/radGroupDep"> <TableRow> <RadioButton android:id="@+id/radDepAir" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left"></RadioButton> <Spinner android:id="@+id/spinDepAir" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="right"></Spinner> </TableRow> <TableRow> <RadioButton android:id="@+id/radDepTow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left"></RadioButton> <Spinner android:id="@+id/spinDepReg" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="right"></Spinner> </TableRow> </RadioGroup> <RadioGroup android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:id="@+id/radGroupArr"> <TableRow> <RadioButton android:id="@+id/radArrAir" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left"></RadioButton> <Spinner android:id="@+id/spinArrAir" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="right"></Spinner> </TableRow> <TableRow> <RadioButton android:id="@+id/radArrTow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="left"></RadioButton> <Spinner android:id="@+id/spinArrReg" android:layout_height="wrap_content" android:layout_width="match_parent" android:gravity="right"></Spinner> </TableRow> </RadioGroup> </TableLayout> </ScrollView> ```
RadioButton select not working
CC BY-SA 3.0
null
2011-04-29T09:02:25.457
2011-08-25T04:54:52.947
2011-04-29T09:09:24.307
506,879
641,321
[ "android", "xml", "user-interface" ]