Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
5,253,969
1
5,254,013
null
0
1,333
How do you share a link on Facebook? I have no problem with submitting a top level URL (site.com). When I try to share a deeper link (site.com/anything), Facebook incorrectly encodes the link. I tried pre-encoding my URL with Javascript's `escape()`, but Facebook doesn't like that either. ![Facebook Share](https://i.stack.imgur.com/kBCCq.png)
Share link on Facebook is strangly encoded
CC BY-SA 2.5
null
2011-03-10T00:11:41.450
2011-03-10T09:58:37.317
null
null
459,987
[ "javascript", "facebook", "url" ]
5,254,018
1
5,254,097
null
9
5,447
I'm trying to create this simple layout in Android. ![enter image description here](https://i.stack.imgur.com/xtpU9.png) should wrap to fit its content and `left|center_vertical` align. should expand as much as possible, filling all empty space. should be right-aligned, wrapping to fill its content and also being aligned `center_vertical`. Here is my layout: ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:gravity="left|center_vertical"> <!-- A --> <ImageView android:id="@+id/example_item_icon" android:layout_width="48px" android:layout_height="48px"/> <!-- B --> <LinearLayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="fill_parent" android:gravity="left|center_vertical" android:padding="5px"> <TextView android:id="@+id/example_item_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold"/> <TextView android:id="@+id/example_item_level_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold|italic" android:lines="1" android:textSize="10px"/> </LinearLayout> <!-- C --> <TextView android:id="@+id/example_item_count_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textStyle="bold" android:textSize="14px"/> </LinearLayout> ``` In this layout, is pushed off-screen. How can I make this layout work?
Can't get proper layout with "fill_parent"
CC BY-SA 2.5
0
2011-03-10T00:18:21.730
2011-05-25T02:05:17.933
null
null
128,967
[ "android", "android-layout" ]
5,254,122
1
5,254,217
null
1
6,403
I need to change the color of an image on a website. The image is of a carport, so the texture and shadow's needs to stay consistent. If I change the color by just swapping the images with other ones in a different color I would have to have approximately 7500 images and I don't think it would be the most efficient way of doing this, so I am asking the community if there is a jQuery code that would allow me to place some sort of color filter on top of a white carport and change the color real-time on the website? This is a sample of one of the images I have to start with. ![enter image description here](https://i.stack.imgur.com/KwskD.png) The only thing that can change color is the roof part, the metal rails in the image cannot change color and the background cannot change color either. Update: I think it would be easier to make this using flash. I know that car dealer sites use flash as well. Does anyone know any good tutorials for flash?
Changing the color of an image
CC BY-SA 2.5
null
2011-03-10T00:33:22.153
2013-03-28T07:08:18.240
2011-03-10T02:51:20.460
415,527
415,527
[ "javascript", "jquery", "css", "flash", "colors" ]
5,254,477
1
5,306,649
null
6
1,751
I'm trying to use BWToolkit to make a HUD-style button. Since Xcode 4 doesn't support IB plugins, I'm forced to make this button through code. After importing the framework and importing the header, I tried this: ``` BWTransparentCheckbox *button = [[BWTransparentCheckbox alloc] initWithFrame:NSMakeRect(0, 0, 100, 20)]; [self addSubview:button]; ``` I'd expect this nice-looking button: ![button](https://i.stack.imgur.com/sKlQW.png) However, this is what I get (minus the black border): ![button](https://i.stack.imgur.com/Xepcu.png) Any idea what I'm doing wrong here?
Use BWToolkit through code instead of IB
CC BY-SA 2.5
0
2011-03-10T01:38:31.757
2011-05-13T13:58:47.847
2011-03-15T00:56:19.007
456,851
456,851
[ "objective-c", "cocoa", "xcode", "macos", "xcode4" ]
5,254,552
1
5,254,685
null
5
4,721
I'm trying to create a transition/animation on a UIView that looks something like the image in the link below. It would start with a UIView that is a standard rectangle shape, the view would then animate/transition like the left side is being pushed and it rotates on the right side corner, like a door opening slightly. I'm sure this is a really easy thing to do in Core Animation, and I've tried searching for solutions, but haven't found any examples. Here's an example of what I am trying to achieve: ![enter image description here](https://i.stack.imgur.com/wDy3p.jpg)
Opening door effect using Core Animation
CC BY-SA 3.0
0
2011-03-10T01:52:51.693
2012-03-05T10:01:54.987
2012-03-05T10:01:54.987
689,356
591,591
[ "iphone", "objective-c", "cocoa", "uiview", "core-animation" ]
5,254,562
1
5,254,625
null
27
43,577
So I wanted to have a TextView with a cool border around it. I couldn't find any standard way of doing it, so I came up with this: @drawable/custom_bg_1: A blue rounded shape ``` <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#439CC8"/> <corners android:radius="3dp" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape> ``` @drawable/custom_bg_2: A white rounded shape ``` <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#FFFFFF"/> <corners android:radius="3dp" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape> ``` myactivity.xml: the xml for the activity ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:padding="15dp" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="2dp" android:background="@drawable/custom_bg_1" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/curr_loc" android:textSize="15sp" android:background="@drawable/custom_bg_2" /> </LinearLayout> </Linearlayout> ``` The outcome: ![picture of blue border](https://i.stack.imgur.com/0iQSB.jpg) What I am doing here is overlapping a white shape background inside a blue shape background to give the effect of a blue border. I can't imagine this is the best way to get this effect. I have seen other posts that attempt to solve this problem such as [this](https://stackoverflow.com/questions/2026873/android-way-to-appear-bordered-text-on-the-textview) and [this](https://stackoverflow.com/questions/3496269/how-to-put-a-border-around-an-android-textview), but I feel like they are just as much of a work around as my implementation. Is there a better way or more standard way of simply putting a border around certain views such as a TextView or should I just stick with the way I am doing it? --- I changed custom_bg_2.xml to look like this: ``` <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#FFFFFF"/> <stroke android:width="2dp" android:color="#000000"/> <corners android:radius="3dp" /> <padding android:left="10dp" android:top="10dp" android:right="10dp" android:bottom="10dp" /> </shape> ``` And now I get this result: ![blue and black border](https://i.stack.imgur.com/c9VZD.jpg) It looks like I can achieve an outline by including `<stroke ... />` in shape.
Is there a simpler/better way to put a border/outline around my TextView?
CC BY-SA 2.5
0
2011-03-10T01:54:36.223
2013-09-23T12:34:08.883
2017-05-23T11:53:02.863
-1
535,590
[ "xml", "textview", "border", "android" ]
5,254,606
1
null
null
0
774
I got a UIView which contains a UIBezierPath. (this path is used to draw a shape in drawRect:). Image of my setup (Blue is the UIView with the drawn shape, Red is the shape of the UIBezierPath (found by trial-error)). ![First Image](https://i.stack.imgur.com/HvSeJ.png) Everything works fine! but when i rotate the UIView the path does not rotate (but it draws correctly): ![Second Image](https://i.stack.imgur.com/57MFl.png) As you can see it is no longer updated and in sync with the UIView. I use CGAffineTransformMakeRotation to rotate the UIView so i thought that i could do the same transformation on the UIBezierPath ([UIBezierPath applyTransform]), but this makes the beziepath disappear (i was not able to find it in the view). still drawing correctly… any ideas? best regards Kristian
Problem with UIBezierPath containsPoint when rotating
CC BY-SA 2.5
null
2011-03-10T02:00:13.967
2011-03-10T03:19:41.310
null
null
526,224
[ "iphone", "objective-c", "cocoa" ]
5,254,660
1
5,254,672
null
0
280
I have to selects inside td that's only one column in big table)and I want to make sure that they are next to each other at all times but td's width is width of these two selects. Not more. The thing is that value to be displayed in based on data. So I thought I can assign fixed width to but not sure if there is some better solution to that. If I resize the browser window it is ok. Maybe I need to change the properties? ``` <td> <select name="db2.rfthdd"> <option value="WEI">WEI</option> <option value="SCOTSdatabase">SCOTSdatabase</option> </select> <select id="db2.rfttimestamp"> <option value="20110302122831">2011-03-02-122831</option> <option value="20110302122442">2011-03-02-122442</option> </select> </td> ``` ![see the red boxes](https://i.stack.imgur.com/WnTpT.png)
two <select> always next to each other inseide <td>?
CC BY-SA 2.5
null
2011-03-10T01:13:08.833
2011-03-10T23:43:05.177
2011-03-10T23:37:41.873
250,422
250,422
[ "css" ]
5,255,071
1
5,256,138
null
1
1,590
I have an ItemsControl presenting TextBlocks, with a Separator at the bottom of each item. My problem is that each Separator is rendered in a slightly different shade of gray - it looks really dodgy: ![enter image description here](https://i.stack.imgur.com/g1Ck1.png) Here is my XAML: ``` <ItemsControl ItemsSource="{Binding Path=Items}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel></StackPanel> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <StackPanel> <TextBlock Text="{Binding}" ></TextBlock> <Separator></Separator> </StackPanel> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> ``` I have also tried using a thin border instead of the Separator, with the same result. How can I make each line identical?
Separator in ItemsControl renders in different shades for each item
CC BY-SA 3.0
0
2011-03-10T03:21:19.097
2016-09-22T23:15:13.313
2016-09-22T23:15:13.313
503,969
503,969
[ "wpf", "itemscontrol", "separator" ]
5,255,253
1
5,255,383
null
0
464
Work on .I have a dataset I want to search string on this dataset table. ``` DataSet ds = new DataSet(); ds = ImportFromExcel(oOpenFileDialog.FileName, false); ... var w = (from p in ds.Tables["ReadExcel"].Rows.Cast<DataRow>().ToArray() select p.ItemArray).ToList(); string[] sExcelString = {"Vessel Name :", "Voyage No. :", "Port :", "Terminal :", ``` "NMC Global File :" }; from this w list I want to search string arrays all element .After search I want to get the list to retrive the related values.How to search on list and how to get the related list for next process.Bellow picture describe detail. ![enter image description here](https://i.stack.imgur.com/wAKto.jpg) If have any query plz ask?Thanks in advance.
How to search string on list
CC BY-SA 2.5
null
2011-03-10T03:52:00.047
2011-03-13T04:40:17.800
2011-03-10T06:04:02.917
336,100
336,100
[ "c#", ".net", "linq", "linq-to-objects" ]
5,255,579
1
5,255,732
null
12
33,168
I want something like this develop using C# .net for Windows Forms. (ListView Details View). Putting a Image is the problem. ![enter image description here](https://i.stack.imgur.com/CIMSX.png) Help me ..!! Thank You Yohan
C# .net Windows Forms Listview with image in Detail View
CC BY-SA 2.5
null
2011-03-10T04:47:22.640
2014-02-11T22:38:46.497
2011-03-10T05:05:11.157
106,224
441,628
[ "c#", "winforms", "listview" ]
5,255,615
1
5,255,670
null
9
772
![enter image description here](https://i.stack.imgur.com/vnMNC.png) ![enter image description here](https://i.stack.imgur.com/0SvAQ.png) ![enter image description here](https://i.stack.imgur.com/H7HEW.png) ![enter image description here](https://i.stack.imgur.com/ILZY6.png) Above are four images of a character walking along the ground from the bottom right towards the upper left. You can see that the drawing order isn't correct in the third panel. There doesn't seem to be a "correct order" here. For example if instead of a small guy we had a sprite of a looooong cat going through the door, then no matter if you draw the door first or the cat first, it would be wrong. ![enter image description here](https://i.stack.imgur.com/jKSL1.png) ![enter image description here](https://i.stack.imgur.com/FwuVN.png) How do other game engines handle this? Some hack to prevent this situation from happening? Draw a z-buffer by hand? Some other option that didn't occur to me?
Passages through isometric tiles
CC BY-SA 2.5
0
2011-03-10T04:52:14.870
2011-03-10T14:58:04.520
null
null
8,005
[ "graphics", "isometric" ]
5,256,058
1
5,256,754
null
4
1,213
I had my NHibernate session management setup like follows: ``` protected MvcApplication() { BeginRequest += delegate { NHibernateSessionManager.Instance.OpenSession(); }; EndRequest += delegate { NHibernateSessionManager.Instance.CloseSession(); }; } ``` And for when I needed to save to the database, I made an ActionFilterAttribute that looked like this: public class TransactionAttribute: ActionFilterAttribute { private ITransaction _currentTransaction; ``` public override void OnActionExecuting(ActionExecutingContext filterContext) { _currentTransaction = NHibernateSessionManager.Instance.CurrentSession.Transaction; _currentTransaction.Begin(); } public override void OnActionExecuted(ActionExecutedContext filterContext) { if (_currentTransaction.IsActive) { if (filterContext.Exception == null) _currentTransaction.Commit(); else { _currentTransaction.Rollback(); } } _currentTransaction.Dispose(); } } ``` and then I could just add [Transaction] to my action method. This seemed to work in initial testing, but I then I tried using at HttpWebRequest to call an action method from another app multiple times and I had issues. Testing with Fiddler I setup a POST request and then fired them off in quick succession and it showed up the following: ![WebRequests](https://i.stack.imgur.com/4YYqk.png) THe red ones are various errors that I believe is to do with threading. My NHibernateSessionManager uses the HTtpContext to store the session like this: ``` public ISession CurrentSession { get { return (ISession)HttpContext.Current.Items["current.session"]; } set { HttpContext.Current.Items["current.session"] = value; } } ``` So, to fixed it, I moved my Transaction code into my BeginRequest and EndRequest methods - and then I could fire off heaps in succession. My question is - why did this fix it? I would have thought that I would have had something similar to this: Begin Request - opens session OnActionExecuting - starts transaction action code OnActionExecuted - commits transaction End Request - closes session and that this would be unique to each request, so it shouldn't interfere with one another, because there should be a different HttpContext for each request shouldn't there? Or are they shared or something?? Can someone enlighten me?
HttpContext in MVC Attributes - threading issues?
CC BY-SA 2.5
0
2011-03-10T06:01:03.147
2011-03-10T07:37:16.133
null
null
126,597
[ "asp.net-mvc", "nhibernate", "httpcontext" ]
5,256,153
1
5,259,090
null
7
8,078
i have a task to modify the PDF and add an image into it, for which I Have used the FPDF and FPDI libraries.. whose action code is given below: ``` <?php require_once('fpdf.php'); require_once('fpdi.php'); $pdf =& new FPDI(); $pdf->AddPage(); //Set the source PDF file $pagecount = $pdf->setSourceFile("Completed.pdf"); //Import the first page of the file $tpl = $pdf->importPage(1); //Use this page as template // use the imported page and place it at point 20,30 with a width of 170 mm $pdf->useTemplate($tpl, 20, 30, 170); #Print Hello World at the bottom of the page //Select Arial italic 8 $pdf->SetFont('Arial','',8); $pdf->SetTextColor(0,0,0); $pdf->SetXY(90, 160); //$pdf->Rotate(90); $pdf->Image('think.jpg',120,240,20,20); $pdf->Image('think.jpg',120,260,20,20); //$pdf->Write(0, "Hello World"); $pdf->Output("modified_pdf.pdf", "F"); ?> ``` But When I get the Modified pdf I can get very distorted modified pdf... whose screen shot is given below: ![enter image description here](https://i.stack.imgur.com/pxrc0.jpg) The Original Document is as given below: ![enter image description here](https://i.stack.imgur.com/1DGwf.jpg) Hence Could anyone help me in retrieveing the correct Modified PDF using the same code/ modified code..?
How to get the exact modified PDF using FPDF/FPDI?
CC BY-SA 3.0
0
2011-03-10T06:14:10.553
2012-12-22T04:21:05.463
2012-12-22T04:21:05.463
367,456
184,814
[ "php", "pdf", "fpdf", "fpdi" ]
5,256,348
1
5,256,369
null
2
1,828
I have download the source from [https://github.com/ResultsDirect/LinkedIn-iPhone](https://github.com/ResultsDirect/LinkedIn-iPhone) . Demo working fine, and try to use in my application. I have followed all the steps already whatever required as mention here in [post](http://developer.linkedin.com/message/6139#6350) ... But I have getting the error ``` "_OBJC_CLASS_$_RDLinkedInEngine", referenced from: "_OBJC_CLASS_$_RDLinkedInAuthorizationController", referenced from: ``` ![](https://i.stack.imgur.com/RcydN.png) When I comment the lines of RDLinkedInEngine and RDLinkedInAuthorizationController then error are removed ``` - (void)loadView { [super loadView]; // rdEngine = [[RDLinkedInEngine engineWithConsumerKey:kOAuthConsumerKey consumerSecret:kOAuthConsumerSecret delegate:self] retain]; } - (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // if( !rdHasAppeared ) { // UIViewController* controller = [RDLinkedInAuthorizationController authorizationControllerWithEngine:rdEngine delegate:self]; // if( controller ) { // [self presentModalViewController:controller animated:YES]; // rdHasAppeared = YES; // } // else { // NSLog(@"Already authenticated"); // } // } } ``` I my application I have already integrated MGTwitterEngine from source [https://github.com/bengottlieb/Twitter-OAuth-iPhone](https://github.com/bengottlieb/Twitter-OAuth-iPhone) Which is wokring ok.
Try to integrate LinkedIn in iPhone application
CC BY-SA 2.5
0
2011-03-10T06:40:17.643
2011-11-26T15:00:05.647
2011-03-10T06:43:32.213
189,950
488,506
[ "iphone-sdk-3.0", "sdk", "linkedin" ]
5,256,398
1
null
null
4
18,004
This should be rather simple but I don't know why I get Row Count as Zero when I use ROW COUNT transformation in Data Flow Task. I have created a variable(NoOfRecords) with Package scope. Variable name set to variable NoOfRecords in Row Count Transformation. ![Image1](https://i.stack.imgur.com/a9wgb.png) Used a Derived column to assign the row count.![Image2](https://i.stack.imgur.com/A8xQq.png) The package runs successfully and shows record count 265![Image3](https://i.stack.imgur.com/Bu2NE.png) But the Derived column shows record count as 0 instead of 265 rows. ![enter image description here](https://i.stack.imgur.com/zRUNx.png)
SSIS 2008 Row Count Transformation - Row count return 0
CC BY-SA 2.5
null
2011-03-10T06:48:00.887
2019-01-11T20:19:50.823
null
null
374,902
[ "sql", "sql-server-2008", "ssis" ]
5,256,419
1
5,363,608
null
3
1,674
I have two web projects in Visual Studio 2008 SP1, One hosting a WCF service and another that I am using to consume the WCF service. The service in question exposes a webHttpBinding endpoint and take JSON as input and returns JSON. I have used Jquery ajax to consume the service from the client web app like so: ``` $(document).ready(function () { var data = '{"myobject":{"Business":"PIZZA"}}'; $.ajax({ type: "POST", contentType: "application/json", data: data, dataType: 'json', url: "http://localhost:1212/JobInfo.svc/ReturnThisString", error: function(XMLHttpRequest, textStatus, errorThrown) { alert("Error"); }, success: function(data) { alert("BoolValue: " + data.GetDataUsingDataContractResult.BoolValue); alert("StringValue: " + data.GetDataUsingDataContractResult.StringValue); } }); }); ``` And I get the following error in the Firebug HTML request: ``` http://localhost:1212/JobInfo.svc/ReturnThisString 405 Method Not Allowed ``` But if run the exact same file in the web project that is hosting the project it works fine. The hosting project is running on set port localhost:1212 and the client on localhost:RANDOM_PORT. As the localhost is the same I would imagine its not a Cross Domain issue? Or does the port part count also? The server contract is as follows: ``` [OperationContract] [WebInvoke(Method="POST",UriTemplate="ReturnThisString", BodyStyle=WebMessageBodyStyle.Wrapped, RequestFormat=WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json)] EventListArgs ReturnThisString(EventListArgs myobject); [Serializable] [DataContract] public class EventListArgs { [DataMember( IsRequired = false)] public string Business; [DataMember( IsRequired = false)] public string Feeder; } ``` And the implemented code is: ``` public EventListArgs ReturnThisString(EventListArgs myobject) { return myobject; } ``` This was added as a simple method to prove I had not just done something silly. What I like to call a sanity check. Its a simple function that takes a complex(of type other then string) JSON object as a parameter and returns a complex JSON object. ![enter image description here](https://i.stack.imgur.com/7esM6.png) As you can see above I have two web project that use the Visual Studio Built in web server (local IIS install not possible). The above configuration does not work but if you can see I have also got the Darkside test page in the server host which is an exact copy from the client and this work with no problems at all.
WCF "Method Not Allowed" in Visual Studio integrated webserver
CC BY-SA 2.5
null
2011-03-10T06:52:17.983
2012-07-13T13:44:56.317
2011-03-15T06:18:58.937
615,511
615,511
[ "c#", "visual-studio", "wcf" ]
5,256,591
1
null
null
0
2,545
![Ad Blocks Page Image](https://i.stack.imgur.com/QPUjZ.png) Dear All, I have this page in which if i mouseover on any orange ad block, then blue dashed border comes and on click of each ad block the respective info is displayed. I have the code block in JQuery as ``` var cssObj = { 'border' : 'Dashed 2px #3B5998' } var cssObj2 = { 'border' : 'none' } $(".gil_Ads_AdOverState1").mouseover(function(){ $(this).css(cssObj); }).mouseout(function(){ $(this).css(cssObj2); }); $(".gil_Ads_AdOverState1").click(function(){ $('#gDescZone1').hide(); $('#gDescZone2').hide(); $('#descAd2').hide(); $('#descAd3').hide(); $('#descAd4').hide(); $('#descAd1').fadeIn(); }); ``` It is working fine in Chrome while same is not working in IE8... May i know what is the problem.
mouseover mouse out nt working in IE8
CC BY-SA 2.5
0
2011-03-10T07:16:50.370
2011-03-10T17:13:08.083
null
null
348,170
[ "jquery", "css" ]
5,256,619
1
5,256,944
null
2
456
See working example at [http://jsfiddle.net/xqwqH](http://jsfiddle.net/xqwqH/). I have a green div inside a red div. Green div is positioned using jQuery postion(). If I resize the browser to where the bottom edge is inside the green square and refresh the page (see example below), the green square moves to a different location. I thought it was a bug in the browser but when it worked the same way in IE8, FF and Chrome, it seems this behavior is normal. Why does the div change position when browser window was resized in that manner? ![Part of screen capture](https://i.stack.imgur.com/Hl99a.gif)
Why position of div is different when browser is resized to a certain dimension?
CC BY-SA 2.5
null
2011-03-10T07:20:49.027
2011-03-10T09:05:08.597
null
null
129,001
[ "html", "css", "jquery-ui", "browser", "position" ]
5,256,709
1
5,256,863
null
0
211
I am having following table structure ![enter image description here](https://i.stack.imgur.com/3bGB5.png) and having the following Data in this table ![enter image description here](https://i.stack.imgur.com/yZfV0.png) Now I want to query in such a way so that I can have values of all the columns + the value of max(currenttime) for a particular game_id. i am running the following query SELECT _id, game_id, inning_id, scoretype, oponentonescore, oponenttwoscore, currenttime, MAX( currenttime ) AS latest FROM `game_scores` WHERE game_id = '2268' and as a result i am getting only one row as in the following result ![enter image description here](https://i.stack.imgur.com/ttOHs.png) But i want want all rows matching the criteria(i.e. game id 2268) How to compose Query to achieve this? Thanks in advance
How to get max(colName) value where colName is of Type TimeStamp in mySQL
CC BY-SA 2.5
null
2011-03-10T07:31:38.227
2011-03-10T08:01:46.480
null
null
395,661
[ "php", "mysql", "database" ]
5,256,742
1
5,294,794
null
1
769
I am using express checkout. following are the steps. ``` Step 1. it takes me to paypal website to login Step 2. It displays review information page as attached image. Step 3. It returns back control to my website to finally contains pay button. Step 4. At the end it tells successs or failure page. ``` Now i want change here i want to reduce step 3 and i want checkout button on the paypal page instead continue button as shown in attached image. Any quick idea how to do it ? ![enter image description here](https://i.stack.imgur.com/2LJPE.png)
paypal express checkout checkout button on review information page
CC BY-SA 2.5
null
2011-03-10T07:35:45.333
2017-09-13T15:54:19.840
2017-09-13T15:54:19.840
881,229
216,431
[ "paypal", "express-checkout" ]
5,257,158
1
5,258,727
null
0
524
The following bit of code populates a class that inherits from the class, with menu items. So is basically a wx.Menu. When I run the flowing code snippet, the line seems to change the highlighting from the default: ![enter image description here](https://i.stack.imgur.com/TGcal.png) to this plain blue style: ![enter image description here](https://i.stack.imgur.com/sUKEd.png) The line simply adds an icon (test). But, for some reason it changes the highlighting style. I know this is about as nitpicky as it gets, but I'd like to the first images highlighting style with the second images Icon. This is in Windows 7 if it makes a difference. Snippet: ``` about = wx.MenuItem(self, -1, 'About...') about.SetBitmap(wx.Bitmap('Icon24.ico')) # The line that's causing the problem. itemlist = [self.AppendItem(about), self.AppendSeparator(), self.Append(-1, 'Options...'), self.AppendSeparator(), self.Append(-1, 'Exit')] for i in itemlist: self.Bind(wx.EVT_MENU, self.menu_beh, i) ```
Icons Affecting Menu Style in wxPython on Windows 7
CC BY-SA 2.5
null
2011-03-10T08:34:22.347
2011-03-10T11:00:46.143
null
null
433,417
[ "python", "windows-7", "menu", "wxpython", "highlighting" ]
5,257,172
1
null
null
1
269
Here i have some text and slecect boxes.. Here i am attaching picture which is looks like and i need the code in zend from.. Regards kiran![enter image description here](https://i.stack.imgur.com/Zzh8C.jpg)
How to give space between the text in zend from?
CC BY-SA 2.5
null
2011-03-10T08:36:10.180
2011-03-10T13:40:26.690
null
null
607,745
[ "zend-framework", "zend-form" ]
5,257,273
1
5,257,747
null
0
3,753
I have the following [multiselect control](http://dev.sencha.com/deploy/dev/examples/multiselect/multiselect-demo.html) in a Ext JS form which looks like this: ![enter image description here](https://i.stack.imgur.com/OIEHq.png) How can I change the two legends "Available" and "Selected"? I see in the file `ItemSelect.js` where I could set these once internally: ![enter image description here](https://i.stack.imgur.com/QpQd8.png) , e.g. something like: ``` msConfig[0].legend = 'verfügbar'; msConfig[1].legend = 'ausgewählt'; ``` Calling code: ``` }, { xtype: 'itemselector', name: 'itemselector', fieldLabel: 'ItemSelector', width: 700, imagePath: 'images/multiselect/', multiselects: [{ width: 250, height: 200, store: new Ext.data.ArrayStore({ data: [[123,'One Hundred Twenty Three'], ['1', 'Two'], ['2', 'One'], ['3', 'Three'], ['4', 'Four'], ['5', 'Five'], ['6', 'Six'], ['7', 'Seven'], ['8', 'Eight'], ['9', 'Nine']], fields: ['value','text'], sortInfo: { field: 'value', direction: 'ASC' } }), displayField: 'text', valueField: 'value' },{ width: 250, height: 200, store: [['10','Ten'],['11','Eleven'],['12','Twelve']], tbar:[{ text: 'clear', handler:function(){ simple_form.getForm().findField('itemselector').reset(); } }] }] }, ```
How can I set the legend in Ext JS ItemSelector/Multiselect control?
CC BY-SA 2.5
null
2011-03-10T08:47:36.927
2011-03-10T09:34:26.313
null
null
4,639
[ "javascript", "extjs", "multi-select", "itemselector" ]
5,257,417
1
49,305,482
null
5
3,116
I wonder if there is a way to display paragraph text with diagonal indent to be some thing like that! ![enter image description here](https://i.stack.imgur.com/ThgG1.gif) Keeping in mind that this text is written in WYSIWYG editor (Contains html tags). I was thinking if there is a way to count the words within the paragraph excluding html tags and then making some equations to increase the indent of the text every line by jQuery or Javascript. Is there any suggestions to do that ?
Display Paragraph's text with Diagonal Indent
CC BY-SA 2.5
0
2011-03-10T09:02:18.113
2018-03-15T17:15:41.950
2011-03-10T09:15:26.600
287,047
653,197
[ "php", "javascript", "jquery", "css" ]
5,257,576
1
5,257,823
null
1
265
I am currently developing a silverlight application, however yesterday I started getting the following error message every time I run the project: ![Webpage Error - Line: 1805 - Error: Object doesn't support this property or method](https://i.stack.imgur.com/Ct2PM.jpg) I am a little confused as to why I am getting this message, and am looking for some help to track down the cause. If I click "yes" to debug - nothing happens. Also, I have no Line 1805 in any of my source files! This error message started appearing yesterday, and appears as soon as I run the project, shortly before the first page loads. If i click yes or no, the project then loads and runs perfectly, I cannot see any unwanted behaviour. I have been using source control, so I rolled back the project to a point before the error started appearing, however I am still getting the error! Could it be a setting in VS Web Developer Express 2010 that I have accidentally changed?
help debugging a silverlight application
CC BY-SA 2.5
null
2011-03-10T09:17:55.807
2011-03-10T09:42:33.103
null
null
582,836
[ "asp.net", "vb.net", "silverlight", "visual-studio-2010", "debugging" ]
5,257,829
1
null
null
2
924
I am currently developing a back end interface for a client of mine and i've hit a brick wall. It seems that Internet Explorer (all versions, including 9 beta) and Chrome are not displaying the page as desired. Firefox and Safari are displaying the page perfectly. I find it rather strange that it works on safari but not chrome.. anyway that's besides the point. How the form looks in Safari and Firefox - it is the desired outcome: ![enter image description here](https://i.stack.imgur.com/9iU1y.png) How the form looks in all browsers other than Safari and Firefox - this is not desired: ![enter image description here](https://i.stack.imgur.com/NcHv4.png) I'm after a way to make the background expand to the width that is set in the css in these other browsers. Any hints and tips would be much appreciated as I've been stuck on this for about 5 hours today and it's starting to get very frustrating for me. After some help, i've narrowed the problem down to the jQuery plugin "equal height columns" however I require the effect is has, so surely there is a way to make this work in the other browsers. --- My HTML is: ``` <head> <meta charset="UTF-8"> <title>User Login</title> <link rel="shortcut icon" href="images/favicon.png" /> <link rel="stylesheet" href="stylesheets/reset.css" type="text/css" /> <link rel="stylesheet" href="stylesheets/styles.css" type="text/css" /> <script src="javascript/jquery.js" type="text/javascript"></script> <script src="javascript/jquery.equalHeightColumns.js" type="text/javascript"></script> <meta name="description" content="" /> <meta name="keywords" content="" /> <meta name="robots" content="" /> <script type="text/javascript"> $(document).ready(function() { $("#form_left, #form_right, #form_right input").equalHeightColumns(); }); </script> </head> <body> <a href="forgot_password.html" class="loginmeta">Forgot Password?</a> <div id="container"> <div id="header"> <h1><a href="#">User Login</a></h1> </div> <div id="form"> <form name="login" action="#" method="post"> <div id="form_left"> <label for="">Username</label> <input type="text" id="username" /> <label for="">Password</label> <input type="password" id="password" /> </div> <div id="form_right"> <input type="submit" name="submit" value="Log In" /> </div> <div class="clear"></div> </form> </div> </div> </body> ``` and the CSS: ``` //* TYPE */ a.loginmeta { position: absolute; right: 20px; top: 20px; color: #4a4f5b; font-size: 12px; } a.loginmeta:hover { color: #5d6472; } /* STRUCTURE */ body { background: url('../images/page_background.png') repeat; } #container { width: 480px; display: block; margin: 100px auto 0 auto; } /* FORM */ form { width: 480px; margin: 30px 0 15px 0; } form label { color: #919191; text-transform: uppercase; display: block; margin-bottom: 10px; } form input { background: #ffffff; border: 1px solid #d1d1d1; font-size: 17px; color: #414141; padding: 10px; margin-bottom: 10px; width: 328px; } #form_left, #form_right { -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; -webkit-box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2); -moz-box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2); box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2); } #form_left { float: left; width: 350px; background: url('../images/form_background.png') repeat-x bottom left #f3f3f3; padding: 20px 20px 10px 20px; } #form_right { float: right; background: url('../images/form_background.png') repeat-x bottom left #f3f3f3; padding-bottom: 30px; } #form_right input { width: 80px; font-size: 12px; text-transform: uppercase; color: #939393; background: none; border: none; margin: 15px 0; padding: 0; } *** ``` Thank you!
Expand Parent Div to width of Elements with CSS and HTML
CC BY-SA 3.0
0
2011-03-10T09:43:13.977
2014-05-30T17:06:11.280
2014-02-06T16:32:48.593
901,048
653,266
[ "html", "css", "width", "expand" ]
5,258,007
1
5,331,457
null
1
1,747
I have a strange situation where the following code works however XCode warns it is deprecated... ``` NSString *col1 = [NSString stringWithCString:(char *)sqlite3_column_text(compiledStatement, 0)]; ``` However as that is the deprecated method if I set an encoding the string comes out wrong! I have tried all the encodings but none work! ``` NSString *col1 = [NSString stringWithCString:(char *)sqlite3_column_text(compiledStatement, 0) encoding:NSASCIIStringEncoding]; ``` ![enter image description here](https://i.stack.imgur.com/hYPhE.png)
SQLite MYSQL character encoding
CC BY-SA 2.5
null
2011-03-10T09:58:49.293
2014-09-25T08:48:01.037
null
null
103,999
[ "iphone", "sqlite", "nsstring" ]
5,258,189
1
null
null
4
14,677
I have to write a little OSX app which make use of an NSTableView, but I didn't find a very good example of it, I would like have this result: Someone could help me? ![enter image description here](https://i.stack.imgur.com/c4jrR.png)
NSTableView example of use
CC BY-SA 2.5
0
2011-03-10T10:13:11.783
2012-09-14T11:45:25.083
null
null
554,892
[ "objective-c", "macos", "nstableview" ]
5,258,234
1
null
null
-1
19,849
I don't know how to do this. I opened my SQL Server and connected using Windows Authentication at 10am. Until now, it does not go to the "Explorer". I checked the services. The SQL Server Browser is running as well as the SQL Server Service. I restarted the service, but this did not solve the problem. What should I do? Below is the screen shot of the error. ![enter image description here](https://i.stack.imgur.com/C8kyg.jpg) (note the Server name has bee removed intentionally, I am actually using a server name) Here's regarding the services I mentioned earlier ![enter image description here](https://i.stack.imgur.com/3KcUH.jpg)
SQL Server 2008 cannot connect to Database Engine
CC BY-SA 3.0
null
2011-03-10T10:16:46.510
2016-09-15T05:22:50.993
2013-11-15T01:14:43.730
1,690,193
440,310
[ "sql-server", "sql-server-2008" ]
5,258,284
1
null
null
1
2,985
I am struggling with the configuration of the Eclipse Dali plugin and Hibernate. The version I'm using is [as recommended](http://www.jboss.org/tools/download/installation/update_3_2.html): - - When configuring the Java Persistence properties for my project, I created a user library named "Hibernate JPA" and included the following JARs: - - - - - - - - As long as the folder is outside of my project directory, everything works fine. However, if I put the Hibernate folder into the project directory, I get an error saying "Required class org.hibernate.SessionFactory does not exist in selected libraries": ![enter image description here](https://i.stack.imgur.com/QVwZA.png) The error text is wrong, the required class is definitely included in , and everything works as expected when I move the JARs outside of my project directory. I have two questions about that: 1. I do not understand why the User Library behaves differently depending on whether the JARs are placed inside or outside of my project directory. Could anybody explain what's happening here? 2. I would like to have my project in SVN, including all the required libraries. Is there any way to configure Dali to accept User Libraries within the project directory? Thank you very much.
Where to put the User Library for Eclipse-Dali-Hibernate integration?
CC BY-SA 2.5
0
2011-03-10T10:21:03.173
2012-10-16T06:11:01.987
2011-03-10T16:19:06.993
170,825
170,825
[ "eclipse", "hibernate", "jpa" ]
5,258,576
1
5,258,703
null
0
209
![enter image description here](https://i.stack.imgur.com/K1sbO.png) I am a beginner in android.I need to design my layout as given in the image(place 2 images in the 2 ends of the screen). But as per my code, its not showing as like the given image in my galaxy tablet. Please help. My code is : ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" android:background="#FFFFFF"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginLeft="50dp" android:layout_marginTop="50dp"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:id="@+id/imgPicture" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/cam2" android:onClick="@string/camera_click"> </ImageView> <TextView android:text="Camera" android:id="@+id/TextView01" android:textColor="#000000" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" android:layout_marginLeft="70dp"> <TextView android:text="" android:id="@+id/TextView015" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> <TextView android:text="" android:id="@+id/TextView06" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical" > <ImageView android:id="@+id/imgPicture1" android:onClick="@string/gallery_click" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/photosgallery"> </ImageView> <TextView android:text="Gallery" android:id="@+id/TextView02" android:layout_marginTop="15dp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textColor="#000000" ></TextView> </LinearLayout> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="horizontal" android:layout_marginLeft="55dp" android:layout_marginTop="50dp"> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:orientation="vertical"> <ImageView android:id="@+id/imgPicture2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/contacts"> </ImageView> <TextView android:text="Contacts" android:id="@+id/TextView03" android:textColor="#000000" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:layout_gravity="right" android:orientation="vertical" android:layout_marginLeft="70dp" > <TextView android:text="" android:id="@+id/TextView012" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> <TextView android:text="" android:id="@+id/TextView013" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="right" android:orientation="vertical" > <ImageView android:id="@+id/imgPicture3" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/process"> </ImageView> <TextView android:text="Processed" android:id="@+id/TextView04" android:textColor="#000000"android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </LinearLayout> </LinearLayout> </LinearLayout> ```
Problem in designing a layout
CC BY-SA 2.5
null
2011-03-10T10:47:31.167
2018-02-07T13:13:27.513
null
null
548,218
[ "android", "android-layout" ]
5,258,653
1
null
null
3
511
This is a follow up question to [The MVC pattern and SWING](https://stackoverflow.com/questions/5217611/the-mvc-pattern-and-swing). I am trying to implement the MVC pattern in an existing piece of code. The existing code creates a JFrame which acts as both the view and the controller. The JFrame has a table, and the table's model is an adapter to a custom data model. Whenever the user performs an action, the model would be updated by doing something like the following: ``` CustomDataTableModel cdtm = (CustomDataTableModel) DataTable.getModel(); CustomDataModel cdm = cdtm.getModel(); cdm.delete(1); ``` I've tried to visualise how it currently works, but I've also visualised how I imagine the relationships with the future controller and model should be. ![MVC](https://i.stack.imgur.com/sDbV8.jpg) Now, my question is simply whether I can continue using the model as it is now? Could I implement the following and still "adhere" to the MVC pattern? 1. The user selects an element in the table, and clicks on a delete button. 2. The view delegates the action to the controller. 3. The controller access the table through an accessor on the view, and performs the update. 4. The model, when it is updated, notifies the JTable that it has been changed. If any other components in the view displays data from the table, then this could be solved by registering listeners on the JTable's table model. ### Update 1 I've been thinking about the existing code in light of the MVC pattern, and I've redrawn the relationships a little. The point is that the controller is the behaviour of the view, thus the controller updates the model when users do stuff, and the view listens for changes in the model. However, nothing in the MVC pattern stops the view from listening to the model through a tablemodel - right? ![MVC](https://i.stack.imgur.com/rxDXH.jpg) Now, the user clicks the add button. The view notifies the controller that the add button has been clicked, and the controller takes care of creating a new item by invoking some method on the model. The view is registered as a listener on the model (through a table model) and updates its view. The controller may also be a listener on the model in case it needs to take care of disabling or locking fields. Have I not achieved what the MVC is all about; separation of concerns? As far as I can see, I've even introduced the adapter pattern to decouple the view even more from the model? It is late and I am tired, so that might be why it makes sense :-)
Apply the MVC pattern to an existing application
CC BY-SA 2.5
0
2011-03-10T10:55:15.633
2011-03-10T21:15:34.687
2017-05-23T12:30:38.833
-1
355,232
[ "java", "model-view-controller", "swing" ]
5,258,738
1
5,258,828
null
1
1,996
i want to implement more advance search than the filter toolbar in jqgrid so i changed my code to set multipleSearch: true: ``` jQuery("#grid").navGrid("#pager", { multipleSearch:true, add: false, edit: false, del: false }, {}, {}, {}, {} ``` i do get the Search Icon in my footer toolbar ![enter image description here](https://i.stack.imgur.com/7x6z2.png) but when i click on it, i just get the single field search GUI. ![enter image description here](https://i.stack.imgur.com/XoohB.png) does anyone know why this would not show up the multiple search GUI? Am i missing some extra plugin or config setting ?
trying to use multiple search with jqgrid but only single search GUI pops up
CC BY-SA 2.5
null
2011-03-10T11:01:36.897
2011-03-10T11:09:06.580
null
null
4,653
[ "jquery", "jqgrid" ]
5,258,740
1
5,258,834
null
6
3,453
I am using shape context histograms as a feature descriptor to encode silhouette images. To assist with debugging, I would like to view the shape context logpolar bins overlaid on a silhouette image (the sample points taken from the edge image). An example of what it should look like for one of the points is as follows: ![Overlaid shape context logpolar bins](https://i.stack.imgur.com/qJiLB.png) I know how to display the circles (radial bins), but I am having difficulty in producing the angular bins (lines). Given a set of angles, how can I draw line segments similar to those shown in the example image?
Drawing shape context logpolar bins in MATLAB
CC BY-SA 2.5
0
2011-03-10T11:01:49.593
2016-02-06T13:06:25.040
2015-06-14T06:08:20.850
1,576,602
568,145
[ "matlab", "machine-learning", "computer-vision", "pattern-recognition", "shape-context" ]
5,258,802
1
5,258,837
null
19
27,762
I have a problem getting the text in an input to show correct in Internet Explorer 8. Firefox, Safari and Chrome all show the same. Firefox, Safari and Chrome ![Firefox, Safari and Chrome](https://i.stack.imgur.com/ok2jh.jpg) Internet Explorer 8 ![Internet Explorer 8](https://i.stack.imgur.com/PauhF.jpg) ``` <form action="" method="get"> <input id="q" name="q" type="text"> <input id="s" name="s" type="submit" value="Sök"> </form> #q { background:url(../../image_layout/search_field.png) no-repeat; width:209px; height:32px; padding:0 5px 0 5px; text-align:left; margin:0; border:0; font-family:Arial, Helvetica, sans-serif; font-size:14px; font-weight:bold; color:#09305b; font-weight:bold; position:absolute; left: 0px; top: 19px; } #s { background:url(../../image_layout/serach_buttom.png) no-repeat; width:56px; height:34px; padding:0; margin:0; color:#FFFFFF; font-family:Arial, Helvetica, sans-serif; font-size:14px; font-weight:bold; border:0; position:absolute; left: 225px; top: 17px; } ```
Css style problems on input in IE8
CC BY-SA 2.5
0
2011-03-10T11:06:51.080
2016-02-04T19:01:30.837
null
null
266,642
[ "html", "css", "input", "textinput" ]
5,258,968
1
6,917,529
null
0
745
I've noticed in testing a problem whereby Flowplayer will not play any content without a internet connection. All the files which make up my project are stored locally, and I've gone through and checked all the paths to make sure nothing points outwards towards the internet. Curiously if I pull the internet connection out before the web page loads, the video file fails to load, however installing a loopback adapter gets around this. How can I alleviate this problem? For proofs sake I've loaded the page in chrome looked at the network activity; ![chrome network activity](https://i.stack.imgur.com/iwT91.png)
Flowplayer requires an internet connection?
CC BY-SA 2.5
null
2011-03-10T11:21:27.680
2011-08-02T19:32:20.207
null
null
271,200
[ "flash", "windows-vista", "flowplayer" ]
5,258,992
1
5,259,100
null
1
7,027
I am building an online shop and I have a problem. I will have products which have a direct price (for example HTC Touch 2 Smartphone: $299.00 ), but in the same time I will have products which have prices for combinations based on specifications: In this image you can see the database diagram, which I think would be ok for the multiple-price products: ![database diagram](https://i.stack.imgur.com/ikwH4.png) THE MAIN PROBLEM: Since this is a webshop, people will put items in the shopping cart. I think the items inserted into the shopping cart should be from the same table (in our case it would be the `[combinations]` table, since there are the prices stored). Here are some data for these tables, just to be more clear: `[products]` ``` productid | productName 1 | Nike T-Shirt 2 | HTC Touch 2 Smartphone ``` `[specifications]` ``` specId | productId | specName 1 | 1 | Size 2 | 1 | Color ``` `[specvalues]` ``` specValueId | specId | svValue 1 | 1 | L 2 | 1 | XL 3 | 2 | white 4 | 2 | blue 5 | 2 | red ``` `[combinations]` (items into the cart) ``` combinationId | price | description 1 | 10 | White L Nike T-Shirt 2 | 15 | White XL Nike T-Shirt 3 | 11 | Blue L Nike T-Shirt 4 | 16 | Blue XL Nike T-Shirt 5 | 18 | Red XL Nike T-Shirt ``` `[combinationParts]` ``` nmid | combinationId | specValueId 1 | 1 | 1 2 | 1 | 3 3 | 2 | 2 4 | 2 | 3 5 | 3 | 1 1 | 3 | 4 2 | 4 | 2 3 | 4 | 4 4 | 5 | 2 5 | 5 | 5 ``` I hope my diagram and database population does make sense :) . So the question is how can I store the single price products (HTC Touch 2 Smartphone) so it can be added to shopping cart just like the multiple price products.
MySQL database structure for a webshop
CC BY-SA 2.5
0
2011-03-10T11:23:10.647
2017-01-30T23:55:06.267
2011-03-10T11:38:09.853
366,738
281,005
[ "mysql", "database-design", "mysql-management", "webshop" ]
5,259,015
1
6,068,281
null
4
4,222
I have an Android App that dynamically scales text depending on the resolution of the android device. I have tested this code on all the predefined resolutions in the Android Simulator and my code works fine. (This includes the same resolutions as on HTC Desire and Motorola Droid) It also works fine on my HTC Wildfire. Here are some screen shots from the simulators: ![enter image description here](https://i.stack.imgur.com/mJ6cQ.png) ![enter image description here](https://i.stack.imgur.com/Joyc4.png) ![enter image description here](https://i.stack.imgur.com/0rSjv.png) However... I have tried this on HTC Desire, and I have had reports from users using Motorola Droid that the fonts are not scaling correctly: ![enter image description here](https://i.stack.imgur.com/uzcOK.jpg) Note how it is chopping the text off. Any ideas why this is not working on these particular devices? I currently have a function that scales the text down depending on the available height for the text... something like this: ``` public static float calculateHeight(FontMetrics fm) { return Math.abs(fm.ascent) + fm.descent; } public static int determineTextSize(Typeface font, float allowableHeight) { Paint p = new Paint(); p.setTypeface(font); int size = (int) allowableHeight; p.setTextSize(size); float currentHeight = calculateHeight(p.getFontMetrics()); while (size!=0 && (currentHeight) > allowableHeight) { p.setTextSize(size--); currentHeight = calculateHeight(p.getFontMetrics()); } if (size==0) { System.out.print("Using Allowable Height!!"); return (int) allowableHeight; } System.out.print("Using size " + size); return size; } ``` Any ideas why this is happening on only a couple of devices? and how I can fix it? Is there another font metric than I need to be considering here which I don't know about? Like Scale or DPI? Thanks.
FontMetrics not correct when run on android device. Simulator fine
CC BY-SA 3.0
null
2011-03-10T11:25:23.967
2011-05-20T11:49:10.480
2011-05-20T11:47:29.373
247,221
383,369
[ "java", "android", "fontmetrics" ]
5,259,087
1
null
null
0
342
I create csv file from my web app and when the web app runs in my system with browser language set to English the file gets downloaded and on open shows the expected format. But when i change my language to Danish it shows like below ! [Wrong csv file format](https://i.stack.imgur.com/xonWh.png) The correct format should be like this ![Correct csv file format ](https://i.stack.imgur.com/fx57w.png) How do i correct this so that irrespective of the language the language the file csv file gets downloded properly ? Thanks in Advance
CSV File creation affected by regionnal setting
CC BY-SA 2.5
null
2011-03-10T11:32:25.410
2011-03-10T14:26:56.813
null
null
581,157
[ "csv" ]
5,259,268
1
5,259,903
null
5
2,302
I would like to create a NSBezierPath object which corresponds to the outline of an arbitrary bitmap image. All my images are png solid monochrome shapes with transparent backgrounds. Here is an examplee: ![Bitmap image of solid padlock shape](https://i.stack.imgur.com/Cd4gL.png) I want the bezier path of the outline of the shape. What is the bast way to achieve this?
Create NSBezierPath from bitmap outline
CC BY-SA 2.5
0
2011-03-10T11:54:19.800
2016-07-08T00:17:15.117
null
null
220,847
[ "objective-c", "cocoa", "nsbezierpath" ]
5,259,335
1
5,259,374
null
1
129
Is there a UML notation for how many levels deep a recursion can be? In a simple composition model I have branches that can have branches or leaves. But a branch can only have a kid-branch and a grandkid branch, after that, It only can have leaves. ![enter image description here](https://i.stack.imgur.com/dITxx.png) Thanks!
UML notation for 'ending' composition
CC BY-SA 2.5
null
2011-03-10T12:02:28.873
2011-03-10T14:09:33.893
null
null
86,751
[ "uml", "composition" ]
5,259,360
1
5,259,815
null
0
417
![enter image description here](https://i.stack.imgur.com/df9Nx.png)i'm using a QR Code SDK when pressed the button, it will have a presentModalView in there i got a info button. i wanted it to link to another nib to show the info on how it works! ``` -(IBAction)QRscan; { //Make sure we can even attempt barcode recognition, (i.e. on a device without a camera, you wouldn't be able to scan anything). if([SKScannerViewController canRecognizeBarcodes]) { SKScannerViewController *scannerVC = [[SKScannerViewController alloc] init]; //Insantiate a new SKScannerViewController scannerVC.delegate = self; scannerVC.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel target:self action:@selector(cancelTapped)]; UIButton *button = [UIButton buttonWithType:UIButtonTypeInfoLight]; [button addTarget:self action:@selector(settingsTapped) forControlEvents:UIControlEventTouchUpInside]; UIBarButtonItem *infoItem = [[UIBarButtonItem alloc] initWithCustomView:button]; scannerVC.navigationItem.rightBarButtonItem = infoItem; scannerVC.title = @"Scan a QRcode"; qrtest.text = @""; //Reset our info text label. scannerVC.shouldLookForQRCodes = YES;//QRCode Checker UINavigationController *_nc = [[[UINavigationController alloc] initWithRootViewController:scannerVC] autorelease]; //Put our SKScannerViewController into a UINavigationController. (So it looks nice). [scannerVC release]; [self presentModalViewController:_nc animated:YES]; //Slide it up onto the screen. } - (void) settingsTapped { qrcode_info *otherVC = [[qrcode_info alloc] initWithNibName:@"qrcode_info" bundle:Nil ]; [self presentModalViewController: otherVC animated:YES]; [otherVC release]; } ```
presentModalView problem
CC BY-SA 2.5
null
2011-03-10T12:06:00.557
2011-03-29T08:47:00.637
2011-03-10T12:16:29.617
537,422
537,422
[ "iphone", "xcode", "ios", "presentmodalviewcontroller" ]
5,259,416
1
5,282,107
null
2
1,208
I want 2 navigation Controller to be attached to one Tab bar item. Basically the idea is to have 2 views on a single tab Item and there should be a navigation bar to push and pop the screens. (same like settings application in iPad). edited====== It will look like on left hand side there is a View with its own navigation Controller and on right hand side there is another View with its own navigation controller(or some other UI) to achieve the Push Pop stuff. I know how to attach 1 navigation Controller to one Tab bar Item. :- by implementing conmulligan code everything works property. But if I try to display some ModalViewController in lansdscape mode and when I try to close this ModalView the FirstViewController navigationbar becomes portrait(along with its View) and SecondViewController NavigationBar remains landscape(at it should be). This happens only in Device not in simulator. Below is my Code of presenting the ModalViewController. ``` ModalTableViewController *modalTableViewController = [[ModalTableViewController alloc]initWithNibName:@"ModalTableViewController" bundle:[NSBundle mainBundle]]; UINavigationController *localNavigationViewController = [[UINavigationController alloc] initWithRootViewController:modalTableViewController]; localNavigationViewController.modalPresentationStyle = UIModalPresentationFormSheet; [self presentModalViewController:localNavigationViewController animated:YES]; [modalTableViewController release]; [localNavigationViewController release]; ``` For Dismising the ModalViewCntroller I do it as below:- ``` [self dismissModalViewControllerAnimated:YES]; ``` Waiting for your replies.![enter image description here](https://i.stack.imgur.com/OH54D.png)
add two navigation controller to one Tab bar Item
CC BY-SA 2.5
0
2011-03-10T12:10:40.833
2011-04-03T08:14:48.163
2011-04-03T08:14:48.163
248,014
248,014
[ "iphone", "cocoa", "ipad" ]
5,259,532
1
5,260,573
null
1
2,474
I have a Menu that contains a TreePanel. The users need to be able to interact with a the TreePanel's nodes using a context menu. I'm showing the context menu from a function attached to the TreePanel's `contextmenu` event. This works except: 1. Without allowOtherMenus: true, showing the context menu causes the main menu, and therefore the TreePanel, to disappear ; 2. With allowOtherMenus: true on either menu, the context menu doesn't disappear when the users clicks a blank area of the TreePanel. I'm looking for a way to have the context menu to work as if the TreePanel were not an item within a menu. ![enter image description here](https://i.stack.imgur.com/V9C0y.png)
Context menu within a menu item in ExtJS
CC BY-SA 2.5
0
2011-03-10T12:22:08.903
2011-03-10T13:56:07.237
2011-03-10T13:27:31.777
280,490
280,490
[ "extjs" ]
5,259,576
1
5,259,609
null
1
490
I'm getting some strange behaviour here. Any help would be great. I start like this: ``` int *event_positions = (int *) malloc(1 * sizeof(int)); // let us start with 1 and then add more within the method. This should continue until we have all the flags we want. int number_of_flags = event_extractor(vocal_data, size, event_positions); // HERE I WOULD LIKE TO USE THE VALUES OF event_positions BUT THE ARE WEIRD I.E. THEY DON'T MATCH THE VALUES BEING PRINTED IN THE LAST METHOD. ``` Event extractor then passes on the variable to another method. Simplified this looks like this: ``` int event_extractor (int *audio_samples, unsigned int size_of_audio ,int *event_flags) { int number_of_flags = apply_threshold (lopass_samples, length, event_flags); // PRINT ARRAY event_flags HERE // VALUES ARE INCORRECT AND WEIRD } ``` The last method: ``` int apply_threshold (int *audio_samples, unsigned int size_of_audio, int *event_flags) { // DO SOME STUFF HERE. // PRINT THE ARRAY WHICH SHOW THE CORRECT VALUES. } ``` I hope this is clear. Basically I have an array which I pass as an argument and am having trouble accessing those values after the method has finished. --- First File: ``` int *event_positions = (int *) malloc(1 * sizeof(int)); // let us start with 1 and then add more within the method. This should continue until we have all the flags we want. int number_of_flags = event_extractor(vocal_data, size, event_positions); ``` Second File: ``` int apply_threshold (int *audio_samples, unsigned int size_of_audio, int *event_flags) { int flag = 0; // this will be the number of flags that I have bool run = true; // this will make sure that a minimum amount of time passes before I grab another flag. It's a guard. int counter = 0; // this is the counter for the above guard. printf("\n\nCURRENT MINIMUM TIME: 20100 SAMPLES \n\n"); // event_flags[0] = 1; // this first one is a dud. within the loop we will automatically start adding flags int threshold = calculate_threshold_value(audio_samples, size_of_audio); printf("\n\n this is the threshold %d \n\n", threshold); int length = (int)size_of_audio; for (int i = 0; i < length; i++) { if (audio_samples[i] > threshold && run) { // ** is this realloc working ? event_flags = (int*)realloc(event_flags, sizeof(int) * (flag+1)); // reallocate the size of the array event_flags[flag] = i; // printf("FLAG CREATED! %i\n ", i); printf("EVENT FLAG %i %i\n",flag, event_flags[flag] ); flag++; run = false; } if (!run) { counter++; if (counter > 20100) { // hardcode minimum size for now. counter = 0; run=true; } } } printf("\n\n\n NUMBER OF EVENTS --- %d\n", flag); for (int i = 0; i < flag; i++) { printf("FLAG %i -- %d\n", i, event_flags[i]); } printf("\nFIVE samples before and after my second flag: \n 0 should indicate a reach in the threshold\n"); for (int i = 0; i <10 ; i++) { printf("VOCAL SAMPLE %i %i \n", i-5,audio_samples[event_flags[1]+i-5] ); } return flag; } ``` --- I've updated my code according to Erik's model. My loop now looks like this ``` if (audio_samples[i] > threshold && run) { // ** is this realloc working ? // event_flags = (int*)realloc(event_flags, sizeof(int) * (flag+1)); *event_flags = (int*)realloc(*event_flags, sizeof(int) * (flag+1)); // reallocate the size of the array *event_flags[flag] = i; // printf("FLAG CREATED! %i\n ", i); printf("EVENT FLAG %i %i\n",flag, *event_flags[flag] ); flag++; run = false; } ``` And now I'm getting an error that looks like this. Any ideas?![enter image description here](https://i.stack.imgur.com/FhT9h.png)
Passing pointer variables through functions in C
CC BY-SA 2.5
null
2011-03-10T12:25:19.763
2011-03-10T13:06:24.943
2011-03-10T13:01:47.577
385,559
385,559
[ "c", "arrays", "pointers", "argument-passing" ]
5,259,652
1
5,261,407
null
0
260
(im using debian squeeze) i tried (but its unacceptable - just a lot of '?'s) now i am using but its awfully sloow.. for example generating html for this : ![eq](https://i.stack.imgur.com/9Kasd.png) takes ~2 seconds (thats 4+ times slower than generating the image !!!) 1. is there something wrong with my config or is tex4ht really that slow? 2. (i doubt theres something wrong with my config) are there any other(FAST) reliable tex2html converters?
any FAST tex to html program?
CC BY-SA 2.5
null
2011-03-10T12:34:04.350
2011-03-10T14:52:07.243
null
null
78,054
[ "html", "latex", "debian" ]
5,259,853
1
5,261,041
null
12
16,320
Minimal example: ``` [x,y,z] = peaks(50); figure; subplot(5,1,1:4); pcolor(x,y,z); shading flat; colorbar; subplot(5,1,5); plot(x(end/2,:), z(end/2,:)); ``` ![output](https://i.stack.imgur.com/rWOsi.png) In this example I'd like to have the lower subplot show the cross-section of peaks along y=0 and the plot ending at the same position as the pcolor subplot, so that the x ticks are on identical positions. In fact, I don't need the duplicate x axis then. So, > How to rescale the lower subplot such that the right limit matches the right limit of the upper one's plot part? (preferably such that the colorbar can be switched on/off without destroying that alignment) (FYI I [learned](https://stackoverflow.com/q/5023085/321973) I can use the [linkaxes](http://www.mathworks.com/help/techdoc/ref/linkaxes.html) command then to have a correct zoom behaviour in a second step)
Matlab: How to align the axes of subplots when one of them contains a colorbar?
CC BY-SA 2.5
0
2011-03-10T12:53:56.487
2015-02-27T12:44:27.083
2017-05-23T11:54:37.807
-1
321,973
[ "matlab", "plot", "axes" ]
5,259,948
1
null
null
2
1,976
I've built an app using the UITabBar template. I have a few tabbar items, one item displays a view. That view has a UIScrollView element that has paging enabled to mimic the behaviour of the iPhone springboard i.e. pages that can be scrolled left to right. I'm trying to drop in a UIPageControl, so I've resize the UIScrollView so that it's slightly shorter than the parent UIView height and have placed a UIPageControl below it. When I run the app the UIScrollView is always 100% of the height of the parent UIView and I can't see the UIPageControl. I've got the following code in my viewDidLoad method of the view controller for the tab: ``` UIScrollView *tempScrollView=(UIScrollView *)self.view; tempScrollView.contentSize=CGSizeMake(640,377); ``` This sets the content size ok and I can scroll left to right. I've tried adding: ``` tempScrollView.frame=CGRectMake(0, 0, 640, 377); ``` To to resize the scroll view but it still shows 100%. See diagram below showing the issue: ![example](https://i.stack.imgur.com/asf6B.jpg)
How do I resize a UIScrollView so that it's not 100% of the parent UIView?
CC BY-SA 2.5
null
2011-03-10T13:01:02.700
2011-06-07T15:40:52.210
null
null
248,848
[ "objective-c", "cocoa-touch", "ios4", "uiscrollview" ]
5,260,128
1
null
null
0
400
Im sorry if I don't make any sense my brain is fried right now. I just started programming in NHibernate, decided to move to Fluent Nhibernate because of the automapping but I'm having a little trouble, here is the relation it should have: ![enter image description here](https://i.stack.imgur.com/lNeJO.png) Here is the relation Fluent Nhibernate's automapping made, notice that MemberId is added to the table: ![enter image description here](https://i.stack.imgur.com/9Bitt.png) I'm guessing this is because the relations are set to inverse in my conventions. I needed to make the relationships inverse() or the cascades didn't work. Here are my conventions: ``` public class HasManyConvention : IHasManyConvention { public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance) { instance.Key.Column(instance.EntityType.Name + "ID"); //instance.Inverse(); if (instance.Member.GetCustomAttributes(typeof(CascadeAttribute), false).Length <= 0) { instance.Cascade.None(); return; } var cascadeOption = (CascadeAttribute)instance.Member.GetCustomAttributes(typeof(CascadeAttribute), false)[0]; switch (cascadeOption.CascadeOption) { case Enums.CascadeOptions.All: instance.Cascade.All(); break; case Enums.CascadeOptions.AllDeleteOrphan: instance.Cascade.AllDeleteOrphan(); break; case Enums.CascadeOptions.Delete: instance.Cascade.All(); break; case Enums.CascadeOptions.DeleteOrphan: instance.Cascade.DeleteOrphan(); break; case Enums.CascadeOptions.None: instance.Cascade.None(); break; case Enums.CascadeOptions.SaveUpdate: instance.Cascade.SaveUpdate(); break; } } } public class ReferenceConvention : IReferenceConvention { public void Apply(FluentNHibernate.Conventions.Instances.IManyToOneInstance instance) { instance.Column(instance.Property.Name + "Fk"); if (Attribute.IsDefined(instance.Property.PropertyType.Assembly, typeof(DomainSignatureAttribute))) instance.UniqueKey("DomainSignature"); else instance.Index(instance.Property.Name + "Index"); } } ``` And my two entities: ``` public class Member : Entity { public Member() { Mail = new List<Mail>(); } [Cascade(Enums.CascadeOptions.All)] public virtual IList<Mail> Mail { get; set; } } public class Mail : Entity { public virtual Member Receiver { get; set; } public virtual Member Sender { get; set; } public virtual string Subject { get; set; } public virtual string Body { get; set; } } ``` Why does fluent nhibernate map MemberId when it's obvious that Receiver and Sender are foreign keys to the member table?
Fluent NHibernate atutomapping, simple question, extra field being added for foreign key relationships
CC BY-SA 2.5
null
2011-03-10T13:15:59.450
2011-11-09T23:05:00.763
2011-11-09T23:05:00.763
221,708
349,877
[ "nhibernate", "fluent-nhibernate", "automapping" ]
5,260,329
1
5,260,398
null
0
261
I have a loop that involves a dynamically allocated array in C. For some reason it crashes after `flag` increments 7 times. This wasn't happening before I was reallocating the size of the array. Here is the code: ``` for (int i = 0; i < length-1; i++) { if (audio_samples[i] > threshold && run) { *event_flags = (int*)realloc(*event_flags, sizeof(int)*(flag+1)); // reallocate the size of the array *event_flags[flag] = i; // printf("FLAG CREATED! %i\n ", i); printf("EVENT FLAG %i %i\n",flag, *event_flags[flag] ); if (flag >5) { printf("%d\n", i); } flag++; run = false; } ``` Any ideas? Please keep in mind that the size of the array is indeed the same value as length. Here is an example of my errors: ![enter image description here](https://i.stack.imgur.com/Kjepu.png) --- FILE ONE: ``` int *event_positions = (int *) malloc(1 * sizeof(int)); // let us start with 1 and then add more within the method. This should continue until we have all the flags we want. int number_of_flags = event_extractor(vocal_data, size, event_positions); ``` FILE TWO: ``` float g_THRESHOLD_FACTOR = 2.3; // THIS INCREASES THE THRESHOLD VALUE. int event_extractor (int *audio_samples, unsigned int size_of_audio ,int *event_flags) { int length = (int)size_of_audio; // * * * * * * * * * * * * * * * * * * // RECTIFY VALUES (MAKE ABSOLUTE) (MAKE ALL POSITIVE) int *rectified_audio = (int *) malloc(length * sizeof(int)); // I took this line from wave header reader. The number is the number of samples of the hip hop track. make_values_absolute(audio_samples, length, rectified_audio); // If I convert to signed ints here would the method run more efficiently? // * * * * * * * * * * * * * * * * * * * * // LOW PASS FILTER int *lopass_samples = (int *) malloc(length * sizeof(int)); // I took this line from wave header reader. The number is the number of samples of the hip hop track. lopass(rectified_audio, length,0.5, lopass_samples); int number_of_flags = apply_threshold (lopass_samples, length, &event_flags); printf("\n\n\n NUMBER OF EVENTS AAAA --- %d\n", number_of_flags); for (int i = 0; i < number_of_flags; i++) { printf("FLAG %i -- %d \n", i, event_flags[i]); } return number_of_flags; } int apply_threshold (int *audio_samples, unsigned int size_of_audio, int **event_flags) { int flag = 0; // this will be the number of flags that I have bool run = true; // this will make sure that a minimum amount of time passes before I grab another flag. It's a guard. int counter = 0; // this is the counter for the above guard. printf("\n\nCURRENT MINIMUM TIME: 20100 SAMPLES \n\n"); // event_flags[0] = 1; // this first one is a dud. within the loop we will automatically start adding flags int threshold = calculate_threshold_value(audio_samples, size_of_audio); printf("\n\n this is the threshold %d \n\n", threshold); int length = (int)size_of_audio; printf("LENGTH OF VOCAL AUDIO %d \n", length ); for (int i = 0; i < length-1; i++) { if (audio_samples[i] > threshold && run) { // ** is this realloc working ? // event_flags = (int*)realloc(event_flags, sizeof(int) * (flag+1)); *event_flags = (int*)realloc(*event_flags, sizeof(int)*(flag+1)); // reallocate the size of the array *event_flags[flag] = i; // printf("FLAG CREATED! %i\n ", i); printf("EVENT FLAG %i %i\n",flag, *event_flags[flag] ); if (flag >5) { printf("%d\n", i); } flag++; run = false; } if (!run) { counter++; if (counter > 20100) { // hardcode minimum size for now. counter = 0; run=true; } } } printf("\n\n\n NUMBER OF EVENTS --- %d\n", flag); for (int i = 0; i < flag; i++) { printf("FLAG %i -- %d\n", i, *event_flags[i]); } printf("\nFIVE samples before and after my second flag: \n 0 should indicate a reach in the threshold\n"); for (int i = 0; i <10 ; i++) { printf("VOCAL SAMPLE %i %i \n", i-5,audio_samples[*event_flags[1]+i-5] ); } return flag; } ```
Loop will not increment past 8?
CC BY-SA 2.5
0
2011-03-10T13:36:53.580
2011-03-10T15:24:45.840
2011-03-10T13:50:23.590
385,559
385,559
[ "c", "arrays", "loops", "memory-management" ]
5,260,424
1
5,260,953
null
3
1,851
I am developing database scheme for recipes database. Do you have some ideas how to enchance my existing model? My bigges concern is RECIPE_INGREDIENT table. ![enter image description here](https://i.stack.imgur.com/rtMUf.png)
Database schema dilemmas
CC BY-SA 2.5
0
2011-03-10T13:44:44.053
2011-09-05T11:24:48.670
2011-09-05T11:24:48.670
117
126,414
[ "database-design" ]
5,260,452
1
null
null
1
1,240
![enter image description here](https://i.stack.imgur.com/0jcV7.png) I want to make an view that include; ScrollView,PageControl,TextView (As you see at pic)... I have an NSArray that include img adress and text. So there is no problem take an image and its text and put them correctly. My problem is I can'u use both of page control & scrollview that mean; If I write code in ``` (IBAction)changePage:(id)sender //for valuechange event pagecontrol ``` pagecontrol is work correctly but scrolling not. Otherwise If I write code in ``` (void)scrollViewDidEndDecelerating ``` this time scrollworks but page control does not.. How can I combine them and work together correctly??? NOTE: These SS taken from IOS simulator that mean it works correctly not an image only. On interface there are 4 component;(correct order) navigation bar, scrollview,pagecontrol,textview.normally imageview does not exist ı add 1 of them on viewDidLoad() and others on changePage methods.
combine page control + scrollview(includes imageviews) + textview
CC BY-SA 2.5
null
2011-03-10T13:47:50.497
2011-08-24T12:17:20.553
null
null
611,345
[ "iphone", "ios", "uiscrollview", "uipagecontrol" ]
5,260,469
1
null
null
0
316
How can I post HTML to a textarea? Or in some other HTML tags? I want it to be like a textarea, but not code text into it, just the HTML result of the code. with a scrollbar, like the following ![something like textarea](https://i.stack.imgur.com/eLGOt.png)
textarea analog
CC BY-SA 2.5
0
2011-03-10T13:49:15.930
2011-03-10T16:09:00.093
2011-03-10T14:07:21.530
1,288
298,192
[ "html" ]
5,260,642
1
5,433,429
null
1
822
I need to read some tiff files into a WPF, and I had it all working nicely, until I tested it on Windows XP. The image that's loaded appears to be corrupted, regardless of how I load it. Attached are 2 screenshots of the same program loading the same image - the dark one is how it should look (loaded from Win7), the other is how it looks when loaded in XP. I've tried loading as a BitmapImage, a BitmapSource, loading a FileStream and passing to a BitmapImage, directly from an Image tag in WPF... all have the same sort of corruption. I've used the .NET LibTiff library to get around the problem, but it doesn't explain why it happens, and I'm at a bit of a loss to explain it! Edit: I should add that the image is 16 bit. ![Loaded in Windows 7 ](https://i.stack.imgur.com/2ueH8.png)![Loaded in XP](https://i.stack.imgur.com/sHfpd.png)
.NET handling of tiff files corrupts on XP, but not Win7
CC BY-SA 2.5
0
2011-03-10T14:00:09.700
2011-03-25T13:58:49.900
2011-03-11T13:01:02.137
290,634
290,634
[ ".net", "tiff" ]
5,260,654
1
5,261,025
null
15
29,601
I am sending html and images with javamail but for some reason I don't see the images as part of the html, I see them only as an attachment. I don't know why is that. This is how it looks like when one of my users receive an email: ![enter image description here](https://i.stack.imgur.com/iLoVf.png) I would like to mention also that is how the html looks like: ``` private String generateActivationLinkTemplate() { String htmlText = ""; htmlText ="<table width=\"600\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"> <tr> <td><img src=\"cid:logoimg\"/></td> </tr> <tr> <td height=\"220\"> <p>Thanks for Joining Site.com</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> <p>Username:<br /> Password: </p> <p>To confirm your email click <a href=\"#\">here</a>.</p></td> </tr> <tr> <td height=\"50\" align=\"center\" valign=\"middle\" bgcolor=\"#CCCCCC\">www.site.com | [email protected] | +38200 123 456</td> </tr></table>";} ``` Do I need an html,body, and a head tag...? This is how the java implementation looks like: ``` @Stateless(name = "ejbs/EmailServiceEJB") public class EmailServiceEJB implements IEmailServiceEJB { @Resource(name = "mail/myMailSession") private Session mailSession; public void sendAccountActivationLinkToBuyer(String destinationEmail, String name) { // Destination of the email String to = destinationEmail; String from = "[email protected]"; try { Message message = new MimeMessage(mailSession); // From: is our service message.setFrom(new InternetAddress(from)); // To: destination given message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(to)); message.setSubject("Uspijesna registracija"); // How to found at http://www.rgagnon.com/javadetails/java-0321.html message.setContent(generateActivationLinkTemplate(), "text/html"); Date timeStamp = new Date(); message.setSentDate(timeStamp); // Prepare a multipart HTML Multipart multipart = new MimeMultipart(); // Prepare the HTML BodyPart htmlPart = new MimeBodyPart(); htmlPart.setContent(generateActivationLinkTemplate(), "text/html"); // PREPARE THE IMAGE BodyPart imgPart = new MimeBodyPart(); String fileName = "logoemailtemplate.png"; ClassLoader classLoader = Thread.currentThread() .getContextClassLoader(); if (classLoader == null) { classLoader = this.getClass().getClassLoader(); if (classLoader == null) { System.out.println("IT IS NULL AGAIN!!!!"); } } DataSource ds = new URLDataSource(classLoader.getResource(fileName)); imgPart.setDataHandler(new DataHandler(ds)); imgPart.setHeader("Content-ID", "logoimg"); multipart.addBodyPart(imgPart); multipart.addBodyPart(htmlPart); // Set the message content! message.setContent(multipart); Transport.send(message); } catch (MessagingException e) { throw new RuntimeException(e); } } ``` I think the java part to me looks fine, but i am suspicious only is the html markup, i there something wrong with it? I think that the img tag is not working properly and for not reason the image dont appear on the email(Notice it only appears down as an attachment): ``` <img src=\"cid:logoimg\"/> ```
Embedding images into html email with java mail
CC BY-SA 3.0
0
2011-03-10T14:01:18.053
2014-11-14T00:59:34.903
2014-04-24T19:15:20.777
251,173
614,141
[ "java", "html", "jakarta-ee", "ejb-3.0", "jakarta-mail" ]
5,260,804
1
5,261,242
null
3
1,044
I'm currently facing a performance problem with creating POCO objects from my database. I'm using Entity Framework 4 as OR-Mapper. The whole application is a prototype for now. Let's assume I want to have some business objects like classes 'Printer' or 'Scanner'. Both classes inherit from a BaseClass called Product. The business classes exist. I try to use a more generic database approach. I don't want to create tables for "Printer" nor "Scanner". I want to have 3 tables: One called Product, and the other Property and PropertyValue (which stores all assigned values to a specific Product). In my business layer I do create a specific object like this: ``` public Printer GetPrinter(int IDProduct) { Printer item = new Printer(); // get the product object with EF // get all PropertyValues // (with Reflection) foreach property in item.GetType().GetProperties // { // property.SetValue("specific value") // } return item; } ``` This is how the EF model looks like: ![enter image description here](https://i.stack.imgur.com/rwADO.png) Works fine so far. For now I'm doing performance tests for retrieving multiple sets. I've created a prototype and improved it several times to increase the performance. It is still far away from being usable. I takes 919ms to create 300 objects who only contain 3 properties. The reason for choosing such DB design is to have a generic database design. Adding new properties should only be done in the business model. Am I just being too stupid to create a performant way of retrieving xx objects or is my approach totally wrong? As far as I understand OR-Mapper, they are basically doing the same?
How to create a business model wrapper for a generic database approach?
CC BY-SA 2.5
0
2011-03-10T14:12:05.203
2011-03-10T15:10:14.810
null
null
225,808
[ "c#", "asp.net", "database-design", "entity-framework-4" ]
5,260,891
1
5,262,212
null
11
39,308
I have following layout in my application: ``` <?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/ScrollView01" android:layout_width="fill_parent" android:layout_height="fill_parent" android:scrollbars="vertical" android:background="@drawable/bbg"> <LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1"> <TextView android:id="@+id/Title" android:text="@string/order_status" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textSize="26sp" android:textColor="#000000" android:shadowColor="#FFFFFF" android:shadowDx="0.5" android:shadowDy="0.5" android:shadowRadius="1.0"/> <LinearLayout android:orientation="vertical" android:id="@+id/MainStatusWindow" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_margin="10sp" android:background="@drawable/rounded_corners"> <TextView android:id="@+id/RateInfo" android:text="" android:layout_width="fill_parent" android:layout_height="wrap_content" android:textSize="16sp" android:layout_margin="10sp" android:textColor="#5C5C5C"/> <ImageView android:src="@drawable/line" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaleType="fitXY"/> <TextView android:id="@+id/OrderStatus" android:text="@string/please_wait" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textSize="20sp" android:layout_margin="10sp" android:textColor="#222222"/> <ImageView android:src="@drawable/line" android:layout_width="fill_parent" android:layout_height="wrap_content" android:scaleType="fitXY"/> <TextView android:id="@+id/TimerStatus" android:text="0:00" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:textSize="50sp" android:layout_margin="10sp" android:textColor="#222222"/> </LinearLayout> <Button android:id="@+id/Cancel" android:layout_marginTop="10sp" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/cancel_order" android:textSize="18sp" android:textColor="#111111" android:layout_alignParentBottom="true" android:background="@drawable/button_red"/> </LinearLayout> </ScrollView> ``` I need to last button to be on the bottom of page. Picture bellow shows what I need (On the left what I have, on the right what I need). ![Explanation](https://i.stack.imgur.com/zRQR9.jpg) Thank you.
Android Layout align bottom
CC BY-SA 2.5
0
2011-03-10T14:17:19.107
2011-03-10T16:40:39.087
null
null
629,748
[ "android" ]
5,260,974
1
6,510,789
null
1
5,784
After reading the two nice posts [Algorithm for simplifying 3d surface?](https://stackoverflow.com/questions/3338385/algorithm-for-simplifying-3d-surface) [https://stackoverflow.com/questions/838761/robust-algorithm-for-surface-reconstruction-from-3d-point-cloud](https://stackoverflow.com/questions/838761/robust-algorithm-for-surface-reconstruction-from-3d-point-cloud) I have still a question about surface reconstruction. I have some 3d point cloud data from range camera. It means that the point cloud data is noisy, has only coordination (x,y,z) information and represents only a partial surface of a scanned scene (aka. 2.5D data). Before trying to mesh-lize them, I run some alignment algorithm (e.g. ICP) to merge multiple range data into one. Somehow the alignment is not perfect, it let the merge data sets have some not well surface artifacts and the whole data gets even more noisy! here is an illustration. ``` here are points representing a surface (shown as a line) ..................................................... here are points representing actually the same surface as the one above, but due to imperfect alignment of multiple data sets they seem overlapping like onion shell. ............................ ............................. ............................... ....................................... ``` can the algorithms (e.g. ball pivoting, poisson, marching cubes) handle such situation? or do I need some preprocessing to make the data set thinner to reduce the overlapping surfaces? btw, I have tried MeshLab with just ball pivoting to reconstruct surface from such data sets. It works but some of surface normals are generated in wrong direction. I think that the overlapping points cause such problem. The surface generated in MeshLab, the surface in white and black having different direction of normals. ![image](https://i.stack.imgur.com/lIM4v.png) Thanks for any suggestion and possible answer.
Surface reconstruction from 3D point cloud dealing with unwanted overlapping surface?
CC BY-SA 3.0
0
2011-03-10T14:24:08.750
2014-06-19T23:13:57.890
2017-05-23T12:19:48.617
-1
104,897
[ "3d", "mesh", "point-clouds", "geometry-surface", "3d-reconstruction" ]
5,261,532
1
5,263,400
null
2
304
I am struggling a bit to understand what would be the proper markup for the following information it would be a specifications list for a wine: - - - - - - - - - - - - `<img src="..."/>` so firstly I thought: this would look nice if each one of the items is a `section` within the specifications `section` but then it looked that it isn't a section because it basically consists of `key:value` pairs. So I've changed for a definition list `<dl>` which would have some definition terms and few items with more than one definition. It looks good in markup but there's no way to style that properly if you need a element for earch one of the definitions and float them side by side. something like this: ![how the items should be displayed](https://cl.ly/59Wy/Screen_shot_2011-03-10_at_16.40.04.png) Then it occurred to me that I could use a too but I am not sure if this would be a good markup since it would practically have to create a header for each list item and them insert its value on a subsquent paragraph (seems too much for me) So perhaps a table?...well I am a bit confused after these many options available, the one which makes me feel more comfortable yet still the sub-`section`s alternative but I am not sure if this would be a good markup since the impression I have of sections is that they would include more content than just a single line in some cases. If someone could give a help here on how to make it work on a clean markup but at the same time consider the accessibility, it would be great :) Thanks in advance
HTML5 markup for list of specifications
CC BY-SA 2.5
0
2011-03-10T15:00:56.863
2011-03-11T15:57:13.843
2017-02-08T14:31:44.910
-1
165,750
[ "list", "html", "format", "markup", "specifications" ]
5,261,514
1
5,262,038
null
24
23,714
i'm looking at the [W3Schools demo of using the <COL> element to align columns](http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_col_test): ``` <table width="100%" border="1"> <col align="left" /> <col align="left" /> <col align="right" /> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>3476896</td> <td>My first HTML</td> <td>$53</td> </tr> </table> ``` And browser's rendering of it is not encouraging: Chrome (10.0.648.127): ![enter image description here](https://i.stack.imgur.com/mEmdi.png) FireFox (3.6.8): ![enter image description here](https://i.stack.imgur.com/x1Y81.png) Internet Explorer 9 (standards mode): ![enter image description here](https://i.stack.imgur.com/DsZHT.png) Internet Explorer 8 (standards mode): ![enter image description here](https://i.stack.imgur.com/6ZMZj.png) Internet Explorer 7 (standards mode): ![enter image description here](https://i.stack.imgur.com/7g4cq.png) Internet Explorer (quirks mode): ![enter image description here](https://i.stack.imgur.com/WRad5.png) It's interesting to note that `<COL align>` to work in browsers, and the feature was in ie8. (And Chrome, with position of being the arbiter of all things perfect, doesn't support it.) This makes me wonder if `<COL align>` is something that's not to work. Has `<COL align>` been deprecated? --- ## Update One i understand that it hasn't been formally deprecated. But the fact that browsers to support it, then supporting it makes me believe that there is some historical story that i'm missing. i assume the intentional removal of `col align` support from IE, and the continued lack of support from other browsers, indicates something is going on. ## Update Two i was mistakenly assuming lack of support for all features of `<COL>` meant `<COL>` itself isn't supported. i mistakenly assumed that since the only attribute i was trying wasn't working: that the element wasn't working. This was my mistake; and in hindsight i have asked if "COL align" is deprecated (which it is). In my defense i assumed an example would have been shown what wasn't working "anymore". ## See also - [Web Design Group: COL - Table Column](http://htmlhelp.com/reference/html40/tables/col.html)- [W3Schools: HTML <col> tag](http://www.w3schools.com/tags/tag_col.asp)- [HTML 4.01 - The col element](http://www.w3.org/TR/html4/struct/tables.html#edef-COL)
Is html <COL align> deprecated?
CC BY-SA 2.5
0
2011-03-10T14:59:31.770
2015-09-29T13:16:45.273
2011-03-10T16:26:57.157
12,597
12,597
[ "html", "col" ]
5,261,588
1
5,374,719
null
0
114
I have made a question which is a bit similar to this, though the old one actually got solved but I found a new issue which relates a bit. Anyways, I chose to make seperate topics. I have an application which reads data from a property list on my webserver. I want the application to be usable when offline therefore I copy the property list onto the iPhone as Bands.plist and I read the data from the local plist. My problem is, that if the data has been updated and an old version of Bands.plist is stored on the device, then my application starts reading from Bands.plist while updating and the data becomes a mix of old and new data which causes the application to crash. I can't figure out how to fix this issue and hope that someone has an idea. I have an image which illustrates my issue: ![On the left is the old data and on the right is the new data](https://i.stack.imgur.com/d3xkB.png) What happens is, that my view has a subview which has a page controller. Each page contains a table view where the data is loaded into. Here you see that I am sliding from one view to another. In the first view (the left) is the old data and in the second view (the right) is the new data. In this transition of views, the application crashes. Can anyone help me figure this out? It seems that the application starts loading the data before it is saved. Here is some code. Please say, if more code will help. I can't figure out how to fix this issue. This is from the App Delegate. Here the data is retrieved from the webserver and is saved to Bands.plist. ``` NSLog(@"[AppDelegate] Data has been downloaded."); // throw data into a property list (plist) NSMutableArray *tmpArray = [NSPropertyListSerialization propertyListFromData:receivedData mutabilityOption:NSPropertyListMutableContainers format:nil errorDescription:nil]; NSMutableArray *plistArray = [[NSMutableArray alloc] initWithArray:tmpArray]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Bands.plist"]; NSLog(@"[AppDelegate] Bands.plist has been populated."); ``` This is from the table view. Here the data is loaded from Bands.plist. ``` pageNumber = page; NSLog(@"[TableView] Loading view."); NSArray *whatDays = [[NSArray alloc] initWithObjects:@"Onsdag", @"Torsdag", @"Fredag", @"Lørdag", @"Ikke programsat", nil]; sections = [[NSMutableDictionary alloc] init]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *path = [documentsDirectory stringByAppendingPathComponent:@"Bands.plist"]; tmpArray = [[NSMutableArray alloc] initWithContentsOfFile:path]; // scan through data and sort for(int i = 0; i < [whatDays count]; i++) { NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.weekDay == %@", [whatDays objectAtIndex:i]]; NSArray *bandsThisDay = [tmpArray filteredArrayUsingPredicate:predicate]; [sections setObject:bandsThisDay forKey:[whatDays objectAtIndex:i]]; } [whatDays release]; ``` Would it be possible to call a method in tableview implementation from the app delegate and tell it to populate the table? So it's waiting for the download to be done?
App crashes when mixing up new and old data
CC BY-SA 2.5
null
2011-03-10T15:05:38.873
2011-03-21T07:03:02.887
2011-03-10T15:12:44.053
486,845
486,845
[ "iphone", "sdk", "load", "save", "plist" ]
5,262,124
1
5,262,223
null
1
1,346
I have a Navigation-bar in my program that allows you to navigate the different sections in my TextBox, but the problem I have is that this doesn't work if the Text I am scrolling to is already visible on the screen. Like in this example, if I try to jump from Section 1 to Section 3, it won't work as it's already visible. ![Example 1](https://i.stack.imgur.com/sp8XP.png) But, in this example if I jump to Section 3, it works fine as it's not already visible. ![Example 2](https://i.stack.imgur.com/8klpz.png) The scrolling function I use is very simple: ``` if (nLine > 0 && nLine <= textBox.LineCount) textBox.ScrollToLine(nLine - 1); ``` I hope that someone can shed some light on an alternative solution that allows me to scroll even if the text is already visible. ``` private static void ScrollToLineCallback(DependencyObject target, DependencyPropertyChangedEventArgs e) { var textBox = (TextBox)target; int newLineValue; if (Int32.TryParse(e.NewValue.ToString(), out newLineValue)) { if (newLineValue > 0 && newLineValue <= textBox.LineCount) // Validate { textBox.ScrollToLine(newLineValue - 1); // Scroll to Line // Check and see if we are at the line we want. if (textBox.GetFirstVisibleLineIndex() <= newLineValue && textBox.GetLastVisibleLineIndex() >= newLineValue) { // If not lets move to the desired location int newLineCorrectionValue = newLineValue - textBox.GetFirstVisibleLineIndex() - 2; // How much further do we need to scroll down? for (int i = 0; i < newLineCorrectionValue; i++) { textBox.LineDown(); // Scroll down } } } } } ```
WPF TextBox ScrollToLine not updating if visible
CC BY-SA 3.0
null
2011-03-10T15:48:34.987
2022-08-02T14:56:50.097
2012-06-24T21:47:37.053
408,182
408,182
[ "c#", "wpf", "textbox" ]
5,262,276
1
5,262,617
null
9
1,414
I ran a test on this website [http://jsperf.com/](http://jsperf.com/) ![This is screen shot of a jsperf test i ran](https://i.stack.imgur.com/OzbZg.jpg) I want some one to explain 1. What does green and pink signifies 2. What is ops per second 3. what is 95,814,583 4. what is +- 1.95% is 5. whats does 'fastest' and 'slower' means
Explain this JsPerf.com result
CC BY-SA 2.5
0
2011-03-10T16:01:11.207
2011-03-10T16:24:02.220
2011-03-10T16:06:57.583
183,200
183,200
[ "javascript", "benchmarking", "performance", "jsperf" ]
5,262,423
1
5,263,621
null
3
1,320
When using the following dialog to add a view, is there anyway you can state in what order you want the fields created? ![enter image description here](https://i.stack.imgur.com/v1cvE.jpg) I tried [Column(Order=0)] ::: [Column(Order=12)], but no joy! Thanks Paul
MVC3 - Scaffold Template (Field Order)
CC BY-SA 2.5
null
2011-03-10T16:11:33.447
2012-04-01T10:19:45.350
null
null
545,490
[ "asp.net-mvc", "asp.net-mvc-3", "scaffolding", "scaffold" ]
5,262,466
1
5,262,555
null
4
3,410
I would like to have a way to get the theme colour of the users Windows theme with WPF or C# code-behind. And with this colour I mean the one that can be set in under Windows 7(and Vista too, I think). I want to use this colour to make a gradient in much the same way as Trillian 5 does it. ![enter image description here](https://i.stack.imgur.com/eKxt0.png) I tried to find it myself, but unfortunately I'm not getting anywhere. Apparently it's not under `SystemColors.Whatever`. I have found something on the [MSDN](http://msdn.microsoft.com/en-us/library/microsoft.windows.themes.themecolor.aspx) but I can't figure out how to use it, nor do I think it's what I want. If anyone could help me I would be grateful.
How do I retrieve the theme colour of Windows?
CC BY-SA 3.0
0
2011-03-10T16:14:05.800
2012-11-19T20:58:11.463
2012-11-19T20:58:11.463
652,417
652,417
[ "c#", "wpf", "c#-4.0" ]
5,262,775
1
5,263,387
null
2
6,005
In my last project I've used jqGrid 3.8.2, jQuery 1.4.4 and jquery-ui-1.8.10. The company I work for still uses IE8 as a web broswer so in my development I always test with that platform. I've noticed today that a jqGrid is rendered properly when I test everything on my machine (winXP) using the Visual Studio (2010) ASP.NET Development Server: ![Good](https://i.stack.imgur.com/5D81T.png) As you can see the selection is perfect and the header is ok. When I copy everything on the production server (Win 2003 + IIS6.0) the same form renders in a funny way. ![Bad](https://i.stack.imgur.com/6uADo.png) As you can see now the row selection is not working properly and I've got these strange arrows in the header. PS: I am using the same computer and browser to render the same page. PPS: Obviously, if I use a different (professional ;-) ) browser (mozilla, safari, opera, chrome) everything works properly.
jqGrid and Compatibility View mode in IE8
CC BY-SA 2.5
0
2011-03-10T16:35:45.127
2011-03-14T20:52:21.973
2011-03-14T08:54:59.523
219,406
219,406
[ "jquery", "internet-explorer", "jqgrid", "ie8-compatibility-mode" ]
5,262,771
1
5,262,970
null
0
68
I don't understand "why" SQLiteDB may not respond to "-checkIfDatabaseExists". What's causing this and how do I fix it? (I'm real close to getting this to work, but because I'm a newbie, I am still having problems). I appreciate any assistance I can get on this. Here is the code: ``` #import "SQLiteDB.h" static SQLiteDB *sharedSQLiteDB = nil; // makes this a singleton class @implementation SQLiteDB @synthesize db, dbPath, databaseKey; //-------------- check for database or create it ----------------| #pragma mark Singleton Methods + (SQLiteDB *) sharedSQLiteDB { if(!sharedSQLiteDB) { sharedSQLiteDB = [[SQLiteDB alloc] init]; [sharedSQLiteDB checkIfDatabaseExists]; } return sharedSQLiteDB; } +(id)allocWithZone:(NSZone *)zone { if(!sharedSQLiteDB) { sharedSQLiteDB = [super allocWithZone:zone]; return sharedSQLiteDB; } else { return nil; } } -(id)copyWithZone:(NSZone *)zone { return self; } -(void) release { // no-op } - (void) checkIfDatabaseExists { // Get the path to the database file NSArray *searchPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentPath = [searchPaths objectAtIndex:0]; NSString *databasePath = [documentPath stringByAppendingPathComponent:@"ppcipher.s3db"]; // Open the database file const char *cDatabasePath = [databasePath cStringUsingEncoding:NSUTF8StringEncoding]; if(sqlite3_open(cDatabasePath, &db) == SQLITE_OK) // does it exist? return; else { // create database file here } } @end ``` ![Here is the results of the build:](https://i.stack.imgur.com/YuSyE.png)
What's causing this?
CC BY-SA 2.5
null
2011-03-10T16:35:33.563
2011-03-10T17:05:23.573
2011-03-10T16:51:33.857
1,231,786
1,231,786
[ "objective-c", "xcode" ]
5,262,893
1
5,270,128
null
2
920
I'm attempting to group contiguous date ranges to show the minimum and maximum date for each range. So far I've used a solution similar to this one: [http://www.sqlservercentral.com/articles/T-SQL/71550/](http://www.sqlservercentral.com/articles/T-SQL/71550/) however I'm on SQL 2000 so I had to make some changes. This is my procedure so far: ``` create table #tmp ( date smalldatetime, rownum int identity ) insert into #tmp select distinct date from testDates order by date select min(date) as dateRangeStart, max(date) as dateRangeEnd, count(*) as dates, dateadd(dd,-1*rownum, date) as GroupID from #tmp group by dateadd(dd,-1*rownum, date) drop table #tmp ``` It works exactly how I want except for one issue: weekends. My data sets have no records for weekend dates, which means any group found is at most 5 days. For instance, in the results below, I would like the last 3 groups to show up as a single record, with a dateRangeStart of 10/6 and a dateRangeEnd of 10/20: ![screenshot of results](https://i.stack.imgur.com/PMlF9.jpg) Is there some way I can set this up to ignore a break in the date range if that break is just a weekend? Thanks for the help.
Grouping by contiguous dates, ignoring weekends in SQL
CC BY-SA 2.5
0
2011-03-10T16:44:47.443
2011-04-21T12:08:36.340
2011-04-21T12:08:36.340
297,408
281,572
[ "sql", "sql-server-2000", "sql-date-functions" ]
5,262,897
1
5,263,131
null
2
3,105
The JSF code which is giving me problems is the following: ``` <h:panelGrid columns="3"> <!-- Minimum Password Length --> <h:outputText value="#{i18n['xxx']}:" /> <h:inputText id="minLength" value="#{passwordPolicies.minLength.paramValue}" required="true"> <f:validateLongRange minimum="1"/> <f:ajax event="valueChange" render="@this minLengthMessage" listener="passwordPolicies.testListener"/> </h:inputText> <h:message id="minLengthMessage" for="minLength" errorClass="error" tooltip="true"/--> <!-- Many other validation fields --> <h:panelGrid/> ``` Firstly, I am having a very similar issue as: [f:ajax listener never fired](https://stackoverflow.com/questions/4900587/fajax-listener-never-fired) . I must combine Ajax and full requests on my JSF page. [Jim Driscoll @ java.net](http://weblogs.java.net/blog/driscoll/archive/2009/10/01/mixing-ajax-and-full-requests-jsf-20) says that in order for these 2 to work, an Ajax error listener must be set up? Is this very much diferent than the property of the tag? Now, I know I could try Primefaces p:inputText and p:ajax tags, but these would require me individual listeners for all my fields that are validated. Is there a way to fix the f:ajax error listener, in order to be triggered and dont get the nasty: ![enter image description here](https://i.stack.imgur.com/iOl9X.png) Thanks for any input!
Mixing Ajax and full requests in JSF 2.0
CC BY-SA 2.5
null
2011-03-10T16:44:50.987
2015-07-28T15:49:45.800
2017-05-23T12:06:58.140
-1
583,673
[ "java", "ajax", "jsf", "jsf-2", "listener" ]
5,263,055
1
null
null
127
175,035
How do I achieve formatting of a text inside a `TextBlock` control in my WPF application? e.g.: I would like to have certain words in bold, others in italic, and some in different colors, like this example: ![enter image description here](https://i.stack.imgur.com/zGUuD.png) The reason behind my question is this actual problem: ``` lblcolorfrom.Content = "Colour From: " + colourChange.ElementAt(3).Value.ToUpper(); ``` I would like the second part of the string to be bold, and I know that I could use two controls (Labels, TextBlocks, etc.) but I'd rather not, due the vast amount of controls already in use.
Formatting text in a TextBlock
CC BY-SA 3.0
0
2011-03-10T16:57:43.867
2018-09-26T15:43:39.883
2014-06-27T13:02:22.477
1,552,016
408,757
[ "c#", "wpf", "wpf-controls" ]
5,263,470
1
5,263,651
null
0
370
I'd like to run some terminal command within my Mac program. For example, I normally use `mate abc.txt` or `python abc.py` from my shell to open Text Mate or running python script. How can I do the same thing with Cocoa/Objective-C? I thought about [this method](https://stackoverflow.com/questions/5048677/launching-an-mac-app-with-objective-c-cocoa), but I prefer just running in one line. For example, when users enter "python abc.py", I just run the command as if it's in the Terminal.app. Python's equivalent command is `os.system()`. ![inputItem](https://i.stack.imgur.com/0PXEH.png) <-- inputItem TextField ``` NSString* item = [inputItem stringValue]; [NSRuncommandLikeShell item]; <-- ???? ``` The environment variables should be retained so that I don't need to run '/usr/bin/python'. ## EDIT I can use `~/.MacOSX/environment.plist` file for setup path environment. Or, I also could use [this utility](http://www.apple.com/downloads/macosx/system_disk_utilities/environmentvariablepreferencepane.html) for GUI.
What's Python's os.system() equivalent to cocoa/Objective-C?
CC BY-SA 2.5
null
2011-03-10T17:33:25.420
2011-03-10T20:18:25.560
2017-05-23T10:30:23.117
-1
260,127
[ "python", "objective-c", "cocoa", "shell", "command" ]
5,263,739
1
null
null
3
1,353
I was wondering if anyone had any insight as to the best way to create a UIButton with two or more labels (or basically two lines with different styling) and one or more images. The closest example of what I am trying to do is the Evernote iPhone compose screen where each button has an icon and one or more UILabels (the Twitter app for iPhone employes a similar button style). Here's a screenshot: ![enter image description here](https://i.stack.imgur.com/FsCD5.png) My question is basically whether it is best to sub-class UIButton or to add the individual labels and images as subviews of the UIButton. Thanks for the help...
Custom buttons with multiple UILabel and images
CC BY-SA 2.5
null
2011-03-10T17:58:22.000
2013-03-28T12:26:51.840
2011-03-10T18:02:59.987
456,851
654,055
[ "iphone", "ios", "uibutton" ]
5,263,767
1
5,263,856
null
1
2,117
Right now i have this layout (horizontal relative layouts inside vertical linear layout) , but i need radiobuttons instead of checkboxes (user must be able to choose just one option). ![enter image description here](https://i.stack.imgur.com/Nt13m.png) ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:orientation="horizontal"> <ImageView android:src="@drawable/flag_en" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitCenter" android:layout_alignParentLeft="true" /> <TextView android:text="English" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_marginLeft="10dip" android:textStyle="bold" android:textSize="20dip" /> <CheckBox android:id="@+id/checkbox4" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" /> </RelativeLayout> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginTop="10dip" android:layout_marginLeft="5dip" android:layout_marginRight="5dip" android:orientation="horizontal"> <ImageView android:src="@drawable/flag_dk" android:layout_width="wrap_content" android:layout_height="wrap_content" android:adjustViewBounds="true" android:scaleType="fitCenter" android:layout_alignParentLeft="true" /> <TextView android:text="Dansk" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerInParent="true" android:textStyle="bold" android:textSize="20dip" /> <CheckBox android:id="@+id/checkbox5" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" /> </RelativeLayout> <Button android:id="@+id/ang_btn" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="ang" /> </LinearLayout> ``` Problem is that RadioGroup must be placed inside linear layout (not relative), so i can't use above layout. How can i achieve the same layout (multiple rows, 3 colums, radiobuttons in the third column) and also use radiogroup with radiobuttons? EDIT: I tried Robby Pond's solution (below) and i get this: ![enter image description here](https://i.stack.imgur.com/oh2ck.png) I could used that if i could put some space between radiobutton and it's drawableLeft. I managed to get some space between drawableLeft and text with android:drawablePadding="10dip" (not seen on my last screenshot).
How to layout views so that radiogroup could be used?
CC BY-SA 2.5
null
2011-03-10T18:00:26.897
2011-03-11T09:16:36.327
2011-03-11T09:16:36.327
324,417
324,417
[ "android", "layout", "radio-button" ]
5,263,791
1
5,264,602
null
6
733
In Mathematica, locators can be constrained to certain screen regions via the parameters of `LocatorPane` (See [LocatorPane](http://reference.wolfram.com/mathematica/ref/LocatorPane.html) documentation.) A list of three ordered pairs `{{{minX, minY}, {maxX, maxY}, {dX, dY}}}` is usually the key to determining the behavior of locators. `{minX, minY}` and `{maxX, maxY}` set the region. `{dX, dY}` sets the jump size: zero for unrestrained, any other positive number for the size of each hop. In the code below, `{{{-.9, 0}, {1, 0}, {0, 0}}}` sets the region and jumps for the locator `pts`. The first two ordered pairs limit the locators to the interval [-9, 1] on the number line. The ordered pair `{0, 0}` imposes no additional constraints on either of the locators. However, because the y values can only be zero, due to the region defined by the first two items, neither locator is free to leave the x-axis. I'd like to confine each locator to x-values in `myTicks`. (In the full program, myTicks will change over time depending on decisions made by the user.) Because the ticks are not uniformly spaced along x, the issue cannot be solved by setting a constant value for the x-jump. And if the value were take into account the current position of the locator, the next left hop might be different size than the right hop. ``` myTicks = {-.9, 0, .1, .2, .45, .79, 1}; pts = {{.25, 0}, {.75, 0}}; LocatorPane[Dynamic[pts], Graphics[{}, Axes -> {True, False}, PlotLabel -> Row[{"locators at: " , Dynamic[pts[[1, 1]]], " and ", Dynamic[pts[[2, 1]]]}], Ticks -> {myTicks, Automatic}], {{{-.9, 0}, {1, 0}, {0, 0}}}] ``` ![Mathematica graphics](https://i.stack.imgur.com/ajTPo.png) Any suggestions would be appreciated!
How can I constrain locators to a limited (but not regular) set of positions?
CC BY-SA 3.0
0
2011-03-10T18:02:28.817
2012-01-03T21:51:06.960
2012-01-03T21:51:06.960
615,464
638,130
[ "wolfram-mathematica", "mouseevent" ]
5,263,891
1
5,264,735
null
3
425
What Vim command did I invoke to cause a top-to-bottom gray bar with the character sequence ">>" in the current line's left margin to appear? (See screenshot below) ![http://imgur.com/8l9s4](https://i.stack.imgur.com/IjoNK.png) This happens every once and a while but I'm usually typing too quickly to realize what clumsy key combo caused it.
What keys did I press to cause ">>" to appear in the left margin?
CC BY-SA 3.0
0
2011-03-10T18:13:30.620
2011-12-07T22:48:06.967
2011-12-07T22:48:06.967
84,042
650,277
[ "vim", "vi" ]
5,263,952
1
5,264,202
null
2
431
I have a TextField (`IBOutlet NSTextField *commandInput;`) to get an input as a command, and I have a Button to run the command by calling this method: ``` - (IBAction) runShell: (id)sender; { // get the string from inputItem NSString* item = [commandInput stringValue]; system([item UTF8String]); NSLog(@"%s", [item UTF8String]); } ``` ![enter image description here](https://i.stack.imgur.com/gAFH3.png) Can I remove the Button? I mean, can I run the runShell method when I hit enter the TextField?
Cocoa's TextField returns action control
CC BY-SA 2.5
null
2011-03-10T18:20:35.750
2011-03-10T18:41:13.380
2011-03-10T18:36:28.557
481,154
260,127
[ "objective-c", "cocoa" ]
5,264,189
1
6,211,637
null
0
166
I have a FlowLayoutControl on my form that I am populating with 20-100 graphics heavy UserControls. The only problem I am having is that, while scrolling, the graphics "drag" (similar to dragging windows while it's slow, creating a duplicate image wherever the window is dragged). I need a way to be able to scroll through the FLC without the images dragging or glitching. I need the scrolling to be smooth. Is there any possible way to buffer the controls or fix this problem without any MAJOR changes? Thanks if you can! (If you are confused about what I mean when referring to "Window Lag", it's something similar to the following example [here](http://ericfaller.com/blog/wp-content/uploads/2007/08/expose.jpg)) Here is an actual picture of the lag issue I am dealing with: ![enter image description here](https://i.stack.imgur.com/zH5cU.png)
Slow rendering objects while scrolling through a .net FlowLayoutControl
CC BY-SA 2.5
0
2011-03-10T18:40:14.307
2011-06-02T07:21:46.533
2011-03-10T20:45:27.127
595,437
595,437
[ ".net", "user-controls", "buffer" ]
5,264,563
1
5,266,863
null
0
176
I am just not able to get the table indexes to use themselves in this table join : ``` explain select n.* from npi n,npi_taxonomy nt where n.NPI=nt.NPI_CODE; ``` Here is the output of explain that i am getting : ![enter image description here](https://i.stack.imgur.com/oqmIi.png) As you can see, it finds the key in possible_keys column but the key column is empty. Please help.
Cannot join two tables using indexes
CC BY-SA 2.5
null
2011-03-10T19:10:24.943
2011-03-10T22:51:01.190
2011-03-10T19:33:29.967
278,851
278,851
[ "mysql", "indexing", "query-optimization" ]
5,265,134
1
5,265,641
null
4
7,588
Anything I do in views that would normally use ajax to open up a new form to modify properties of that action is giving me an alert box of what looks like the code that should be loading with ajax: ![enter image description here](https://i.stack.imgur.com/2KVts.jpg)
Drupal Views - Ajax Error Alert Box From Hell
CC BY-SA 2.5
null
2011-03-10T19:55:31.260
2014-02-06T21:07:42.943
2011-03-10T20:11:39.520
143,071
143,071
[ "ajax", "drupal", "view", "alert" ]
5,265,220
1
5,266,132
null
0
1,092
I'm relatively new to Obj-C and haven't got to the stage of navigating with my eyes shut yet :) I'm writing a custom tab bar class as an exercise to learn a bit more & I need it for a project I'm doing. My thinking is to create a normal UITabBarController and then hide the view and replace it with my own, this has worked so far and I have got the desired aesthetics in place. As you can see here, ![Can't post image due to lack of reputation, click here to see it :)](http://www.samjordan.co.uk/grabs/16845b4daf900c994e95a31a66ecf1f1.png)](https://i.stack.imgur.com/vlOZj.png) The code that I used to get this [can be seen at this gist](https://gist.github.com/cf7df02f82a0c31aa86c). The problem I'm faced with is the touch event does not seem to fire. I thought at first it was because the button was in a UIImageView, so enabled user interaction, but still no luck! I'd appreciate any help that will get me towards the problem. As I've said I'm relatively new to Obj-C so it may just be something simple I've missed out!
Custom UITabBarController on iPhone
CC BY-SA 2.5
0
2011-03-10T20:01:57.280
2011-03-10T21:28:42.650
2011-03-10T20:04:57.977
115,730
323,050
[ "iphone", "objective-c", "xcode", "ios", "uitabbarcontroller" ]
5,265,335
1
5,267,648
null
0
1,597
I have two shapes and I want to do a zoom, I use the following code ``` Iterator iter = objects.iterator(); Shape shape; while(iter.hasNext()){ shape = (Shape)iter.next(); AffineTransform t = shape.getAffineTransform(); int x = shape.getCenter().x; int y = shape.getCenter().y; t.translate(-x, -y); t.scale(sx,sy); t.translate(x, y); shape.setAffineTransform(t); } ``` The shapes are zoomed but the distance between them became smalled ![Befor the zooming](https://i.stack.imgur.com/c9hTH.jpg) ![after the zomming](https://i.stack.imgur.com/D8SMu.jpg) I thought making a composite shape from the two shapes and then scale it. Is there another way to keep the proportions? thanks
How to scale many shapes and keep the same proportion
CC BY-SA 2.5
null
2011-03-10T20:10:41.510
2011-03-11T00:27:41.587
2011-03-10T20:27:02.817
604,109
604,109
[ "java", "2d", "shapes" ]
5,265,473
1
5,273,644
null
1
984
Clients upload files in .doc format to a server directory, and the text within them is extracted using POI as per Ray Camdens posting [here](http://www.coldfusionjedi.com/index.cfm/2009/2/5/Reading-Office-documents-with-ColdFusion-2%22here%22) The content is saved in a text/memo field in a MySQL database and is made available as a web service which is consumed as wsdl. All works as intended, until consumers of the web service access records containing certain (I presume) control characters, at which point the web service throws a 500 error. In the database the problem rows seem to have control characters, and when the text field is displayed in Firefox there's odd characters too. ![enter image description here](https://i.stack.imgur.com/1BQAU.png) The web service simply returns a CF query of returntype = "any" and is called as ``` <cfinvoke webservice="https://nww.someplace.nhs.uk/cfcs/providerapi.cfc?wsdl" method="getPendingReferrals" returnvariable="getReferrals"> <cfinvokeargument name="userName" value=#username#> <cfinvokeargument name="password" value=#password#> <cfinvokeargument name="maxrows" value=#maxrows#> </cfinvoke> ``` I presume the WSDL cannot transmit these characters, so is there a way to encode them, or do I just have to strip them out using a regex or something? ``` <cfcomponent> <cffunction output="false" access="remote" returntype="any" name="getPendingReferrals"> <cfargument required="false" name="userName" type="string"/> <cfargument required="false" name="password" type="string"/> <cfargument required="false" name="maxrows" type="numeric" default="20"/> <cfset var q=""> <cfinvoke component="cfcs.security" method="checkAuthenticated" returnvariable="checkAuth"> <cfinvokeargument name="username" value="#arguments.userName#"> <cfinvokeargument name="password" value="#arguments.password#"> </cfinvoke> <cfif checkAuth.authenticates is "true"> <!--- log the login ---> <cfset filename=#datepart("yyyy", now())#&#datepart("m", now())#&#datepart("d", now())#&"loginlog.txt"> <CFSET OUTFILE = "#application.Root#"&"logs\"&"#filename#"> <cfif #FileExists(OUTFILE)# is "Yes"> <cffile action="append" file="#OUTFILE#" output="#checkAuth.userName#, #now()#, #remote_addr#, #Left(http_user_agent, 50)#"> <cfelse> <CFFILE action="write" output="#checkAuth.userName#, #now()#, #remote_addr#, #Left(http_user_agent, 50)#" file="#OUTFILE#"> </cfif> <cfif checkAuth.organisationID is 1> <cfset toStr="toID=1"> <cfelseif checkAuth.organisationID is 28> <cfset toStr="(toID=28 OR toID=29)"> </cfif> <cfquery name="q" datasource='mySqlData' maxrows=#arguments.maxrows#> SELECT messages.messageID, messages.toID, messages.fromID AS referrerID, (SELECT CONCAT(title, ' ',firstName, ' ', lastname) FROM users WHERE users.userID = messages.fromID) as referrerName,messages.threadID, messages.messageBody, messages.dateCreated, messages.dateSent, messages.deleted, messages.createdByID, (SELECT CONCAT(title, ' ',firstName, ' ', lastname) FROM users WHERE users.userID = messages.createdByID) as createdByName, (SELECT organisationName FROM organisations WHERE messages.originatingOrganisationID = organisations.organisationID) as originatingOrganisationName, messages.originatingOrganisationID, messages.viewed, messages.referral, messages.actioned, messages.patientID, messages.refTypeID, messages.specialtyID, organisations.organisationName AS toOrganisationName, patients.nhsNumber AS patientNHSnumber, patients.patientTitle, patients.patientLastname, patients.patientFirstname, patients.patientDOB, patients.address1 as patientAddress1, patients.address2 AS patientAddress2, patients.address3 AS patientAddress3, patients.address4 AS patientAddress4, patients.postcode AS patientPostcode, patients.patientPhone1 FROM users INNER JOIN (organisations INNER JOIN (patients INNER JOIN messages ON patients.patientID = messages.patientID) ON organisations.organisationID = messages.toID) ON users.userID = messages.fromID WHERE #toStr# AND NOT actioned AND NOT originatingOrganisationID=3 ORDER BY messageID </cfquery> <cfif isQuery(q)> <cfreturn q> <cfelse> <cfreturn "Error : in query"> </cfif> <cfelse> <cfreturn "Error : failed to authenticate"> </cfif> </cffunction> ```
Coldfusion web service consumed as WSDL chokes on control characters
CC BY-SA 2.5
null
2011-03-10T20:22:34.620
2011-03-11T14:24:39.823
2011-03-10T23:54:48.313
83,147
83,147
[ "web-services", "coldfusion", "wsdl" ]
5,265,465
1
5,285,973
null
9
44,072
im trying to style a listview control but im having problems... when i set width of image to 40px as shown in markup. i cant seem to get the content to align properly to the left. ie. i dnt want that gap between image and text. here is my markup ``` <ul data-role="listview" class="ui-listview" data-inset="true" role="listbox"> <li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-c" style='font-size:8pt;font-weight:normal'> <?php echo fmtDate($x->date); ?>,<?php echo $name; ?> wrote on <?php echo $wname; ?>'s wall <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style='right:55px;background: url(../images/comment.png) no-repeat;padding:3px;padding-left:20px'>34</span> <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style='right:5px;background: url(../images/like.gif) no-repeat;padding:3px;padding-left:20px'>442</span> </li> <li role="option" tabindex="0" data-theme="c" > <a href='#'> <img width="40" height="40" src='<?php echo $imgstr; ?>'/> <div style='font-size:9pt;font-weight:normal;'><?php echo nl2br(addSmilies(urlize(trim($x->msg))));?></div> </a> </li> </ul> ``` just to clarify this is the markup i get from 'inspect element' ``` <ul data-role="listview" class="ui-listview ui-listview-inset ui-corner-all ui-shadow" data-inset="true" role="listbox"> <li data-role="list-divider" role="heading" tabindex="0" class="ui-li ui-li-divider ui-btn ui-bar-b ui-btn-up-c ui-corner-top ui-btn-up-undefined" style="font-size:8pt;font-weight:normal"> Today, 55 minute(s) ago,Maggie Ferguson wrote on Maggie's wall <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style="right:55px;background: url(../images/comment.png) no-repeat;padding:3px;padding-left:20px">34</span> <span class="ui-li-count ui-btn-up-c ui-btn-corner-all" style="right:5px;background: url(../images/like.gif) no-repeat;padding:3px;padding-left:20px">442</span> </li> <li role="option" tabindex="-1" data-theme="c" class="ui-li-has-thumb ui-btn ui-btn-icon-right ui-li ui-corner-bottom ui-btn-up-c"><div class="ui-btn-inner"><div class="ui-btn-text"> <a href="#" class="ui-link-inherit"> <img width="40" height="40" src="../members/mariamjohnson/media/878_thumb.jpg" class="ui-li-thumb ui-corner-bl"> <div style="font-size:9pt;font-weight:normal;">WAIT A MINUTE,GWE DAN CAN YOU PLEASE BEHAVE YOURSELF,IF YOU HAVE NOTHING TO DO ,GO GET YOURSELF WASTED ELSEWHERE,YOU ARE ABUSIVE AND YOU ARE BEGINING TO IRRETATE ME LIKE A RASH.GURU CHAIN HIM UP,HE SHOULD NOT SPEAK UNTIL SPOKEN TO ,OK?</div> </a> </div><span class="ui-icon ui-icon-arrow-r"></span></div></li> </ul> ``` looks like jquery mobile adds extra and classes to the mrkup... any solutions? ![enter image description here](https://i.stack.imgur.com/y5lR0.png)
Styling jquery mobile listviews
CC BY-SA 2.5
0
2011-03-10T20:21:54.613
2013-06-13T11:58:00.280
2011-03-24T20:12:12.050
477
384,894
[ "javascript", "jquery", "listview", "mobile", "jquery-mobile" ]
5,265,837
1
5,265,988
null
8
14,559
I was wondering if there’s an easy way to convert a label matrix into a matrix where you have lines anywhere two labeled regions meet and zeros elsewhere so that you could basically superimpose the borders of regions on the original image from which the labels were generated as another visualization alternative to the popular label2rgb function. The reason I ask is that I’m currently working on with some superpixel code, so I have many labeled regions (500 to 5,000). I’ve been using rgblabel to convert the superpixel labels to colored regions, turning hold on, then displaying them over the original image with 'AlphaData' turned down to make them semi-transparent. However, with so many regions, this can be hard to analyze visually and I think simple borders of the regions would work better. Thanks. [EDIT] @O_O: I've attached a sample label matrix along with the target result although I'm now quite satisfied with Jonas's second suggestion. Will try method from user616736 as well in the next day. I've also [uploaded](http://www.site.uottawa.ca/~ssilk083/label_matrix_borders.zip) the sample images in .mat format here in case anyone else wants to experiment with them. Label Matrix: ![Label Matrix](https://i.stack.imgur.com/bEhSB.jpg) Desired Result: ![Desired Result](https://i.stack.imgur.com/jqsPj.jpg)
Find outlines/ borders of label image in MATLAB
CC BY-SA 3.0
0
2011-03-10T20:59:01.713
2016-10-03T13:44:43.693
2016-10-03T13:44:43.693
380,329
380,329
[ "matlab", "image-processing", "label" ]
5,266,137
1
null
null
0
506
The environment is an iOS device with multitasking support, like an iPhone4. I'm in a cocos2d app with a Main Menu that leads to several Scenes. ![enter image description here](https://i.stack.imgur.com/EfIgC.png) If I switch to another app using the taskbar, then switch back, how do I programmatically tell which scene is active?
Which cocos2d scene is currently active when returning from suspended app state
CC BY-SA 2.5
0
2011-03-10T21:29:14.583
2011-03-11T11:16:05.320
null
null
23,973
[ "ios", "cocos2d-iphone", "multitasking" ]
5,266,236
1
null
null
0
642
I have to develop an application that offers some basic functionality as shown in figure: ![enter image description here](https://i.stack.imgur.com/Gfbcz.jpg) It has to display a table of entries that is totally static and does not involve CRUD. I first made this app using .NET winforms but the size of setup (including .net client runtime) reached over 50 MB but my client wants something less than one MB. Is there a way I can develop such application that can run as stand alone executable providing tabular listing of entries, searching and printing. I don't know what language I should target.
How to compress a standalone exe project under 1MB in size?
CC BY-SA 3.0
null
2011-03-10T21:38:36.830
2018-04-26T12:59:02.033
2018-04-26T12:59:02.033
472,495
331,174
[ ".net", "deployment", "exe" ]
5,266,350
1
5,267,479
null
470
131,239
I would like to archive my application, but the Archive option is greyed out. What could cause this? ![enter image description here](https://i.stack.imgur.com/uvldQ.png)
Xcode 4 - "Archive" is greyed out?
CC BY-SA 2.5
0
2011-03-10T21:50:59.737
2021-06-01T12:07:40.757
2019-08-26T10:23:33.030
1,735,653
91,414
[ "xcode", "xcode4" ]
5,266,630
1
5,266,660
null
3
421
I am working on a program that fills an array with data from a text file. When I output the array its contents are not in the order I thought I read them in. I'm thinking the problem is either in one of the for loops that inputs data into the array or outputs the array to the iostream. Can anyone spot my mistake? : (I changed the first number in each row to 2-31 to differentiate it from the 0's and 1's) ![enter image description here](https://i.stack.imgur.com/Gg4ay.png) : ![enter image description here](https://i.stack.imgur.com/Jd5lB.png) : ``` #include <cstdlib> #include <iostream> #include <fstream> #include <iomanip> using namespace std; int main() { ifstream inFile; int FC_Row, FC_Col, EconRow, EconCol, seat, a, b; inFile.open("Airplane.txt"); inFile >> FC_Row >> FC_Col >> EconRow >> EconCol; int airplane[100][6]; int CurRow = 0; int CurCol = 0; while ( (inFile >> seat) && (CurRow < FC_Row)) { airplane[CurRow][CurCol] = seat; ++CurCol; if (CurCol == FC_Col) { ++CurRow; CurCol = 0; } } while ( (inFile >> seat) && (CurRow < EconRow)) { airplane[CurRow][CurCol] = seat; ++CurCol; if (CurCol == EconCol) { ++CurRow; CurCol = 0; } } cout << setw(11)<< "A" << setw(6) << "B" << setw(6) << "C" << setw(6) << "D" << setw(6) << "E" << setw(6) << "F" << endl; cout << " " << endl; cout << setw(21) << "First Class" << endl; for (a = 0; a < FC_Row; a++) { cout << "Row " << setw(2) << a + 1; for (b = 0; b < FC_Col; b++) cout << setw(5) << airplane[a][b] << " "; cout << endl; } cout << setw(23) << "Economy Class" << endl; for (a = 6; a < EconRow; a++) { cout <<"Row " << setw(2)<< a + 1; for (b = 0; b < EconCol; b++) cout << setw(5) << airplane[a][b] << " "; cout << endl; } system("PAUSE"); return EXIT_SUCCESS; } ```
Am i filling this array wrong or outputting it wrong?
CC BY-SA 2.5
null
2011-03-10T22:21:11.463
2011-03-10T22:53:58.300
2011-03-10T22:53:58.300
538,293
538,293
[ "c++", "arrays" ]
5,266,810
1
5,268,502
null
0
12,352
I want to change the style of a button in an android app. here is a picture that has both kinds of buttons, the one that I have now, and the one that I want to switch to: ![enter image description here](https://i.stack.imgur.com/mzIIm.png) the kinds of buttons that I am using now, look like any of the letters on that keyboard. the ones that I want to use like like the arrows. I would I go about changing this. I prefer to do it in xml but I can do it in java if that is the only way. Thanks
how do I change the style of a button in android?
CC BY-SA 2.5
0
2011-03-10T22:44:56.070
2011-03-11T02:59:54.277
null
null
599,402
[ "android", "button", "coding-style" ]
5,266,818
1
5,275,034
null
3
3,996
Hey. I have a maps application that uses google maps. I get the bounds off the map, and then I do some clustering markers on that grounds, but to be able to have the clusters stay at the same place, I'd like to know how to make the boundaries that I pass snap into the tilegrid that google uses. The quadtree algorithm they use for their map essentially what I'm asking for is how do I get the bounds for the tiles that the viewport is in. I've tried to illustrate it :) ![google tiles viewport cluster](https://i.stack.imgur.com/5WKbR.gif) If I do the cluster calc on the tile bounds and not the viewport, when I split it up in a grid, the clusters will stay in the same place, because the grid will be absolute at each zoom level. Also this allows for better query caching, as the queries will be a lot similar when the bounds have to "snap in" to the tiles, AND the user will be able to pan with markers in proximity being displayed already. I'm starting over... I've got this ``` function TileMyBounds($sx, $sy, $nx, $ny, $zoom) { function TileMyBounds($sx, $sy, $nx, $ny, $zoom) { list($nmx,$nmy) = $this->LatLonToMeters($ny/1000000, $nx/1000000); list($ntx, $nty) = $this->MetersToTile($nmx, $nmy, $zoom); $nbounds = $this->TileLatLonBounds($ntx, $nty, $zoom); list($smx,$smy) = $this->LatLonToMeters($sy/1000000, $sx/1000000); list($stx, $sty) = $this->MetersToTile($smx, $smy, $zoom); $sbounds = $this->TileLatLonBounds($stx, $sty, $zoom); $step = ($sbounds[3]-$sbounds[1])*1000000; return array($sbounds[0]*1000000, $sbounds[1]*1000000, $nbounds[2]*1000000, $nbounds[3]*1000000, $step); } ``` and the function where I use it looks like this: ``` function clusterGrid($zoom,$nelt,$nelg,$swlt,$swlg) { $singlemarkers = array(); $clusters = array(); list($swlg, $swlt, $nelg, $nelt, $step) = $this->TileMyBounds($swlg, $swlt, $nelg, $nelt, $zoom); $calcbounds = $this->TileMyBounds($swlg, $swlt, $nelg, $nelt, $zoom); $queryconcat = ""; $length_lng = ceil(($nelg-$swlg)/$step); $length_lat = ceil(($nelt-$swlt)/$step); $orgnelg = $nelg; $orgswlt = $swlt; for($i=0;$i < $length_lng + 1; $i++) { $nelg -= $step; $temp_swlt = $swlt; for($j=0; $j < $length_lat + 1; $j++) { $temp_swlt += $step; if($nelg > $orgnelg) continue; if($temp_swlt > $nelt) continue; if($nelg < $swlg) continue; if($temp_swlt < $orgswlt) continue; $q = $this->db->select(' COUNT(*) AS CO, (MAX(lat)+MIN(lat))/2 AS lat, (MAX(lng)+MIN(lng))/2 AS lng') ->where('`lat` BETWEEN '.$temp_swlt.' AND '.($temp_swlt+$step).' AND `lng` BETWEEN '.($nelg-$step).' AND '.$nelg) ->get('markers'); $queryconcat += $this->db->last_query(); $result = $q->row_array(); if($result['CO'] == 0) { continue; } $clusters[] = array('lat' => ($result['lat']), 'lng' => ($result['lng']), 'size' => $result['CO']); } } return array('singlemarkers' => '', 'clustermarkers' => $clusters, 'bounds' => $calcbounds, 'lengths' => array($length_lng, $length_lat)); } ``` The tiles are somewhat precise, yet not entirely, so when panning around, the clusters can "move around" a little. Due to the fact that the `$step = ($sbounds[3]-$sbounds[1])*1000000;` calculation is not always the same at each zoom level, as I would've expected because I would think that a tile would have the same width and length in lat and lon as any other tile at the same zoom level.
calculate tile size of google map at zoom level n
CC BY-SA 2.5
0
2011-03-10T22:45:44.850
2012-11-01T10:18:09.957
2011-03-12T11:58:34.063
347,904
347,904
[ "php", "google-maps", "cluster-analysis", "mercator" ]
5,266,931
1
null
null
1
1,339
I was thinking about how to make some cool image effects in browser, and I know it may be a little late to be heading down this train of thought with HTML5/CSS3 up and coming, but I was wondering what the inherent limitations / problem points there would be with implementing a library that essentially created divs each to hold a pixel of an image using background offsets. It is clear that this will create many divs, but if you wanted to work with only rows or columns on a small image it doesn't seem like this would be that unreasonable. With browser caching images, a request wouldn't have to be made for every segment, and the only other potential problem I can see is the processing of the positioning, which I imagine won't be a problem. I don't really have anything at this point to stop from going forward playing with images like this (so I will!), but I'm curious if there is anything that I am overlooking here that would make the idea unfeasible, and especially anything tricky I should be aware of. Thanks :) Edit: Tried this, and it seems like there is either an inherent problem or a problem in my code (sorry it sucks, was just playing around), use with any image and you will see the difference. ``` var lpath = "images/logo.png" window.onload = function(){ console.log('test'); $('body').append("<img id='logo' style='display:none' src="+lpath+">"); console.log($('#logo').width()); console.log('hello'); var logod = $('<div></div>') .addClass('i') .width($('#logo').width()) .height($('#logo').height()) .css('background-image','url('+lpath+')') $('body').append(logod); for(var i = 1; i <= $('#logo').height(); i++){ var cons = $("<div></div>") .height(1) .width($('#logo').width()) .css('background','url('+$('#logo').attr('src')+') no-repeat 0 ' + (-i)); $('body').append(cons); } } ``` ![enter image description here](https://i.stack.imgur.com/UP3ub.png) Image on the top is just an , image on the bottom is a series of 1px tall divs. PS Has to do with browser zoom.
split images into pixel divs
CC BY-SA 2.5
0
2011-03-10T22:58:41.843
2011-03-11T20:10:13.267
2011-03-11T20:10:13.267
405,015
369,591
[ "javascript", "html", "css" ]
5,267,471
1
5,267,594
null
0
2,131
I want to make a grid with wrap panel behavior and resizable control inside it, how can I do this? maybe it's easier to show what I want in images : initial state: ![enter image description here](https://i.stack.imgur.com/obwrS.png) resize control 1 with direction bottom-right so it will take around 2x2 cells, then control 2 and so on will rearrange it's position on the grid: ![enter image description here](https://i.stack.imgur.com/rpcmk.png) when it's resized back it should be back to initial state.
Grid-Like WrapPanel with resizable control in WPF
CC BY-SA 2.5
null
2011-03-11T00:04:24.773
2011-03-11T00:46:53.540
null
null
269,963
[ "wpf", "grid", "resizable", "wrappanel" ]
5,267,569
1
5,267,810
null
16
38,975
I saw these on jQuery UI's themes page, and thought they were neat. ![](https://i.stack.imgur.com/twyXk.jpg) I wonder how to display messages with these styles both in a static way and with JavaScript. Thanks in advance.
Display Messages with jQuery UI
CC BY-SA 2.5
0
2011-03-11T00:18:36.167
2012-11-12T14:13:48.887
null
null
407,236
[ "jquery", "jquery-ui" ]
5,267,580
1
5,267,747
null
3
7,249
iPhone's resolution is 480*320. However, it has a global at the top, and Safari uses an and . How much vertical space do they take up? Or, what's the resolution on Safari's horizontal and vertical viewable area? ![Safari on iPhone - How much of the webpage is visible?](https://i.stack.imgur.com/tz2OD.png) --- 1. Status bar, 20 px 2. Address bar, 60 px 3. Toolbar, 44 px
What is the initial viewable area of a website on the iPhone?
CC BY-SA 2.5
0
2011-03-11T00:19:40.793
2011-03-13T19:09:31.433
2011-03-13T19:09:31.433
154,065
154,065
[ "iphone", "mobile-safari", "viewport", "screen-resolution" ]
5,267,581
1
5,267,738
null
0
219
I am trying to connect to a BlackFish database in another machine using win32 dbExpress 4 database driver. Server is start in both machines, local and remote. Database is up in both machines local and remote. --- UPDATE --- this is my configuration: ![enter image description here](https://i.stack.imgur.com/OIfKK.png) "devmobilWRK" is the remote machine. This is the result of the test Connection: ![enter image description here](https://i.stack.imgur.com/Ehcki.png) Both machine have the same port - 2508 I have delphi 2007 installed in both machines
How can I connect to a BlackFish Database in another PC
CC BY-SA 2.5
null
2011-03-11T00:19:42.070
2011-03-11T01:46:40.253
2011-03-11T01:46:40.253
48,705
48,705
[ "delphi", "database-connection", "blackfish" ]
5,267,933
1
5,269,239
null
2
1,257
In order to figure out (or guess) something from one of our proprietary desktop tools developed by wxPython, I injected a logging decorator on several regardful class methods. Each log record looks like the following: ![log records of one application in phpmyadmin way](https://i.stack.imgur.com/vl1eL.png) Right now, there are more than 3M log records in database and I started to think "What I can get from those stuff?". I can get some information like: - - - I guess the related technique might be . Does anyone have any idea for further information I can retrieve from this really simple log? I'm really interested to get something more from it.
How to do Log Mining?
CC BY-SA 2.5
0
2011-03-11T01:10:37.230
2016-12-22T14:19:13.400
null
null
261,718
[ "python", "logging", "data-mining" ]
5,267,989
1
null
null
20
1,501
I have been a fan of the new "Navigate To" feature that was [released](http://www.hanselman.com/blog/VisualStudio2010Released.aspx) with Visual Studio 2010 since I saw Scott Hanselman using it in one of his [presentation](http://www.youtube.com/watch?v=-QrNrCT08-s). For some unknown reason, it randomly stops working. I hit "Ctrl + ,", type what I am looking for and then nothing happens. It seems to wait for something and the window shows no progression in the research. ![enter image description here](https://i.stack.imgur.com/8PH7K.png) The only way I found to fix this is to restart Visual Studio and wait for the problem to happen again. Does anyone have any idea why Visual Studio is behaving like this and how I can fix this?
Why does the "Navigate To" feature stops working in Visual Studio 2010
CC BY-SA 2.5
0
2011-03-11T01:21:51.007
2013-03-25T06:49:18.497
null
null
463,192
[ "visual-studio", "visual-studio-2010" ]
5,267,998
1
5,268,106
null
136
50,406
Email field: ``` <label for="job_client_email">Email: </label> <input type="email" name="job[client_email]" id="job_client_email"> ``` looks like this: ![without_error](https://i.stack.imgur.com/35gsM.jpg) But, if the email validation fails, it becomes: ``` <div class="field_with_errors"> <label for="job_client_email">Email: </label> </div> <div class="field_with_errors"> <input type="email" value="wrong email" name="job[client_email]" id="job_client_email"> </div> ``` which looks like this: ![with_error](https://i.stack.imgur.com/LPFoa.jpg) How could I avoid this appearance change ?
Rails 3: "field-with-errors" wrapper changes the page appearance. How to avoid this?
CC BY-SA 2.5
0
2011-03-11T01:23:54.503
2020-08-06T02:14:19.123
null
null
247,243
[ "ruby-on-rails", "ruby-on-rails-3", "validation", "field-with-errors" ]
5,268,142
1
5,321,356
null
3
4,176
I just upgraded to XCode 4 and am now unable to view a number of my previous XCode 3 projects. When I launch the projects XCode opens, but it looks like this: ![No Files and No Editor](https://i.stack.imgur.com/r7oud.png) Any way to tell what is going wrong? Any special logs I can look at? I don't get any warnings or errors appearing!
XCode 4 Unable to Open Old Projects
CC BY-SA 2.5
0
2011-03-11T01:53:19.467
2012-06-05T18:41:21.063
2011-03-11T15:15:36.160
259,900
259,900
[ "xcode", "macos" ]