Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
3,637,620
1
3,642,841
null
1
91
![alt text](https://i.stack.imgur.com/ndLuW.png) At top there is some most useful info about foo. Between horizontal lines there is some immediate actions, if they are available, to perform on/with foo. And below is thing that bothers me. There goes tabbed, detailed information about foo. Those tabs can hold some actions too and can be quite sovereign. So the is - how to properly structure this thing (what should be controllers, actions, to each other) in order to avoid unnecessary hussle? I'm confused cause those tabs below are like a separate island. --- In model - there's that strange thing: 1 on 1 relation. It's like there's a `Contest` (Foo), and `Participant`. Tabs are detailed description of `Participant`. Currently I've modeled them both as [aggregate roots](http://domaindrivendesign.org/node/88). But it might be a wrong choice. So - if there are two roots, it seems natural if both of them got controllers and `Contest` isn't really responsible to hold all data. It seems that sub actions would be the way to go, but I foresee some complexity. When tabs will hold some actions, they will need to know how to redirect back to `Contest` details and how to pass info how to render correct tab. This coupling I would like to avoid but it seems there's no way to do that.
How to structure views/controllers/actions(/areas?) in asp.net mvc app in this context?
CC BY-SA 2.5
0
2010-09-03T16:16:28.727
2010-09-04T19:58:22.127
2010-09-04T19:58:22.127
82,062
82,062
[ "asp.net-mvc", "project-structuring" ]
3,638,551
1
3,648,368
null
7
1,672
I have this table: ``` CREATE TABLE `categories` ( `id` int(11) NOT NULL auto_increment, `category_id` int(11) default NULL, `root_id` int(11) default NULL, `name` varchar(100) collate utf8_unicode_ci NOT NULL, `lft` int(11) NOT NULL, `rht` int(11) NOT NULL, PRIMARY KEY (`id`), KEY `category_id` (`category_id`), KEY `lft` (`lft`,`rht`), KEY `root_id` (`root_id`) ) ``` Based on this question: [Getting a modified preorder tree traversal model (nested set) into a <ul>](https://stackoverflow.com/questions/1310649/getting-a-modified-preorder-tree-traversal-model-nested-set-into-a-ul) The difference is that I have many trees in one table. Each row has a foreign key representing its parent and its top parent: category_id and root_id. Also I have the lft and rht fields based on this example: [http://articles.sitepoint.com/article/hierarchical-data-database/2](http://articles.sitepoint.com/article/hierarchical-data-database/2) Based on this rows: ``` INSERT INTO `categories` VALUES(1, NULL, NULL, 'Fruits', 1, 14); INSERT INTO `categories` VALUES(2, 1, 1, 'Apple', 2, 3); INSERT INTO `categories` VALUES(3, 1, 1, 'Orange', 4, 9); INSERT INTO `categories` VALUES(4, 3, 1, 'Orange Type 1', 5, 6); INSERT INTO `categories` VALUES(5, 3, 1, 'Orange Type 2', 7, 8); INSERT INTO `categories` VALUES(6, 1, 1, 'Pear', 10, 11); INSERT INTO `categories` VALUES(7, 1, 1, 'Banana', 12, 13); INSERT INTO `categories` VALUES(8, NULL, NULL, 'Eletronics', 1, 14); INSERT INTO `categories` VALUES(9, 8, 8, 'Cell Phones', 2, 3); INSERT INTO `categories` VALUES(10, 8, 8, 'Computers', 4, 9); INSERT INTO `categories` VALUES(11, 10, 8, 'PC', 5, 6); INSERT INTO `categories` VALUES(12, 10, 8, 'MAC', 7, 8); INSERT INTO `categories` VALUES(13, 8, 8, 'Printers', 10, 11); INSERT INTO `categories` VALUES(14, 8, 8, 'Cameras', 12, 13); ``` How can I build an ordened list representing this tree? With the sql bellow: ``` SELECT c. * , (COUNT( p.id ) -1) AS depth FROM `categorias` AS p CROSS JOIN categories AS c WHERE ( c.lft BETWEEN p.lft AND p.rht ) GROUP BY c.id ORDER BY c.lft; ``` I got this result: ![alt text](https://i.stack.imgur.com/8PRRk.png) As you can see, I need to order by root_id too, so that I can generate the correct tree. Also, after get the tree, is there a way to order each node by name?
How to generate a tree view from this result set based on Tree Traversal Algorithm?
CC BY-SA 2.5
0
2010-09-03T18:29:04.530
2010-09-06T00:11:28.027
2017-05-23T12:09:11.587
-1
260,610
[ "php", "sql", "mysql", "html", "modified-preorder-tree-t" ]
3,638,573
1
3,638,602
null
0
794
I have searched and no one else seems to have my particular problem. The scroll bar shows up, but without arrows on the side. And I am shifting the page over so I can hide a side launch menu on the side of my Intranet site. My code is: ``` <html> <body> <div style="overflow:hidden; width: 300; height:1000; position:absolute; left:-170px; top:-100px"> <iframe src="" style="overflow:hidden;" width=350 height=250 frameborder="0" scrolling="no"> </iframe></div> </body> </html> ``` ![alt text](https://i.stack.imgur.com/mvbus.png)
How do I remove this horizontal scroll bar from my div/iframe?
CC BY-SA 2.5
null
2010-09-03T18:31:09.323
2010-09-03T18:34:40.203
null
null
400,636
[ "html", "scrollbar" ]
3,638,688
1
3,664,019
null
3
1,125
I'm editing the entire post to show the problem: ``` <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <link type="text/css" href="./jQuery/jQueryUI/css/ui-darkness/jquery-ui-1.8.4.custom.css" rel="stylesheet" /> <script type="text/javascript" src="./jQuery/jquery-1.4.2.min.js"></script> <script type="text/javascript" src="./jQuery/jQueryUI/js/jquery-ui-1.8.4.custom.min.js"></script> <script type="text/javascript"> $(function() { var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"]; $("#tags").autocomplete({ source: availableTags }); }); </script> </head> <body> <br/><br/><br/> <div id="LoginLinkSearch" class="ui-widget"> <label for="tags">Tags: </label> <input id="tags" /> </div> <br/><br/><br/> </body> </html> ``` ![alt text](https://i.stack.imgur.com/VZ2HM.jpg) I was experiencing problems in other browsers, but I believe this is due to me using a bad CSS file for the jqueryUI.
jqueryUI autocomplete suggestions misplaced in Chrome
CC BY-SA 2.5
0
2010-09-03T18:47:33.810
2010-09-08T01:28:28.263
2010-09-07T14:43:12.337
257,493
257,493
[ "html", "css", "jquery-ui", "jquery-autocomplete" ]
3,638,773
1
3,638,931
null
13
16,464
I'm trying to output 6 figures into one image, in a 3x2 layout. I'd like to place extra space between the top row and the bottom two rows. Is this possible using R? I've looked through the documentation for par and plot and can't seem to find an appropriate option. Here's some example code: ``` a = rnorm(100,100,10) b = rnorm(100,100,10) par(mfrow=c(3,2), oma=c(1,1,1,1), mar=c(2,2,2,2)) hist(a) hist(b) plot(a,b) plot(a,b) plot(a,b) plot(a,b) ``` --- Here's what that code outputs: --- ![alt text](https://i.stack.imgur.com/coEMA.png) --- Here's what I'd like it to output (I modified this image in an external editor). Note the extra space between the top row and bottom rows. --- ![alt text](https://i.stack.imgur.com/SyBtg.png) ---
Add extra spacing between a subset of plots
CC BY-SA 3.0
0
2010-09-03T19:03:55.240
2022-03-15T17:24:48.490
2013-01-02T09:49:06.540
429,846
152,159
[ "r", "graphics", "plot", "spacing" ]
3,639,212
1
null
null
1
386
I have a ListSelectionDialog. Something like this for instance: ![](https://sureshkrishna.files.wordpress.com/2008/03/listselectiondialog.jpg) Now what I'd like to do is to have some items permanently selected and disabled (Basically I'd like to indicate to the user that these are part of the "core" selections and are not optional). Is there a way to do this?
JFace question: Disable some entries in ListSelectionDialog?
CC BY-SA 2.5
0
2010-09-03T20:01:56.193
2010-09-03T22:19:51.320
2017-02-08T14:30:19.073
-1
2,288,585
[ "java", "eclipse", "user-interface", "dialog", "jface" ]
3,639,342
1
3,639,387
null
512
161,675
I've always thought of `git reset` and `git checkout` as the same, in the sense that both bring the project back to a specific commit. However, I feel they can't be exactly the same, as that would be redundant. What is the actual difference between the two? I'm a bit confused, as the svn only has `svn co` to revert the commit. ### ADDED VonC and Charles explained the differences between `git reset` and `git checkout` really well. My current understanding is that `git reset` reverts all of the changes back to a specific commit, whereas `git checkout` more or less prepares for a branch. I found the following two diagrams quite useful in coming to this understanding: ![http://a.imageshack.us/img651/1559/86421927.png](https://i.stack.imgur.com/C4BCo.png) ![http://a.imageshack.us/img801/1986/resetr.png](https://i.stack.imgur.com/Tiv4H.png) ### ADDED 3 From [http://think-like-a-git.net/sections/rebase-from-the-ground-up/using-git-cherry-pick-to-simulate-git-rebase.html](http://think-like-a-git.net/sections/rebase-from-the-ground-up/using-git-cherry-pick-to-simulate-git-rebase.html), checkout and reset can emulate the rebase. [](https://i.stack.imgur.com/EYijy.png) ``` git checkout bar git reset --hard newbar git branch -d newbar ``` [](https://i.stack.imgur.com/6F3ZK.png)
What's the difference between "git reset" and "git checkout"?
CC BY-SA 4.0
0
2010-09-03T20:21:43.267
2021-10-02T05:46:52.980
2019-04-08T20:10:24.393
260,127
260,127
[ "git", "git-checkout", "git-reset" ]
3,639,468
1
3,639,746
null
14
4,290
I'm relatively new to Qt, and am not entirely familiar with the out-of-the-box widgets. I have a somewhat (but not very) complex widget to create, and don't want to reinvent any wheels. What is the best QWidget to use as a starting point to subclass and/or QWidgets to use to compose my widget. Here is the end-result I am looking for (apologies for the crude drawing): ![Widget](https://sites.google.com/site/drmtempsoimages/_/rsrc/1283546424882/home/widget.png?height=301&width=400) Key points: - - - -
What Qt widget(s) to use for read-only, scrollable, collapsible, icon list
CC BY-SA 2.5
0
2010-09-03T20:46:51.073
2010-09-07T19:46:54.100
null
null
183,339
[ "user-interface", "qt", "widget", "qwidget" ]
3,639,649
1
null
null
3
4,306
The Blackberry 9800 simulator is crashing when launching the browser, throwing > JVM Error 104: Uncaught IllegalStateException. This is a clean install of the simulator with no 3rd party applications installed to it. I strictly wanted to use it for testing web applications. All other applications on the device seem to work without error. ![http://i.stack.imgur.com/ssXZs.png](https://i.stack.imgur.com/BXUAh.png)
Blackberry 9800 Simulator Crashing When Launching Browser
CC BY-SA 3.0
0
2010-09-03T21:21:07.720
2013-01-02T09:20:03.687
2013-01-02T09:20:03.687
null
439,327
[ "blackberry", "jvm", "blackberry-simulator", "jvm-crash", "blackberry-torch" ]
3,639,758
1
null
null
0
1,045
I wrote a Jquery function that blacks out the screen after a certain amount of inactivity, creates a pop-up that allows the user to click a button to stay logged in, and logs them out (closing the application window) if they do not respond in time. The environment is ASP.NET (VB). We don't technically use master pages, but we do have a parent page in which our header, footer and nav reside, and my Jquery code is called from that window, loaded via an IFrame. We're using txControl's ActiveX version as our text editor built into the app. We're going to be upgrading very soon, but for now I've got this one classic ASP page that I need to integrate my timeout code into, but when the timeout code kicks in, the ASP file does not "black out" like the rest of the child windows, and the button to continue the session is invisible, ending up behind the ASP page, I'm guessing. Here is my main timeout function, which is in a .js file and is inserted into the parent window via a script tag: ``` function pop_init() { // show modal div $("html").css("overflow", "hidden"); $("body").append("<div id='popup_overlay'></div><div id='popup_window'></div>"); //$("#popup_overlay").click(popup_remove); // removed to make sure user clicks button to continue session. $("#popup_overlay").addClass("popup_overlayBG"); $("#popup_overlay").fadeIn("slow"); // build warning box $("#popup_window").append("<h1>Warning!!!</h1>"); $("#popup_window").append("<p id='popup_message'><center>Your session is about to expire. Please click the button below to continue working without losing your session.</center></p>"); $("#popup_window").append("<div class='buttons'><center><button id='continue' class='positive' type='submit'><img src='images/green-checkmark.png' alt=''/> Continue Working</button></center></div>"); // attach action to button $("#continue").click(session_refresh); // display warning window popup_position(400, 300); $("#popup_window").css({ display: "block" }); //for safari using css instead of show $("#continue").focus(); $("#continue").blur(); // set pop-up timeout SESSION_ALIVE = false; window.setTimeout(popup_expired, WARNING_TIME); } ``` I've attached "stay-alive" code to mousedown, keydown and blur events in the child windows like this: ``` <script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript" language="javascript"></script> <script type="text/javascript"> $(document).ready(function() { window.parent.reportChildActivity(); }); </script> <script type="text/javascript"> $(document).bind("mousedown keydown blur", function() { window.parent.reportChildActivity(); }); </script> ``` I tried adding the following to my ASP file, only to get the result you see in the attached image: ``` <script src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js" type="text/javascript" language="javascript"></script> <script src="JScripts/RC_jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { window.parent.reportChildActivity(); }); </script> <script type="text/javascript"> $(document).bind("mousedown keydown blur", function() { window.parent.reportChildActivity(); }); </script> ``` Can anyone tell me what I need to do to get the Jquery timeout div to overlay the entire window as designed? Thanks for your time and any assistance you may be able to provide! ![ShouldLook](https://i.stack.imgur.com/V8db6.jpg) ![DoesLook](https://i.stack.imgur.com/I9VCe.jpg) Top pic is the desired result, and the result on all the aspx pages. Bottom pic is what I'm getting on the classic asp page. EDIT: Well, I thought to wrap all the essential parts of the ASP page in a div (called "divPage") and then hide the div. It works like a charm if I call "$('#divPage').hide();" from a script in the head section of the ASP file - it hides the div as soon as the document loads. However, I need conditional hiding, so I tried to put the same code in my Jquery file, in the pop_init function, and although the rest of the code in that function executes flawlessly for me, the code to hide divPage is doing nothing. Any ideas why I'd get different results from the iniline code, versus the function included in the RC_Jquery.js file?
Integrating Jquery timeout code into a classic ASP form in an ASP.NET application
CC BY-SA 2.5
null
2010-09-03T21:45:16.597
2011-02-02T03:00:41.877
2010-09-07T18:07:24.387
430,984
430,984
[ "jquery", "asp-classic", "timeout", "parent-child" ]
3,640,367
1
3,640,399
null
14
20,073
I need to use double quotes in a string that uses the @ symbol. Using double quotes is breaking the string. I tried escaping with \, but that doesn't work. Ideas? ![alt text](https://i.stack.imgur.com/DzRf6.png)
How to use double quotes in a string when using the @ symbol?
CC BY-SA 2.5
null
2010-09-04T00:14:22.717
2012-10-19T15:22:31.583
null
null
402,098
[ "c#", ".net", "string", "escaping", "literals" ]
3,640,546
1
3,640,570
null
0
656
![alt text](https://i.stack.imgur.com/TUXuN.jpg) See the menu where it says Home. Can this menu bar be replicated using CSS 3 only?
Can I create a Mac like menu in CSS 3?
CC BY-SA 2.5
null
2010-09-04T01:27:15.303
2010-09-04T01:38:17.830
2010-09-04T01:36:58.630
157,882
437,650
[ "javascript", "html", "css" ]
3,641,145
1
3,647,813
null
1
2,315
![alt text](https://i.stack.imgur.com/kBKAl.png) First off, sorry about the large screen. I am trying to get the text to wrap but am currently unable to do so. I have tried android:layout_width="fill_parent", android:scrollHorizontal="false", android:width="0dip" all of which suggested in another question. Does anyone have any idea how I can achieve text wrapping? Here's a sample of the xml: ``` <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="fill_parent"> <TableLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="2"> <TableRow> <TextView android:layout_column="1" android:gravity="center" android:background="@drawable/lgrayborder" android:paddingRight="5dip" android:paddingLeft="5dip" android:id="@+id/chatUser1"/> <TextView android:layout_column="1" android:gravity="left" android:background="@drawable/lgrayborder" android:paddingLeft="5dip" android:id="@+id/chatComm1"/> </TableRow> <TableRow> <TextView android:layout_column="1" android:gravity="center" android:background="@drawable/lgrayborder" android:paddingRight="5dip" android:paddingLeft="5dip" android:id="@+id/chatUser2"/> <TextView android:layout_column="1" android:gravity="left" android:background="@drawable/lgrayborder" android:paddingLeft="5dip" android:id="@+id/chatComm2"/> </TableRow> </TableLayout> </ScrollView> ``` Update: I have tried setting attributes in the ScrollView, TableLayout, and TableRow in hopes that it would force the TextViews to wrap but to no avail. Still looking for a solution to this.
Text wrap in TextView within a Tab
CC BY-SA 2.5
null
2010-09-04T06:21:17.240
2011-02-17T20:24:53.857
2010-09-05T20:58:12.463
423,519
423,519
[ "android", "xml" ]
3,641,676
1
3,698,254
null
0
2,670
I've created a WebService in VS2008, How Can I publish it with VS2008 ? ![Solution Explorer](https://i.stack.imgur.com/yZ3Dz.jpg)
How can we publish a WebService in Visual Studio 2008?
CC BY-SA 2.5
null
2010-09-04T09:37:32.640
2013-01-22T12:33:51.027
null
null
191,647
[ "c#", "web-services", "publish" ]
3,641,694
1
3,650,223
null
4
2,858
I've created an asp.net website with VS2008, how can I publish it in VS2008? P.S: I've used `Right Click -> publish` but, I've used a Database in my project, but VS2008 doesn't publish it. P.S: I'm using SQL Express 2008 ![Solution Explorer](https://i.stack.imgur.com/2sm7g.jpg)
How can we publish an asp.net website with Visual Studio 2008?
CC BY-SA 2.5
null
2010-09-04T09:40:38.797
2012-10-30T15:59:07.947
2010-09-04T18:50:23.943
191,647
191,647
[ "c#", "asp.net", "publish" ]
3,641,997
1
3,642,216
null
6
5,258
I follow by entity framework example : [http://msdn.microsoft.com/en-us/library/bb399182.aspx](http://msdn.microsoft.com/en-us/library/bb399182.aspx) and I have problem with Identity Columns. Here is part of code of creating database: ``` CREATE TABLE [dbo].[Person]( [PersonID] [int] IDENTITY(1,1) NOT NULL, [LastName] [nvarchar](50) NOT NULL, [FirstName] [nvarchar](50) NOT NULL, [HireDate] [datetime] NULL, [EnrollmentDate] [datetime] NULL, CONSTRAINT [PK_School.Student] PRIMARY KEY CLUSTERED ( [PersonID] ASC )WITH (IGNORE_DUP_KEY = OFF) ON [PRIMARY] ) ON [PRIMARY] END GO ``` In VS 2010 I build .edmx and at model I see that Person StoreGeneratedPattern is set to Identity. But when I want to create Person, by : ![alt text](https://i.stack.imgur.com/x27f5.png) Why I must put id, if this column is autoincrement? EDITŁ I thought that I found the way to resolve my problem by: ``` var schoolContext = new SchoolEntities(); schoolContext.AddToPeople(new Person() { LastName = "Gates", FirstName = "Bil" }); schoolContext.SaveChanges(); ``` because it added Bill to persons, but...because PersonID is not nullable, and it inserted him with id 0. When I tried add another person the same way of course I get error about primary key :) So still with nothing... Any ideas ?
Identity column in EF 4
CC BY-SA 2.5
0
2010-09-04T11:11:17.453
2010-09-04T20:10:02.253
2010-09-04T12:00:36.323
278,618
278,618
[ "c#", "entity-framework-4", "primary-key" ]
3,642,129
1
3,642,159
null
0
566
![alt text](https://i.stack.imgur.com/RxBiS.png) HI all, can we post images with tweets in twittter through code in iphone???? Check the screen shots I am using busyAgent.this helps me to tweet wiothout posting images, i need to send images to at the time of tweeting Guidence regards ![alt text](https://i.stack.imgur.com/JCutY.png)
Send images to twitter through code
CC BY-SA 2.5
null
2010-09-04T11:53:11.487
2011-02-25T12:42:35.520
2010-09-04T13:00:51.683
227,698
1,497,488
[ "iphone" ]
3,642,139
1
3,642,195
null
10
1,424
I've had a look at the markup it creates, namely a bunch of ![atom](https://www.google.co.uk/logos/2010/buckyball10-hp-atom.png) images for the atoms, and a [big background image](http://www.google.co.uk/logos/2010/buckyball10-hp-bond.png), which is used rather strangely to create the bonds. There are some things that I can't work out: 1. Where the javascript is 2. What makes the bonds at the rear narrower 3. Why the atoms also have the bond background applied --- Here's what the google doodle looked like, for those who are interested: ![doodle](https://www.google.com/logos/2010/buckyball10-hp.gif)
How is Google's buckyball doodle implemented?
CC BY-SA 3.0
0
2010-09-04T11:58:47.660
2011-06-18T07:36:38.317
2017-02-08T14:30:19.763
-1
102,441
[ "javascript", "css", "google-doodle" ]
3,642,555
1
3,642,593
null
1
227
I'd like to determine if a given x509 Certificate is an EV cert using C#. Since there are no properties available to me in the .NET API and I'm not sure where to get more information on this standard, I'm a bit stuck. Does anyone have the answer, or know where I should start looking inside the binary blob? ![alt text](https://i.stack.imgur.com/EBvDZ.gif)
How do I validate and access EV properties of a EV Certificate?
CC BY-SA 2.5
null
2010-09-04T13:52:32.330
2010-09-04T14:02:38.873
null
null
328,397
[ "c#", "cryptography", "certificate", "ssl-certificate", "x509certificate" ]
3,642,932
1
3,643,059
null
0
5,916
I would like to add facebook multi-friend-selector in my facebook iframe appplication that using PHP. Can i add it to my application? on anyway? Thanks! ![alt text](https://i.stack.imgur.com/oydiR.jpg)
Facebook multi-friend-selector for iframe application?
CC BY-SA 2.5
0
2010-09-04T15:48:14.167
2011-01-12T09:10:08.327
null
null
286,090
[ "php", "facebook", "iframe" ]
3,643,020
1
null
null
7
2,540
I can set background color for NSTextView, also insertion color, but when I try to change text color it just doesn't work. I can set the color programmatically before each insert of text, but I'm probably doing something wrong, since Interface Builder offers this options. Here's what my inspector looks like: ![alt text](https://i.stack.imgur.com/Cd1ws.png)
Changing text color of NSTextView in Interface Builder won't work
CC BY-SA 2.5
0
2010-09-04T16:10:00.093
2020-07-29T04:30:05.110
null
null
304,321
[ "cocoa", "interface-builder" ]
3,643,106
1
3,643,322
null
0
2,833
I have a thread running on a child form, I want to activate a control on the parent form but cannot. It works fine if It's done from the child forms UI thread: (FormMain.SetControlPropertyValue(FormMain.RBSQL2005, "Checked", True)) but not from a thread running on the child form: ``` Public Class FormRestoreDB Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim t = New Thread(AddressOf UpdateListView1) t.Start() End Sub Private Sub UpdateListView1() 'FormMain.SetControlPropertyValue(FormMain.RBSQL2005, "Checked", True) FormMain.RBSQL2005.Checked = True End Sub End Class Public Class FormMain Delegate Sub SetControlValueCallback(ByVal oControl As Control, ByVal propName As String, ByVal propValue As Object) Public Sub SetControlPropertyValue(ByVal oControl As Control, ByVal propName As String, ByVal propValue As Object) If (oControl.InvokeRequired) Then Dim d As New SetControlValueCallback(AddressOf SetControlPropertyValue) oControl.Invoke(d, New Object() {oControl, propName, propValue}) Else Dim t As Type = oControl.[GetType]() Dim props As PropertyInfo() = t.GetProperties() For Each p As PropertyInfo In props If p.Name.ToUpper() = propName.ToUpper() Then p.SetValue(oControl, propValue, Nothing) End If Next End If End Sub End Class ``` What am I doing wrong? ![alt text](https://i.stack.imgur.com/ygeI4.png)
Accessing controls between forms
CC BY-SA 2.5
null
2010-09-04T16:32:59.727
2011-04-20T15:35:33.053
2010-09-04T18:43:25.227
2,278,201
2,278,201
[ "vb.net" ]
3,643,142
1
3,643,334
null
0
340
I've seen a lot of applications where they have for example a login page. The username field and password are in a grouped (rounded) tableview. Is it possible to do this with interface builder alone? If yes what's the trick? Or does it have to be generated by code? ![alt text](https://i.stack.imgur.com/1XI5e.png)
iPhone - How can i create a tableview with rows in interface builder?
CC BY-SA 2.5
null
2010-09-04T16:41:42.080
2011-03-23T15:53:14.747
2010-09-04T16:47:22.770
242,769
242,769
[ "iphone", "uitableview" ]
3,643,267
1
3,644,355
null
1
144
Question update: I'm almost there, just missing dotted line style for the grid. ![alt text](https://i.stack.imgur.com/ZfafP.png) grid: [1100 600] step-grid: 5 max-n-points: grid/1 / step-grid x-axis-border: 20 Y-margin: 10 max-random: 1000 n-points: 300 ``` get-random-data: func[n p][ block: copy [] repeat i n [ append block RANDOM p ] block ] get-extremes: func[block][ extreme: none foreach element block [ if none? extreme [ extreme: copy [] repeat i 2 [append extreme element] ] if element > extreme/1 [ extreme/1: element ] if element < extreme/2 [ extreme/2: element ] ] extreme ] data0: get-random-data n-points max-random extremes: get-extremes data0 height: extremes/1 - extremes/2 ratio: (grid/2 - x-axis-border - (Y-margin * 2)) / height data: copy [] foreach element skip data0 (n-points - max-n-points) [ append data to-integer (ratio * element) ] plot: copy [] color: 0.0.0 append plot [ pen green line ] x: 0 foreach y data [ append plot as-pair x (grid/2 - x-axis-border - Y-margin) - y x: x + 5 ] main: layout [ origin 20x0 space 1x1 panel1: box 1100x580 black effect reduce [ 'line-pattern 4 4 'grid 30x30 0x0 200.200.200 'draw plot ] panel2: box 1100x0 black panel3: box 1100x20 black ] view main ``` === former question The space between each box is too big and I cannot draw dotted grid, how to do this ? ``` plot: copy [] color: 0.0.0 append plot [line-pattern 4 4] repeat x 400 [ repeat y 200 [ append plot compose [ box (xy: 25 * as-pair x - 1 y - 1) (xy + 25) ] ] ] main: layout [ origin 0x0 panel1: box 800x400 black effect reduce ['draw plot] panel2: box 800x180 black panel3: box 800x20 black ] view main ```
How to control the space between boxes in rebol draw?
CC BY-SA 2.5
null
2010-09-04T17:19:50.103
2010-09-05T15:26:42.863
2010-09-05T15:26:42.863
2,687,173
2,687,173
[ "functional-programming", "rebol" ]
3,643,633
1
3,643,662
null
21
8,608
Take a look : ![alt text](https://i.stack.imgur.com/QnwCd.jpg) Result should be ![alt text](https://i.stack.imgur.com/aq55L.jpg)
How to change width to fill the remaining space (CSS)
CC BY-SA 2.5
0
2010-09-04T19:12:53.000
2015-10-02T14:58:34.130
2010-09-05T15:20:18.520
423,903
423,903
[ "css", "width" ]
3,644,037
1
3,644,076
null
1
346
I am trying to translate a function in a book into code, using MATLAB and C#. I am first trying to get the function to work properly in MATLAB. Here are the instructions: ![alt text](https://i.stack.imgur.com/GHd9g.png) The variables are: ``` xt and m can be ignored. zMax = Maximum Sensor Range (100) zkt = Sensor Measurement (49) zkt* = What sensor measurement should have been (50) oHit = Std Deviation of my measurement (5) ``` I have written the first formula, N(zkt;zkt*,oHit) in MATLAB as this: ``` hitProbabilty = (1/sqrt( 2*pi * (oHit^2) ))... * exp(-0.5 * (((zkt- zktStar) ^ 2) / (oHit^2)) ); ``` This gives me the Gaussian curve I expect. I have an issue with the definite integral below, I do not understand how to turn this into a real number, because I get horrible values out my code, which is this: ``` func = @(x) hitProbabilty * zkt * x; normaliser = quad(func, 0, max) ^ -1; hitProbabilty = normaliser * hitProbabilty; ``` Can someone help me with this integral? It is supposed to normalize my curve, but it just goes crazy.... (I am doing this for zkt 0:1:100, with everything else the same, and graphing the probability it should output.)
Help understanding a definitive integral
CC BY-SA 2.5
null
2010-09-04T21:14:45.590
2010-09-05T16:40:43.490
null
null
282,090
[ "math", "matlab" ]
3,644,070
1
3,644,117
null
0
302
I'm subclassing `InputMethodService` to create my own personal keyboard. A lot of stuff already works quite nice. But now I'm playing around with the suggestion bar (also called "candiate view"). For now I'm just trying to load a static layout with one button in it: ``` @Override public View onCreateCandidatesView() { LayoutInflater mLayoutInflater = LayoutInflater.from(this); mView = mLayoutInflater.inflate(R.layout.suggestion_bar, null); return mView; } ``` The result looks like this: ![alt text](https://i.stack.imgur.com/msPLN.png) Which is exactly what I expected, but with one big issue: the button in the suggestion bar is not selectable or clickable at all. Any thoughts?
Android: button in IME's suggestion bar not clickable
CC BY-SA 2.5
0
2010-09-04T21:28:32.667
2010-11-13T10:43:06.283
2010-11-13T10:43:06.283
49,246
184,367
[ "android", "layout", "ime", "android-input-method" ]
3,644,512
1
3,648,258
null
4
7,771
here is my code? ``` FB.login(function(response){ console.log(response) if(response.session){ connectFacebook(); } },{perms:'email,read_stream,publish_stream,offline_access'}); ``` I need to permission user to use my application. The problem is FB.login show in popup style but i need it to show in page style like : ![alt text](https://i.stack.imgur.com/0tZUc.png) how can i do it? how do i change my code? thank you!
can FB.login() display as page for facebook iframe application?
CC BY-SA 2.5
0
2010-09-05T00:23:58.890
2010-09-05T23:34:59.707
2020-06-20T09:12:55.060
-1
286,090
[ "javascript", "facebook" ]
3,644,734
1
null
null
1
604
learning Cocoa can be pretty tough for web developers. Some things are so simple in HTML, and I have no idea, how to do this in Cocoa. Let me just show you an image here, to show you what I have on my mind. ![alt text](https://i.stack.imgur.com/K6ypI.png) So it's kinda like a blog. Each post has variable length, so it can take up some space. Also, you're able to scroll through posts. I was thinking about using or , but since I don't know much about Cocoa, I'm asking you for advice. Also please do link any related articles. So here are some things that I discovered. 1. I could make a subclass of NSCell and use it in Table View. I can use it, I can put there a string, something like this: [http://pastie.org/1140412](http://pastie.org/1140412) (please take a look at this code, I'm wondering if I should use awakeFromNib/setDataCell combination) 1. But string is not enough. I need a NSTextView. The problem is, it doesn't have method like drawInRect: withAttributes:. So I don't know how to draw it into that cell. I guess I'm missing some basics here, so I'm just gonna study some Cocoa views now. Any ideas are welcome.
HTML-like view in Cocoa?
CC BY-SA 2.5
null
2010-09-05T02:09:42.060
2010-09-05T22:44:34.447
2010-09-05T22:44:34.447
304,321
304,321
[ "cocoa" ]
3,644,846
1
3,722,508
null
0
15
When I exit and reopen my application, it immediately kills itself off, stating in the logcat: ![alt text](https://i.stack.imgur.com/gDX1p.png) I cannot for the life of me figure out why it would be running out of resources, when there is pretty much nothing that it does when resuming the application, other than set a few variables. Any help?
createNormalSurfaceLockedFailed Android
CC BY-SA 2.5
null
2010-09-05T03:04:21.853
2010-09-15T23:04:18.067
null
null
118,241
[ "java", "android" ]
3,645,156
1
3,645,166
null
-1
457
I have customer details , have lastname column , Some of records contain white space in the name front and back , i want to do the alphabetical order , but not working properly, plz chk this screen shot , i cant able to guess wha tis the exact reason , ![alt text](https://i.stack.imgur.com/iYFCI.jpg)
alphabetical order not working
CC BY-SA 2.5
null
2010-09-05T05:49:10.873
2010-09-05T15:01:12.763
2010-09-05T15:01:12.763
73,226
246,963
[ "php", "mysql" ]
3,645,386
1
3,645,713
null
2
626
I have a Django admin page for a nested category list like this: ![alt text](https://i.stack.imgur.com/6sHBX.png) I wrote this script to sort the list and present it hierarchically: ``` {% extends "admin/change_list.html" %} {% load i18n %} {% block footer %} <script> (function(){ var rows=document.getElementById('result_list').getElementsByTagName('tr'), table=rows[1].parentNode||rows[1].parentElement, i=0, r, // skip the first row data={}; // store category data while (r=rows[++i]) { var catName=r.getElementsByTagName('a')[0], k=catName.innerHTML, opts=r.getElementsByTagName('select')[0], j=-1, opt; while (opt=opts[++j]) { if (!opt.selected) continue; data[k] = { title: k, children: {}, parentName: opt.innerHTML, parentId: opt.value, catName: catName, row: r } } } for (var sub in data) { if (data[sub].parentName == sub) continue; for (var sup in data) { if (sup == data[sub].parentName) { data[sup].children[sub]=data[sub]; data[sub].parent = data[sup]; break; } } } var alt = 0; for (var leaf in data) { if (data[leaf].parentName != leaf) continue; walk(data[leaf], leaf, function (node, nodeName) { var n=node, t=n.title; while (n=n.parent) { t = ' &middot; &nbsp;' + t; } node.catName.innerHTML = t; node.row['class']=node.row['className']='row'+alt++%2; table.removeChild(node.row); table.appendChild(node.row); }); } function walk (leaf, leafName, cb) { if (cb) cb(leaf, leafName); leaf.ready = true; for (var kid in leaf.children) { if (leaf.children[kid].ready) continue; walk(leaf.children[kid], kid, cb); } } }()); </script> {% endblock %} ``` ...the script runs fine and the list looks like this: ![alt text](https://i.stack.imgur.com/sMry1.png) My question is: I feel like the script is prone to memory leaks in UAs with weak garbage collection because of the circular references created by the parent / child stuff. Is this something I should be worried about? Is there a better way to write the script? Should I be deleting a bunch of stuff at the end of the script, and if so, what?
Prevent memory leaks in this javascript code?
CC BY-SA 2.5
0
2010-09-05T07:53:57.103
2010-09-21T00:12:06.917
2010-09-21T00:12:06.917
886,931
886,931
[ "javascript", "garbage-collection", "django-admin" ]
3,645,809
1
3,645,904
null
1
376
I've updated my theme at my main site, [TweaksForGeeks.com](http://www.TweaksForGeeks.com), but as you can see in the image below I'm having an issue with my bottom AdSense block. ![alt text](https://i.stack.imgur.com/0VRta.png) The AdSense block overlays the tags if it is an article that has enough tags (or long enough ones) to use more than one line. It looks proper if the tags are all on just one line. I've fiddled with it a bit, and this block is set outside the tags div block, so I've no idea why it's doing this. Any ideas? The offending page example is [here](http://www.tweaksforgeeks.com/q_and_a/2010/04/isass-exe-application-error-0xc00000005). Code is below. CSS code is as follows: ``` #bottom-adsense { width: 468px; height: 60px; padding-top: 2px; padding-bottom: 0px; margin-left: auto; margin-right: auto; } .post .post-meta { font-size: 10px; text-transform: uppercase; float: left; clear: both; } .rightn small a, .post-meta a { font-size: 10px; font-family: Arial; color: #737373; } .rightn small, .post-meta { font-size: 10px; font-family: Arial; color: #737373; text-transform: uppercase; } ``` Page code is: ``` <div class="post-meta"><?php the_tags( __( '<span class="tag-links">Tags: ', 'wpbx' ), ", ", "</span>\n" ) ?></div> <div id="bottom-adsense"> <script type="text/javascript"><!-- google_ad_client = "MY_PUB_ID"; /* 468x60 - Post Bottom */ google_ad_slot = "8415056823"; google_ad_width = 468; google_ad_height = 60; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </div> <div id="socialicons"> <ul> <li><a href="http://twitter.com/home?status=Currently reading <?php the_permalink(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/twitter.png" alt="Tweet This!" />Tweet This</a></li> <li><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title(); ?>" rel="external,nofollow" target="_blank"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/facebook.png" alt="Share on Facebook" />Share on Facebook</a></li> <li><a href="http://digg.com/submit?phase=2&url=<?php the_permalink();?>&title=<?php the_title();?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/digg.png" alt="Digg it!" />Digg This</a></li> <li><a href="http://del.icio.us/post?v=4&noui&jump=close&url=<?php the_permalink();?>&title=<?php the_title();?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/delicious.png" alt="Add to Delicious!" />Save to delicious</a></li> <li><a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/stumble.png" alt="Stumble it" />Stumble it</a></li> <li><a href="<?php bloginfo('rss2_url'); ?>"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/feed.png" alt="Subscribe by RSS" />RSS Feed</a></li> </ul> </div> ```
CSS Overlay Issue - AdSense Block lays over my tags (Screenshot included)
CC BY-SA 2.5
null
2010-09-05T10:56:14.647
2010-09-05T11:31:00.057
2010-09-05T11:01:17.073
313,758
297,092
[ "php", "html", "css" ]
3,646,231
1
3,646,902
null
1
1,069
I am using a book with a function I would like to use. However I don't think I am getting the correct values from my function. Here is the instruction from the book: ![alt text](https://i.stack.imgur.com/yCns1.png) Here is the function as I have created it in MATLAB: ``` function [ shortProbability ] = pShort( zkt, zktStar, short) if zkt > zktStar shortProbability = 0; else normalizer = 1/(1-exp(-short*zktStar)); shortProbability = normalizer * (short * exp(-short*zkt)); end end ``` The values I am plugging in are: ``` zkt = 0:1:100 zktStar = 50; short = 0.01; ``` However my graph doesn't behave like the one which I am supposed to end up with, which is this: ![alt text](https://i.stack.imgur.com/G7z7M.png) I am getting this from the graph, which looks correct, however I don't think it is being normalized properly: ![alt text](https://i.stack.imgur.com/vxIeO.png) Can anyone help me to correct this function?
How to implement this function in MATLAB?
CC BY-SA 2.5
null
2010-09-05T13:37:29.287
2010-09-05T17:19:25.190
2010-09-05T14:17:19.020
282,090
282,090
[ "math", "matlab" ]
3,646,331
1
null
null
2
306
am rendering around 3000 records , So row like Customer Profile edit Customername , Action ``` 1 john editimage | Delete image 2 john editimage | Delete image 3 john editimage | Delete image 4 john editimage | Delete image 5 john editimage | Delete image ... ... 3000 john editimage | Delete image ``` So every time edit and delete images loading , chk this image![alt text](https://i.stack.imgur.com/ZNM11.jpg)
How to load image once
CC BY-SA 2.5
null
2010-09-05T14:10:38.830
2012-12-24T21:40:43.103
2012-12-24T21:40:43.103
367,456
246,963
[ "php", "javascript" ]
3,646,714
1
3,646,733
null
2
73
I need some help with an RSS feed I'm working on. This is the code of an item: ``` <item> <title>Team Fortress 2</title> <link>http://wormgineers.com/index.php?page=File&id=228</link> <description><[CDATA[Map with characters from Team Fortress 2.]]></description> <guid>228</guid> </item> ``` (Also, I'm not sure if I'm doing the CDATA thing right.) Apparantly, the feed fails because this is wrong: ![Validation](https://i.stack.imgur.com/VCXHx.png)
Some help with an RSS feed
CC BY-SA 2.5
null
2010-09-05T16:05:27.333
2010-09-05T16:14:36.653
null
null
377,618
[ "php", "html", "xml", "validation", "rss" ]
3,646,807
1
null
null
5
1,812
Hi i have a form where user can select start date and end date of a leave. For example when the no of days is 3, there will be 3 row of date generated. Each date,day and period (am/pm) will be stored in the hidden field. So 3 days will generate a hidden field with name date_1, day_1, period_1, date_2, day_2, period_2, date_3, day_3, period_3. The question is how to deal with this dynamic number of form input? I need to pass the value to the controller and then to model to store into database. This is the main problem since form input is number is dynamic and we need to pass it to the controller function. Can someone show me the correct way of dealing with this problem? A link of tutorial will be helpful thanks :) This is the code that is use to generate the list of date as in the picture below ``` function test(){ var count = 0; var date1 = $('#alternatestartdate').val(); var date2 = $('#alternateenddate').val(); var startDate = new Date(date1); var endDate = new Date(date2); var Weekday = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); while (startDate<=endDate) { var weekDay = startDate.getDay(); if (weekDay < 6 && weekDay > 0) { var month = startDate.getMonth()+1; if( month <= 9 ) { month = "0"+month; } var day = startDate.getDate(); var datearr = new Array(); if( day <= 9 ) { day = "0"+day; } count++; var datelist = day+"-"+month+"-"+startDate.getFullYear(); $('#pa').append(day+"-"+month+"-"+startDate.getFullYear() + " ("+Weekday[weekDay]+") <input type='hidden' id='' name='date_"+count+"' value='"+datelist+"' /><input type='hidden' id='' name='day_"+count+"' value='"+Weekday[weekDay]+"' /><input type='radio' name='period_"+count+"' value='1' checked/>Full<input type='radio' name='period_"+count+"' value='2'/>Half (AM)<input type='radio' name='period_"+count+"' value='3'/>Half (PM)<br />"); } startDate.setDate(startDate.getDate()+1) } $('#pa').append("<input type='hidden' id='' name='countval' value='"+count+"' />"); } ``` ![alt text](https://i.stack.imgur.com/nd8a8.jpg) If insert correctly, the data the in database will look like this: ![alt text](https://i.stack.imgur.com/qZdNH.jpg)
How to deal with dynamic number of form input using PHP?
CC BY-SA 2.5
null
2010-09-05T16:31:16.127
2010-09-05T17:04:28.177
2010-09-05T17:04:28.177
417,899
417,899
[ "php", "javascript" ]
3,647,099
1
3,664,447
null
1
452
I have this code to create a candlestick chart in rebol. Now I'd like to use over feel [http://www.rebol.com/how-to/feel.html#section-6](http://www.rebol.com/how-to/feel.html#section-6) to show info on each candlestick but my box is drawn with draw dialect and it doesn't seem to accept event ? ``` plot: [ pen green line 5x404 5x440 pen gold fill-pen 0.255.0 box 3x424 7x418 line 10x396 10x422 pen gold fill-pen 0.255.0 box 8x418 12x402 line 15x397 15x436 pen gold fill-pen 255.0.0 box 13x401 17x435 line 20x429 20x447 pen gold fill-pen 255.0.0 box 18x434 22x446 line 25x441 25x464 pen gold fill-pen 255.0.0 box 23x446 27x463 line 30x445 30x493 pen gold fill-pen 255.0.0 box 28x461 32x482 line 35x470 35x504 pen gold fill-pen 255.0.0 box 33x481 37x492 line 40x466 40x498 pen gold fill-pen 0.255.0 box 38x491 42x477 ] grid: [1100 600] step-grid: 5 max-n-points: (grid/1 / step-grid) - 1 x-axis-border: 20 Y-margin: 10 X0: 5 grid-color: coal main: layout [ origin 20x0 space 1x1 panel1: box 1100x580 black effect reduce [ 'line-pattern 4 4 'grid 30x30 0x0 (grid-color) 'draw plot ] panel2: box 1100x0 black panel3: box 1100x20 black ] view main ``` ![alt text](https://i.stack.imgur.com/vMCxC.png)
How to create interactive chart with Rebol
CC BY-SA 2.5
0
2010-09-05T17:54:45.513
2010-09-10T06:30:49.280
2010-09-10T06:30:49.280
211,160
2,687,173
[ "event-handling", "mouseover", "rebol", "google-visualization" ]
3,647,319
1
null
null
15
6,023
I've run into this really strange phenomenon that I can't quite figure out. I have a UITableViewController that manages a UITableView. Pretty simple. I also have a UISearchDisplayController for searching the contents of the table view. The searching functionality will be able to delete items of the content displayed by the table view. So if the user chooses to delete one of the items they found while searching, I want to not only reload the UISearchDisplayController's table view but also the UITableViewController's table view. When I do that, the sections of the regular table view pop out and display above the UISearchDisplayController. It's really quite strange. I think the best way to explain it is with an image: ![http://img46.imageshack.us/img46/2818/screenshot20100905at140.png](https://i.stack.imgur.com/hMi3H.png) If any of you know what could possibly be causing this problem or know a workaround, that would be fantastic.
Reloading UITableView behind UISearchDisplayController
CC BY-SA 3.0
0
2010-09-05T18:54:56.727
2016-10-09T22:46:58.027
2016-10-09T22:46:58.027
4,370,109
432,479
[ "ios", "uitableview", "reload", "uisearchdisplaycontroller", "behind" ]
3,647,448
1
3,647,527
null
1
1,480
First i need some background color on the text only. Like the headers in the F-Script Browser ![alt text](https://i.stack.imgur.com/tAujd.jpg) Setting [cell setBackgroundColor: [NSColor blueColor]]; colors the whole cell space not only the text. Also i would need underlined and strikeout text. And to make things readable i would finally like to change the colors (foreground/background) of the selection on the styled items. Can i do this with the default NSTextFieldCell ?
I need to do some advanced text styling of NSTextFieldCell
CC BY-SA 2.5
null
2010-09-05T19:30:49.360
2010-09-05T19:50:16.387
null
null
155,082
[ "cocoa", "nstextfield", "nstextfieldcell" ]
3,647,532
1
3,670,524
null
1
1,885
I'm developing a turn-by-turn navigation software and I'm using the following solution to make my lines of roads into 2.5D or 3D View [Draw 2.5D or 3D Map with C# from lines](https://stackoverflow.com/questions/2808393/draw-2-5d-or-3d-map-with-c-from-lines) However, above solution is quite okay for lines within the view port which is 0 < x < width and 0 < y < height . However there are lines that its points may have y < 0 or x < 0 or y > height or x > width and then the above solution gone crazy. Could anyone help me figure out how to solve the problem? vvvv With 3D algorithm vvvv ![alt text](https://i.stack.imgur.com/z1els.png) . vvvv Without 3D algorithm vvvv ![alt text](https://i.stack.imgur.com/Dxp6t.png) Update:: After using this code ``` double x = p->x(); double y = p->y(); double t = -0.5; x = x - w / 2; y = y - h / 2; double a = h / (h + y* sin(t)); double u = a * x + w / 2; double v = a * y * cos(t) + h / 2; p->setX(u); p->setY(v); return p; ``` The map become like following ![alt text](https://i.stack.imgur.com/rtEAz.png) I think there's something wrong with Y calculations when they go way beyond negative values. I'm using Qt and cracks at line seems bug with Qt renderer, not related to our original problem.
Problem with bird's eye view or 2.5D rendering of Map
CC BY-SA 2.5
0
2010-09-05T19:51:01.910
2010-09-11T17:26:13.253
2017-05-23T12:13:31.967
-1
337,827
[ "dictionary", "geometry", "navigation" ]
3,647,676
1
3,648,683
null
0
99
I'm having trouble trying to understand what to do here. My objective isn't as simple as a regular old CRUD form to create a new entity, but rather a browse index page that will list all of the Evaluations in my database. Each evaluation is attached to a RegisteredCourse which in turn has a Teacher attached to it. Here is how I'd like to present the information: ![alt text](https://i.stack.imgur.com/LuOki.png) My table structure doesn't allow me to just invoke it simply, so I know I have to create a ViewModel to have my controller give my View something nice and useful. My question is how to create this ViewModel. I'm stumped because I've never tackled this sort of problem before. Thanks. Below is SQL schema if that helps. ``` create table Grado( ID int identity(1,1) primary key, Nombre varchar(64) ) create table Jefe( ID int identity(1,1) primary key, Nombre varchar(128), Apellido varchar(256) ) create table Area( ID int identity(1,1) primary key, IDJefe int foreign key references Jefe(ID), Nombre varchar(64) ) create table Carrera( ID int identity(1,1) primary key, IDArea int foreign key references Area(ID), Nombre varchar(64) ) create table Docente( ID int identity(1,1) primary key, IDCarrera int foreign key references Carrera(ID), IDGrado int foreign key references Grado(ID), Nombre varchar(128), Apellido varchar(256), Carnet varchar(20), FechaNacimiento datetime ) create table Materia( ID int identity(1,1) primary key, IDCarrera int foreign key references Carrera(ID), Nombre varchar(64) ) create table MateriaProgramada( ID int identity(1,1) primary key, IDMateria int foreign key references Materia(ID), IDDocente int foreign key references Docente(ID), Ano datetime, Semestre int, Modulo int ) create table Evaluador( ID int identity(1,1) primary key, Nombre varchar(256) ) create table Evaluacion( ID int identity(1,1) primary key, IDMateriaProgramada int foreign key references MateriaProgramada(ID), IDEvaluador int foreign key references Evaluador(ID), Tema int, Horario int, Secuencia int, Pizarra int, Audiovisuales int, Letra int, Voz int, Gestos int, Ejemplificacion int, Preguntas int, Dominio int, Participacion int, Observaciones varchar(2048), MateriasPosibles varchar(1024), ExigenciasAcademicas bit ) ```
Having trouble starting my very own MVC tutorial-sans web application
CC BY-SA 2.5
null
2010-09-05T20:28:47.663
2010-09-06T02:20:38.767
null
null
null
[ "c#", "asp.net", "asp.net-mvc-2", "viewmodel" ]
3,647,797
1
3,647,910
null
1
1,230
I have a question regarding this database design. I am a bit unsure of the difference between identifying and non-identifying relationships in a database leading me to some puzzles in my head. I have this database design: ![Sample.png](https://i.stack.imgur.com/VxqRn.png) I somewhat understand how it works. However, I was wondering what if I create a in the loan table, and use and as normal foreign keys? Some of my questions are: What are the advantages or disadvantages of the later approach? A situation where the initial or later model is better? Does the initial model enable a friend to borrow a movie more than once? Any thorough explanation would be much appreciated.
What would it mean If I change the identifying relationship from this part of a database design to a non-identifying relationship?
CC BY-SA 3.0
null
2010-09-05T21:03:04.353
2011-10-28T21:09:46.293
2011-10-28T21:09:46.293
757,830
374,399
[ "sql", "database", "database-design", "data-modeling" ]
3,647,821
1
3,721,880
null
1
4,178
In my Android app I use a TabWidget without any special customization. I'd like Android to take care of the specific appearance, which works fine if you compare Android 1.6 with 2.1 for example. By just using a TabWidget the same code leads to different forms of tabs because the SDK defines how to draw it. Here is how it looks on 2.1 for example: ![alt text](https://i.stack.imgur.com/cVYkn.jpg) So, the highlighted tab is gray and the font is white and you can read it quite well. But, if you have HTC Sense, it looks like this: ![alt text](https://i.stack.imgur.com/FOT4Q.jpg) The picture isn't that good, but just believe me that it's white text on white background which is not really that easy to read... My questions are: 1) Why does Android create a TabWidget with white on white text? I never defined either the text color or the background color, so the system is supposed to chose sensible colors. 2) I assume that other TabWidgets look just fine on HTC Sense, because otherwise it would be quite a big and popular problem. So why is my TabWidget having this problem and not others. 3) How can I fix this problem without changing the appearance on non Sense devices? As I said I did not customize the TabWidget in any way. Here is my definition: ``` <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@android:color/black" > <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="0dp" > <ScrollView android:id="@+id/shortenerScrollView" android:layout_height="fill_parent" android:layout_width="fill_parent" android:background="@android:color/black" android:fadingEdge="horizontal" > ``` So, besides defining black as my general background color of the app, there's no color or style defintion made. The only exception might be that I'm using standard Android ids for TabHost and TabWidget. /Edit: Here's the defintion of the tabs in the onCreate method: ``` th = getTabHost(); th.addTab(th.newTabSpec("shortener").setIndicator(getString(R.string.tabShortenerName), res.getDrawable(R.drawable.url_zip)).setContent(R.id.shortenerScrollView)); ``` The class extends a TabActivity. /Edit 2: The device that comes up with the white on white text is a HTC Legend running Android 2.1 btw. /Edit 3: dream3r was right. Changing the targetSdk value to 4 did the trick for me, too (before, it was set to 6)! I don't really get it, but I can live with that for now. :) Here's a picture of how it looks now: ![alt text](https://i.stack.imgur.com/dCy8Z.jpg)
Android: Highlighted tab of TabWidget not readable on HTC Sense
CC BY-SA 2.5
0
2010-09-05T21:10:58.157
2014-03-10T07:09:07.667
2010-09-18T10:07:52.330
388,826
388,826
[ "android", "layout", "colors", "tabwidget", "htcsense" ]
3,647,871
1
3,647,931
null
0
288
My website is in the root directory, which is `/www.lebmotor.com/web/content/`. I am using this: ``` Dim appPath As String = HttpContext.Current.Request.ApplicationPath Dim directory As String = appPath & "/upload/" & Left(TableName, 2) & "/" ``` to get the path and it's working very well. But when I create a new sub-folder and copy some pages from the root directory into the sub-folder, my images are not displayed because the path has changed. This is the link from the page in the root directory: > [http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM](http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM) and this is the link from the page in the sub-folder: > [http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM](http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM) So how can I make the link in the sub folder like this: > [http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM](http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM) --- Let me explain more about this. First, I have two directories and both of them have been set as application directories, as you can see here in the photo: ![](https://jhpdxa.blu.livefilestore.com/y1pZHEa9MdjD2tPnDqvdpI8rscYkILJ0FkwCuLWKKL50v_EGT_1bF7Sv4ZxvZehTh7n1eSyPcQ6JgDZIKVtnr2EphRN9WwWaIK3/HERE.png?psid=1) The `/ar` sub-folder is an application and it's a copy of the original one in the Content directory. In the `ar/App_code` there is a class with the name `MGImages.vp`, and course it's a copy of the original one in `Content/App_code`. This class' job is to display photos from the `Upload` sub folder. This is the code which will save the path of the photo: ``` Dim appPath As String = HttpContext.Current.Request.ApplicationPath Dim directory As String = appPath & "/upload/" & Left(TableName, 2) & "/" If ImageType.ToUpper = "TN" Then directory += "TN/" ElseIf ImageType.ToUpper = "LG" Then directory += "LG/" Else directory += "OT/" End If ``` This class is working very well in the `Content` directory because this will give me the right path: > [http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM](http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM) All photos should be saved in the `Content/Upload` folder for both directories' `Content/ar` But in the `ar` directory it will give me the wrong path: > [http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM](http://www.lebmotor.com/ar/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM) Where the goal is to make the path like this one: > [http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM](http://www.lebmotor.com/upload/VE/TN/6/VEListing-66-Photo1.jpg?ts=9/4/2010%201:45:17%20AM) I want it to display the photos from `Content/upload`, not from the `content/ar/upload`.
Why the links are not working when moving a page outside the root directory?
CC BY-SA 2.5
null
2010-09-05T21:26:58.810
2010-09-05T21:43:31.177
2017-02-08T14:30:20.200
-1
414,933
[ "asp.net", "vb.net", "path", "root" ]
3,647,970
1
3,648,000
null
2
596
Orginal CSS Code [http://www.faressoft.org/BlueCristalTheme/postView.php](http://www.faressoft.org/BlueCristalTheme/postView.php) ![alt text](https://i.stack.imgur.com/Yj26W.jpg) Result should be ![alt text](https://i.stack.imgur.com/4H0zf.jpg)
how to change height of div to covered the text area (CSS)
CC BY-SA 2.5
null
2010-09-05T21:53:19.873
2010-09-05T22:04:56.633
null
null
423,903
[ "css", "width" ]
3,648,324
1
3,648,332
null
0
114
How do I implement this menu in the iPhone SDK? ![http://www.simplemobilereview.com/wp-content/uploads/2010/03/iphone-way.jpg](https://i.stack.imgur.com/W7xW7.jpg)
How to implement a selection menu on the iPhone
CC BY-SA 3.0
null
2010-09-05T23:57:05.773
2011-11-27T07:47:29.063
2011-11-27T07:47:29.063
234,976
440,261
[ "iphone", "select", "sdk" ]
3,648,798
1
null
null
3
1,783
i have a CSS Drop Down Menu... what i am doing with this in a certain portion of my website is that i am using its links to call AJAX-jQuery to change the contents of a DIV on the page without reloading... ``` <script type="text/javascript"> function load_editor(id) { $('#myDIV').load('editor.php?id=' + id); } </script> <div class="mainmenu"> <ul> <li class="li_nc"><a href="javascript:load_editor('1')">Home</a></li> <li class="li_hc"><a href="#" >Programs</a><ul class="ul_ch"> <li class="li_hc"><a href="#" >Engineering</a><ul class="ul_ch"> <li class="li_nc"><a href="javascript:load_editor('2')" >BEE ( Electronics 4 Years )</a></li> <li class="li_nc"><a href="javascript:load_editor('3')" >BEE ( Tele Comm. 4 Years )</a></li> <!--and the following code is the usual CSS Drop Down Menu Code--> ``` well normally when we click the Drop Down Menu... we navigate to another Page but since i am not switching to another page... what happens is when i click a menu item it performs the JS but doesn't collapses, that is, it stays in the following is an screen-shot after a click ![alt text](https://i.stack.imgur.com/KZiQe.png) which is logical because the cursor is still there and when i will move the cursor it will go back to collapse state but i want to change its behavior such that when i click it collapses... ONE WAY is that when i click and the `#myDIV` is loaded with the required div... i load the Drop Down Menu Layer with itself (reload it)... BUT i am looking for an alternative so my question in simple words -
CSS Drop Down Menu - Stays HOVER state when clicked
CC BY-SA 2.5
null
2010-09-06T03:05:02.463
2010-09-06T08:09:57.427
2010-09-06T05:27:08.657
158,455
158,455
[ "html", "css", "jquery", "drop-down-menu" ]
3,648,831
1
3,649,924
null
3
124
I know there are plenty of resources on this but I'm having a tough time relating any of them to my situation so I was hoping someone could help me clarify how this works: Basically I have a model `Action`, (which gets created anytime a user does something that affects another user, like commenting on their article or voting on someones photo, for example), these actions will be listed in the users dashboard page as all the actions that have taken place that relate to them, like a stream... sort of like Github's "News Feed" ![Github's "News Feed"](https://i.stack.imgur.com/EAqmU.jpg) I've decided to go with creating a polymorphic association, here is what my model looks like: ``` class Action < ActiveRecord::Base belongs_to :instigator, :polymorphic => true belongs_to :victim, :polymorphic => true end ``` I used instigator and victim because anyone can create these actions, which in turn always affect another user, here is my `User` model ``` class User < ActiveRecord::Base has_many :actions, :as => :instigator has_many :actions, :as => :victim end ``` And this is where I'm going wrong, because ultimately I want to have a query which when I run something like `User.find(1).actions` to actually return all the instances in which the user is both an `instigator` or a `victim`, I think I can't have both of those `have_many`'s in there, because when used like this I only get the instances where the user is the `victim`. Here is my migration: ``` create_table :actions do |t| t.references :instigator, :polymorphic => true t.references :victim, :polymorphic => true t.string :action_performed t.references :resource, :polymorphic => true t.timestamps end ``` Thanks for any help, I always love the great suggestions and help the SO community gives.
Help understanding polymophic associations (rails)
CC BY-SA 2.5
0
2010-09-06T03:17:59.510
2010-09-06T15:57:28.417
2010-09-06T03:31:18.803
103,739
103,739
[ "ruby-on-rails" ]
3,648,917
1
3,649,035
null
5
8,549
I start using classifier for classification (Weka), however I have some problems to understand while training the data. The data set I'm using is weather.nominal.arff. ![alt text](https://i.stack.imgur.com/d7Q8n.png) While I use use training test from the options, the classifier result is: ``` Correctly Classified Instances 13 - 92.8571 % Incorrectly Classified Instances 1 - 7.1429 % a b classified as 9 0 a =yes 1 4 b = no ``` My first question what should I understand from the incorrect classified instances? Why such a problem occurred? which attribute collection is classified incorrect? is there a way to understand this? Secondly, when I try the 10 fold cross validation, why I get different (less) correctly classified instances? The results are: ``` Correctly Classified Instances 8 57.1429 % Incorrectly Classified Instances 6 42.8571 % a b <-- classified as 7 2 | a = yes 4 1 | b = no ```
interpreting Naive Bayes results
CC BY-SA 3.0
0
2010-09-06T03:54:23.017
2016-09-12T06:26:06.503
2012-12-05T13:52:22.353
453,596
169,895
[ "machine-learning", "classification", "weka" ]
3,648,926
1
8,438,768
null
0
2,078
I just started using Aptana Studio. The first thing I did was import my php from svn repository and install the PDT tools. But whenever I open the php file, it always displays following message. ![alt text](https://i.stack.imgur.com/QkpyH.png) I had the PHP perspective open when I tried opening the file. Also I checked the Content Types and File Associations, where PHP Content Type has `*.php` listed and `*.php` had the `PHP Editor` associated with it in the file associations. I even tried creating a new PHP project, then creating a new PHP file - couldn't even do that - nothing showed up. What am I missing over here? Regards
Aptana Studio php files not opening in PHP Editor
CC BY-SA 2.5
null
2010-09-06T03:59:08.453
2011-12-08T22:44:35.573
null
null
206,613
[ "php", "aptana" ]
3,649,485
1
3,649,538
null
59
148,785
I use `GZIPOutputStream` or `ZIPOutputStream` to compress a String (my `string.length()` is less than 20), but the compressed result is longer than the original string. On some site, I found some friends said that this is because my original string is too short, `GZIPOutputStream` can be used to compress longer strings. so, can somebody give me a help to compress a String? My function is like: ``` String compress(String original) throws Exception { } ``` Update: ``` import java.io.ByteArrayOutputStream; import java.io.IOException; import java.util.zip.GZIPOutputStream; import java.util.zip.*; //ZipUtil public class ZipUtil { public static String compress(String str) { if (str == null || str.length() == 0) { return str; } ByteArrayOutputStream out = new ByteArrayOutputStream(); GZIPOutputStream gzip = new GZIPOutputStream(out); gzip.write(str.getBytes()); gzip.close(); return out.toString("ISO-8859-1"); } public static void main(String[] args) throws IOException { String string = "admin"; System.out.println("after compress:"); System.out.println(ZipUtil.compress(string)); } } ``` The result is : ![alt text](https://i.stack.imgur.com/NUYbH.jpg)
How to compress a String in Java?
CC BY-SA 3.0
0
2010-09-06T06:40:09.163
2019-06-07T11:41:43.487
2015-11-28T12:05:38.443
1,351,298
421,851
[ "java", "string", "compression", "zip" ]
3,649,534
1
3,663,943
null
0
1,534
For some reason, the text has 0 width in the second row. ![alt text](https://i.stack.imgur.com/PGmLs.png) Code: ``` public LinearLayout getView(int position, View convertView, ViewGroup parent){ LinearLayout rowView; if(convertView==null){ rowView=(LinearLayout) mActivity.getLayoutInflater().inflate(R.layout.icon_list, null); }else{! rowView=(LinearLayout) convertView; } //Image view ImageView imageView=(ImageView) rowView.findViewById(R.id.list_icon); Pair<String,Bitmap> p=getItem(position); imageView.setImageBitmap(p.second); //Text view TextView textView=(TextView) rowView.findViewById(R.id.list_text); textView.setText("AAAA"); return rowView; } ``` XML: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="20dip" android:id="@+id/icon_list" android:padding="6dip"> <ImageView android:id="@+id/list_icon" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:layout_gravity="left"/> <TextView android:id="@+id/list_text" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="center_vertical"/> </LinearLayout> ``` Before I had accidentally left in the line. ``` android:src="@drawable/icon" ``` I removed it, but the problem remains
Android Listview - first item is different
CC BY-SA 2.5
0
2010-09-06T06:49:26.087
2010-09-08T01:14:18.510
2010-09-07T00:44:21.647
165,495
165,495
[ "android", "listview" ]
3,649,588
1
3,649,605
null
0
149
![alt text](https://i.stack.imgur.com/AlHvM.jpg) I'm confused what the line in bold means?
Anyone knows what does highlight mean in svn revision view of zend studio?
CC BY-SA 2.5
null
2010-09-06T06:56:36.353
2010-09-06T06:59:26.203
null
null
339,038
[ "svn", "zend-studio" ]
3,649,670
1
3,656,291
null
0
3,119
I have created a COM add-in for Excel 2003 using Visual Studio 2005 Tools for Office. The add-in code looks like this: ``` [Guid("EAC0992E-AC39-4126-B851-A57BA3FA80B8")] [ComVisible(true)] [ProgId("NLog4VBA.Logger")] [ClassInterface(ClassInterfaceType.AutoDual)] public class Logger { public double Debug(string context, string message) { Trace.WriteLine(message); return message.Length; } [ComRegisterFunctionAttribute] public static void RegisterFunction(Type type) { Registry.ClassesRoot.CreateSubKey(GetSubKeyName(type, "Programmable")); RegistryKey key = Registry.ClassesRoot.OpenSubKey(GetSubKeyName(type, "InprocServer32"), true); key.SetValue("", System.Environment.SystemDirectory + @"\mscoree.dll", RegistryValueKind.String); } [ComUnregisterFunctionAttribute] public static void UnregisterFunction(Type type) { Registry.ClassesRoot.DeleteSubKey(GetSubKeyName(type, "Programmable"), false); } private static string GetSubKeyName(Type type, string subKeyName) { System.Text.StringBuilder s = new System.Text.StringBuilder(); s.Append(@"CLSID\{"); s.Append(type.GUID.ToString().ToUpper()); s.Append(@"}\"); s.Append(subKeyName); return s.ToString(); } } ``` I've set the project to register for COM interop, and I've registered the DLL with: ``` regasm.exe /tlb NLog4VBA.dll ``` When I open Excel, I go to Tools -> Add-Ins, click Automation, and add NLog4VBA.Logger. I can then go to Insert -> Function, pick NLogVBA.Logger from the list of categories, and choose Debug. The end result is a cell with contents like: ``` =Debug("My Context","My Message") ``` ... and a displayed value of: ``` 10 ``` This is all as it should be. In my VBA code, I can go to Tools -> References and add NLog4VBA. I then add the following code to a button on my sheet: ``` Private Sub CommandButton1_Click() Application.COMAddIns("NLog4VBA.Logger").Object.Debug "My Context", "My Message" End Sub ``` This fails, because COMAddIns("NLog4VBA.Logger") fails with: ``` Run-time error '9': Subscript out of range ``` Could someone please tell me what I need to do to make the Debug() method accessible to my VBA code (which is more useful to me than being able to call the method from within a cell)? I'm sure I'm missing something simple here. I've updated the code snippet to include the [ProgId] attribute as suggested below by Jim; the problem persists. I can see the object in registry: ``` [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}] @="NLog4VBA.Logger" [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}\Implemented Categories] [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}] [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}\InprocServer32] @="C:\\WINDOWS\\system32\\mscoree.dll" "ThreadingModel"="Both" "Class"="NLog4VBA.Logger" "Assembly"="NLog4VBA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" "RuntimeVersion"="v2.0.50727" "CodeBase"="file:///C:/projects/nlog4vba/NLog4VBA/bin/Debug/NLog4VBA.dll" [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}\InprocServer32\1.0.0.0] "Class"="NLog4VBA.Logger" "Assembly"="NLog4VBA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" "RuntimeVersion"="v2.0.50727" "CodeBase"="file:///C:/projects/nlog4vba/NLog4VBA/bin/Debug/NLog4VBA.dll" [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}\ProgId] @="NLog4VBA.Logger" [HKEY_CLASSES_ROOT\CLSID\{EAC0992E-AC39-4126-B851-A57BA3FA80B8}\Programmable] ``` Also, the ProgID is visible in the Add-Ins dialog: ![Add-Ins dialog showing ProgID](https://i.stack.imgur.com/cmtA4.png) I still have no idea why this isn't working :-(
Accessing COM add-in code from VBA
CC BY-SA 2.5
null
2010-09-06T07:14:25.360
2010-09-07T06:40:05.443
2018-07-09T19:34:03.733
-1
181,452
[ "com", "excel", "vsto", "vba" ]
3,649,743
1
null
null
-4
156
i need to create a task list in the html page.using only css . i try using jquery,but it is not filled my requirement.for reference please check the image attached ![alt text](https://i.stack.imgur.com/aK4wl.png) thank you
creating chart with css and javascript
CC BY-SA 2.5
null
2010-09-06T07:34:08.897
2010-09-06T10:00:21.680
2010-09-06T10:00:21.680
318,493
70,900
[ "css" ]
3,649,889
1
null
null
2
376
`multiple photos``multiple videos``inline` So for example, I get `2 photos` a `video` and again a `photo`. I have a parent `news` table and 2 secondary table `news_photos` and `news_videos` and I want to get in `one query` the `photos` and `videos` for the `news`. Is this somehow possible? ``` mysql_query(" SELECT * FROM news_photos, news_videos FULL JOIN news_videos ON news_id = {$news_id} FULL JOIN news_photos ON news_id = {$news_id} "); ``` ![alt text](https://i.stack.imgur.com/Xt0VM.png)
MySQL: Multiple Photos and Videos for News with Joins
CC BY-SA 2.5
null
2010-09-06T08:04:39.513
2010-09-06T12:53:38.613
2010-09-06T12:53:38.613
380,562
380,562
[ "php", "mysql", "database", "join" ]
3,650,293
1
null
null
4
1,625
I often have lots of whitespace-only changes (spaces turning to tabs or vice versa etc.) and I generally don't care about these changes. I know that whitespace could be important (i.e. some whitespace changes can be breaking), but it would be very useful if there was a way to tell when looking at huge lists of files which ones contain whitespace changes only. Please I am not looking for the "you should never have that many files to check in" kind of response, I'm aware of that already - this is just the situation and I'd like some advice! Thanks. ![alt text](https://i.stack.imgur.com/B9a0X.png)
How can I make Tortoise SVN's commit dialog indicate non-whitespace versus whitespace-only changes?
CC BY-SA 2.5
0
2010-09-06T09:16:03.733
2014-03-12T17:28:30.603
null
null
64,519
[ "tortoisesvn", "whitespace" ]
3,650,354
1
3,650,370
null
20
10,355
i want to set first text on my UISearchBar -the text is "Search"-, and the text will disappear when user start typing. just like this: ![alt text](https://i.stack.imgur.com/fm1Mi.png) ![alt text](https://i.stack.imgur.com/T1RK2.png) how it could be.??? thanx
set first text on UISearchBar
CC BY-SA 2.5
0
2010-09-06T09:28:43.900
2016-05-19T16:41:43.647
null
null
408,434
[ "iphone", "objective-c", "uisearchbar" ]
3,650,595
1
3,685,105
null
0
1,734
I've written a small form that reads the data from a database table (SQL CE 3.5) and displays it in a DataGridView control. This works fine. I then modified it to make a change to the data before displaying it, which also seems to work fine with the exception that it doesn't seem to actually commit the changes to the database. The code is as follows: ``` using (SqlCeConnection conn = new SqlCeConnection( Properties.Settings.Default.Form1ConnectionString )) { conn.Open(); using (SqlCeDataAdapter adapter = new SqlCeDataAdapter( "SELECT * FROM People", conn )) { //Database update command adapter.UpdateCommand = new SqlCeCommand( "UPDATE People SET name = @name " + "WHERE id = @id", conn); adapter.UpdateCommand.Parameters.Add( "@name", SqlDbType.NVarChar, 100, "name"); SqlCeParameter idParameter = adapter.UpdateCommand.Parameters.Add( "@id", SqlDbType.Int); idParameter.SourceColumn = "id"; idParameter.SourceVersion = DataRowVersion.Original; //Create dataset DataSet myDataSet = new DataSet("myDataSet"); DataTable people = myDataSet.Tables.Add("People"); //Edit dataset adapter.Fill(myDataSet, "People"); people.Rows[0].SetField("name", "New Name!"); adapter.Update(people); //Display the table contents in the form datagridview this.dataGridView1.DataSource=people; } } ``` The form displays like so: ![alt text](https://i.stack.imgur.com/P0tpE.png) Looking at the table via Visual Studio's Server Explorer however, doesn't show any change to the table. What am I doing wrong?
Cannot commit DataSet changes to database
CC BY-SA 2.5
null
2010-09-06T10:09:27.527
2015-06-15T19:04:13.480
null
null
41,348
[ "c#", "visual-studio-2008" ]
3,650,862
1
15,821,706
null
70
25,879
I would like to know if it is possible to get a profile from `R`-Code in a way that is similar to `matlab`'s Profiler. That is, to get to know which line numbers are the one's that are especially slow. What I acchieved so far is somehow not satisfactory. I used `Rprof` to make me a profile file. Using `summaryRprof` I get something like the following: > ``` $by.self self.time self.pct total.time total.pct [.data.frame 0.72 10.1 1.84 25.8 inherits 0.50 7.0 1.10 15.4 data.frame 0.48 6.7 4.86 68.3 unique.default 0.44 6.2 0.48 6.7 deparse 0.36 5.1 1.18 16.6 rbind 0.30 4.2 2.22 31.2 match 0.28 3.9 1.38 19.4 [<-.factor 0.28 3.9 0.56 7.9 levels 0.26 3.7 0.34 4.8 NextMethod 0.22 3.1 0.82 11.5 ... ``` and > ``` $by.total total.time total.pct self.time self.pct data.frame 4.86 68.3 0.48 6.7 rbind 2.22 31.2 0.30 4.2 do.call 2.22 31.2 0.00 0.0 [ 1.98 27.8 0.16 2.2 [.data.frame 1.84 25.8 0.72 10.1 match 1.38 19.4 0.28 3.9 %in% 1.26 17.7 0.14 2.0 is.factor 1.20 16.9 0.10 1.4 deparse 1.18 16.6 0.36 5.1 ... ``` To be honest, from this output I don't get where my bottlenecks are because (a) I use `data.frame` pretty often and (b) I never use e.g., `deparse`. Furthermore, what is `[`? So I tried Hadley Wickham's `profr`, but it was not any more useful considering the following graph: ![alt text](https://i.stack.imgur.com/YIm0J.png) Any hints appreciated. Based on Hadley's comment I will paste the code of my script below and the base graph version of the plot. But note, that my question is not related to this specific script. It is just a random script that I recently wrote. `R` The data (`x`) looks like this: > ``` type word response N Classification classN Abstract ANGER bitter 1 3a 3a Abstract ANGER control 1 1a 1a Abstract ANGER father 1 3a 3a Abstract ANGER flushed 1 3a 3a Abstract ANGER fury 1 1c 1c Abstract ANGER hat 1 3a 3a Abstract ANGER help 1 3a 3a Abstract ANGER mad 13 3a 3a Abstract ANGER management 2 1a 1a ... until row 1700 ``` The script (with short explanations) is this: > ``` Rprof("profile1.out") # A new dataset is produced with each line of x contained x$N times y <- vector('list',length(x[,1])) for (i in 1:length(x[,1])) { y[[i]] <- data.frame(rep(x[i,1],x[i,"N"]),rep(x[i,2],x[i,"N"]),rep(x[i,3],x[i,"N"]),rep(x[i,4],x[i,"N"]),rep(x[i,5],x[i,"N"]),rep(x[i,6],x[i,"N"])) } all <- do.call('rbind',y) colnames(all) <- colnames(x) # create a dataframe out of a word x class table table_all <- table(all$word,all$classN) dataf.all <- as.data.frame(table_all[,1:length(table_all[1,])]) dataf.all$words <- as.factor(rownames(dataf.all)) dataf.all$type <- "no" # get type of the word. words <- levels(dataf.all$words) for (i in 1:length(words)) { dataf.all$type[i] <- as.character(all[pmatch(words[i],all$word),"type"]) } dataf.all$type <- as.factor(dataf.all$type) dataf.all$typeN <- as.numeric(dataf.all$type) # aggregate response categories dataf.all$c1 <- apply(dataf.all[,c("1a","1b","1c","1d","1e","1f")],1,sum) dataf.all$c2 <- apply(dataf.all[,c("2a","2b","2c")],1,sum) dataf.all$c3 <- apply(dataf.all[,c("3a","3b")],1,sum) Rprof(NULL) library(profr) ggplot.profr(parse_rprof("profile1.out")) ``` Final data looks like this: > ``` 1a 1b 1c 1d 1e 1f 2a 2b 2c 3a 3b pa words type typeN c1 c2 c3 pa 3 0 8 0 0 0 0 0 0 24 0 0 ANGER Abstract 1 11 0 24 0 6 0 4 0 1 0 0 11 0 13 0 0 ANXIETY Abstract 1 11 11 13 0 2 11 1 0 0 0 0 4 0 17 0 0 ATTITUDE Abstract 1 14 4 17 0 9 18 0 0 0 0 0 0 0 0 8 0 BARREL Concrete 2 27 0 8 0 0 1 18 0 0 0 0 4 0 12 0 0 BELIEF Abstract 1 19 4 12 0 ``` The base graph plot: ![alt text](https://i.stack.imgur.com/FtbVh.png) [Running the script today also changed the ggplot2 graph a little (basically only the labels), see here.](https://imgur.com/8grk7.png)
How to efficiently use Rprof in R?
CC BY-SA 2.5
0
2010-09-06T10:50:15.633
2015-09-23T14:50:31.683
2010-09-07T13:49:23.630
289,572
289,572
[ "r", "profiling", "profiler" ]
3,651,005
1
3,651,068
null
0
1,455
I want to show hidden `div` on hover of `<div class="thumb">` and i have multiple `div` on page each thumb `div` has different content images. `width` is fix for all `div` but `height` of large div `<div class="large" style="display:none">` can be extended upon content after the image inside div. Text of `h2` will be always the same in both `div`. If mouse is inside <`div class="large"></div>` then the `div` should stay on screen. ``` <!----------------- Small Boxes -----------------> <div class="thumb"> <h2>Box1</h2> <img src="test_files/images/thumbnail/thumb1.png" /> </div> <!----------------- Large Boxes on hover -----------------> <div class="large" style="display:none"> <h2>Box1</h2> <h3>Heading 3 (this text will come over the image)</h3> <img src="test_files/images/large/large1.png" /> <p> Lorem ipsum Lorem ipsum Lorem ipsum Lorem ipsum </p> </div> ``` I just given a example of one `div` but in actual I will have multiple boxes on actual page. ![alt text](https://i.stack.imgur.com/ZWnQf.jpg) In actual page I will have multiple boxe like this ![alt text](https://i.stack.imgur.com/fYJQm.jpg)
How to show hidden div on mouse over using jquery?
CC BY-SA 2.5
null
2010-09-06T11:18:47.593
2010-09-06T12:43:37.280
2010-09-06T11:25:04.130
84,201
84,201
[ "javascript", "jquery", "css", "xhtml" ]
3,651,401
1
3,656,365
null
7
10,530
I've got the below screen that contains some images (6 per visible page). Scrolling up and down seems quite laggy to me. It's like it's rendering the images again. Scrolling back up seems worse than scrolling down. Anyone know how to increase performance in such an area to create a nice smooth scroll? : The images and text is all retrieved from my SQLite database. The list is created using SimpleCursorAdapter. ![Gallery](https://i.stack.imgur.com/pMhDh.png) ``` private class HistoryViewBinder implements SimpleCursorAdapter.ViewBinder { //private int wallpaperNumberIndex; private int timeIndex; private int categoryIndex; private int imageIndex; private java.text.DateFormat dateFormat; private java.text.DateFormat timeFormat; private Date d = new Date(); public HistoryViewBinder(Context context, Cursor cursor) { dateFormat = android.text.format.DateFormat.getDateFormat(context); timeFormat = android.text.format.DateFormat.getTimeFormat(context); //wallpaperNumberIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_WALLPAPER_NUMBER); timeIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_TIME); categoryIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_CATEGORY); imageIndex = cursor.getColumnIndexOrThrow(HistoryDatabase.KEY_IMAGE); } @Override public boolean setViewValue(View view, Cursor cursor, int columnIndex) { Log.d(TAG, "setViewValue"); if (view instanceof TextView) { Log.d(TAG, "TextView"); TextView tv = (TextView) view; if (columnIndex == timeIndex) { Log.d(TAG, "timeIndex"); d.setTime(cursor.getLong(columnIndex)); tv.setText(timeFormat.format(d) + " " + dateFormat.format(d)); return true; } else if (columnIndex == categoryIndex) { Log.d(TAG, "categoryIndex"); tv.setText(cursor.getString(columnIndex)); return true; } } else if (view instanceof ImageView) { Log.d(TAG, "ImageView"); ImageView iv = (ImageView) view; if (columnIndex == imageIndex) { Log.d(TAG, "imageIndex"); byte[] image = cursor.getBlob(columnIndex); Bitmap bitmapImage = BitmapFactory.decodeByteArray(image, 0, image.length); iv.setImageBitmap(bitmapImage); return true; } } return false; } } ```
Scrolling through ListView with some images very laggy
CC BY-SA 2.5
0
2010-09-06T12:21:41.460
2014-08-07T10:59:12.603
2012-01-27T08:43:36.810
114,066
149,166
[ "android", "performance", "android-listview" ]
3,651,497
1
null
null
6
4,301
Note: I am aware that the activity property `android:windowSoftInputMode="adjustResize|adjustResize|adjustUnspecified"` exists, as described here [http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft](http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft) , but in my case it doesn't seem to have any effect. This is my problem: I have two activities, pretty much the same layout, but the first one is using a . The second activity holds a . The rest is the same, same number of buttons, same height of elements, etc. Now, when I press the search button to open the search input bar, in This is actually how I want it to behave. How can I achieve the same with my activity that's using the ListView? In my manifest, initially I didn't specify any `android:windowSoftInputMode` attribute, but even if I do, it doesn't make any difference; I tried all three values (adjustPan, adjustResize, adjustUndefined, without any difference). This is my layout: 1) [http://pastebin.com/5zzVxjbK](http://pastebin.com/5zzVxjbK) 2) [http://pastebin.com/KFtPuHvP](http://pastebin.com/KFtPuHvP) ![alt text](https://i.stack.imgur.com/UNXPz.png)
How does Android determine whether to move the layout up when showing the softkeyboard?
CC BY-SA 2.5
0
2010-09-06T12:37:14.843
2011-04-17T15:42:33.827
2010-09-06T13:56:37.820
241,475
241,475
[ "android", "android-manifest" ]
3,651,561
1
3,651,594
null
2
338
I have a list of students that are being added via a form inside the admin area. I'm trying to come up with a password generating solution for each addition that will be both secure and viewable from the admin panel (like below). ![alt text](https://i.stack.imgur.com/Dp5Ci.jpg) I need it to be viewable so that the admin will be able to print out the passwords and hand them out to the parents. But I also want them to be secure in case there's a database breach. Any ideas?
How to generate secure passwords for new users?
CC BY-SA 2.5
null
2010-09-06T12:48:26.380
2010-10-25T04:30:07.240
2010-09-06T13:09:56.470
244,296
161,619
[ "php", "mysql", "database", "encryption", "passwords" ]
3,651,737
1
null
null
32
12,602
I'm working on some `SocketChannel`-to-`SocketChannel` code which will do best with a direct byte buffer--long lived and large (tens to hundreds of megabytes per connection.) While hashing out the exact loop structure with `FileChannel`s, I ran some micro-benchmarks on `ByteBuffer.allocate()` vs. `ByteBuffer.allocateDirect()` performance. There was a surprise in the results that I can't really explain. In the below graph, there is a very pronounced cliff at the 256KB and 512KB for the `ByteBuffer.allocate()` transfer implementation--the performance drops by ~50%! There also seem sto be a smaller performance cliff for the `ByteBuffer.allocateDirect()`. (The %-gain series helps to visualize these changes.) ![The Pony Gap](https://i.stack.imgur.com/NvnhU.png) `ByteBuffer.allocate()``ByteBuffer.allocateDirect()` What exactly is going on behind the curtain? It very well maybe hardware and OS dependent, so here are those details: - - - Source code, by request: ``` package ch.dietpizza.bench; import static java.lang.String.format; import static java.lang.System.out; import static java.nio.ByteBuffer.*; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.channels.Channels; import java.nio.channels.ReadableByteChannel; import java.nio.channels.WritableByteChannel; public class SocketChannelByteBufferExample { private static WritableByteChannel target; private static ReadableByteChannel source; private static ByteBuffer buffer; public static void main(String[] args) throws IOException, InterruptedException { long timeDirect; long normal; out.println("start"); for (int i = 512; i <= 1024 * 1024 * 64; i *= 2) { buffer = allocateDirect(i); timeDirect = copyShortest(); buffer = allocate(i); normal = copyShortest(); out.println(format("%d, %d, %d", i, normal, timeDirect)); } out.println("stop"); } private static long copyShortest() throws IOException, InterruptedException { int result = 0; for (int i = 0; i < 100; i++) { int single = copyOnce(); result = (i == 0) ? single : Math.min(result, single); } return result; } private static int copyOnce() throws IOException, InterruptedException { initialize(); long start = System.currentTimeMillis(); while (source.read(buffer)!= -1) { buffer.flip(); target.write(buffer); buffer.clear(); //pos = 0, limit = capacity } long time = System.currentTimeMillis() - start; rest(); return (int)time; } private static void initialize() throws UnknownHostException, IOException { InputStream is = new FileInputStream(new File("/Users/stu/temp/robyn.in"));//315 MB file OutputStream os = new FileOutputStream(new File("/dev/null")); target = Channels.newChannel(os); source = Channels.newChannel(is); } private static void rest() throws InterruptedException { System.gc(); Thread.sleep(200); } } ```
Why the odd performance curve differential between ByteBuffer.allocate() and ByteBuffer.allocateDirect()
CC BY-SA 2.5
0
2010-09-06T13:15:23.833
2014-08-24T13:52:00.557
2010-09-06T15:34:06.170
2,961
2,961
[ "java", "nio", "bytebuffer" ]
3,652,128
1
3,654,480
null
1
1,735
I've just downloaded the dynamic object framework [Clay](http://clay.codeplex.com/) and am running into issues regarding [castle project](http://www.castleproject.org/container/index.html) versions. Clay uses functionality from v2.0 of "castle" whilst I have a project which has been started referencing v2.5. Needless to say just to make matters more interesting I'm a complete beginner in all things "Castle" and IoC. The real problem is that upgrading the references within clay solution results in a depreciated method warning. Regardless of whether you supress the method or not, the provided unit tests fail with a "Cannot perform runtime binding on a null reference" exception in the following code in "Intercept" of "InterfaceProxyBehavior": ``` var invoker = BindInvoker(invocation); invoker(invocation); ``` The code that produces the run-time warning is in "CreateInstance" of "DefaultClayActivator": ``` //var proxyType = _builder.CreateClassProxy(baseType, options); var proxyType = _builder.CreateClassProxyType(baseType, null, options); ``` As previously stated I'm still a complete beginner with Castle Windsor and just starting out with IoC so haven't even come across the Proxy stuff yet. Frustratingly I have no idea what the error message is even telling me, or asking for. Have anyone already ported Clay across to version 2.5 of the castle project, so know the steps needed. Or can any one with experience of this part of castle throw anymore light on the error and what I may need to do to resolve it. I'm still not really any the wiser as to the functionality that is failing, but have had chance to revisit the code running it both with v2.0 (works) and v2.5 (breaks) in castle.core. Attached are two images of the debug information when it works and then when it breaks. The test that it fails on is below, I've indicated the call with a comment. ``` namespace ClaySharp.Tests { [TestFixture] public class BinderFallbackTests { ... [Test] public void TestInvokePaths() { var dynamically = ClayActivator.CreateInstance<Alpha>(new IClayBehavior[] { new InterfaceProxyBehavior(), new AlphaBehavior() }); Alpha statically = dynamically; IAlpha interfacially = dynamically; Assert.That(dynamically.Hello(), Is.EqualTo("World-")); Assert.That(statically.Hello(), Is.EqualTo("World-")); Assert.That(interfacially.Hello(), Is.EqualTo("World-")); // <- Fails on this call Assert.That(dynamically.Foo(), Is.EqualTo("Bar-")); Assert.That(interfacially.Foo(), Is.EqualTo("Bar-")); Assert.Throws<RuntimeBinderException>(() => dynamically.MissingNotHandled()); } ... } } ``` This is the debug information when using v2.5 of castle.core and the exception is thrown: ![alt text](https://i.stack.imgur.com/w2i4H.png) This is the debug information using v2.0 of castle.core (which works) for the same call / line that causes the problem with v2.5 ![alt text](https://i.stack.imgur.com/WNNwj.png)
Clay and Castle Windsor 2.5
CC BY-SA 2.5
0
2010-09-06T14:10:33.200
2011-02-21T09:25:06.403
2010-09-08T14:49:09.433
385,544
385,544
[ "c#", "dynamic", ".net-4.0", "castle-windsor" ]
3,652,419
1
3,652,438
null
0
69
How do I clean up the toolbars (see the figure) from the UI of NetBeans? ![alt text](https://i.stack.imgur.com/kQfdt.gif)
Cleaning up the UI of NetBeans
CC BY-SA 2.5
null
2010-09-06T14:59:56.153
2010-09-06T15:01:53.457
null
null
200,145
[ "user-interface", "netbeans" ]
3,652,818
1
3,652,928
null
1
1,121
my `<fb:request-form>` show incorrect size (width). here is my code: ``` <fb:serverFbml style="width:600px;"> <script type="text/fbml"> <fb:fbml> <fb:request-form action="<?= BASE_URL; ?>/pages/eid/inc/_send_card.php?ctid=<?= $card_type_id; ?>" target="_top" method="POST" invite="true" type="Muslimsquare Gift Card" content="<?= $name; ?> ได้ส่งของขวัญเนื่องในวันอีดิ้ลฟิตรี่ให้กับคุณ โดยหวังว่าคุณจะตอบรับของขวัญของเขา คลิกปุ่ม Accept เพื่อตอบรับของขวัญจาก <?= $name; ?> และส่งของขวัญให้คนอื่นๆต่อไป <fb:req-choice url='http://www.muslimsquare.com/applications/pages/eid/acp_gift.php?uid=<?= $uid; ?>' label='Accept' />" <fb:multi-friend-selector showborder="false" actiontext="เลือกเพื่อนที่คุณต้องการส่งของขวัญให้"> </fb:request-form> </fb:fbml> </script> </fb:serverFbml> ``` But when it show in iframe application. it is about `width:964px;` and my iframe application display some stupid scrollbar like : ![alt text](https://i.stack.imgur.com/z6roJ.png) How can I fix this issue?
<fb:request-form> show as not correct size
CC BY-SA 2.5
0
2010-09-06T16:06:45.363
2010-11-22T11:56:46.053
2010-09-06T16:09:59.927
222,159
286,090
[ "css", "facebook", "fbml" ]
3,652,982
1
3,653,050
null
2
2,996
Using ReSharper, I occasionally get quick-fix suggestions for importing a namespace for a LINQ operation. So given the following code in a brand-new class: ``` linqToSqlDataContext.Customers.Count(); ``` I get a quick-fix drop down as follows: ![alt text](https://i.stack.imgur.com/Imm0s.png) Which should I choose, and what is the difference between them?
Difference between System.Linq.Dynamic and System.Linq?
CC BY-SA 2.5
0
2010-09-06T16:38:31.353
2018-12-08T00:11:26.230
null
null
26,414
[ "c#", "linq" ]
3,653,288
1
3,653,352
null
1
110
> [Need help with a SQL query that combines adjacent rows into a single row](https://stackoverflow.com/questions/1132560/need-help-with-a-sql-query-that-combines-adjacent-rows-into-a-single-row) So this is how my table looks. ![alt text](https://i.stack.imgur.com/CoCro.jpg) ..and I need to write a query to get the output like this: ![alt text](https://i.stack.imgur.com/GXlrh.jpg) This is not a homework question.
Help writing SQL query
CC BY-SA 2.5
0
2010-09-06T17:34:27.303
2010-09-06T19:46:12.543
2020-06-20T09:12:55.060
-1
338,292
[ "sql", "sql-server", "tsql", "pivot" ]
3,653,431
1
null
null
2
695
![alt text](https://i.stack.imgur.com/VKv67.png) ![alt text](https://i.stack.imgur.com/gr0tq.png) ![alt text](https://i.stack.imgur.com/nMAfe.png) ![alt text](https://i.stack.imgur.com/GlyVv.png) I want to display image in center and top and bottom in same size refer bellow screens,anybody know please give the code to me... Thanks All
how to set image's top and bottom in same size for android?
CC BY-SA 2.5
null
2010-09-06T18:05:56.490
2010-09-06T23:03:48.770
2010-09-06T18:07:42.870
21,234
410,757
[ "android", "imageview" ]
3,653,594
1
3,657,126
null
1
820
I randomly get this error, and I can't figure out a way to fix it: the variables pane (top right) is blank, and the gdb "po" command can't print any variables. ![Debugger with no variables](https://i.stack.imgur.com/2deZ7.png) The "po" command doesn't even know about "self": ![No po either.](https://i.stack.imgur.com/P93hs.png) The problem appears specifically for methods in the `MGMinimap` class. Nowhere else. I can debug from A and see `self` and the others, and then as soon as A steps into `MGMinimap`, the variables pane goes blank like the above image, and gdb doesn't work at all. The temporary solution to this problem is to create a new class in XCode called e.g. `MGMinimapNew`, copy-paste everything from the real class's .h and .m into the new class, renaming the old class files to e.g. `MGMinimapOld.m|h`, then renaming the new class to `MGMinimap.m|h`. Doing this, things start working again. Still looking for a answer though. in answer to - - - - - - - -
"no symbol XXX in current context" for specific classes in debugging of XCode ip* project
CC BY-SA 2.5
0
2010-09-06T18:30:27.077
2010-09-07T08:44:42.983
2010-09-07T08:41:43.813
271,166
271,166
[ "iphone", "xcode", "debugging", "ipad", "variables" ]
3,653,788
1
3,653,850
null
29
80,712
I have SSH access to 'public' server, which is also the gateway to company network. There is another server in the network, where Oracle Database server is running (There is no access from outside of this server, only localhost DB connections are accepted). And of course, I have another SSH access to this server. Is there any way to join to this Oracle Database 11g Server from outside of the network ? I am asking if there is something like ssh tunnel chain, and how i configure it. This can be usefull, for example, for TOAD for Oracle (ORACLE client). Here is image ![alt text](https://i.stack.imgur.com/vrfxt.png) Thanks
How can I connect to Oracle Database 11g server through ssh tunnel chain (double tunnel, server in company network)?
CC BY-SA 3.0
0
2010-09-06T19:10:01.867
2020-08-13T17:48:56.227
2014-01-19T18:04:25.640
400,571
400,571
[ "oracle", "ssh", "database-connection", "ssh-tunnel" ]
3,654,220
1
3,654,231
null
20
9,959
I'm trying to draw an image, with a source `Bitmap` and an alpha mask `Bitmap`, using the `System.Drawing.Graphics` object. At the moment I loop X and Y and use `GetPixel` and `SetPixel` to write the source color and mask alpha to a third `Bitmap`, and then render that. However this is very inefficient and I am wondering if there is an faster way to achieve this? The effect I'm after looks like this: ![Effect I’m after](https://i.stack.imgur.com/jEiKw.png) The grid pattern represents transparency; you probably knew that.
Alpha masking in c# System.Drawing?
CC BY-SA 2.5
0
2010-09-06T20:48:32.543
2011-09-29T14:47:03.547
2010-09-06T21:11:09.407
252,817
252,817
[ "c#", "alpha", "masking" ]
3,654,737
1
3,654,783
null
0
234
How to create new wordpress widgets for my themes ? ![alt text](https://i.stack.imgur.com/eGd4r.jpg)
How to create new wordpress widgets for my themes
CC BY-SA 2.5
null
2010-09-06T23:01:31.677
2016-01-29T12:43:03.310
null
null
423,903
[ "wordpress-theming", "wordpress" ]
3,655,059
1
3,655,064
null
70
261,916
Let's say following is the directory structure of my website : ![DIR STRUCTURE](https://i.stack.imgur.com/0ityY.png) Now in `index.html` I can simply refer images like: ``` <img src="./images/logo.png"> ``` But I want to refer the same image from `sub.html`. What should be the `src`?
Pick images of root folder from sub-folder
CC BY-SA 4.0
0
2010-09-07T00:39:00.870
2020-06-12T17:10:04.353
2019-08-12T10:40:28.140
4,157,124
158,455
[ "html", "reference", "directory", "src", "subdirectory" ]
3,655,209
1
4,917,365
null
5
1,179
Analysis of Zend_Log reveals following Class Diagram - - - - - ![alt text](https://i.stack.imgur.com/hPy6D.jpg) 1. Zend_Log_Filter_Interface relates with Zend_Log_Filter_Suppress, Zend_Log_Filter_Message & Zend_Log_Filter_Priority as depicted, is this correctly laid out in Class Diagram? 2. Is it okay to say that, the Zend_Log contains reference to array of Zend_Log_Filter_Interface and this is composition relationship (similarly for Zend_Log_Writer_Abstract)? 3. As it is obvious that Zend_Log_Filter_Interface is contained by both Zend_Log & Zend_Log_Writer_Abstract, while Zend_Log contains Zend_Log_Writer_Abstract, that makes Zend_Log_Filter referenced by both container (Zend_Log) and contained (Zend_Log_Writer_Abstract); is that some "Design Pattern", if yes what is the name? Regards!
Is UML Class Diagram of Zend_Log correct?
CC BY-SA 2.5
0
2010-09-07T01:30:38.950
2011-02-07T01:01:50.497
null
null
166,910
[ "zend-framework", "class", "uml", "class-diagram", "zend-log" ]
3,655,310
1
3,655,328
null
1
60
How would code this in css and html? Should I do it with absolute? Or float it somehow? Any Ideas? ![alt text](https://i.stack.imgur.com/mmi3F.png)
Image with images around it in css
CC BY-SA 2.5
null
2010-09-07T02:07:37.353
2013-02-12T13:58:13.937
2013-02-12T13:58:13.937
274,350
348,843
[ "html", "css", "image" ]
3,655,340
1
3,655,403
null
1
318
``` <input type='text' name='one' id='oneID' maxlength="150"> ``` i need the JS to display the number of characters left that user can input ![alt text](https://i.stack.imgur.com/yHDGd.png) a picture is worth a 1000 words so no more explanation required...
HTML - Text Box - JS Function for Characters Left like SO
CC BY-SA 2.5
0
2010-09-07T02:16:43.407
2010-09-07T03:46:06.070
2010-09-07T02:29:49.483
158,455
158,455
[ "html", "webforms", "textbox", "limit" ]
3,655,316
1
3,658,735
null
86
110,257
I'm having trouble with loading CSS and images and creating links to other pages when I have a servlet forward to a JSP. Specifically, when I set my `<welcome-file>` to `index.jsp`, the CSS is being loaded and my images are being displayed. However, if I set my `<welcome-file>` to `HomeServlet` which forwards control to `index.jsp`, the CSS is not being applied and my images are not being displayed. My CSS file is in `web/styles/default.css`. My images are in `web/images/`. I'm linking to my CSS like so: ``` <link href="styles/default.css" rel="stylesheet" type="text/css" /> ``` I'm displaying my images as follows: ``` <img src="images/image1.png" alt="Image1" /> ``` How is this problem caused and how can I solve it? --- : I've added the structure of the application, as well as some other information that might help. ![alt text](https://i.stack.imgur.com/nf0zO.png) The `header.jsp` file is the file that contains the link tag for the CSS. The `HomeServlet` is set as my `welcome-file` in `web.xml`: ``` <welcome-file-list> <welcome-file>HomeServlet</welcome-file> </welcome-file-list> ``` The servlet is declared and mapped as followes in the `web.xml`: ``` <servlet> <servlet-name>HomeServlet</servlet-name> <servlet-class>com.brianblog.frontend.HomeServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>HomeServlet</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> ``` --- : I found the problem finally - my servlet was mapped incorrectly. Apparently when setting a Servlet as your `<welcome-file>` it can't have a URL pattern of `/`, which I find sort of weird, because wouldn't that stand for the root directory of the site? The new mapping is as follows: ``` <servlet-mapping> <servlet-name>HomeServlet</servlet-name> <url-pattern>/HomeServlet</url-pattern> </servlet-mapping> ```
Browser can't access/find relative resources like CSS, images and links when calling a Servlet which forwards to a JSP
CC BY-SA 3.0
0
2010-09-07T02:09:28.277
2020-04-26T02:35:08.500
2017-08-20T11:09:22.983
157,882
221,564
[ "css", "image", "jsp", "servlets" ]
3,655,552
1
3,655,656
null
16
3,011
I'd like design a chart and set the colors from a single exemplar. Same way as in Excel's: ![alt text](https://i.stack.imgur.com/jcFfd.png) Is there some sort of a formula or algorithm to generate the next shade of color from a given shade or color?
How can I generate multiple shades from a given base color?
CC BY-SA 3.0
0
2010-09-07T03:26:58.223
2011-06-03T13:07:38.473
2011-06-03T13:07:38.473
33,732
129,663
[ "delphi", "colors" ]
3,655,733
1
3,655,792
null
5
426
Is there a `<hr></hr>` like in winforms? I just saw this line in a property window of an icon, is it a control or what? How can I add it into my form? Please see image: ![alt text](https://i.stack.imgur.com/QeWQE.jpg)
Is this a control? (C# Winforms)
CC BY-SA 2.5
null
2010-09-07T04:18:59.283
2010-09-07T06:09:14.363
2010-09-07T04:21:26.553
2,598
396,335
[ "c#", "winforms" ]
3,655,811
1
3,656,058
null
1
10,775
I have fieldset and legend. fieldset border is coming in the middle of the legend like below ![alt text](https://i.stack.imgur.com/i8Yvm.jpg) But I want border like below ![alt text](https://i.stack.imgur.com/1RYva.jpg) I am using below css. ``` .fieldSet { width: 97%; margin-left: 10px; border-color: #003366; } .legendStyle { border-style:none; background-color: #003366; font-family: Tahoma, Arial, Helvetica; font-weight: bold; font-size: 9.5pt; Color: White; width:30%; padding-left:10px; } ```
How to set fieldset border from legend bottom?
CC BY-SA 2.5
null
2010-09-07T04:35:54.580
2011-06-10T20:18:53.490
2011-06-10T20:18:53.490
213,269
158,008
[ "css", "forms", "stylesheet", "legend", "fieldset" ]
3,655,903
1
null
null
4
109
Sorry for my English. A friend of mine asked me to help him to build a HTML page. I just know a little bit of CSS, and know absolutely nothing about JavaScript or jQuery. All the code I wrote was from Google. You can get what I really want in the picture, and I just finish the first step, the rollover animation works now, you can download the zip file here([http://www.hitbang.cn/stackoverflow.zip](http://www.hitbang.cn/stackoverflow.zip)). ![alt text](https://i.stack.imgur.com/xeHs3.jpg) But I can't animate the color of the text at the same time ,and the picture and text's layout is the second problem that I need your help to overcome, CSS layout is so complicated! Here is part of my code ,and you can download the whole code, if you help me correct my code, you can email me. ``` <div id="rightsidebar"> <div id="yuepingTitle"> </div> <div id="reviewContent"> <ul id="reviewList"> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#">6</a></li> <li><a href="#">7</a></li> </ul> </div> </div> ``` Javascript ``` $(function(){ $('#reviewList a') .css( {backgroundPosition: "0px 0px"} ) .mouseover(function(){ $(this).stop().animate({backgroundPosition:"(0px -692px)"}, {duration:300}) }) .mouseout(function(){ $(this).stop().animate({backgroundPosition:"(0px 0px)"}, {duration:200, complete:function(){ $(this).css({backgroundPosition: "0px 0px"}) }}) }) }); ``` CSS: ``` ul#reviewList {list-style:none;margin:0 ;padding:18px 0px 0px 6px;} ul#reviewList li {width:266px;float:left;margin:0px 0px 1px 0px;padding:0;} ul#reviewList li a {display:block;height:106px;color:#FFF;text-decoration:none;} ul#reviewList a {background:url(img/1.jpg) no-repeat 0px 0px;} ```
CSS and JavaScript problem
CC BY-SA 2.5
null
2010-09-07T04:59:27.413
2010-09-07T05:15:39.297
2010-09-07T05:08:19.973
383,547
383,547
[ "javascript", "jquery", "css" ]
3,655,979
1
3,656,819
null
0
909
I've got a little objective-c utility program that renders a convex hull. (This is to troubleshoot a bug in another program that calculates the convex hull in preparation for spatial statistical analysis). I'm trying to render a set of triangles, each with an outward-pointing vector. I can get the triangles without problems, but the vectors are driving me crazy. I'd like the vectors to be simple cylinders. The problem is that I can't just declare coordinates for where the top and bottom of the cylinders belong in 3D (e.g., like I can for the triangles). I have to make them and then rotate and translate them from their default position along the z-axis. I've read a ton about Euler angles, and angle-axis rotations, and quaternions, most of which is relevant, but not directed at what I need: most people have a set of objects and then need to rotate the object in response to some input. I need to place the object correctly in the 3D "scene". I'm using the [Cocoa3DTutorial](http://c3dt.sourceforge.net/) classes to help me out, and they work great as far as I can tell, but the rotation bit is killing me. Here is my current effort. It gives me cylinders that are located correctly, but all point along the z-axis (as in this image:![alt text](https://i.stack.imgur.com/vTPGI.png). We are looking in the -z direction. The triangle poking out behind is not part of the hull; for testing/debugging. The orthogonal cylinders are coordinate axes, more or less, and the spheres are to make sure the axes are located correctly, since I have to use rotation to place those cylinders correctly. And BTW, when I use that algorithm, the out-vectors fail as well, although in a different way, coming out normal to the planes, but all pointing in +z instead of some in -z) ``` // Make the out-pointing vector C3DTCylinder *outVectTube; C3DTEntity *outVectEntity; Point3DFloat *sideCtr = [thisSide centerOfMass]; outVectTube = [C3DTCylinder cylinderWithBase: tubeRadius top: tubeRadius height: tubeRadius*10 slices: 16 stacks: 16]; outVectEntity = [C3DTEntity entityWithStyle:triColor geometry:outVectTube]; Point3DFloat *outVect = [[thisSide inVect] opposite]; Point3DFloat *unitZ = [Point3DFloat pointWithX:0 Y:0 Z:1.0f]; Point3DFloat *rotAxis = [outVect crossWith:unitZ]; double rotAngle = [outVect angleWith:unitZ]; [outVectEntity setRotationX: rotAxis.x Y: rotAxis.y Z: rotAxis.z W: rotAngle]; [outVectEntity setTranslationX:sideCtr.x - ctrX Y:sideCtr.y - ctrY Z:sideCtr.z - ctrZ]; [aScene addChild:outVectEntity]; ``` ``` if (_hasTransform) { glPushMatrix(); // Translation if ((_translation.x != 0.0) || (_translation.y != 0.0) || (_translation.z != 0.0)) { glTranslatef(_translation.x, _translation.y, _translation.z); } // Scaling if ((_scaling.x != 1.0) || (_scaling.y != 1.0) || (_scaling.z != 1.0)) { glScalef(_scaling.x, _scaling.y, _scaling.z); } // Rotation glTranslatef(-_rotationCenter.x, -_rotationCenter.y, -_rotationCenter.z); if (_rotation.w != 0.0) { glRotatef(_rotation.w, _rotation.x, _rotation.y, _rotation.z); } else { if (_rotation.x != 0.0) glRotatef(_rotation.x, 1.0f, 0.0f, 0.0f); if (_rotation.y != 0.0) glRotatef(_rotation.y, 0.0f, 1.0f, 0.0f); if (_rotation.z != 0.0) glRotatef(_rotation.z, 0.0f, 0.0f, 1.0f); } glTranslatef(_rotationCenter.x, _rotationCenter.y, _rotationCenter.z); } ``` I added the bit in the above code that uses a single rotation around an axis (the "if (_rotation.w != 0.0)" bit), rather than a set of three rotations. My code is likely the problem, but I can't see how.
Can't correctly rotate cylinder in openGL to desired position
CC BY-SA 2.5
null
2010-09-07T05:21:01.407
2010-09-07T08:02:04.410
null
null
271,626
[ "objective-c", "opengl" ]
3,656,184
1
3,658,099
null
0
52
I can't see how to position a new panel4 across panel1, panel2, panel3 on the right side for drawing my y-axis: ![alt text](https://i.stack.imgur.com/kGbEz.png) ``` plot: [ pen green line 5x404 5x440 pen gold fill-pen 0.255.0 box 3x424 7x418 line 10x396 10x422 pen gold fill-pen 0.255.0 box 8x418 12x402 line 15x397 15x436 pen gold fill-pen 255.0.0 box 13x401 17x435 line 20x429 20x447 pen gold fill-pen 255.0.0 box 18x434 22x446 line 25x441 25x464 pen gold fill-pen 255.0.0 box 23x446 27x463 line 30x445 30x493 pen gold fill-pen 255.0.0 box 28x461 32x482 line 35x470 35x504 pen gold fill-pen 255.0.0 box 33x481 37x492 line 40x466 40x498 pen gold fill-pen 0.255.0 box 38x491 42x477 ] grid: [1100 600] step-grid: 5 max-n-points: (grid/1 / step-grid) - 1 x-axis-border: 20 Y-margin: 10 X0: 5 grid-color: coal main: layout/size [ origin 0x0 space 1x1 panel1: box 1100x580 black effect reduce [ 'line-pattern 4 4 'grid 30x30 0x0 (grid-color) 'draw plot ] panel2: box 1100x0 black panel3: box 1100x20 black ;answer thanks to Graham across at 1100x0 panel4: box 40x600 black effect [draw [pen coal line 0x0 0x580]] ] 1140x600 view main ```
How to create a panel on the right side of the layout for drawing a chart y-axis?
CC BY-SA 2.5
0
2010-09-07T06:16:52.430
2010-09-07T16:04:46.737
2010-09-07T16:04:46.737
2,687,173
2,687,173
[ "functional-programming", "rebol" ]
3,656,387
1
3,904,738
null
0
2,794
I'm building a drop down menu which resides in program menu bar and pops up a JPopupMenu if a JButton gets clicked. In the JPopupMenu there are multiple JMenuItems. However, beside every JMenuItem it shows a checkbox! Which looks like this: ![alt text](https://i.stack.imgur.com/3I8Ee.png) I don't think it should, and there is explicit JCheckBoxMenuItem for that. Does anyone know why a check box appears in a JMenuItem and how do I disable / remove it? The code ``` ImageIcon icon = ViewUtilities.createIcon("resource/gui/mainMenu.png", _buttonLength); setIcon(icon); JMenuItem menuItem = new JMenuItem("New Whiteboard"); menuItem.addActionListener(new NewWhiteboardActionListener()); getMenu().add(menuItem); menuItem = new JMenuItem("Open..."); menuItem.addActionListener(new OpenFileActionListener()); getMenu().add(menuItem); menuItem = new JMenuItem("Preferences..."); menuItem.addActionListener(new PreferencesActionListener()); getMenu().addSeparator(); getMenu().add(menuItem); menuItem = new JMenuItem("Exit"); menuItem.addActionListener(new ExitActionListener()); getMenu().addSeparator(); getMenu().add(menuItem); ``` where `getMenu()` returns a `JPopupMenu`. Thanks! Cheers, Shuo --- I've fixed it. The problem is on [Jide](http://www.jidesoft.com) library. I've used it for a custom LAF of TabbedPanel. And it LAF for popup menus too as long as it's load. So the solution is too set it to load menu styles. ``` LookAndFeelFactory.installJideExtension( LookAndFeelFactory.VSNET_STYLE_WITHOUT_MENU); ```
JMenuItem shows checkbox on the left, how to disable it?
CC BY-SA 3.0
0
2010-09-07T06:57:25.167
2015-11-03T21:42:16.193
2015-11-03T21:42:16.193
1,555,990
284,811
[ "java", "swing", "checkbox", "jmenuitem" ]
3,656,416
1
3,656,833
null
5
1,586
I got the code for the new google.com's doodle: [http://gist.github.com/567948](http://gist.github.com/567948) The problem is, all the values in the `<div id="hplogo">` is changing dynamically, but not when I copy the code in my local machine. It seems only JS + DIV, anything missing? But now able to replicate it on my local machine. ![alt text](https://i.stack.imgur.com/wV2A6.png) Any suggestions?
How is the new google logo (moving balls) implemented?
CC BY-SA 2.5
0
2010-09-07T07:02:34.103
2010-09-07T09:23:52.650
2010-09-07T08:54:57.487
231,917
231,917
[ "javascript", "google-doodle" ]
3,656,615
1
3,656,844
null
118
309,118
``` <html> <head> <title>Table Row Padding Issue</title> <style type="text/css"> tr { padding: 20px; } </style> </head> <body> <table> <tbody> <tr> <td> <h2>Lorem Ipsum</h2> <p>Fusce sodales lorem nec magna iaculis a fermentum lacus facilisis. Curabitur sodales risus sit amet neque fringilla feugiat. Ut tellus nulla, bibendum at faucibus ut, convallis eget neque. In hac habitasse platea dictumst. Nullam elit enim, gravida eu blandit ut, pellentesque nec turpis. Proin faucibus, sem sed tempor auctor, ipsum velit pellentesque lorem, ut semper lorem eros ac eros. Vivamus mi urna, tempus vitae mattis eget, pretium sit amet sapien. Curabitur viverra lacus non tortor luctus vitae euismod purus hendrerit. Praesent ut venenatis eros. Nulla a ligula erat. Mauris lobortis tempus nulla non scelerisque.</p> </td> </tr> </tbody> </table> </body> </html> ``` Here's what the padding looks like. See how the td inside isn't affected. What's the solution? ![Table Row Padding Issue](https://i.stack.imgur.com/RRMec.png)
Padding a table row
CC BY-SA 3.0
0
2010-09-07T07:33:33.707
2021-05-20T08:26:12.463
2017-06-10T16:01:56.190
4,370,109
336,528
[ "html", "css", "html-table", "row", "padding" ]
3,656,908
1
null
null
3
3,670
when the process run in the same browser, to open a new TAB and check the session variables there, in this situation. But when a webpage runs inside a `WebBrowser` Control (under Windows Forms) for example, any Session Variable that process is using. > Does anyone have an idea on how to get the variables? before I create a value to use Session Variables or File Output in the `web.config` :) ![alt text](https://i.stack.imgur.com/Drrnp.png) The image above is my but it's always empty when I run the web page from a different process :o( --- Tracing is not an option as I get this from Trace: ![alt text](https://i.stack.imgur.com/Hh1pS.png) The Debug window assigns that `List` to a `GridView` and shows up nicely.
Debugging ASP.NET Session Variables
CC BY-SA 2.5
null
2010-09-07T08:15:51.107
2010-09-07T09:06:16.840
2010-09-07T09:06:16.840
28,004
28,004
[ ".net", "asp.net", "debugging", "session-variables" ]
3,657,122
1
null
null
16
39,434
I'm trying to create a layout with a 'header' area which contains a logo and some links, and then a content area which needs to extend to the bottom of the page. This is where I'm getting stuck. I've surrounded the header and content with a container div which has a height of 100%, this works fine. But I can't then get the content div to stretch to the bottom of the container div as giving it a minimum height of 100% appears to take the height from the page body, so I end up with a scroll bar due to the space taken up at the top of the page by the header. Here's a wireframe which hopefully makes what I'm trying to achieve a bit clearer... ![Mockup](https://i.stack.imgur.com/949CV.png) Here is a quick CSS example, this works, apart from there always being a scrollbar at which appears to be the height of the header area... ``` html, body { height: 100%; margin: 0; padding: 0; color: #fff; } body { background-color: #000; } #container { position: relative; margin: 0 auto; width: 1000px; min-height: 100%; } #header { padding-top: 26px; } #logo { width: 194px; height: 55px; margin: 0 auto; background-color: #fff; } #content { margin-top: 10px; position: absolute; width: 1000px; min-height: 100%; background-color: #fff; } ```
CSS Layout Help - Stretch div to bottom of page
CC BY-SA 3.0
0
2010-09-07T08:44:13.173
2015-07-04T16:10:16.933
2013-11-26T21:17:55.907
1,366,033
228,929
[ "css", "html" ]
3,657,128
1
null
null
0
1,301
Problem with `<div>` tags Works fine: Text "Whatever" is in column 1, followd by a radiobutton: ![alt text](https://i.stack.imgur.com/rt5fj.png) Works also fine (no radio button with text): ![alt text](https://i.stack.imgur.com/d8VNq.png) The next cell AFTER the text "Whatever" should be displayed in column 1 of the next row - instead directly under the text. ![alt text](https://i.stack.imgur.com/F9bqx.png) Background: The table structure is made by my html helper. He generates asp.net MVC2 code to display radio buttons with images(!) in a table structure. The html helper takes some values like: Generate a table with five radio buttons in two columns and add one radio button with the text "Whatever". (Of course takes the html helper some additional values, but thats not the problem ...) The table is made with `<div>` tags (no `<table>` tag at all!). I use the styles "width: 50%;" for a table with two columns and the "float: left;". Everything works great - until the radio button with the text (and without any image) should be displayed in the last column. See for example picture 2: The after the "text radio button" following radio button (with 3 images) should be displayed in the first column and NOT under the text. What do I wrong? Additional info: Same behaviour in IE and firefox. Thanks in advance! --- Thanks for the fast reply! As requested: ``` <div id="stars" style="width: 860px; border: solid 2px #000000; background-color:#CCCCCC;" > <div id="div0" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix0" type="radio" text="6" value="false" /> <label for="idPrefix0"> <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="6" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="6" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="6" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="6" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="6" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="6" > </label> </div> <div id="div1" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix1" type="radio" text="2" value="false" /> <label for="idPrefix1"> <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="2" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="2" > </label> </div> <div id="div2" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix2" type="radio" text="5" value="false" /> <label for="idPrefix2"> <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="5" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="5" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="5" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="5" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="5" > </label> </div> <div id="div3" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix3" type="radio" text="1" value="false" /> <label for="idPrefix3"> <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="1" > </label> </div> <div id="div4" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix4" type="radio" text="4" value="false" /> <label for="idPrefix4"> <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="4" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="4" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="4" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="4" > </label> </div> <div id="div5" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix5" type="radio" text="-1" value="false" /> <label for="idPrefix5"> Whatever </label> </div> <div id="div6" style="width: 50.0%; float: left;" > <input name="radioButtonName" id="idPrefix6" type="radio" text="3" value="false" /> <label for="idPrefix6"> <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="3" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="3" > <img src="/Content/Images/Dialog/gold_star.png" style="width: 16px; height: 17px;" alt="3" > </label> </div> <div id="div7" style="width: 50.0%; float: left;" > &nbsp </div> </div> ``` --- Getting strange (at 1st look): ![alt text](https://i.stack.imgur.com/tnwF2.png) But explainable: Think about a chain: Pull the cell / radio button with the 5 images "two positions/columns to the right" (where it should be) and imagine that all following cells/radio buttons would follow. Then everything would be at the right place. ;-)
asp-net MVC2: <div> tag - "float: left;" - Problem?
CC BY-SA 2.5
null
2010-09-07T08:45:30.120
2011-02-16T10:26:54.103
2010-09-07T09:54:20.453
415,876
415,876
[ "html", "css", "asp.net-mvc-2" ]
3,657,515
1
3,657,598
null
7
12,608
![alt text](https://i.stack.imgur.com/sCVQQ.png) ![alt text](https://i.stack.imgur.com/Ik4Oi.png) I want to display the image like first image but my images are displaying like second image. I want to display images like first image, like center in screen and equal spaces top and bottom look first image, but my images are displaying not center in screen and no spaces in top. What can I do for display image like first images... Anybody knows,please give solution for that
How can I display image in screen center?
CC BY-SA 3.0
0
2010-09-07T09:45:46.353
2014-06-05T12:10:22.523
2014-06-05T10:52:59.873
1,904,504
410,757
[ "android", "android-layout" ]
3,657,801
1
3,662,990
null
7
8,118
I wrote a [k-Means clustering](http://en.wikipedia.org/wiki/K-means_clustering) algorithm in MATLAB, and I thought I'd try it against MATLABs built in `kmeans(X,k)`. However, for the very easy four cluster setup (see picture), MATLAB [kMeans](http://www.mathworks.com/help/toolbox/stats/kmeans.html) does not always converge to the optimum solution (left) but to (right). The one I wrote does not always do that either, but should not the built-in function be able to solve such an easy problem, always finding the optimal solution? ![alt text](https://i.stack.imgur.com/DYv31.png)
MATLAB kMeans does not always converge to global minima
CC BY-SA 2.5
0
2010-09-07T10:30:54.383
2011-01-12T17:01:42.820
2010-09-07T21:55:15.937
97,160
441,337
[ "matlab", "machine-learning", "cluster-analysis", "k-means" ]
3,657,837
1
5,447,044
null
3
8,254
I have just finished incorporating a jQuery accordian with a jQuery Slider. I.e. 3 pictures are displayed. The user can either use `PREV` or `NEXT` buttons to view the next/prev 3 images. They can also navigate through all the images with the slider. The next step is to make this slider look like a timeline. The left hand side needs to start at 1970 and finish at 2010. For each item (an item is a set of 3 images in this case) I need it to show a date on the timeline. i.e: ![alt text](https://i.stack.imgur.com/CG7u8.jpg) I know I could create an image with the dates the right width apart but idealy this needs to be dynamic so more items can be put in and the timeline self updates.
jQuery slider as a timeline
CC BY-SA 2.5
0
2010-09-07T10:36:33.263
2011-03-28T10:42:01.857
2011-03-28T02:20:01.987
50,776
405,529
[ "jquery", "slider", "timeline" ]
3,658,355
1
3,658,700
null
0
72
I have a table made of of several records, with the rows having different number of records per row. What I'd like to have is for the rows with less records, I want to have them being equal in length to the longest row. Currently what I have comes out like below: ![alt text](https://i.stack.imgur.com/sN0rv.jpg) I've done this using this bit of code: ``` <table> {% for week in month_days %} {% for day, entries, weekday in week %} <tr class="{% cycle 'row1' 'row2' %}"> {% if day != 0 %} <td>{{ weekday }}</td> <td>{{ day }}</td> {% if entries %} {% for entry in entries %} <td>{{ entry.start_time|time:"h:i a" }}</td> <td>{{ entry.end_time|time:"h:i a" }}</td> <td>{{ entry.hours }}</td> <td>Break</td> {% endfor %} {% endif %} {% endif %} </tr> <!--- Insert blank row after each Sunday --> {% if weekday == "Sunday" %} <tr class="week-end"> <td colspan="{{ days_month.count }}">&nbsp;</td> </tr> {% endif %} {% endfor %} {% endfor %} </table> ``` From the above photo, as an example, I want, on the entry for Monday 16th, to have the blue space filled in with blank cells.
Equal row lengths in a table
CC BY-SA 2.5
0
2010-09-07T11:46:27.513
2010-09-07T12:36:09.597
null
null
217,647
[ "html", "django-templates" ]
3,658,373
1
null
null
0
347
We use in our application cells in a grouped tableview as buttons. Therefore we set a backgroundimage to look the cells like buttons. We used the following code: ``` cell.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bg_gradient_mainmenu_2.png"]]; cell.textLabel.textColor = [UIColor whiteColor]; cell.textLabel.highlightedTextColor = [UIColor whiteColor]; ``` which looks like this![alt text](https://i.stack.imgur.com/lB4Xe.png) The weird thing now is that it works for just some devices with different OS Systems. It definitly doesn't work on new iPhones 4. Does anyone has a clue how solve that problem?
weird background in grouped table cell
CC BY-SA 2.5
0
2010-09-07T11:50:27.660
2011-05-12T23:36:42.120
2010-09-07T11:52:19.917
106,224
155,663
[ "iphone", "objective-c", "uitableview", "background-color" ]
3,658,513
1
6,155,997
null
5
5,742
If I host an ASP.NET page with: ``` <%@ Page Language="C#" %> <!DOCTYPE html> <script runat="server"> protected void btn_Click(object sender, EventArgs e) { lbl.Text = HttpContext.Current.Session["a"] == null ? "null" : HttpContext.Current.Session["a"].ToString(); } protected void btn_Click2(object sender, EventArgs e) { lbl.Text = HttpContext.Current.Cache["a"] == null ? "null" : HttpContext.Current.Cache["a"].ToString(); } protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { HttpContext.Current.Session["a"] = "CBA"; lbl.Text = "assigned Session Variable"; HttpContext.Current.Cache.Add( "a", "ABC", null, DateTime.Now.AddHours(2), TimeSpan.Zero, CacheItemPriority.NotRemovable, null); } } </script> <html> <head> <title>Testing Session</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Button ID="btn" runat="server" Text="read Session" OnClick="btn_Click" />&nbsp;&nbsp; <asp:Button ID="btn2" runat="server" Text="read Cache" OnClick="btn_Click2" /> <hr /> <asp:Label ID="lbl" runat="server" /> </div> </form> </body> </html> ``` on the first run I do get the `assigned Session Variable` text, but upon click the Session object is always `null` Id there an option I need to turn on/off to use the normal Session Variables ? works fine on IIS 6.0 and Cassini (under VS 2008 and 2010). > I'm starting to be without ideas on what's going on :o( Any help is greatly appreciated! --- the process of the example page above ![alt text](https://i.stack.imgur.com/NPcqE.png) ![alt text](https://i.stack.imgur.com/IXBIM.png) --- shows that this only happens in IE (ie8 in this case), Firefox, Safari, Opera, Chrome they all give the correct "answer" ![alt text](https://i.stack.imgur.com/QU9e5.png) --- > check the [screen cast of the situation](http://www.balexandre.com/temp/showflash.aspx?swf=2010-09-07_1356.swf&h=481&w=841)
IE8 does not keep Session Variables
CC BY-SA 3.0
null
2010-09-07T12:08:24.700
2011-08-17T21:25:27.657
2011-08-17T21:25:27.657
318,465
28,004
[ "iis-7", "internet-explorer-8", "session-state", "session-variables" ]
3,659,141
1
3,659,224
null
1
323
I am rotating an image around it center point but need to track a location on the image as it rotates. Given: 1. Origin at 0,0 2. Image width and height of 100, 100 3. Rotation point at C(50,50) 4. Angle of "a" (say 90 degrees in this example) 5. Point P starts at (25,25) and after the rotation it is at Pnew(75,25) ![alt text](https://i.stack.imgur.com/l9h29.png) I haven't touched trig in 20 years but guessing the formula is simple...
Image rotation & tracking locations
CC BY-SA 2.5
null
2010-09-07T13:42:26.240
2010-09-07T13:52:42.420
null
null
64,262
[ "math", "trigonometry" ]