Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
3,659,138
1
3,661,457
null
1
1,357
My textbox is the only control on a window, which is a part of a bigger application. The textbox contains a certain amount of text, large enough to show vertical scrollbar. The scrollbar appears, but without a thumb: ![alt text](https://i.stack.imgur.com/1wdns.png) I can still scroll the contents, either with mouse wheel or by clicking the arrow-buttons repeatedly. When I create a new project with the same window and textbox the scrollbar works as it should. The same happens with a WrapPanel. Do you have ideas what could be spoiling my existing project and causing this issue? In generic.xaml I found some styles overriding the defaults for scrollbar and scrollviewer, but even totally clearing generic.xaml didn't help. Thanks in advance! EDIT: right, the code. It's XAML only (no c# backing code). ``` <Window x:Class="TextBoxTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" MaxHeight="200" MaxWidth="200"> <TextBox x:Name="textbox" MaxLines="2" MaxHeight="50" VerticalScrollBarVisibility="Auto" TextWrapping="WrapWithOverflow"> Useless text..... asdasdasda ssssssssssssss sssssss ssssaokdoka sdojwoandowm nxaofwha398ua ozmca3u0a3j3 a80a9fu 03 u0sf u0s9jf4s 0cuj wuf0j w40 fcjw cujwfj9 c9 u49 wsuc j9w3 3089w 9f8u4wfv 0sf ufw0u w0fuw0 fwu f0uw 09djcazp zopf h43 wofh FYHFWFH WOWY HWO H wohg fujg 4g fugj 4 g0 4 4w fw4 f3f g555u45y 55 some more some moresome more some moresome more some moresome more some moresome more some more. </TextBox> </Window> ```
WPF: Textbox scrollbar has no thumb
CC BY-SA 3.0
null
2010-09-07T13:42:00.407
2013-10-25T10:17:14.100
2011-08-20T19:38:48.440
318,795
318,795
[ "c#", "wpf" ]
3,659,267
1
3,659,418
null
1
318
The program works in its current for but I would like to make it more object oriented like its design using constructors and such but I don't know where to start and how to make it work. I would like your insight and examples on how you would accomplish this task? Here is a sample UML for what I am trying to do. ![UML](https://i.stack.imgur.com/SQHK4.jpg) ``` public static class IsbnConsole { public static void Main(string[] args) { Console.Write("Enter a valid 10 digit ISBN Number "); string isbn = checkIsbnClass.DestabilizeIsbn(Console.ReadLine()); // Normalizes the input and puts it on string "str" if (isbn.Length > 10 || isbn.Length < 9) // If the string length is greather than 10, or smaller than 9 { Console.WriteLine("The number you have entered is not a valid ISBN try again."); // Print invalid number Console.ReadLine(); } else if (isbn.Length == 10) // If the length is 10 { if (checkIsbnClass.CheckNumber(isbn)) // If function CheckNum return "true"... Console.WriteLine("The number you have entered is a Valid ISBN"); else // If it returns "false"... Console.WriteLine("The number you have entered is not a valid ISBN try again."); Console.ReadLine(); } else // Else (If the number is NOT greater than 10 or smaller than 9, NOR is it 10 -> If the number is 9) { Console.WriteLine("The Check digit that corresponds to this ISBN number is " + checkIsbnClass.CheckIsbn(isbn) + "."); // Print the checksum digit Console.ReadLine(); } public static class checkIsbnClass { public static string CheckIsbn(string isbn) // Calculates the 10th digit of a 9-digits partial ISBN number { int sum = 0; for (int i = 0; i < 9; i++) // For each number... { sum += int.Parse(isbn[i].ToString()) * (i + 1); // ...Multiply the number by it's location in the string } if ((sum % 11) == 10) // If the remainder equals to 10... { return "x"; // Output X } else // If it does not equal to 10... { return (sum % 11).ToString(); // Output the number } } public static bool CheckNumber(string isbn) // Checks if the checksum digit is correct { if (isbn[9].ToString() == CheckIsbn(isbn)) // If the 10th digit of the number is the same as the calculated digit... return true; else // If they're not the same... return false; } public static string DestabilizeIsbn(string isbn) // replace the string { return isbn.Replace("-", "").Replace(" ", ""); } ``` ``` public class isbn { //attributes private string isbnNum; //method public string GetIsbn() { return this.isbnNum; } //constructor public isbn() { Console.Write("Enter Your ISBN Number: "); this.isbnNum = Console.ReadLine(); }//end default constructor //method public string displayISBN() { return this.GetIsbn(); } public static void Main(string[] args) { //create a new instance of the ISBN/book class isbn myFavoriteBook = new isbn(); //contains the method for checking validity bool isValid = CheckDigit.CheckIsbn(myFavoriteBook.GetIsbn()); //print out the results of the validity. Console.WriteLine(string.Format("Your book {0} a valid ISBN", isValid ? "has" : "doesn't have")); Console.ReadLine(); } public static class CheckDigit { // attributes public static string NormalizeIsbn(string isbn) { return isbn.Replace("-", "").Replace(" ", ""); } public static bool CheckIsbn(string isbn) // formula to check ISBN's validity { if (isbn == null) return false; isbn = NormalizeIsbn (isbn); if (isbn.Length != 10) return false; int result; for (int i = 0; i < 9; i++) if (!int.TryParse(isbn[i].ToString(), out result)) return false; int sum = 0; for (int i = 0; i < 9; i++) sum += (i + 1) * int.Parse(isbn[i].ToString()); int remainder = sum % 11; if (remainder == 10) return isbn[9] == 'X'; else return isbn[9] == (char)('0' + remainder); } ```
Converting a program with just static methods to one that uses objects instead
CC BY-SA 2.5
null
2010-09-07T13:57:20.227
2010-09-07T15:19:52.620
2010-09-07T14:18:37.657
327,073
327,073
[ "c#" ]
3,659,383
1
3,659,398
null
3
506
When I press Ctrl+P in NetBeans PHP while writing down function call parameters I get a tooltip reminding me of the parameters: ![netbeans screenshot](https://i.stack.imgur.com/n0Kyi.png) Is there an equivalent for this in Eclipde PDT? It seems I can only get the autocomplete box while typing the function name - as soon as the cursor is in the function calls parenthesis there is no obvious way to get the autocomplete box again or anything like the tooltip above. Ctrl+Space just gives me a list of local variables...
Eclipse PDT equivalent for NetBeans PHP Ctrl+P inside function call parenthesis
CC BY-SA 2.5
0
2010-09-07T14:07:23.517
2010-09-07T14:30:40.337
null
null
360,593
[ "eclipse-pdt" ]
3,659,630
1
3,659,749
null
6
6,551
I'm using a box as a shared repo, and my team connects to it via . What I do is: 1. Create an empty git repository on the central machine git init 2. Then from each workstation do something like git clone ssh://user@central-box/Users/user/Projects/my-project/.git/ This works nice, but git keeps yelling at me every time I make a push something like this: ![alt text](https://i.stack.imgur.com/GIUL2.png) Is there a better way of sharing a repo . I'm well aware of the existence of `gitosis` and tools like that, I do not want anything fancy. Just sharing a .git repo over ssh. Thanks
Right way to share a git repo over ssh
CC BY-SA 2.5
0
2010-09-07T14:35:06.393
2010-09-08T03:25:22.243
null
null
7,595
[ "git", "ssh" ]
3,659,794
1
3,659,846
null
0
811
I'm currently redesigning a website and have run into an issue with some elements in the header. The header contains a logo, some text and a navigation bar. Between the bottom of the logo and the top of the navigation bar there is a relatively thick gap, shown in this screenshot: ![Problem](https://i.stack.imgur.com/hBLc8.png) I don't want the gap, I don't know where it's come from and I don't know how to get rid of it :( I can reduce it down to a single pixel by setting the `line-height` property of the div containing the logo down to `0.0`, but it seems hacky and still doesn't fix the issue. The work-in-progress version can be viewed live [here](http://sandbox.woodstockdesigns.co.uk/), if anyone with more HTML/CSS experience can identify any silly mistakes I've made.
Unexpected gap between CSS header elements
CC BY-SA 2.5
0
2010-09-07T14:55:05.660
2010-09-08T01:34:36.213
2010-09-08T01:34:36.213
222,454
222,454
[ "html", "css" ]
3,660,063
1
3,668,591
null
1
1,355
I have built a UserControl for display a list of other UserControls which themselves are bound to individual data objects. The link below shows an example implementation of this control. ![alt text](https://i.stack.imgur.com/ST2Vf.jpg) Each of the individual user rows is its own UserControl/XtraUserControl, laid out in a FlowLayoutPanel. The problem I have is with perfomance, to populate the list above takes around (excluding any data loading) - this is a combination of creating each control and then adding them to the FlowLayoutPanel using the AddRange(controls[]) method. Does anyone know any way I can improve perfomance here? Do I have to manually paint the items instead of using User Controls? Thanks in advance.
Winforms Usercontrol: Perfomance issues when creating and adding to parent
CC BY-SA 2.5
null
2010-09-07T15:22:53.803
2010-09-23T13:19:39.473
2010-09-23T13:19:39.473
213,707
213,707
[ "winforms", "performance", "user-controls", "devexpress" ]
3,660,288
1
3,660,321
null
6
508
I've made a class (code below) that handles the creation of a "matching" quiz item on a test, this is the output: ![alt text](https://i.stack.imgur.com/UV062.png) It works fine. However, in order to get it , I have to put the for at least 300 counts between the random shuffling of the two columns, anything lower than 300 returns both columns sorted in the same order, as if it is using the same seed for randomness: ``` LeftDisplayIndexes.Shuffle(); Thread.Sleep(300); RightDisplayIndexes.Shuffle(); ``` ``` using System.Collections.Generic; using System; using System.Threading; namespace TestSort727272 { class Program { static void Main(string[] args) { MatchingItems matchingItems = new MatchingItems(); matchingItems.Add("one", "111"); matchingItems.Add("two", "222"); matchingItems.Add("three", "333"); matchingItems.Add("four", "444"); matchingItems.Setup(); matchingItems.DisplayTest(); matchingItems.DisplayAnswers(); Console.ReadLine(); } } public class MatchingItems { public List<MatchingItem> Collection { get; set; } public List<int> LeftDisplayIndexes { get; set; } public List<int> RightDisplayIndexes { get; set; } private char[] _numbers = { '1', '2', '3', '4', '5', '6', '7', '8' }; private char[] _letters = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h' }; public MatchingItems() { Collection = new List<MatchingItem>(); LeftDisplayIndexes = new List<int>(); RightDisplayIndexes = new List<int>(); } public void Add(string leftText, string rightText) { MatchingItem matchingItem = new MatchingItem(leftText, rightText); Collection.Add(matchingItem); LeftDisplayIndexes.Add(Collection.Count - 1); RightDisplayIndexes.Add(Collection.Count - 1); } public void DisplayTest() { Console.WriteLine(""); Console.WriteLine("--TEST:-------------------------"); for (int i = 0; i < Collection.Count; i++) { int leftIndex = LeftDisplayIndexes[i]; int rightIndex = RightDisplayIndexes[i]; Console.WriteLine("{0}. {1,-12}{2}. {3}", _numbers[i], Collection[leftIndex].LeftText, _letters[i], Collection[rightIndex].RightText); } } public void DisplayAnswers() { Console.WriteLine(""); Console.WriteLine("--ANSWERS:-------------------------"); for (int i = 0; i < Collection.Count; i++) { string leftLabel = _numbers[i].ToString(); int leftIndex = LeftDisplayIndexes[i]; int rightIndex = RightDisplayIndexes.IndexOf(leftIndex); string answerLabel = _letters[rightIndex].ToString(); Console.WriteLine("{0}. {1}", leftLabel, answerLabel); } } public void Setup() { do { LeftDisplayIndexes.Shuffle(); Thread.Sleep(300); RightDisplayIndexes.Shuffle(); } while (SomeLinesAreMatched()); } private bool SomeLinesAreMatched() { for (int i = 0; i < LeftDisplayIndexes.Count; i++) { int leftIndex = LeftDisplayIndexes[i]; int rightIndex = RightDisplayIndexes[i]; if (leftIndex == rightIndex) return true; } return false; } public void DisplayAsAnswer(int numberedIndex) { Console.WriteLine(""); Console.WriteLine("--ANSWER TO {0}:-------------------------", _numbers[numberedIndex]); for (int i = 0; i < Collection.Count; i++) { int leftIndex = LeftDisplayIndexes[i]; int rightIndex = RightDisplayIndexes[i]; Console.WriteLine("{0}. {1,-12}{2}. {3}", _numbers[i], Collection[leftIndex].LeftText, _letters[i], Collection[rightIndex].RightText); } } } public class MatchingItem { public string LeftText { get; set; } public string RightText { get; set; } public MatchingItem(string leftText, string rightText) { LeftText = leftText; RightText = rightText; } } public static class Helpers { public static void Shuffle<T>(this IList<T> list) { Random rng = new Random(); int n = list.Count; while (n > 1) { n--; int k = rng.Next(n + 1); T value = list[k]; list[k] = list[n]; list[n] = value; } } } } ```
How can I get true randomness in this class without Thread.Sleep(300)?
CC BY-SA 2.5
0
2010-09-07T15:52:25.180
2010-09-07T16:11:07.380
null
null
4,639
[ "c#", "random" ]
3,660,441
1
3,660,712
null
0
1,213
i have generated a Linq to Sql class which looks like this. ![alt text](https://i.stack.imgur.com/zMsua.jpg) so i have 3 querys which gets my data. ``` private IQueryable<Gesellschaft> loadedGesellschaft; private IQueryable<Anschrift> loadedGesellschaftAnschrift; private IQueryable<Email> loadedGesellschaftEmail; private lgDataContext completeGesellschaft; private void Button_Click(object sender, RoutedEventArgs e) { completeGesellschaft = new lgDatacontext(); loadedGesellschaft = completeGesellschaft.Gesellschaft.Where(gid => gid.GID == 2); loadedGesellschaftAnschrift = completeGesellschaft.Anschrift.Where(FK_GID => FK_GID.FK_GesellschaftId == loadedGesellschaft.First().GID); loadedGesellschaftEmail = completeGesellschaft.Email.Where(FK_GID => FK_GID.FK_AnschriftId == loadedHauptanschrift.First().idAnschrift); } ``` After this i want to put these 3 on my page. The Result is something like this there one Office(loadedGesellschaft) and that has maybe more than one Adress(loadedGesellschaftAnschrift) and has maybe more than one Email(loadedGesellschaftEmail) so i have on my window some textboxes which contain the fields from loadedGesellschaft and Adresses and Emails are stored in comboboxes. do i always have to bind the itemsource of one Control e.g. `<ComboBox Name="CBox_GDEmail" />` ``` CBoxGDEmail.Itemsource = loadedGesellschaftEmail; ``` or is there an possibility to put all three objects together to the datacontext of the window ?
C# WPF Linq to SQL Databinding
CC BY-SA 2.5
null
2010-09-07T16:10:04.513
2010-09-07T16:42:25.107
null
null
424,226
[ "c#", "wpf", "linq-to-sql", "data-binding" ]
3,660,841
1
null
null
0
332
My ListView has to be customized like, it should have three imageView in each ListItem along with the name and date that has to populated from the DB,added with that, once i click upon the a list item ,that corresponding Listitem information has to be displayed in another Screen...The Size of the List should be based on the Cursor object from DB..and it should be possible to add data in to the Listview..too Can anybody give me any suggestion/snippet/resource of how to proceed the above said.. Please check the ScreenShot of ListView that i mentioned..(My ListView should have to be like this only).. ![SampleListView](https://i.stack.imgur.com/CUri4.jpg) Thanks in advance.....
ListView in Android
CC BY-SA 3.0
0
2010-09-07T16:57:16.427
2011-12-04T00:30:32.607
2011-12-04T00:30:32.607
84,042
384,193
[ "android", "listview" ]
3,661,954
1
3,662,025
null
6
4,977
I have an `ol`/`li` listing (in one `ol` tag), I need to list in two columns. There must be a way to do it in CSS. ![alt text](https://i.stack.imgur.com/jnwUh.jpg)
Listing ol li up to down in 2 column with CSS
CC BY-SA 3.0
null
2010-09-07T19:21:15.403
2015-12-14T23:17:05.927
2012-06-03T17:53:29.693
387,076
150,225
[ "html", "css", "html-lists" ]
3,662,479
1
3,663,317
null
2
1,088
I'm currently redesigning a website and have run into an issue with horizontal scrolling when the page is viewed in a narrow browser window. The header contains a logo, some text and a navigation bar and spans 100% of the page width, but the header content is centered with a fixed width of 940px. When shown properly, it looks like this: ![Normal](https://i.stack.imgur.com/aTBT6.png) However, if the browser window is resized to be narrower than the fixed width a horizontal scrollbar appears (as expected), but scrolling it 'cuts' the scrolled part out, producing the following result: ![Scrolled](https://i.stack.imgur.com/kRQnF.png) The work-in-progress site can be viewed live [here](http://sandbox.woodstockdesigns.co.uk/), if the CSS/HTML can give you any hints as to what I'm doing wrong.
Fixed full-width CSS header not scrolling correctly with narrow browser windows
CC BY-SA 2.5
0
2010-09-07T20:31:22.620
2010-09-07T22:51:04.587
null
null
222,454
[ "css" ]
3,662,634
1
3,662,848
null
0
1,000
I have a custom workflow implementation what requires updation of an external DB. I created a simple workflow for text purpose and found a strange thing! my Db update/insert code is placed in a code activity of the workflow. it seems the code activity is executed multiple times when the workflow is invoked on a simple list item in sharepoint custom list. Here is my workflow: ![workflow-image](https://i.stack.imgur.com/9ksZ2.png) and my code is: ``` private void onWorkflowActivated1_Invoked(object sender, ExternalDataEventArgs e) { workflowProperties.Item["Title"] = "Processed by workflow at "+ DateTime.Now; workflowProperties.Item.Update(); } private void codeActivity1_ExecuteCode(object sender, EventArgs e) { Random rnd = new Random(); string conStr = "Data Source=192.168.1.57\\TRIBIRD;Initial Catalog=XXXXXX;User ID=XXXXXX;Password=XXXXXXXXXX"; SqlConnection connection = new SqlConnection(conStr); SqlCommand command = connection.CreateCommand(); command.CommandType = System.Data.CommandType.Text; command.CommandText = "INSERT INTO XXXX VALUES(" + rnd.Next() + ",'THE CONTENT FROM SHAREPOINT WORKFLOW','EN',1,1,'BRT')"; connection.Open(); command.ExecuteNonQuery(); command.Dispose(); connection.Close(); } ``` in the DB i get more than 1 row for the workflow execution! interesting thing is, during each execution, the number of rows added varies. Why is this happening? what is my mistake? Any ideas and suggestions are welcome.
Repeated execution of code activity in SharePoint workflow?
CC BY-SA 2.5
null
2010-09-07T20:50:50.687
2010-09-07T21:18:07.810
2020-06-20T09:12:55.060
-1
185,655
[ "sharepoint", "workflow", "sharepoint-2007", "sharepoint-workflow" ]
3,662,649
1
3,662,655
null
5
27,520
I want to show two lines in `<td>`. And it is showing, next to each other. ``` <td bgcolor="White"> First Name (on external website) </td> ``` I want to be like below. 1st line bold and 2nd line will be small letters. ![alt text](https://i.stack.imgur.com/3MndH.jpg)
How make 2 lines in <td>
CC BY-SA 4.0
0
2010-09-07T20:52:50.717
2019-09-24T06:27:49.690
2020-06-20T09:12:55.060
-1
158,008
[ "asp.net", "html", "css" ]
3,662,657
1
3,662,824
null
0
1,816
I need to add a form to my existing application i have it all laid out but how do I get it to use the code from the form as to make it seamless. Any thoughts? and sorry for the wall of code just thought it might help. The Validate button should get its info from the console like below ![alt text](https://i.stack.imgur.com/bAcDJ.jpg) The Generate action should append the check digit like in this example ![alt text](https://i.stack.imgur.com/m6a7D.jpg) ![alt text](https://i.stack.imgur.com/XXbNj.jpg) ``` public static void Main(string[] args) { Console.Write("Enter a valid 10 digit ISBN Number "); string isbn = isbnChecker.DestabilizeIsbn(Console.ReadLine()); // Normalizes the input and puts it on string "str" if (isbn.Length > 10 || isbn.Length < 9) // If the string length is greather than 10, or smaller than 9 { Console.WriteLine("The number you have entered is not a valid ISBN try again."); // Print invalid number Console.ReadLine(); } else if (isbn.Length == 10) // If the length is 10 { if (isbnChecker.CheckNumber(isbn)) // If function CheckNum return "true"... Console.WriteLine("The number you have entered is a valid ISBN"); else // If it returns "false"... Console.WriteLine("The number you have entered is not a valid ISBN try again."); Console.ReadLine(); } else // Else (If the number is NOT greater than 10 or smaller than 9, NOR is it 10 -> If the number is 9) { Console.WriteLine("The Check digit that corresponds to this ISBN number is " + checkIsbnClass.CheckIsbn(isbn) + "."); // Print the checksum digit Console.ReadLine(); } } public static class isbnChecker { public static bool CheckNumber(string isbn) // Checks if the checksum digit is correct { if (isbn[9].ToString() == checkIsbnClass.CheckIsbn(isbn)) // If the 10th digit of the number is the same as the calculated digit... return true; else // If they're not the same... return false; } public static string DestabilizeIsbn(string isbn) // replace the string { return isbn.Replace("-", "").Replace(" ", ""); } } public static string CheckIsbn(string isbn) // Calculates the 10th digit of a 9-digits partial ISBN number { int sum = 0; for (int i = 0; i < 9; i++) // For each number... { sum += int.Parse(isbn[i].ToString()) * (i + 1); // ...Multiply the number by it's location in the string } if ((sum % 11) == 10) // If the remainder equals to 10... { return "x"; // Output X } else // If it does not equal to 10... { return (sum % 11).ToString(); // Output the number } } public static bool CheckNumber(string isbn) // Checks if the checksum digit is correct { if (isbn[9].ToString() == CheckIsbn(isbn)) // If the 10th digit of the number is the same as the calculated digit... return true; else // If they're not the same... return false; } public static string DestabilizeIsbn(string isbn) // replace the string { return isbn.Replace("-", "").Replace(" ", ""); } } public partial class IsbnForm : Form { public IsbnForm() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { this.xInputTextBox.Text = "Enter a Valid ISBN"; } } ``` }
Adding a Form to an existing console application?
CC BY-SA 2.5
null
2010-09-07T20:53:48.610
2010-09-07T21:13:31.920
null
null
327,073
[ "c#" ]
3,662,809
1
3,664,534
null
0
958
I like the comment box at the top with the posts going in reverse order. Comment rating, highest rated comments, all great features, remaining character count, spam flag. My question is, is there a open commenting system available for Django that already has these features?![alt text](https://i.stack.imgur.com/0q7ru.png)
django comment system: How to make it more like YouTube's?
CC BY-SA 2.5
null
2010-09-07T21:10:57.580
2010-09-08T03:53:59.493
null
null
355,697
[ "python", "django", "comments", "youtube" ]
3,662,959
1
3,662,968
null
16
7,191
In the iOS clock app, the font in the table view cells has a slight shadow to it which gives the effect that the text is engraved.... ![alt text](https://i.stack.imgur.com/pWYZx.png) How can I recreate that font with the engraved look? Thanks in advance for your help!
How can I recreate this iOS font that has a shadow?
CC BY-SA 2.5
0
2010-09-07T21:37:13.453
2012-02-20T10:13:04.540
null
null
191,808
[ "iphone", "ipad", "ios", "uifont" ]
3,663,306
1
null
null
7
42,305
I've found an example [here](https://stackoverflow.com/questions/1910478/centering-text-within-a-multirow-cell-in-latex) but that only centers one column and I can't really adapt it to my needs. What I'd like is something like this: ![alt text](https://i.stack.imgur.com/jy7mt.png)
Is it possible to vertically center multiple columns in a table?
CC BY-SA 3.0
null
2010-09-07T22:45:09.217
2017-01-14T23:22:28.193
2017-05-23T10:29:24.460
-1
383,330
[ "alignment", "latex", "multiple-columns", "multirow" ]
3,664,027
1
null
null
0
231
![alt text](https://i.stack.imgur.com/mOdK2.png) The attached image is what happens sometimes when I try to size a `MKMapView` to fit one or more placemarks. It's intermittent, but the display is always in exactly the same position. Here is the code: ``` // loc1 is always non-null, and is equal to one of the annotation locations CLLocationCoordinate2D topLeftCoord = loc1.coordinate; CLLocationCoordinate2D bottomRightCoord = loc1.coordinate; for(UserPlacemark* annotation in self.mapView.annotations) { topLeftCoord.longitude = fmin(topLeftCoord.longitude, annotation.coordinate.longitude); topLeftCoord.latitude = fmax(topLeftCoord.latitude, annotation.coordinate.latitude); bottomRightCoord.longitude = fmax(bottomRightCoord.longitude, annotation.coordinate.longitude); bottomRightCoord.latitude = fmin(bottomRightCoord.latitude, annotation.coordinate.latitude); } MKCoordinateRegion region; double k = 0.01; region.center.latitude = topLeftCoord.latitude - (topLeftCoord.latitude - bottomRightCoord.latitude) * 0.25; region.center.longitude = topLeftCoord.longitude + (bottomRightCoord.longitude - topLeftCoord.longitude) * 0.5; region.span.latitudeDelta = k + fabs(topLeftCoord.latitude - bottomRightCoord.latitude) * 1.25; // Add a little extra space on the sides region.span.longitudeDelta = k + fabs(bottomRightCoord.longitude - topLeftCoord.longitude) * 1.5; // Add a little extra space on the sides // only zoom if region doesn't fit, or too small CGRect newRect = [mapView convertRegion:region toRectToView:mapView]; double MIN_SIZE_PIXELS = 50.0; double rectSizePixels = newRect.size.width+newRect.size.height; if (!CGRectContainsRect(mapView.bounds, newRect) || rectSizePixels < MIN_SIZE_PIXELS) { region = [mapView regionThatFits:region]; [mapView setRegion:region animated:TRUE]; } ```
iPhone Map Region Weirdness
CC BY-SA 3.0
null
2010-09-08T01:29:43.493
2017-09-18T11:24:01.127
2017-09-18T11:24:01.127
1,000,551
104,181
[ "ios", "objective-c", "mapkit" ]
3,664,365
1
3,664,436
null
2
6,842
I have a ListView with a lot of data (200+ items) so to save space it's making use of a UniformGrid to display 3 columns instead of 1 ``` <ListView.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Columns="3" /> </ItemsPanelTemplate> </ListView.ItemsPanel> ``` I also modify the style so that each item is aligned to the top ``` <ListView.Resources> <Style TargetType="{x:Type ListView}"> <Setter Property="ItemContainerStyle"> <Setter.Value> <Style TargetType="ListViewItem"> <Setter Property="VerticalContentAlignment" Value="Top"/> </Style> </Setter.Value> </Setter> </Style> </ListView.Resources> ``` This works ok, however due to differences in the length of the data displayed, there is still wasted space in item groups because most of the data fits on a single line, but occasionally there is an item which takes up 2 or more rows. This means all rows in a group take up 2 or more rows when it's only 1 row that needs the extra space ![alt text](https://i.stack.imgur.com/dqcaT.png) Does anyone know how to fix this, or can suggest another approach to avoid the uniformgrid? Thanks!
Best approach for WPF multi-column list view
CC BY-SA 2.5
0
2010-09-08T03:02:48.167
2010-09-08T03:23:04.430
2010-09-08T03:13:50.073
44,540
44,540
[ "wpf", "listview", "uniformgrid" ]
3,664,441
1
3,664,485
null
0
1,350
I have a requirement by which I need to have something like below as the background of my asp.net menu item background. NOTE: The menu is populated by sitemapdatasource which is dynamic depending on querystring. ![alt text](https://i.stack.imgur.com/iHXfJ.png) I was doing some googling up and found that I can apply JQuery's rounded corner functionality along with asp.net menu item. Has anyone got any better solution or probably an example of JQuery's rounded corner and asp.net menu item example. Thanks, Nimesh
asp.net menu item with jquery rounded corner
CC BY-SA 2.5
null
2010-09-08T03:23:56.693
2010-09-08T03:45:03.193
null
null
375,777
[ "asp.net", "jquery", "css" ]
3,665,168
1
3,667,948
null
1
6,307
Say, I have a script nicely formatted in SSMS and it's annotated with all kinds of comments in different languages. But when I copy and paste this nice thingy into Word with syntax highlighted I will get a syntax-highlighted message with those comments garbled, as if reading the source text with one code page and pasting it using another code page. Very nasty kinda bug. Does anyone know how to solve this issue once and for all? Thank you! ![alt text](https://i.stack.imgur.com/csWeD.png) Save → Save with Encoding... → Encoding : Unicode (UTF-8 with signature). - [Need a way to set the default encoding for query files in SMSS. by ChrisMay @Microsoft Connect](https://connect.microsoft.com/SQLServer/feedback/details/336750/need-a-way-to-set-the-default-encoding-for-query-files-in-smss?wa=wsignin1.0)- [SQL Server Management Studio - File Encoding @SqlDev](http://www.sqldev.org/sql-server-tools-general/sql-server-management-studio--file-encoding-56214.shtml)- [SSMS : Option to set default save as encoding for CSV by AaronBertrand @Microsoft Connect](https://connect.microsoft.com/SQLServer/feedback/details/259779/ssms-option-to-set-default-save-as-encoding-for-csv?wa=wsignin1.0)
How to copy and paste script text from SSMS to Outlook or Word without garbling it?
CC BY-SA 2.5
0
2010-09-08T06:33:45.000
2010-09-08T14:36:01.813
2010-09-08T14:36:01.813
124,681
124,681
[ "sql-server", "sql-server-2005", "ssms", "sql-server-2008" ]
3,665,385
1
3,665,442
null
45
30,368
I am creating a UITextField programmatically and placing it inside a UIView. The font size is set to 15.0f (system font). But the placeholder that appears is not centered in the text view. Any one know how to resolve this? I found some references on SO for blurred text etc and tried setting the frame of the textfield with integer values, but it doesn't make a difference. ``` UITextField *txtField = [[UITextField alloc] initWithFrame:CGRectMake(5.0f, 6.0f, 278.0f, 32.0f)]; [txtField setPlaceholder:@"My placeholder"]; [txtField setFont:[UIFont systemFontOfSize:15.0]]; [txtField setBorderStyle:UITextBorderStyleRoundedRect]; [txtField setAutocorrectionType:UITextAutocorrectionTypeNo]; [txtField setAutocapitalizationType:UITextAutocapitalizationTypeNone]; [txtField setKeyboardType:UIKeyboardTypeEmailAddress]; [txtField setReturnKeyType:UIReturnKeyDone]; [txtField setClearButtonMode:UITextFieldViewModeWhileEditing]; ``` Thank you for any help Adding an image of the issue for clarification - as seen in the image, the placeholder text is more towards the top and not in the center vertically. ![alt text](https://i.stack.imgur.com/XD6Sr.png)
Placeholder text not centered for UITextField created programmatically
CC BY-SA 3.0
0
2010-09-08T07:11:43.533
2017-05-10T11:02:47.367
2017-04-04T12:06:40.343
1,033,581
46,297
[ "iphone", "uitextfield" ]
3,665,390
1
3,665,476
null
2
2,964
I'm quite new in C++ after few years in Java and eclipse, I got little bit confusing using code::blocks, no autogenerate setter/getter and also implement interface :D. I wanna ask about code structure in code::blocks, I create new console application, my header will be put to Headers/include folder called Employee.h, then .cpp will be put to src folder. Now I create main class (I put outside of src folder) who will call the header, I just append the include code like this : ``` #include "Employee.h" ``` sure then the errors appeared after compiling: error : Employee.h: No such file or directory. how to link the header to the main class properly? this is my folder structure : ![alt text](https://i.stack.imgur.com/N2lc8.jpg) updated : It works, my include folder needs to be added on build options. ![alt text](https://i.stack.imgur.com/aNSrQ.jpg) Really thanks
Question about C++ folder structure for header file
CC BY-SA 2.5
0
2010-09-08T07:12:28.900
2012-07-31T20:11:56.507
2010-09-08T08:05:57.633
15,416
231,007
[ "c++" ]
3,665,707
1
null
null
0
312
I'm using `TAdvOfficePager`component from [TMS Software](http://www.tmssoftware.com/site/aop.asp). Inside each page I use a frame. When switching between pages I get some ugly display artefacts like this: ![alt text](https://i.stack.imgur.com/Qlb6N.jpg) The controls from the old page and the controls from the new page are both visible for some time. Is there anything I can do about this? : There's nothing happening in the `OnShow` event handler, it's really just the page switch causing the artefact. Thanks for your help in advance.
Display Artefacts when Switching Pages in TMS TAdvOfficePager
CC BY-SA 2.5
null
2010-09-08T08:04:00.157
2010-09-08T08:40:46.943
null
null
62,391
[ "delphi", "delphi-2010", "tms" ]
3,666,131
1
4,322,138
null
2
1,397
If you have used the Google Maps web app on your iphone or ipad you know what i am talking about. You can't see my fingers in this screen grab, but this is mid-pinch (if you will) zooming out. The detailed area was the initial map viewing area and the blurry bit outside is the extra map that has come into view mid-pinch. ![zooming out with gesture](https://i.stack.imgur.com/HUfj6.jpg) The pinch-to-zoom function that uses the gesture touch input scales the map currently in view live in a way that is so smooth it looks like magic. We are trying to scale images and reproduce this smooth scaling. Does anyone know how they do it? We don't know if it's a single `img` element being scaled. Or maybe all the `img` elements in their relative grid matrix somehow being all scaled at once (this seems a bit unlikely). Maybe it's lots of `canvas` elements.. or one big `canvas` element (which we also doubt after a reasonable amount of testing). Please, any suggestions, ideas or answers (if you're from Google) would be great.
How is google maps (web app) scaling so smooth on the iphone/ipad with the gesture/pinch?
CC BY-SA 2.5
0
2010-09-08T09:02:42.437
2010-12-01T07:31:41.550
2010-10-04T06:05:45.970
56,145
56,145
[ "google-maps", "ios", "touch", "multi-touch", "gesture" ]
3,666,541
1
3,666,563
null
25
208,013
I'm currently stuck setting borders in an html table. (I use inline styles for a better rendering in e-mail-clients) I have this piece of code: ``` <html> <body> <table style="border: 1px solid black;"> <tr> <td width="350" style="border: 1px solid black ;"> Foo </td> <td width="80" style="border: 1px solid black ;"> Foo1 </td> <td width="65" style="border: 1px solid black ;"> Foo2 </td> </tr> <tr style="border: 1px solid black;"> <td style="border: 1px solid black;"> Bar1 </td> <td style="border: 1px solid black;"> Bar2 </td> <td style="border: 1px solid black;"> Bar3 </td> </tr> <tr style="border: 1px solid black;"> <td style="border: 1px solid black;"> Bar1 </td> <td style="border: 1px solid black;"> Bar2 </td> <td style="border: 1px solid black;"> Bar3 </td> </tr> </table> </body> </html> ``` It is rendered like this: ![alt text](https://i.stack.imgur.com/UvlnF.png) I want the table to be rendered like Excel would render a table, with inner and outer border: ![alt text](https://i.stack.imgur.com/skooZ.png)
How to format html table with inline styles to look like a rendered Excel table?
CC BY-SA 3.0
0
2010-09-08T09:58:49.243
2018-04-23T22:10:55.550
2015-05-20T20:13:34.697
3,281,476
225,808
[ "html", "css", "border", "html-table" ]
3,666,791
1
3,667,211
null
0
398
![alt text](https://i.stack.imgur.com/fJqus.png)I have a UIScrollView which has a UIView embedded in it. It have 2 buttons "scroll" and "unscroll".On clicking the "scroll" button, my scrollview scroll up from the bottom of the parent view. Everything works fine until here but when I click the "unscroll" button to push the scrollview back to where it came from, nothing happens. I have posted the entire code here. Please check where the fault lies !!. Already spent a sizeable amount of time on it. ``` -(IBAction)unscrollClicked:(id)sender { //[viewController.view removeFromSuperview]; [UIView beginAnimations:@"back to original size" context:nil]; scrollView.contentSize=viewController.view.bounds.size; //scrollView.contentSize=viewController.view.bounds.size; [UIView commitAnimations]; } -(IBAction)scrollClicked:(id)sender { //viewController.view.backgroundColor=[UIColor orangeColor]; viewController.view.frame=CGRectMake(0, 410, 320, 460); //[self.view addSubview:viewController.view]; UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0,40, 320, 400)];//(0,0,320,160) scrollView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; //[MyView setFrame:CGRectMake (0, 0, 320, 170)]; viewController.view.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth; scrollView.contentSize = viewController.view.bounds.size; scrollView.bounces = YES; scrollView.bouncesZoom = YES; scrollView.scrollEnabled = YES; scrollView.minimumZoomScale = 0.5; scrollView.maximumZoomScale = 5.0; scrollView.delegate = self; [scrollView addSubview: viewController.view]; [self.view addSubview:scrollView]; [self moveScrollView:scrollView]; } -(void) moveScrollView:(UIScrollView *)scrollView { CGFloat scrollamount=400; [scrollView setContentOffset:CGPointMake(0,scrollamount) animated:YES]; } ```
UIScrollView "scroll back"
CC BY-SA 2.5
null
2010-09-08T10:31:56.637
2010-09-08T11:28:01.830
2010-09-08T10:48:02.853
null
null
[ "iphone" ]
3,666,956
1
3,667,374
null
1
655
How do I blend these two sets of pixelData? The maskArray specifies the pixels to use from the OverlayData. These need to be merged with the backgroundData, and inserted back into the main canvas as newBackgroundData, and as offsetX changes update as needed. I think I have found a solution: simply create another hidden canvas, and then using drawImage back into the main canvas, preserving any transparency. ![alt text](https://i.stack.imgur.com/KPcMo.png)
Overlay Canvas Pixel Data
CC BY-SA 2.5
null
2010-09-08T10:55:00.263
2010-09-08T12:03:59.957
2010-09-08T12:03:59.957
219,609
219,609
[ "javascript", "graphics", "html", "canvas", "pixel" ]
3,667,213
1
3,667,301
null
0
205
i want to embed an open source editor to my java desktop application. But i am not sure yet how to do it. I got jnlp web start and jar file to import library. The program which will be imported is like below. ![alt text](https://i.stack.imgur.com/P97IH.png) In fact i just need internal frames but if it is too completed i can embed whole program too. I think about 3 options but don't know which one really works and which one is better. 1. Run jnlp webstart in java code 2. Run jar file in java code(non-executable jar) 3. Import jar and use its api (This is really what i need but i m not sure how to do this. I debugged the code to understand which frame works how but i have no experience about it and i found it very complicated) Any advices how to solve this problem ? Thanks, Bilal
Java, using another java program in jar format
CC BY-SA 2.5
null
2010-09-08T11:28:07.567
2010-09-08T11:40:36.017
2010-09-08T11:40:36.017
265,143
396,563
[ "java", "jar" ]
3,667,257
1
3,667,428
null
2
8,516
I managed (as you can see in older posts from me) to insert a onetomany relation through hibernate. My two entity classes look like following: Project.java: ``` @Entity public class Project { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @OneToMany(cascade = CascadeType.ALL, mappedBy="project") @OrderColumn(name = "project_index") List<Application> applications; .... ``` Application.java (which is a child of project. One project can have many applications, but one application belongs to just one project) ``` @Entity public class Application { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; @ManyToOne @JoinColumn(name = "project_id") private Project project; ... ``` So far, insertion of data works well. But getting data out of my database is the problem. I tried two ways: --- I retrieve a Project and try to get Applications out of the list attribute. But unfortunately Application entities are in a 'storedSnapshot', which seems pretty wrong to me. Here is a screenshot from my debug screen: ![alt text](https://i.stack.imgur.com/hzV8n.jpg) --- I try to retrieve a list of all applications via sql query: ``` public List<Application> getApplications(int project_id) { Session session = HibernateUtil.getSessionFactory().getCurrentSession(); session.beginTransaction(); List<Application> applications = session.createQuery("from Application a where a.project_id=" + project_id + " ").list(); return applications; } ``` ..which throws strange exception -.- org.hibernate.QueryException: could not resolve property: project_id of: `de..common.entities.Application [from de..common.entities.Application a where a.project_id=1 ]` --- A little help for a hibernate beginner would be great :-) Cheers..
Hibernate retrieving list from onetomany
CC BY-SA 2.5
null
2010-09-08T11:33:21.190
2018-10-25T19:58:29.590
2010-09-09T06:18:00.223
70,604
389,430
[ "java", "hibernate", "orm", "hql" ]
3,668,123
1
3,670,079
null
1
5,882
I have a `CheckedListBox` that has X number of items. These items are placed there at runtime. These items are supposed to represent reports that can be displayed in the `DataGridView`. What I need to do now is display the record count for each report in parenthesis right next to the report name. I tried, not for too long, to edit the actual name of the item but couldn't find out how to do it. So then, I brute forced it. Saved the items to an array, cleared the items, appended the record counts to each item in the array, created new items. Well, this has caused issues because now it's not retaining my checks and the reason why is because whenever I generate the reports, I clear the items and recreate them. Well, rather than doing another `foreach` loop to save the checked status, does anyone know of a way to change the text of existing items in a `CheckedListBox`? Here is the code I currently have: In the MainForm.Designer.cs: ``` this.clbReports.Items.AddRange(new object[] { "Report 1", "Report 2", "Report 3", "Report 4", "Report 5", "Report 6", "Report 7", "Report 8", "Report 9", "Report 10", "Report 11"}); ``` And it looks like: ![alt text](https://i.stack.imgur.com/A1KGq.png) And I want it to look like (but there won't all be 0's): ![alt text](https://i.stack.imgur.com/bLpDT.png) Here is the SelectedIndexChanged function: ``` private void clbReports_SelectedIndexChanged(object sender, EventArgs e) { string strCheckBox = clbReports.SelectedItem.ToString(); bool bShowAllIsChecked = clbReports.GetItemChecked(clbReports.FindString("Show All Error Reports")); bool bSelected = clbReports.GetItemChecked(clbReports.FindString(strCheckBox)); int nIndex = -1; if (strCheckBox.Contains("Show All Error Reports")) { foreach (string str in _strReports) { if (!str.Contains("Show All Error Reports") && !str.Contains("Show Tagged Records")) { nIndex = clbReports.FindString(str); if (nIndex > -1) { clbReports.SetItemChecked(nIndex, bSelected); } } } } else { if (strCheckBox.Contains("Show All Error Reports") || bShowAllIsChecked) { foreach (string str in _strReports) { nIndex = clbReports.FindString(str); if (nIndex > -1) { clbReports.SetItemChecked(nIndex, false); } } } nIndex = clbReports.FindString(strCheckBox); if (nIndex > -1) { clbReports.SetItemChecked(nIndex, bShowAllIsChecked ? true : bSelected); } } string[] strCheckedItems = new string[clbReports.CheckedItems.Count]; clbReports.CheckedItems.CopyTo(strCheckedItems, 0); List<string> checkBoxReportFilter = new List<string>(); foreach (ReportRecord obj in this._lstReportRecords) { foreach (string str in strCheckedItems) { if (str.Contains(obj.Description)) { checkBoxReportFilter.Add(obj.PartID.ToString()); } } } try { if (checkBoxReportFilter.Count == 0 && clbReports.CheckedItems.Count > 0) { throw new NullReferenceException(); } _strReportFilter = String.Join(",", checkBoxReportFilter.ToArray()); } catch (NullReferenceException) { _strReportFilter = "-1"; } generateReport(); } ``` And here is the code where I am clearing the items, getting the report counts and creating the new items. ``` _lstReportRecords = _dataController.ReportList; bool[] bChecked = new bool[clbReports.Items.Count]; int nCounter = 0; foreach (string str in _strReports) { foreach (string str2 in clbReports.SelectedItems) { bChecked[nCounter] = str2.Contains(str); } nCounter++; } clbReports.Items.Clear(); nCounter = 0; foreach (string str in _strReports) { int nCount = _lstReportRecords.Where<ReportRecord>(delegate(ReportRecord rr) { return rr.Description == str; }).Count(); string newReport = str + " (" + nCount + ")"; clbReports.Items.Add(newReport); clbReports.SetItemChecked(nCounter, bChecked[nCounter]); nCounter++; } ``` Please tell me there is an easier way to do this. I tried doing foreach loops through the clbReports.Items but it wants me to cast it to a string (errored on me when trying to cast to a CheckBox) so I couldn't change the value. And even if I could cast it to a CheckBox, I have a feeling it will give me the error that Enumeration has failed because the list has been changed (or however they word it). Any and all help is welcome. Thanks. Please know that the Report X are just so that the actual report names aren't displayed to keep it generic. However, in the code, I just copied and pasted so the Show All Error Reports and Show All Tagged Records are reports I need to check.
How do I edit the name of an item in a CheckedListBox?
CC BY-SA 2.5
null
2010-09-08T13:19:48.343
2017-04-13T10:43:57.170
2010-09-08T15:06:17.090
76,337
419,603
[ "c#", "winforms", "checkedlistbox" ]
3,668,341
1
null
null
1
5,533
In , `tb.HorizontalContentAlignment = HorizontalAlignment.Center` : ![alt text](https://i.stack.imgur.com/zfSIZ.png) ``` <Window x:Class="TestText2343434.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <StackPanel x:Name="MainContent" Margin="10" HorizontalAlignment="Left"/> </Grid> </Window> ``` ``` using System.Windows; using System.Windows.Controls; namespace TestText2343434 { public partial class Window1 : Window { public Window1() { InitializeComponent(); TextBox tb = new TextBox(); tb.Width = 30; tb.MaxLength = 1; tb.HorizontalContentAlignment = HorizontalAlignment.Center; MainContent.Children.Add(tb); } } } ``` In Silverlight, `tb.HorizontalContentAlignment = HorizontalAlignment.Center` : ![alt text](https://i.stack.imgur.com/s9b6a.png) ``` <UserControl x:Class="TestContent222.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"> <Grid x:Name="LayoutRoot"> <StackPanel x:Name="MainContent" Margin="10" HorizontalAlignment="Left"/> </Grid> </UserControl> ``` ``` using System.Windows; using System.Windows.Controls; namespace TestContent222 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); TextBox tb = new TextBox(); tb.Width = 30; tb.MaxLength = 1; tb.HorizontalContentAlignment = HorizontalAlignment.Center; MainContent.Children.Add(tb); } } } ``` What do I have to do to make `HorizontalContentAlignment` work in Silverlight as it does in WPF?
Why doesn't HorizontalContentAlignment work in Silverlight as it does in WPF?
CC BY-SA 3.0
0
2010-09-08T13:47:05.187
2016-01-21T15:16:07.117
2016-01-21T15:16:07.117
201,078
4,639
[ "silverlight", "textbox", "centering" ]
3,668,359
1
3,681,645
null
1
1,629
I'm trying to produce a shader to replicate a white plastic object with a colored light inside. Either by having a shader that will be translucent and if I put a light inside the object the light will show through or by having a shader that fakes the effect of a light inside. The effect im going for is kinda like a light going through a lamp shade similar to these pictures: ![alt text](https://i.stack.imgur.com/FPyzF.jpg) ![alt text](https://i.stack.imgur.com/YAPyT.jpg) ![alt text](https://i.stack.imgur.com/uknxS.jpg) Ideally I would be able to control the strength and colour of the light to get it to pulse and rotate through some nice bright fluro colours Though I'm not sure where to start! My question is does anyone know the techniques I should be researching to be able to produce such a shader or have an example of the same/similar shader I can use as a starting point? Or even if you want to provide a shader that might do the job
HLSL Translucent Plastic Shader
CC BY-SA 2.5
0
2010-09-08T13:48:41.250
2022-02-20T19:35:19.070
2010-09-09T10:34:10.633
298,745
298,745
[ "graphics", "3d", "shader", "hlsl", "pixel-shader" ]
3,669,582
1
3,677,809
null
0
1,646
I have a UserControl that contains a DropDownList and an ObjectDataSource. That control is used in the markup of my MasterPage. In the Designer of a ContentPage that uses that MasterPage I can see the DropDownList and the ObjectDataSource. See for yourself. ![alt text](https://i.stack.imgur.com/HWCYM.png) I know that other controls (like ComponentArt:Grid) only show themself as outer container and hide the inner controls. I guess that is somehow achievable with attributes. Which ones do I have to set?
How to hide the inner controls of a UserControl in the Designer?
CC BY-SA 2.5
null
2010-09-08T15:54:56.793
2014-05-15T07:41:10.770
null
null
225,808
[ "c#", "asp.net", "user-controls" ]
3,669,784
1
3,669,865
null
1
163
I have the following RegularExpressionValidator on one of my pages: ``` <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ControlToValidate="InKindTextBox" ErrorMessage="The value entered for 'Cash' must be in a number format. Examples: 500.00, 500, $500, $50,000 or $500.00" ValidationExpression="(?n:(^\$?(?!0,?\d)\d{1,3}(?=(?<1>,)|(?<1>))(\k<1>\d{3})*(\.\d\d)?)$)" > ``` But when it tries to validate it throws the error below from one of my dynamic JS pages. ![alt text](https://i.stack.imgur.com/QiBew.png) When I run this regex through [regex texter](http://regexlib.com/RETester.aspx) it works fine. Am i doing something wrong here?
Validator throwing error
CC BY-SA 2.5
0
2010-09-08T16:17:59.523
2010-09-08T19:19:24.253
2010-09-08T17:26:13.340
226,897
226,897
[ "asp.net", "regex", "validation" ]
3,669,874
1
3,669,927
null
1
2,468
I have an image and text beside it with this code. A sample can be seen [here](http://uploadpic.org/view-pic.php?img=92579): ![alt text](https://i.stack.imgur.com/L53j2.png) The problem is that the text is starting from the center of the image (on the right side) whereas i want the text to start from the top right-hand side of the image. Here is my code: ``` <table width="550"> <tr> <td> <div id="i1"> <img src="<? echo $row_array[3];?>" height="225" width="225"> </div> </td> <td> <div id="i2"> <span style="position: relative; top: 0px; left: 0px;"> <? echo $row_array[4];?> </span> </div> </td> </tr> <tr></tr> <?} ?> </table> ``` I have even tried to remove span but it still shows the same way. i1 in css: `margin-left:0px;` i2 in css: `#i2 { display: inline; margin: 0px 0px 0px 0px; padding:0px 0px 0px 0px; }`
position text on top just beside the image in html
CC BY-SA 2.5
null
2010-09-08T16:29:23.680
2010-09-08T16:35:57.987
2010-09-08T16:32:13.797
82,548
370,657
[ "html", "css", "image" ]
3,670,114
1
3,671,820
null
9
866
Wondering if anyone knows if the feature to allow add-in's for Visual Studio 2010 xml comment viewer was cut in the final release?? What I am talking about specifically is this: ![alt text](https://i.stack.imgur.com/ZlHxO.gif) I took this image from this page on MSDN ([http://msdn.microsoft.com/en-us/magazine/dd722812.aspx](http://msdn.microsoft.com/en-us/magazine/dd722812.aspx)) I can't seem to find even one addin with this functionality, anyone know? Thanks, Jeff Lundstrom
XML Comment Viewer Add-in for Visual Studion 2010?
CC BY-SA 2.5
0
2010-09-08T17:00:11.187
2012-09-06T12:44:13.630
2011-12-21T04:11:04.820
3,043
177,312
[ "visual-studio-2010", "comments", "add-in" ]
3,670,353
1
null
null
2
2,129
Can someone tell me how to achieve iBooks Library turning effect.(Not the pages). Could that be achieved via Core Animation perhaps? ![enter image description here](https://i.stack.imgur.com/erhfK.png)
iBooks library like effect
CC BY-SA 3.0
0
2010-09-08T17:28:19.997
2012-01-24T10:34:14.073
2012-01-24T10:34:14.073
401,137
442,680
[ "ios", "ibooks" ]
3,671,040
1
null
null
0
195
I want to do something like ![alt text](https://i.stack.imgur.com/5AA1N.jpg) This is screenshot of google transliterator that can be found [here](http://www.google.com/transliterate/). In this application user writes in Roman script and when he/she presses space an ajax request goes to server bringing back list of words. Roman word is then replaced by word top in the result list (Urdu result list in my case). Now when I continue typing and after sometime i come back and see that a word is not like I intended to write. I click on that word and a context menu would open like shown in the figure, but the important thing is that this time no ajax request goes to the server rather Google picks the result somewhere stored in client area (browser). My question is how can I cache ajax result on client side and second thing is how I can associate each result with each word in text area or rich text box using a context menu or similar interface. I want to accomplish similar functionality in asp.net mvc2.
Caching ajax result on client side in asp.net mvc2
CC BY-SA 4.0
null
2010-09-08T19:00:13.390
2018-05-18T07:52:03.287
2018-05-18T07:52:03.287
472,495
331,174
[ "user-interface", "asp.net-mvc-2", "asp.net-ajax", "jquery" ]
3,671,069
1
3,671,920
null
0
532
I'm using a XML ([click here to see](http://gist.github.com/570591)) with to render this: ![alt text](https://i.stack.imgur.com/DMUrx.jpg) which `Menu Principal` is the first level, then `Home` and `Quem Somos`, then the dropdown is the third and last level. I want this last list to be dynamic (querying from the database). I found out that I can use the method `addPages($array)` in order to dynamically render the navigation. So I thought of querying the database for the page titles then pushing them out as arrays then use `addPages()` method. I just don't know how to add pages from an existing level of the navigation. I know how to retrieve the array I want to add, but how do I add it as `Quem Somos`'s list?
How to add a page inside some levels using Zend_Navigation?
CC BY-SA 2.5
null
2010-09-08T19:05:13.350
2010-09-08T21:08:37.117
2020-06-20T09:12:55.060
-1
336,945
[ "arrays", "zend-framework", "zend-navigation" ]
3,671,532
1
3,673,902
null
1
943
I have been working on extracting the peak values from a graph [(see previous question)](https://stackoverflow.com/questions/3495892/how-can-i-extract-peak-values-from-auto-correlated-data-in-matlab) which looks like this: ![alt text](https://i.stack.imgur.com/Ch1PE.png) but I have noticed that for some of the xcorr graphs I have been working on the values do not turn out as expected and they normally turn out looking more like this: ![alt text](https://i.stack.imgur.com/o4cou.jpg) and this: [](https://i.stack.imgur.com/UnkJA.jpg) Instead of trying to pick the peak values like the code was doing in the first figure, how would I go about trying to pick the values where the downward slope momentarily evens itself out (as shown in Figure 3)? When I try and run the code in its current state on data like the ones shown in Figure 2 & 3, I do not get any useful data back in return. I think I need an if statement or similar in the 'find extrema points' section but I'm not sure whether that is correct or not. My .M code for the function looks like this so far: ``` [inputname, pathname] = uigetfile('*.wav', 'Select WAV-file'); thumb1 = inputname; %# Get filename information fprintf('\n%s is being turned into a 30s thumbnail...\n', thumb1); fprintf('Please wait..!\n\n'); %# load the signal [y, fs, nb] = wavread(thumb1); y = mean(y,2); %# stereo, take avrg of 2 channels %# Calculate frame energy fWidth = round(fs*1); %# 10ms numFrames = floor(length(y)/fWidth); energy = zeros(1,numFrames); for f=1:numFrames energy(f) = sum( y((f-1)*fWidth+1:f*fWidth).^2 ); end %# smooth the signal (moving average with window size = 1% * length of data) WINDOW_SIZE = round(length(energy) * 0.01); %# 200 XX = filtfilt(ones(1,WINDOW_SIZE)/WINDOW_SIZE, 1, energy); %# auto-correlation [r,lags] = xcorr(XX, 'biased'); %# find extrema points dr = diff(r); eIdx = find(dr(1:end-1) .* dr(2:end) <= 0) + 1; [~,loc] = sort(r(eIdx), 'descend'); loc = loc(1:min(3,end)); %# take the highest 3 values inf=lags( eIdx(loc) ); thumb=max(inf); startrecord=round((thumb/1)*fs); endrecord=round(((thumb+30)/1)*fs); wavwrite(y(startrecord:endrecord), fs, nb, 'Temp1'); fprintf('The thumbnail of %s has been created.\n\n', thumb1); ``` Sorry that it all looks so messy, but I wanted to get some visual examples in!
How to extract specific values from auto-correlated data in MATLAB?
CC BY-SA 4.0
null
2010-09-08T20:14:47.793
2019-08-06T21:06:51.070
2019-08-06T21:06:51.070
4,751,173
372,752
[ "matlab", "math", "audio", "correlation" ]
3,671,733
1
3,671,750
null
7
15,481
I have a normal `UITableViewCell` with custom colors, but how can i change the border? Currently it looks very ugly: ![Screenshot](https://i.stack.imgur.com/3bMdD.png) I only want a tiny little white border.
UITableViewCell set Border
CC BY-SA 3.0
null
2010-09-08T20:45:49.637
2012-05-20T13:38:37.460
2012-05-20T13:38:37.460
1,028,709
438,679
[ "iphone", "objective-c", "uitableview", "ios" ]
3,671,817
1
3,671,881
null
3
624
I have a simple (hopefully) scenario. - - - I have a strongly typed "Edit" view for "Seats". I have managed to get a multi select list on that page in order to assign or unassign computers (jquery to add/remove items). However, when I submit the form, the contents of select list are not posted to the controller action. I assume this is because "computers" select list is not a model property. Is there anyway to POST the additional data to the controller outside of model's properties? My tables look something like this: ![alt text](https://i.stack.imgur.com/xELOw.gif)
Strongly Typed Views - post additional data via edit/create form
CC BY-SA 2.5
null
2010-09-08T20:53:47.840
2010-09-08T21:02:26.607
2010-09-08T20:59:00.737
16,522
16,522
[ "asp.net-mvc", "asp.net-mvc-2" ]
3,672,134
1
3,673,944
null
1
828
![alt text](https://i.stack.imgur.com/9WHE3.png) Hi, Although I have a lot of experience in database development, I'm having a hard time conceptualizing linking relationships in Core Data. As I understand it, the many relationship is an NSSet attached to the one file. After reading the documentation, I've understood part of it and gotten it to work in the first import in my code below. I have a data model into which I perform two separate imports using the XMLParser. The first import loads Events and Categories from the same XML file within the same import like so: ``` if (thisTagIsForOneTable) { // Insert object for the one-entity (Events) self.eventsObject = [NSEntityDescription insertNewObjectForEntityForName:@"Events" inManagedObjectContext:xmlManagedObjectContext]; return; } if (thisTagIsForManyTable) { // Insert object for many-entity (EventCategories) self.categoriesObject = [NSEntityDescription insertNewObjectForEntityForName:@"EventCategories" inManagedObjectContext:xmlManagedObjectContext]; return; } ...... // Set attribute values depending upon whether the tag is for the one-entity or the many-entity. [self.xxxObject setValue:trimmedString forKey:attributeName]; ...... // Set the relationship. This works great! if (thisTagIsForManyTable) { NSMutableSet *manyRecordSet = [self.eventsObject mutableSetValueForKey:@"categories"]; // My relationship name. [manyRecordSet addObject:self.categoriesObject]; } // Save the context. Voila. ``` The above works fine. The second import loads EventLocations separately in a different part of the application so I need to set it's to-one relationship to Events. This is where I'm not too sure. Should the steps be? ``` // Step A) Create (insert) new EventLocations object. self.eventLocationsObject = [NSEntityDescription insertNewObjectForEntityForName:@"EventLocations" inManagedObjectContext:xmlManagedObjectContext]; // Step B) Locate and get a reference to the the related one-entity's object (Events) by ID? I have a custom class for Events. // This seems to work but I'm taking a performance hit and getting a compiler warning below. The method returnObjectForEntity does a query and returns an NSManagedObject. Is this correct? Events *event = (Events *)[self returnObjectForEntity:@"Events" withID:[oneRecordObject valueForKey:@"infIDCode"]]; // Step C) Set the relationship to the Events entity. if (event) { [event addLocationsObject:self.eventLocationsObject]; // Compiler warning: incompatible Objective-C types 'struct NSManagedObject *', expected 'struct EventLocations *' when passing argument 1 of 'addLocationsObject:' from distinct Objective-C type } // Save the context. ``` I'm not too sure about steps B and C. Any help would be appreciated. Thanks.
add<Key>Object vs insertNewObjectForEntityForName Core Data Relationships
CC BY-SA 2.5
null
2010-09-08T21:41:30.640
2010-09-09T05:13:23.590
null
null
289,667
[ "core-data", "import", "entity-relationship", "one-to-many", "key-value-coding" ]
3,672,258
1
3,784,949
null
11
9,870
When you clear the box on the new WPF 4.0 DatePicker control it shows "Select a date" ![alt text](https://i.stack.imgur.com/ZqYHr.jpg)
How to localize the WPF 4.0 DatePicker control
CC BY-SA 2.5
0
2010-09-08T22:07:33.430
2015-06-04T14:16:12.977
2010-09-09T14:37:31.227
2,385
2,385
[ "wpf", "localization", "wpf-controls", "datepicker" ]
3,672,422
1
3,678,656
null
1
1,613
I'm using Zend_Form with a registration page. I have a checkbox, that if checked, will show additional billing fields. In my form instance, I only want those extra fields to be setRequired(true) if that checkbox is checked. Is there a way to do this? The problem now is I have to set all the billing fields as setRequired(false), but if the user checks the checkbox, the logic won't care if the fields are empty because they aren't required. ![alt text](https://i.stack.imgur.com/6O1OZ.png)
zend_form set fields required only if checkbox is checked
CC BY-SA 2.5
0
2010-09-08T22:37:25.440
2012-06-05T08:06:38.350
null
null
284,630
[ "validation", "zend-form" ]
3,672,803
1
3,688,953
null
5
822
I am looking for a property in a font file (either from WPF's `System.Windows.Media.Fonts` `Typeface` or `GlyphTypeface`) or directly accessing the .ttf/.otf file that will allow me to determine if a program like Write/WordPad in Windows will apply Bold to the font. Basically, some fonts that have the Bold attribute will still get an extra boldness applied to them and some won't. I'm trying to discover what the logic is that is used to make this determination. To manually see this, copy and the paste the following into Write/WordPad (or OOo's Writer or MS Word or...) and change each line's font face to it's name (i.e. apply Arial Black to Arial Black) 1. Arial Black 2. Arial Rounded MT Bold 3. Arial Narrow Now apply bold to them. You'll see #2 and #3 change, but not #1. > With #3 though, something different is happening than the other two - a different font all together is being applied. Namely ('NB' appended, which is ) in place of ('N' appended, which is ). So in the case of this font, bold is not actually being applied. Back to the list. #1 doesn't change, but #2 does. #1's weight is "Black" and #2's is "Bold". If you were to take the Bold version of #3, , and apply bold to it, it would act like #1 - it wouldn't change. But it has the same weight as #2, that of "Bold". In other words, two are bold (Arial Rounded MT Bold and Arrow Narrow Bold), but only Arial Rounded MT Bold gets more bold applied. In the case of Arial Black, it doesn't have a Bold weight, but it still doesn't have a bold applied to it either. Here's what it looks like: ![alt text](https://i.stack.imgur.com/AMKue.png) Interestingly, WPF doesn't exhibit this behavior (i.e adding more bold), but Silverlight does: ### WPF (Note the FontFamily is "Arial Rounded MT"): ``` <StackPanel Orientation="Vertical"> <TextBlock FontSize="24" Text="Arial Rounded MT Bold" FontFamily="Arial Rounded MT"/> <TextBlock FontSize="24" Text="Arial Rounded MT Bold" FontWeight="Black" FontFamily="Arial Rounded MT"/> </StackPanel> ``` ### Silverlight (Note the FontFamily is "Arial Rounded MT Bold"): ``` <StackPanel Orientation="Vertical"> <TextBlock FontSize="24" FontFamily="Arial Rounded MT Bold" >Arial Rounded MT Bold</TextBlock> <TextBlock FontSize="24" FontFamily="Arial Rounded MT Bold" FontWeight="Bold" >Arial Rounded MT Bold</TextBlock> </StackPanel> ``` The question comes back to: I'm seeking a flag or a property within the font file that will tell me this logic. Here's a list of other fonts where applying "Bold" has no effect:
What property in a font file makes a program decide to simulate bold?
CC BY-SA 2.5
null
2010-09-08T23:53:06.277
2010-09-11T15:17:44.253
2010-09-09T05:39:16.680
149,573
149,573
[ ".net", "wpf", "fonts" ]
3,672,886
1
null
null
1
3,386
I'm using a jqGrid and a horizontal scrollbar appears. How can I stop this from happening? ![jqGrid with scrollbar](https://i.stack.imgur.com/NwMyP.png)
How do I prevent a scroll bar from displaying in jqGrid?
CC BY-SA 2.5
0
2010-09-09T00:12:47.547
2013-11-29T11:09:37.187
null
null
80,282
[ "jquery", "jqgrid" ]
3,673,008
1
3,674,036
null
2
11,020
I am having problem with download my android application from my own web server. First I sent a html content with java script to ask Android phone to open my download link ``` <html> <head> <script> window.onload=function() {{ window.location = "downloadURL"; }} </script> </head> </html>" ``` Android phone revice this java script will open the downloadURL On my server end, I am using .Net ASP I've set up the MIME content ``` Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.ContentType = "application/vnd.android.package-archive"; Response.AppendHeader("Content-Disposition", "attachment; filename=" + "MyApp.apk"); Response.AppendHeader("Content-Length", "" + response.Application.Bytes.Length); Response.BinaryWrite(response.Application.Bytes); ``` The apk file which is MyApp.apk is about 1.5MB How ever, when I used Android emulator to download the app, the file size is only 4.25 KB, and the name is not MyApp.apk. It contains the name of my download link. ![alt text](https://i.stack.imgur.com/7pxYn.jpg) When I use Firefox to download my app, Firefox successfully download it with correct name and size. ![alt text](https://i.stack.imgur.com/bgxPC.jpg) Please help me out!! Thanks When I debug my server, my server did sent out the application bytes with ``` Response.BinaryWrite(response.Application.Bytes); ``` I don't understand why, andorid emulator can not receive, intead it seems create its own apk file from the html content.
download apk from own Webserver
CC BY-SA 2.5
null
2010-09-09T00:44:22.413
2012-07-12T13:16:09.077
2010-09-09T03:21:49.107
399,820
399,820
[ "android" ]
3,673,189
1
null
null
1
74
I get a leak on the code below, any idea why? I am not allocating anything so why does it leak? It leaks 32 bytes ``` NSString *username = @""; NSString *myString = @"some text"; NSRange range = [myString rangeOfString:@"username="]; //instrument shows a leak on the line below username = [myString substringToIndex:range.location + range.length]; //I never release username or myString ``` ![alt text](https://i.stack.imgur.com/2KgEz.png)
iPhone - Why do I get a leak?
CC BY-SA 2.5
0
2010-09-09T01:36:18.573
2010-09-09T11:25:08.930
2010-09-09T02:16:58.227
242,769
242,769
[ "iphone", "memory-management", "memory-leaks" ]
3,673,268
1
3,673,821
null
2
2,014
I'm now in problem about how to function in jQuery to expand proportionally. Normally, it expand one-sided only just like expand to bottom or expand to right. What I want is to expand proportionally left-right-top-bottom by using animate. ![alt text](https://i.stack.imgur.com/UQZ5W.jpg) Following is my coding. What I said above, it expand to bottom only. ``` $(document).ready(function() { var theFrame = $("#FrmPatient", parent.document.body); theFrame.animate({width: 650, height: 485}, 1000); }); ```
jQuery animate expand proportionally
CC BY-SA 2.5
null
2010-09-09T01:55:38.383
2011-10-05T20:02:01.810
null
null
2,555,911
[ "javascript", "jquery" ]
3,673,279
1
3,673,314
null
4
6,885
I have a `TextBox` in my form and I added this event on it: ``` private void txtValue_KeyDown(object sender, KeyEventArgs e) { MessageBox.Show(e.KeyData.ToString()); } ``` But it always prints the upper case of the letter even though I entered a lower case letter in the textBox. Please see image below: ![my form](https://i.stack.imgur.com/nkzHy.jpg) How should I get the right display? Thanks...
Always in upper case... (C# winforms)
CC BY-SA 2.5
null
2010-09-09T01:59:14.440
2010-09-09T02:49:59.020
2010-09-09T02:49:59.020
33,225
396,335
[ "c#", "key-events" ]
3,674,272
1
5,546,606
null
2
3,460
I'm developing a site with jQTouch, but it doesn't have style for a search bar. Has someone come across a library or css for the iPhone search bar like the image below? ![alt text](https://i.stack.imgur.com/AZKeB.png)
Does anyone know where I can find iPhone search bar style?
CC BY-SA 2.5
0
2010-09-09T06:27:22.773
2011-04-05T02:39:34.633
null
null
404,033
[ "iphone", "css", "uisearchbar", "jqtouch", "searchbar" ]
3,674,352
1
3,675,100
null
0
887
![alt text](https://i.stack.imgur.com/6omYg.png) In the figure, what you see in "red" is another view that slides up once you click the first + button. This "red" view does not have a separate view controller. On every "+" button click, I want this view to slide up with a different element embedded in it. For instance, on the first "+" button click , I would like this red view to slide up with a datepicker embedded in it. On second "+" button click, I would like this red view to slide up with a UIPicker View embedded in it. I have the elements: UIDatepicker and UIPicker prepared. I don't know when and where to embed them and what should be their frame size. I am initializing the "red" view in the viewDidLoad method viewDidLoad { ``` CGRect frame=CGRectMake(0, CGRectGetMaxY(self.view.bounds)-70, 320, 150); popup=[[UIView alloc]init]; popup.backgroundColor=[UIColor redColor]; [popup setFrame:frame]; ``` } and I am sliding it up in -(void) btnClick:(id)sender { frame=CGRectMake(0, 240, 320, 150); ``` [UIView beginAnimations:nil context:nil]; [popup setFrame:frame]; [UIView commitAnimations]; ``` }
UIView animation
CC BY-SA 2.5
0
2010-09-09T06:44:53.217
2010-09-09T11:44:15.677
2010-09-09T07:58:49.567
null
null
[ "iphone" ]
3,674,374
1
3,674,387
null
0
1,132
I raised a question about this a while ago but I'm still having an issue. I have a mysql5 database with a sales table that contains a timestamp to represent a sale. If a field in the sales table in amended or altered the timestamp updates to the current time (the time of the change). To prevent this I have unselected the on_update_select_current_timestamp option but still the timestamp changes? Here's how the field looks in phpmyadmin ![alt text](https://i.stack.imgur.com/bWOEK.jpg) Does anyone have any idea what I should do, unchecking the CURRENT_TIMESTAMP option seems to reset the on_update_select_current_timestamp trigger
mysql timestamp updates when record is amended
CC BY-SA 2.5
null
2010-09-09T06:49:46.337
2010-09-09T06:57:25.853
null
null
197,420
[ "php", "mysql", "phpmyadmin" ]
3,674,444
1
3,674,469
null
-1
152
I have the following markup: ``` <div class="ui-accordion ui-widget" style="margin: 10px 0px 12px 0px;"> <h3 class="ui-helper-reset ui-corner-top ui-accordion-header ui-state-default" style="height: 24px; font-weight: bold; padding: 5px 0px 0px 12px">Title</h3> <div class="ui-accordion-content-active ui-widget-content ui-corner-bottom accordionContent" style="height:150px; padding: 8px 12px;"> <ul> <li style="background-image:url('/_assets/images/image1.png');"> <%= Html.ActionLink("Link 1", "Index", "Home") %> </li> <li style="background-image:url(/_assets/images/image2.png);"> <%= Html.ActionLink("Link 2", "Index", "Home") %> </li> <li style="background-image:url(/_assets/images/image3.png);"> <%= Html.ActionLink("Link 3", "Index", "Appointment") %> </li> </ul> </div> </div> ``` that render the following box on Chrome (without the red rectangle) ![alt text](https://i.stack.imgur.com/eqRJU.png) I would like to add an hyperlink just in the place of the red rectangle. How can I do it? Please note that all the used styles are inline and the classes are all from jquery UI standard classes. I am not a designer and maybe this markup can be optimized. Any advice is welcomed... :) Thanks for helping!
Hyperlink on the baseline of a DIV
CC BY-SA 2.5
null
2010-09-09T07:03:57.917
2010-09-10T07:47:24.390
null
null
431,537
[ "html", "css", "jquery-ui" ]
3,674,510
1
3,675,228
null
1
2,793
I am developing one application in which i am getting an exception, and i know this one is the silly or small mistake which i am doing but your help may catch me out and make my day: ``` public class Demo extends Activity { Button btnDemo; Thread t; AlertDialog alertDialog; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.demo); btnDemo = (Button) findViewById(R.id.btnDemo); btnDemo.setOnClickListener(new OnClickListener() { public void onClick(final View v) { t=new Thread() { public void run() { tryDemo(); } }; t.start(); } }); } public void tryDemo() { try { int i = 5; if(i == 0 || i == 1) { Intent intent_success = new Intent(getApplicationContext(), Main_Activity.class); startActivity(intent_success); } else { alertDialog = new AlertDialog.Builder(getApplicationContext()).create(); alertDialog.setTitle("Demo"); alertDialog.setButton("OK", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { //here you can add functions } }); alertDialog.setIcon(R.drawable.icon); alertDialog.setMessage("Sorry!! Either Username or Password Invalid"); alertDialog.show(); } } catch(Exception e) { Log.i("Demo", "Demo - Demo Exception"); } } } ``` In above code, if i make i=0 or i=1 in tryDemo function then it is running successfully , but if i make it other than 0 or 1 then it . I am not sure but i think the exception raises from . The exception which i am getting, as follows: ![alt text](https://i.stack.imgur.com/1ggK5.png) If I remove the "thread" part and wrote the whole function code in the button click event and replaced the "getApplicationContext()" with v.getContext() then it is running successfully.........but i want to implement it within the THREAD. Please help me and catch me out... thanx
Android - Getting Exception
CC BY-SA 2.5
0
2010-09-09T07:16:49.790
2010-09-10T23:56:04.763
2010-09-09T09:49:33.153
379,693
379,693
[ "android", "exception", "try-catch", "android-context" ]
3,674,577
1
3,676,149
null
0
757
Yesterday I read something abouth application optimization and how a programmer should find the most used parts of the program and by profiling and modifying them getting the most benefit (when looking at the time/work invested vs. memory/speed gains). Now, I've run the Eclipse profiler, got VisualVM but I don't how to use this data properly. My primary concerns are memory usage (i'm generating an XML and either storing it to disk as a zip or flushing it as zip to the user for download) and slowdowns from the database (i'm suspecting my indexes aren't there or aren't good, and in any case, don't know much about them so I can't tell you more :) but I don't even know how to start this. For the first case VisalVM shows that the program uses up to 200MB, but when I inspect the Heap Dump and click the most used object (or how it's called), the information is overwhelming. For the second case I know even less, other than that Toad has some tools. What I want to know is how to start doing this, and when I'm satisfied with the local performance, how to do it on the production application. Edit1: So, for a concrete example of memory usage (i'm generating an XML and either storing it to disk as a zip or flushing it as zip to the user for download). This is what I get when I choose "Heap dump", then choose top 20 objects by retained size and open the details:![Heapdump screenshot](https://i.stack.imgur.com/lUSbb.jpg) and this is what I get when I opened Profiler on the same use case: ![alt text](https://i.stack.imgur.com/pQuRU.jpg) The question is, what do this screens tell me? :)
How should I start profiling/optimizing my java application/oracle database?
CC BY-SA 2.5
null
2010-09-09T07:29:30.880
2010-09-09T11:58:20.013
2010-09-09T11:58:20.013
348,389
348,389
[ "java", "oracle", "optimization", "toad", "visualvm" ]
3,675,041
1
3,682,399
null
1
1,664
Greetings all, This is going to be a long question,skip the [Background] if its not that neccasary ;) ] I am developing a modular QT based application.Application is extentible via QT based plugins. As shown in the figure, there are mainly 3 parts .(numbers in red) ![alt text](https://i.stack.imgur.com/FYnDE.png) 1) - the core of the application,which defines pluginterfaces,main UIS,interations..etc 2) - the applicatoin which implement some builtin plugins and main application execution. 3) - several plugins which implements Plugin interfaces in `libAppCore.dll` Here's how each components links each other: - libAppCore links QT libraries.- App.exe links libAppCore.DLL and QT libraries (App.exe uses someother QT Classes not being used my libAppCore.DLL)- Plugins (libAppQTPluginA.DLL , libAppQTPluginB.DLL ) - link libAppCore.DLL and QT libs. libAppQTPluginA.DLL - links OpenGL libAppQTPluginB.DLL - links VTK libraries Everything compiles fine and I have only problem wihen executing the PluginB , which uses VTK libraries. During executing PluginB , it creates a QWidget which set as central widget in a QMainWindow.(there can be many QMainWindow's at once) Inside this QWidget I create a QVTWidget and create a dummy sphere as follows, QVTKWidget qtWidget = new QVTKWidget(this); qtWidget->resize(512, 512); vtkSmartPointer sphereSource = vtkSmartPointer::New(); sphereSource->Update(); vtkSmartPointer sphereMapper = vtkSmartPointer::New(); sphereMapper->SetInputConnection(sphereSource->GetOutputPort()); vtkSmartPointer sphereActor = vtkSmartPointer::New(); sphereActor->SetMapper(sphereMapper); // VTK Renderer vtkSmartPointer leftRenderer =vtkSmartPointer::New(); leftRenderer->AddActor(sphereActor); qtWidget->GetRenderWindow()->AddRenderer(leftRenderer); QVBoxLayout *vboxLayout = new QVBoxLayout; vboxLayout->addWidget(qtWidget); setLayout(vboxLayout); During execution QT warns about multiple threads ,but I never create any new threads nor VTK (AFAIK). ``` QObject: Cannot create children for a parent that is in a different thread.(Parent is QObject(0xdbe0d70), parent's thread is QThread(0x3370f8), current thread is QThread(0xdc427f8) ``` (But when I comment out the line vboxLayout->addWidget(qtWidget); this disappears. ) And when I perforce any operation on QVTKWidget ,application crash .Error log is ``` > Program received signal SIGSEGV, > Segmentation fault. 0x01024c41 in > QRegion::isEmpty (this=0x28d480) at > painting\qregion.cpp:3975 3975 > painting\qregion.cpp: No such file or > directory. > in painting\qregion.cpp (gdb) back > #0 0x01024c41 in QRegion::isEmpty (this=0x28d480) > at painting\qregion.cpp:3975 > #1 0x00f0f18a in QWidgetPrivate::childAt_helper > (this=0xf3957a0, p=..., > ignoreChildrenInDestructor=false) at kernel\qwidget.cpp:9641 > #2 0x00f0f109 in QWidgetPrivate::childAt_helper > (this=0xb3c8218, p=..., > ignoreChildrenInDestructor=false) at kernel\qwidget.cpp:9636 > #3 0x00f0ef9e in QWidget::childAt (this=0x3be0b0, p=...) > at kernel\qwidget.cpp:9600 > #4 0x00f27bb6 in QETWidget::translateMouseEvent > (this=0xf3701e8, msg=...) > at kernel\qapplication_win.cpp:3114 > #5 0x00f234db in QtWndProc@16 (hwnd=0x70af4, message=513, wParam=1, > lParam=14090539) at kernel\qapplication_win.cpp:1629 > #6 0x767a6238 in USER32!IsDialogMessageW () from > C:\Windows\syswow64\user32.dll > #7 0x00070af4 in ?? () warning: (Internal error: pc 0x200 in read in > psymtab, but not in symtab.) > > warning: (Internal error: pc 0x200 in > read in psymtab, but not in symtab.) > > #8 0x00000201 in ?? (warning: (Internal error: pc 0x200 in read in > psymtab, but not in symtab.) ``` Any tips ? Why it compains about multiple thread at the first time?
QT Plugin , VTK QT Widget , Multi-thread and Linking question?
CC BY-SA 2.5
null
2010-09-09T08:44:08.730
2010-09-10T05:22:31.647
null
null
180,904
[ "c++", "qt4", "linker", "vtk" ]
3,675,135
1
3,675,485
null
40
56,622
How would you structure the below page in Codeigniter? ![alt text](https://i.stack.imgur.com/7vHtF.png) I thought about creating seperate controllers for each section 1. Left nav 2. Content nav 3. Login name 4. Leaderboard Excluding the content section (as this changes depending on the link on the left nav and content nav used as a kinda sub-menu). All the other sections remain roughly the same I thought about doing: ``` Class User_Profile extends Controller { function index() { $this->load_controller('Left_Nav'); $this->load_controller('Content_Nav'); $this->load_controller('Login_Name'); $this->load_controller('Leaderboard', 'Board'); $this->Left_Nav->index(array('highlight_selected_page' => 'blah')); $this->load('User'); $content_data = $this->User->get_profile_details(); $this->view->load('content', $content_data); $this->Login_Name->index(); $this->Board->index(); } } ``` Obviously this `load_controller` does not exist but this functionaility would be useful. The controller for each section gets the data required from the model and then loads the page through `$this->view->load()` It could be a headache to have this code in all the left nav links like News, Users, About Us, etc.. But then again not every nav link has all those sections so I need that flexability of having the sections as a "partial view" Can anyone suggest a better way of doing this?
Codeigniter: Best way to structure partial views
CC BY-SA 2.5
0
2010-09-09T08:58:59.427
2014-09-04T11:48:39.653
null
null
63,523
[ "php", "design-patterns", "codeigniter" ]
3,675,195
1
null
null
11
22,697
![alt text](https://i.stack.imgur.com/PaiPc.png) Hi friends, I am using `GridView` inside a `ScrollView` for displaying images. In the GridView I have 16 images which were dynamically added, but the `ScrollView` does not display all 16 images (see screenshot). I want the `ScrollView` to display the whole `GridView`, does anybody know how I can fix this? Thanks all. ``` <?xml version="1.0" encoding="utf-8"?> <merge android:layout_width="wrap_content" android:layout_height="340dip" xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:id="@+id/LinearLayout01" android:layout_width="fill_parent" android:layout_height="320dip" android:orientation="vertical" android:background="@color/black"> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/scrollview" android:layout_width="fill_parent" android:layout_height="500dip" android:background="#ffffff" android:paddingTop="10dip" android:paddingLeft="5dip" android:layout_weight="1"> <GridView android:id="@+id/jr_lookbook_grid" android:layout_width="fill_parent" android:layout_height="fill_parent" android:numColumns="4" android:verticalSpacing="10dp" android:horizontalSpacing="10dp" android:columnWidth="90dp" android:stretchMode="columnWidth" android:adjustViewBounds="true" android:background="@drawable/shape" android:gravity="center" android:layout_weight="1"/> </ScrollView> <Button android:id="@+id/click" android:background="@android:color/transparent" android:text="Load More Pictures..." android:textColor="@color/white" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerVertical="true" /> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/LinearLayout02_img" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_gravity="center" android:layout_alignParentBottom="true" android:background="@color/black" android:layout_alignParentLeft="true"> <WebView android:id="@+id/webview" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="none" /> <ImageView android:id="@+id/ImageView01" android:layout_gravity="center_horizontal" android:scaleType="centerInside" android:layout_width="wrap_content" android:layout_height="fill_parent" android:adjustViewBounds="true"> </ImageView> </LinearLayout> <LinearLayout android:id="@+id/LinearLayout02" android:background="#AA000000" android:layout_width="400px" android:layout_height="50dip" android:layout_gravity="bottom" > <Button android:id="@+id/back" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/back1" android:layout_alignParentRight="true" android:layout_marginLeft="10dip" /> <Button android:background="@drawable/forward5" android:id="@+id/next" android:layout_width="wrap_content" android:layout_height="wrap_content" android:gravity="center" android:layout_alignParentRight="true" android:layout_marginLeft="215dip" /> </LinearLayout> </merge> ```
How to increase ScrollView height in Android?
CC BY-SA 3.0
0
2010-09-09T09:07:32.457
2017-12-13T02:13:05.917
2014-02-28T15:05:37.847
1,542,891
410,757
[ "android", "scrollview" ]
3,675,246
1
3,675,384
null
2
3,026
I'm using XSL-FO with Apache FOP to take a sexy looking XML file and output it as a PDF, however I'm having a really basic problem trying to get a particular bit of information (the address) to be positioned from the right of the page, I can force it over to the right by increasing the `left` attribute, but if I change my page size, orientation or margins this will immediately be useless. Below is the code for the XSL, note the comment on line 23. ``` <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" version="1.0"> <xsl:template match="/"> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="all-pages" page-height="297mm" page-width="210mm" margin-top="1cm" margin-bottom="1cm" margin-left="1cm" margin-right="1cm" > <fo:region-body margin-top="5cm" margin-bottom="1.1cm"/> <fo:region-before extent="1cm"/> <fo:region-after extent="5mm"/> </fo:simple-page-master> <fo:page-sequence-master master-name="default-sequence"> <fo:repeatable-page-master-reference master-reference="all-pages"/> </fo:page-sequence-master> </fo:layout-master-set> <fo:page-sequence master-reference="default-sequence"> <fo:static-content flow-name="xsl-region-before" font-size="10pt" font-family="Helvetica" > <!-- HERE'S MY PROBLEM, THE RIGHT ATTRIBUTE ISN'T BEHAVING ITSELF --> <fo:block-container absolute-position="absolute" right="4cm" top="1cm" width="6cm" border-style="solid" border-width="1mm" > <fo:list-block > <fo:list-item> <fo:list-item-label> <fo:block></fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block>ABC</fo:block> </fo:list-item-body> </fo:list-item> <fo:list-item> <fo:list-item-label> <fo:block></fo:block> </fo:list-item-label> <fo:list-item-body> <fo:block>123</fo:block> </fo:list-item-body> </fo:list-item> </fo:list-block> </fo:block-container> </fo:static-content> <fo:static-content flow-name="xsl-region-after" padding-top="2pt" border-top-style="solid" border-top-width="1pt" border-top-color="rgb(192,192,192)" font-size="10pt" font-family="Helvetica"> <fo:block></fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body" font-size="10pt" font-family="Helvetica"> <fo:block></fo:block> </fo:flow> </fo:page-sequence> </fo:root> </xsl:template> </xsl:stylesheet> ``` And as you can see by this screenshot the element isn't positioning correctly: ![alt text](https://i.stack.imgur.com/VP1sZ.png) Any one know know why this is happening?
Aligning an element to the right using XSL-FO, Apache FOP
CC BY-SA 2.5
null
2010-09-09T09:13:37.190
2010-09-09T09:35:28.120
null
null
80,111
[ "xslt", "xsl-fo", "apache-fop" ]
3,675,300
1
3,675,355
null
0
318
I'm trying to get the maximum value in a line in an 2d array. For example is this greyscale image. For me it's no problem to calculate the horizontal and vertical maximum grey value. However, I don't have a clue how to calculate an angled line (green line) from this 2d array. Anyone can help me out with this. ![alt text](https://i.stack.imgur.com/YGNag.png)
2 dimensional array, calculating maximum value
CC BY-SA 2.5
null
2010-09-09T09:21:32.420
2010-09-09T09:30:27.277
null
null
241,513
[ ".net", "arrays", "2d", "line" ]
3,675,538
1
3,681,061
null
6
4,648
my image processing project works with grayscale images. I have ARM Cortex-A8 processor platform. I want to make use of the NEON. I have a grayscale image( consider the example below) and in my alogorithm, I have to add only the columns. How can I load in parallel, which are , as into one of the 128-bit NEON registers? What intrinsic do I have to use to do this? I mean: ![alt text](https://i.stack.imgur.com/cf1tr.jpg) I must load them as 32 bits because if you look carefully, the moment I do 255 + 255 is 512, which can't be held in a 8-bit register. e.g. ``` 255 255 255 255 ......... (640 pixels) 255 255 255 255 255 255 255 255 255 255 255 255 . . . . . (480 pixels) ```
Load 8bit uint8_t as uint32_t?
CC BY-SA 3.0
0
2010-09-09T09:58:26.127
2014-04-10T15:30:21.253
2014-04-10T15:30:21.253
1,880,339
317,331
[ "arm", "neon", "intrinsics", "cortex-a" ]
3,675,624
1
3,675,805
null
0
949
I'm currently designing a page with a footer split into two divs. The top div displays a background-image to separate it from the main page, and the second div contains the actual footer content. It looks like the following in all browsers: ![Good](https://i.stack.imgur.com/O1kiV.png) ...except IE6, where it looks like: ![Bad](https://i.stack.imgur.com/Md9OQ.png) I'm guessing it's a margin/padding issue, but I can't identify which div is causing it (it's working in all browsers except IE6!). The work-in-progress site is available [here](http://sandbox.woodstockdesigns.co.uk/), if anyone can identify where the extra space is coming from.
IE6 background-image margin/padding/spacing issue
CC BY-SA 2.5
null
2010-09-09T10:13:36.203
2010-09-09T10:41:54.940
null
null
222,454
[ "css", "background-image" ]
3,676,448
1
3,676,491
null
1
191
I've got these interfaces: ![alt text](https://i.stack.imgur.com/DWDZJ.jpg) And this code: ``` IList<IFinder<IDomainObject>> finders = new List<IFinder<IDomainObject>>(); IFinder<IOrder> orderFinder = this.mocks.StrictMock<IFinder<IOrder>>(); finders.Add(orderFinder); ``` I get this error on the third line: > Argument '1': cannot convert from 'Mes.FrameworkTest.Repository.Finders.IFinder`<Mes.FrameworkTest.DomainModel.IOrder`>' to 'Mes.FrameworkTest.Repository.Finders.IFinder`<Mes.FrameworkTest.DomainModel.IDomainObject`>' Why do I get this error when IOrder is derived from IDomainObject?
Adding a derived interface to generic interface
CC BY-SA 2.5
null
2010-09-09T12:22:45.750
2010-09-09T12:28:28.943
null
null
94,923
[ "c#", "generics" ]
3,676,513
1
null
null
6
894
I have a query that has appropriate indexes and is shown in the query plan with an estimated subtree cost of circa 1.5. The plan shows an Index Seek, followed by Key Lookup - which is fine for a query expected to return 1 row from a set of between 5 and 20 rows (i.e. the Index Seek should find between 5 and 20 rows, and after 5 - 20 Key Lookups, we should return 1 row). When run interactively, the query returns almost immediately. However, DB traces this morning show runtimes from live (a web app) that vary wildly; typically the query is taking < 100 DB Reads, and effectively 0 runtime... but we are getting a few runs that consume > 170,000 DB Reads, and runtime up to 60s (greater than our timeout value). What could explain this variation in disk reads? I have tried comparing queries interactively and using Actual Execution plans from two parallel runs with filter values taken from fast and slow runs, but interactively these show effectively no difference in the plan used. I also tried to identify other queries that could be locking this one, but I am not sure that would impact the DB Reads so much... and in any event this query tended to be the worst for runtime in my trace logs. Here's a sample of the plan produced when the query is run interactively: ![alt text](https://i.stack.imgur.com/2AdFZ.png) ignore the 'missing index' text. It true that changes to the current indexes could allow a faster query with fewer lookups, but that is not the issue here (there are already appropriate indexes). This is an Execution Plan, where we see figures like Actual Number of Rows. For example, on the Index Seek, the Actual number of rows is 16, and the I/O cost is 0.003. The I/O cost is the same on the Key Lookup. The results from the trace for this query are: ``` exec sp_executesql N'select [...column list removed...] from ApplicationStatus where ApplicationGUID = @ApplicationGUID and ApplicationStatusCode = @ApplicationStatusCode;',N'@ApplicationGUID uniqueidentifier,@ApplicationStatusCode bigint',@ApplicationGUID='ECEC33BC-3984-4DA4-A445-C43639BF7853',@ApplicationStatusCode=10 ``` The query is constructed using the Gentle.Framework SqlBuilder class, which builds parameterised queries like this: ``` SqlBuilder sb = new SqlBuilder(StatementType.Select, typeof(ApplicationStatus)); sb.AddConstraint(Operator.Equals, "ApplicationGUID", guid); sb.AddConstraint(Operator.Equals, "ApplicationStatusCode", 10); SqlStatement stmt = sb.GetStatement(true); IList apps = ObjectFactory.GetCollection(typeof(ApplicationStatus), stmt.Execute()); ```
Database reads varying dramatically on a query with indexes
CC BY-SA 2.5
0
2010-09-09T12:29:34.970
2010-09-11T06:25:49.350
2010-09-11T06:25:49.350
6,004
6,004
[ "sql-server", "database", "performance", "sql-server-2008", "sql-server-2008-r2" ]
3,676,594
1
3,676,632
null
0
286
I have a `background-image` used to separate my page footer from the main content. It displays fine when viewed in a browser window wider than the supported `min-width` of the page. However, if the window is resized to be narrower the image is pushed to the right relative to the main body. How it displays in wide browser windows: ![Good](https://i.stack.imgur.com/8KQr5.png) How it displays in narrow browser windows: ![Bad](https://i.stack.imgur.com/mvowL.png) Can I set the main body content not to push right up against the left-hand side of the window, but rather keep the 30 pixel margin when viewed in a narrow browser window? The page is live [here](http://sandbox.woodstockdesigns.co.uk/) if the CSS will be helpful.
background-image being pushed right on narrow pages
CC BY-SA 2.5
null
2010-09-09T12:41:15.640
2010-09-09T12:48:55.297
null
null
222,454
[ "css", "background-image" ]
3,676,872
1
3,677,439
null
0
3,088
I want to see how I can get the value entered in this console application to work inside a form textbox how can I do this? Example entering 00000000 in console to be as if it were entered in the form so I guess I want them to be separate but work seamless any ideas. I cant figure out how to get the textbox to get the contents from the Console.Readline() of the console application. ![alt text](https://i.stack.imgur.com/bAcDJ.jpg) ![alt text](https://i.stack.imgur.com/XXbNj.jpg) ``` public static void Main(string[] args) { Console.Write("Enter a valid 10 digit ISBN Number "); string isbn = isbnChecker.DestabilizeIsbn(Console.ReadLine()); // Normalizes the input and puts it on string "str" if (isbn.Length > 10 || isbn.Length < 9) // If the string length is greather than 10, or smaller than 9 { Console.WriteLine("The number you have entered is not a valid ISBN try again."); // Print invalid number Console.ReadLine(); } else if (isbn.Length == 10) // If the length is 10 { if (isbnChecker.CheckNumber(isbn)) // If function CheckNum return "true"... Console.WriteLine("The number you have entered is a valid ISBN"); else // If it returns "false"... Console.WriteLine("The number you have entered is not a valid ISBN try again."); Console.ReadLine(); } else // Else (If the number is NOT greater than 10 or smaller than 9, NOR is it 10 -> If the number is 9) { Console.WriteLine("The Check digit that corresponds to this ISBN number is " + checkIsbnClass.CheckIsbn(isbn) + "."); // Print the checksum digit Console.ReadLine(); } } public static class isbnChecker { public static bool CheckNumber(string isbn) // Checks if the checksum digit is correct { if (isbn[9].ToString() == checkIsbnClass.CheckIsbn(isbn)) // If the 10th digit of the number is the same as the calculated digit... return true; else // If they're not the same... return false; } public static string DestabilizeIsbn(string isbn) // replace the string { return isbn.Replace("-", "").Replace(" ", ""); } } [1]: http://i.stack.imgur.com/bAcDJ.jpg public static string CheckIsbn(string isbn) // Calculates the 10th digit of a 9-digits partial ISBN number { int sum = 0; for (int i = 0; i < 9; i++) // For each number... { sum += int.Parse(isbn[i].ToString()) * (i + 1); // ...Multiply the number by it's location in the string } if ((sum % 11) == 10) // If the remainder equals to 10... { return "x"; // Output X } else // If it does not equal to 10... { return (sum % 11).ToString(); // Output the number } } public static bool CheckNumber(string isbn) // Checks if the checksum digit is correct { if (isbn[9].ToString() == CheckIsbn(isbn)) // If the 10th digit of the number is the same as the calculated digit... return true; else // If they're not the same... return false; } public static string DestabilizeIsbn(string isbn) // replace the string { return isbn.Replace("-", "").Replace(" ", ""); } } public partial class IsbnForm : Form { public IsbnForm() { InitializeComponent(); } private void textBox1_TextChanged(object sender, EventArgs e) { this.xInputTextBox.Text = "Enter a Valid ISBN"; } ``` }
Get input from console into a form
CC BY-SA 2.5
null
2010-09-09T13:18:26.203
2010-09-09T14:23:59.287
null
null
327,073
[ "c#" ]
3,677,362
1
null
null
0
315
I have 7 to 8 buttons in my application. Like this. ![alt text](https://i.stack.imgur.com/4v9KN.jpg) How can I do this? I used: ``` LinearLayout ll = (LinearLayout)findViewById(R.id.searchdialog_layout); ll.setOrientation(0); Button btn = new Button(context); btn.setBackgroundDrawable(getResources().getDrawable(R.drawable.bubble_layout)); btn.setPadding(4,0, 4, 0); btn.setTextSize(14); btn.setTextColor(Color.BLACK); btn.setText("bubble" + " x"); ll.addView(btn) ; ``` But it didn't work. Can anyone help?
How to set buttons in Android?
CC BY-SA 2.5
null
2010-09-09T14:08:55.430
2012-06-03T20:51:58.507
2010-09-09T14:27:30.293
50,846
435,025
[ "android" ]
3,677,368
1
null
null
97
104,733
I have a matplotlib figure which I am plotting data that is always referred to as nanoseconds (1e-9). On the y-axis, if I have data that is tens of nanoseconds, ie. 44e-9, the value on the axis shows as 4.4 with a +1e-8 as an offset. Is there anyway to force the axis to show 44 with a +1e-9 offset? The same goes for my x-axis where the axis is showing +5.54478e4, where I would rather it show an offset of +55447 (whole number, no decimal - the value here is in days). I've tried a couple things like this: ``` p = axes.plot(x,y) p.ticklabel_format(style='plain') ``` for the x-axis, but this doesn't work, though I'm probably using it incorrectly or misinterpreting something from the docs, can someone point me in the correct direction? Thanks, Jonathan ![Problem illustration](https://i.stack.imgur.com/Gg00z.png) --- I tried doing something with formatters but haven't found any solution yet...: ``` myyfmt = ScalarFormatter(useOffset=True) myyfmt._set_offset(1e9) axes.get_yaxis().set_major_formatter(myyfmt) ``` and ``` myxfmt = ScalarFormatter(useOffset=True) myxfmt.set_portlimits((-9,5)) axes.get_xaxis().set_major_formatter(myxfmt) ``` On a side note, I'm actually confused as to where the 'offset number' object actually resides...is it part of the major/minor ticks?
matplotlib: format axis offset-values to whole numbers or specific number
CC BY-SA 3.0
0
2010-09-09T14:09:11.183
2020-09-02T19:26:21.600
2016-11-25T10:54:15.667
2,062,965
277,241
[ "python", "matplotlib" ]
3,677,844
1
3,678,630
null
0
719
i am facing one font problem, my website is to operate in five languages, one of them is german, so few characters like ü etc.are not getting displayed properly. so for example, in english, i have one word "unhappy", in german it has to be displayed as "unglücklich", actually i m still using Flex3.0, so![alt text](https://i.stack.imgur.com/N6j8q.png) when i receive this value from PHP end, i m getting it as mentioned in this image.., so "unhappy" text when it is getting displayed finally is worthless., can n e one plzz help me out, my website is almost finsihed, just few of these small problems is creating problem, Thank you very much in advance Thank you Ankur Sharma ![alt text](https://i.stack.imgur.com/N6j8q.png)
Font Embedding german characters( "ü") problems
CC BY-SA 2.5
null
2010-09-09T15:02:53.643
2010-10-22T10:06:31.123
2010-09-10T06:34:53.207
340,116
340,116
[ "flash", "actionscript-3", "actionscript", "flex3", "flex4" ]
3,678,224
1
null
null
2
621
So for example I have ![such image](https://i.stack.imgur.com/Q4FQp.png) such lines with coordinates. how (using what algorithm) is it possible to generate some kind of simple 3d scene meaning get relative distance from camera to the wall that is facing us?
How to get camera position from such data generated by LSD lines detector?
CC BY-SA 2.5
null
2010-09-09T15:49:51.183
2011-05-22T08:00:00.963
null
null
434,051
[ "algorithm", "3d", "camera", "2d", "line" ]
3,678,326
1
3,683,665
null
0
1,401
I'm currently using the [Facebook Developer Toolkit](http://facebooktoolkit.codeplex.com/) to publish to my organization's Facebook page. I'd like to be able to attach a link, but can't quite seem to figure out the syntax. Here's what I'm trying. ``` ConnectSession fbSession = new ConnectSession(API_KEY, API_SECRET); Api fbApi = new Api(fbSession); attachment attach = new attachment(); attach.href = "http://www.google.com"; attach.caption = "Google"; attach.name = "Google"; String post = "Here's a cool new search engine I found!"; fbApi.Stream.Publish(post, attach, null, null, Convert.ToInt64(fanPageId)); ``` Here's what I'm going for: ![alt text](https://i.stack.imgur.com/edQMe.png)
Facebook publish to stream and attach link
CC BY-SA 2.5
null
2010-09-09T16:01:00.927
2010-09-10T09:53:56.190
null
null
228,014
[ "facebook" ]
3,678,335
1
3,678,604
null
5
4,406
I'm looking for a quick method/algorithm for finding which nodes in a graph is critical. For example, in this graph: ![alt text](https://i.stack.imgur.com/1reXa.png) Node number 2 and 5 are critical. My current method is to try removing one non-endpoint node from the graph at a time and then check if the entire network can be reached from all other nodes. This method is obvious not very efficient. What are a better way?
What is a fast algorithm for finding critical nodes?
CC BY-SA 2.5
0
2010-09-09T16:02:18.710
2020-05-18T17:40:12.770
2012-12-16T16:01:43.230
1,288
242,348
[ "algorithm", "graph" ]
3,678,647
1
3,678,870
null
3
1,285
Using this library, [ZXing](http://code.google.com/p/zxing/), we have a project at school in which we'll implement a inventory system using Android phones. We aim to use an Android phone to be a inexpensive replacement to this: ![Scanner... thing](https://i.stack.imgur.com/LD8DR.jpg) I've read some of the warnings on the FAQ for certain phones. (with use of the ZXing library in mind)? We have to buy the phone ourselves, so we would prefer not to buy the wrong phone!
Preferred Developer Android Phone for using the ZXing library
CC BY-SA 2.5
0
2010-09-09T16:43:18.623
2010-12-22T00:32:41.673
null
null
269,694
[ "android", "camera", "barcode", "zxing" ]
3,678,691
1
3,678,828
null
1
1,777
So I have noticed that things (for lack of a better word) like this ![alt text](https://i.stack.imgur.com/Xf4Xd.png) and ![alt text](https://i.stack.imgur.com/OKGKW.gif) are just done in the console using special characters and changing their color. I know how to accomplish this on windows but how would I go about doing this in linux (I am using ubuntu if that matters)? Are there any predefined classes out there to help construct these textboxes?
Color console boxes in linux terminal
CC BY-SA 2.5
0
2010-09-09T16:48:14.173
2014-02-27T09:14:17.147
2010-09-09T18:11:43.460
420,892
357,882
[ "c++", "linux", "console", "ncurses" ]
3,678,964
1
3,693,507
null
0
480
![text templating visual studio 2010](https://i.stack.imgur.com/DCLgI.jpg) I have installed Visual Web Developer Express 2010 but my .tt templates don't have icons. Do you know how to solve this issue?
Visual Web Developer Express 2010 T4 Templates no icon?
CC BY-SA 2.5
null
2010-09-09T17:24:07.670
2010-09-12T02:27:03.757
null
null
372,935
[ "visual-studio-2010", "t4" ]
3,679,014
1
3,711,323
null
6
9,387
I'm using [imagettftext](http://php.net/manual/en/function.imagettftext.php) to make a and at the I want to put the . I have the (which are really rectangles) `$x1` `$y1` `$x2` `$y2` `$imagesx` `$imagesy` `$font_size` Also, The ![alt text](https://i.stack.imgur.com/wBqMX.png)
PHP GD ttftext center alignment
CC BY-SA 2.5
0
2010-09-09T17:30:55.727
2015-07-04T09:46:31.870
2010-09-11T22:48:34.707
1,246,275
1,246,275
[ "php", "image", "text", "graph", "gd" ]
3,679,022
1
3,679,051
null
1
1,646
I'm using the jQuery [qtip](http://craigsworks.com/projects/qtip/) plugin. I want the content of the qtip to be an image, loaded dynamically. The url I'm using works. If I go to the url, I see an image. However, the qtip shows something... weird. Here is the result: ![alt text](https://i.stack.imgur.com/FCdyC.jpg) Any ideas why this would happen? --- Edit This is the entire Response Header (via Chrome inspector): ``` Access-Control-Allow-Credentials:true Access-Control-Allow-Methods:POST, GET, OPTIONS Access-Control-Allow-Origin:* Access-Control-Max-Age:1728000 Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Connection:keep-alive Content-Length:5690 Content-Type:image/gif; charset=binary Date:Thu, 09 Sep 2010 17:35:48 GMT Expires:Thu, 19 Nov 1981 08:52:00 GMT Keep-Alive:timeout=2 Last-Modified:Thu, 09 Sep 2010 17:35:48 GMT Pragma:no-cache Server:nginx/0.8.31 X-Powered-By:PHP/5.2.11 ```
jQuery qtip - loading an image into the qtip via ajax
CC BY-SA 2.5
null
2010-09-09T17:31:58.680
2010-09-09T17:42:20.577
2010-09-09T17:42:20.577
190,902
190,902
[ "jquery", "ajax", "qtip" ]
3,679,457
1
3,748,081
null
4
4,182
I've been having a problem to show large images on a scrollview, the images are 2,4 - 4,7 MB. It runs fine on the 3GS and on the simulator. But whenever I try to run on a 3G or iPod Touch 2G, it crashes. I searched across the web and found the "imageNamed is evil" article. Ok I changed all my image calls to imageWithContentsOfFile: but it still crashes, the only different that I see is that now images are deallocated after I leave the view just fine. But the memory usage is still very high. Here is a screenshot of Instruments. ![alt text](https://i.stack.imgur.com/nrc1i.jpg) ![alt text](https://i.stack.imgur.com/fzkqm.jpg) ![alt text](https://i.stack.imgur.com/8wjlD.jpg) By the way the app was tested on iOS 4 and 3.1.2 Do you have any tips? Because this problem is driving me nuts. Since now thanks a lot!
App Crashing when using large images on iOS 4.0
CC BY-SA 2.5
0
2010-09-09T18:28:57.333
2010-09-21T01:15:44.253
null
null
239,028
[ "iphone", "image", "memory", "crash", "uiimage" ]
3,679,751
1
3,679,955
null
2
2,273
I'm developing an simple art program in Java and I was curious if it was possible to create an gray empty space around the canvas like is most art programs(Meaning, an empty space that isn't locked down and is scrollable). Is this possible and how could I go about doing this? Example: ![alt text](https://i.stack.imgur.com/2ZpMw.png)
Creating a gray space around a JPanel in Java
CC BY-SA 2.5
null
2010-09-09T19:09:34.577
2017-10-08T20:55:23.313
null
null
383,940
[ "java", "swing", "awt" ]
3,680,429
1
4,839,672
null
1,976
954,154
I have a `div` that has `background:transparent`, along with `border`. Underneath this `div`, I have more elements. Currently, I'm able to click the underlying elements when I click outside of the overlay `div`. However, I'm unable to click the underlying elements when clicking directly on the overlay `div`. I want to be able to click through this `div` so that I can click on the underlying elements. ![My Problem](https://i.stack.imgur.com/VDlDa.png)
Click through div to underlying elements
CC BY-SA 4.0
0
2010-09-09T20:42:54.743
2021-11-29T07:23:06.887
2021-11-29T07:23:06.887
8,112,776
398,434
[ "css", "click", "mouseevent", "layer" ]
3,680,465
1
3,878,903
null
0
667
I'm having trouble getting this code to set the prompt: ``` // Create a PeoplePicker ABPeoplePickerNavigationController *objPeoplePicker = [[ABPeoplePickerNavigationController alloc] init]; [objPeoplePicker setPeoplePickerDelegate:self]; // Customize colors objPeoplePicker.topViewController.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0]; objPeoplePicker.topViewController.searchDisplayController.searchBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0]; // Only display phone numbers NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty], nil]; objPeoplePicker.displayedProperties = displayedItems; // Add a prompt objPeoplePicker.navigationBar.topItem.prompt = @"Choose a contact to..."; // Show the picker [self presentModalViewController:objPeoplePicker animated:YES]; ``` The "Add a Prompt" section doesn't seem to be setting the prompt. Any ideas? Here's a screenshot of the output: ![alt text](https://i.stack.imgur.com/kniNI.png)
Setting a prompt in an ABPeoplePickerNavigationController
CC BY-SA 2.5
null
2010-09-09T20:48:20.793
2010-10-07T05:35:15.060
2010-10-07T05:35:15.060
60,488
277,757
[ "iphone", "objective-c", "cocoa-touch", "abpeoplepickerview" ]
3,680,467
1
3,680,606
null
1
6,656
I built form here, When I input utf-8 data to it at firefox 3.6.8 it is like this: but it works fine with IE.8 ![alt text](https://i.stack.imgur.com/zta3G.png) It seems that while typing (or filling) the input box, the characters are all uppercase. Just like that you are holding shift and type it. anyone knows what is the problem with firefox? --- edit : it is a simple form ``` <form enctype="multipart/form-data" action="print $_SERVER['PHP_SELF'];" method="post" accept-charset="utf-8"> <br><input name="f_name" type="text"><br> </form> ```
HTML form, inputing utf-8 string firefox and IE !
CC BY-SA 2.5
null
2010-09-09T20:48:35.257
2010-09-09T21:09:12.910
2010-09-09T20:54:52.373
238,952
238,952
[ "html", "utf-8" ]
3,680,674
1
3,682,356
null
3
654
I have TWebBrowser embedded in a TForm. Whenever I press Alt button the browser window becomes white. If I drag the form around it repaints correctly. What I am doing wrong? I have DevExpress Bars and Quantum Grid if that matters? I use Delphi 2010 and Windows 7 and XP SP2. IE version is 7 and 8. Reproducible on all. Before pressing Alt: ![Before pressing the Alt](https://i.stack.imgur.com/sYqhV.png%EF%9C%AB) After pressing Alt: ![After pressing Alt](https://i.stack.imgur.com/oth07.png) I have resolved it by usnig the following: ``` procedure TMainForm.WndProc(var Message: TMessage); begin inherited WndProc(Message); if Message.Msg = WM_UPDATEUISTATE then begin if Assigned(ProblematicWebBrowser) then ProblematicWebBrowser.Repaint; end; end; ```
Pressing Alt clears the embedded TWebBrowser
CC BY-SA 2.5
null
2010-09-09T21:22:08.990
2010-09-14T05:12:24.987
2010-09-14T05:12:24.987
91,299
69,358
[ "delphi", "key", "delphi-2010", "twebbrowser" ]
3,680,860
1
5,602,266
null
1
1,594
![alt text](https://i.stack.imgur.com/zupG5.png) I dont know where to save the script or how to link it in this field. I found this script on a different website, and I feel that it would work fine for what I need it to do, just alert me via email when the truck is down. ``` #!/bin/bash echo "You're screwed, the trunk you bought is down"|mail -s "You have a problem" [email protected] ```
How can I setup in Elastix 1.5 the "Monitor Trunk Failures" feature?
CC BY-SA 2.5
null
2010-09-09T21:55:10.900
2011-04-09T01:21:48.887
null
null
328,536
[ "email", "alert", "voip", "asterisk", "trunk" ]
3,681,373
1
3,681,386
null
4
3,619
I would like to bind the same event to a list of anchor link. Why this does not work? Markup: ``` <a tabindex="0" href="#contactRoles" class="fg-button fg-button-icon-right ui-widget ui-state-default ui-corner-all" id="contactAdd"> <span class="ui-icon ui-icon-triangle-1-s"></span>Aggiungi contatto</a> <div id="contactRoles" class="hidden"> <ul> <li><a href="#1" class="contactRole">Cliente</a></li> <li><a href="#2" class="contactRole">Controparte</a></li> <li><a href="#3" class="contactRole">Avvocato</a></li> <li><a href="#4" class="contactRole">Avv. Controparte</a></li> <li><a href="#5" class="contactRole">Altre parti</a></li> <li><a href="#6" class="contactRole">Domiciliatario</a></li> <li><a href="#7" class="contactRole">Pubblico Ministero</a></li> <li><a href="#8" class="contactRole">Giudice</a></li> <li><a href="#9" class="contactRole">Istruttori</a></li> <li><a href="#10" class="contactRole">Studio Legale</a></li> </ul> </div> ``` jQuery: ``` $('#contactAdd').menu({ content: $('#contactRoles').html(), width: 150, showSpeed: 300 }); $("a.contactRole").click(function(event){ event.preventDefault(); alert("Link " + $(this).attr("href") + " clicked"); }); ``` Where am I wrong? : @everybody: Yes the script is wrapped by a $(document).ready(...) For further information consider that the div with class "hidden" is hidden and can only be viewed by a click on another anchor as you can see from this screenshot. ![alt text](https://i.stack.imgur.com/a6ktE.png)
jquery bind on multiple anchor
CC BY-SA 2.5
null
2010-09-09T23:46:31.537
2010-09-10T00:29:16.940
2010-09-10T00:29:16.940
431,537
431,537
[ "jquery" ]
3,681,502
1
3,681,891
null
0
1,019
how do i set up a Flash CS5 Slider component to trace decimal values, from 0.00 to 10.00 when the slider is dragged? i can't seem to find where i need to set these options to permit decimals. is it possible to set this in ActionScript? ![alt text](https://i.stack.imgur.com/X4CRo.png)
Flash Slider Component With Decimal Value?
CC BY-SA 2.5
null
2010-09-10T00:24:54.340
2010-09-10T02:17:05.473
null
null
336,929
[ "flash", "actionscript-3", "slider", "decimal" ]
3,681,629
1
3,687,882
null
3
3,008
I'm just beginning Silverlight, yet I thought this would be easy to do. I simply add a button to a new Silverlight 4 application but no matter what I change the Background property to (SolidColorBrush, any color), only part of button's gradient changes, I can never get a solid, flat color fill. This shows what I mean: ![Butten still has gradient](https://i.stack.imgur.com/vtGj6.png) Why the red gradient? What do I need to set to get a solid color fill?
How do I create a flat (i.e. solid, non-gradient) color fill on Silverlight 4 button?
CC BY-SA 2.5
0
2010-09-10T00:56:50.853
2010-09-10T19:55:37.360
null
null
11,314
[ "silverlight-4.0" ]
3,681,693
1
3,681,937
null
0
2,219
I have a faceted plot (about which I had this [other](https://stackoverflow.com/questions/3681647/ggplot-how-to-increase-spacing-between-faceted-plots) question). I would like to control the interval of ylim() to reduce the clutter because it looks like this: ![alt text](https://i.stack.imgur.com/Znukm.png) It's too detailed and I would like to display only 0 and 500, that is (the thin horizontal lines are enough). The reasons I want only those 2 values are: - - Thanks in advance.
ggplot: How to override the ylim interval?
CC BY-SA 2.5
null
2010-09-10T01:12:36.893
2010-09-10T02:32:48.317
2017-05-23T12:30:39.393
-1
277,434
[ "r", "ggplot2" ]
3,681,872
1
31,572,599
null
41
35,552
How do you add a shaded area between two points in a [matplotlib](http://matplotlib.org/index.html) plot? In the example [matplotlib](http://matplotlib.org/index.html) plot below, I manually added the shaded, yellow area using [Skitch](http://www.skitch.com/). I'd like to know how to do this sans-Skitch. ![alt text](https://i.stack.imgur.com/lPdkR.jpg)
Shading an area between two points in a matplotlib plot
CC BY-SA 3.0
0
2010-09-10T02:08:20.667
2022-06-07T13:38:56.393
2015-07-22T20:06:41.767
3,358,223
95,592
[ "python", "matplotlib" ]
3,681,950
1
3,682,218
null
35
17,279
I have installed Mono 2.6.7 in Snow Leopard and would like to run LINQPad. I've gotten LINQPad (v2.21) to start but immediately get a FileNotFoundException. Has anyone been able to run it successfully? I assume the exception is because it's trying to read/write a config file or something but hopefully there is some workaround. Thanks. In Terminal: ``` svn co svn://anonsvn.mono-project.com/source/trunk/olive cd /Users/(your user name)/olive ./configure --prefix=/Users/(your user name)/olive --with-glib=embedded make make install ``` Now navigate in Finder to: > /Users/(your user name)/olive/lib/mono/gac Copy those folders (ex: PresentationCore, PresentationFramework) into: > /Library/Frameworks/Mono.framework/Versions/2.6.7/lib/mono/gac (Current Mono version is 2.6.7 but this obviously may be different) Unfortunately, now I'm getting this when running LINQPad: > WARNING **: The class System.Windows.Resources.AssemblyAssociatedContentFileAttribute could not be loaded, used in LINQPadcould not be loaded, used in LINQPad Xamarin Workbooks recently released 1.0 ([https://developer.xamarin.com/workbooks/](https://developer.xamarin.com/workbooks/)) and is the closest I've seen to LINQPad on macOS. Running most Windows applications (including GUI apps) might be possible with Docker and Windows Subsystem for Linux (WSL): ![Animated demo of cmd.exe running on Ubuntu](https://blog.jessfraz.com/img/cmd-exe.gif) See the blog post at [https://blog.jessfraz.com/post/windows-for-linux-nerds/](https://blog.jessfraz.com/post/windows-for-linux-nerds/) for a detailed walkthrough.
Is it possible to run LINQPad with Mono (Mac)
CC BY-SA 3.0
0
2010-09-10T02:36:50.800
2020-12-06T21:41:42.137
2020-12-06T21:41:42.137
213,269
45,852
[ "linux", "mono", "windows-subsystem-for-linux", "linqpad" ]
3,681,976
1
3,684,148
null
3
2,694
I've got an Activity with two views set up in a ViewFlipper. One of the views is a layout with a GLSurfaceView and a few other widgets, the other just has a layout with a TextView and a VideoView. When I click on something in the GLSurfaceView, the ViewFlipper swaps so the video can play. In this screenshot, you can see the plain GLSurfaceView rendering a map on the left. On the right is what it looks like after the ViewFlipper has flipped and the video starts playing. ![Screenshot](https://i.stack.imgur.com/Ho2RZ.png) The empty transparent area where the GLSurfaceView shows through is where the video is supposed to be. I can hear it playing through the speaker and the timeline is moving forward, so I know it's playing. I can post code if you need it, but there's a lot involved so it could get rather complicated. Any ideas as to what's going on here?
VideoView in ViewFlipper is transparent when video is playing
CC BY-SA 2.5
0
2010-09-10T02:46:44.800
2010-09-10T11:14:24.683
null
null
1,384
[ "android", "viewflipper", "android-videoview", "glsurfaceview" ]
3,681,990
1
4,925,776
null
27
51,105
I noticed that the titleView's position depends on the rightbarbutton title. How can I set the frame of the titleView to be in the center instead? I've tried setting titleView.frame, but to no avail. Here's the code: ``` UIButton *titleLabel = [UIButton buttonWithType:UIButtonTypeCustom]; [titleLabel setTitle:@"Right Eye" forState:UIControlStateNormal]; [titleLabel setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; [titleLabel setTitleColor:[UIColor blackColor] forState:UIControlStateHighlighted]; titleLabel.frame = CGRectMake(100, 0, 180, 44); titleLabel.titleLabel.backgroundColor = [UIColor clearColor]; titleLabel.titleLabel.font = [UIFont boldSystemFontOfSize:20.0]; titleLabel.titleLabel.shadowColor = [UIColor colorWithWhite:0.0 alpha:0.3]; // titleLabel.titleLabel.textAlignment = UITextAlignmentCenter; (this doesn't work either) [titleLabel addTarget:self action:@selector(titleTap:) forControlEvents:UIControlEventTouchUpInside]; self.navigationItem.titleView = titleLabel; self.navigationItem.titleView.frame = CGRectMake(100, 0, 180, 44); //(this doesn't work either) ``` ![alt text](https://i.stack.imgur.com/mpG0c.png)
Adjusting navigationItem.titleView's frame?
CC BY-SA 2.5
0
2010-09-10T02:52:57.603
2020-06-04T01:38:55.843
null
null
338,926
[ "iphone", "uinavigationitem" ]
3,681,854
1
3,681,979
null
4
11,109
i have a strange problem with sending HTML mail in c#. Basically i am trying to email myself the weather every morning and I begin by downloading the weather in HTML markup from an ftp site. After obtaining the source file i then read it into a string and create a mailMessage using the following code. ``` string body = File.ReadAllText(@"C:\Weather.htm"); MailMessage mailMessage = new MailMessage(); SmtpClient mailClient = new SmtpClient("smtp.gmail.com"); mailClient.Credentials = new NetworkCredential(username, password); mailClient.Port = 587; mailClient.EnableSsl = true; mailMessage.From = new MailAddress(emailFrom); mailMessage.IsBodyHtml = true; mailMessage.To.Add(emailTo); mailMessage.Subject = "Test Email"; mailMessage.SubjectEncoding = System.Text.Encoding.Unicode; mailMessage.Body = body; mailMessage.BodyEncoding = System.Text.Encoding.Unicode; mailClient.Send(mailMessage); ``` The problem is that whilst the email arrives in HTML format, all of the DIV / CSS are not respected and it looks weird. I have tried to email to a different email address & client and it looks the same as well as trying different encodings. So somewhere along the line something is going wrong. Does anyone know how to fix this and get a properly formatted email? # Good Image ![alt text](https://i.stack.imgur.com/oNk4V.png) # BadImage ![alt text](https://i.stack.imgur.com/MpVOm.png) source markup ``` <html xmlns="http://www.w3.org/1999/xhtml"><head xmlns=""> <META http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Sydney Forecast</title> <link rel="stylesheet" type="text/css" href="http://www.bom.gov.au/watl/standard/common.css"> <link rel="stylesheet" type="text/css" href="http://www.bom.gov.au/weather-services/styles/text-gfe.css"> </head> <body> <div class="product"> <p xmlns="" class="p-id">IDN10064</p> <p xmlns="" class="source">Australian Government Bureau of Meteorology<br/>New South Wales <h2 xmlns="">Updated Sydney Forecast</h2> <p xmlns="" class="date">Issued at 8:11 am&nbsp;EST on Thursday 9 September 2010<br>for the period until midnight EST&nbsp;Wednesday 15 September 2010.</p> <h3 xmlns="" class="warning">Warning Summary at issue time</h3> <p xmlns="">Nil.</p> <p xmlns="" class="p-id">Details of warnings are available on the Bureau's website www.bom.gov.au, by telephone 1300-659-218* or through some TV and radio broadcasts.</p> <h3 xmlns="" class="day">Forecast for the rest of Thursday</h3> <p xmlns="" class="sl">Cloud increasing. Areas of rain this afternoon and evening. Winds northerly averaging up to 20 km/h.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">A little rain later.</div> <div class="max_l">Max</div> <div class="max_v">20</div> </div> <div class="line"> <div class="rain_l">Chance of any rainfall:</div> <div class="rain_prob_v">30%</div> <div class="rain_l">Chance of no rainfall:</div> <div class="rain_prob_v">70%</div> <div class="rain_l">Rainfall:</div> <div class="rain_v">0 to 1 mm</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Late rain.</div> <div class="max_l">Max</div> <div class="max_v">20</div> </div> <div class="line"> <div class="rain_l">Chance of any rainfall:</div> <div class="rain_prob_v">30%</div> <div class="rain_l">Chance of no rainfall:</div> <div class="rain_prob_v">70%</div> <div class="rain_l">Rainfall:</div> <div class="rain_v">0 to 1 mm</div> </div> <div class="line"> <div> <h4>Around Sydney</h4> </div> </div> <div class="line"> <div class="name">Liverpool</div> <div class="max_l">Max</div> <div class="max_v">20</div> <div class="name">Parramatta</div> <div class="max_l">Max</div> <div class="max_v">20</div> </div> <div class="line"> <div class="name">Terrey Hills</div> <div class="max_l">Max</div> <div class="max_v">19</div> <div class="name">Campbelltown</div> <div class="max_l">Max</div> <div class="max_v">19</div> </div> <div class="line"> <div class="name">Richmond</div> <div class="max_l">Max</div> <div class="max_v">20</div> <div class="name">Bondi</div> <div class="max_l">Max</div> <div class="max_v">19</div> </div> </div> <p xmlns="" class="sl">Fire Danger: Low to Moderate [0-11]</p> <p xmlns="" class="sl">UV Alert from 9:10 am to 2:40 pm, UV Index predicted to reach 6 [High]</p> <h3 xmlns="" class="day">Forecast for Friday</h3> <p xmlns="" class="sl">Partly cloudy. Winds west to northwesterly averaging up to 25 km/h tending westerly up to 40 km/h around midday.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">Becoming windy.</div> <div class="min_l">Min</div> <div class="min_v">13</div> <div class="max_l">Max</div> <div class="max_v">22</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Partly cloudy. Becoming windy.</div> <div class="min_l">Min</div> <div class="min_v">11</div> <div class="max_l">Max</div> <div class="max_v">23</div> </div> </div> <h3 xmlns="" class="day">Forecast for Saturday</h3> <p xmlns="" class="sl">Sunny. Winds west to southwesterly averaging up to 25 km/h tending mainly southeast to southwesterly up to 20 km/h around midday.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">Sunny.</div> <div class="min_l">Min</div> <div class="min_v">12</div> <div class="max_l">Max</div> <div class="max_v">21</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Sunny.</div> <div class="min_l">Min</div> <div class="min_v">9</div> <div class="max_l">Max</div> <div class="max_v">22</div> </div> </div> <h3 xmlns="" class="day">Forecast for Sunday</h3> <p xmlns="" class="sl">Mostly sunny. Light winds.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">Mostly sunny.</div> <div class="min_l">Min</div> <div class="min_v">10</div> <div class="max_l">Max</div> <div class="max_v">21</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Sunny.</div> <div class="min_l">Min</div> <div class="min_v">6</div> <div class="max_l">Max</div> <div class="max_v">23</div> </div> </div> <h3 xmlns="" class="day">Forecast for Monday</h3> <p xmlns="" class="sl">Becoming cloudy. Isolated showers later in the day. Winds west to southwesterly averaging up to 25 km/h.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">Shower or two developing.</div> <div class="min_l">Min</div> <div class="min_v">13</div> <div class="max_l">Max</div> <div class="max_v">22</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Shower or two developing.</div> <div class="min_l">Min</div> <div class="min_v">10</div> <div class="max_l">Max</div> <div class="max_v">22</div> </div> </div> <h3 xmlns="" class="day">Forecast for Tuesday</h3> <p xmlns="" class="sl">Sunny. Light winds tending north to northeasterly up to 20 km/h during the evening.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">Sunny.</div> <div class="min_l">Min</div> <div class="min_v">12</div> <div class="max_l">Max</div> <div class="max_v">19</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Sunny.</div> <div class="min_l">Min</div> <div class="min_v">10</div> <div class="max_l">Max</div> <div class="max_v">19</div> </div> </div> <h3 xmlns="" class="day">Forecast for Wednesday</h3> <p xmlns="" class="sl">Isolated showers during the morning. Sunny afternoon. Winds northwesterly averaging up to 25 km/h tending westerly up to 35 km/h during the morning.</p> <div xmlns="" class="grid"> <div class="line space-b"> <div class="name">City Centre</div> <div class="wx">Shower or two clearing.</div> <div class="min_l">Min</div> <div class="min_v">12</div> <div class="max_l">Max</div> <div class="max_v">20</div> </div> <div class="line space-b"> <div class="name">Penrith</div> <div class="wx">Shower or two clearing.</div> <div class="min_l">Min</div> <div class="min_v">8</div> <div class="max_l">Max</div> <div class="max_v">21</div> </div> </div> <p xmlns="" class="dt">The next routine forecast will be issued at 4:20 pm&nbsp;EST&nbsp;Thursday.</p> <p xmlns="" class="p-id">* Calls to 1300 numbers cost around 27.5c incl. GST, higher from mobiles or public phones.</p> </div> </html> ```
HTML email not displaying correctly
CC BY-SA 2.5
null
2010-09-10T02:00:43.707
2012-10-19T10:02:23.703
2010-09-10T02:33:36.570
96,854
96,854
[ "c#", "html", "css", "markup", "mailmessage" ]
3,682,021
1
3,684,095
null
2
917
I am willing to do this widget: ![alt text](https://i.stack.imgur.com/PuTkj.png) Just A-B-C can be chosen. Any idea if someone already did something similar? If not, how would you do it?
UISlider with certain possible values
CC BY-SA 2.5
0
2010-09-10T03:06:25.343
2010-09-10T11:07:26.510
null
null
119,895
[ "iphone", "uislider" ]
3,682,409
1
3,682,421
null
10
30,792
I have a mysql table with contents the structure is here: ![alt text](https://i.stack.imgur.com/HaH2F.png) I want to read and print the content of this table to html This is my code: ``` <?php include("config.php"); $global_dbh = mysql_connect($hostname, $username, $password) or die("Could not connect to database"); mysql_select_db($db) or die("Could not select database"); function display_db_query($query_string, $connection, $header_bool, $table_params) { // perform the database query $result_id = mysql_query($query_string, $connection) or die("display_db_query:" . mysql_error()); // find out the number of columns in result $column_count = mysql_num_fields($result_id) or die("display_db_query:" . mysql_error()); // Here the table attributes from the $table_params variable are added print("<TABLE $table_params >\n"); // optionally print a bold header at top of table if($header_bool) { print("<TR>"); for($column_num = 0; $column_num < $column_count; $column_num++) { $field_name = mysql_field_name($result_id, $column_num); print("<TH>$field_name</TH>"); } print("</TR>\n"); } // print the body of the table while($row = mysql_fetch_row($result_id)) { print("<TR ALIGN=LEFT VALIGN=TOP>"); for($column_num = 0; $column_num < $column_count; $column_num++) { print("<TD>$row[$column_num]</TD>\n"); } print("</TR>\n"); } print("</TABLE>\n"); } function display_db_table($tablename, $connection, $header_bool, $table_params) { $query_string = "SELECT * FROM $tablename"; display_db_query($query_string, $connection, $header_bool, $table_params); } ?> <HTML><HEAD><TITLE>Displaying a MySQL table</TITLE></HEAD> <BODY> <TABLE><TR><TD> <?php //In this example the table name to be displayed is static, but it could be taken from a form $table = "submits"; display_db_table($table, $global_dbh, TRUE, "border='2'"); ?> </TD></TR></TABLE></BODY></HTML> ``` but I get ???????? as the results: Where is my mistake?
reading utf-8 content from mysql table
CC BY-SA 4.0
0
2010-09-10T05:25:11.330
2022-03-01T23:52:01.633
2022-03-01T23:52:01.633
238,952
238,952
[ "php", "mysql", "utf-8" ]
3,682,532
1
3,682,727
null
1
1,234
I have a text field, and it's good everywhere except Opera, where it takes the color of the background. ![bad opera](https://i.stack.imgur.com/ZjFGH.png) How can I make just the inside white? Setting background(-color) to white makes the entire square element background white, which is not what I want. ![background color](https://i.stack.imgur.com/S46aE.png) The cornering is border-radius. No IE hacks needed :) No specific CSS is used for the other browsers, it just works, in that it was always white. Should've posted the link earlier, but the page in question is [http://blog.darkhax.com/](http://blog.darkhax.com/)
CSS for inner background color of a text field
CC BY-SA 2.5
null
2010-09-10T05:57:31.700
2010-09-10T22:12:21.153
2010-09-10T22:12:21.153
4,657
4,657
[ "css", "forms", "opera" ]
3,682,704
1
null
null
0
791
I want a horizontal field manager to act as a button, changing the background image on focus: ![http://i52.tinypic.com/2cgzqe0.jpg](https://i.stack.imgur.com/JEmbh.jpg) set background image for HorizontalFieldManager and it should change onfocus(select) and it should act as a button to push some other screen... Under that HorizontalFieldManager I want to add an image and labels to display some information... I want it exactly like in the screen shot, there are no edit fields..
Button HorizontalFieldManager, change background image on focus?
CC BY-SA 3.0
null
2010-09-10T06:44:14.643
2013-04-12T06:32:50.210
2011-09-09T02:43:56.900
669,202
442,058
[ "blackberry", "button", "screen", "horizontalfieldmanager" ]