Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
5,789,745
1
5,800,272
null
8
3,875
I'd like to know if it's possible to do the following: - - - Basically I want to create button icons using pixels but be able to set the color at runtime depending on triggers. Something like this: ![dog buttons](https://i.stack.imgur.com/IBhia.png)
Use image as WPF Button icon mask?
CC BY-SA 3.0
0
2011-04-26T11:40:05.147
2011-04-27T06:27:23.007
2011-04-27T06:26:22.040
422,611
422,611
[ "wpf", "icons" ]
5,789,909
1
5,790,073
null
16
333
I'm looking for a GIS/Geometric algorithm: I have 1000 points randomly distributed in a large area(such as a city), How can I find out all the small areas which have more than 15 points? Like this picture below: ![enter image description here](https://i.stack.imgur.com/9yivv.png) Each point has its own latitude and longitude coordinates. The small area less than 200m x 200m.
Calculation of accumulation area
CC BY-SA 3.0
0
2011-04-26T11:55:13.533
2013-08-03T21:11:34.980
null
null
130,075
[ "c++", "c", "delphi", "gis" ]
5,789,926
1
5,796,072
null
15
31,315
I'm stuck trying to update a progressbar from other threads ran in a different class. To explain what I do I think a picture will be better. I want to update the progressbar in the //HERE point :![enter image description here](https://i.stack.imgur.com/80hd8.jpg) I've tried using a delegate, tried with ReportProgress and I think i've basically tried to use everything google reported in the first 100 results, without success. I'm still learning WPF and this might be silly way to proceed, i'm looking for a quick and dirty way to get the work done but feel free to tell me what I should redesign for a cleaner application. : More code. In ExecutorWindow.xaml.cs : ``` public void RunExecutor() { // CREATE BACKGROUNDWORKER FOR EXECUTOR execBackground.DoWork += new DoWorkEventHandler(execBackground_DoWork); execBackground.RunWorkerCompleted += new RunWorkerCompletedEventHandler(execBackground_RunWorkerCompleted); execBackground.ProgressChanged += new ProgressChangedEventHandler(execBackground_ProgressChanged); execBackground.WorkerReportsProgress = true; execBackground.WorkerSupportsCancellation = true; // RUN BACKGROUNDWORKER execBackground.RunWorkerAsync(); } private void execBackground_DoWork(object sender, DoWorkEventArgs e) { myExecutor = new Executor(arg1, arg2); myExecutor.Run(); } private void execBackground_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { MessageBox.Show("RunWorkerCompleted execBackground"); } private void execBackground_ProgressChanged(object sender, ProgressChangedEventArgs e) { ExecutorProgressBar.Value += 1; } // TESTING private void updateProgressBar(int i) { ExecutorProgressBar.Value += i; } public delegate void callback_updateProgressBar(int i); ``` In Executor.cs : ``` public void Run() { string[] options = new string[2]; int i = 0; while (LeftToRun > 0) { if (CurrentRunningThreads < MaxThreadsRunning) { BackgroundWorker myThread = new BackgroundWorker(); myThread.DoWork += new DoWorkEventHandler(backgroundWorkerRemoteProcess_DoWork); myThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorkerRemoteProcess_RunWorkerCompleted); myThread.ProgressChanged += new ProgressChangedEventHandler(backgroundWorkerRemoteProcess_ProgressChanged); myThread.WorkerReportsProgress = true; myThread.WorkerSupportsCancellation = true; myThread.RunWorkerAsync(new string[2] {opt1, opt2}); // HERE ? CurrentRunningThreads++; i++; LeftToRun--; } } while (CurrentRunningThreads > 0) { } logfile.Close(); MessageBox.Show("All Tasks finished"); } private void backgroundWorkerRemoteProcess_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker myBackgroundWorker = sender as BackgroundWorker; string[] options = (string[])e.Argument; string machine = options[0]; string script = options[1]; // UPDATE HERE PROGRESSBAR ? RemoteProcess myRemoteProcess = new RemoteProcess(machine, script); string output = myRemoteProcess.TrueExec(); // UPDATE HERE PROGRESSBAR ? this.logfile.WriteLine(output); } private void backgroundWorkerRemoteProcess_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { CurrentRunningThreads--; } private void backgroundWorkerRemoteProcess_ProgressChanged(object sender, ProgressChangedEventArgs e) { //myExecWindow.ExecutorProgressBar.Value = e.ProgressPercentage; // TESTING //ExecutorWindow.callback_updateProgressBar(1); // TESTING } ``` : I got it! Simple in fact, but i guess I've been looking too close to find out. In my ExecutorWindow class : ``` private void execBackground_DoWork(object sender, DoWorkEventArgs e) { myExecutor = new Executor(arg1, arg2); myExecutor.Run(sender); } private void execBackground_ProgressChanged(object sender, ProgressChangedEventArgs e) { ExecutorProgressBar.Value += 1; } ``` And in my Executor class : ``` private BackgroundWorker myExecutorWindow; [...] public void Run(object sender) { myExecutorWindow = sender as BackgroundWorker; string[] options = new string[2]; int i = 0; while (LeftToRun > 0) { if (CurrentRunningThreads < MaxThreadsRunning) { BackgroundWorker myThread = new BackgroundWorker(); myThread.DoWork += new DoWorkEventHandler(backgroundWorkerRemoteProcess_DoWork); myThread.RunWorkerCompleted += new RunWorkerCompletedEventHandler(backgroundWorkerRemoteProcess_RunWorkerCompleted); myThread.ProgressChanged += new ProgressChangedEventHandler(backgroundWorkerRemoteProcess_ProgressChanged); myThread.WorkerReportsProgress = true; myThread.WorkerSupportsCancellation = true; myThread.RunWorkerAsync(new string[2] {opt1, opt2}); CurrentRunningThreads++; i++; LeftToRun--; } } [...] private void backgroundWorkerRemoteProcess_DoWork(object sender, DoWorkEventArgs e) { BackgroundWorker myBackgroundWorker = sender as BackgroundWorker; myBackgroundWorker.ReportProgress(1); // PROCESSING MY STUFF HERE myBackgroundWorker.ReportProgress(1); } private void backgroundWorkerRemoteProcess_ProgressChanged(object sender, ProgressChangedEventArgs e) { myExecutorWindow.ReportProgress(1); } ``` Thank you !
WPF C# - Update progressbar from another thread
CC BY-SA 3.0
0
2011-04-26T11:56:40.633
2015-04-13T23:10:36.567
2015-04-13T23:10:36.567
700,309
700,309
[ "c#", "wpf", "multithreading", "progress-bar" ]
5,790,179
1
5,823,283
null
6
2,849
I'm customizing a TFS Work Item Type, adding a 'Business Description' HTML Field, but I cannot get the Layout right: ``` <Tab Label="Details"> <Group> <Column PercentWidth="60"> <Control FieldName="Customer.BusinessDescription" Type="HtmlFieldControl" Label="Business Description:" LabelPosition="Top" Dock="Fill" /> </Column> <Column PercentWidth="40"> <Control FieldName="Microsoft.VSTS.CMMI.Symptom" Type="HtmlFieldControl" Label="Symptom:" LabelPosition="Top" /> <Control FieldName="System.History" Type="WorkItemLogControl" Label="&amp;History:" LabelPosition="Top" /> </Column> </Group> </Tab> ``` This turns out like this: ![undesired layout](https://i.stack.imgur.com/8jd4J.png) While I really want this ('Photoshopped' with MSPaint): ![desired layout](https://i.stack.imgur.com/XPV29.png) I have played around with the Fill properties on all three fields, have already set the MinimumSize property on the BusinessDescription field, added a group inside the left column, but I do not seem to find a solution for this. Is this at all possible?
TFS WorkItem Layout problem
CC BY-SA 3.0
0
2011-04-26T12:19:11.670
2011-04-28T18:26:55.723
null
null
45,045
[ "layout", "tfs", "customization", "tfs-workitem" ]
5,790,199
1
5,790,311
null
-1
1,408
I'm trying to build the following structure on a page on my website: ![enter image description here](https://i.stack.imgur.com/dsWbr.png) The black border is the content container. The red border is the left content container and the gray area is the right content container with a gray background. Now, I want the right content container to expand vertically dependent on the height of the left content container, so they will always have the same height. How exactly do I go about this? Anyone know of a work-around to make the divs behave like a table would? Thanks in advance! All the best, Bo
div table-behavior
CC BY-SA 3.0
null
2011-04-26T12:21:02.313
2011-05-11T05:51:29.337
null
null
201,681
[ "css", "xhtml", "html", "sass" ]
5,790,458
1
5,791,227
null
0
449
for some time now, my developer console overview shows a small box named "Merchant sales report" in which is written: > Last Merchant Sales Report n/a ![screenshot](https://i.stack.imgur.com/VqWtD.png) What does that mean?
developer console says: "Last Merchant Sales Report n/a"
CC BY-SA 3.0
null
2011-04-26T12:41:30.420
2011-04-27T07:27:09.530
2011-04-26T13:34:14.793
419,780
419,780
[ "android", "google-play" ]
5,790,536
1
6,476,477
null
0
505
At the bottom of every project portal dashboard page for my TFS 2010 project portal () I get the message "" (see picture) ![enter image description here](https://i.stack.imgur.com/sgsWa.png) If I edit any of the dashboard pages (site actions of edit page) this message is still there, but not inside a web part which leads me to belive this is not a web part that is showing this message. But what is it? More to the point what do I need to do to fix it? I presume I have some permissions or configuration issues, but currently both I and my companies internal support people are without a clue as to how we go about diagnosing never mind resolving this issue. It should be pointed out that i/we are TFS 2010 newbies AND sharepoint 2007 newbies. Any help would be much apreciated.
TFS 2010 Project portal shows "Login failed for user <DOMAIN>\sharepoint.admin" error message. How do I fix this?
CC BY-SA 3.0
null
2011-04-26T12:45:29.893
2011-06-25T07:21:10.897
2011-06-25T07:21:10.897
595,787
595,787
[ "sharepoint-2007", "portal" ]
5,791,035
1
5,795,397
null
4
8,749
In a small WebView app I wrote, I am able to load YouTube and see the picture the represents a video clip, with the familiar right-pointing arrow that is supposed to start playing the video: ![enter image description here](https://i.stack.imgur.com/UIRyB.png) But... when I touch that arrow, nothing happens (the video is NOT played). I did enable the plugins setting in WebView, but that didn't help: ``` mWebView.getSettings().setPluginsEnabled(true); ``` So, I searched for more clues about how to make Flash (YouTube) run embedded in my WebView and I found the following [hint](https://stackoverflow.com/questions/2943947/how-to-enable-flash-plugin-in-webview): > I think you also need Flash to be installed, like in Android 2.2 and above. I am OK with the requirement for Android 2.2 but what I don't understand is what "install Flash plugin" means: YouTube plays fine in Android's default browser (which is based on WebView AFAIK) and also in the YouTube app that's also installed in my device. Doesn't that mean that the Flash plugin is already installed? If the answer is "no", what do I need to do to install it?
What does "install Flash plugin" in WebView mean?
CC BY-SA 3.0
0
2011-04-26T13:26:24.597
2014-11-17T23:56:19.563
2017-05-23T12:01:09.563
-1
725,417
[ "android", "flash", "plugins", "webview", "android-webview" ]
5,791,146
1
5,791,798
null
3
5,055
I am going over the Big-Oh notation, and I have a problem understanding the solution to this question: ``` Is 2n + 10 ≡ O(n)? Can we find c and n0? 2n + 10 <= cn (c-2)n >= 10 n >= 10/(c-2) Pick c = 3 and n0 = 10 ``` There is also a graph used in this example: ![Graph](https://i.stack.imgur.com/BxOq1.jpg) I am confused as to how c = 3 and how n0 = 10? Can somebody please enlighten me?
Big-O/Big-Oh Notation Problem
CC BY-SA 3.0
0
2011-04-26T13:35:15.177
2021-10-22T16:43:39.820
null
null
636,987
[ "big-o" ]
5,791,249
1
5,791,347
null
1
4,802
![enter image description here](https://i.stack.imgur.com/nFzj1.png) I have one `WrapPanel` (with green background) inside of a `ListBox`(with gray background). I am trying to dynamically add a `StackPanel` multiple times (by clicking on the button below given image) in the `WrapPanel`. The `StackPanel` contains a `Button` which has Content “X”. I want to remove individual `StackPanel` objects (with orange background) when this button is clicked.
Dynamically Add and Remove stack panel
CC BY-SA 3.0
0
2011-04-26T13:42:55.260
2017-05-04T07:14:45.157
2011-04-26T13:48:12.797
64,329
468,968
[ ".net", "wpf", "stackpanel", "wrappanel" ]
5,791,442
1
null
null
0
64
![PHPMyAdmin Screenshot](https://i.stack.imgur.com/PY8eS.png) I create a table the put the comments of each article so the `comment_id` is the auto increment for count the comments and `article_id` is the article ID from another table (foreign key). I want to count the number of comments for each article and put it in new record or something just so I can show it in the article page like : "the number of comments : 5"
PHP and MySql question
CC BY-SA 3.0
null
2011-04-26T13:57:57.897
2011-04-26T14:28:14.940
2011-04-26T14:08:46.783
93,623
725,473
[ "php", "mysql" ]
5,791,440
1
5,791,475
null
0
126
In internet explorer, when I have a field dynamically generated, everything moves down. However, the surrounding container stays the same height and everything just moves on past it. Try clicking 'Add a Language' or 'Add a Skill' then scroll down to the bottom. Any suggestions? [](http://quspot.com/ie_test/)[http://quspot.com/ie_test/](http://quspot.com/ie_test/) ![Any suggestions?](https://i.stack.imgur.com/wYpfQ.jpg) EDIT/ The syntax is ``` <div id="content"> <div class="wrapper"></div> </div> ``` .wrapper is expanding just fine (I added a background color to make sure), the #content div is not though.
Expanding container around dynamically added fields
CC BY-SA 3.0
null
2011-04-26T13:57:45.110
2011-04-26T15:18:51.737
2011-04-26T14:27:43.117
612,371
612,371
[ "javascript", "jquery", "html", "css", "internet-explorer" ]
5,791,949
1
5,792,003
null
0
45,886
This is my ListView, Column 1 for ID and Column 2 for Notes ![enter image description here](https://i.stack.imgur.com/A2mqx.png) I have a Multi-Line textbox and a Button Like this ![enter image description here](https://i.stack.imgur.com/qk7cb.png) I want to load the selected note on the textbox when the button is clicked. How can I do this ?
How to get the selected row items in ListView
CC BY-SA 3.0
0
2011-04-26T14:36:45.943
2011-04-26T14:55:14.887
null
null
722,000
[ "vb.net", "winforms" ]
5,792,081
1
5,792,257
null
4
6,055
As you can see in the image below then when the browser window is resized the checkbox labels can wrap to the opposite side of their ascociated checkboxes.![enter image description here](https://i.stack.imgur.com/KHijV.png) In the image above the label for checkbox 12 has wrapped and is at the opposite side of the screen. How can I make it so that each label stays with its checkbox?
prevent checkbox label from wrapping to opposite side of page
CC BY-SA 3.0
0
2011-04-26T14:45:41.143
2011-04-26T14:57:33.753
null
null
552,067
[ "html", "css", "checkbox", "label" ]
5,792,141
1
null
null
3
1,319
I have a relatively complicated classification tree that I'm trying to output. The resulting postscript output looks very jumbled. ``` > fit = rpart(virility ~ friend_count + recip_count + twitter_handles + has_email + has_bio + has_foursquare + has_linkedin + auto_tweet + interaction_visibility + site_own_cnt + site_rec_cnt + has_url + has_linkedin_url + lb_cnt, + mob_own_cnt + mob_rec_cnt + twt_own_cnt + twt_rec_cnt, method="class", data=vir) > fit n= 9704 node), split, n, loss, yval, (yprob) * denotes terminal node 1) root 9704 3742 virile (0.39970092 0.60029908) 2) recip_count< 15.5 9610 3159 mule (0.52005469 0.47994531) 4) site_own_cnt< 0.5 7201 1372 mule (0.65423387 0.34576613) 8) friend_count< 2.5 6763 948 mule (0.69566613 0.30433387) 16) has_bio>=0.5 4030 601 mule (0.73743993 0.26256007) * 17) has_bio< 0.5 2733 347 mule (0.57990315 0.42009685) 34) recip_count< 0.5 2496 88 mule (0.78000000 0.22000000) * 35) recip_count>=0.5 237 167 virile (0.39201878 0.60798122) * 9) friend_count>=2.5 438 424 mule (0.50293083 0.49706917) 18) lb_cnt< 2.5 427 344 mule (0.55208333 0.44791667) 36) has_foursquare< 0.5 401 257 mule (0.61353383 0.38646617) 72) twitter_handles>=0.5 382 210 mule (0.65742251 0.34257749) * 73) twitter_handles< 0.5 19 5 virile (0.09615385 0.90384615) * 37) has_foursquare>=0.5 26 16 virile (0.15533981 0.84466019) * 19) lb_cnt>=2.5 11 5 virile (0.05882353 0.94117647) * 5) site_own_cnt>=0.5 2409 827 virile (0.31637337 0.68362663) 10) recip_count< 0.5 1344 274 mule (0.62102351 0.37897649) 20) friend_count< 0.5 955 75 mule (0.81155779 0.18844221) * 21) friend_count>=0.5 389 126 virile (0.38769231 0.61230769) 42) twitter_handles< 0.5 62 3 mule (0.93181818 0.06818182) * 43) twitter_handles>=0.5 327 85 virile (0.30249110 0.69750890) * 11) recip_count>=0.5 1065 378 virile (0.19989424 0.80010576) * 3) recip_count>=15.5 94 319 virile (0.11474820 0.88525180) 6) friend_count< 2.5 40 265 virile (0.32435741 0.67564259) 12) site_rec_cnt>=1.5 24 175 mule (0.59112150 0.40887850) 24) site_rec_cnt< 4 13 46 mule (0.80257511 0.19742489) * 25) site_rec_cnt>=4 11 66 virile (0.33846154 0.66153846) * 13) site_rec_cnt< 1.5 16 12 virile (0.03084833 0.96915167) * 7) friend_count>=2.5 54 54 virile (0.02750891 0.97249109) * > post(fit, file = "/tmp/blah.ps", title = "virility model") ``` This results in: ![enter image description here](https://i.stack.imgur.com/orAyy.png) The nodes of the tree are all written half on top of each other. Is there any way to make this output look reasonably readable?
fix unreadable postscript tree output in r
CC BY-SA 3.0
0
2011-04-26T14:49:14.433
2011-04-26T17:08:06.407
2011-04-26T17:08:06.407
1,855,677
41,613
[ "r", "machine-learning", "postscript" ]
5,792,164
1
null
null
0
2,452
How I can implement the following screen. ![enter image description here](https://i.stack.imgur.com/hhczl.png) What are ui controls can be used for implementation the same grid behavior? I'm seeing UITableView, but it doesn't support multi columns. How can be? Thanks, Anatoly
iPhone how i can I do multiple columns in UITableView/UIImageView
CC BY-SA 3.0
0
2011-04-26T14:50:41.570
2012-08-02T07:11:02.717
null
null
676,369
[ "iphone", "uitableview", "user-interface", "uiimageview" ]
5,792,222
1
5,792,255
null
3
14,762
Hej All, I upgraded my solutions of a project from vs2008 to vs2010. But right now I have a weird problem. I reference a project in multiple solutions (3 solutions) In 2 of those solutions the referencing goes wrong. I am able to add the reference (project reference) but when I build I got the warning the referenced project x does not exists. And errors that I have to add an reference. I already deleted and added the project again, same with the references but no result. ![enter image description here](https://i.stack.imgur.com/0docQ.gif) ![enter image description here](https://i.stack.imgur.com/myAZY.gif) Does anybody have any idea? Greetz, Jonathan
The referenced project x does not exists
CC BY-SA 3.0
null
2011-04-26T14:55:16.627
2021-01-04T17:03:03.567
2011-04-26T14:57:21.557
11,343
637,819
[ "c#", "visual-studio", "reference", "project" ]
5,792,254
1
5,800,157
null
8
597
I am building an IE Addon in C#. I uninstall my addon using Programs and Features. But it doesn't work out. The toolbar stays there on the browser. Tried Manage Addons from Tool Menu in IE. It displays Unavailable, but doesn't give an option to Remove or Uninstall it. I am unable to remove it fully. Also, when I rebuild my SetUp and reinstall it, it's not reflecting the changes as the old one is still there. Even I deleted the Keys from the Registry. Also there are other Addons which aren't built by me and still show the same behaviour. Please see the Screenshot. ![Screenshot from Manage Addons in IE](https://i.stack.imgur.com/vW4ay.png) Please guide me to uninstall or say remove these. Regards
How to uninstall IE Addon
CC BY-SA 3.0
0
2011-04-26T14:57:22.650
2011-04-27T06:52:29.157
null
null
434,685
[ "c#", "registry", "uninstallation", "ieaddon" ]
5,792,345
1
null
null
2
2,714
I'm trying to make a tab thing out of buttons. So the selected button gets its' class changed so the bottom border is now WHITE. The effect is to make it look like part of the connecting page. HOWEVER, when I add margin-bottom:-2px; to the class - HOPING TO COVER THE PORTION OF MY DIV BORDER - it still shows the div border. IF I make it -3px, then I get the WHITE background over the div... BUT now I have 1 pixel of left and right border sticking underneath the bottom... overflow:hidden doesnt work because it sets me back to the DIV border showing... Anyone run into this problem before? Thanks! Todd HERE IS THE -2px - Notice, BLUE BORDER STILL SHOWING: ![enter image description here](https://i.stack.imgur.com/K9cW6.png) AND here is what happens if give it -3px ... NOW blue side borders sticking through (ugh!) ![enter image description here](https://i.stack.imgur.com/KvAzb.png) HERE IS HTML: ``` <div style="border-bottom:1px solid #A3C0E8; width:556px;"> <asp:Button Text="Settings" ID="btnViewSettings" runat="server" class="dxpButton_AquaTab" Visible="false" CausesValidation="false" CommandArgument="0" OnClick="SwitchView" /> <asp:Button Text="Links" ID="btnViewLinks" runat="server" Visible="false" class="dxpButton_AquaTab" CausesValidation="false" CommandArgument="1" OnClick="SwitchView"/> <asp:Button Text="Test Data Source" ID="btnTestLoader" runat="server" class="dxpButton_AquaTab" CausesValidation="false" Visible="false" CommandArgument="2" OnClick="btnLoaderTest_click"/> <asp:Button Text="Test Import" ID="btnTestConverter" runat="server" class="dxpButton_AquaTab" CausesValidation="false" Visible="false" CommandArgument="2" OnClick="btnConverterTest_click"/> <asp:Button Text="Run Import" ID="btnRunImport" runat="server" class="dxpButton_AquaTab" CausesValidation="false" Visible="false" CommandArgument="2" OnClick="btnRunImport_click"/> </div> ``` HERE IS JQUERY: ``` if ($('#dgLinkGrid').is(':visible')) { $('#btnViewLinks').removeClass("dxpButton_AquaTab"); $('#btnViewLinks').addClass("dxpButton_AquaTabSelected"); }; ``` HERE IS MY CSS: ``` .dxpButton_AquaTab { background:url("App_Themes/Aqua/Editors/edtButtonBack.gif") repeat-x scroll center top #E2F0FF; border:1px solid #A3C0E8; color:#2C4D79; cursor:pointer; font-family:Tahoma; font-size:9pt; font-weight:normal; padding:1px; vertical-align:middle; width:103px; height:40px; margin-left:3px; margin-bottom:-1px; } .dxpButton_AquaTabSelected { background-color:White; border:1px solid #A3C0E8; color:#2C4D79; cursor:pointer; font-family:Tahoma; font-size:9pt; font-weight:normal; padding:1px; vertical-align:middle; width:103px; height:40px; margin-left:3px; margin-bottom:-3px; z-index:100; border-bottom:0px solid white; border-top:3px solid #FFBD69; } ```
How to lay bottom border of button (white) over bottom border of containing div
CC BY-SA 3.0
null
2011-04-26T15:04:51.840
2011-04-26T17:11:53.813
2011-04-26T17:11:53.813
339,463
339,463
[ "css", "border" ]
5,792,410
1
6,345,398
null
0
1,279
When I first asked this question, I didn't fully understand what the problem was. Your best bet is to glance over the issue below and then read my answer. --- I have a report with a matrix where the data looks like the following: ``` Name Id Activity 1 Activity 2 …Acitivity N Smith 1 77 100 nn Johnson 2 88 99 nn ``` and are in a group. When the number of activities are greater than 11, I need the columns and to repeat when the report renders in a PDF. --- Here is an example of report recently run: > Page 1 (NOTE: red boxes indicate personal data filtered out): ![Page 1](https://i.stack.imgur.com/GAaI7.jpg) --- Page 2: ![Page 2](https://i.stack.imgur.com/oqOYI.jpg) I've been fiddling with the properties and , but I have had no success. How do I make this column repeat? Sadists can check out the rdl file [here](http://home.windstream.net/ray023/ssrs/MyReport.rdl).
Can't Repeat Column Groups AND ALSO hide Static Columns within a Matrix
CC BY-SA 3.0
null
2011-04-26T15:11:10.717
2011-06-14T14:52:15.877
2011-06-14T14:52:15.877
250,385
250,385
[ "ssrs-2008" ]
5,792,427
1
5,820,723
null
1
7,822
I'm setting up a mail merge file that reads from a CSV file. In the CSV file, there are ~20 Boolean fields that produce the body of the Word mail merge file. The problem is that if the first 19 fields are all `"N"`, then the Word mail merge file will have 19 blank spaces and then output the 20th field underneath all of them. Is there any way to suppress the output of these blank lines using the built-in mail merge rules? --- Here's the header and a sample row of the CSV file: ``` "firstname","lastname","PRNT1040","LEGALGRD","ACADTRAN","STUD1040","VERWKSIN","VERWKSDP","UNEMPLOY","SSCARD","HSDPLOMA","DPBRTCFT","DEATHCRT","USCTZPRF","SLCTSERV","PROJINCM","YTDINCM","LAYOFFNT","MAJRCARS","W2FATHER","W2MOTHER","W2SPOUSE","W2STUDNT","2YRDEGRE","4YEARDEG","DPOVERRD" "Joe","Smith","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","N","Y" ``` Here's a couple lines of the mail merge file that I'm trying (image linked because copying and pasting of mail merge does not show original document) ![msword_mailmerge](https://i.stack.imgur.com/Y0IBK.png) --- Does anyone know how to get around this? I tried placing the `SKIPIF` in front of the conditionals, but that doesn't work either.
How do I suppress blank lines in a Microsoft Word 2007 mail merge?
CC BY-SA 3.0
null
2011-04-26T15:12:17.020
2012-10-26T10:54:51.320
2011-07-01T19:42:17.313
236,247
42,229
[ "csv", "ms-word", "rules", "conditional-statements", "mailmerge" ]
5,792,792
1
5,792,902
null
0
2,837
Example: I have 20 persons as object, and every person knows 0-n others. The direction of the link matters! A person A might know B, but B might not know A. It's a directed graph. So in the worst case everyone is connected with everyone else, everyone knows everyone else. This is no real use case but I want to write a test for this to learn and play around. In a productive environment the number of objects would be limited to about 20, but the ways in which those objects are connected to eachother are unlimited. This illustrates the problem in a simplified way: ![graph](https://i.stack.imgur.com/pV3wi.jpg) [thanks to source](http://labspace.open.ac.uk/course/view.php?id=5022) Given a specific person as starting point, I want to walk through the whole graph and examine every possible path exactly once without getting stuck in an infinite loop. Let's imagine person A knows B, who knows C, and who knows A. The output might be: A knows B knows C knows A (ok but we don't want to end in an infinite loop so we stop here) A knows C knows A A knows T knows R knows V This would be stupid and must be eliminated: A knows B knows C knows A knows C knows A knows T knows R knows V ... I do have a couple of crazy ideas how to tackle this problem. But... Question) Must I do that with an Iterative deepening depth-first search (IDDFS)? --- Jon was so kind to point out [DFS on Wikipedia](http://en.wikipedia.org/wiki/Depth-first_search) I'm stuck with this part in the article: ![wikipedia](https://i.stack.imgur.com/dWKma.png) > a depth-first search starting at A, assuming that the left edges in the shown graph are chosen before right edges, and assuming the search remembers previously-visited nodes and will not repeat them (since this is a small graph), will visit the nodes in the following order: A, B, D, F, E, C, G. The edges traversed in this search form a Trémaux tree, a structure with important applications in graph theory. specifically this note: > "(since this is a small graph)" OK so what if this is a huge graph?
Should I iterate over a directed graph using Iterative deepening depth-first search (IDDFS)?
CC BY-SA 3.0
null
2011-04-26T15:40:18.910
2011-04-26T17:08:14.150
2011-04-26T17:08:14.150
472,300
472,300
[ "algorithm", "graph", "artificial-intelligence", "neural-network" ]
5,793,106
1
null
null
1
1,835
Process Hacker has a process manager in C. When you double-click in process manager on a process e.g. Explorer You see a lot of info, including: Topics related to the process. PDD, Cycles Delta Start, Address, priority. Well I tried to do something similar in Delphi, but I get only the TID and priority ... I can not put the info Start Address as follows: "msiltcfg.dll 0x258!" or can only return 00630EFA. The (Original) Application Process Hacker show the information in the image below: ![http://i54.tinypic.com/mrcztx.png](https://i.stack.imgur.com/32AHa.png) How do I solve this? based on the code example below. ``` procedure TForm1.Button7Click (Sender: TObject); var tbi: THREAD_BASIC_INFORMATION; hThreadSnap, Process, hThread, ThreadInfo: THandle; te32: tagTHREADENTRY32; me32: MODULEENTRY32; th32: THREADENTRY32; dwPID: DWORD; startaddr: Pointer; Status: LongInt; Error: DWORD; modname: String; hToken: DWORD; TKP: TOKEN_PRIVILEGES; otkp: TOKEN_PRIVILEGES; dwLen: dword; begin hThreadSnap: = CreateToolhelp32Snapshot (TH32CS_SNAPTHREAD, 0); if hThreadSnap = INVALID_HANDLE_VALUE then Exit; try dwPID: = GetProcessID (Trim (Edit1.Text)); te32.dwSize: = SizeOf (THREADENTRY32); me32.dwSize: = SizeOf (MODULEENTRY32); ListBox1.Items.Clear; ListBox2.Items.Clear; if not Thread32First (hThreadSnap, te32) then Exit; repeat if te32.th32OwnerProcessID = dwPID then begin hThread: = OpenThread (THREAD_ALL_ACCESS, False, te32.th32ThreadID); status: = ZwQueryInformationThread (hThread, 9, ThreadQuerySetWin32StartAddress {} @Startaddr, SizeOf (startaddr) @ DwLen); listbox1.Items.AddObject (Format ('StartAddress:% p' [Startaddr]) + 'ID:' + IntToStr(te32.th32ThreadID), TObject (hThread)); if hThread <> 0 then CloseHandle (hThread); end; Until not Thread32Next (hThreadSnap, te32); finally CloseHandle (hThreadSnap); end; end; ```
Get Name / Description Startaddress Or From A Thread In A Process ( Delphi/Pascal )
CC BY-SA 3.0
0
2011-04-26T16:06:12.303
2011-04-26T21:47:39.217
2011-04-26T21:38:33.487
650,492
725,667
[ "windows", "delphi", "winapi" ]
5,793,397
1
5,793,475
null
6
525
I am finally working on my [n-point Pade code](https://stackoverflow.com/questions/5294376/using-fold-to-calculate-the-result-of-linear-recurrence-relying-on-multiple-previ), again, and I am running across an error that was not occurring previously. The heart of the matter revolves around this code: ``` zi = {0.1, 0.2, 0.3} ai = {0.904837, 1.05171, -0.499584} Quiet[ RecurrenceTable[ {A[0] == 0, A[1] == ai[[1]], A[n+1]==A[n] + (z - zi[[n]]) ai[[n+1]] A[n-1]}, A, {n, Length@ai -1 } ], {Part::pspec}] ``` (The use of `Quiet` is necessary as `Part` complains about `zi[[n]]` and `ai[[n+1]]` when `n` is purely symbolic.) The code itself is part of a function that I want a symbolic result from, hence `z` is a `Symbol`. But, when I run the above code I get the error: ``` RecurrenceTable::nlnum1: The function value {0.904837,0.904837+0. z} is not a list of numbers with dimensions {2} when the arguments are {0,0.,0.904837}. ``` Note the term `{0.904837,0.904837+0. z}` where `0. z` is not reduced to zero. What do I need to do to force it to evaluate to zero, as it seems to be the source of the problem? Are there alternatives? Additionally, as a general complaint about the help system for the Wolfram Research personnel who haunt stackoverflow: in v.7 `RecurrenceTable::nlnum1` is not searchable! Nor, does the `>>` link at the end of the error take you to the error definition, but takes you to the definition of `RecurrenceTable`, instead, where the common errors are not cross-referenced. : After reviewing my code, the solution I came up with was to evaluate the `RecurrenceTable` completely symbolically, including the initial conditions. The working code is as follows: ``` Clear[NPointPade, NPointPadeFcn] NPointPade[pts : {{_, _} ..}] := NPointPade @@ Transpose[pts] NPointPade[zi_List, fi_List] /; Length[zi] == Length[fi] := Module[{ap, fcn, rec}, ap = {fi[[1]]}; fcn = Module[{gp = #, zp, res}, zp = zi[[-Length@gp ;;]]; res = (gp[[1]] - #)/((#2 - zp[[1]]) #) &[Rest@gp, Rest@zp]; AppendTo[ap, res[[1]]]; res ] &; NestWhile[fcn, fi, (Length[#] > 1 &)]; (* The recurrence relation is used twice, with different initial conditions, so pre-evaluate it to pass along to NPointPadeFcn *) rec[aif_, zif_, a_, b_][z_] := Evaluate[RecurrenceTable[ {A[n + 1] == A[n] + (z - zif[n])*aif[n + 1]*A[n - 1], A[0] == a, A[1] == b}, A, {n, {Length@ap - 1}}][[1]]]; NPointPadeFcn[{zi, ap, rec }] ] NPointPadeFcn[{zi_List, ai_List, rec_}][z_] /; Length[zi] == Length[ai] := Module[{aif, zif}, zif[n_Integer] /; 1 <= n <= Length[zi] := zi[[n]]; aif[n_Integer] /; 1 <= n <= Length[zi] := ai[[n]]; rec[aif, zif, 0, ai[[1]]][z]/rec[aif, zif, 1, 1][z] ] Format[NPointPadeFcn[x_List]] := NPointPadeFcn[Shallow[x, 1]]; ``` Like the built-in interpolation functions, `NPointPade` does some pre-processing, and returns a function that can be evaluated, `NPointPadeFcn`. The pre-processing done by `NPointPade` generates the list of `ai`s from the `zi`s and the function values at those points, in addition to pre-evaluating the recurrence relations. When `NPointPadeFcn` is supplied with a `z` value, it evaluates two linear recurrence relations by supplying it with the appropriate values. : for the curious, here's `NPointPade` in operation ![NPointPade in action](https://i.stack.imgur.com/j2ZPb.jpg) In the first plot, it is difficult to tell the difference between the two functions, but the second plot shows the absolute (blue) and relative (red) errors. As written, it takes a very long time to create a Pade for 20 points, so I need to work on speeding it up. But, for now, it works.
Error in RecurrenceTable with symbolic input
CC BY-SA 3.0
0
2011-04-26T16:31:32.370
2011-04-27T00:49:13.657
2017-05-23T10:30:21.980
-1
198,315
[ "wolfram-mathematica" ]
5,793,487
1
null
null
2
329
I am looking to develop a webpage specifically for viewing on an iPhone/mobile browsers. The layout would be something like this: ![enter image description here](https://i.stack.imgur.com/8Fp4J.png) I would like the two tabs at the top to be fixed, i.e. they would always appear at the top of the viewport/screen, and the content in each tab to scroll (the height of the content in each tab would exceed the remaining available height, and so I would want this to scroll). Ideally there would also be a transition on switching tabs (perhaps a simple fade would work best with the graphics capability of the iPhone), though this is not essential. I would be grateful for any advice in getting this set up, Thanks, Nick
need help with iphone layout with fixed tabs and scrolling content
CC BY-SA 3.0
null
2011-04-26T16:37:10.383
2011-06-20T07:50:09.433
2011-04-26T17:33:15.030
21,234
672,147
[ "iphone", "layout", "scroll", "mobile-safari", "fixed" ]
5,793,639
1
5,800,394
null
5
3,276
For a school assignment me and a friend have been working on rendering a cube on a 2D surface(the screen) using a 2D-library(slick) To do this we use the method described here [3D-projection - Wikipedia the free encyclopedia](http://en.wikipedia.org/wiki/Perspective_projection#Perspective_projection). We use a 3x3 matrix to rotate the 3D-vectors which represents points on the cubes surface. Then We project the 3D vectors onto a plane(the screen) located on the positive X-axis using this method: ``` public Vector2D translate2D(Vector3D v){ Vector3D trans = translate(v);//Rotates the vector into position float w = -trans.getX()/(700) + 1; float x = (trans.getZ())/w; float y = (trans.getY())/w; return new Vector2D(x, y); } ``` where translate() rotates the vector into the correct position and w adds some perspective to the cube. I need to know which sides of the cube to render and which to not render(i e which are facing the viewer and which aren't). As long as you don't use perspective(w) this is easy. The cube always shows three sides to the user and to find these all you needed to do was: 1. Get the side's normal 2. Translate it using the rotational matrix 3. If the translated normals X-component was positive, then the side was facing the positive X-direction and therefore was to be visible to the viewer. This because the screen is located directly on the positive X-axis. Now, because of perspective, the viewer is facing 1-3 sides depending on the rotation of the cube. As mentioned I have access to each side's normal(unit vectors pointing straight away from each side) and the matrix which handles the rotation as well as the above method. (edit) Thank you for your answer horatius83 but here's my problem: I dont know he surfaces normal since the side's normal is slightly distorted due to the added perspective. Here are some images to describe my problem further Without perspective(side's normal=surface normal): ![enter image description here](https://i.stack.imgur.com/bNy6S.gif) With perspective showing 3 sides(side's normal!=surface normal): ![enter image description here](https://i.stack.imgur.com/hassB.gif) With perspective showing 3 sides but should only be showing 1(side's normal!=surface normal) ![enter image description here](https://i.stack.imgur.com/HFeuV.gif) (edit) the code determining whether the side should be rendered is very simple and not entirely correct since we're using the side's normal as if there was no perspective(as in image 1). If there is perspective this must be compensated for in some way. I just don't know how. ``` public boolean sideVisible(Vector3D normal){ if (translate(normal).getX()>0) { return true; }else{ return false; } } ```
Determining which side is facing the viewer on a 3D-cube
CC BY-SA 3.0
0
2011-04-26T16:51:11.563
2011-04-27T06:42:30.947
2011-04-26T20:46:23.393
702,065
702,065
[ "java", "3d" ]
5,793,760
1
5,794,028
null
2
7,577
This is my very first C program and I'm using this example libcurl code from their website: ``` #include <stdio.h> #include <curl/curl.h> int main(void) { CURL *curl; CURLcode res; curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "https://google.com/"); #ifdef SKIP_PEER_VERIFICATION /* * If you want to connect to a site who isn't using a certificate that is * signed by one of the certs in the CA bundle you have, you can skip the * verification of the server's certificate. This makes the connection * A LOT LESS SECURE. * * If you have a CA cert for the server stored someplace else than in the * default bundle, then the CURLOPT_CAPATH option might come handy for * you. */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L); #endif #ifdef SKIP_HOSTNAME_VERFICATION /* * If the site you're connecting to uses a different host name that what * they have mentioned in their server certificate's commonName (or * subjectAltName) fields, libcurl will refuse to connect. You can skip * this check, but this will make the connection less secure. */ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L); #endif res = curl_easy_perform(curl); /* always cleanup */ curl_easy_cleanup(curl); } return 0; } ``` So in xcode I created a "group" called it curl and added all the files in the curl directory: ![enter image description here](https://i.stack.imgur.com/iAs4b.png) And now I'm getting these Build errors: ![enter image description here](https://i.stack.imgur.com/Rv09x.png) What am I doing wrong? Any advice would help, thanks!
Including libcurl in C project
CC BY-SA 3.0
0
2011-04-26T17:00:52.900
2015-12-30T18:10:37.713
null
null
242,934
[ "c", "libcurl" ]
5,793,908
1
5,794,293
null
2
3,130
I have went through countless examples of webview with buttons and can't get any of them to show my buttons. Below is my last layout and it looks correct in eclipse but the website goes full screen when run on the phone. ![enter image description here](https://i.stack.imgur.com/dThLF.png) Any help would be great! Kind Regards, Mike
Webview with buttons on the bottom of the view
CC BY-SA 3.0
null
2011-04-26T17:11:52.983
2011-04-27T04:12:40.423
2011-04-26T18:34:05.037
724,209
724,209
[ "android", "button", "webview" ]
5,794,039
1
5,794,155
null
19
43,227
Here is the design of the control I want to create: ![sample design](https://i.stack.imgur.com/DOKTl.jpg) As you can see, it's easy to create the design except the browse button of upload control. I created the rest. I've been searching about changing the place of Browse button but could not find anything useful. So, how to do that? There was an idea like embedding an unvisible upload control over button but any other advice is golden, thanks.
How Can I Create a Custom File Upload With Only HTML, JS and CSS
CC BY-SA 3.0
0
2011-04-26T17:22:48.257
2016-07-01T22:54:25.717
2013-05-31T11:52:16.797
705,982
705,982
[ "javascript", "html", "css" ]
5,794,063
1
null
null
93
153,926
IIS7 Windows 7 64bit No matter what I do I can't seem to add an application to a web site. When I 'Test settings' I get "Invalid application path". Any one have a guess as to what I could be doing wrong? ![screenshot](https://i.stack.imgur.com/DYmPJ.jpg)
Invalid application path
CC BY-SA 3.0
0
2011-04-26T17:24:28.577
2019-05-14T11:26:20.193
2015-01-06T21:39:18.597
153,923
526,951
[ "iis-7" ]
5,794,074
1
5,794,214
null
2
3,781
Now what I am doing is having a text nav but then on hover still keeping the text but using an image as the background. Because the text is varying sizes & the background image is one size it's becoming a problem because I only have 597px to work within for the nav area & I also want the same amount of spacing between each nav selection. I want this for example.. ![enter image description here](https://i.stack.imgur.com/QmxYS.png) But currently I am getting this: ![enter image description here](https://i.stack.imgur.com/TLpD8.png) The nav background image is 87px in width, so obviously it's wrapping because we don't have enough space. But we also end up with varying amounts of space between each nav item because each is set to 87px. So I was wondering if there was any clean way to do what I want without using javascript & without the nav items jumping around when hovering over others? I've tried putting differing widths on the different states but the nav just jumped around & looked terrible. Any idea to do what I'm wanting? If you would like to see my current HTML & CSS it's below: HTML: ``` <div class="nav_wrapper"> <ul class="nav"> <li><a href="index.php">HOME</a></li> <li><a href="about.php">ABOUT US</a></li> <li><a href="services.php">SERVICES</a></li> <li><a href="our_process.php">OUR PROCESS</a></li> <li><a href="portfolio.php">OUR WORK</a></li> <li><a href="">BLOG</a></li> <li><a href="free_quote.php">FREE QUOTE</a></li> <li><a href="contact_us.php">CONTACT US</a></li> </ul> <!-- Nav Ends --> <div class="contentClear"></div> </div> <!-- Nav Wrapper Ends --> ``` CSS: ``` #header .nav_wrapper { float: left; width: 597px; margin: 30px 0 0 50px; } #header .nav_wrapper .nav { list-style-type: none; list-style-image: none; } #header .nav_wrapper li { float: left; height: 23px; min-width: 87px; font-family: "Zurich Cn BT", Tahoma; font-size: 12px; text-align: center; } ul.nav li a, ul.nav li a:visited, ul.nav li a:focus { display: block; line-height: 23px; color: #764422; text-decoration: none; } ul.nav li a:hover, ul.nav li a:active { color: #fff; text-decoration: none; background-image: url(../images/nav-bg.png); } ```
Having issue with CSS hover with different hover size
CC BY-SA 3.0
0
2011-04-26T17:25:24.357
2012-08-28T18:37:58.973
2012-08-28T18:37:58.973
5,640
472,501
[ "hover", "css" ]
5,794,246
1
5,794,275
null
3
2,370
I've just begun using breakpoints to debug a T-SQL stored procedure in Management Studio (SQL Server 2008). I notice that the breakpoints window has a condition column: ![enter image description here](https://i.stack.imgur.com/bJqTJ.png) But I can't find any way to actually on a breakpoint, not via the Debug menu, not via a context menu on the breakpoint or within the breakpoint window, etc. Is there a way to use conditional breakpoints in SSMS, or does that column exist for some future version?
Can conditional breakpoints be set while debugging in SSMS?
CC BY-SA 3.0
null
2011-04-26T17:38:41.527
2020-03-21T11:49:22.433
null
null
238,688
[ "sql-server-2008", "debugging", "ssms", "conditional-breakpoint" ]
5,794,239
1
5,794,618
null
0
1,464
i have many to many throught asociation and then i do this ``` fields_for :device ``` this displaying in good way, but i cannot save it i get unknown attribute :price ![fields_for :device](https://i.stack.imgur.com/a7vUe.png) And `fields_for :devices` ![field_for :devices](https://i.stack.imgur.com/swauG.png) And so on, one device makes one more repeat, if i write f`.fields_for :price` it gives good text field count, but it write ``` unknown attribute: price Rails.root: C:/Users/Ignas/mildai/baze4 Application Trace | Framework Trace | Full Trace app/controllers/commercial_offers_controller.rb:74:in `block in update' app/controllers/commercial_offers_controller.rb:73:in `update' ``` thank you additional information: controller ``` def edit_prices @commercial_offer = CommercialOffer.find(params[:id]) end ``` link to edit prices ``` <%= link_to "Edit prices", :controller => "CommercialOffers", :action => "edit_prices", :id => @commercial_offer %> ``` _edit_price.html.erb ``` <%= form_for @commercial_offer do |f| %> <% CommercialOffer.find(params[:id]).devices.each do |device| %> <%= check_box_tag "commercial_offer[device_ids][]", device.id, @commercial_offer.devices.include?(device) %> <%= device.name %> <%= f.fields_for :prices do |builder| %> <%= render 'prices/new_price', :f => builder, :commercial_offer => @commercial_offer, :device => device %> <% end %> <% end %> <div class="actions"> <%= f.submit "Save"%> </div> <% end %> ``` for one device it have render only one time, but it rendering for one device such times how many devices is with same commercial_offer_id ``` _new_price.html.erb Price: <%= f.text_field :price %></br> Quantity: <%= f.text_field :quantity %></br> Device id: <%= f.text_field :device_id, :value => device.id %></br> class CommercialOffer < ActiveRecord::Base has_many :prices has_many :devices, :through => :prices accepts_nested_attributes_for :prices accepts_nested_attributes_for :devices end class Device < ActiveRecord::Base has_many :prices accepts_nested_attributes_for :prices has_many :commercial_offer, :through => :prices class Price < ActiveRecord::Base belongs_to :device belongs_to :commercial_offer end ```
Nested forms fields_for :prices, repeat forms few time
CC BY-SA 3.0
null
2011-04-26T17:38:10.717
2011-04-26T20:34:53.713
2011-04-26T19:06:18.863
332,719
332,719
[ "ruby-on-rails-3", "nested-forms", "nested-attributes" ]
5,794,499
1
5,794,626
null
3
7,083
I try to create a TableLayout with multi rows, and each row is having different columns The following show list view. For each row of list view, it contains a table layout with only 1 row, 2 columns. ``` <?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="?android:attr/listPreferredItemHeight" android:padding="6dip"> <ImageView android:id="@+id/color_label" android:layout_width="12dip" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:background="#ffffff" /> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1"> <TableRow> <TextView android:id="@+id/toptext" android:gravity="left" /> <TextView android:id="@+id/bottomtext" android:gravity="right" /> </TableRow> <View android:layout_height="2dip" android:background="#FF909090" /> </TableLayout> </LinearLayout> ``` Here is the outcome. ![enter image description here](https://i.stack.imgur.com/9PGi9.png) Later, I want to further improve the TableLayout. With its 1st row is having 2 columns. and its 2nd row is having 4 columns, with a vertical line separates 1,2 columns with 3,4 columns. I use the following code. ``` <?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="?android:attr/listPreferredItemHeight" android:padding="6dip"> <ImageView android:id="@+id/color_label" android:layout_width="12dip" android:layout_height="fill_parent" android:layout_marginRight="6dip" android:background="#ffffff" /> <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:stretchColumns="1"> <TableRow> <TextView android:id="@+id/toptext" android:gravity="left" /> <TextView android:id="@+id/bottomtext" android:gravity="right" /> </TableRow> <View android:layout_height="2dip" android:background="#FF909090" /> <TableRow> <TextView android:id="@+id/col1" android:gravity="left" android:text="Column 1" /> <TextView android:id="@+id/col2" android:gravity="right" android:text="Column 2" /> <TextView android:id="@+id/col3" android:gravity="left" android:text="Column 3" /> <TextView android:id="@+id/col4" android:gravity="right" android:text="Column 4" /> </TableRow> <View android:layout_height="2dip" android:background="#FF909090" /> </TableLayout> </LinearLayout> ``` Here is the outcome. ![enter image description here](https://i.stack.imgur.com/zwpe5.png) However, the 2nd row of table layout is not something I want. What I wish to have is something like this. ![enter image description here](https://i.stack.imgur.com/COa4N.jpg) How can I improve my XML to achieve the above effect?
TableLayout with different columns at different rows
CC BY-SA 3.0
0
2011-04-26T18:02:39.540
2011-04-26T18:14:38.757
null
null
72,437
[ "android" ]
5,794,588
1
5,794,771
null
0
149
I've got an annoying issue, if someone needs additional information please say, as I'm not sure what I should put up here to make the question clearer! In the first picture I have the current layout, I wanted to move the star ratings to below the pictures in the dashed div of the other users. But when I do it , everything gets fugly, as you can see in the second picture. Does anyone know what I should be looking at to ensure the stars end up below the div with pictures of hte images. I've put my css at the bottom. ![enter image description here](https://i.stack.imgur.com/ICP3v.png) ![enter image description here](https://i.stack.imgur.com/NUtiP.png) ``` #gallery { margin-left:auto; margin-right:auto; background:#EEE; float: left; border: width: 500px; solid 1px #BBBBBB ; border-style: dashed; } * html #gallery { height: 12em; } /* IE6 */ .gallery.custom-state-active { background: #eee; } .gallery li { float: left; width: 96px; height:86px padding: 0.4em; margin: 0.4em 0.4em 0.4em 0.4em; text-align: center; } .gallery li h5 { margin: 0 0 0.4em; cursor: move; } .gallery li a { float: right; } ```
Push list under a div
CC BY-SA 3.0
null
2011-04-26T18:11:06.820
2011-04-26T19:00:34.453
null
null
84,278
[ "html", "css", "layout" ]
5,794,646
1
5,796,037
null
2
877
On this OpenGL application that I'm developing on Windows 7 with Visual Studio, I tried to enable Anti-Aliasing on the NVIDIA Control Panel (only for the application .exe). Enabling that causes a little bit of distortion in lines/quads drawn in orthographic projection. Anti-aliasing is turned off on the left and turned on on the right: ![anti-aliasing issue](https://i.stack.imgur.com/qrCmv.png) How can this be fixed keeping anti-aliasing on? In case it's relevant, here's how the orthographic projection is setup and how black border is drawn: ``` void drawHeadsUpDisplay(void) { static int winWidth, winHeight; winWidth = glutGet(GLUT_WINDOW_WIDTH); winHeight = glutGet(GLUT_WINDOW_HEIGHT); glPushAttrib(GL_ENABLE_BIT); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glMatrixMode(GL_PROJECTION); glPushMatrix(); glLoadIdentity(); gluOrtho2D(0.0f, winWidth, winHeight, 0.0f); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glBegin(GL_LINE_LOOP); glColor3f(0.0f, 0.0f, 0.0f); glVertex2f(winWidth - 41, 48); glVertex2f(winWidth - 41, winHeight - 48); glVertex2f(winWidth - 18, winHeight - 48); glVertex2f(winWidth - 18, 48); glEnd(); glMatrixMode(GL_PROJECTION); glPopMatrix(); glMatrixMode(GL_MODELVIEW); glPopAttrib(); } ```
Enabling Anti-Aliasing in NVIDIA Control Panel causes line distortion in orthographic projection
CC BY-SA 3.0
null
2011-04-26T18:16:19.793
2011-04-27T09:53:30.530
2011-04-27T09:53:30.530
40,480
40,480
[ "opengl", "drawing", "antialiasing", "nvidia", "orthographic" ]
5,794,732
1
5,794,815
null
0
125
![enter image description here](https://i.stack.imgur.com/eRgIZ.png) As you can see in the picture above, a ClickOnce application is being run directly off of a webpage to be installed. Is there a way to mimic this ability? I plan on making my own installer but I want installing the software to be as easy and fast as possible (my software is aimed towards teens and older children). Does anybody have any ideas? I'm using vb.net so any .net examples are appreciated. Thanks if you can! I don't, however, need people to tell me alternate methods than the one proposed. This is the way I'm doing it and how it needs to be :) Basically, once you click on a link in a browser, a similar dialog will pop-up asking (instead of saying "Install // Don't Install") if you would like to run the program?
Mimicking click once behavior
CC BY-SA 3.0
null
2011-04-26T18:24:23.413
2011-04-26T20:38:01.373
null
null
595,437
[ ".net", "vb.net", "installation", "clickonce" ]
5,794,837
1
null
null
3
714
In Silverlight 4 (using Expression Blend 4), how can I alter the Font size of a `TextBox` within the style of the `Border` containing it? I'm converting the style from WPF to Silverlight (fun always). Here is what I have: ``` <Style x:Key="Title" TargetType="Border"> <Setter Property="TextBlock.VerticalAlignment" Value="Center"/> <Setter Property="TextBlock.TextAlignment" Value="Center"/> <Setter Property="TextBlock.FontSize" Value="48"/> <Setter Property="TextBlock.Foreground" Value="{StaticResource TextForeground}"/> <Setter Property="VerticalAlignment" Value="Top"/> <Setter Property="HorizontalAlignment" Value="Stretch"/> <Setter Property="Background" Value="{StaticResource TitleBackground}"/> <Setter Property="Padding" Value="25,0"/> </Style> ``` It is not working. It gives me the following exception in the designer: ![enter image description here](https://i.stack.imgur.com/ecKYO.png) Ok, I know this is possible in WPF. Is it simply not possible in Silverlight (without taking on a whole theme construct as Xin suggests?)
Applying Style to child elements in Silverlight 4
CC BY-SA 3.0
0
2011-04-26T18:33:54.503
2011-05-06T13:22:55.720
2011-05-06T13:22:55.720
443,602
443,602
[ "silverlight", "styles" ]
5,795,465
1
null
null
0
120
On my site hiphopcanvass.com I added the blogroll in the footer. I want the height to be a certain size, right now its on auto. If the content of the blogroll gets to that height then it will display on the other side until its fully across. What i want can be seen in the image below. ![enter image description here](https://i.stack.imgur.com/k4c6b.png)
How do i make a list <li> display freely instead of down?
CC BY-SA 3.0
null
2011-04-26T17:48:33.827
2011-04-28T00:18:34.763
null
null
null
[ "hyperlink" ]
5,795,921
1
5,806,043
null
1
1,950
Today I wrote a program for detecting circles using Hough Transform using OpenCV in C. The program inputs 3 images, each image contains a fixed small circle and a big circle with variable position. The program then recognizes both the circles and marks the centres of both the circles. Now what I want to do is that in the output image the (x,y) coordinates of the centre of the bigger circle should be displayed with respect to the centre of the fixed smaller circle . Here's the code for 'circle.cpp' ``` #include <cv.h> #include <highgui.h> #include <math.h> int main(int argc, char** argv) { IplImage* img; int n=3; char input[21],output[21]; for(int l=1;l<=n;l++) { sprintf(input,"Frame%d.jpg",l); // Inputs Images if( (img=cvLoadImage(input))!= 0) { IplImage* gray = cvCreateImage( cvGetSize(img), IPL_DEPTH_8U, 1 ); IplImage* canny=cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,1); IplImage* rgbcanny=cvCreateImage(cvGetSize(img),IPL_DEPTH_8U,3); CvMemStorage* storage = cvCreateMemStorage(0); cvCvtColor( img, gray, CV_BGR2GRAY ); cvSmooth( gray, gray, CV_GAUSSIAN, 9, 9 ); // smooth it, otherwise a lot of false circles may be detected cvCanny(gray,canny,50,100,3); CvSeq* circles = cvHoughCircles( canny, storage, CV_HOUGH_GRADIENT, 2, gray->height/4, 200, 100 ); int i; cvCvtColor(canny,rgbcanny,CV_GRAY2BGR); for( i = 0; i < circles->total; i++ ) { float* p = (float*)cvGetSeqElem( circles, i ); cvCircle( rgbcanny, cvPoint(cvRound(p[0]),cvRound(p[1])), 3, CV_RGB(0,255,0), -1, 8, 0 ); cvCircle( rgbcanny, cvPoint(cvRound(p[0]),cvRound(p[1])), cvRound(p[2]), CV_RGB(255,0,0), 3, 8, 0 ); } cvNamedWindow( "circles", 1 ); cvShowImage( "circles", rgbcanny ); //Displays Output images sprintf(output,"circle%d.jpg",l); cvSaveImage(output,rgbcanny); cvWaitKey(0); } } return 0; } ``` And here are the input and output images: ![enter image description here](https://i.stack.imgur.com/0vCe0.png) ![enter image description here](https://i.stack.imgur.com/7RlHP.jpg) ![enter image description here](https://i.stack.imgur.com/KxMei.jpg) ![enter image description here](https://i.stack.imgur.com/y9aGq.jpg) ![enter image description here](https://i.stack.imgur.com/cuAva.jpg) ![enter image description here](https://i.stack.imgur.com/TscrG.jpg) Please suggest what changes should I make in the code to display the desired (x,y)coordinates. Thanx a lot :)
How to find the coordinates of a point w.r.t another point on an image using OpenCV
CC BY-SA 3.0
null
2011-04-26T20:15:56.960
2011-04-27T18:09:05.603
null
null
407,419
[ "image-processing", "opencv", "image-recognition", "hough-transform" ]
5,795,965
1
null
null
1
861
Am not even sure if this can be done but... Ive added a feed from my forums to wordpress it works great but I need it to auto add the url of the image in a custom field from the images in the post (feed) first image would be fine as its only ahve a slider Is there any way to do this? Ok I think I did not explain this very well so made a few screen shots ![enter image description here](https://i.stack.imgur.com/oAaUs.jpg) This is my slider at the minute with my ![enter image description here](https://i.stack.imgur.com/edqLX.jpg) This is an imported post one other feed I was using ![enter image description here](https://i.stack.imgur.com/RhFVP.jpg) On this image you can see the custom field (which I have to fill in after every import) ![enter image description here](https://i.stack.imgur.com/i9H5o.jpg) Adding the image url into the custom field ![enter image description here](https://i.stack.imgur.com/UcF5I.jpg) and finaly a view of the slider working This is what am trying to do (auto) so my feed from my booru / forums / 2 other of my sites and (2 other peoples) sites make my home page on a new site Hope this explain it alot more
The url from an image via custom field (wordpress)
CC BY-SA 3.0
null
2011-04-26T20:19:26.080
2011-04-28T08:19:25.943
2011-04-28T08:19:25.943
72,882
638,278
[ "image", "wordpress", "field" ]
5,795,990
1
5,806,092
null
3
871
I would like to draw a popup in X11. Something like the slider that appears in KDE and GNOME when you press volume or brightness control buttons. This is what it looks like in GNOME: ![brightness slider in GNOME](https://i.stack.imgur.com/R4hvC.png) What library should I use to create such popups (unlike normal windows they should be without borders, etc. and possibly with some transparency)? Would be nice if there were bindings for Python.
Drawing popups in X11
CC BY-SA 3.0
0
2011-04-26T20:21:23.960
2011-07-17T15:50:42.970
2011-07-17T15:50:42.970
635,608
506,367
[ "user-interface", "x11", "xorg" ]
5,796,317
1
5,796,353
null
1
317
How do you add data providers to the "Data Source Configuration Wizard"? I'd like to add Paradox to this list. Is it possible? Thanks ![enter image description here](https://i.stack.imgur.com/6VhIv.jpg)
How do you add data providers to the "Data Source Configuration Wizard" in VS2010
CC BY-SA 3.0
null
2011-04-26T20:53:04.127
2011-04-26T20:56:37.770
null
null
107,421
[ "database", "visual-studio-2010", "provider", "paradox" ]
5,796,457
1
null
null
19
2,273
Main purpose of application I'm working on in WPF is to allow editing and consequently printing of songs lyrics with guitar chords over it. You have probably seen chords even if you don't play any instrument. To give you an idea it looks like this: ``` E E6 I know I stand in line until you E E6 F#m B F#m B think you have the time to spend an evening with me ``` But instead of this ugly mono-spaced font I want to have `Times New Roman` font with kerning for both lyrics and chords (chords in bold font). And I want user to be able to edit this. This does not appear to be supported scenario for `RichTextBox`. These are some of the problems that I don't know how to solve: - `TextPointer` . ``` E E6 I know !!!SOME TEXT REPLACED HERE!!! in line until you ``` - . ``` E E6 think you have the time to spend an F#m B F#m B evening with me ``` - . ``` F#m E6 ...you have the ti me to spend... ``` - `Ta VA``A`![kering right](https://i.stack.imgur.com/O34zN.png)![enter image description here](https://i.stack.imgur.com/TioPC.png)`V``A``<TextBlock FontFamily="Times New Roman" FontSize="60">Ta VA</TextBlock>``<TextBlock FontFamily="Times New Roman" FontSize="60"><Span>Ta V<Floater />A</Span></TextBlock>` Any ideas on how to get `RichTextBox` to do this ? Or is there better way to do it in WPF? Will I sub-classing `Inline` or `Run` help? Any ideas, hacks, `TextPointer` magic, code or links to related topics are welcome. --- ## Edit: I'm exploring 2 major directions to solve this problem but both lead to another problems so I ask new question: 1. Trying to turn RichTextBox into chords editor - Have a look at How can I create subclass of class Inline?. 2. Build new editor from separate components like Panels TextBoxes etc. as suggested in H.B. answer. This would need a lot of coding and also led to following (unsolved) problems: Components will change their Width/Height according to they layout position (white space removal at line beginning etc.) Kerning will have to be inserted manually at components boundaries. How to make RichTextBox look like TextBlock? (not elegant hack/workaround is known) --- ## Edit#2 [Markus Hütter's high quality answer](https://stackoverflow.com/questions/5796457/create-guitar-chords-editor-in-wpf-from-richtextbox/5845927#5845927) has shown me that a lot more can be done with `RichTextBox` then I expected when I was trying to tweak it for my needs myself. I've had time to explore the answer in details only now. Markus might be `RichTextBox` magician I need to help me with this but there are some unsolved problems with his solution as well: 1. This application will be all about "beautifully" printed lyrics. The main goal is that the text looks perfect from the typographic point of view. When chords are too near to each other or even overlapping Markus suggests that I iteratively add addition spaces before its position until their distance is sufficient. There is actually requirement that the user can set minimum distance between 2 chords. That minimum distance should be honored and not exceeded until necessary. Spaces are not granular enough - once I add last space needed I'll probably make the gap wider then necessary - that will make the document look 'bad' I don't think it could be accepted. I'd need to insert space of custom width. 2. There could be lines with no chords (only text) or even lines with no text (only chords). When LineHeight is set to 25 or other fixed value for whole document it will cause lines with no chords to have "empty lines" above them. When there are only chords and no text there will be no space for them. There are other minor problems but I either think I can solve them or I consider them not important. Anyway I think Markus's answer is really valuable - not only for showing me possible way to go but also as a demonstration of general pattern of using `RichTextBox` with adorner.
Create guitar chords editor in WPF (from RichTextBox?)
CC BY-SA 3.0
0
2011-04-26T21:06:15.460
2019-01-02T05:49:46.170
2019-01-02T05:49:46.170
1,293,501
311,865
[ ".net", "wpf", "user-interface", "richtextbox", "music-notation" ]
5,796,507
1
5,815,070
null
2
2,487
I have been working on a project where I need to load a ssrs site within an iframe. The iframe is acutally using the telerik spitter panels but the DOM refers to it as an iframe when rendered. The issue I am coming into is when referencing the SSRS site it loads wihtin the iframe but the view tiled multiple times over. In reading I have seen mention that the SSRS site also uses iframes which causes an issue when loaded into another iframe. Does anyone know of a solution for this type of scenario or can you point me in the right direction of where to look? In essence I have to wrap an asp.net wrapper around the SSRS site as it is a part of a larger site and users need to be able to navigate to this section of the site using the main navigation. I need to avoid pop-up windows or redirects as the user needs to get the expereince that they are in the same site even though I am loading ssrs from another server. Attached is a screen shot of what the tiling looks like. The site is small so I am not using masterpages it is loaded directly within an asp.net document. ![enter image description here](https://i.stack.imgur.com/RmM3p.png) Any tips or suggestions are always appreciated. Thank you
how to properly display SSRS site within iframe
CC BY-SA 3.0
0
2011-04-26T21:11:20.307
2011-04-28T07:19:37.840
null
null
290,645
[ "asp.net", "iframe", "ssrs-2008" ]
5,796,556
1
null
null
0
168
I am getting a memory leak on the following code line: ![enter image description here](https://i.stack.imgur.com/GWQEh.png) The code-line: ``` NSArray *fetchedObjects = [qContext executeFetchRequest:fetchRequest error:&error]; ``` I have been trying to read-up on this and have tried to find the cause of this for quite some time, without success. Could someone give me a hint where to look? ...and do i understand the "100%" correctly that it indicate that this code line is 100% causing the leak? Some more code: ``` //=========PREPARE CORE DATA DB===========// if (managedObjectContext == nil) { managedObjectContext = [(FamQuiz_R0_1AppDelegate *) [[UIApplication sharedApplication] delegate] managedObjectContext]; } // Define qContext NSManagedObjectContext *qContext = [self managedObjectContext]; NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"questions" inManagedObjectContext:qContext]; [fetchRequest setEntity:entity]; NSArray *fetchedObjects = [qContext executeFetchRequest:fetchRequest error:&error]; for (NSManagedObject *info in fetchedObjects) { if ([[info valueForKey:@"qDiff"] intValue] == 1) { [allEasyArrayQ addObject:[info valueForKey:@"idQ"]]; } else if ([[info valueForKey:@"qDiff"] intValue] == 2) { [allMediumArrayQ addObject:[info valueForKey:@"idQ"]]; } else if ([[info valueForKey:@"qDiff"] intValue] == 3) { [allHardArrayQ addObject:[info valueForKey:@"idQ"]]; } } ```
Memory leak problem, could someone explain what this mean?
CC BY-SA 3.0
null
2011-04-26T21:16:17.060
2011-04-27T09:07:37.260
2011-04-26T21:56:43.530
418,332
418,332
[ "iphone", "objective-c", "memory-leaks" ]
5,796,619
1
5,796,799
null
0
133
I was wondering if there was an easy way to add parameters to a service connection? Essentially I want to do something as simple as passing a integer through a service connection where all available methods have the ability to access this parameter. Here's a diagram of the design: ![enter image description here](https://i.stack.imgur.com/L6jMo.jpg) Essentially application servers will get an id that can be passed when communicating with a WCF services for many reasons. Is there an easy way to integrate this functionality into a wcf service to be used by methods at runtime? The functionality I'm looking for is something like: Service1Client myService = new Service1Client(); myService.customValue = 1234; That will be passed globally to all methods within that service.
Extend WCF declaration to add parameter entry?
CC BY-SA 3.0
null
2011-04-26T21:21:42.147
2011-04-26T21:41:10.867
null
null
479,775
[ "c#", "asp.net", "wcf", "service" ]
5,797,307
1
5,798,450
null
1
518
I have an .NET web service which I'm calling with the following code: ``` <cfinvoke webservice="http://server01/customer.asmx?WSDL" refreshwsdl="true" method="NotesList" returnvariable="aTemp"> <cfinvokeargument name="SessionID" value="#arguments.SessionID#"/> <cfinvokeargument name="CustomerCode" value="#arguments.CustomerCode#"/> </cfinvoke> ``` The web service schema is as follows: ![enter image description here](https://i.stack.imgur.com/MPmag.gif) I want to extract the xml value in the "MessageXML" node. If I dump out the return var "aTemp", I get the following: ![enter image description here](https://i.stack.imgur.com/OxBh2.gif) How do I get the raw XML?? If I dump out the method getMessageXML(), I get the following: ![enter image description here](https://i.stack.imgur.com/0If7k.gif) How do I get the raw XML? I'm obviously missing something.
.net to coldfusion web service xml parsing
CC BY-SA 3.0
null
2011-04-26T22:37:20.030
2011-04-27T01:45:56.650
null
null
460,114
[ "asp.net", "xml", "web-services", "coldfusion" ]
5,797,322
1
5,797,504
null
2
1,186
I have view table that looks like this: ![enter image description here](https://i.stack.imgur.com/BRFMH.png) And I started to create a view to summarize by status for each currency: ``` WITH C AS (SELECT * FROM CampaignsPublisherReportSummary) SELECT 'Total' T, SUM(CASE WHEN PayCurrency='USD' THEN Total END) USD, SUM(CASE WHEN PayCurrency='EUR' THEN Total END) EUR, SUM(CASE WHEN PayCurrency='GBP' THEN Total END) GBP, SUM(CASE WHEN PayCurrency='AUD' THEN Total END) AUD FROM C UNION SELECT 'ToBePaid' T, SUM(CASE WHEN PayCurrency='USD' THEN ToBePaid END) USD, SUM(CASE WHEN PayCurrency='EUR' THEN ToBePaid END) EUR, SUM(CASE WHEN PayCurrency='GBP' THEN ToBePaid END) GBP, SUM(CASE WHEN PayCurrency='AUD' THEN ToBePaid END) AUD FROM C GO ``` ![enter image description here](https://i.stack.imgur.com/4gEXK.png) I could finish and get what I want by copy/pasting again for each of the other status (Unverified, Verified, ...etc) but the programmer in me wants to have some kind of function that takes the the status name and runs a templatized version of the query... QUESTION: Can I do this? Or is there another better way to break the information down that I'm missing? UPDATE: My goal is to have something like this: ``` SELECT * FROM #mytempfunc('Total') UNION SELECT * FROM #mytempfunc('ToBePaid') UNION ... ```
how do i create a (temporary?) stored procedure to assist making a summary view?
CC BY-SA 3.0
0
2011-04-26T22:41:11.010
2011-04-26T23:06:24.380
2011-04-26T22:48:03.227
398,546
398,546
[ "sql-server", "tsql", "stored-procedures", "view", "pivot-table" ]
5,797,335
1
5,797,405
null
2
1,584
I'm building a little sticky notes app for fun, and sometimes this happens: ![](https://i.imgur.com/672oL.png) (It's because the first word is wider than the width of the note.) Is there a way to check whether the scrollbar is present with Javascript? If I can do that, I can resize the note until it contains the text without the scrollbar.
Check if scrollbars are present with Javascript?
CC BY-SA 3.0
null
2011-04-26T22:42:58.923
2014-04-18T11:05:11.317
2014-04-18T11:05:11.317
1,266,650
null
[ "javascript", "css", "width", "scrollbar", "overflow" ]
5,797,342
1
5,811,160
null
3
1,445
![Leaks](https://i.stack.imgur.com/aYJNb.png) Every few weeks I check my application for memory leaks using instruments ( awesome tool, really ). As you can see in the screenshots there are a few memory leaks in it. I used to ignore these as I never really knew why they were there and they didn't seem to increase anyways. They are created on launch and well.. thats all I know about them. Anyone any ideas on how I can figure out what library or part of my code is causing these leaks? -- thanks
Strange memory leaks showing up in Instruments
CC BY-SA 3.0
null
2011-04-26T22:43:49.403
2011-04-27T22:02:52.063
null
null
257,116
[ "objective-c", "cocoa", "xcode", "memory-leaks", "instruments" ]
5,797,453
1
5,797,782
null
0
2,439
Good day, I have been given an assignment that gets data off a CSV file. The CSV file contains the following entries: LName,FName,Dept,Grade,Gross Pay, Tax Paid, Net Pay. I am able to retrieve the data and display it in the console window which is shown in my code below. However, I need help with displaying the results according to dept and getting the total net pay in each dept. There are three depts M, R, And S. ![sample Output](https://i.stack.imgur.com/fqzK6.jpg) ``` class DisplayEmpData { public void DisplayEmp() { Console.Clear(); Console.WriteLine("****************************************************************************"); Console.WriteLine("****************************************************************************"); Console.WriteLine("** **"); Console.WriteLine("** Payroll System **"); Console.WriteLine("** Employee Data Display **"); Console.WriteLine("****************************************************************************"); Console.WriteLine("****************************************************************************"); List<string> columns; List<Dictionary<string, string>> myData = GetData(out columns); foreach (string column in columns) { Console.Write("{0,-9}", column); } Console.WriteLine(); foreach (Dictionary<string, string> row in myData) { foreach (string column in columns) { Console.Write("{0,-9}", row[column]); } Console.WriteLine(); } Console.ReadKey(); } private static List<Dictionary<string, string>> GetData(out List<string> columns) { string line; string[] stringArray; char[] charArray = new char[] { ',' }; List<Dictionary<string, string>> data = new List<Dictionary<string, string>>(); columns = new List<string>(); try { FileStream aFile = new FileStream(@"..\..\EmployeeDetails.txt", FileMode.Open); StreamReader sr = new StreamReader(aFile); // Obtain the columns from the first line. // Split row of data into string array line = sr.ReadLine(); stringArray = line.Split(charArray); for (int x = 0; x <= stringArray.GetUpperBound(0); x++) { columns.Add(stringArray[x]); } line = sr.ReadLine(); while (line != null) { // Split row of data into string array stringArray = line.Split(charArray); Dictionary<string, string> dataRow = new Dictionary<string, string>(); for (int x = 0; x <= stringArray.GetUpperBound(0); x++) { dataRow.Add(columns[x], stringArray[x]); } data.Add(dataRow); line = sr.ReadLine(); } sr.Close(); return data; } catch (IOException ex) { Console.WriteLine("An IO exception has been thrown!"); Console.WriteLine(ex.ToString()); Console.ReadLine(); return data; } } } ``` Can someone please help me?
Sorting data received from a CSV files
CC BY-SA 3.0
0
2011-04-26T22:59:21.007
2011-04-26T23:46:53.033
null
null
709,013
[ "c#", "list" ]
5,797,669
1
5,808,880
null
3
842
I'm having a problem with lighting when dealing with really small particles. I'm doing particle-based fluid simulation and am right now rendering the fluid as really tiny polygonized spheres (by really tiny I'm saying about 0.03 units radius for the spheres). The lighting in my scene isn't lighting them how I want and I can't get it to look right. I'm looking for something similar to the soft lighting on the particles in this image... ![particles with correct lighting](https://i.stack.imgur.com/r7R5S.png) However my particles look like this... ![What my particles look like](https://i.stack.imgur.com/lg6JJ.png) See how my particles have bright white sections whereas the green particles are just lit up softly and don't have large white hotspots. I know the reason is either the settings for my light or simply the fact that the particles are so small that the light takes up a larger space (is that possible??). My settings for lighting are as follows... ``` GLfloat mat_ambient[] = {0.5, 0.5, 0.5, 1.0}; GLfloat mat_specular[] = {1.0, 1.0, 1.0, 1.0}; GLfloat mat_shininess[] = {10.0}; GLfloat light_position[] = {0.0, 0.1, p_z, 1.0}; GLfloat model_ambient[] = {0.5, 0.5, 0.5, 1.0}; glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient); glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular); glMaterialfv(GL_FRONT, GL_SHININESS, mat_shininess); glLightfv(GL_LIGHT0, GL_POSITION, light_position); glLightModelfv(GL_LIGHT_MODEL_AMBIENT, model_ambient); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_DEPTH_TEST); glShadeModel(GL_SMOOTH); glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_DIFFUSE); glEnable(GL_COLOR_MATERIAL); ```
OpenGL lighting small objects?
CC BY-SA 3.0
0
2011-04-26T23:32:56.593
2013-02-10T03:53:07.470
2012-05-01T19:18:13.123
44,729
418,925
[ "opengl", "graphics", "lighting", "particles" ]
5,797,736
1
5,845,371
null
-1
1,255
## Question: The generated XML file from an .XSD template produces the output pasted below. Since `category`'s keys are `image`, my standard way of parsing the `image` items wont work on `category`. I would like to place the `category name="Category #"` into an array, How can I make an array from the category fields. ## What I need: What I want is an array of dictionaries. Each position contains a dictionary representing one category, and each dictionary contains images for that category. > `Array: @"Category 1",@"Category 2",@"Category 3";``For each Array, a Dictionary with: <image>``</image>` ![enter image description here](https://i.stack.imgur.com/WZHCM.png) ## XML Output: ``` <?xml version="1.0" encoding="UTF-8"?> <app xmlns="http://www.wrightscs.com/_xml_.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.wrightscs.com/_xml_.xsd" name="Testing" unlock_product_id="com.wrightscs.all"> <bannerImg>http://www.wrightscs.com</bannerImg> <category name="Category 1" icon="http://www.wrightscs.com"> <image> <title>title</title> <thumbUrl>http://www.wrightscs.com</thumbUrl> <sampleUrl>http://www.wrightscs.com</sampleUrl> <imageUrl>http://www.wrightscs.com</imageUrl> <description>These items / keys not an issue.</description> <infoUrl>http://www.wrightscs.com</infoUrl> <license>http://www.wrightscs.com</license> <licenseUrl>http://www.wrightscs.com</licenseUrl> </image> </category> <category name="Category 2" icon="http://www.wrightscs.com"> <image> <title>title</title> <thumbUrl>http://www.wrightscs.com</thumbUrl> <sampleUrl>http://www.wrightscs.com</sampleUrl> <imageUrl>http://www.wrightscs.com</imageUrl> <description>These items / keys not an issue.</description> <infoUrl>http://www.wrightscs.com</infoUrl> <license>http://www.wrightscs.com</license> <licenseUrl>http://www.wrightscs.com</licenseUrl> </image> </category> <category name="Category 3" icon="http://www.wrightscs.com"> <image> <title>title</title> <thumbUrl>http://www.wrightscs.com</thumbUrl> <sampleUrl>http://www.wrightscs.com</sampleUrl> <imageUrl>http://www.wrightscs.com</imageUrl> <description>These items / keys not an issue.</description> <infoUrl>http://www.wrightscs.com</infoUrl> <license>http://www.wrightscs.com</license> <licenseUrl>http://www.wrightscs.com</licenseUrl> </image> </category> </app> ```
Parse XML item "Category" into an NSArray with NSDictionary
CC BY-SA 4.0
0
2011-04-26T23:42:04.933
2018-05-08T01:02:26.497
2020-06-20T09:12:55.060
-1
171,206
[ "xml", "ios", "nsarray", "nsdictionary", "nsxmlparser" ]
5,797,862
1
5,797,965
null
19
39,266
I want to draw a line in a JPanel. This is my GUI and I want a line in the JPanel in white. ![enter image description here](https://i.stack.imgur.com/ufGCx.jpg) I find many examples but the problem is the how to use it. In many exmples, always they draw in a JFrame that extends from a JPanel. I want to add the Panel to the Frame and add some buttons to draw lines in many directions and use the X button in center to clean the JPanel. This is the code of the interface: ``` import java.awt.BorderLayout; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; import java.awt.Color; import javax.swing.JScrollPane; import javax.swing.JLabel; import javax.swing.ImageIcon; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; public class circuit extends JFrame { private JPanel contentPane; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { circuit frame = new circuit(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public circuit() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 559, 332); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); JScrollPane scrollPane = new JScrollPane(); scrollPane.setBounds(10, 21, 359, 255); contentPane.add(scrollPane); JPanel panel = new JPanel(); scrollPane.setViewportView(panel); panel.setBackground(Color.WHITE); JLabel label = new JLabel("New label"); label.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent arg0) { ///////////// } }); label.setIcon(new ImageIcon("C:\\Users\\achermen\\Desktop\\up.png")); label.setBounds(447, 66, 46, 48); contentPane.add(label); JLabel label_1 = new JLabel("New label"); label_1.setIcon(new ImageIcon("C:\\Users\\achermen\\Desktop\\down.png")); label_1.setBounds(447, 159, 46, 48); contentPane.add(label_1); JLabel label_2 = new JLabel("New label"); label_2.setIcon(new ImageIcon("C:\\Users\\achermen\\Desktop\\right.png")); label_2.setBounds(495, 112, 46, 48); contentPane.add(label_2); JLabel label_3 = new JLabel("New label"); label_3.setIcon(new ImageIcon("C:\\Users\\achermen\\Desktop\\left.png")); label_3.setBounds(398, 112, 46, 48); contentPane.add(label_3); JLabel label_4 = new JLabel("New label"); label_4.setIcon(new ImageIcon("C:\\Users\\achermen\\Desktop\\1303860240_list-remove.png")); label_4.setBounds(447, 112, 46, 48); contentPane.add(label_4); } } ``` This is the code to draw a line ``` public void paint(Graphics graphics) { graphics.drawLine(10, 20, 300, 310); } ``` So how to use this lines .... Thanks in advance. Best regards, Ali
Draw a line in a JPanel with button click in Java
CC BY-SA 3.0
0
2011-04-26T23:58:00.713
2012-06-24T20:53:15.590
2011-12-20T15:56:10.957
203,657
604,156
[ "java", "swing", "graphics", "line", "jpanel" ]
5,798,412
1
null
null
28
980
From what I've read about [btouch](http://code.google.com/p/btouch-library/); the bindings are not complete for three20. Is there a project that provides either bindings for the Three20 app launcher or a pure MonoTouch implementation of a launcher UI element? [http://three20.info/showcase/launcher](http://three20.info/showcase/launcher) ![enter image description here](https://i.stack.imgur.com/qEPFs.png)
Monotouch Three20 app launcher or bindings
CC BY-SA 3.0
0
2011-04-27T01:40:29.663
2011-12-01T05:40:00.027
null
null
51,695
[ "ios", "xamarin.ios", "three20" ]
5,798,487
1
5,798,644
null
1
1,694
I have a view which already has `SchemaBinding` applied AND it has a `UNIQUE CLUSTERED` index. Now, I'm trying to add a second index, which is a SPATIAL index ... and I get the following error message:- ![enter image description here](https://i.stack.imgur.com/s5aDZ.png) And here's the a picture of the schema: ![enter image description here](https://i.stack.imgur.com/OjIOh.png)
How can I create a Spatial Index on an Indexed View?
CC BY-SA 4.0
0
2011-04-27T01:52:55.620
2021-12-10T19:26:23.933
2021-12-10T19:26:23.933
472,495
30,674
[ "sql-server-2008", "view", "indexing", "spatial", "indexed-view" ]
5,798,699
1
5,804,921
null
6
857
I'm creating a simple game and come up with this problem while designing AI for my game: Given a set of N points inside a rectangle in the Cartesian coordinate, i need to find the widest straight path through this rectangle. The path must be empty (i.e not containing any point). ![enter image description here](https://i.stack.imgur.com/EhvRd.png) ![enter image description here](https://i.stack.imgur.com/L4J4T.png) I wonder if are there any efficient algorithm to solve this problem? Can you suggest any keyword/ paper/ anything related to this problem? EDIT: The rectangle is always defined by 4 points in its corner. I added an image for illustration. the path in the above pictures are the determined by two red lines
Finding widest empty straight path through a set of point
CC BY-SA 3.0
0
2011-04-27T02:30:14.977
2011-04-27T14:30:04.997
2011-04-27T12:18:21.203
604,159
604,159
[ "algorithm", "path", "geometry", "pathgeometry" ]
5,798,709
1
5,798,797
null
4
1,521
I am writing my little Android app. I pop up a dialog control which is a nice, non-fullscreen, rounded-corners dialog by setting `android:theme="@android:style/Theme.Dialog"` on the activity in my manifest. That all works just as I expected. However it is just a drab, grey-titled dialog as in this screenshot: ![default grey dialog look](https://i.stack.imgur.com/m6WtA.png) I've noticed however that a LOT of applications, when they pop up dialogs have a nice, blue-themed title as in this screen shot. ![enter image description here](https://i.stack.imgur.com/WtJA3.png) I would assume this theme is some common theme, as it shows up in a LOT of different apps. I would assume it is something built in to the OS. (My phone is a Captivate with the official Froyo release). Of course it COULD be something that every developer simply re-coded on their own, but I doubt that. Assuming that this is a common theme, how do I utilize it in my app? What changes do I need to make to my activity to have it use that theme? Thanks in advance!
How do I use common UI styles in Android?
CC BY-SA 3.0
0
2011-04-27T02:32:38.483
2015-04-20T15:32:07.223
null
null
80,209
[ "android", "android-activity", "themes" ]
5,798,851
1
5,798,906
null
0
846
When creating a database application in Netbeans. How do I change the default title in the title bar? ![enter image description here](https://i.stack.imgur.com/sCEOG.png)
How to change title of java database application in netbeans
CC BY-SA 3.0
null
2011-04-27T02:57:53.493
2011-08-03T05:10:51.210
null
null
472,034
[ "java", "netbeans" ]
5,799,054
1
5,799,232
null
2
234
I am running Emacs 23.3 on Windows XP. When Emacs is started, the mode line will assume one of these two appearances at random. Needless to say, I prefer the first one. How do I figure out what is going on and how do I make the first one stick? ![Good status bar](https://i.stack.imgur.com/xPe5P.png) ![Bad status bar](https://i.stack.imgur.com/KCHRG.png) The images don't show it, but the first one has a GUI type appearance. If I hover over the various bits of text with a mouse, e.g. then the text turns into a button with shadows etc. The black mode line appears to be a text mode widget. The only thing that the mouse will change on it is the highlighting. PS: Thanks JSON!
How do I fix this random behavior with my Emacs mode line?
CC BY-SA 3.0
null
2011-04-27T03:37:54.543
2011-04-28T03:06:40.993
2011-04-28T03:06:40.993
78,720
78,720
[ "emacs" ]
5,799,364
1
null
null
2
2,783
Can someone please guide me to fix this problem while accessing "Server Explorer" ? I've tried reinstalling VS 2010 but no luck. ![enter image description here](https://i.stack.imgur.com/A3qUP.png) , ![enter image description here](https://i.stack.imgur.com/9iuEo.png) ``` OracleVSGPkg.Close - Exception when terminating Oracle Developer Tools SQL*Plus Service Oracle.VsDevTools Unable to load DLL 'oravs11w.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Oracle.VsDevTools.OracleSVCSqlplus.Terminate() at Oracle.VsDevTools.OracleVSGPkg.Microsoft.VisualStudio.Shell.Interop.IVsPackage.Close() {D601BB95-E404-4A8E-9F24-5C1A462426CE} ``` ``` 317 OracleVSGPkg.Close - Revoking Oracle Developer Tools Oracle Input Output Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.549 318 OracleVSGPkg.Close - Revoking Oracle Developer Tools Oracle Database Project Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.550 319 OracleVSGPkg.Close - Revoking Oracle Developer Tools Oracle Message Box Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.551 320 OracleVSGPkg.Close - Revoking Oracle Developer Tools Common Language Runtime Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.552 321 OracleVSGPkg.Close - Revoking Oracle Developer Tools PL/SQL Language Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.553 322 OracleVSGPkg.Close - Revoking Oracle Developer Tools SQL Language Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.554 323 OracleVSGPkg.Close - Revoking Oracle Developer Tools Package Service {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.555 324 OracleVSGPkg.Close - Remove the Oracle Developer Tools as an IOleCommand Target {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.556 325 OracleVSGPkg.Close - Cleanup the Oracle Developer Tools Global resources {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.557 326 OracleVSGPkg.Close - End Oracle Developer Tools VS Package Close {D601BB95-E404-4A8E-9F24-5C1A462426CE} Oracle Developer Tools for Visual Studio 2011/04/27 07:04:14.558 327 ERROR End package load [Oracle Developer Tools for Visual Studio .NET] {D601BB95-E404-4A8E-9F24-5C1A462426CE} 80004005 - E_FAIL VisualStudio 2011/04/27 07:04:14.559 ```
Visual Studio 2010 and ODP.NET error
CC BY-SA 3.0
0
2011-04-27T04:29:10.877
2016-11-29T12:38:28.487
2011-04-27T07:13:15.543
263,357
263,357
[ "visual-studio-2010" ]
5,799,320
1
5,804,436
null
11
35,958
I have made an application which has tabs like in HelloTabActivity, there is also space between these tabs, can anyone suggest how to remove this space and also there is a grey line beneath the tabs how can that be removed? ![enter image description here](https://i.stack.imgur.com/JVXp9.png) ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp" > <HorizontalScrollView android:layout_width="wrap_content" android:layout_height="wrap_content" android:scrollbars="none"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> </HorizontalScrollView> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp" /> </LinearLayout> </TabHost> </LinearLayout> ``` ``` <?xml version="1.0" encoding="utf-8"?> <resources> <style name="CustomTheme" parent="@android:style/Theme"> <item name="android:tabWidgetStyle">@style/CustomTabWidget</item> </style> <style name="CustomTabWidget" parent="@android:style/Widget.TabWidget"> <item name="android:textAppearance">@style/CustomTabWidgetText</item> </style> <style name="CustomTabWidgetText" parent="@android:style/TextAppearance.Widget.TabWidget"> <item name="android:textSize">10sp</item> <item name="android:textStyle">bold</item> <item name="android:textColor">#1589FF</item> <item name="android:padding">3dip</item> </style> </resources> ``` ``` public class InfralineTabWidget extends TabActivity{ public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources res = getResources(); // Resource object to get Drawables TabHost tabHost = (TabHost)getTabHost(); // The activity TabHost TabHost.TabSpec spec; // Resusable TabSpec for each tab Intent intent; // Reusable Intent for each tab // Create an Intent to launch an Activity for the tab (to be reused) intent = new Intent().setClass(this, TopNewsActivity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("topNews").setIndicator("Top News", res.getDrawable(R.drawable.tab_news)).setContent(intent); tabHost.addTab(spec); // Do the same for the other tabs intent = new Intent().setClass(this, PowerActivity.class); spec = tabHost.newTabSpec("power").setIndicator("Power", res.getDrawable(R.drawable.tab_power)).setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this, EnergyActivity.class); spec = tabHost.newTabSpec("energy").setIndicator("Renewable Energy", res.getDrawable(R.drawable.tab_energy)).setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this, CoalActivity.class); spec = tabHost.newTabSpec("coal").setIndicator("Coal", res.getDrawable(R.drawable.tab_coal)).setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this, OilnGasActivity.class); spec = tabHost.newTabSpec("oilnGas").setIndicator("Oil & Gas", res.getDrawable(R.drawable.tab_oilngas)).setContent(intent); tabHost.addTab(spec); tabHost.setCurrentTab(0); tabHost.getTabWidget().getChildAt(0).setLayoutParams(new LinearLayout.LayoutParams(100,25)); tabHost.getTabWidget().getChildAt(1).setLayoutParams(new LinearLayout.LayoutParams(100,25)); tabHost.getTabWidget().getChildAt(2).setLayoutParams(new LinearLayout.LayoutParams(100,25)); tabHost.getTabWidget().getChildAt(3).setLayoutParams(new LinearLayout.LayoutParams(100,25)); tabHost.getTabWidget().getChildAt(4).setLayoutParams(new LinearLayout.LayoutParams(100,25)); } } ``` Now i want to remove the black spaces between the tabs and it should be like they are connected and also i'm not able to remove the grey line below the tabs. Thanks
Android remove space between tabs in tabwidget
CC BY-SA 3.0
0
2011-04-27T04:22:59.307
2016-08-30T12:35:42.983
2012-05-31T19:39:51.143
506,879
694,260
[ "android", "android-layout", "android-tabhost", "tabwidget", "android-style-tabhost" ]
5,799,464
1
5,799,560
null
1
519
I've got a SQL query which is trying to find all the Neighbourhoods in some Counties. When I use SQL Sentry Plan Explorer to visualize the query (IMO, a bit better than the tools provided with MS SSMS) it highlights a really slow performing part :- Full Plan ![enter image description here](https://i.stack.imgur.com/EFGOM.png) Zoomed in .... ![enter image description here](https://i.stack.imgur.com/gRrwJ.png) Details ![enter image description here](https://i.stack.imgur.com/4gvNz.png) SQL script: ``` -- Update which Neighbourhoods are in these Counties. INSERT INTO @NeighbourhoodCounties (NeighbourhoodId, CountyId) SELECT SubQuery.NeighbourhoodId, SubQuery.CountyId FROM ( SELECT e.LocationId AS NeighbourhoodId, b.LocationId AS CountyId, c.OriginalBoundary.STArea() AS CountyArea, c.OriginalBoundary.STIntersection(d.OriginalBoundary).STArea() AS IntersectionArea FROM @CountyIds a INNER JOIN [dbo].[Counties] b ON a.Id = b.LocationId INNER JOIN [dbo].[GeographyBoundaries] c ON b.LocationId = c.LocationId INNER JOIN [dbo].[GeographyBoundaries] d ON c.OriginalBoundary.STIntersects(d.OriginalBoundary) = 1 INNER JOIN [dbo].[Neighbourhoods] e ON d.LocationId = e.LocationId ) SubQuery WHERE (SubQuery.IntersectionArea / SubQuery.CountyArea) * 100 > 5 -- a Neighbourhood has to be 5% or more to be considered 'Inside' ``` Can anyone help interpret this query? What do all these numbers mean? How can I use these numbers to help diagnose and improve my query? [I tried to make an indexed view on the spatial table](https://stackoverflow.com/questions/5798487/how-can-i-create-a-spatial-index-on-an-indexed-view) but that failed miserably. Can anyone help?
Trying to see how I can improve the performance of this Sql query
CC BY-SA 3.0
0
2011-04-27T04:43:03.680
2016-02-06T17:05:18.477
2017-05-23T11:45:13.693
-1
30,674
[ "performance", "sql-server-2008" ]
5,799,583
1
5,799,740
null
0
304
Hey guys, this is driving me absolutely crazy! Been searching for hours and can't seem to figure out a solution. Any ideas how to do something like this: ![Groupon Screenshot](https://i.stack.imgur.com/0mRWm.png) Notice how there are two buttons inside of the tableviewcell, asnd notice how the grouped tableview has a background. Any ideas? Thank you!
Putting two buttons into one UITableViewCell
CC BY-SA 3.0
null
2011-04-27T05:03:53.050
2011-04-27T05:26:17.323
null
null
563,762
[ "iphone", "objective-c", "ios" ]
5,799,572
1
6,040,688
null
7
7,020
I have got four tabs. I was able to change the tab icon color from default blue to red (or probably any color) and it works perfectly fine. The problem is it works only for three tabbaritems and last one is default blue. Below is the code. I'm coding this in `rootviewcontrollerAppDelegate.m` You could try this by pasting the below code in your appdelegate. Could you guys help me out I'd be so greatful! ``` @implementation UITabBar (ColorExtensions) - (void)recolorItemsWithColor:(UIColor *)color shadowColor:(UIColor *)shadowColor shadowOffset:(CGSize)shadowOffset shadowBlur:(CGFloat)shadowBlur { CGColorRef cgColor = [color CGColor]; CGColorRef cgShadowColor = [shadowColor CGColor]; for (UITabBarItem *item in [self items]) if ([item respondsToSelector:@selector(selectedImage)] && [item respondsToSelector:@selector(setSelectedImage:)] && [item respondsToSelector:@selector(_updateView)]) { CGRect contextRect; contextRect.origin.x = 0.0f; contextRect.origin.y = 0.0f; contextRect.size = [[item selectedImage] size]; // Retrieve source image and begin image context UIImage *itemImage = [item image]; CGSize itemImageSize = [itemImage size]; CGPoint itemImagePosition; itemImagePosition.x = ceilf((contextRect.size.width - itemImageSize.width) / 2); itemImagePosition.y = ceilf((contextRect.size.height - itemImageSize.height) / 2); UIGraphicsBeginImageContext(contextRect.size); CGContextRef c = UIGraphicsGetCurrentContext(); // Setup shadow CGContextSetShadowWithColor(c, shadowOffset, shadowBlur, cgShadowColor); // Setup transparency layer and clip to mask CGContextBeginTransparencyLayer(c, NULL); CGContextScaleCTM(c, 1.0, -1.0); CGContextClipToMask(c, CGRectMake(itemImagePosition.x, -itemImagePosition.y, itemImageSize.width, -itemImageSize.height), [itemImage CGImage]); // Fill and end the transparency layer CGContextSetFillColorWithColor(c, cgColor); contextRect.size.height = -contextRect.size.height; CGContextFillRect(c, contextRect); CGContextEndTransparencyLayer(c); // Set selected image and end context [item setSelectedImage:UIGraphicsGetImageFromCurrentImageContext()]; UIGraphicsEndImageContext(); // Update the view [item _updateView]; } } @end - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions: (NSDictionary *)launchOptions { [[tabBarController tabBar] recolorItemsWithColor:[UIColor redColor] shadowColor:[UIColor blackColor] shadowOffset:CGSizeMake(0.0f, -1.0f) shadowBlur:3.0f]; [self.window addSubview:tabBarController.view]; [self.window makeKeyAndVisible]; [self addTabBarArrow]; return YES; } ``` ![enter image description here](https://i.stack.imgur.com/xo5ji.png)
How to change tabbar icon color from default blue?
CC BY-SA 3.0
0
2011-04-27T05:01:49.360
2016-01-26T12:57:32.673
2012-12-05T13:05:38.723
1,002,727
652,878
[ "objective-c", "xcode", "uitabbarcontroller", "uitabbaritem" ]
5,799,627
1
5,799,794
null
8
5,914
I'm trying to allow users that have connected their Facebook accounts to my rails app to find their Facebook friends that have already registered in the app, preferably in an index like format (similar to Formspring's display). Currently I'm using Devise, OAuth+Fbook Javascript SDK, and Koala. I have the Facebook UID of each user that connects their Facebook saved in the db, but I don't know how to filter through the results of the Facebook API call @friends = @graph.get_connections("me", "friends") in order to display the users that have matching UID's to the API call data. Any thoughts? There's probably an even better way, so lemme know if any additional info is needed. Thanks very much for your help! EDIT (screenshot of index action in users controller) ![enter image description here](https://i.stack.imgur.com/VY9e5.png) Note in @oauth, app id and app secret are cropped out in the example image
Finding user's friends with Facebook Graph API
CC BY-SA 3.0
0
2011-04-27T05:09:52.350
2015-07-14T04:03:13.357
2011-04-28T03:32:01.647
695,541
695,541
[ "ruby-on-rails", "ruby", "facebook", "facebook-graph-api", "omniauth" ]
5,799,692
1
null
null
1
871
HI FRIENDS.. I use a scroll view and a label now i want that when i scroll that , label also scroll with that and set to next location , i set paging enable = YES , so i want that there are 5 images and when i did scrolling the label i set is also move and show in other position. thanks ![enter image description here](https://i.stack.imgur.com/E7GwH.png) ![enter image description here](https://i.stack.imgur.com/UY2oR.png)
label and scroll view
CC BY-SA 3.0
0
2011-04-27T05:20:09.043
2011-04-27T05:53:53.877
2011-04-27T05:29:37.260
679,808
679,808
[ "iphone", "ipad" ]
5,799,666
1
5,800,082
null
5
6,235
I have an entity "Routine" with a to many relationship to "Exercise" called "routineExercises". I have a method called `addExercise` which should add an Exercise to an instance of Routine. Is this the correct way to implement this in code? ``` Exercise *exercise = (Exercise *)[NSEntityDescription insertNewObjectForEntityForName:@"Exercise" inManagedObjectContext:managedObjectContext]; exercise.name = selectedExercise; NSMutableSet *exercises = [[NSMutableSet alloc]init]; [exercises addObject:exercise]; Routine *routine = [NSEntityDescription insertNewObjectForEntityForName:@"Routine" inManagedObjectContext:managedObjectContext]; routine.routineExercises = exercises; ``` Update: I am getting an error at routine.routineExercises = exercises that says "-[Routine setRoutineExercises:]: unrecognized selector sent to instance 0x711bf30 2011-04-27 01:25:37.683 Curl[888:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Routine setRoutineExercises:]: unrecognized selector sent to instance 0x711bf30' " Update: ``` -(void)addExercise { if (managedObjectContext == nil) { managedObjectContext = [(CurlAppDelegate *)[[UIApplication sharedApplication] delegate] managedObjectContext]; [managedObjectContext retain]; } NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Exercise" inManagedObjectContext:managedObjectContext]; [request setEntity:entity]; NSError *error = nil; NSMutableArray *mutableFetchResults = [[managedObjectContext executeFetchRequest:request error:&error] mutableCopy]; if (mutableFetchResults == nil) { // Handle the error. } Exercise *exercise = (Exercise *)[NSEntityDescription insertNewObjectForEntityForName:@"Exercise" inManagedObjectContext:managedObjectContext]; exercise.name = selectedExercise; NSMutableSet *exercises = [NSSet setWithObjects:exercise,nil]; Routine *routine = (Routine *)[NSEntityDescription insertNewObjectForEntityForName:@"Routine" inManagedObjectContext:managedObjectContext]; routine.routineExercises = exercises; if (![managedObjectContext save:&error]) { // Handle the error. } NSLog(@"%@", error); [self.routineTableView reloadData]; [mutableFetchResults release]; [request release]; } ``` ![enter image description here](https://i.stack.imgur.com/SJ8kL.png) Error: ``` 2011-04-27 03:05:58.902 Curl[1954:207] -[Routine setRoutineExercises:]: unrecognized selector sent to instance 0x5d4a4e0 2011-04-27 03:05:58.904 Curl[1954:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Routine setRoutineExercises:]: unrecognized selector sent to instance 0x5d4a4e0' ``` Routine.h ``` #import <Foundation/Foundation.h> #import <CoreData/CoreData.h> @class Exercise; @interface Routine : NSManagedObject { @private } @property (nonatomic, retain) NSString * name; @property (nonatomic, retain) NSDate * timeStamp; @property (nonatomic, retain) NSSet* routineExercises; @end ``` Routine.m ``` #import "Routine.h" #import "Exercise.h" @implementation Routine @dynamic name; @dynamic timeStamp; @dynamic routineExercises; - (void)addRoutineExercisesObject:(Exercise *)value { NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1]; [self willChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects]; [[self primitiveValueForKey:@"routineExercises"] addObject:value]; [self didChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueUnionSetMutation usingObjects:changedObjects]; [changedObjects release]; } - (void)removeRoutineExercisesObject:(Exercise *)value { NSSet *changedObjects = [[NSSet alloc] initWithObjects:&value count:1]; [self willChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueMinusSetMutation usingObjects:changedObjects]; [[self primitiveValueForKey:@"routineExercises"] removeObject:value]; [self didChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueMinusSetMutation usingObjects:changedObjects]; [changedObjects release]; } - (void)addRoutineExercises:(NSSet *)value { [self willChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value]; [[self primitiveValueForKey:@"routineExercises"] unionSet:value]; [self didChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueUnionSetMutation usingObjects:value]; } - (void)removeRoutineExercises:(NSSet *)value { [self willChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueMinusSetMutation usingObjects:value]; [[self primitiveValueForKey:@"routineExercises"] minusSet:value]; [self didChangeValueForKey:@"routineExercises" withSetMutation:NSKeyValueMinusSetMutation usingObjects:value]; } @end ```
Am I Correctly Adding An Object To Core Data?
CC BY-SA 3.0
0
2011-04-27T05:16:06.160
2011-04-27T07:34:14.867
2011-04-27T07:34:14.867
null
null
[ "iphone", "objective-c", "core-data" ]
5,799,980
1
5,800,131
null
11
7,749
I'm working with jQuery Mobile and one of my pages is giving me problems. I have a `<p>` embedded in a list like so: ``` <div data-role="page"> <div data-role="header"> <h1>Page 1</h1> </div> <div data-role="content"> <ul data-role="listview"> <li data-role="list-divider"> List Heading </li> <li> <p>A very long paragraph that <b>should</b> be wrapped when it exceeds the length of the visible line.</p> </li> </ul> </div> </div> ``` No matter what I do, the page looks something like this: ![enter image description here](https://i.stack.imgur.com/itrH0.jpg) The `<p>` is getting clipped. I tried wrapping it in a `<div>`, but it remains the same. Since the `<p>` is pulled from an external source, I would prefer solutions that don't modify the `<p>` or the contents of it.
How to keep this <p> from getting clipped when it exceeds the width of the page?
CC BY-SA 3.0
0
2011-04-27T05:55:30.417
2014-11-01T15:17:18.397
2012-01-05T16:17:07.777
861,565
193,619
[ "jquery", "html", "jquery-mobile" ]
5,800,192
1
null
null
0
712
i would like to add my own key "X" by editing the previous one like "Done", or else is it possible to add a new key to the keyboard framework in Android. I want my button like this. i tried using Ime.option Label but cant works me. i get this image from iPhone keyboard but i would like to modify android's "Phone" type Keyboard. ![enter image description here](https://i.stack.imgur.com/82be6.png)
Modifying android keyboard
CC BY-SA 3.0
0
2011-04-27T06:18:49.257
2011-04-27T12:08:43.767
null
null
683,525
[ "android", "keyboard", "keypad", "android-keypad" ]
5,800,209
1
5,800,531
null
0
1,442
JSP FILE ``` .... <form method="post" action="/spring/krams/show/city"> <select name="city"> <c:forEach items="${cities}" var="city"> <option value="<c:out value="${city.id}" />"><c:out value="${city.city}" /></option> </c:forEach> </select> <input type="submit" value="Test" name="submit" /> </form> ..... ``` PICTURE!! ![enter image description here](https://i.stack.imgur.com/H6QDJ.png) ``` @RequestMapping(value = "/weather", method = RequestMethod.GET) public String getCurrentWeather(Model model) { logger.debug("Received request to show cities page"); // Attach list of subscriptions to the Model model.addAttribute("cities", service.getAllCities()); // This will resolve to /WEB-INF/jsp/subscribers.jsp return "weather"; } ``` JSP FILE! ``` .... <h1>Cities</h1> <c:out value="${city.city}" /> .... ``` ``` @RequestMapping(value = "/city", method = RequestMethod.GET) public String getCurrentCity(Model model) { logger.debug("Received request to show cities page"); model.addAttribute("city", service.getCity(2)); // This will resolve to /WEB-INF/jsp/citys.jsp return "city"; } ``` MY PROBLEM: when i just go to the url /city it gets the second city from database..IT WORKS..getCity method works...but when i press the submit button, it does not work .. it gives me tons of error..but i think i'm just using the syntax wrong MY QUESTION: basically i want it to pass the dropbox value to /city and in /city controller it should getCity(x) , at the moment i am using getCity(2) for testing . how can i do it?
Spring get value of dropbox, POST/GET?
CC BY-SA 3.0
null
2011-04-27T06:20:52.643
2011-04-27T06:57:41.593
null
null
625,189
[ "java", "spring", "jsp", "wsdl" ]
5,800,252
1
null
null
1
272
It's incredible that such sample code doesn't even work. I have put this inside grid but I can't see any line (code taken from MSDN in fact): ``` <Canvas Height="103" HorizontalAlignment="Left" Margin="30,166,0,0" Name="canvas1" VerticalAlignment="Top" Width="180"> <Line X1="0" Y1="10" X2="5" Y2="10" Stroke="Black" StrokeThickness="4" /> </Canvas> ``` This is incredible that such simple thing like that would be so buggy so did I miss something see picture below ? (Everything else in silverlight works fine for me): ![enter image description here](https://i.stack.imgur.com/YJtEg.png) Update: the bug is confirmed. This is quite incredible that MS hasn't fixed this !
Silverlight is completely buggy with canvas
CC BY-SA 3.0
null
2011-04-27T06:24:45.270
2011-05-22T20:32:54.377
2011-05-22T20:32:54.377
310,291
310,291
[ "silverlight" ]
5,800,245
1
null
null
2
1,727
We have been working on a Google Maps API v3 based app for the past few weeks when we noticed that the click event on one type of marker had stopped working. We had changed the size and upped the number of these markers, assumed our code was bad but a revert didn't fix the issue. Our code was fairly simple. After creating a marker (called obj in this example) we would do the following: ``` google.maps.event.addListener(obj, 'click', function(coords){ localClick(coords, id); }); ``` `localClick` is one of our functions, `alert('click!');` also yielded nothing. After a few days of scratching our heads, we noticed something odd: some of the markers working. Then we noticed a horizontal line of almost invisible markers that were clickable but in the wrong place: ![enter image description here](https://i.stack.imgur.com/9Zcf6.png) This happens on all browsers on OSX (we didn't try on Windows or Linux). One solution was to specify the version of the API you are using to v3.2. This isn't ideal as we'd like to stay up to date. And it was working on the latest edition (v3.4) until recently. Call in the Google maps API like this and it's not working: ``` $.getScript("https://maps-api-ssl.google.com/maps/api/js? sensor=false&callback=mapLoaded"); ``` Like this and everything's great: ``` $.getScript("https://maps-api-ssl.google.com/maps/api/js? sensor=false&v=3.2&callback=mapLoaded"); ``` We're puzzled. Unfortunately we cannot post the code or a working demo (I know this reduces the response rate, client requirements).
Click listener event on Google Maps API v3 not working
CC BY-SA 3.0
null
2011-04-27T06:23:48.407
2011-04-27T08:55:56.583
2011-04-27T06:31:21.717
249,137
249,137
[ "javascript", "google-maps", "google-maps-api-3" ]
5,800,490
1
5,800,529
null
3
989
I need to create a graph as shown in the image below. I have the values for the upper limit, lower limit and the average for each question. Can anyone suggest a plugin in Ruby on Rails to create such a graph shown in the image? ![needed graph](https://i.stack.imgur.com/oZBk7.png) Edit: I am finding it difficult to find something which does clear the area from the X-axis(Question axis) to the lower limit. Can anyone help me with this?
Floating Column(Max/Min) Graph in ROR
CC BY-SA 3.0
0
2011-04-27T06:53:18.217
2011-04-27T19:10:38.853
2011-04-27T19:10:38.853
584,440
584,440
[ "ruby-on-rails" ]
5,800,509
1
5,801,103
null
2
7,222
This is what I have at the moment: views.py ``` def activation_signupcount(request): if 'datestart' not in request.GET: form = SegmentForm(request.GET) #form2 = Period(request.GET) return render_to_response('activation/activation_signupcount.html', {'datestart':'', 'form':form}) ``` template ``` <form method="get" action=""> <h3>1. Choose segment</h3> {{ form.as_p }} ``` forms.py ``` from django import forms from django.forms.widgets import RadioSelect from django.forms.extras.widgets import SelectDateWidget usersegment = [['non-paying','Non-paying'],['paying','Paying'], ['all', 'All']] class SegmentForm(forms.Form): radio = forms.ChoiceField(required = True, label= False, widget=RadioSelect(), choices=usersegment) ``` The output looks like this ![enter image description here](https://i.stack.imgur.com/6FvDj.png) Questions: 1. How do I set a initial or default value? 2. How do I remove the bullet points 3. How do I get rid of the text 'This field is required.' I had a good look at the documentation on djangoprojects but there doesn't seem to be anything on it unless I missed something?
Some questions about radio buttons in Django forms
CC BY-SA 3.0
0
2011-04-27T06:54:59.720
2012-08-03T02:27:05.987
2011-04-27T08:21:53.207
131,238
131,238
[ "django", "django-forms", "radio-button" ]
5,800,595
1
5,801,867
null
0
213
I'm trying to figure out how to use an image as my window frame. I've been looking at [creating custom windows](http://cocoawithlove.com/2008/12/drawing-custom-window-on-mac-os-x.html), but it talks about drawing a custom shape rather than using an existing image. I want to make a window like this: ![enter image description here](https://i.stack.imgur.com/0zrPZ.png)
Using an image as the window in cocoa
CC BY-SA 3.0
null
2011-04-27T07:05:14.043
2011-04-27T09:21:04.840
null
null
20,134
[ "objective-c", "cocoa", "macos" ]
5,800,685
1
5,828,177
null
6
1,881
I have a class defined as: ``` public class Student { public string Id { get; set; } public IDictionary<string, string> Attributes { get; set; } } ``` based on the discussion I found here : [http://groups.google.com/group/ravendb/browse_thread/thread/88ea52620021ed6c?pli=1](http://groups.google.com/group/ravendb/browse_thread/thread/88ea52620021ed6c?pli=1) I can store an instance quite easily as : ``` //creation using (var session = store.OpenSession()) { //now the student: var student = new Student(); student.Attributes = new Dictionary<string, string>(); student.Attributes["NIC"] = "studentsNICnumberGoesHere"; session.Store(student); session.SaveChanges(); } ``` However when I query it as below: ``` //Testing query on attribute using (var session = store.OpenSession()) { var result = from student in session.Query<Student>() where student.Attributes["NIC"] == "studentsNICnumberGoesHere" select student; var test = result.ToList(); } ``` I get the error "'System.Linq.Expressions.InstanceMethodCallExpressionN' to type 'System.Linq.Expressions.MemberExpression'." as shown: ![enter image description here](https://i.stack.imgur.com/AlHSU.png) How can I query based on a key in the dictionary?
Querying a Dictionary with RavenDb
CC BY-SA 3.0
0
2011-04-27T07:16:16.713
2014-02-15T06:33:27.503
2014-02-15T06:33:27.503
104,727
390,330
[ "ravendb" ]
5,800,838
1
5,811,562
null
0
427
i am still very new to objective c and in fact this is my first attempt to build an app so please bear with me... I am trying to add an UITable beside core-plot graph, i have taken CPTestApp example and stated to work off that, i was able to get the graph part working ok but i am having trouble with UITable. Below is the screenshot of how it look at the moment.UITable is upside down and the text is all mirrored.. ![enter image description here](https://i.stack.imgur.com/LbS3o.jpg) below is rotation part, can someone point me with an example for UITable rotation together with graph...UITable is populated with an array of values and that is working ok too.. i probably need some guidance to figure out the correct way to add UItable to the coreplothosting view layer Thanks ``` - (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { if (UIInterfaceOrientationIsLandscape(fromInterfaceOrientation)) { // Move the plots into place for portrait scatterPlotView.frame = CGRectMake(20.0f, 55.0f, 728.0f, 556.0f); tblSimpleTable.frame = CGRectMake(20.0f, 644.0f, 728.0f, 340.0f); [tblSimpleTable reloadData]; } else { // Move the plots into place for landscape scatterPlotView.frame = CGRectMake(20.0f, 55.0f, 858.0f, 677.0f); tblSimpleTable.frame = CGRectMake(878.0f, 51.0f, 220.0f, 677.0f); [tblSimpleTable reloadData]; } } ```
core-plot adding UITable
CC BY-SA 3.0
null
2011-04-27T07:34:41.810
2011-04-27T22:48:21.947
2011-04-27T10:25:56.900
572,059
572,059
[ "uitableview", "core-plot" ]
5,800,862
1
5,800,944
null
3
2,789
imagine this situation: # SetUp in the default MVC3 project, create a new complex type in the `AccountModels.cs` ``` public class GlobalAccount { public GlobalAccount() { this.LogOn = new LogOnModel(); this.Register = new RegisterModel(); } public LogOnModel LogOn { get; set; } public RegisterModel Register { get; set; } } ``` In the `RegisterModel` change the `UserName` to: ``` [Required] [Remote("UserNameExists", "Validation", "", ErrorMessage = "Username is already taken.")] [RegularExpression(@"(\S)+", ErrorMessage = "White space is not allowed.")] [Display(Name = "Username (spaces will be stripped, must be at least 6 characters long)")] public string UserName { get; set; } ``` The `UserNameExists` method in a `Validation` controller is as follow: ``` public class ValidationController : Controller { public JsonResult UserNameExists(string UserName) { string user = null; if (!String.IsNullOrWhiteSpace(UserName) && UserName.Length >= 6) user = UserName == "abcdef" ? "ok" : null; return user == null ? Json(true, JsonRequestBehavior.AllowGet) : Json(string.Format("{0} is not available.", UserName), JsonRequestBehavior.AllowGet); } } ``` Now in the Register View, use the `GlobalAccount` Model instead of the `RegisterModel` the username input box will be like: ``` @model Your.NameSpace.Models.GlobalAccount ``` and ``` <div class="field fade-label"> @Html.LabelFor(model => model.Register.UserName, new { @class = "text" }) @Html.TextBoxFor(model => model.Register.UserName, new { spellcheck = "false", size = "30" }) </div> ``` this will result in something like this, in the HTML ``` <div class="field fade-label"> <label class="text" for="Register_UserName"><span>Username (spaces will be stripped, must be at least 6 characters long)</span></label> <input data-val="true" data-val-regex="White space is not allowed." data-val-regex-pattern="(\S)+" data-val-remote="Username is already taken." data-val-remote-additionalfields="*.UserName" data-val-remote-url="/beta/Validation/UserNameExists" data-val-required="The Username (spaces will be stripped, must be at least 6 characters long) field is required." id="Register_UserName" name="Register.UserName" size="30" spellcheck="false" type="text" value=""> </div> ``` # Debug If you use FireBug to check what's going on ... the is sending the attribute instead of the attribute to the Validation method (the `UserNameExists` one) as: `Register.UserName` instead of `Register_UserName` So I can't fetch this value ... :( Is this really a bug or is something that someone already found and I couldn't get from Googling it? Here is a simple image of the actual problem: ![enter image description here](https://i.stack.imgur.com/wV9Pd.png)
Remote Validation seems buggy
CC BY-SA 3.0
0
2011-04-27T07:37:48.183
2012-02-17T10:49:59.567
2011-04-27T08:46:37.807
93,356
28,004
[ "asp.net-mvc", "validation", "asp.net-mvc-3", "remote-validation" ]
5,801,116
1
5,801,614
null
12
11,888
I am new to HTML5 `<canvas>` and was trying to make something, actually draw the PORTAL2 logo :). Till now I have got it so far ![enter image description here](https://i.stack.imgur.com/gmQzd.png) but as you can see leg is protruding out of the wall, i want to know how to chip off that extra paint. I guess it can be done with `clip()` function but I'm not sure how to use it. Here is what i want ![enter image description here](https://i.stack.imgur.com/NOHUj.jpg) This is the code I'm trying, also available at JS Bin here [http://jsbin.com/exado5/edit](http://jsbin.com/exado5/edit) ``` //function to convert deg to radian function acDegToRad(deg) { return deg* (-(Math.PI / 180.0)); } //set fill color to gray ctx.fillStyle = "rgb(120,120,120)"; //save the current state with fillcolor ctx.save(); //draw 2's base rectangle ctx.fillRect(20,200,120,35); //bring origin to 2's base ctx.translate(20,200); //rotate the canvas 35 deg anti-clockwise ctx.rotate(acDegToRad(35)); //draw 2's slant rectangle ctx.fillRect(0,0,100,35); //restore the canvas to reset transforms ctx.restore(); //set stroke color width and draw the 2's top semi circle ctx.strokeStyle = "rgb(120,120,120)"; ctx.lineWidth = 35; ctx.beginPath(); ctx.arc(77,135,40,acDegToRad(-40),acDegToRad(180),true); ctx.stroke(); //reset canvas transforms ctx.restore(); //change color to blue ctx.fillStyle = "rgb(0,160,212)"; //save current state of canvas ctx.save(); //draw long dividing rectangle ctx.fillRect(162,20,8,300); //draw player head circle ctx.beginPath(); ctx.arc(225,80,35,acDegToRad(0),acDegToRad(360)); ctx.fill(); //start new path for tummy :) ctx.beginPath(); ctx.moveTo(170,90); ctx.lineTo(230,140); ctx.lineTo(170,210); ctx.fill(); //start new path for hand //set lineCap and lineJoin to "round", blue color //for stroke, and width of 25px ctx.lineWidth = 25; ctx.lineCap = "round"; ctx.strokeStyle = "rgb(0,160,212)"; ctx.lineJoin = "round"; ctx.beginPath(); ctx.moveTo(222,150); ctx.lineTo(230,190); ctx.lineTo(270,220); ctx.stroke(); //begin new path for drawing leg ctx.beginPath(); ctx.moveTo(160,210); ctx.lineTo(195,260); ctx.lineTo(160,290); ctx.stroke(); ``` Please help.
How to use HTML5 <canvas> clip()
CC BY-SA 3.0
0
2011-04-27T08:10:17.060
2014-12-26T09:10:24.300
2011-04-27T09:21:15.627
21,234
399,722
[ "javascript", "html", "canvas", "clip" ]
5,801,283
1
null
null
5
3,055
When I try to deploy my MVC3 application on IIS7, on every URL I am getting an Http 500 - Internal Server Error. The site runs fine in development in Visual Studio. And I can request simple html pages, or aspx pages, and they return fine. I've tested if asp.net works by adding an aspx page that returns inline <%= DateTime.Now.ToShortDateString() %>, which also works fine. So I think the problem is situated with MVC itself or the Routing. MVC3 is installed on the server, but I also tried bin deploying by setting all MVC related references to `copy local = true`. Any ideas ? Edit: I enabled failed request tracing, which results in no error logs. Customerrors are off & Server errors are detailed : ``` <httpErrors errorMode="Detailed" /> <asp scriptErrorSentToBrowser="true"/> <customErrors mode="Off"/> ``` The only thing I am getting is a 500 - Internal Server Error header with a blank page. I checked the event log for the webserver, nothing to find. After some restarts I'm getting a somewhat more detailed error : ![http500](https://i.stack.imgur.com/huWQD.png)
Deploying an MVC3 application on IIS7 always returns Http 500 - Internal Server Error
CC BY-SA 3.0
0
2011-04-27T08:28:58.377
2013-03-20T05:38:26.113
2012-04-16T14:01:28.527
201,387
632,336
[ "asp.net", "deployment", "asp.net-mvc-3" ]
5,801,338
1
5,802,034
null
2
10,878
I have an `<ol>` with some `<li>`'s in it, in FF it looks good, but for some reason in IE it looks like this: ![List Bullet weirdness in IE](https://i.stack.imgur.com/MpQDR.jpg) HTML: ``` <ol start="1"> <li>Free gifts click here</li> <li>Free gifts click here</li> <li>Bonus gifts</li> </ol> ``` CSS: ``` ol { list-style: none outside none; } li { list-style: decimal outside none; margin-left: 30px; margin-bottom: 12px; } ``` Any idea? Thanks,
List bullets not displaying correctly in Internet Explorer
CC BY-SA 3.0
null
2011-04-27T08:34:59.797
2012-05-09T22:49:14.653
2012-05-09T22:49:14.653
246,246
726,826
[ "html", "css", "internet-explorer", "html-lists" ]
5,801,434
1
5,801,679
null
0
2,461
Why does the div go out of his parent in Chrome and they is not appeared both in FireFox! In spite of everything is working great in IE8. Chrome: ![enter image description here](https://i.stack.imgur.com/wGWuo.png) The code: ``` <div id="parentDIV" style="overflow: auto; height: 600px;"> <!-- Child Control --> <GW1:OrgChart ID="OrgChart1" runat="server" /> </div> ``` : When I specify the width for the parent div it works, but I don't prefer that. I tried to set the width to `100%` and it does not work. Any idea!
Why [overflow: auto] does not work in Chrome?
CC BY-SA 3.0
null
2011-04-27T08:45:43.140
2011-04-27T09:06:05.900
2011-04-27T08:58:50.833
385,273
322,355
[ "asp.net", "html", "cross-browser" ]
5,801,586
1
5,804,099
null
9
1,261
In OOP languages I might write a database wrapper which encapsulates database connection, manages schema and provides few core operations, such as `exec`, `query`, `prepare_and_execute`. I might even have a separate database helper class which would handle the database schema, leaving the database abstraction only to handle connections. This would then be used by model wrappers/factories which use the database abstraction class to create instances of model classes. Something along the line like this UML diagram: ![](https://i.stack.imgur.com/OMuGF.png) What would be the preferred way to design such a system in idiomatic haskell?
Idiomatic haskell for database abstraction
CC BY-SA 3.0
0
2011-04-27T08:58:51.763
2013-04-26T09:52:39.327
null
null
77,650
[ "database", "haskell" ]
5,802,117
1
5,802,269
null
0
4,566
I want to show a UIActionSheet in the middle of the screen.I tried with the following code I get the result as desired but i can click only cancel button, and the half of export image button.I don't know where i am going wrong.Kindly please any body help me.What should i do to make it working.![enter image description here](https://i.stack.imgur.com/23ar3.png)
UIActionsheet in the middle of the screen
CC BY-SA 3.0
null
2011-04-27T09:43:29.603
2012-02-29T09:05:45.680
null
null
421,532
[ "iphone", "uiactionsheet" ]
5,802,138
1
6,121,162
null
14
4,067
I am trying for a coloring app and to figure out floodfill in objective c anybody did this before..???I am reading all pixel data in a picture and i can change it also..but floodfill can only do what i want exactly.. ![Sample Image](https://i.stack.imgur.com/C6pRE.png)..Here I Can identify the pixels containing black dot also.but I am really confuse how to identify the pixels in a particular white area.Any help is appreciated..
Floodfill in objective c
CC BY-SA 4.0
0
2011-04-27T09:45:37.437
2019-01-07T06:21:23.253
2019-01-07T06:21:23.253
5,400,105
438,676
[ "iphone", "objective-c", "flood-fill" ]
5,802,129
1
5,802,878
null
2
1,780
Noticed a small sorting problem in a DataGrid we are using. When a DataGrid column header is clicked, the default alternating ascending/descending sorting takes place. Fine. But when all of the row items in a column are the same, and the column header is clicked, some sorting still takes place, but only for the first click, and this not occur on subsequent clicks. [http://megaswf.com/serve/1103850](http://megaswf.com/serve/1103850) Click the 'In Stock' heading to see the problem. ![enter image description here](https://i.stack.imgur.com/FZARe.jpg) ``` <?xml version="1.0"?> <!-- dpcontrols/DataGridSort.mxml --> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" initialize="initDP();" width="550" height="400"> <mx:Script> <![CDATA[ import mx.collections.*; private var myDPColl:ArrayCollection; // The data source that populates the collection. private var myDP:Array = [ {Artist:'Pavement', Album:'Slanted and Enchanted', Price:11.99, InStock: true}, {Artist:'Pavement', Album:'Crooked Rain, Crooked Rain', Price:10.99, InStock: true}, {Artist:'Pavement', Album:'Wowee Zowee', Price:12.99, InStock: true}, {Artist:'Asphalt', Album:'Brighten the Corners', Price:11.99, InStock: true}, {Artist:'Asphalt', Album:'Terror Twilight', Price:11.99, InStock: true}, {Artist:'Asphalt', Album:'Buildings Meet the Sky', Price:14.99, InStock: true}, {Artist:'Other', Album:'Other', Price:5.99, InStock: true} ]; //Initialize the DataGrid control with sorted data. private function initDP():void { myDPColl = new ArrayCollection(myDP); myGrid.dataProvider=myDPColl; } ]]> </mx:Script> <mx:DataGrid id="myGrid" width="100%" height="213"> <mx:columns> <mx:DataGridColumn minWidth="120" dataField="Artist" /> <mx:DataGridColumn minWidth="200" dataField="Album" /> <mx:DataGridColumn width="75" dataField="Price" /> <mx:DataGridColumn width="75" dataField="InStock" headerText="In Stock"/> </mx:columns> </mx:DataGrid> </mx:Application> ```
Flex DataGrid sorting problem - sorts even when no sort necessary
CC BY-SA 3.0
null
2011-04-27T09:45:06.570
2011-04-27T10:52:13.063
null
null
271,012
[ "apache-flex", "actionscript-3", "flex3" ]
5,802,150
1
5,804,329
null
2
4,646
I am having a kinda strange problem. Here is the situation. I have a `ListView`, with a custom defined `GroupStyle` to make data appear in `Expander`s, in which there is a `WrapPanel` containing `StackPanels` (which contain one ToggleButton + one custom control) The custom control in the `StackPanel` is not visible by default, and becomes visible when the `ToggleButton` is checked. However, when I check a `ToggleButton`, the custom control appears, and all the other control situated on the same line will move to a vertical center. Ideally, I'd like these other members to stay on top. I've tried to set `VerticalAlignment="Top"` everywhere I could, it doesn't change anyway. Imaged problem: The initial state of an expander: ![Expander before](https://i.stack.imgur.com/1qgFE.jpg) Once the `ToggleButton` is clicked, here is what happens: ![Expander after](https://i.stack.imgur.com/UO26T.jpg) As you can see, the button "Test Analysis" is moved to stay at the center. I want it to stay in the same place than the original. Moreover, I've defined all of these styles in separate `DataTemplate`s objects. Here is some light code (I just removed what's useless for the problem here, won't make you read tons of XAML code :) ): The expander's content property: ``` <Expander.Content> <WrapPanel Background="White" VerticalAlignment="Top"> <ItemsPresenter VerticalAlignment="Top"/> </WrapPanel> </Expander.Content> ``` The list's `ItemsPanel` : ``` <ItemsPanelTemplate > <WrapPanel Width="{Binding (FrameworkElement.ActualWidth), RelativeSource={RelativeSource AncestorType=Expander}}" ItemWidth="{Binding (ListView.View).ItemWidth, RelativeSource={RelativeSource AncestorType=ListView}}" ItemHeight="{Binding (ListView.View).ItemHeight, RelativeSource={RelativeSource AncestorType=ListView}}" /> </ItemsPanelTemplate> ``` The list's `ItemsTemplate` : ``` <StackPanel Orientation="Vertical" Height="Auto" Width="Auto" VerticalAlignment="Top" > <ToggleButton BorderBrush="{x:Null}" Background="{x:Null}" IsChecked="{Binding Value.IsToLaunch, Mode=TwoWay}" Command="{Binding DataContext.UpdateGroupCheckingsCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"> <Grid Background="Transparent"> <!-- Blah blah blah about the ToggleButton's content --> </Grid> </ToggleButton> <my:UcReleaseChooser> <!-- Blah blah blah about being visible if ToggleButton is Checked --> </my:UcReleaseChooser> </StackPanel> ```
VerticalAlignment in WrapPanel - How to make it work correctly?
CC BY-SA 3.0
null
2011-04-27T09:46:21.717
2011-04-27T12:45:56.850
2011-04-27T09:59:29.227
546,730
664,237
[ "wpf", "wpf-controls", "datatemplate", "vertical-alignment", "wrappanel" ]
5,802,205
1
5,802,262
null
0
480
Is there a feature in HTML that the label has a specific width and when it needs to render over its given width, it should clip and show `...`. And in the tooltip, the full actual name is shown. Something like this: ![enter image description here](https://i.stack.imgur.com/89b0u.png)
Does HTML support clipping label for width?
CC BY-SA 3.0
null
2011-04-27T09:51:49.333
2016-04-12T02:00:47.297
null
null
322,355
[ "html" ]
5,802,416
1
5,802,477
null
1
59
I need to produce a table similar to: ![enter image description here](https://i.stack.imgur.com/VHn0L.png) What we see is the left column containing the data point headers, and each column after contains the actual data. I'd like to treat each column (other than the first one) as an optional column. The user can add or remove the columns based on funds they select. If they've selected only 1 fund, only the first 2 columns are visible, the rest of the spaces are blank. Each subsequent fund selection adds a new column to the table, up to a max of 5. I'm wondering what is the best way to implement this? I'm thinking each column is an independent table of a fixed width that I can add to a container which can align them side by side. Will I have difficulty getting the 6 tables to line up side by side? Is there a better way for me to achieve this result?
How to create a table that I can add or remove columns from
CC BY-SA 3.0
null
2011-04-27T10:08:13.780
2011-04-27T10:14:53.190
null
null
181,771
[ "html", "css", "asp.net-mvc" ]
5,802,555
1
5,802,587
null
3
12,472
I'm trying to between the fields of my ExtJS form. I am able to change the style of the with the style tag in the Items collection like this: ![enter image description here](https://i.stack.imgur.com/iA7wM.png) ``` //form right var simple_form_right = new Ext.FormPanel({ frame:true, labelWidth: 90, labelAlign: 'right', title: 'Orderer Information', bodyStyle:'padding:5px 5px 0 0', width: 300, height: 600, autoScroll: true, itemCls: 'form_row', defaultType: 'displayfield', items: [{ fieldLabel: 'Customer Type', name: 'customerType', style: 'padding:0px;font-size:7pt', labelStyle: 'padding:0px', allowBlank: false, value: 'Company' },{ fieldLabel: 'Company', name: 'company', value: 'The Ordering Company Inc.' },{ fieldLabel: 'Last Name', name: 'lastName', value: 'Smith' }, { ... ```
How to reduce the padding of the labels in an ExtJS FormPanel?
CC BY-SA 3.0
null
2011-04-27T10:23:39.580
2011-04-27T11:18:35.450
2011-04-27T11:18:35.450
4,639
4,639
[ "javascript", "css", "forms", "extjs" ]
5,802,612
1
5,808,466
null
2
320
As a small project to get myself used to some more iPhone elements I've decided to create a sample in call screen, modeling it on the native iPhone call screen (IOS 4) However I'm struggling to make out what elements the native in call screen uses to make up the view that is displayed. I was wondering if someone with more experience on iPhone could help me out by explaining what the various elements are? Is the bottom part a UIActionSheet that is slightly transparent and with a UIBUtton placed over it? Or is it a slightly transparent imageview with the button over-layed? Similarly at the top, it looks like its an imageiew with the name or number of the callee/caller and the call duration underneath, would I be correct in thinking that? The part I'm really interested in is the bit where the icons are held in some sort of dialog in the centre of the screen that is animated to swing around to a keypad when it is selected, is this some sort of iPhone control that I can use or customise? ![enter image description here](https://i.stack.imgur.com/WMR7X.png) I've tried two things to try to achieve this so far: 1) I've created a view within a view and I am trying to flip this however I can only seem to get the main view to flip properly and not the view inside it which is the one I want and it doesn't seem to be a good approach. 2) I've tried to look at using the Utility application approach to it but again this seems to be for flipping the full screen and not just a section within a screen (view) Has anybody got any pointers on what to try next? Or if one of the above methods is the ideal way to do it and should be investigated further?
iPhone - What is the control in the middle of the in call screen?
CC BY-SA 3.0
0
2011-04-27T10:28:20.533
2011-04-27T17:59:34.800
2011-04-27T17:41:45.917
243,999
243,999
[ "iphone", "screen", "call" ]
5,802,652
1
5,802,688
null
1
1,989
I have a set of tables which are connected through foreign keys , and almost all of them have the primary keys as auto increment identifier of sql server. The figure is given below . Now when I am adding a row in storyboard table I need to know the auto generated storyboard Id on inserting the row so that using that I can insert the slides associated with it into slide table. For this should I query the database for the Id created or is there any other way to use this ? Please tell me how to do this in sql server 2008 I am using asp dot net web service to interact with sql server. ![Database Design](https://i.stack.imgur.com/zrDBA.jpg)
how to get the new identity ID just after inserting the new row in Sql Server?
CC BY-SA 3.0
null
2011-04-27T10:31:09.593
2011-04-27T10:40:37.990
null
null
125,571
[ "asp.net", "sql", "sql-server", "database", "web-services" ]
5,802,679
1
5,803,328
null
0
656
Yesterday I was having fully compiled ASP.NET MVC 3.0 project. Today when i opened my project again it is wont compiled because of T4MVC, I was very surprised. I readd the T4MVC template thorough NuGet again, but it is didn't help. Then i removed all related T4 VS 2010 extensions: T4 Editor, T4Utilites, and Visual T4, opened project again but it is didn't help, than i rebooted and installed T4 extensions again but it is didn't help either. Than i created new clean ASP.NET MVC 3.0 project and add T4MVC to this, and I've got the same errors (see peintscreen). If i remove T4MVC.tt from solution than I can compile the project, but when i am put it back, I am getting errors again. ![Error screen 1](https://i.stack.imgur.com/Cn7Io.png) [Open Error screen 1](https://i.stack.imgur.com/Cn7Io.png) ![Error screen 2](https://i.stack.imgur.com/cY7gd.jpg) [Open Error screen 2](https://i.stack.imgur.com/cY7gd.jpg) I think that the problem with Visual Studio, and now I have a very bad idea - try to reinstall Visual Studio, but may be some one may suggest something better? p.s 1 Also I didn't install anything related to Visual Studio this days, may be only a couple of small Upstates through windows update, but they wasn't related to visual studio. Also i have MVC 3.0 Updates tools' installed, but before today everything was working well. It is looking very strange, i can generate *.cs files successfully using this template, there is no errors i am getting during this process, but visual studio blaming T4MVC.tt fore some reason. p.s 2 Actually also NuGet package where updated. May be it is the case? mmm... But after removing NuGet all the same :(
MVC 3.0 T4MVC stopped working in VS 2010
CC BY-SA 3.0
null
2011-04-27T10:33:07.550
2011-04-27T11:29:36.680
2011-04-27T11:18:13.120
415,078
415,078
[ "asp.net-mvc-3", "t4mvc" ]
5,802,692
1
5,802,731
null
5
26,885
Relative path not working in CSS while it's correct ``` { width: 64px; background: url(../images/abc/xyz/bottom-navigation.jpg) no-repeat 0 0; } ``` ![enter image description here](https://i.stack.imgur.com/9dtrc.jpg) Folder path ![enter image description here](https://i.stack.imgur.com/JI21U.jpg)
background images path not working in CSS
CC BY-SA 3.0
null
2011-04-27T10:33:54.323
2018-03-04T06:01:56.587
2011-04-27T11:10:03.117
84,201
84,201
[ "css" ]
5,802,747
1
null
null
13
2,023
I am using the GWT Activities and Places framework to structure my application and it is turning out nicely. One thing that annoys me though is that the `ActivityMapper` implementation is (1) receiving all the views in the application (2) contains a giant if/else block for instantiating activities based on the received place. It will only get worse as the number of views increases. ![ActivityMapper screenshot](https://i.stack.imgur.com/fOQgZ.png) I am already using [Gin](http://code.google.com/p/google-gin) but I don't see how I can use it here. How can I reduce or eliminate the boilerplate from my `ActivityMapper`?
Eliminating GWT ActivityMapper boilerplate
CC BY-SA 3.0
0
2011-04-27T10:39:29.580
2015-11-23T12:01:06.260
null
null
112,671
[ "gwt", "gwt-mvp", "gwt-gin" ]
5,802,800
1
5,802,977
null
2
486
I have an image such as this: ![](https://i.stack.imgur.com/WFmOv.png) I want to have it so I can use these images for different buttons and other parts without having to split the image myself. I've seen lots of games and programs do this without needing to split it. How would I do this? I'm using VB.net so any .net examples are appreciated! You can see an example here: ![](https://i.stack.imgur.com/PfYta.png) This image is used as a minimap in a game I play, the different pieces are cut at runtime.
Splitting an image during runtime
CC BY-SA 3.0
0
2011-04-27T10:44:32.807
2012-10-08T23:58:44.930
2011-04-27T10:54:26.120
595,437
595,437
[ ".net", "image", "split" ]
5,803,163
1
5,803,356
null
0
660
I've a UINavigationController and in the picture you can see a UIViewController added to it. Now, I would like to customize the top bar of the UINavigationController with the content of the current visible UIViewController. More in particular, I would like: 1. add the title 2. customize "back" button text Should I use self.navigationController method from the current UINavigationController ? If so, what are the next steps ? Thanks ![enter image description here](https://i.stack.imgur.com/KQZWw.png)
How to customize the top bar of a UINavigationController with the current view information?
CC BY-SA 3.0
null
2011-04-27T11:16:53.610
2011-04-27T11:45:36.873
2011-04-27T11:41:37.530
256,728
257,022
[ "iphone", "cocoa-touch", "ios" ]
5,803,237
1
null
null
2
785
I'm working on an .obj file loader for OpenGL using Objective-C. I'm trying to get objects to load and render them with shading. I'm not using any textures, materials, etc. to modify the model besides a single light source. When I render any model, the shading is not distributed properly (as seen in the pictures below). I believe this has something to do with the normals, but I'm not sure. These are my results: ![Sphere](https://i.stack.imgur.com/zSGFo.png) ![Blender Monkey](https://i.stack.imgur.com/zVvE5.png) And this is the type of effect I'm trying to achieve: ![Goal](https://i.stack.imgur.com/TKn21.png) I thought the problem was that the normals I parsed from the file were incorrect, but after calculating them myself and getting the same results, I found that this wasn't true. I also thought not having `GL_SMOOTH` enabled was the issue, but I was wrong there too. So I have no idea what I'm doing wrong here, so sorry if the question seems vague. If any more info is needed, I'll add it. Update: Link to larger picture of broken monkey head: [http://oi52.tinypic.com/2re5y69.jpg](http://oi52.tinypic.com/2re5y69.jpg) Update 2: If there's is a mistake in the process of me calculating normals, this is what I'm doing: - - - : ``` static inline void normalizeVector(Vector3f *vector) { GLfloat vecMag = VectorMagnitude(*vector); if (vecMag == 0.0) { vector->x /= 1.0; vector->y /= 0.0; vector->z /= 0.0; } vector->x /= vecMag; vector->y /= vecMag; vector->z /= vecMag; } ``` Update 3: Here's the code I'm using to create the normals: ``` - (void)calculateNormals { for (int i = 0; i < numOfIndices; i += 3) { Triangle triangle; triangle.v1.x = modelData.vertices[modelData.indices[i]*3]; triangle.v1.y = modelData.vertices[modelData.indices[i]*3+1]; triangle.v1.z = modelData.vertices[modelData.indices[i]*3+2]; triangle.v2.x = modelData.vertices[modelData.indices[i+1]*3]; triangle.v2.y = modelData.vertices[modelData.indices[i+1]*3+1]; triangle.v2.z = modelData.vertices[modelData.indices[i+1]*3+2]; triangle.v3.x = modelData.vertices[modelData.indices[i+2]*3]; triangle.v3.y = modelData.vertices[modelData.indices[i+2]*3+1]; triangle.v3.z = modelData.vertices[modelData.indices[i+2]*3+2]; Vector3f normals = calculateNormal(triangle); normalizeVector(&normals); modelData.normals[modelData.surfaceNormals[i]*3] = normals.x; modelData.normals[modelData.surfaceNormals[i]*3+1] = normals.y; modelData.normals[modelData.surfaceNormals[i]*3+2] = normals.z; modelData.normals[modelData.surfaceNormals[i+1]*3] = normals.x; modelData.normals[modelData.surfaceNormals[i+1]*3+1] = normals.y; modelData.normals[modelData.surfaceNormals[i+1]*3+2] = normals.z; modelData.normals[modelData.surfaceNormals[i+2]*3] = normals.x; modelData.normals[modelData.surfaceNormals[i+2]*3+1] = normals.y; modelData.normals[modelData.surfaceNormals[i+2]*3+2] = normals.z; } ``` Update 4: Looking further into this, it seems like the .obj file's normals are surface normals, while I need the vertex normals. (Maybe) If the vertex normals are what I need, if anybody can explain the theory behind calculating them, that'd be great. I tried looking it up but I only found examples, not a theory. (e.g. "get the cross product of each face and normalize it"). If I know what I have to do, I can look it up an individual process if I get stuck and won't have to keep updating this. Update 5: I re-wrote my whole loader, and got it to work, somehow. Although it shades properly, I still have those grid-like lines that you can see on my original results.
OpenGL models show grid-like lines
CC BY-SA 3.0
null
2011-04-27T11:23:13.143
2011-04-29T07:04:20.477
2011-04-29T07:04:20.477
null
null
[ "objective-c", "opengl" ]