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,715,802
1
5,716,072
null
33
17,757
I'm facing a problem when developing layout files for Android with Eclipse ADT Plugin. Some of my files, when opened, does not show the Graphical layout tab, just as below: ![enter image description here](https://i.stack.imgur.com/C68DD.png) The others (actually, the older ones), instead, show it correctly. ![enter image description here](https://i.stack.imgur.com/ZM2uE.png) Does anyone knows what can be done in this case? Thanks in advance!
Graphical Layout tab does not appear for some layout files into Eclipse
CC BY-SA 3.0
0
2011-04-19T11:42:10.533
2012-06-06T16:03:21.320
null
null
416,590
[ "android", "eclipse", "user-interface", "layout", "adt" ]
5,715,835
1
5,716,110
null
12
1,832
I'm trying to implement a discrete fourier transform, but it's not working. I'm probably have written a bug somewhere, but I haven't found it yet. Based on the following formula: ![terere](https://i.stack.imgur.com/PURun.png) This function does the first loop, looping over X0 - Xn-1... ![enter image description here](https://i.stack.imgur.com/fvfRN.png) ``` public Complex[] Transform(Complex[] data, bool reverse) { var transformed = new Complex[data.Length]; for(var i = 0; i < data.Length; i++) { //I create a method to calculate a single value transformed[i] = TransformSingle(i, data, reverse); } return transformed; } ``` And the actual calculating, this is probably where the bug is. ``` private Complex TransformSingle(int k, Complex[] data, bool reverse) { var sign = reverse ? 1.0: -1.0; var transformed = Complex.Zero; var argument = sign*2.0*Math.PI*k/data.Length; for(var i = 0; i < data.Length; i++) { transformed += data[i]*Complex.FromPolarCoordinates(1, argument*i); } return transformed; } ``` `var sign = reverse ? 1.0: -1.0;` The reversed DFT will not have `-1` in the argument, while a regular DFT does have a `-1` in the argument. ![enter image description here](https://i.stack.imgur.com/EeQnn.png) `var argument = sign*2.0*Math.PI*k/data.Length;` is the argument of the algorithm. This part: ![enter image description here](https://i.stack.imgur.com/eUiuq.png) then the last part `transformed += data[i]*Complex.FromPolarCoordinates(1, argument*i);` ![](https://i.stack.imgur.com/dNFZI.png) I think I carefully copied the algorithm, so I don't see where I made the mistake... ## Additional information As Adam Gritt has shown in his answer, there is a nice implementation of this algorithm by AForge.net. I can probably solve this problem in 30 seconds by just copying their code. However, I still don't know what I have done wrong in my implementation. I'm really curious where my flaw is, and what I have interpreted wrong.
What is wrong with this fourier transform implementation
CC BY-SA 3.0
0
2011-04-19T11:45:29.907
2011-04-20T21:21:35.350
2011-04-20T06:52:01.247
241,513
241,513
[ "c#", "c#-4.0", "fft", "complex-numbers" ]
5,716,078
1
null
null
7
4,506
I'm experiencing an issue described in [this thread](http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110). dotTrace told me "Stylus Input" was guilty. ![enter image description here](https://i.stack.imgur.com/TERLl.png) I tried [the code](http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110) posted by [Ron Z](http://social.msdn.microsoft.com/profile/ron%20z/?type=forum&referrer=http://social.msdn.microsoft.com/Forums/en-IE/windowsaccessibilityandautomation/thread/6c4465e2-207c-4277-a67f-e0f55eff0110) and [Chaim Zonnenberg](http://social.msdn.microsoft.com/profile/chaim%20zonnenberg/), but didn't work. [Rash](http://social.msdn.microsoft.com/profile/rath%5Bmsft%5D/) suggested 2 workarounds: 1. Automation code will be triggered only if there are any automation clients ( like screen reader, tabtip in tablet pcs, etc) running in the machine. So one way to get out of this situation is to close any of those automation client apps. 2. If one is not feasible then an alternative is, UIElementHelper.InvalidateAutomationAncestors will take longer time only if automation tree for the app is sparse ( happens if had disabled building automation tree using custom window automation peer) and visual tree is dense. So another solution is disable any custom automation code and allow WPF to build complete automation tree. This should speed up UIElementHelper.InvalidateAutomationAncestors as well. But how to close tabtip? I tried to stop and disable the following services but didn't work, tabtip.exe was still running in the background: - - Rash said this issue should be solved in .NET 4.0 SP1. Anyone knows the release date of .NET 4.0 SP1? I'm using Visual Studio 2010, Windows 7 64bit, Wacom Graphire 4. Thanks --- : To close tabtip.exe I just need to restart Windows after disabling the aforementioned services. But this alone didn't solve my issue. In order to workaround the performance issue, I have to also disable "Wacom Consumer Touch Service". And according to [this thread](http://social.msdn.microsoft.com/Forums/is/wpf/thread/d6e71f13-d7ac-44f2-8c21-af52b9fe2bc3) (March 22, 2011): `there is no published timeline for .NET Framework 4.0 sp1`
WPF performance issue due to UI Automation
CC BY-SA 3.0
null
2011-04-19T12:06:48.273
2019-12-27T19:30:32.690
2019-12-27T19:30:32.690
4,728,685
null
[ ".net", "wpf", "performance" ]
5,716,359
1
5,716,450
null
1
1,750
I want to create an android activity that looks like the one below this. This one has 4 layouts and one has a scroll view. When I add layouts, they get put on the bottom of each other or off the screen. How can I make them fit on one screen. ![enter image description here](https://i.stack.imgur.com/Ruodo.jpg)
Android: How to Distribut Weight Evenly
CC BY-SA 3.0
null
2011-04-19T12:30:33.820
2011-04-19T14:08:34.157
null
null
656,944
[ "android", "user-interface" ]
5,717,010
1
null
null
0
518
I am using a httphandler to dynamically resize images that are rendered on a page. I have a preset width that all images must confirm - and the height of the images can vary (proportions constrained to the original width and height). I am caching the images - however, when they are originally loaded, the httphandler is called after the page is rendered - so for longer images - sometimes on intial load, layout breaks with larger images as they overlap the content that is below it. Here is an example screenshot from here [http://www.teakmonkeystudios.ca/photos/photo.aspx?id=10801](http://www.teakmonkeystudios.ca/photos/photo.aspx?id=10801): ![enter image description here](https://i.stack.imgur.com/9Ihll.jpg) Here is the css: ``` .gallery { margin-left:0px; padding-left:5px; } ul.gallery div.top_frame { width:732px } ul.gallery div.view_frame { margin-left:5px; } ul.gallery div.image_frame { border: 1px solid #dddddd; padding-top: 5px; height:100%; min-height:490px; padding-bottom: 5px; text-align: center; } ul.gallery div.button_frame { width: 732px; text-align: right; margin: 4px 0px 0px 0px; } ul.gallery div.name_frame, ul.gallery div.original_name_frame { margin: 0px 0px 0px 5px; } ul.gallery div.name_frame h2 { margin: 2px 0px 3px 0px; padding: 0px; } ul.gallery div.date_frame { margin-left:5px; margin-bottom:5px; } ul.gallery div.update_frame { width: 732px; margin-bottom: 5px; margin-top: 5px;text-align:right; } ul.gallery div.desc_frame { margin-left:5px; background-color:#eeeeee; } ul.gallery li { width: 732px; display: -moz-inline-stack; display: inline-block; vertical-align:top; margin: 5px; zoom: 1; *display: inline; _height:100%; color:#000000; letter-spacing:0px; line-height:normal; } ul.breadcrumbs li { float:left; margin:0px; padding:0px; width:100%; } ul.breadcrumbs li a { font-size:12px; } ``` Since the image in the screenshot below may be cached you may not see the broken layout. I wonder if rendering the images in a table would be better? Or is there a css fix? I've even tried Jquery and used document ready to adjust the height of the image containers - but the image may not be loaded - so I can't return the height of the image in the function. Any suggestions on how to solve this issue?
Layout fix with images rendered via dynamic image handler
CC BY-SA 3.0
null
2011-04-19T13:21:32.190
2011-04-19T15:05:54.237
null
null
185,961
[ "c#", "asp.net", "css", "image-scaling" ]
5,717,155
1
5,717,484
null
1
2,239
For some reason, I have following situation: ![enter image description here](https://i.stack.imgur.com/y6byT.png) Now I want to get rid of `default_2` and fast-forward `default` to rev 89. But when I do ``` hg up -r default hg transplant 61:89 ``` or ``` hg transplant -b default_2 ``` Mercurial (1.8.2+20110401) just updates my working copy to rev 89. With `mq` extension it looks like I have to specify all intermediate revisions one-by-one. So the questions are: 1. Why doesn’t transplant work? (It’s recommended here: https://www.mercurial-scm.org/wiki/RebaseProject#When_rebase_is_not_allowed) 2. Is there a way to fast-forward without much pain?
Fast-forward branch in mercurial
CC BY-SA 3.0
0
2011-04-19T13:31:05.443
2017-06-19T09:37:51.887
2017-06-19T09:37:51.887
1,000,551
142,655
[ "mercurial", "fast-forward" ]
5,717,158
1
6,105,501
null
1
4,588
Using SharePoint 2007, I downloaded Microsoft's Employee's Training Scheduling and Materials template from [http://www.microsoft.com/downloads/details.aspx?FamilyId=B5206277-550C-44DA-A2D5-D7E32E3B6B8F](http://www.microsoft.com/downloads/details.aspx?FamilyId=B5206277-550C-44DA-A2D5-D7E32E3B6B8F) This is exactly what I wanted but the date format for Start/End date is in the format "MM/dd/yyyy" (US). I want it in "dd/MM/yyyy" (UK) but cannot for the life of me find where I can change this simple detail. Any advice? EDIT: I have found the offending piece of code: ``` <SharePoint:FormField runat="server" id="ff7{$Pos}" ControlMode="New" FieldName="EventDate" __designer:bind="{ddwrt:DataBind('i',concat('ff7',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@EventDate')}"/> ``` But I can't seem to see how the date would be formatted. The exact same piece of code is used elsewhere (different id and a pre-installed template) and displays the date correctly. EDIT: OK Still having problems with this. When I Edit Items the dates are formatted correctly, but when it is displaying the dates they are displayed incorrectly. Any ideas? Correct: ![enter image description here](https://i.stack.imgur.com/lOCmT.jpg) Incorrect: ![enter image description here](https://i.stack.imgur.com/bBmLh.jpg)
Change date format in Sharepoint template
CC BY-SA 3.0
null
2011-04-19T13:31:16.160
2012-10-30T09:21:24.860
2011-04-28T14:13:46.727
591,282
591,282
[ "sharepoint", "date" ]
5,717,241
1
null
null
0
1,543
Is there any way to run JNLP on Windows without display this popup? It's annoying when the operation run periodically. ![Java Web Start download popup](https://i.stack.imgur.com/YrsJr.png) Thanks
Hide loading popup of Java WebStart?
CC BY-SA 3.0
null
2011-04-19T13:37:22.350
2011-11-16T12:09:11.153
2011-11-16T12:09:11.153
525,725
658,741
[ "java", "jnlp", "java-web-start" ]
5,717,356
1
5,729,662
null
1
247
I don't know if this is asked before or if I'm phrasing the question correctly. I can't find any information on google neither. My question is: How do I get a sort of popup like [this](http://tapbots.com/img/software/tweetbot/icon_tabbar.png) when I press a tabbarbutton? ![enter image description here](https://i.stack.imgur.com/XmDmo.png)
How to get an expand-popup while pressing UITabbar
CC BY-SA 3.0
0
2011-04-19T13:46:30.357
2011-04-20T11:45:00.290
2011-04-20T09:33:25.073
685,314
685,314
[ "iphone", "objective-c", "xcode", "uitabbar", "uibarbuttonitem" ]
5,717,742
1
5,717,920
null
0
1,965
I am using a RibbonSplitButton to with menuitems in its dropdown to mimic visual studio's undo redo button. We have the undo redo stacks and I have a dependencypropertychanged event handler that will update the UI based on the stacks. The problem is, the splitbutton's items property is using a Collection, and even though its collection of items are in the right order, it won't display them as they are ordered by index. I will provide some examples below to explain this better: Code: ``` private static void UndoRedoUpdated(DependencyObject obj, DependencyPropertyChangedEventArgs args) { VO3Main main = (VO3Main)Application.Current.MainWindow; MenuItem item; int dif; if (main.UndoCommands != null) { dif = main.UndoCommands.Count - main._undoMenu.Items.Count; if (dif > 0) { for (int i = dif - 1; i >= 0; i--) { item = new MenuItem(); item.Header = main.UndoCommands[i].Name; item.Click += new RoutedEventHandler(main.undoMenu_Click); main._undoMenu.Items.Insert(0, item); } } else if (dif < 0) { for (int i = 0; i < -dif; i++) main._undoMenu.Items.RemoveAt(0); } } if (main.RedoCommands != null) { dif = main.RedoCommands.Count - main._redoMenu.Items.Count; if (dif > 0) { for (int i = dif - 1; i >= 0; i--) { item = new MenuItem(); item.Header = main.RedoCommands[i].Name; item.Click += new RoutedEventHandler(main.redoMenu_Click); main._redoMenu.Items.Insert(0, item); } } else if (dif < 0) { for (int i = 0; i < -dif; i++) main._redoMenu.Items.RemoveAt(0); } } } ``` XAML: ``` <r:RibbonGroup GroupSizeDefinitions="{StaticResource RibbonLayoutSmall}"> <r:RibbonGroup.Command> <r:RibbonCommand LabelTitle="Editing"/> </r:RibbonGroup.Command> <r:RibbonSplitButton Name="_undoMenu" Command="me:AppCommands.Undo" MaxHeight="50"/> <r:RibbonSplitButton Name="_redoMenu" Command="me:AppCommands.Redo" MaxHeight="50"/> </r:RibbonGroup> ``` ![Actual Undo Menu Items](https://i.stack.imgur.com/CJC82.png) ![Undo Menu Items in Code](https://i.stack.imgur.com/puRqp.png) P.S. even if I change the insert at 0 to a Add, so it will add to the last of the collection instead of first, it doesn't seem to make a difference... if anybody can give me some information regarding what's going on and how to work around this, it will be greatly appreciated. Thanks in advance.
WPF RibbonControlsLibrary RibbonSplitButton Items issue
CC BY-SA 3.0
null
2011-04-19T14:13:12.337
2011-04-19T14:33:08.497
null
null
631,080
[ "wpf", "collections", "stack", "ribbon", "undo-redo" ]
5,717,797
1
5,717,989
null
12
655
I am very new to Indexes in MySQL. I know, I should probably have leart it earlier, but most projects been small enough for me to get away with out it ;) So, now I am testing it. I did my test by running `EXPLAIN` on a query: Query: ``` EXPLAIN SELECT a . * FROM `tff__keywords2data` AS a LEFT JOIN `tff__keywords` AS b ON a.keyword_id = b.id WHERE ( b.keyword = 'dog' || b.keyword = 'black' || b.keyword = 'and' || b.keyword = 'white' ) GROUP BY a.data_id HAVING COUNT( a.data_id ) =4 ``` First, without indexes I got these results: ![enter image description here](https://i.stack.imgur.com/MsEpR.jpg) Then, with index on data_id and keyword_id i got this: ![enter image description here](https://i.stack.imgur.com/T3QVG.jpg) So as I understand, the number of rows MySQL has to search goes from 61k down to 10k which must be good right? So my question is, am I correct here? And is there anything else I could think about when trying to optimize? Further more, after some help from AJ and Piskvor pointing out my other table and its column keyword not having index I got this: ![enter image description here](https://i.stack.imgur.com/2GMXO.jpg) Great improvement! Right?
Improving MySQL tables with Indexes
CC BY-SA 3.0
null
2011-04-19T14:16:25.450
2011-04-19T14:41:51.717
2011-04-19T14:35:26.150
266,642
266,642
[ "php", "mysql", "optimization", "indexing" ]
5,717,849
1
5,718,349
null
5
4,033
i came across this question on this website called codility, but i cant really figure out how to solve it, would appreciate the help Given an array A of n integers, and the sequence S of n elements 1 or -1 we define the value: ![enter image description here](https://i.stack.imgur.com/SNc1v.png) Assume the sum of zero elements is equal zero. Write a function ``` int min_abs_sum(int[] A); ``` than given an array A of n integers from the range [-100..100] computes the lowest possible value of val(A,S) (for any sequence S with elements 1 or -1). You can assume that . For example given array: a={1,5,2,-2} your function should return 0, since for sequence S=(-1,1,-1,1) the val(A,S)=0. Here are two links for some peoples result, it doesnt show the solution but it does show the complexity of their algorithms, the first link shows the complexity at which the program should run and the second one is slower. [1st link 100% marks](http://codility.com/cert/view/certM3JC3M-26CK6E5P37T8W7NC/details#) [2nd link 86% marks](http://codility.com/cert/view/certVGNMX7-FQ9ZDVMDVDXHQMEH/details)
Minimum set difference
CC BY-SA 3.0
0
2011-04-19T14:19:58.337
2020-06-29T12:28:25.917
2012-01-07T11:15:01.823
507,519
520,989
[ "java", "algorithm" ]
5,717,865
1
5,719,928
null
0
849
I have 2 table (FirstTable & SecondTable). My FirstTable is header table and SecondTable is detail table, but FirstTable has complex primary key. How I can have a reference in my SecondTable to first Table that be NORMAL and best choice. ![Tables](https://i.stack.imgur.com/cXmt5.jpg)
Design Normal Form in sql server
CC BY-SA 3.0
0
2011-04-19T14:21:02.287
2013-06-13T10:20:13.900
2020-06-20T09:12:55.060
-1
648,723
[ "sql-server", "sql-server-2005", "sql-server-2008", "database-design", "normalization" ]
5,717,889
1
5,820,710
null
3
2,799
Hi I'm trying to pull some javascript on a page off of the page and putting it into an external javascript file for reusability. Just as a test I'm just trying to display an alert text box but even that's not working. Here's what I have so far. Page with the javascript EDIT: Ignore the type="text/javascript" that wasn't the problem ![enter image description here](https://i.stack.imgur.com/Tfh0A.png) Here's the actual content of the script.js ![enter image description here](https://i.stack.imgur.com/t5O02.png) File Structure from the site root ![enter image description here](https://i.stack.imgur.com/b3C8w.png) Honestly it looks like it should work but whenever I run the page in the browser I'm getting this error. ![enter image description here](https://i.stack.imgur.com/k1rC7.png) I know that the path is correct, but what am I missing?
Referencing a custom external javascript file in asp.net mvc 3
CC BY-SA 3.0
null
2011-04-19T14:22:27.257
2011-04-28T15:02:39.620
null
null
581,695
[ "javascript", "jquery", "asp.net-mvc" ]
5,717,899
1
5,717,978
null
0
694
How do I accomplish this ![Dynamic divs](https://i.stack.imgur.com/QTBtH.jpg) with this - each div is generated in the order shown on the server and has unknown height: ``` <html xmlns="http://www.w3.org/1999/xhtml" > <head> <title>Untitled</title> <style type="text/css"> div {width:100px;color:white;background-color:grey;border:solid 5px black; margin:2px} .wrapper {width:331px;height:400px;border:solid 1px black;float:left;} </style> </head> <body> <form id="form1" runat="server"> <div class="wrapper"> <div class="shortDiv" style="float:left;">1 some stuff</div> <div class="tallDiv" style="float:left;">2 some stuff some stuff</div> <div class="shortDiv" style="float:left;">3 some stuff</div> <div class="shortDiv" style="float:left;">4 some stuff</div> <div class="shortDiv" style="float:left;">5 some stuff</div> <div class="shortDiv" style="float:left;">6 some stuff</div> <div class="tallDiv" style="float:left;">7 some stuff some stuff</div> <div class="shortDiv" style="float:left;">8 some stuff</div> <div class="shortDiv" style="float:left;">9 some stuff</div> </div> </form> </body> ```
Using jQuery or CSS to place dynamic divs of unknown height
CC BY-SA 3.0
null
2011-04-19T14:22:54.920
2011-04-19T14:28:59.607
null
null
295,783
[ "jquery", "html", "css" ]
5,718,308
1
5,718,400
null
1
493
I get this error when ever i try run a rawQuery statement for my android application. Does anyone no how to fix it? I am using android 2.2 for my SDK ![Cannot get JAR source](https://i.stack.imgur.com/9ChyG.png) its driving me crazy :(
android 2.2 JAR source not found
CC BY-SA 3.0
null
2011-04-19T14:49:02.957
2011-04-19T14:55:35.273
null
null
670,994
[ "android", "sql", "jar", "executable-jar" ]
5,718,381
1
5,720,278
null
0
1,089
I want to add a color picker in my preferences dialog that is like mspaint's. ![enter image description here](https://i.stack.imgur.com/cgmMs.png) Is this possible to do with MFC? I'm using VC6 because the project was started on it a long time ago and now it can't be ported, so I can't use new MFC classes.
Adding a color-picker toolbar like mspaint's
CC BY-SA 3.0
null
2011-04-19T14:54:18.433
2011-04-19T17:27:56.627
2011-04-19T15:06:13.230
492,336
492,336
[ "mfc", "color-picker" ]
5,718,530
1
6,260,395
null
2
8,022
If you go to the site below, you will see there is a youtube video, but if you select the add to cart button on any of the products below, a popup window shows the product being added to the cart. However, the YouTube video shows through it. Is this a Z-index issue or do I need to add some tags into the embed code from YouTube? The problem is only happening in Windows on Chrome & IE. The problem does not happen on MAC in any browsers. I have not checked Safari on Windows. [http://www.unicornfibre.com/pages/Power-Scour-.html](http://www.unicornfibre.com/pages/Power-Scour-.html) Below is a screenshot of the problem ![This is a screenshot of the problem](https://i.stack.imgur.com/lRCp3.png)
How do I fix a YouTube flash video overlay problem on a ajax popup window layer in IE & Chrome?
CC BY-SA 3.0
0
2011-04-19T15:06:28.363
2014-03-03T18:49:22.990
null
null
555,677
[ "css", "flash", "internet-explorer", "xhtml", "google-chrome" ]
5,718,657
1
5,718,762
null
2
1,994
All of a sudden, my intellisense window in VS2010 Express has a input field which has exactly what I'm typing. This wouldn't bother me, except that now space doesn't commit the selected choice that intellisense gives me. Also note that the option in Tools-Options-Text Editor-C#-IntelliSense does have the "Comitted by pressing the spacebar" checked, yet it doesn't work. ![enter image description here](https://i.stack.imgur.com/TQ3nD.png)
Intellisense window has input field, and doesn't commit on space
CC BY-SA 3.0
0
2011-04-19T15:15:23.037
2015-05-20T20:32:55.507
2011-04-19T15:32:18.177
703,169
703,169
[ "c#", "visual-studio", "visual-studio-2010", "intellisense" ]
5,718,761
1
5,719,098
null
5
550
Given a search string and a result string (which is guaranteed to contain all letters of the search string, case-insensitive, in order), how can I most efficiently get an array of ranges representing the indices in the result string corresponding to the letters in the search string? Desired output: ``` substrings( "word", "Microsoft Office Word 2007" ) #=> [ 17..20 ] substrings( "word", "Network Setup Wizard" ) #=> [ 3..5, 19..19 ] #=> [ 3..4, 18..19 ] # Alternative, acceptable, less-desirable output substrings( "word", "Watch Network Daemon" ) #=> [ 0..0, 10..11, 14..14 ] ``` This is for an autocomplete search box. Here's a screenshot from [a tool](http://colibri.leetspeak.org/) similar to [Quicksilver](http://qsapp.com/) that underlines letters as I'm looking to do. Note that--unlike my ideal output above--this screenshot does not prefer longer single matches. ![Screenshot of Colibri underlining letters in search results](https://i.stack.imgur.com/qYwuI.png) ## Benchmark Results Benchmarking the current working results shows that @tokland's regex-based answer is basically as fast as the StringScanner-based solutions I put forth, with less code: ``` user system total real phrogz1 0.889000 0.062000 0.951000 ( 0.944000) phrogz2 0.920000 0.047000 0.967000 ( 0.977000) tokland 1.030000 0.000000 1.030000 ( 1.035000) ``` Here is the benchmark test: ``` a=["Microsoft Office Word 2007","Network Setup Wizard","Watch Network Daemon"] b=["FooBar","Foo Bar","For the Love of Big Cars"] test = { a=>%w[ w wo wor word ], b=>%w[ f fo foo foobar fb fbr ] } require 'benchmark' Benchmark.bmbm do |x| %w[ phrogz1 phrogz2 tokland ].each{ |method| x.report(method){ test.each{ |words,terms| words.each{ |master| terms.each{ |term| 2000.times{ send(method,term,master) } } } } } } end ```
Find consecutive substring indexes
CC BY-SA 3.0
0
2011-04-19T15:22:10.260
2014-03-21T19:33:36.903
2011-04-19T19:25:31.183
405,017
405,017
[ "ruby", "autocomplete" ]
5,718,846
1
5,721,102
null
7
5,248
I just finished implementing VBO's in my 3D app and saw a roughly 5-10x speed increase in rendering. What used to render at 1-2 frames per second now renders at 10-11 frames per second. My question is, are there any further improvements I can make to increase rendering speed? Will triangle strips make a big difference? Currently vertices are not being shared between faces, each faces vertices are unique but overlapping. My Device Utilization is 100%, Tiler Utilization is 100%, Renderer Utilization is 11%, and resource bytes is 114819072. This is rendering 912,120 faces on a CAD model. Any suggestions? ![](https://i1238.photobucket.com/albums/ff487/davidohyer/drum.png)
How can I optimize the rendering of a large model in OpenGL ES 1.1?
CC BY-SA 3.0
0
2011-04-19T15:27:51.090
2011-04-19T18:45:33.753
2017-02-08T14:31:58.950
-1
419,861
[ "iphone", "ios", "opengl-es", "vbo" ]
5,718,967
1
5,722,840
null
0
851
Below code defines a horizontal field manager with two fields. How can I amend the code so that the background is just set on the two fields being added not on the whole manager. Note, im not attempting to add an individual background image to each of the fields, instead a shared background image that spans behind the two fields. ``` LabelField label = new LabelField("name"); TextField e = new TextField(Field.FOCUSABLE); final Bitmap b = Constants.SETTINGS; final Background bg = BackgroundFactory.createBitmapBackground(Constants.SETTINGS); HorizontalFieldManager manager = new HorizontalFieldManager() { public void sublayout (int width, int height) { Field field; int x = 0; super.sublayout(b.getWidth(), height); super.setExtent(b.getWidth(), height); for (int i = 0; i < getFieldCount(); i++) { field = getField(i); layoutChild(field, Display.getWidth()/2, height); setPositionChild(field, x, 10); x += Display.getWidth()/2; } } }; manager.add (label); manager.add (e); add (manager); ``` ![Image of desired effect](https://i.stack.imgur.com/9dsPv.png)
Background image behind two fields in custom HorizontalFieldManager
CC BY-SA 3.0
null
2011-04-19T15:37:50.817
2011-09-27T00:53:29.577
2011-04-19T19:59:41.970
470,184
470,184
[ "blackberry" ]
5,719,398
1
5,726,424
null
1
678
Hi; I have 4 tables, one of them is main table also there is one to many relation between tables. TID is Foreign key and ID is PK. As a result. i don't want to fill table with classic method. I should access table property and generic <T> I want to set all TID to T_Table ,C_Table, Q_Table ![enter image description here](https://i.stack.imgur.com/ze76H.png) MY CODES(this is test project not real project but logis is the same as real project) Below codes return to me ERROR( in first foreach loop): ``` using System.Reflection; namespace App.ReflectionToGeneric { class Program { static void Main(string[] args) { string[] PropertyNames = new string[] { "TID", "AnyID" }; int[] Vals = new int[] { 1, 2 }; new DataManager().Save<QTable>(PropertyNames, Vals); } } public class DataManager { IEnumerable<Table> list = new GetData().GetVals(); public void Save<TModel>( string[] PropertyNames, int[] Vals ) where TModel : class, new() { var instance = new TModel(); Type calcType = instance.GetType(); // object calcInstance = Activator.CreateInstance(calcType); foreach (string PropertyName in PropertyNames) { // ERROR RETURN TO ME BELOW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! calcType.GetProperty(PropertyName).SetValue(instance, Vals[0], null); } foreach (string PropertyName in PropertyNames) { Console.WriteLine(calcType.GetProperty(PropertyName).GetValue(instance, null).ToString()); } } } public class GetData { public IEnumerable<Table> GetVals() { List<Table> list = new List<Table>(); list.Add(new Table() { ID = 1, Name = "yusuf" }); list.Add(new Table() { ID = 2, Name = "berkay" }); return list; } } public class Table { internal int ID { get; set; } internal string Name { get; set; } } public class CTable { internal int ID { get; set; } internal int TID { get; set; } internal int AnyID { get; set; } } public class QTable { internal int ID { get; set; } internal int TID { get; set; } internal int AnyID { get; set; } } public class TTable { internal int ID { get; set; } internal int TID { get; set; } internal int AnyID { get; set; } } } ```
how to fill Sql Table with Generic Reflection method?
CC BY-SA 3.0
null
2011-04-19T16:11:28.317
2011-04-20T06:38:05.837
2011-04-20T06:34:18.320
298,875
298,875
[ "c#", ".net", "asp.net", "visual-studio-2008", "reflection" ]
5,719,671
1
null
null
12
6,569
in AssemblyInfo.cs file I have following subection: ``` #if DEBUG [assembly: AssemblyConfiguration("Debug")] #else [assembly: AssemblyConfiguration("Release")] #endif ``` Where this information can be seen after assembly is built ? Since there is nothing about it in file details: ![enter image description here](https://i.stack.imgur.com/Dmr4L.jpg) where else can it be found ? Regards
Where to find the assembly configuration information?
CC BY-SA 3.0
0
2011-04-19T16:34:21.283
2015-06-25T13:09:48.300
2012-10-10T09:00:37.843
270,315
270,315
[ ".net", ".net-assembly", "assemblyinfo" ]
5,719,812
1
null
null
1
2,224
I am using the [ASP.NET Chart Control](http://weblogs.asp.net/scottgu/archive/2010/02/07/built-in-charting-controls-vs-2010-and-net-4-series.aspx) that Microsoft provides. I have a simple 2D chart with two series in it, one is positive and the other is negative. Here is what it looks like currently: ![Picture of my chart](https://i.stack.imgur.com/2OmCI.png) I am guessing, because of my data range that the Y Axis at zero does not display by default. But if I add this line it does (as you can see in the above image): ``` AxisY.Crossing = 0; ``` AxisY is a reference to the Y Axis object. Is there a way to now label the axis without having to manually label all the major grid lines? If I do this it will label the Axis, but all the other dollar labels disappear: ``` Chart.ChartAreas[0].AxisY.CustomLabels.Add(new CustomLabel(0, 1, "0", 0, LabelMarkStyle.SideMark)); ``` Here is my ASP.NET code: ``` <asp:Chart ID="chartStudyResults" runat="server" AntiAliasing="All" Height="650px" Width="690px"> <Series> </Series> <ChartAreas> <asp:ChartArea Name="main" IsSameFontSizeForAllAxes="true"> <AxisX Interval="1" IntervalAutoMode="VariableCount"> <MajorGrid Enabled="false" /> </AxisX> <AxisY> <MajorGrid Enabled="true" /> </AxisY> </asp:ChartArea> </ChartAreas> </asp:Chart> ``` I am adding the series data in code. Thanks in advance.
ASP.NET Chart Control - Add Label to AxisY Crossing without removing automatic labels of major grid lines
CC BY-SA 3.0
null
2011-04-19T16:48:30.490
2011-06-29T16:53:40.107
null
null
54,392
[ "asp.net", "charts", "asp.net-charts" ]
5,719,868
1
5,749,740
null
3
3,014
I have a div that I want to use as the page footer, and have it fill the whole width of the page. So far, so simple, you would think. And, it is, in and IE. Unfortunately in both major webkit browsers, despite having my footer (`#footer`) set for `width:100%; max-width:none;`, webkit won't make it fill the width of the browser window. The page is here: [page demonstrating problem](http://kitandmarcin.us/tustincommercial/index.xhtml) What's happening? Any solutions? Edit: Apologies all - when I said it was working in Safari, that was a typo - I meant firefox. Screenshots: ![Working correctly in IE](https://i.stack.imgur.com/xUJhQ.jpg) Here it is being broken in Chrome (same behaviour in Safari). The arrow is hand drawn, for emphasis. ![Broken rendering in Chrome](https://i.stack.imgur.com/Zk0gF.jpg)
Can't make div fill width of screen in Webkit (chrome and safari)
CC BY-SA 3.0
null
2011-04-19T16:52:30.827
2011-04-22T09:06:54.237
2011-04-19T18:58:03.560
21,640
21,640
[ "css", "google-chrome", "safari", "webkit", "cross-browser" ]
5,719,946
1
5,720,066
null
0
717
![enter image description here](https://i.stack.imgur.com/EcpcZ.jpg) in my asp.net page i have register page. i want to create a xml file with parent and child nodes of xml like : ``` <Personal Details> <First Name> ... </First Name> <Last Name> ... </Last Name> </Personal Details> <Bank Details> <Bank Name> ... </Bank Name> <Account No> ... </Account NO> <Bank Details> ``` and store the xml file in datbase widht parent and child nodes.
Creating xml file in asp.net?
CC BY-SA 3.0
0
2011-04-19T16:59:18.877
2011-04-19T17:37:37.077
2011-04-19T17:37:37.077
124,069
164,002
[ "asp.net" ]
5,719,967
1
5,722,137
null
1
62
i have this: ``` <% @devices.each do |device| %> <tr> <td> <% if device.photo.exists? then %> <%= image_tag device.photo.url(:small) %></br> <% end %> <%= link_to device.name, device %></br> <%= device.description %></br> <%= link_to 'Redaguoti', edit_device_path(device) %></br> <%= link_to 'Ištrinti', device, :confirm => 'Ar tikrai norite ištrinti šį prietaisą?', :method => :delete %> </td> <% end %> ``` I want to get data like this: ![table](https://i.stack.imgur.com/cxTWj.png) Thank you
Data in columns and rows, one record in one cell
CC BY-SA 3.0
0
2011-04-19T17:01:45.517
2011-04-19T20:25:14.163
null
null
332,719
[ "ruby-on-rails", "ruby-on-rails-3" ]
5,719,991
1
5,720,822
null
2
54
I recently found a bug in [TomatoFlix](https://apps.kynetx.com/installable_apps/3459-TomatoFlix) through the KBX. When the user is logged in on Netflix (different from the non-logged-in interface), the rating banner gets added twice: ![Doubled rating banner](https://i.stack.imgur.com/YNf3H.png) I added some emits to my rules to show when the rule is getting fired. The code now looks like this: ``` rule netflix_loggedin { select when pageview "movies.netflix.com/.*?Movie/(.*)/" setting (movieTitle) pre { title = movieTitle.replace(re/[-_]/g, " "); div = getRatings(title, "", "lycoflix"); } emit <| console.log("TomatoFlix fired!"); |>; before("p.synopsis", div); } rule netflix_two { select when pageview "movies.netflix.com/.*?Movie/(.*)/" setting (movieTitle) emit <| console.log("TomatoFlix second rule fired!"); |>; } ``` The JavaScript console shows the following four lines: ``` TomatoFlix fired! TomatoFlix second rule fired! TomatoFlix fired! TomatoFlix second rule fired! ``` This doesn't happen with a bookmarklet or with the standalone browser extension. Only in the KBX. The `dispatch` block has two domains in it: `www.netflix.com` and `movies.netflix.com` Ideas?
KBX extension calling ruleset twice
CC BY-SA 3.0
null
2011-04-19T17:03:46.023
2011-04-19T18:19:44.447
null
null
191,521
[ "krl" ]
5,719,999
1
null
null
2
6,445
In my ListView each item consists of ImageView and TextView. I want when I click on image - get itemid(and then show image in dialog). How to catch click on ImageView and get Id of ListItem? ![enter image description here](https://i.stack.imgur.com/y7s4T.jpg) ``` ImageView image; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.content_friends); contactsList=(ListView)findViewById(android.R.id.list); contactsList.setOnItemClickListener(clickListener); image = (ImageView)findViewById(R.id.image_a); image.setOnClickListener(imListener); } OnItemClickListener clickListener = new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long itemId) { Toast.makeText(getApplicationContext(), "listItem " + itemId, Toast.LENGTH_SHORT).show(); } }; OnClickListener imListener = new OnClickListener() { @Override public void onClick(View v) { Toast.makeText(getApplicationContext(), "Image of listItem ", Toast.LENGTH_SHORT).show(); } }; ```
ListView. Getting itemId when click on imageView
CC BY-SA 3.0
0
2011-04-19T17:04:44.457
2014-09-12T23:35:19.163
null
null
672,752
[ "android", "listview" ]
5,719,996
1
5,720,042
null
2
6,051
I'm making a simple address book GUI and I don't have a very good grasp of layouts. I want my GUI to look like this... ![enter image description here](https://i.stack.imgur.com/8AHG9.jpg) Here is my DRIVER: ``` import javax.swing.*; public class AddressBookGui { public static void main (String[] args) { userInput addressBook = new userInput(); addressBook.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); //whenever you hit x you will exit the program addressBook.setSize(750, 600); addressBook.setVisible(true); } } This is my USERINPUT class import java.awt.*; import javax.swing.*; public class userInput extends JFrame { private JButton newEntry; private JButton deleteEntry; private JButton editEntry; private JButton saveEntry; private JButton cancelEntry; private FlowLayout layout; private JTextField lastName; private JTextField middleName; private JTextField firstName; private JTextField phone; public userInput() { super("My Address Book"); //sets the title! Container content = getContentPane(); JPanel buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout()); newEntry = new JButton("New"); deleteEntry = new JButton("Delete"); editEntry = new JButton("Edit"); saveEntry = new JButton("Save"); cancelEntry = new JButton("Cancel"); buttonPanel.add(newEntry); buttonPanel.add(deleteEntry); buttonPanel.add(editEntry); buttonPanel.add(saveEntry); buttonPanel.add(cancelEntry); add(buttonPanel, BorderLayout.SOUTH); content.setLayout(new BorderLayout()); content.add(buttonPanel, "South"); lastName = new JTextField(10); //set the length to 10. add(lastName); //adds item1 to the window firstName = new JTextField(10); add(firstName); middleName = new JTextField(10); add(middleName); phone = new JTextField(10); add(phone); setVisible(true); } } ``` Currently I have the buttons at the bottom, but the GUI is just one giant text box. Thanks for the help.
JTextField with JLabels in Simple GUI
CC BY-SA 3.0
null
2011-04-19T17:04:26.953
2011-04-19T17:13:31.580
2011-04-19T17:13:31.580
273,200
707,105
[ "java", "user-interface" ]
5,720,043
1
5,720,093
null
3
226
What does class=" " do if there is nothing being referenced between the quotes? It comes from the HTML of [http://careers.stackoverflow.com/](http://careers.stackoverflow.com/) ``` <a class="" href="/cv>my profile</a> ``` I'm trying to figure out how to create the texture behind the grey button. ![image from navigation menu careers.stackoverflow.com](https://i.stack.imgur.com/Lhycs.jpg)
What does class=" " do?
CC BY-SA 3.0
null
2011-04-19T17:08:17.087
2011-04-19T17:21:39.327
null
null
604,741
[ "html", "css", "class" ]
5,720,210
1
5,721,004
null
2
3,021
I have an application which talks to USB printer and prints out the receipt once a sale is completed. I have no problem with connecting to the printer and printing something. THe problem i have now is when i do some printing i could see only a part of my message gets printed on the receipt. I have attached the code i am using. Please help me to see the full printed receipt :) --CODE-- ``` package utilities; import javax.swing.JFrame; import javax.swing.JOptionPane; import java.awt.print.PrinterJob; import java.awt.print.PageFormat; import java.awt.print.Printable; import java.awt.print.PrinterException; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; public class ReceiptPrinter implements Printable { private JFrame printFrame; private String waitMsg; private javax.swing.JTextArea jTextArea1;` /** Inner class for the actual printed object */ class PrintFrame extends JFrame { PrintFrame(String msg) { setBackground(new Color(255, 255, 255, 0)); jTextArea1 = new javax.swing.JTextArea(); jTextArea1.setColumns(80); jTextArea1.setLineWrap(true); jTextArea1.setRows(5); jTextArea1.setWrapStyleWord(true); jTextArea1.setText(msg); add(jTextArea1); pack(); setVisible(true); } } /** Creates a new instance of ReceiptPrinter with a default wait message */ public ReceiptPrinter() { waitMsg = "Wait for the printer to finish\nClick the OK button when done"; } /** * Creates a new instance of ReceiptPrinter with a wait message. * * @param msg the wait message */ public ReceiptPrinter(String msg) { waitMsg = msg; } /** * Sends the actual message to the receipt printer - does not wait. * * @param msg the actual message to be printed */ public void printIt(String msg) { printIt(msg, false); } /** * Sends the actual message to the receipt printer. * * @param msg the actual message to be printed * @param wait show JOptionPane to wait for print to finish */ public void printIt(String msg, boolean wait) { printFrame = new PrintFrame(msg); PrinterJob job = PrinterJob.getPrinterJob(); PageFormat format = job.defaultPage(); format.setOrientation(PageFormat.PORTRAIT); //double width = format.getWidth(); System.out.println(format.getImageableX()+","+format.getImageableY()); job.setPrintable(this, format); try { job.print(); if (wait) { JOptionPane.showMessageDialog(null, waitMsg, "Information", JOptionPane.INFORMATION_MESSAGE); } } catch (PrinterException e) { e.printStackTrace(); } //printFrame.dispose(); } /** * Print method required by Printable interface. * * @param g the graphics context * @param format the page format * @param pagenum the page number requested to print * @return int flag indicating page existance */ public int print(Graphics g, PageFormat pf, int pagenum) { if (pagenum > 0) { return Printable.NO_SUCH_PAGE; } //g.translate(0, 150); Graphics2D g2d = (Graphics2D)g; g2d.translate(pf.getImageableX(), pf.getImageableY()); /* Print the entire visible contents of a java.awt.Frame */ printFrame.printAll(g2d); //g.translate((int) format.getImageableX(), // (int) format.getImageableY()); //printFrame.paint(g); return Printable.PAGE_EXISTS; } } ``` And the main function where i call this class is ``` package utilities; import forms_helper.global_variables; import java.awt.Dimension; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import javax.swing.JOptionPane; public class PrintTest extends javax.swing.JFrame { private ReceiptPrinter receiptPrinter = new ReceiptPrinter(); private FileOutputStream fos; public PrintTest() { initComponents(); setPreferredSize(new Dimension(300, 200)); pack(); try { fos = new FileOutputStream("USB002"); } catch (FileNotFoundException e) { JOptionPane.showMessageDialog(this, "Cannot open file\n" + e.getMessage(), "Warning", JOptionPane.WARNING_MESSAGE); } }` private void initComponents() { openButton = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); display = new javax.swing.JTextArea(); exitButton = new javax.swing.JButton(); getContentPane().setLayout(null); setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); openButton.setFont(new java.awt.Font("Tahoma", 1, 11)); openButton.setText("Open"); openButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { openButtonActionPerformed(evt); } }); getContentPane().add(openButton); openButton.setBounds(151, 120, 80, 23); display.setColumns(20); display.setRows(5); jScrollPane1.setViewportView(display); getContentPane().add(jScrollPane1); jScrollPane1.setBounds(10, 10, 220, 92); exitButton.setFont(new java.awt.Font("Tahoma", 1, 11)); exitButton.setText("Exit"); exitButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { exitButtonActionPerformed(evt); } }); getContentPane().add(exitButton); exitButton.setBounds(10, 120, 70, 23); pack(); } private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) { try { fos.close(); } catch (IOException e) { JOptionPane.showMessageDialog(this, "Unable to close printer port", "Warning", JOptionPane.WARNING_MESSAGE); } dispose(); } private void openButtonActionPerformed(java.awt.event.ActionEvent evt) { // this section attempts to send the BEL character to the printer port byte bel = 0x07; try { fos.write(bel); fos.flush(); } catch (IOException e) { JOptionPane.showMessageDialog(this, "Error trying to write\n" + e.getMessage(), "Warning", JOptionPane.WARNING_MESSAGE); } // this section appends the BEL to the printed message and sends it to the Windows printer //String msg = "test \n test"; String msg=global_variables.msg; msg += ((char) 0x07); receiptPrinter.printIt(msg); // this section displays a hex dump of the printed message // note that the BEL is being converted to a box and that // is what actually prints on the printer instead of the beep for (int i = 0; i < msg.length(); i += 5) { for (int j = 0; j < 5; j++) { if ((i + j) < msg.length()) { int x = msg.charAt(i + j); display.append(String.format("%02x ", x)); } } display.append(" "); for (int j = 0; j < 5; j++) { if (i + j < msg.length()) { char c = msg.charAt(i + j); display.append(String.format(" %c", c)); } } display.append("\n"); } } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new PrintTest().setVisible(true); } }); } private javax.swing.JTextArea display; private javax.swing.JButton exitButton; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JButton openButton; } ``` When i print it i am getting the image like this ![enter image description here](https://i.stack.imgur.com/g21JL.jpg) Actual content was something like this ![enter image description here](https://i.stack.imgur.com/NgHy8.jpg)
Problem with printing in Java
CC BY-SA 3.0
0
2011-04-19T17:21:12.957
2011-04-19T22:13:38.833
2011-04-19T18:14:56.807
230,513
402,610
[ "java", "swing", "printing" ]
5,720,293
1
null
null
2
3,264
I have a little alignment problem with my table. This only occurs with Google Chrome. I would like to have my header checkbox aligned with all checkbox of my table. Everything works well on IE & Chrome until I add the css . You can see the result below. On Chrome, the header checkbox is no more aligned with all other checkbox in my table. ![Page displayed with Internet explorer](https://i.stack.imgur.com/UwGve.jpg) ![Page displayed with Google Chrome](https://i.stack.imgur.com/uTksz.jpg) Here is my css: ``` table.search-results { border-collapse: collapse; table-layout:fixed; width: 100%; } table.search-results td.tipsy-empty { width: 5px; } table.search-results td.tipsy { width: 5px; } table.search-results td.checkbox { width:20px; } table.search-results td.favoricon { width:20px; } table.search-results td.idaffaire { width:50px; } table.search-results td.information { width:auto; white-space:nowrap; overflow:hidden; } table.search-results td.username { width:50px; } ``` Any help is greatly appreciated.
CSS Alignment problem with Google Chrome
CC BY-SA 3.0
null
2011-04-19T17:28:45.277
2011-04-19T18:16:06.073
2011-04-19T18:16:06.073
198,536
693,560
[ "css", "google-chrome" ]
5,720,464
1
5,720,516
null
0
2,430
I have the following problem. I made an application in C# (using Visual Studio 2010). Everything worked fine. Then I had to make some changes in a "main.cs". Did those... all fine again. Then I had to make other changes in same file. Did those... cleaned the solution built it. The problem is that when I run/debug/anything the application I get the same result as I did before I made the changes. I even tried to break the code (called a random function that didn't exist, used wrong syntax), but the result was the same "Build successful" and the old version. Is there some kind of cacheing mechanism or something? How do I get rid of this problem? I added prints for the "compile" solution... I can't find the build property. ![Enter image description here](https://i.stack.imgur.com/d4xu0.png) ![Enter image description here](https://i.stack.imgur.com/G5YRN.png)
C# - Visual Studio project build
CC BY-SA 4.0
null
2011-04-19T17:47:44.020
2018-10-13T15:09:15.630
2018-10-13T15:09:15.630
63,550
569,872
[ "c#", "visual-studio-2010" ]
5,720,471
1
5,806,794
null
29
43,515
I have tried the suggestions in [this post](https://stackoverflow.com/questions/4762538/iis-express-windows-authentication) but I can not get Windows Authentication working with IIS Express in Vision Studio 2010. Now I get following error: ![401.2 Error](https://i.stack.imgur.com/fJDnX.png) Here are my applicationhost.config file entries: ``` ... <add name="WindowsAuthenticationModule" lockItem="false" /> ... <authentication> <anonymousAuthentication enabled="true" userName="" /> <basicAuthentication enabled="false" /> <clientCertificateMappingAuthentication enabled="false" /> <digestAuthentication enabled="false" /> <iisClientCertificateMappingAuthentication enabled="false"> </iisClientCertificateMappingAuthentication> <windowsAuthentication enabled="true" /> </authentication> ... <sectionGroup name="authentication"> <section name="anonymousAuthentication" overrideModeDefault="Allow" /> <section name="basicAuthentication" overrideModeDefault="Allow" /> <section name="clientCertificateMappingAuthentication" overrideModeDefault="Allow" /> <section name="digestAuthentication" overrideModeDefault="Allow" /> <section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Allow" /> <section name="windowsAuthentication" overrideModeDefault="Allow" /> </sectionGroup> ``` My web.config: ``` <system.web> <authentication mode="Windows" /> </system.web> <system.webServer> <security> <authentication> <anonymousAuthentication enabled="false" /> <windowsAuthentication enabled="true" /> </authentication> </security> </system.webServer> ``` This is .NET 4
IIS Express HTTP Error 401.2 - Unauthorized
CC BY-SA 3.0
0
2011-04-19T17:48:08.143
2020-07-14T21:34:27.227
2017-05-23T12:32:05.310
-1
12,367
[ ".net-4.0", "windows-authentication", "iis-express" ]
5,720,486
1
5,720,583
null
0
505
I'm writing a dropdown navigation for my page using an unordered list, but the list items display the elements behind them. ![What I'm talking about](https://i.stack.imgur.com/Kqolm.jpg) See how the hr displays through the submenu? That's what I don't want. I've tried fuddling with the z-index for all the elements involved, and assigning background colors, but that doesn't seem to work. I feel like I'm missing a simple solution. Related Html ``` <ul id="menu" class="topNavListLeft"> <li class="headlink">@Html.ActionLink("Home", "Index", "Home") <ul> <li>@Html.ActionLink("Home", "Index", "Home")</li> <li>@Html.ActionLink("About", "About", "Home")</li> </ul> </li> <li class="headlink">@Html.ActionLink("About", "About", "Home") <ul> <li>@Html.ActionLink("About", "About", "Home")</li> <li>@Html.ActionLink("Home", "Index", "Home")</li> </ul> </li> </ul> </div> <div> <br /> <hr style="position:relative; top:-25px; color:Gray; background-color:Gray; height:3px" /> </div> ``` Edit: Here's a few sections of my CSS too. ``` .nav a:active, .nav a:hover { color:#1ba1e2; } ul.topNavListLeft { white-space:nowrap; padding-top:50px; min-height:35px; width:100%; } .topNavListLeft > li { float:left; font-size:18px; padding-right:50px; height:35px; display:block; } .topNavListLeft div { float:left; white-space:nowrap; padding-right:60px; } .topNavListLeft li ul { display:none; z-index:20; } .topNavListLeft a { display:block; z-index:20; } .topNavListLeft a:hover, .topNavListLeft li.current a { border-bottom:solid 6px #1ba1e2; } .topNavListLeft li:hover ul { display:block; } ul { list-style: none; } .content { text-align:left; width:903px; margin:0px 40px 0px 40px; } .body { margin:0px auto; width:981px; text-align:center; background-color:#fff; color: #666666; min-height:101%; position:relative; font-size:14px; font-family:'Segoe UI',arial,helvetica; } a { text-decoration:none; color:Gray; } a:link, a:hover { color:#1ba1e2; } ```
Dropdown list displays elements behind it in IE9 and FF
CC BY-SA 3.0
null
2011-04-19T17:49:27.503
2011-04-19T22:16:47.443
2011-04-19T18:20:54.090
467,384
467,384
[ "html", "css", "drop-down-menu" ]
5,720,552
1
5,728,936
null
3
430
## UPDATE 2 I found a tentative solution that currently works for me in Chrome on Mac OS X. [You can check out my answer below for details](https://stackoverflow.com/questions/5720552/complicated-css-layout-need-some-help/5724006#5724006). For those of you who are still trying to come up with CSS only solutions or JavaScript solutions, please keep going and let me know what you come up with! Please :) ## UPDATE The answer below is really close to an all CSS solution, so I'm going to try to make it work. In the meantime, I'm opening up this question to JavaScript solutions as well. How would you do it using JavaScript? All solutions are now welcome :) --- Let's see if we can solve this one together! I'm trying to set up a layout, check out the image... ![layout](https://i.stack.imgur.com/17bnz.png) I'm using the "sticky footer" technique, which works great, and I've set it up so that whenever one of the two columns gets taller, the other will also match its height, [as described in this article](http://matthewjamestaylor.com/blog/equal-height-columns-2-column.htm). The problem, however, is that these two columns don't reach the footer naturally... I'm forcing the height through JavaScript. Anyway, all the relevant code can be seen in the fiddle... ## CODE [http://jsfiddle.net/UnsungHero97/XrJMa/embedded/result/](http://jsfiddle.net/UnsungHero97/XrJMa/embedded/result/) ## QUESTIONS 1. First big problem: how can I set it up so that the height of these columns reaches the footer below? I want it so that when the page loads, both pink and blue columns reach the bottom automatically. 2. How can I get it so that when the pink column grows beyond its current height, a local scrollbar appears, but when the blue column grows beyond its current height, the overall page scrollbar appears and the footer is pushed down? ``` - basically, I want the height of the pink and blue columns to ALWAYS be the same height but the height is only determined by the blue column; blue is dominant so it can expand the height of both columns; pink cannot expand the height, just be at the same height as blue ``` 1. Can this functionality be achieved using only CSS? Let me know if I need to clarify anything.
How to create a table-like CSS layout with DIVs?
CC BY-SA 4.0
0
2011-04-19T17:55:35.153
2020-12-18T11:06:13.377
2020-12-18T11:06:13.377
1,783,163
196,921
[ "javascript", "css", "layout" ]
5,720,689
1
5,722,465
null
18
3,767
Rationals are enumerable. For example this code finds k-th rational in open interval 0..1, with ordering that `{n1, d1}` is before `{n2, d2}` if `(d1<d2 || (d1==d2 && n1<n2))` assuming `{n,d}` is coprime. ``` RankedRational[i_Integer?Positive] := Module[{sum = 0, eph = 1, den = 1}, While[sum < i, sum += (eph = EulerPhi[++den])]; Select[Range[den - 1], CoprimeQ[#, den] &][[i - (sum - eph)]]/den ] In[118]:= Table[RankedRational[i], {i, 1, 11}] Out[118]= {1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6} ``` Now I would like to generate random rationals, given an upper bound on the denominator sort-of uniformly, so that for large enough denominator rationals will be uniformly distributed over the unit interval. Intuitively, one could pick among all rationals with small denominators with equal weights: ``` RandomRational1[maxden_, len_] := RandomChoice[(Table[ i/j, {j, 2, maxden}, {i, Select[Range[j - 1], CoprimeQ[#, j] &]}] // Flatten), len] ``` Can one generate random rationals with this distribution more efficiently, without constructing all of them ? It does not take much for this table to become huge. ``` In[197]:= Table[RankedRational[10^k] // Denominator, {k, 2, 10}] Out[197]= {18, 58, 181, 573, 1814, 5736, 18138, 57357, 181380} ``` Or maybe it is possible to efficiently generate rationals with bounded denominator having a different "feels-like-uniform" distribution ? --- This is Mathematica code which runs acceptance-rejection generation suggested by btilly. ``` Clear[RandomFarey]; RandomFarey[n_, len_] := Module[{pairs, dim = 0, res, gcds}, Join @@ Reap[While[dim < len, gcds = cfGCD[pairs = cfPairs[n, len - dim]]; pairs = Pick[pairs, gcds, 1]; If[pairs =!= {}, dim += Length@Sow[res = pairs[[All, 1]]/pairs[[All, 2]]]]; ]][[2, -1]] ] ``` The following compiled function generations pairs of integers `{i,j}` such that `1<=i < j<=n`: ``` cfPairs = Compile[{{n, _Integer}, {len, _Integer}}, Table[{i, RandomInteger[{i + 1, n}]}, {i, RandomChoice[2 (n - Range[n - 1])/(n (n - 1.0)) -> Range[n - 1], len]}]]; ``` and the following compiled function computes gcd. It assumes the input is a pair of positive integers. ``` cfGCD = Compile[{{prs, _Integer, 1}}, Module[{a, b, p, q, mod}, a = prs[[1]]; b = prs[[2]]; p = Max[a, b]; q = Min[a, b]; While[q > 0, mod = Mod[p, q]; p = q; q = mod]; p], RuntimeAttributes -> Listable]; ``` Then ``` In[151]:= data = RandomFarey[12, 10^6]; // AbsoluteTiming Out[151]= {1.5423084, Null} In[152]:= cdf = CDF[EmpiricalDistribution[data], x]; In[153]:= Plot[{cdf, x}, {x, 0, 1}, ImageSize -> 300] ``` ![enter image description here](https://i.stack.imgur.com/csP91.png)
Random rational numbers generation
CC BY-SA 3.0
0
2011-04-19T18:07:23.160
2011-04-19T22:10:16.323
2011-04-19T22:10:16.323
594,376
594,376
[ "math", "random", "wolfram-mathematica" ]
5,720,756
1
5,720,873
null
0
351
I'm trying to understand the Leaks Instrument Tool that Xcode4 provides us. The screenshot below shows me a couple of leaks (I think). I was wondering how to read the Leaked object and diagnose where the leak is coming from. Anyone have any suggestions to what [NSPlaceholderMutableString ...] is? I don't have this declared anywhere in the program itself. ![enter image description here](https://i.stack.imgur.com/YTd23.png)
Leaks in objective-C
CC BY-SA 3.0
null
2011-04-19T18:13:01.597
2011-04-19T18:24:52.067
null
null
382,906
[ "objective-c", "memory-leaks", "xcode4" ]
5,721,239
1
5,721,278
null
1
1,488
In my app, I have a [UIWebView](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebView_Class/Reference/Reference.html). Beneath it, I have a toolbar with the back and forward buttons to control the browser. How do I disable the back button when the user is on the initial page and disable the forward button when the user is on the most recent page? Looking at the [UIWebViewDelegate](http://developer.apple.com/library/ios/#documentation/uikit/reference/UIWebViewDelegate_Protocol/Reference/Reference.html) protocol, I don't see any callbacks that tell me the position of the user in their browser history. It should look like Safari's toolbar: ![enter image description here](https://i.stack.imgur.com/Plz5N.jpg) I figured out the detection part, but I can't figure out the disabling part. My buttons always remain at full opacity and are tappable even when `NSLog` prints out `0` for `canGoBack` or `canGoForward`. .h ``` @interface VeetleViewController : UIViewController <UIWebViewDelegate> { UIWebView* webView; UIBarButtonItem* buttonBack; UIBarButtonItem* buttonForward; UIActivityIndicatorView* activityIndicator; } - (void)activityIndicatorStop; @property (nonatomic, retain) IBOutlet UIWebView* webView; @property (nonatomic, retain) IBOutlet UIBarButtonItem* buttonBack; @property (nonatomic, retain) IBOutlet UIBarButtonItem* buttonForward; @property (nonatomic, retain) UIActivityIndicatorView* activityIndicator; @end ``` .m ``` - (void)webViewDidStartLoad:(UIWebView *)webView { NSLog(@"canGoBack:%d canGoForward:%d", self.webView.canGoBack, self.webView.canGoForward); [self.activityIndicator startAnimating]; if (self.webView.canGoBack) { self.buttonBack.enabled = YES; } else { self.buttonBack.enabled = NO; } if (self.webView.canGoForward) { self.buttonForward.enabled = YES; } else { self.buttonForward.enabled = NO; } } ```
Disable back/forward button in web browser
CC BY-SA 3.0
null
2011-04-19T18:56:08.807
2015-07-17T05:48:46.290
2011-04-19T19:24:27.423
459,987
459,987
[ "iphone", "objective-c", "cocoa-touch" ]
5,721,358
1
5,725,354
null
1
2,303
I have a simple table of data that needs to be transposed from row data into column data. For example let me create a simple employee table: ![Employee Table](https://i.stack.imgur.com/PWFmH.jpg) I need to create a side-by-side comparison report structured like this using the above sql table: ![Report](https://i.stack.imgur.com/faBJZ.jpg) ? Or can it be done automatically using a built in ASP.net or DevExpress control? Your feedback is always appreciated! Thanks!
How do I turn row data into column data?
CC BY-SA 3.0
null
2011-04-19T19:06:27.287
2014-05-30T14:34:16.393
2011-04-19T20:17:32.493
261,161
261,161
[ "asp.net", "sql", "sql-server", "sql-server-2005", "devexpress" ]
5,721,477
1
5,721,510
null
5
5,812
I am trying to create a customer support dialog. I want the dialog to have two lines of text, and a title. The first line will be an error message, and the second will be a bold customer service number. This may be hard to picture so I added a dialog I made in paint to help out: ![enter image description here](https://i.stack.imgur.com/WtyrH.png) I tried making a new line statement (`string Error = "You have an error... number \n Customer Support...`) to see if I could separate the text but that did not work. Any suggestions?
Jquery Dialog, Adding a new line of styled text
CC BY-SA 3.0
0
2011-04-19T19:17:41.487
2011-04-19T19:19:54.207
null
null
650,489
[ "javascript", "jquery", "jquery-ui", "jquery-dialog" ]
5,721,592
1
5,721,918
null
0
313
I have a web application which converts some PCL files to PDF by running a scheduler task every 10 seconds. Each time it takes max. 20 pc files from a directory and convert them to pdf. First few tasks run nice but step by step it gets slower and suddenly a `GC overhead limit exceeded` error message is raised. I've tried to analyze this memory leak with VisualVM and here is some output from the heapdump:![enter image description here](https://i.stack.imgur.com/uNpM1.gif) It's strange that such amount of ( !!!) it's shown. In the application I also have Streams and I really checked to see if all this streams are closed when their related operations are done. I use byte in a single class in three methods : byte[] buf = new byte[1024]; ``` public void initBuf() { if (buf != null) { for (int i = 0; i < buf.length; i++) { buf[i] = (byte) 0x00; } pdf_y = PageSize.A4.getHeight(); } } public void appendBuf(char ch) { if (ch == '\n') { processChunk(); drawChunks(); pdf_newline(); } else if (ch != '\r') { buf[buf_index++] = (byte) (0xff & ch); } } public void resetBuf() { for (int i = buf_index; i >= 0; i--) { buf[i] = (byte) 0x00; } buf_index = 0; } ``` I cannot post all the code because there are more classes which do this conversion but I really hope you to help me with some advices becauise I spent a lot of time and still this memory issue persists. Thanks in advance
how to improve java code based on this stats?
CC BY-SA 3.0
null
2011-04-19T19:28:50.177
2011-04-19T20:50:20.320
null
null
174,349
[ "java", "performance", "memory-leaks" ]
5,721,692
1
5,722,697
null
4
2,337
I have a QListView with a list of strings. Basically, I use it as pop window for a QLineEdit for an autocomplete process. I dont want the QListView to display blank lines, only lines that have strings in it. See this: ![Image](https://i.stack.imgur.com/Wnbb2.jpg) I want it to resize itself automatically so it wont have these blank rows after the last entry. Thanks
QListView height according to contents
CC BY-SA 3.0
null
2011-04-19T19:37:08.860
2011-04-19T22:25:39.607
null
null
427,306
[ "c++", "qt", "user-interface", "qt4" ]
5,721,700
1
5,722,692
null
4
4,198
Is there any way of calling a DLL that is a shell extension programmatically? We use a software that registers a shell extension on windows explorer, and I need to call one of the items available on its context menu. I do not have the software source code that I want to call. This context menu only appears when I select a PDF file on windows explorer. So i need to call it passing a dll file. Registry information: [HKEY_CLASSES_ROOT\CLSID{2DC8E5F2-C89C-4730-82C9-19120DEE5B0A}] @="PDFTransformer3.PDFTContextMenu.1" [HKEY_CLASSES_ROOT\CLSID{2DC8E5F2-C89C-4730-82C9-19120DEE5B0A}\InprocServer32] @="C:\Program Files\ABBYY PDF Transformer 3.0\PDFTContextMenu.dll" "ThreadingModel"="Apartment" [HKEY_CLASSES_ROOT\CLSID{2DC8E5F2-C89C-4730-82C9-19120DEE5B0A}\ProgID] @="PDFTransformer3.PDFTContextMenu.1" [HKEY_CLASSES_ROOT\CLSID{2DC8E5F2-C89C-4730-82C9-19120DEE5B0A}\Programmable] [HKEY_CLASSES_ROOT\CLSID{2DC8E5F2-C89C-4730-82C9-19120DEE5B0A}\VersionIndependentProgID] @="PDFTransformer3.PDFTContextMenu" Is it possible to call `ShellExecuteEx` with the verb i want (not the default one)? If so, how do I call the verb I want (which uses the DLL)? Thats the verb i wanna call for a PDF file: ![enter image description here](https://i.stack.imgur.com/XsNQm.gif)
Call windows explorer shell extension
CC BY-SA 3.0
0
2011-04-19T19:37:45.400
2011-04-19T21:26:05.850
2011-04-19T20:43:16.653
528,211
528,211
[ "c#", "windows", "delphi", "shell-extensions" ]
5,722,085
1
5,722,740
null
9
5,085
I have an `NSBezierPath` that makes a rounded rectangle but the corners of it look choppy and appear brighter that the rest of the stroke when viewed at full scale. My code is: ``` NSBezierPath *path = [NSBezierPath bezierPath]; [path appendBezierPathWithRoundedRect:NSMakeRect(0, 0, [self bounds].size.width, [self bounds].size.height) xRadius:5 yRadius:5]; NSGradient *fill = [[NSGradient alloc] initWithColorsAndLocations:[NSColor colorWithCalibratedRed:0.247 green:0.251 blue:0.267 alpha:0.6],0.0,[NSColor colorWithCalibratedRed:0.227 green:0.227 blue:0.239 alpha:0.6],0.5,[NSColor colorWithCalibratedRed:0.180 green:0.188 blue:0.196 alpha:0.6],0.5,[NSColor colorWithCalibratedRed:0.137 green:0.137 blue:0.157 alpha:0.6],1.0, nil]; [fill drawInBezierPath:path angle:-90.0]; [[NSColor lightGrayColor] set]; [path stroke]; ``` Heres a picture of 2 of the corners (Its not as obvious in a small picture): ![corners](https://i.stack.imgur.com/9pTUK.png) Anyone know what's causing this? Am I just missing something? Thanks for any help
NSBezierPath rounded rectangle has bad corners
CC BY-SA 3.0
0
2011-04-19T20:11:30.400
2011-04-20T00:21:15.640
null
null
293,039
[ "cocoa", "stroke", "nsbezierpath" ]
5,722,458
1
5,722,870
null
4
2,654
I have a query that returns something like this... ``` EFFECTIVE_DATE END_DATE DESC SUBPART 4/10/2011 Dairy Products Processing L 4/10/2011 360 CMR 10.000 4/1/2011 4/9/2011 Dairy Products Processing A 4/1/2011 4/9/2011 Ferroalloy Manufacturing A ``` I'm looking to get a query that returns that dataset like this... ``` EFFECTIVE_DATE END_DATE DESC SUBPART 4/10/2011 Dairy Products Processing L 360 CMR 10.000 4/1/2011 4/9/2011 Dairy Products Processing A Ferroalloy Manufacturing A ``` Notice that the duplicate effective date( 4/10/2011 - {null} and 4/1/2011 - 4/9/2011) are suppressed when duplicated. In response to @Justin Cave's answer, Below is my query merged with Justin Cave's template. It's close, but its a little off. The dates and descriptions seem a little mixed up from what they're supposed to be (the data in the dataset should be like the one in . I think it may have something to do with my ordering but I'm not sure. ``` SELECT (CASE WHEN effective_date = prior_effective_date THEN null ELSE effective_date END) effective_date, (CASE WHEN end_date = prior_end_date THEN null ELSE end_date END) end_date, cfr_part_desc , cfr_subpart FROM (SELECT c.effective_date, lag(c.effective_date) over (order by c.effective_date desc, cpl.cfr_part_desc asc) prior_effective_date, c.end_date, lag(c.end_date) over (order by c.effective_date desc, cpl.cfr_part_desc asc) prior_end_date, cpl.CFR_PART_DESC as cfr_part_desc, cd.CFR_SUBPART as cfr_subpart from table1 c inner join table2 cd ON c.IND_ID = cd.IND_ID AND cd.EFFECTIVE_DATE = c.EFFECTIVE_DATE inner join table3 cpl on cd.CFR_PART_L_S = cpl.CFR_PART_L_S inner join table4 f on c.ind_id = f.ind_id inner join table5 p on f.ind_id = p.ind_id where p.PERMIT_S = '4988' order by c.effective_date desc, cpl.CFR_PART_DESC asc ); ``` ![Image](https://i.stack.imgur.com/K35nH.png) The incorrect data was due to ambiguously defining the column effective date. The query above now works correctly.
SQL - Suppressing duplicate columns (not rows) for a query
CC BY-SA 3.0
null
2011-04-19T20:43:42.047
2012-04-25T06:34:55.800
2011-04-20T21:55:14.353
175,057
175,057
[ "sql", "oracle" ]
5,722,611
1
5,749,992
null
1
153
I have these relations in my data base: ![enter image description here](https://i.stack.imgur.com/bLzdc.png) I need all authors related to my book stored in book entity class? I was trying to resolve this by using entityset but I can't use it because there is no primary key in BookAuthors table! Any kind of help will be great! =)
How to store one entity class in another in specific relation between tables?
CC BY-SA 3.0
0
2011-04-19T20:58:29.790
2011-04-21T21:30:43.713
2011-04-21T07:59:50.263
455,900
715,964
[ "c#", "linq-to-sql", "entityset" ]
5,723,159
1
5,872,627
null
17
1,272
I'm building an application that will take an image of a single person's whole body and will produce a "mugshot" for that person. Mugshot meaning an image of the person's whole face, neck, hair and ears at the same general size of another mugshot. Currently I'm using [http://askernest.com/archive/2008/05/03/face-detection-in-c.aspx](http://askernest.com/archive/2008/05/03/face-detection-in-c.aspx) to implement OpenCV and I'm using ``` harrcascade_frontalface_default.xml harrcascade_frontalface_alt.xml harrcascade_frontalface_alt2.xml harrcascade_frontalface_alt_tree.xml ``` as my cascades. I use all of the cascades because a single one will not detect all my faces. After I get all of the faces detected by all of the cascades I find my average square and use that for my final guess of how tall and wide the mugshot should be. My problem is 3 parts. - My current process is rather slow. How can I speed up the detection process? I'm finding that the processing time is directly related to photo size. Reducing the size of the photos may prove to be helpful.- A single cascade will not detect all the faces I come across so I'm using all of them. This of course produces many varied squares and a few false positives. What method can I use to identify false positives and leave them out of the average square calculation? ex. ![Sandman](https://i.stack.imgur.com/8E5Zb.png)![Wayne](https://i.stack.imgur.com/SrrSb.png) I'm implementing an average of values within standard deviation. Will post code soon.- Solved this one. Assuming all my heads are ratios of their faces.``` static public Rectangle GetMugshotRectangle(Rectangle rFace) { int y2, x2, w2, h2; //adjust as neccessary double heightRatio = 2; y2 = Convert.ToInt32(rFace.Y - rFace.Height * (heightRatio - 1.0) / 2.0); h2 = Convert.ToInt32(rFace.Height * heightRatio); //height to width ratio is 1.25 : 1 in mugshots w2 = Convert.ToInt32(h2 * 4 / 5); x2 = Convert.ToInt32((rFace.X + rFace.Width / 2) - w2 / 2); return new Rectangle(x2, y2, w2, h2); } ``` ![Sandman](https://i.stack.imgur.com/dLCl0.png) I just need to get rid of those false positives. -
How to obtain a "mugshot" from face detection squares?
CC BY-SA 3.0
0
2011-04-19T21:51:55.840
2015-02-25T13:21:43.987
2011-04-26T18:00:10.763
102,526
102,526
[ "c#", "face-detection" ]
5,723,286
1
5,779,862
null
2
1,319
if you have an event that lasts for more than one week, fullcalendar repeats event's title on each every line. How can I override that? I need to show the title only once. ![enter image description here](https://i.stack.imgur.com/x8KHd.jpg)
fullcalendar event title. I don't want it to be repeated on every line
CC BY-SA 3.0
null
2011-04-19T22:05:33.353
2013-11-21T12:46:37.473
null
null
116,395
[ "jquery", "fullcalendar" ]
5,723,482
1
null
null
3
3,496
I'm not having much luck in the CSS3PIE forum getting some help for [an issue](http://css3pie.com/forum/viewtopic.php?f=3&t=770) that I'm having. (yep, PIE is active and working fine elsewhere on the page) ![Observation Summary](https://i.stack.imgur.com/jbJaw.png) The failure is actually on two different elements: 1. The reply link's curved corners (top right & bottom left) 2. The comment container's border (all 4 corners) ![IE8 Example](https://i.stack.imgur.com/8ghdG.png) Some of the code... `<p class="reply"><a href="#">+ reply to this comment</a></p>` ``` .reply { margin: -1px 0 -1px -1px; padding: 0; font-size: 11px; line-height: 14px; color: #333; } .reply a:link { display: inline-block; padding: 3px 6px 3px 5px; -webkit-border-radius: 0 5px 0 5px; -moz-border-radius: 0 5px 0 5px; border-radius: 0 5px 0 5px; /* behavior: url(PIE.htc); IE WON'T APPLY BEHAVIORS IN A HOVER SELECTOR? PLACING IT HERE ALSO GIVES Z-INDEX ISSUES */ } .reply a:link, .reply a:visited { color: #878787; } .reply a:hover { padding: 2px 5px 2px 4px; color: #EEE; background-color: #666; border: 1px solid #666; } ``` Thoughts?
CSS3PIE Hover Problem
CC BY-SA 3.0
null
2011-04-19T22:26:25.473
2012-10-26T11:39:20.587
null
null
697,809
[ "internet-explorer", "internet-explorer-8", "css", "css3pie" ]
5,723,777
1
21,416,325
null
3
2,581
When I try to build a C# based project or the setup & deployment project, I get the following error on the visual studio environment: ![enter image description here](https://i.stack.imgur.com/lxBUC.jpg) ![enter image description here](https://i.stack.imgur.com/eskuC.jpg) The error tab displays the following: Error 2 "LC.exe" exited with code -1073741819. I have researched this online and could not find any concrete solution online. Why would this happen anyway? Any advice is appreciated. Thanks, Subbu
.NET framework compiler and assembly registration tool has stopped working
CC BY-SA 3.0
null
2011-04-19T23:04:53.530
2014-01-28T20:38:34.633
null
null
321,710
[ ".net" ]
5,724,053
1
5,724,229
null
0
57
``` <?php require_once('inc/dbc1.php'); $pdo = new PDO('mysql:host=###;dbname=#####', $username, $password); $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $sth = $pdo->prepare(' SELECT name FROM Department ;'); $sth->execute(array( $pID )); ?> <div id="popup_name" class="popup_block"> <h2 style="padding:0; margin:0;">Add a:</h2><br> <form action="inc/add_p_c_validate.php" method="post"> Professor<input type="radio" name="addType" value="Professor" /> &nbsp;&nbsp;Course<input type="radio" name="addType" value="Course" /> <br><br>Name: <input type="text" name="name" /><br> Department: <select id='deptName' name='deptName'> <select name="deptName"> <?php while($row = $sth->fetch(PDO::FETCH_ASSOC)) {echo "<option>".$row['name']."</option>";} ?> </select> ``` It doesnt give any error, just doesnt show a dropdown with any 'option's in it. I've tried the query is phpmyadmin and it returns all the department names... Output for Dropdown (nothing) : ![dd](https://i.stack.imgur.com/nxoIT.png) Anyone?
Why isn't this pulling any data?
CC BY-SA 3.0
null
2011-04-19T23:47:38.427
2011-04-20T00:17:06.077
2011-04-20T00:17:06.077
705,063
700,070
[ "php", "mysql" ]
5,724,167
1
5,736,869
null
3
16,369
for a homework graph theory, I'm asked to determine the chromatic polynomial of the following graph ![enter image description here](https://i.stack.imgur.com/c5CXV.jpg) For the . if G=(V,E), is a connected graph and e belong E ``` P (G, λ) = P (Ge, λ) -P(Ge', λ) ``` where Ge denotes de subgraph obtained by deleting de edge e from G (Ge= G-e) and Ge' is the subgraph obtained by identifying the vertices {a,b} = e When calculating chromatic Polynomials, i shall place brackets about a graph to indicate its chromatic polynomial. removes an edge any of the original graph to calculate the chromatic polynomial by the method of decomposition. ![enter image description here](https://i.stack.imgur.com/gzJPV.jpg) ``` P (G, λ) = P (Ge, λ)-P (Ge', λ) = λ (λ-1)^4 - [λ(λ-1)*(λ^2 - 3λ + 3)] ``` But the response from the answer key and the teacher is: ``` P (G, λ) = λ (λ-1)(λ-2)(λ^2-2λ-2) ``` I have operated on the polynomial but I can not reach the solution that I ask .. what am I doing wrong?
problem to determine the chromatic polynomial of a graph
CC BY-SA 3.0
0
2011-04-20T00:04:13.950
2017-04-07T16:13:33.073
2011-04-20T00:12:26.953
59,468
59,468
[ "graph-theory", "polynomial-math", "text-coloring" ]
5,724,330
1
5,735,750
null
4
797
[this dictionary](http://users.erols.com/whitaker/words.htm)[its parsing capabilities](http://lysy2.archives.nd.edu/cgi-bin/words.exe) Given an input form such as "audiam", the program returns the following output (plain text): ``` audi.am V 4 1 PRES ACTIVE SUB 1 S audi.am V 4 1 FUT ACTIVE IND 1 S audio, audire, audivi, auditus V (4th) [XXXAO] hear, listen, accept, agree with; obey; harken, pay attention; be able to hear; ``` But I just want to receive the following text output (same input: audiam): ``` audiam=audio, audire, audivi, auditus ``` That is: ``` InputWord=Dictionary_Forms ``` So some pieces of information are needless for me. I don't have any Ada knowledge, but I know Delphi/Pascal so it's quite easy to understand the code, isn't it? So the parts causing the text output seem to be the `TEXT_IO.PUT(...)` statements, right? They're all called in so this is probably the source file to look at. What has to be changed in particular? The full Ada 95 source code of this program is available [on this page](http://users.erols.com/whitaker/wordsdev.htm). I hope some of you are able to understand Ada 95 code. Thank you very much in advance! For use on a windows machine, I downloaded and tried to compile the source files using "MinGW Shell". But this was my input and the shell's reponse: ![MinGW Shell reponse](https://i.stack.imgur.com/CTmaf.png) When I compile the program using the latest version of Cygwin, there is no error message: ![enter image description here](https://i.stack.imgur.com/1OegP.png) There is even an .exe file which is created. Its size is 1.6 MB (1,682,616 bytes). But when I open it, it closes right away. What has gone wrong?
Ada 95: Modifying output of dictionary program
CC BY-SA 3.0
0
2011-04-20T00:33:16.553
2016-07-11T08:20:55.737
2014-08-24T03:43:51.560
3,366,929
89,818
[ "dictionary", "ada" ]
5,724,436
1
5,724,913
null
0
721
For some reason, in my admin site I am seeing a specific inline getting duplicated. I have the following models: ``` class PageBase(ContentContainer): title = models.CharField(max_length=1000) slug = models.SlugField() class PageBanner(models.Model): name = models.CharField(max_length=1000) page = models.ForeignKey(PageBase) banner_images = models.ManyToManyField(BannerImage) ``` Then in my admin.py I have: ``` class PageBannerInline(admin.StackedInline): model = models.PageBanner extra = 1 class PageAdmin(admin.ModelAdmin): model = models.Page inlines = PageBannerInline admin.site.register(models.Page, PageAdmin) admin.site.register(models.PageBanner, PageBannerAdmin) ``` For some reason, every time I add a PageBanner to any page in the admin, thus creating another inline for that page, I get another extra banner inline on EVERY page(including the one I added on). So, if I have 4 pages and each page has 1 banner, I will see 3 extra inlines on every page. What is going on here? This is quickly becoming unmanageable, the inlines take up way too much space. Here is an image of the inlines: ![enter image description here](https://i.stack.imgur.com/iYQMX.png)
django admin duplicating inlines
CC BY-SA 3.0
null
2011-04-20T00:53:10.590
2011-06-01T07:16:42.333
null
null
397,010
[ "django", "django-admin" ]
5,724,891
1
null
null
0
162
Currently, this is toggling, but it is not toggling the right fields when the individual "Professor" or "Course" Radio buttons are selected. Anyone have some insight why this isnt working? ![img1](https://i.stack.imgur.com/tj4sB.png) ![img2](https://i.stack.imgur.com/vnSXY.png) Thanks! ``` <!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>--> <script type="text/javascript"> $(document).ready(function() { $(':radio[value="Coursee"]').click(function() { $('#courseFields').toggle(':not(:radio[value="Professor"]:checked)'); }); $(':radio[value="Professor"]').click(function() { $('#ProfFields').toggle(':not(:radio[value="Coursee"]:checked)'); }); }); </script> <?php require_once('inc/dbc1.php'); $pdo = new PDO('mysql:host=ureviewdu.db.6511651.hostedresource.com;dbname=ureviewdu', $username, $password); $pdo->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION ); $sth = $pdo->prepare(' SELECT name FROM Department ;'); $sth->execute(array()); ?> <div id="popup_name" class="popup_block"> <h2 style="padding:0; margin:0;">Add a:</h2><br> <form action="inc/add_p_c_validate.php" method="post" id="addition"> Professor<input type="radio" name="addType" value="Professor" /> &nbsp;&nbsp;Course<input type="radio" name="addType" value="Coursee" /> <div id="courseFields"> <br>Course: <input type="text" name="name" style="width:385px;" /><br> Department: <select name="deptName" id="deptName" style="width:350px;"> <?php while($row = $sth->fetch(PDO::FETCH_ASSOC)) {echo "<option>".$row['name']." "."</option>";} ?></select> Email: <input type="text" name="email" class="l" /> </div><!--/courseFields--> <div id="ProfFields"> <br>First Name: <input type="text" name="name" style="width:385px;" /><br> <br>Last Name: <input type="text" name="name" style="width:385px;" /><br> Department: <select name="deptName" id="deptName" style="width:350px;"> <?php while($row = $sth->fetch(PDO::FETCH_ASSOC)) {echo "<option>".$row['name']." "."</option>";} ?></select> </div><!--/ProfFields--> <input type="submit" name="submit" /> </form> </div><!--popup_name--> ```
Why isn't this jQuery Toggling upon Radio Selection?
CC BY-SA 3.0
null
2011-04-20T02:25:12.920
2011-04-20T04:34:21.310
2011-04-20T02:44:46.600
700,070
700,070
[ "php", "jquery" ]
5,725,099
1
5,725,185
null
27
42,431
![enter image description here](https://i.stack.imgur.com/cwrQr.png) I want to draw text use Quartz 2D. The "menu" direction is wrong. I want "Menu" still readable and have 45 degree with X-axis. Below is my code: ``` CGContextSelectFont(context, "Arial", 12, kCGEncodingMacRoman); CGContextSetTextDrawingMode(context, kCGTextFill); CGContextSetRGBFillColor(context, 0, 0, 0, 1); // 6 CGContextSetRGBStrokeColor(context, 0, 0, 0, 1); CGContextSetTextMatrix(context, CGAffineTransformMake(1.0,0.0, 0.0, -1.0, 0.0, 0.0)); CGContextSetTextMatrix(context, CGAffineTransformMakeRotation(45)); CGContextShowTextAtPoint(context,10, 10, "Menu", 4); ```
How to use CGAffineTransformMakeRotation?
CC BY-SA 3.0
0
2011-04-20T03:10:29.943
2014-01-08T03:15:37.857
2013-08-08T06:53:20.710
640,731
null
[ "ios", "cocoa-touch", "core-graphics", "quartz-2d" ]
5,725,276
1
5,727,316
null
0
1,989
the problem I am having it that if inside the UIView Draw override, I change the view frame size, drawing a rectangle is not working as expected. If I change the view frame size outside of the Draw override, it works fine. Is this an expected behavior or is it a problem with monotouch only? This is the code I am using: ``` class ChildView : UIView { public override void Draw (RectangleF rect) { base.Draw (rect); CGContext g = UIGraphics.GetCurrentContext(); //adding 30 points to view height RectangleF rec = new RectangleF(this.Frame.Location,this.Frame.Size); rec.Height+=30; RectangleF rec_bounds = new RectangleF(0,0,rec.Width,rec.Height); this.Frame=rec; this.Bounds=rec_bounds; //drawing a red rectangle to the first half of view height UIColor.Red.SetFill(); RectangleF _rect = new RectangleF(this.Bounds.Location,this.Bounds.Size); _rect.Height=_rect.Height/2; g.FillRect(_rect); } } ``` However, the output of this code is this: (it should draw only 30 points red, but it draws 60 points) ![enter image description here](https://i.stack.imgur.com/OQHyk.png) Here is a link to download the project to reproduce this issue: [www.grbytes.com\downloads\RectangleDrawProblem.rar](http://www.grbytes.com%5Cdownloads%5CRectangleDrawProblem.rar)
MonoTouch: How to resize a view.Frame inside Draw override and draw correctly?
CC BY-SA 3.0
null
2011-04-20T03:49:02.403
2011-04-22T18:14:02.147
null
null
348,551
[ "xamarin.ios" ]
5,725,607
1
null
null
11
2,928
I'm trying to run git commands in eshell. When I run: ``` git log -p ``` it will look like this: ![git-log in eshell](https://i.stack.imgur.com/6srKV.png) Notice that ^[[k before the cursor. Arrow key down does not work, it will gives error says 'Not found'. You can see that at minibuffer. The only way to scroll down is to use RETURN key, and it looks quite messy: ![git-log in eshell -- scrolling](https://i.stack.imgur.com/pxcYp.png) My $TERM is set to eterm, and I tried ansi too. They are the same. Anyone has experienced this before? Thanks Edit: I have a way to work this around. I created this function: ``` (defun eshell/git (&rest args) (apply 'eshell-exec-visual (cons "git" args))) ``` So every time when I run git command, it will launch the output in a *git* buffer. If you have other ways, please let me know as well.
git-log in eshell
CC BY-SA 3.0
0
2011-04-20T04:42:57.640
2017-09-19T08:32:49.173
2011-04-20T12:45:27.290
649,157
649,157
[ "git", "emacs", "eshell" ]
5,725,720
1
null
null
38
48,923
I want to create an XML document like this: ![Xml Doc](https://i.stack.imgur.com/6bISp.jpg) I want to create it from scratch using code and LINQ-to-XML. In the form Load Event I've written this code: ``` private void Form9_Load(object sender, EventArgs e) { doc = new XDocument(new XDeclaration("1.0", "utf-8", "yes")); XElement myroot = new XElement("Employees"); doc.Add(myroot); } ``` How I can add new person to Employees, and if I want to insert person in specific location what can I do? How I can delete or update a specific person ?
how to add XElement in specific location in XML Document
CC BY-SA 3.0
0
2011-04-20T05:00:13.323
2022-11-03T13:11:36.967
2013-06-11T16:14:13.197
271,200
648,723
[ "c#", "linq", "linq-to-xml" ]
5,725,742
1
5,726,329
null
0
2,602
i have some problem in memory management, and then i try to fix it using intrument tool. Base on [mark j video on you tube](http://www.youtube.com/watch?v=LQtPr8bkB3g&feature=related) about using NSZombieEnabled in intrument, i try to do like that. The problem is i never find a checkbox to set NSZombieEnabled active in my instrument. In this case i use xcode 3.2.5 and still on IOS 4.2. This is the screenshot from the instrument that show no one check box for NSZombieEnabled activated : ![instrument screenshot](https://i.stack.imgur.com/XYeNt.png) am i doing something wrong?? help me please thank you
how to using NSZombieEnabled on intrument Xcode 3.2.5
CC BY-SA 3.0
null
2011-04-20T05:03:35.307
2012-06-19T12:28:25.223
null
null
515,986
[ "xcode", "memory-management", "ios-4.2", "nszombie", "nszombieenabled" ]
5,725,878
1
null
null
0
1,041
in finance, a stock's beta is the covariance between the stock's daily returns and an index' daily returns divided by the variance of the index daily returns. I try to calaculate beta for set of stocks and a set of indices. Here's my query for a 50 business day rolling window and I'd like you to help me optimize it for speed: ``` INSERT INTO betas (permno, index_id, DATE, beta) (SELECT permno, index_id, s.date, IF( s.`seq` >= 50, (SELECT (AVG(s2.log_return*i2.log_return)-AVG(s2.log_return)*AVG(i2.log_return))/VAR_POP(i2.log_return) AS beta FROM stock_series s2 INNER JOIN `index_series` i2 ON i2.date=s2.date WHERE i2.index_id=i.index_id AND s2.permno = s.permno AND s2.`seq` BETWEEN s.`seq` - 49 AND s.`seq` GROUP BY index_id,permno), NULL) AS beta FROM stock_series s INNER JOIN `index_series` i ON i.index_id IN ('SP500') AND i.date=s.date ) ON DUPLICATE KEY UPDATE beta= VALUES (beta) ``` Both main tables are already ordered by entity and date in ascending order, and they already include log daily returns as well as a "seq" column. Seq sequentally enumerates all daily rows company- (or index-) wise, i.e. seq starts over at 1 for every new stock or index in the table and counts up to the number of total number of rows for a given entity. I created it to allow for the rolling window. As of now, with 500 firms and 1 index, the query takes like forever to complete. Let me know any optimization that comes to your mind, like views, stored procs, temp tables, and if you find any inconsistencies, of course. EDIT: Indexes: stock_series has PRIMARY KEY (permno,date) and UNIQUE KEY (permno,seq), index_series has PRIMARY KEY (index_id,date) EXPLAIN EXTENDED results for ONE company (by including a WHERE s.permno=... restriction at the end): ![EXPLAIN EXTENDED of above SELECT query](https://i.stack.imgur.com/dJSrx.gif) EXPLAIN EXTENDED results for ALL ~500 companies: ![enter image description here](https://i.stack.imgur.com/OG8qP.gif)
MySQL: Optimizing query for calculation of financial BETA
CC BY-SA 3.0
0
2011-04-20T05:25:26.200
2011-04-22T01:15:32.307
2011-04-22T01:15:32.307
632,333
632,333
[ "mysql", "optimization" ]
5,725,923
1
null
null
-1
323
I found the exact match for what I'm looking for, it's kind of a relationship user interface, please see [http://www.corporationwiki.com/Ohio/Powell/nutrition-forum-sports-llc/50101823.aspx](http://www.corporationwiki.com/Ohio/Powell/nutrition-forum-sports-llc/50101823.aspx) ![Screenshot of relationship visualizer](https://i.stack.imgur.com/JquMD.png) Ho do I mimic that, I need to code a php aplication that retrieves relations from a database and displays them like that above, so that I have 1 (or many) center nodes, and several others around it pointing and linked to that node, displayed like that above. Best Regards PS: I will need to add and remove nodes "on the fly" live, like with jquery and ajax/json calls. I see I was voted down, I'm sorry if this is not the place to ask this I will gladly retract my question. Can you then please be so kind to point me the place where to ask for this type of information instead of voting me down on my first question ever here?
How to mimic this effect
CC BY-SA 3.0
null
2011-04-20T05:31:14.437
2011-05-21T03:43:33.753
2011-04-20T07:46:34.983
445,073
716,495
[ "php", "javascript", "jquery", "ajax" ]
5,726,109
1
5,726,136
null
5
5,542
I need to simulate a part of the lifecycle, from onPause to onResume event. I used the back button to pause the app, when I enter the app again, it always to the onCreate event to start a new lifecycle. How to make the app run from onPause to onResume directly ? Thanks. ![enter image description here](https://i.stack.imgur.com/TF33A.png)
onPause, onResume events in Android
CC BY-SA 3.0
null
2011-04-20T05:57:33.050
2011-04-20T06:05:19.133
null
null
403,015
[ "android", "lifecycle" ]
5,726,188
1
5,851,818
null
4
493
I implemented/copied the wu line algorithm from pseudo-code on wiki-pedia and other places. When drawing a sine wave it breaks down at the point where the line changes from y dominant to x dominant (or vice versa). (I did not copy the endpoint code because it looks terrible and I do not need them for my purposes. ) ![](https://i.stack.imgur.com/qyhLe.png) Does anyone know a solution for this issue? If not I will modify the algorithm myself to get it to work. I am just curious if someone else has run into this and knows exactly how to fix it. Is it possible to implement without the lines being globally aware of each other? Or is this why drawing API's implement moveto and lineto functions? [The pseudo code](http://freespace.virgin.net/hugo.elias/graphics/x_wuline.htm)
connecting multiple anti-aliased lines together
CC BY-SA 3.0
0
2011-04-20T06:08:04.507
2011-05-01T22:13:17.713
2011-04-20T08:10:56.163
434,376
434,376
[ "c", "algorithm", "graphics", "drawing", "antialiasing" ]
5,726,287
1
null
null
1
4,307
I have created a custom module and related it to the leads module. It has certain custom columns such as "Type", "Notes" and so on. The "Type" column can have 2 values i.e. "Call" and "Auto". I want to show / hide the edit and delete buttons based on the value in the Type column. What's the best way to do this? ![enter image description here](https://i.stack.imgur.com/LGUH0.jpg)
SugarCRM: Conditionally hide / show edit and delete button in subpanel
CC BY-SA 3.0
null
2011-04-20T06:21:15.923
2012-04-19T08:25:12.780
2011-04-20T06:30:53.540
82,135
82,135
[ "php", "customization", "sugarcrm" ]
5,726,296
1
5,726,604
null
3
1,596
I have a `DataGrid` where one column needs to be aligned to the right. To do this I use ``` <DataGridTextColumn.CellStyle> <Style> <Setter Property="FrameworkElement.HorizontalAlignment" Value="Right"/> </Style> </DataGridTextColumn.CellStyle> ``` which works fine as shown here: ![enter image description here](https://i.stack.imgur.com/L0oTr.png) Unfortunately the aligned cells are not properly highlighted when a row is selected. Only the data is highlighted, but the empty area to the left of the data is not, as shown here: ![enter image description here](https://i.stack.imgur.com/nCQHS.png) Additionally, the area to the left of the data is not sensitive to mouse-clicks anymore. In the example above, a click to the left of '12.34' will not select the first row (but a click to the right of 'A1' will). Altogether this makes for a bad user experience. So, how do I do `HorizontalAlignment` without breaking row-selection? I want the entire row highlighted, and I want to be able to click anywhere to select a row. I am using VS 2010, .NET 4, both Win XP and Win 7. The code to reproduce my example: ``` namespace WpfApplication2 { public class ListItem { public string FieldA { get; set; } public decimal FieldB { get; set; } public string FieldC { get; set; } } } <Window x:Class="WpfApplication2.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:My="clr-namespace:WpfApplication2" Title="MainWindow" Height="350" Width="525"> <Window.Resources> <x:Array x:Key="List" Type="{x:Type My:ListItem}"> <My:ListItem FieldA="A1" FieldB="12.34" FieldC="C1"/> <My:ListItem FieldA="A2" FieldB="1000.00" FieldC="C2"/> <My:ListItem FieldA="A3" FieldB="987.6" FieldC="C3"/> </x:Array> </Window.Resources> <Grid> <DataGrid ItemsSource="{StaticResource List}" AutoGenerateColumns="False" SelectionUnit="FullRow" > <DataGrid.Columns> <DataGridTextColumn Header="ColumnA" Binding="{Binding Path=FieldA}" Width="150" /> <DataGridTextColumn Header="ColumnB" Binding="{Binding Path=FieldB, StringFormat='#,##0.00'}" Width="150" > <DataGridTextColumn.CellStyle> <Style> <Setter Property="FrameworkElement.HorizontalAlignment" Value="Right"/> </Style> </DataGridTextColumn.CellStyle> </DataGridTextColumn> <DataGridTextColumn Header="ColumnC" Binding="{Binding Path=FieldC}" Width="*" /> </DataGrid.Columns> </DataGrid> </Grid> </Window> ```
WPF DataGrid: The selected row is not properly highlighted when using HorizontalAlignment
CC BY-SA 3.0
null
2011-04-20T06:22:03.520
2011-04-20T09:17:45.857
null
null
558,197
[ "wpf", "xaml", "datagrid", "alignment" ]
5,726,790
1
5,726,937
null
1
548
I have 3 drop down selectors using AJAX (first is populated, after selection the second gets populated and so on..), after selection a script is called to fill a `<p>` tag with a table that includes pictures, the problem is that I cannot use jquery plugins on those pictures (lightroom, tooltip). I can use these features if I get pictures witought AJAX. I also tryed to move the ajax script in the root (so it can recognize functions in the js files)... ![if i click on a category(not AJAX) (it gets populated with images) everything works fine](https://i.stack.imgur.com/sMabB.jpg) Any ideas would be appreciated :|
JQUERY functions not working with AJAX content
CC BY-SA 3.0
null
2011-04-20T07:16:31.757
2011-04-20T07:29:36.140
2011-04-20T07:24:45.237
468,793
476,543
[ "php", "javascript", "jquery", "ajax" ]
5,726,885
1
5,790,116
null
0
1,570
I'm using the youtube api's non resume method to upload a video to youtube from my android app. The response of this upload is an xml file. I need to parse it and find the url of the video (WHICH IS IN THE TAG media:player url). How to get that url? The xml is as follows ![XML is as follows](https://i.stack.imgur.com/KzMKC.png) ![enter image description here](https://i.stack.imgur.com/obNMe.png) ![enter image description here](https://i.stack.imgur.com/n9ZGS.png)
How to parse the response of youtube video upload api to get the video's url
CC BY-SA 3.0
null
2011-04-20T07:24:05.783
2011-04-26T12:13:17.957
null
null
482,625
[ "android" ]
5,727,027
1
5,727,259
null
0
1,438
I've made an Intraweb ISAPI application. After building the dll, I've created an Web site on IIS and a pool for the application. On the Inetpub directory the permissions are set for the Internet Guest Account and for the IIS_WPG accounts. When I'm trying to access the webpage from IE ([http://ip.0.0.1/website/application.dll](http://ip.0.0.1/website/application.dll)) it returns me or ![enter image description here](https://i.stack.imgur.com/16zqU.jpg) errors. After searching on the Internet it says that is a problem of COM initialization. But in the datamodule of the application there is this code: ``` initialization CoInitialize(nil); finalization CoUninitialize; ``` Can anybody give any advice?
Delphi Intraweb website crash on IIS
CC BY-SA 3.0
0
2011-04-20T07:36:34.780
2018-08-22T23:37:00.263
2016-07-21T10:48:02.643
368,364
368,364
[ "delphi", "iis", "delphi-7", "intraweb" ]
5,727,166
1
5,727,286
null
0
121
Ok, So, I have a social networking website where users can share a post and now i am implementing attachment feature so that users can attach files to the post. I use uploadify in order to upload files to the server. So, my current logic is, when user browses the file and clicks attach as in the attached image, the files are uploaded to a temporary directory in the server and when the post is actually shared, the files are moved to correct upload directory and database is updated accordingly. But my logic goes wrong when the user click attach, so, his files are uploaded to the server, and he quits the application without actually sharing the post. So, those files will be on the server unnecessarily. How can I modify my logic to preven this from happening?![enter image description here](https://i.stack.imgur.com/STY39.png)
Attaching a file to a post
CC BY-SA 3.0
null
2011-04-20T07:51:12.660
2011-04-20T08:04:20.147
null
null
694,877
[ "file-upload", "uploadify" ]
5,727,309
1
null
null
2
399
I want to make a custumized Image Control like MSN with Green light in border ![enter image description here](https://i.stack.imgur.com/ytmYS.jpg)
Styling Image Box
CC BY-SA 3.0
null
2011-04-20T08:05:50.260
2011-08-16T15:32:04.053
2011-08-16T15:32:04.053
305,637
715,003
[ "wpf", "wpf-controls", "styles" ]
5,727,372
1
5,728,242
null
0
144
Need a bit more help please... I need to display 24 times : ![yellow](https://i.stack.imgur.com/5H3ho.png) or ![red](https://i.stack.imgur.com/ItVsz.png) or ![green](https://i.stack.imgur.com/uamuW.png) (depending on speed/duplex on the port) But those images have to be displayed in the switch's image : ![switch](https://i.stack.imgur.com/qICuA.png) How to do to get all images well formated ?? To know which color to choose, I wrote a perl script using Net::SNMP to get infos about speed, duplex... Thanks guys. Bye
Perl/CGI : format several images
CC BY-SA 3.0
null
2011-04-20T08:12:44.197
2011-04-20T09:34:26.533
null
null
698,329
[ "perl", "image", "cgi" ]
5,727,382
1
5,754,094
null
16
8,952
I want to create a simple breadcrumb bar with ListView. Following a simple wireframe screenshot what I would like to archive in the future: ![This is what I am looking for](https://i.stack.imgur.com/38YQg.png) Now, I already created already some code, mainly doing it with DataTemplates, which works actually quite well, but I have some visual problems I am not able to solve: ![This is what I currently achieved](https://i.stack.imgur.com/TJcCa.png) - - Here's the actual code: ``` <ListView DockPanel.Dock="Left" ItemsSource="{Binding TagList}" MinWidth="300" Background="Transparent" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" Margin="8,0,0,0"> <ListView.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal"></StackPanel> </ItemsPanelTemplate> </ListView.ItemsPanel> <ListView.ItemTemplate> <DataTemplate> <Grid Margin="-8,0,0,0"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="8"/> <ColumnDefinition Width="Auto" /> <ColumnDefinition Width="8"/> </Grid.ColumnDefinitions> <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFC64242" Data="F1 M 112,144L 104,144L 112,160L 104,176L 112,176" HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Stretch" Width="Auto"/> <Grid HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Stretch" Width="Auto" Grid.Column="1"> <Rectangle Stretch="Fill" Fill="#FFC64242" HorizontalAlignment="Stretch" Height="Auto" Margin="0.5" VerticalAlignment="Stretch" Width="Auto"/> <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Data="F1 M 128,144L 160,144" HorizontalAlignment="Stretch" Height="1" Margin="0" VerticalAlignment="Top" Width="Auto"/> <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Data="F1 M 128,176L 160,176" HorizontalAlignment="Stretch" Height="1" Margin="0" VerticalAlignment="Bottom" Width="Auto"/> </Grid> <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFC64242" Data="F1 M 168,144L 176,160L 168,176" Height="Auto" VerticalAlignment="Center" Width="8" HorizontalAlignment="Right" Grid.Column="2" d:LayoutOverrides="GridBox"/> <DockPanel LastChildFill="True" Grid.ColumnSpan="2" Grid.Column="1"> <Label DockPanel.Dock="Left" FontSize="12" Content="{Binding Content, FallbackValue=Tagname n/a}" HorizontalAlignment="Left" Grid.Column="0" VerticalAlignment="Center" d:LayoutOverrides="Height" Margin="8,0"/> <Button DockPanel.Dock="Right" Content="X" Background="Transparent" FontSize="12" Command="{Binding RemoveTagBtn}" Grid.Column="0" Width="13.077" d:LayoutOverrides="Height" VerticalAlignment="Center" Margin="0,0,8,0"/> <!--<Border Background="#FFf7f7f7" BorderBrush="#FFc9c9c9" BorderThickness="1" CornerRadius="4" HorizontalAlignment="Left" Margin="0,0,0,5.96" d:LayoutOverrides="Height"/> --> </DockPanel> </Grid> </Grid> </DataTemplate> </ListView.ItemTemplate> </ListView> ```
Breadcrumb style with WPF-ListView
CC BY-SA 3.0
0
2011-04-20T08:13:59.740
2016-09-09T23:35:57.540
2011-08-12T17:40:29.690
305,637
408,659
[ "wpf", "xaml", "listview", "styles" ]
5,727,402
1
null
null
3
1,364
i have a many-to-many relationship table in a typed DataSet. For convenience on an update i'm deleting old relations before i'm adding the new(maybe the same as before). Now i wonder if this way is failsafe or if i should ensure only to delete which are really deleted(for example with LINQ) and only add that one which are really new. In SQL-Server is a unique constraint defined for the relation table, the two foreign keys are a composite primary key. Is the order the DataAdapter updates the DataRows which RowState are <> Unchanged predictable or not? In other words: is it possible that `DataAdapter.Update(DataTable)` will result in an exception when the key already exists? This is the datamodel: ![Datamodel](https://i.stack.imgur.com/lXU5X.jpg) This is part of the code(`LbSymptomCodes` is an ASP.Net ListBox): ``` Dim daTrelRmaSymptomCode As New ERPModel.dsRMATableAdapters.trelRMA_SymptomCodeTableAdapter For Each oldTrelRmaSymptomCodeRow As ERPModel.dsRMA.trelRMA_SymptomCodeRow In thisRMA.GettrelRMA_SymptomCodeRows oldTrelRmaSymptomCodeRow.Delete() Next For Each item As ListItem In LbSymptomCodes.Items If item.Selected Then Dim newTrelRmaSymptomCodeRow As ERPModel.dsRMA.trelRMA_SymptomCodeRow = Services.dsRMA.trelRMA_SymptomCode.NewtrelRMA_SymptomCodeRow newTrelRmaSymptomCodeRow.fiRMA = Services.IdRma newTrelRmaSymptomCodeRow.fiSymptomCode = CInt(item.Value) Services.dsRMA.trelRMA_SymptomCode.AddtrelRMA_SymptomCodeRow(newTrelRmaSymptomCodeRow) End If Next daTrelRmaSymptomCode.Update(Services.dsRMA.trelRMA_SymptomCode) ``` Thank you in advance.
DataTable: is deleting old DataRows before inserting new safe?
CC BY-SA 3.0
null
2011-04-20T08:16:10.520
2011-04-20T08:37:21.003
null
null
284,240
[ "c#", ".net", "sql-server", "vb.net", "ado.net" ]
5,727,578
1
5,727,859
null
1
6,526
I have written an application with a panel and three buttons. I want to add selection this buttons using the mouse. I mean like we have in Windows on the Desktop. I press the left mouse button and with the movement of the mouse the area selection is growing. Is there a specific interface in this or do I have it manually call the appropriate methods for event listeners and there draw transparent rectangle? Here is a picture: ![Example Screenshot](https://i.stack.imgur.com/CItpD.jpg) So I have a problem when I paint rectangle using event mouse-dragged, button is repainting so user see blinking button. I want to this button don't disapear when I paint rectangle. I think that I need to use glassPane. This is my conception. I have a frame. In frame I add panel with button and I need another panel where I will paint transparent rectangle. I am thinking then my button will not be still repainting. What do you think about this conception. Or maybe someone have another idea. This is code: ``` @Override public void mousePressed(MouseEvent e) { startPoint=e.getPoint(); setOpaque(true); Graphics2D g2 = (Graphics2D)getGraphics(); Rectangle2D prostokat = new Rectangle2D.Double(); prostokat.setFrameFromDiagonal(e.getPoint().x, e.getPoint().y,startPoint.x, startPoint.y); g2.setComposite(AlphaComposite.getInstance(rule, alpha)); g2.draw(prostokat); g2.setColor(Color.BLUE); g2.fill(prostokat); } @Override public void mouseDragged(MouseEvent e) { setOpaque(true); Graphics2D g2 = (Graphics2D)getGraphics(); Rectangle2D prostokat = new Rectangle2D.Double(); prostokat.setFrameFromDiagonal(e.getPoint().x, e.getPoint().y,startPoint.x, startPoint.y); g2.setComposite(AlphaComposite.getInstance(rule, alpha)); g2.draw(prostokat); g2.setColor(Color.BLUE); g2.fill(prostokat); paintComponent(g2); } int rule = AlphaComposite.SRC_OVER; float alpha = 0.85F; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { zaznacz rys = new zaznacz(); JFrame frame = new JFrame(); JButton Button = new JButton("1"); JPanel panel = new JPanel(); panel.add(Button); rys.add(panel); frame.setSize(400,300); frame.setVisible(true); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); panel.setOpaque(false); frame.add(rys); } }); } } ``` I know that code is no perfect but almost work. I have a little problem. When I press the mousebutton and dragging my button disapear. ![enter image description here](https://i.stack.imgur.com/Ppmb3.jpg) ![enter image description here](https://i.stack.imgur.com/Y9teM.jpg) I don't need advise like "your code is wrong". I know that and I want to somebody help me what I must correct. I know that I shouldn't use paintComponent() in mouseEvents but only that way I can paint transparent rectangle. Or maybe you can othet idea how I can draw transparent rectangle. I try and try and I think that i must change mouseDragged method. because when I delete code from this method and only draw rectangle over a button all is ok. But problem is when I need draw rectangle by dragging mouse. I should change paint but I don't have idea how. Anyone can help me or try help me?
Drawing a selection box using Swing
CC BY-SA 3.0
0
2011-04-20T08:33:19.373
2011-05-09T13:14:09.647
2011-05-09T07:18:16.373
705,544
705,544
[ "java", "swing", "awt" ]
5,727,665
1
5,727,726
null
2
2,136
I use a primefaces dock as a nav bar. I want it to change one of its images depending on if the user is logged in or not. I did something but it doesn't work, because i see the two icons at the same time and also i cant click the logout button. Can you give me some advice? This is the nav bar(It is created in a template all pages use): ``` <h:body> <h:form> <p:dock position="top"> <p:menuitem value="Naslovna" icon="unsecuredimages/naslovna.png" url="main.xhtml" alt="The image could not be found." /> <p:menuitem value="Register" icon="unsecuredimages/register.png" url="registration.xhtml" alt="The image could not be found." /> <p:menuitem value="Cesta pitanja" icon="unsecuredimages/faq.png" url="faq.xhtml" alt="The image could not be found." /> <p:menuitem value="Login" icon="unsecuredimages/login.png" url="login.xhtml" rendered ="securityController.checkLogged() == false"/> <p:menuitem value="Logout" icon="unsecuredimages/logout.png" action="securityController.logOut()" rendered ="securityController.checkLogged() == true"/> </p:dock> </h:form> ``` This is how the securityController Backing bean looks like: ``` @ManagedBean @RequestScoped public class SecurityController { @EJB private IAuthentificationEJB authentificationEJB; ... public boolean checkLogged() { return authentificationEJB.checkAuthentificationStatus(); } ... } ``` In the process there is also an EJB involved: ``` @Stateful(name = "ejbs/AuthentificationEJB") public class AuthentificationEJB implements IAuthentificationEJB { @PersistenceContext private EntityManager em; .... // Check if user is logged in public boolean checkAuthentificationStatus() { // 1-Check if there is something saved in the session(This means the // user is logged in) if ((FacesContext.getCurrentInstance().getExternalContext() .getSessionMap().get("userRole") != null)) { // 2-If there is not a user already loged, then return false return true; } return false; } ... ``` What do you think how can i add this feature to my nav bar? ``` <p:menuitem value="Login" icon="unsecuredimages/login.png" url="login.xhtml" rendered ="securityController.checkLogged"/> <p:menuitem value="Logout" icon="unsecuredimages/logout.png" action="securityController.logOut()" rendered ="!securityController.checkLogged"/> ``` i also changed to: ``` public boolean isCheckLogged() { return authentificationEJB.checkAuthentificationStatus(); } ``` This is how the navigation looks like. As you see i don't see login or logout icons. ![enter image description here](https://i.stack.imgur.com/mQNcB.png) How can i fix it?
Navigation bar image should change when the user logs in(JSF 2.0 + primefaces)
CC BY-SA 3.0
0
2011-04-20T08:41:51.677
2011-04-20T09:04:12.677
2011-04-20T09:04:12.677
614,141
614,141
[ "java", "jsf", "jakarta-ee", "jsf-2", "primefaces" ]
5,727,761
1
5,729,649
null
2
811
I got a problem. I try to create a project with Navigation-based Application. When I press rightBarButtonItem push to next view. And that view got a UISegmentedControl right on UINavigationBar. ![enter image description here](https://i.stack.imgur.com/SXaCU.png) I use a IBAction when press Button A: ``` -(IBAction)backButtonPressed:(id)sender{ [self.navigationController popViewControllerAnimated:YES];} ``` when first view show up, I press Button A it will go back to main view. If I press number 2 on UISegmentedControl , it become to another View, and still the same method(-(IBAction)backButtonPressed:(id)sender). But when I press Button B , it wont go back to main view.. ![enter image description here](https://i.stack.imgur.com/MpQwr.png) as follow is my method about UISegmentedControl: ``` -(void)showSegmentedView:(id)sender{ AView *aView = [[AView alloc] initWithNibName:@"AView" bundle:nil]; BView *bView = [[BView alloc] initWithNibName:@"BView" bundle:nil]; if(seg.selectedSegmentIndex ==0) { [[seg_view subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; [seg_view addSubview:aView.view]; } else if(seg.selectedSegmentIndex ==1){ [[seg_view subviews] makeObjectsPerformSelector:@selector(removeFromSuperview)]; [seg_view addSubview:bView.view]; } ``` } Does anything wrong?? Thank in advance. Mini
Question about UISegmentedControl and UINavigationController
CC BY-SA 3.0
0
2011-04-20T08:51:36.980
2011-04-20T11:44:01.333
null
null
545,768
[ "iphone", "xcode", "uinavigationcontroller", "uisegmentedcontrol" ]
5,727,841
1
null
null
0
148
I have developed a business website that is based on Drupal. I integrated super fish menu on it however it puts some extra margin when preview IE6 and IE7. In IE8 and other browsers render it nicely could you please help me fix that issue? [Live website preview](http://www.kraiburg.com.tr/) how it appear in IE7 and IE6 ![on-ie6-ie7](https://i.stack.imgur.com/Eh1m2.jpg) [http://i51.tinypic.com/mrtydv.jpg](http://i51.tinypic.com/mrtydv.jpg)
IE7 put some extra right margin on super fish menu
CC BY-SA 3.0
null
2011-04-20T08:57:55.453
2011-11-30T05:58:32.893
2011-11-30T05:42:16.390
776,010
716,783
[ "internet-explorer", "superfish" ]
5,728,149
1
5,738,875
null
0
1,553
When I browse my website it shows me a directory listing instead of web pages: ![enter image description here](https://i.stack.imgur.com/Cs41n.png) How do I stop this happening?
Can't browse website in iis6
CC BY-SA 3.0
null
2011-04-20T09:25:39.363
2011-04-21T02:33:01.483
2011-04-21T01:11:12.627
419
612,428
[ "iis", "iis-6" ]
5,728,326
1
5,728,568
null
0
4,627
Hi I'm setting up an android app and I'm using a tabbed interface. I'd like two tabs, a text based tab (Song),a gridview tab of images like in the Gridview tutorial. Using the tabbed interface tutrial as an example, I am declaring the tab's content within the onCreate() event of the main class. ``` public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Resources res = getResources(); // Resource object to get Drawables 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, GalleryActivity.class); // Initialize a TabSpec for each tab and add it to the TabHost spec = tabHost.newTabSpec("artists").setIndicator("Artists", res.getDrawable(R.drawable.ic_tab_artists)) .setContent(intent); tabHost.addTab(spec); intent = new Intent().setClass(this,songs.class); spec = tabHost.newTabSpec("songs").setIndicator("Songs", res.getDrawable(R.drawable.ic_tab_artists)) .setContent(intent); tabHost.addTab(spec); } ``` And my gallery activity is ``` public class GalleryActivity extends Activity { public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); GridView gridview = new GridView(this); gridview.setAdapter(new ImageAdapter(this)); setContentView(R.layout.grid); } ``` } ``` } } ``` And my xml file is ``` <?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="5dp"> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" /> <FrameLayout android:id="@android:id/tabcontent" android:layout_width="wrap_content" android:layout_height="fill_parent" android:padding="5dp" /> </LinearLayout> </TabHost> ``` My Adapter class is ``` public class ImageAdapter extends BaseAdapter { private Context mContext; public ImageAdapter(Context c) { // TODO Auto-generated constructor stub mContext= c; } @Override public int getCount() { // TODO Auto-generated method stub return mThumbIds.length; } @Override public Object getItem(int position) { // TODO Auto-generated method stub return null; } @Override public long getItemId(int position) { // TODO Auto-generated method stub return 0; } @Override public View getView(int position, View convertView, ViewGroup parent) { // TODO Auto-generated method stub ImageView imageView; if (convertView == null) { // if it's not recycled, initialize some attributes imageView = new ImageView(mContext); imageView.setLayoutParams(new GridView.LayoutParams(85, 85)); imageView.setScaleType(ImageView.ScaleType.CENTER_CROP); imageView.setPadding(8, 8, 8, 8); //myButton.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT, Gravity.CENTER_HORIZONTAL)); } else { imageView = (ImageView) convertView; } imageView.setImageResource(mThumbIds[position]); return imageView; } // references to our images private Integer[] mThumbIds = { R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7, R.drawable.sample_0, R.drawable.sample_1, R.drawable.sample_2, R.drawable.sample_3, R.drawable.sample_4, R.drawable.sample_5, R.drawable.sample_6, R.drawable.sample_7 }; } ``` After doing this when i compiled and run the program i didnt get the grid layout ![enter image description here](https://i.stack.imgur.com/BxQUy.png) Output is not properly formated.I think by adding the grid view xml attributes to Adapter class can fix the errors. But i dont know how to use that attributes in java ui attributes are ``` android:layout_width="fill_parent" android:layout_height="fill_parent" android:columnWidth="90dp" android:numColumns="auto_fit" ``` can any one help me
How to display an gridview within a tabbed layout
CC BY-SA 3.0
null
2011-04-20T09:41:59.503
2011-04-20T10:13:45.140
2011-04-20T10:13:45.140
699,010
699,010
[ "android", "gridview" ]
5,728,380
1
5,729,542
null
1
115
How to show the differences between versions? Like in SO once we creates a question after that if any modification will apply to that question it shows the changes. It shows whatever changes applied to that question when we clicks on link. Like new tags applied or question modification etc .. Any gems or plugins? Any Idea? Something like this .. ![enter image description here](https://i.stack.imgur.com/8Yb3w.png)
Show the differnce between versions with rails?
CC BY-SA 3.0
null
2011-04-20T09:47:03.313
2011-04-20T11:34:55.133
2011-04-20T10:06:15.603
363,503
363,503
[ "ruby-on-rails", "ruby" ]
5,728,478
1
5,732,909
null
10
3,875
I've been thinking about facebook suggestions and other similar system of linkedin. I think Facebook suggestion also based personal knowledges, like school years, the companys i worked or something similar. But beyond that to be more specific here is the scheme ![facebook suggestion scheme](https://i.stack.imgur.com/cXB6v.jpg) Case1 looks simple, but when the friend count goes bigger (event about 300 friend too much) it's not efficient. How about Case2? What kind of algorithm can do this work. I've no idea about Case3 because i guess its something special fo facebook. but how could i detect person 4. is which degree related?
how friend suggestions or 2nd degree related (linkedin) algorithm works
CC BY-SA 3.0
0
2011-04-20T09:54:49.683
2013-06-10T06:22:17.917
null
null
502,649
[ "php", "mysql", "facebook", "linkedin" ]
5,728,530
1
null
null
2
2,390
How can I write these characters to file with batch? ![enter image description here](https://i.stack.imgur.com/PPAOa.png)
Write special charaters with batch into file
CC BY-SA 3.0
null
2011-04-20T09:59:10.313
2013-04-10T12:33:03.513
2011-04-20T15:06:58.047
73,070
679,067
[ "batch-file", "special-characters" ]
5,728,648
1
null
null
-1
738
how do I write the click event for code below? ![enter image description here](https://i.stack.imgur.com/UeFgW.png) ``` var prodName = ["Phlips camera","HP keyboard","iPad","iPhone","Dell Mouse","shirts","books","samsung mobiles","samsung TV", "Phlips TV"," HP Mouse","iPad Charger","iPhone Charger","Dell Keyboard"," T shirts"," Ebooks"]; var cartVal = []; //add to cart $('#addcart').live("click",function() { alert( prodName[id]+" Item Added"); cartVal[item_count] = id; //alert("Item Count :::::" + item_count + " Selected Id:::: " + id); item_count++; }); //create a list to display the selected product in the cart. for(var l=0 ;l< cartVal.length; l++) { //alert(" name ::::"+ prodName[cartVal[l]]); var listItem = document.createElement('li'); listItem.setAttribute('id','listitem_'+ l); listItem.setAttribute('data-icon','false'); listItem.setAttribute('data-theme','c'); listItem.innerHTML = "<a href='#' data-role='button' data-theme ='c' id='" + cartVal[l] + "' rel='external' data-inline='true' style='margin-left:1em;'> <font size='2'>"+ prodName[cartVal[l]] + "</font><span id='viewPage' class='ui-li-count'>View</span></a> <a href='#' id='delete' data-role='button' data-rel='dialog' data-transition='slideup'> Purchase album</a>"; parent.appendChild(listItem); } ``` Here I want to write two click event for both anchor tag `<a>`.. if I click view or the product name, it display the details , then I click delete icon it deletes product the list..for e.g.: there is 5 items in the shopping list I want to delete two or three products?
How do I write the click event for code below in jQuery?
CC BY-SA 3.0
0
2011-04-20T10:07:48.200
2011-04-20T10:22:45.637
2011-04-20T10:17:09.443
6,144
504,130
[ "jquery", "html" ]
5,728,759
1
6,194,238
null
0
940
Within VS2010 I'm using a dark/pastel color scheme. SP2010 has a tab with a read-only XML pane. As you can see from the two screenshots, there is text in the pane, but it's basically invisible due to the background pane color. Is there any way to change the font color, from that light gray to something else? I've tried changing several display items within `Tools\Options\Environment\Fonts and Colors` with no luck. As a last resort, is there a way to change the pane background color? (although I guess it'll change that for the whole VS IDE) Thanks all. Feature manifest preview, unselected: ![Feature manifest preview, unselected](https://i.stack.imgur.com/iSrRJ.png) Feature manifest preview, selected: ![Feature manifest preview, selected](https://i.stack.imgur.com/6dfWA.png)
How to change font color in Visual Studio 2010 SharePoint 2010 Feature Designer?
CC BY-SA 3.0
null
2011-04-20T10:17:08.000
2012-10-31T22:29:54.343
null
null
540,776
[ "visual-studio-2010", "sharepoint-2010", "fonts", "colors", "color-scheme" ]
5,728,818
1
5,744,884
null
0
1,037
I have made a UIScrollView which holds four UILabels. I would like that the selected UILabel is not the one in the left of the screen but in the center. I have attached two images to illustrate what I mean. On the first image, the green label would be the selected one and on the next image the blue label would be the selected one. Is there any way to do this? This is my code: ``` [scrollView setContentSize:CGSizeMake(428, 65)]; [scrollView setDelegate:self]; UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 107, 65)]; [label1 setBackgroundColor:[UIColor redColor]]; [label1 setTextAlignment:UITextAlignmentCenter]; [label1 setText:@"Wednesday"]; [scrollView addSubview:label1]; [label1 release]; UILabel *label2 = [[UILabel alloc] initWithFrame:CGRectMake(107, 0, 107, 65)]; [label2 setBackgroundColor:[UIColor greenColor]]; [label2 setTextAlignment:UITextAlignmentCenter]; [label2 setText:@"Thursday"]; [scrollView addSubview:label2]; [label2 release]; UILabel *label3 = [[UILabel alloc] initWithFrame:CGRectMake(214, 0, 107, 65)]; [label3 setBackgroundColor:[UIColor blueColor]]; [label3 setTextAlignment:UITextAlignmentCenter]; [label3 setText:@"Friday"]; [scrollView addSubview:label3]; [label3 release]; UILabel *label4 = [[UILabel alloc] initWithFrame:CGRectMake(321, 0, 107, 65)]; [label4 setBackgroundColor:[UIColor orangeColor]]; [label4 setTextAlignment:UITextAlignmentCenter]; [label4 setText:@"Saturday"]; [scrollView addSubview:label4]; [label4 release]; ``` ![Example 1](https://i.stack.imgur.com/3od3w.png) ![Example 2](https://i.stack.imgur.com/DPVut.png)
UIScrollView paging selected in center
CC BY-SA 3.0
null
2011-04-20T10:22:30.083
2011-04-21T13:39:29.313
2011-04-20T10:45:43.727
41,761
486,845
[ "iphone", "sdk", "uiscrollview", "pagination", "center" ]
5,728,885
1
5,730,761
null
13
6,388
I'd like to copy a roughly rectangular area to a rectangular area. Example: ![](https://i.stack.imgur.com/S99Hf.png) Both areas are defined by their corner points. The general direction is kept (no flipping etc). Simply rotating the source image does not work since opposing sides may be of different length. So far I found no way to do this in pure C# (except manual pixel copying), so I guess I have to resort to the Windows API or some 3rd party library?
How do I draw an image based on a simple polygon?
CC BY-SA 3.0
0
2011-04-20T10:31:34.810
2013-07-17T03:45:36.330
null
null
39,590
[ "c#", ".net", "image-manipulation" ]
5,729,003
1
5,731,545
null
5
963
For a custom module developed in DotNetNuke (05.01.01) I have added additional settings on the settings page were I have the "Module Settings" and "Page Settings" but I couldn't figure out how to add a title to this group of settings. How can I add the title? Please find attached a screen grab that shows exactly where I need the title: ![screenshot with missing title highlighted](https://i.stack.imgur.com/PiMWT.jpg)
How can I add a title for the module settings in DotNetNuke?
CC BY-SA 3.0
null
2011-04-20T10:43:08.593
2011-08-22T06:01:20.963
2011-08-22T06:01:20.963
48,178
387,746
[ "dotnetnuke", "dotnetnuke-settings" ]
5,729,280
1
5,730,034
null
3
2,700
![DB Tables](https://i.stack.imgur.com/OIkI9.png) I've created a simple DB in EF code first but appear to have hit a problem. What I would like to do is, query the DBContext to retrieve a custom object CheckedTag that would have all of the available tags and a boolean field of checked. Code First abstracts the Many-To-Many table and I can't seem to find the correct query. I've tried ``` var qry = from t in Db.Tags from a in Db.Articles where(a.Id == articleId) select new CheckedTag { Id = t.Id, Name = t.Name, PermanentUrl = t.PermanentUrl, Checked = t.Id == null ? false : true }; ``` and scoured the net for a few hours now. If the articleId were to be 0, it would retrieve all of the tags and checked would be set to false, if the articleId was for an existing article all of the tags would be returned and the checked tags would be set to true. Can anyone suggest the query I need to use to retrieve to achieve this result?
Entity Framework Code First Left Join
CC BY-SA 3.0
0
2011-04-20T11:07:50.080
2011-11-21T18:29:03.587
2011-04-20T12:09:59.307
413,501
358,419
[ "entity-framework", "linq-to-entities", "many-to-many", "left-join", "ef-code-first" ]
5,729,286
1
null
null
0
146
Hi guys I've a problem with my project. I've an UIViewController with a UITableView inside. This table loads some custom cell (LSButtonCell). I've tried to push/pop multiple times this view and I've discovered this strange behavior: ![screenshot](https://i.stack.imgur.com/J0b4D.png) [http://i.stack.imgur.com/J0b4D.png](https://i.stack.imgur.com/J0b4D.png) Seems UITableViewCell will not release itself. What's happened? Any idea?
Allocation for UITableViewCell
CC BY-SA 3.0
null
2011-04-20T11:08:19.423
2011-04-20T12:57:55.863
2011-04-20T11:11:34.883
106,435
580,536
[ "cocoa-touch", "ipad", "uitableview", "allocation" ]
5,729,284
1
5,836,958
null
3
21,080
I am using jQuery datatables in a asp mvc application, and I want to put as shown below. the titles were put using paint :-) ![enter image description here](https://i.stack.imgur.com/acTmJ.jpg) Here is my code: ``` <script type="text/javascript"> var vouchers; $(document).ready(function() { /* Init the table*/ $("#vouchers").dataTable({ "bRetrieve": true, "bFilter": false, "bSortClasses": false, "bLengthChange": false, "bPaginate": true, "bInfo": false, "bJQueryUI": true, "bAutoWidth": true, "aaSorting": [[2, "desc"]], "aoColumns": [ { "bSortable": true }, { "bSortable": true }, { "bSortable": true }, { "bSortable": true }, { "bSortable": true }, { "bSortable": true }, { "bSortable": true }, { "bSortable": true}] }); vouchers.fnDraw(); }); </script> ``` Thank You
How to put a header title and a footer title to jQuery datatables?
CC BY-SA 3.0
null
2011-04-20T11:08:15.787
2011-04-29T20:16:38.470
null
null
350,648
[ "jquery", "asp.net-mvc-2", "datatables" ]
5,729,295
1
5,730,918
null
4
16,532
I've created a form that hosts one or more 'child' forms. In my edit mode, each child form shows its border and caption bar allowing it to be moved and sized (a bit like the old MDI app). Out of my edit mode, the borders disappear and the child forms are fixed in position. For my simple demo, I'm creating the child forms thus: ``` procedure TForm1.Button1Click(Sender: TObject); var Frm : TForm; begin Frm := TForm3.Create( Self ); Frm.Parent := Self; Frm.Visible := True; ``` The result is a layout like this: ![Layout](https://i.stack.imgur.com/I14q5.jpg) I notice that the edit controls in the child forms are never active. I would like to have the 'clicked' form show an active caption bar colour just like active apps move around when clicked. I presume my 'corpse' behaviour of the child forms is because they are inactive but attempts to do things like ChildForm.SetFocus do nothing. What do I need to do to get these edit controls alive and to show one of the forms as 'selected' please? (I'd really like to 'select' more than one form too if possible)
How to create a delphi form containing multiple 'child' forms that can be moved/sized and show activated
CC BY-SA 3.0
0
2011-04-20T11:09:19.203
2014-09-10T21:07:24.370
2014-09-10T21:07:24.370
321,731
47,012
[ "forms", "delphi", "parent" ]
5,729,366
1
5,731,949
null
0
1,518
I have been playing with Core Plot and trying to create a dynamic date x-axis. From the date plot example I have managed to create a static date axis, but would like to create a two-minute window at any time and update the xRange values. I am not sure on how to pass dates as the xRange min and length values and display time on the x-axis. I have looked at examples, but I haven't been able to utilize `NSTimeInterval` (if this is how to do it...). Below is the picture (if it helps) ![enter image description here](https://i.stack.imgur.com/uB1aW.png) Below is my attempt so far; can someone please advise me on how to achieve this? ``` - (void)loadView { // Alloc & Init Main View and since the display resolution is 1024x768 take 20 off for labels later UIView *tmpView = [ [ UIView alloc ] initWithFrame:CGRectMake(0, 0, 1024.0,768.0) ]; [ tmpView setAutoresizingMask:UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight ]; [ tmpView setBackgroundColor:[ UIColor redColor ] ]; // Alloc Graph View graphView = [ [ CPGraphHostingView alloc ] initWithFrame:CGRectMake(0, 0, 1024.0,768.0) ]; [ tmpView addSubview:[ graphView autorelease ] ]; // Set MainView [ self setView:[ tmpView autorelease ] ]; } -(void)viewDidLoad{ [super viewDidLoad]; NSDate *refDate = [NSDate date]; // NSTimeInterval oneDay = 24 * 60 * 60; NSTimeInterval oneHour = 60 * 60; NSTimeInterval fivemin= 5 * 60; // Create graph from theme graph = [(CPXYGraph *) [CPXYGraph alloc] initWithFrame:self.view.bounds]; CPTheme *theme = [CPTheme themeNamed:kCPDarkGradientTheme]; [graph applyTheme:theme]; graphView.hostedGraph = graph; //padding graph.paddingLeft = 20.0; graph.paddingTop = 20.0; graph.paddingRight = 20.0; graph.paddingBottom = 20.0; graph.plotAreaFrame.paddingTop=10.0; graph.plotAreaFrame.paddingLeft=50.0; graph.plotAreaFrame.paddingRight=35.0; graph.plotAreaFrame.paddingBottom=50.0; // Setup scatter plot space CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace; NSTimeInterval xLow = 0.0f; plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(xLow) length:CPDecimalFromFloat(oneHour)]; plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0f) length:CPDecimalFromFloat(100.0f)]; //Line Styles CPLineStyle *lineStyle = [CPLineStyle lineStyle]; lineStyle.lineColor = [CPColor redColor]; lineStyle.lineWidth = 2.0f; CPLineStyle *majorGridLineStyle = [CPLineStyle lineStyle]; majorGridLineStyle.lineWidth = 0.75; majorGridLineStyle.lineColor = [[CPColor colorWithGenericGray:0.2] colorWithAlphaComponent:0.75]; CPLineStyle *minorGridLineStyle = [CPLineStyle lineStyle]; minorGridLineStyle.lineWidth = 0.25; minorGridLineStyle.lineColor = [[CPColor whiteColor] colorWithAlphaComponent:0.1]; CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet; // X-Axes formatting CPXYAxis *x = axisSet.xAxis; x.majorIntervalLength = CPDecimalFromFloat(oneHour); x.orthogonalCoordinateDecimal = CPDecimalFromString(@"0"); x.minorTicksPerInterval = 0; x.labelOffset=0; NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init] autorelease]; dateFormatter.dateStyle = kCFDateFormatterShortStyle; CPTimeFormatter *timeFormatter = [[[CPTimeFormatter alloc] initWithDateFormatter:dateFormatter] autorelease]; timeFormatter.referenceDate = refDate; x.labelFormatter = timeFormatter; x.majorGridLineStyle = majorGridLineStyle; x.minorGridLineStyle = minorGridLineStyle; x.title=@"Time Axis"; //Y-Axes formatting CPXYAxis *y = axisSet.yAxis; y.majorIntervalLength = [ [ NSDecimalNumber decimalNumberWithString:@"10.0" ] decimalValue ]; y.orthogonalCoordinateDecimal = CPDecimalFromString(@"0"); y.minorTicksPerInterval = 5; y.labelOffset = 0.0; y.majorGridLineStyle = majorGridLineStyle; y.minorGridLineStyle = minorGridLineStyle; y.preferredNumberOfMajorTicks = 10; y.minorTickLineStyle = nil; y.labelTextStyle = nil; y.visibleRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(0.0f) length:CPDecimalFromFloat(100.0f)]; CPConstraints yConstraints = {CPConstraintFixed, CPConstraintFixed}; y.isFloatingAxis=YES; y.constraints=yConstraints; // Create a plot that uses the data source method CPScatterPlot *dataSourceLinePlot = [[[CPScatterPlot alloc] init] autorelease]; dataSourceLinePlot.identifier = @"Date Plot"; dataSourceLinePlot.dataLineStyle = lineStyle; dataSourceLinePlot.dataSource = self; [graph addPlot:dataSourceLinePlot]; mydata = [[NSMutableArray alloc]initWithObjects: [NSDecimalNumber numberWithInt:0], nil ]; //a timer to re-load the graph every 2 seconds and re-draw x-axis Timer = [NSTimer scheduledTimerWithTimeInterval:2.0 target:self selector:@selector(testingTimer:) userInfo:nil repeats:YES]; } -(NSUInteger)numberOfRecordsForPlot:(CPPlot *)plot { return mydata.count; } -(NSNumber *)numberForPlot:(CPPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { switch ( fieldEnum ) { case CPScatterPlotFieldX: return (NSDecimalNumber *)[NSDecimalNumber numberWithUnsignedInteger:index]; case CPScatterPlotFieldY: return [mydata objectAtIndex:index]; } return nil; } -(void) testingTimer: (NSTimer *) Timer{ //generating random number and add to mydata array testdata=arc4random() % 100; [mydata addObject:[NSNumber numberWithInt:testdata]]; [graph reloadData]; count++; CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace; plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(count) length:CPDecimalFromFloat(5*30.0f)]; } ```
Moving date on x-axis
CC BY-SA 3.0
0
2011-04-20T11:18:44.763
2011-04-21T05:01:32.487
2011-04-21T05:01:32.487
572,059
572,059
[ "objective-c", "datetime", "dynamic", "core-plot" ]
5,729,407
1
5,729,485
null
1
565
My data structure is set up this way - - Here's how the relationship looks like: ![enter image description here](https://i.stack.imgur.com/y0wjH.jpg) How do I get a list of courses the user takes? The query I have now is: ``` var courses = (from ClassEnrollment enrolment in entities.ClassEnrollment where enrolment.UserID == UserID join Module module in entities.Module on enrolment.ModuleID equals module.ID select module.Course ).ToList(); ``` However, this doesn't result in a list of courses, but rather a list of list of courses. How can I flatten this query to a list of distinct courses?
Concatenating lists inside a LINQ query
CC BY-SA 3.0
null
2011-04-20T11:22:34.200
2011-04-20T19:46:47.527
2011-04-20T19:46:47.527
240,424
128,585
[ "linq", "entity-framework", "entity-framework-4" ]
5,729,479
1
5,729,554
null
3
173
I need to show an additional image once the user hovers over button. How would you go around doing this ideally just using CSS. You can see what I need exactly on the image below, when the users hovers on the brochure button, the view brochure button appears. ![enter image description here](https://i.stack.imgur.com/eOTVv.png)
CSS Hover Effect
CC BY-SA 3.0
null
2011-04-20T11:29:10.807
2011-04-20T11:35:55.400
null
null
658,809
[ "css" ]
5,729,593
1
null
null
2
3,520
For example in the below image I want keep the text always vertically aligned in all condition. even if text is in one, two or three lines. means the text should be vertically centered always. I don't want to add extra `span` ![enter image description here](https://i.stack.imgur.com/iIWUh.jpg) ``` <div> <img src=abc.jpg"> Hello Stackoverflow. Thank you for help me </div> ``` I want to achieve with this html.
How to keep the text vertically aligned in any condition?
CC BY-SA 3.0
0
2011-04-20T11:39:33.547
2011-04-20T19:19:46.573
2011-04-20T19:19:46.573
84,201
84,201
[ "html", "css", "xhtml" ]
5,729,778
1
5,729,824
null
6
15,176
I have an unordered HTML list and am using CSS to style everything. When the text has multiple lines, it starts before the bullet point. Is there a way to make it start after the bullet point position? ![enter image description here](https://i.stack.imgur.com/D3IFT.png)
Text indentation in unordered lists with CSS
CC BY-SA 3.0
0
2011-04-20T11:52:41.977
2015-08-01T01:11:47.793
null
null
698,641
[ "css", "list", "styling", "unordered" ]