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,670,519
1
5,670,559
null
1
178
I need download some html content (pages) made for iphone (or mobile devices) using delphi from a desktop application. for example i wanna download the twitter page for iphone which look like this . ![enter image description here](https://i.stack.imgur.com/mBHpA.png) but I don't know how retrieve such pages (mobile editions), currently i using the `TIdHttp` component.
Download iphone web pages using delphi
CC BY-SA 3.0
null
2011-04-14T22:36:12.603
2011-04-14T22:41:56.123
null
null
167,454
[ "delphi", "delphi-xe" ]
5,670,570
1
5,670,593
null
1
2,435
I have two Tables: Users and Permission. They share 2 columns with the same name, so I need to copy values of those 2 columns from 'Users' to 'Permission'. However, . See the diagram for further understanding: ![enter image description here](https://i.stack.imgur.com/1thUk.png) What SQL command should I use to perform this feat? Thanks!
Copying the values from specific columns from an SQL table to another table
CC BY-SA 3.0
null
2011-04-14T22:44:51.277
2011-04-14T22:49:20.783
null
null
1,049,130
[ "sql", "sql-server" ]
5,670,879
1
5,670,984
null
191
375,271
I want to create some decent inputs for my form, and I would really like to know how TWITTER does their glowing border around their inputs. Example/Picture of the Twitter border: ![enter image description here](https://i.stack.imgur.com/v33Wq.png) I also don't quite know how to create the rounded corners.
CSS/HTML: Create a glowing border around an Input Field
CC BY-SA 3.0
0
2011-04-14T23:32:29.093
2020-03-04T11:09:47.040
2012-07-16T02:31:45.520
895,646
708,920
[ "html", "css", "input", "border", "glow" ]
5,671,000
1
5,727,375
null
3
25,384
I am looking at a Microsoft Network Monitor capture of an HTTPS "GET" request which mysteriously never completes if performed by .NET `HttpWebRequest`. I have found that the Server Hello contains an Alert entry which looks like this: ![enter image description here](https://i.stack.imgur.com/Znf4P.png) I have these questions: I read that alerts do come encrypted if sent after a key exchange, but as you can see, this occurs very early in the negotiation stage, at Server Hello. The first byte, `01`, suggests it's a warning, but the `70` ("Protocol Version") is a error. Surely `70` can only appear as part of `02 70`? "Protocol version" suggests something's up with the, erm, protocol version. However the Client Hello contains "TLS 1.0" as the max version, and the Server Hello specifies "TLS 1.0" too. What else could be wrong? I can attach the whole capture if anyone is feeling brave :) The code I used to perform this request is [shown in my other question](https://stackoverflow.com/questions/5653868/what-makes-this-https-webrequest-time-out-even-though-it-works-in-the-browser).
What does this TLS Alert mean?
CC BY-SA 3.0
0
2011-04-14T23:52:28.377
2011-04-20T08:13:03.340
2017-05-23T10:30:24.107
-1
532,955
[ "https", "ssl" ]
5,671,021
1
5,671,351
null
19
14,004
I have a scrollviewer that contains a stackpanel of textblock items (actually, these are probably tabitems, I'm using a stackpanel inside a scrollviewer to override the default tabpanel in a tabcontrol template). What I'd like to be able to do is, when the selected tab is changed, move the newly selected tab to the center of the scrollviewer's visible area. Ideally this would work for all the tabs, even those on the far sides, but I would settle for being able to tell the scrollviewer to scroll such that a particular element is as close to centered as possible. Are there any obvious ways to achieve this in WPF? All the solutions I can think of right now involve a lot of work on custom controls. ![enter image description here](https://i.stack.imgur.com/l1Of8.png)
WPF - centering content in a scrollviewer?
CC BY-SA 3.0
0
2011-04-14T23:56:14.237
2017-12-13T19:13:40.793
2011-04-15T00:09:15.690
546,730
596,201
[ "c#", "wpf", "scrollviewer" ]
5,671,207
1
5,672,310
null
2
2,210
Greetings, Until now I have mostly been working with google maps v2. I am now making my way to v3, but I came across a problem I havent been able to find a solution for. In V2, when using directions, I could add a point on the map with no actual road, and the maps api would automatically figure out the closest possible endpoint where a road exists and display directrions to that point. This seems not to be the case with V3 though. In allot of cases the route is wrong, because I haven't placed my point on an actual road and the service fails (?) to find the closest one. Here is a screenshot to display what I mean: ![enter image description here](https://i.stack.imgur.com/dcSD8.jpg) I am using the exact same coordinates for both maps. The red pins on V3 show where those coordinates actually point to, but as you can see the directions are wrong. Only if I use coordinates that are exactly on a road, then they show up correctly (not displayed here). I am using the exact same coordinates on V2 and V3, but only V2 displays the correct directions. Here is a sample of the code I am using for getting the direcrtions: ``` var directionDisplay; var directionsService = new google.maps.DirectionsService(); var map; function initialize() { //Works fine, so I ommit the code } function calcRoute(endpointCoords) // endpointCoords holds coordinates for end point { var startpoint = '<?=$startPoint[latitude];?>, <?=$startPoint[longitude];?>'; var endpoint = endpointCoords; var request = { origin:startpoint, destination:endpoint, travelMode: google.maps.DirectionsTravelMode.DRIVING }; directionsService.route(request, function(response, status){ if (status == google.maps.DirectionsStatus.OK) { directionsDisplay.setDirections(response); } }); } ``` The documentation did not help me much further ( [http://code.google.com/apis/maps/documentation/javascript/services.html#Directions](http://code.google.com/apis/maps/documentation/javascript/services.html#Directions) ) Have you had similar experience with the v3 version of the api? Any ideas why this happens? UPDATE: Here is a link that shows the code and problem in action: [http://jsfiddle.net/spairus/gNpZ2/](http://jsfiddle.net/spairus/gNpZ2/)
Google maps V3 directions service fails to find roads close to selected point resulting in wrong directions
CC BY-SA 3.0
0
2011-04-15T00:29:33.473
2011-04-15T14:28:18.743
2011-04-15T14:28:18.743
231,120
231,120
[ "google-maps", "google-maps-api-3" ]
5,671,399
1
null
null
1
2,153
Looks like dumb question, but...: ``` - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; self.bar = [[UISearchBar alloc] initWithFrame:CGRectMake(0.0, 20.0, self.navigationController.view.bounds.size.width, HEADER_HEIGHT)]; mySearchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:bar contentsController:self]; mySearchDisplayController.delegate = self; mySearchDisplayController.searchResultsDataSource = self; mySearchDisplayController.searchResultsDelegate = self; [self.navigationController.view addSubview:self.bar]; ``` All behavior is working fine while i don't press a cancel or hided tableview. After that search bar is closed and i see a clear navigation bar, without search bar. I has change to viewDidload, but nothing changed. Before start printing: ![enter image description here](https://i.stack.imgur.com/EzE6A.png) after: ![enter image description here](https://i.stack.imgur.com/xdL2s.png)
UISearchbar inside uinavigationcontroller
CC BY-SA 3.0
0
2011-04-15T01:04:15.880
2011-04-15T13:47:58.067
2011-04-15T13:47:58.067
493,920
493,920
[ "iphone" ]
5,671,759
1
5,672,205
null
0
172
Consider the Android native clock app. Here is a picture of it, the graphics looks modified (compared to mine at least) but it gets the point across: ![The tabs](https://i.stack.imgur.com/jyLjk.png) See those tabs on top? When you click them, a new view pops up below in the main body of the activity. Currently it is alarm clock, but if you clicked timer or stopwatch that would change. How is this accomplished? From what I can tell it is the same activity (clicking only causes a different button to be highlighted, there is no transition to a new activity). I'm sure this is a totally simple question, but I haven't come across it yet and I tried to search for it but I guess I wasn't explaining it well enough for the google and SO search engine... Thanks!
Android: What kind of layout is used to have different views controlled by buttons on the same activity?
CC BY-SA 3.0
null
2011-04-15T02:22:31.320
2011-04-15T03:52:58.573
null
null
588,758
[ "android", "button", "android-activity", "view" ]
5,671,764
1
5,671,928
null
1
1,660
I have a set of simple shapes (see following figure), and I want to recognize handwriting shape and figure out which shape it probably is in the set. Is there any simple algorithm to do that? Or any open source lib? BTW, my task is simple, so I don't use too complicated lib like OpenCV. Thanks, in advance!! ![shapes](https://i.stack.imgur.com/SelXf.png)
how to recognize simple handwriting shapes?
CC BY-SA 3.0
0
2011-04-15T02:23:31.607
2011-04-15T03:07:45.190
null
null
666,953
[ "c++", "c", "open-source", "image-recognition" ]
5,671,772
1
5,683,857
null
12
35,558
I am comparing the certificates in my local computer and MMC.exe permits me to view the certificates for "Current User" and "Computer". I don't understand why there would be two "personal" stores. Can someone explain why there are two, and how they interact? It would be nice to know why those other folders are there too. The only one that I think has a fixed meaning is "Trusted Root Certificates". The other constant is that Fiddler also seems to put its certificates into "Current User \ Personal" ![enter image description here](https://i.stack.imgur.com/rXQX7.png) For example; FedUtil will only use certificates located in the following location (web.config) ``` <serviceCertificate findValue="6CB9aaaaa636EBF52980152CDCB02D3BBBBBBBBB" storeLocation="LocalMachine" storeName="My" x509FindType="FindByThumbprint" /> ```
Why is there a "Computer\Personal\Certificates" store and also "Current User\Personal\Certificates"
CC BY-SA 3.0
0
2011-04-15T02:25:50.410
2016-01-08T12:44:52.237
2011-04-15T20:35:16.723
328,397
328,397
[ "encryption", "windows-7", "certificate", "ssl-certificate", "x509certificate" ]
5,671,789
1
5,671,835
null
1
4,348
Im trying to find a way either with ajax or jquery that can angle the picture in the point I wanted. For example I want to have four point in my background (picture #1) and then have a picture which every corner of that pointed and adjusted to my desire points (picture #2). Its going to be dynamic and basically picture #1 will be static but picture #2 will be changing with the next/previews key. Kind of like gallery. These points and image may vary in different galleries and has to have ability to get modified. ![Valid XHTML](https://lh5.googleusercontent.com/_LwKumzGQ1Lw/TaerB1jKHiI/AAAAAAAAB_E/P1ieuylmLuE/angle.jpg). Any suggestions? Thanks in Advance.
Scale and skew images using jQuery or AJAX
CC BY-SA 3.0
null
2011-04-15T02:30:05.657
2011-04-15T07:14:49.893
2011-04-15T07:14:49.893
283,844
577,979
[ "javascript", "jquery", "css", "ajax" ]
5,672,095
1
5,674,731
null
3
1,872
I have FFT outputs that look like this: ![messy fft](https://i.stack.imgur.com/3dNuF.png) At 523 Hz is the maximum value. However, being a messy FFT, there are lots of little peaks that are right near the large peaks. However, they're irrelevant, whereas the peaks shown aren't. Are the any algorithms I can use to extract the maxima of this FFT that matter; I.E., aren't just random peaks cropping up near "real" peaks? Perhaps there is some sort of filter I can apply to this FFT output? EDIT: The context of this is that I am trying to take one-hit sound samples (like someone pressing a key on a piano) and extract the loudest partials. In the image below, the peaks above 2000 Hz are important, because they are discrete partials of the given sound (which happens to be a sort of bell). However, the peaks that are scattered about right near 523 seem to be just artifacts, and I want to ignore them.
Finding Relevant Peaks in Messy FFTs
CC BY-SA 3.0
0
2011-04-15T03:30:02.023
2011-10-04T23:18:56.837
2011-04-15T04:21:29.843
644,220
644,220
[ "filtering", "signal-processing", "fft", "max" ]
5,672,162
1
5,675,675
null
1
6,601
I have been working on a jqplot horizontal bar graph. I WANTED TO HAVE THIS OUTPUT (I wanted the Point Labels to be in percentage and should be placed at the starting point of the graph) ![Expected Outpt](https://i.stack.imgur.com/acGJy.png) ``` $.jqplot.config.enablePlugins = true; voteResults = [[Chinabank,0],['Citibank',100], ['UOB',0]['POSB',0],['OCBC',0]]; // voteResults = [[Chinabank,50],['Citibank',50], ['UOB',0]['POSB',0],['OCBC',0]]; plot = $.jqplot('chart1', [voteResults], { seriesDefaults:{ renderer:$.jqplot.BarRenderer, shadowAngle: 135, rendererOptions: { barDirection: 'horizontal', barWidth:15, barMargin: 25 } }, axes: { yaxis: { renderer: $.jqplot.CategoryAxisRenderer, tickOptions:{ showGridline:true, markSize:0 } }, xaxis:{ ticks:[0,100], tickOptions:{formatString:'%d\%'} } } }); ``` Right now the point labels are displayed after the end of the bar graph and if the point value is somewhere near 100% it won't display anything. And the Points are displayed as a whole number. Is there a way that I could move the points near the starting point of the bar graph? The code above displays these sample outputs… I hop you can help me fix my problem :( ![Sample Output 1](https://i.stack.imgur.com/Zb8sk.png) ![Sample Output 2](https://i.stack.imgur.com/Q8L7C.png) Thank you :)
JQPlot - Move the point label to the starting point of the graph
CC BY-SA 3.0
0
2011-04-15T03:44:03.097
2013-02-28T11:50:49.340
null
null
249,580
[ "jquery", "asp.net", "jquery-plugins", "graph", "jqplot" ]
5,672,167
1
5,672,187
null
2
149
I have an interesting project in mind, and I have a question. You can see the look from my jank design below:![enter image description here](https://i.stack.imgur.com/MGkiO.png) I have a variety of technologies I'm planning on leveraging. To give you an idea: - - - `#content` Now, with this in mind, I have no problem leveraging technologies that are not supported by most browsers. That's not any concern. For my question, on the page I have laid out above, the only thing I want to change (besides the updating chat feature) is the content. I would like to load the "Home", "About", "Contact" and "Login" sections of my website into the `#content` portion of the page. Now, I have an instinct to say the best way to achieve this goal is through AJAX, but I'm not sure. Since I could possibly just set up some files with the HTML I'd like to display, and then onclick, load them into the `#content` section. Is this the best method to use? I'm looking for practicality and performance. Sorry for the bizarre question. Thanks!
What technologies should I use to load content into a dynamic div?
CC BY-SA 3.0
null
2011-04-15T03:44:52.067
2011-04-15T05:37:25.770
null
null
403,965
[ "javascript", "ajax" ]
5,672,304
1
27,697,245
null
20
20,188
I've created more projects using ReportViewer 2005 and 2008 in local processing mode than I can count on my hands. All Visual Studio 2005 or 2008 ASP.NET web forms projects. I always used some flavor of Object data source for the reports. Tonight, I attempted to add the same functionality to a Visual Studio 2010 MVC 2 project and am failing miserably. First, the Add New Item > Reporting > Report is now a 2008 RDLC and not a 2005 RDLC report. Secondly, when trying to add a DataSet, my usual method of create a data proxy class with static methods that return `IEnumerables(Of Stuff)` will not show up as sources in the DataSources drop down ![Empty Data Source](https://i.stack.imgur.com/0fLnN.png) Thirdly, my option is to add a Database connection. There is no "Object Data Source" to pick from: ![Database connections only](https://i.stack.imgur.com/7cptm.png) I'm stumped. Like I kind of alluded to, I have no problems whatsoever actually rendering a report using the ReportViewer control. What I can't do is figure out how set up a Data Source in these new-fangled 2008 reports with Visual Studio 2010 so that I can pump a list of domain objects into the ReportViewer and display the report. With some more research, I've found that MVC projects do not allow object data sources to be used within them. One solution for my issue is to create a separate project in the solution -- a web application, a service, or even just a class library, to add the report to and design it accordingly. I'm still looking for alternatives here.
Visual Studio 2010 Local SSRS Report (.rdlc) with Object Data Source
CC BY-SA 3.0
0
2011-04-15T04:11:06.037
2017-09-03T13:38:03.727
2017-09-03T13:38:03.727
1,033,581
74,757
[ "vb.net", "visual-studio-2010", "asp.net-mvc-2", "reportviewer", "rdlc" ]
5,672,520
1
null
null
1
436
I am creating an app in which I am able to swap the views using the top buttons named "1"and "2"....using them i can swap the views in the box. I am using the view controller. but the problem is that I want to swap my views using the buttons inside the view. I want to swap the view when I press the button inside one view. I have tried all the thing but not working. [box setContentView:v]; [box addSubview:v]; Please help ![enter image description here](https://i.stack.imgur.com/TMkmG.png)
Swapping Views in Mac application
CC BY-SA 3.0
0
2011-04-15T04:50:41.793
2011-04-18T05:49:25.417
null
null
585,387
[ "objective-c", "cocoa", "macos" ]
5,672,562
1
5,672,584
null
57
157,367
According to the beginner guide, to setup the ADT Plugin, one of the procedures is [http://developer.android.com/sdk/eclipse-adt.html#installing](http://developer.android.com/sdk/eclipse-adt.html#installing) > For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. I went to Program Files, found Android directory, but none of those works. Upon research, I found out that Android developers have warned me to take note of the SDK directory, which I didn't. Now my question is, how do I get that directory path? I don't want to reinstall the SDK, and then install the updates (lots of mess...) Thanks for the help! --- That exe that you guys wanted me to look for is indeed inside platform-tools. I installed Android SDK, and it gives me Android SDK Manager. So I am guessing I had the right thing installed on my PC. ![enter image description here](https://i.stack.imgur.com/89PQi.png)
setup android on eclipse but don't know SDK directory
CC BY-SA 3.0
0
2011-04-15T04:59:43.250
2017-10-31T11:12:54.320
2011-04-15T05:43:03.963
230,884
230,884
[ "android", "eclipse" ]
5,673,065
1
5,673,109
null
1
3,968
I am running 1 background process in my application...it continuously checks for some input...When proper input is entered of found..It will play Some wav file.. I have added 1 wav filled named as "ding.wav" into Resources.. and i have written following code in my application... I am using System.Media namespace. and using .Net 4.0 ``` SoundPlayer player = new SoundPlayer(); player.Stream = Properties.Resources.ding; player.Play(); ``` but sound is not playing... Can you tell me what i am doing wrong..!! ![enter image description here](https://i.stack.imgur.com/arOVN.png)
Sound not playing in my application
CC BY-SA 3.0
null
2011-04-15T06:18:41.700
2022-10-20T18:33:52.097
null
null
531,014
[ "c#", ".net", ".net-4.0", "windows" ]
5,673,113
1
5,676,328
null
8
5,887
please look at the following screenshot ![enter image description here](https://i.stack.imgur.com/Ts0JJ.png) As you see there are two certificates. All are mine, with maching user's ID and common name. Whenever I build the application and launch it in Xcode for device I receive the fatal, that this certificate is duplicated. So I delete the expired one and launch the application again - it's being installed and debugged on device without any problems. But when I launch other project or reboot that expired certificate is shown in the keychain again and again and it's becoming a little bit annoying. What causes that the expired certificate is being readded to the keychain? How can I dissable it?
Xcode expired certificate problem
CC BY-SA 3.0
0
2011-04-15T06:26:34.783
2013-08-15T07:50:08.057
2011-04-15T11:59:24.880
256,728
491,375
[ "iphone", "cocoa-touch", "xcode4", "code-signing" ]
5,673,290
1
6,839,600
null
2
484
hi guys how do I make a menu like the one that tap tap "where to" app uses, (circular menu, that gets highlited when touched) ![enter image description here](https://i.stack.imgur.com/PcNbX.png) As I saw in some wwdc video they explain the design behind this app, they explain that the menu was a table that goes to a view before being placed in the circle, so it haves a nav bar after an item has been chosen, I saw this link [designing convertbot](http://tapbots.com/blog/design/designing-convertbot), they explain the design for their menu but not the coding or how it works (noob here!) ok thanks a lot!
iphone menu like tap tap
CC BY-SA 3.0
null
2011-04-15T06:51:27.790
2011-07-27T04:58:49.803
2011-05-02T04:58:51.687
523,507
523,507
[ "iphone", "menu" ]
5,673,443
1
null
null
0
293
![Image of excel want to write](https://i.stack.imgur.com/2tDbL.jpg)Hi all, Please help me out, how to write headers and subheaders in excel using asp.netmvc1. Please do see the image for reference. In image see from line no 13 to 15 i want to write in excel the same way. Thanks Nilanjan
write excel in asp.net MVC1
CC BY-SA 3.0
0
2011-04-15T07:08:51.720
2011-04-15T07:56:22.850
null
null
84,951
[ "c#", "asp.net", "asp.net-mvc" ]
5,673,658
1
5,674,233
null
5
5,883
Does anybody know of a routine to do seasonal adjustment in Python or even better, in R? Here is an example data-set (South African CPI), which tends to have spikes in the first few months of the year: ![SA m/m CPI](https://i.stack.imgur.com/W5Pwh.gif) I would like to find the underlying pressures stripping out the seasonal factors, but I'd ideally like to use something fairly straightforward, built into either language, rather than interfacing or using outright an external package such as Demetra.
Seasonal Adjustment in R or Python
CC BY-SA 3.0
0
2011-04-15T07:29:08.230
2017-12-24T00:58:19.197
2020-06-20T09:12:55.060
-1
122,792
[ "python", "r", "time-series" ]
5,673,759
1
null
null
1
1,329
I had a Webpart that due naming conventions I have to change the namespace of the main class. But when I change the old namespace to the new namespace, and I deploy the webpart, I get this message. ![enter image description here](https://i.stack.imgur.com/tNsdz.png) Why this occurs? EDIT: Response (the page don't let me answer my own question) It was the .webpart file, that mantains the old mamespace ``` <metaData> <type name="OLDNAMESPACE.NameWebpart, $SharePoint.Project.AssemblyFullName$" /> <importErrorMessage>$Resources:core,ImportErrorMessage;</importErrorMessage> </metaData> ``` [http://socialsp.com/2010/08/24/changing-namespace-in-visual-studio-2010-might-break-a-sharepoint-2010-webpart-project/](http://socialsp.com/2010/08/24/changing-namespace-in-visual-studio-2010-might-break-a-sharepoint-2010-webpart-project/)
Error changing namespace in Webpart
CC BY-SA 3.0
null
2011-04-15T07:41:48.397
2011-04-15T09:04:28.933
2011-04-15T09:04:28.933
674,887
674,887
[ "c#", "sharepoint", "sharepoint-2010", "namespaces", "web-parts" ]
5,673,870
1
5,700,527
null
24
26,227
I can't figure out how to get flot.pie to change the data shown in the labels from a percentage of the "raw data" to the actual data. In my example i've created a pie chart with the numbers of read/unread messages. Number of read messages: 50. Number of unread messages: 150. The created pie shows the percentage of read messages as 25%. On this spot i want to show the actual 50 messages. See image below: ![enter image description here](https://i.stack.imgur.com/ksJhA.png) The code i used to create the pie: ``` var data = [ { label: "Read", data: 50, color: '#614E43' }, { label: "Unread", data: 150, color: '#F5912D' } ]; ``` And: ``` $(function () { $.plot($("#placeholder"), data, { series: { pie: { show: true, radius: 1, label: { show: true, radius: 2 / 3, formatter: function (label, series) { return '<div style="font-size:8pt;text-align:center;padding:2px;color:white;">' + label + '<br/>' + Math.round(series.percent) + '%</div>'; }, threshold: 0.1 } } }, legend: { show: false } }); }); ``` Is this possible? With the answer of @Ryley I came to a dirty solution. When I output the series.data the values "1,150" and "1,50" were returned. I came up with the idea to substract the first 2 characters of the returned value and display the substracted value. ``` String(str).substring(2, str.lenght) ``` This is the pie chart I created with this solution: ![enter image description here](https://i.stack.imgur.com/u7j7D.png) This is not the best solution, but it works for me. if someone knows a better solution....
Jquery Flot pie charts show data value instead of percentage
CC BY-SA 3.0
0
2011-04-15T07:53:35.690
2014-08-06T19:01:23.003
2012-03-13T15:43:06.330
50,776
709,363
[ "jquery", "flot", "pie-chart" ]
5,674,149
1
5,674,243
null
45
48,297
I've got the following information: There exists a sphere with origin (0,0,0) and radius R. After doing a ray-sphere intersection I know a point (XYZ) in 3D space that is on the sphere (the exact position in 3D space where the line pierces the sphere hull). For my program I'd like to calculate the Latitude and Longitude of the XYZ point on the sphere, but I can't think (or Google) up a way to do this easily. So in short, the function that I'm trying to write is this: ``` public static LatLon FromVector3(Vector3 position, float sphereRadius) { return Latitude and Longitude } ``` Does anybody know how to do this? As a reference this Wiki SVG file might be helpful: ![Geographic coordinates](https://i.stack.imgur.com/63tUo.png) Update: Thanks for all the helpful answers, so in the end I went with this code: ``` public static LatLon FromVector3(Vector3 position, float sphereRadius) { float lat = (float)Math.Acos(position.Y / sphereRadius); //theta float lon = (float)Math.Atan(position.X / position.Z); //phi return new LatLon(lat, lon); } ``` Now I've got to think of which answer helped me the most to accept :P.
3D coordinates on a sphere to Latitude and Longitude
CC BY-SA 4.0
0
2011-04-15T08:24:30.187
2018-07-19T08:08:41.807
2018-07-19T08:08:41.807
880,807
445,112
[ "math", "geometry", "coordinates", "latitude-longitude" ]
5,674,359
1
5,674,383
null
0
716
Look at [http://www.sydsvenskan.se/](http://www.sydsvenskan.se) or just look at the image bellow, and check their big image with text overlaying it at the top of the site. They have a black transparent background on the text, but the text itself isn't transparent. How do they accomplish this? If I try to add transparency on a text block with background set, the text gets transparent as well. ![enter image description here](https://i.stack.imgur.com/Galbu.jpg)
How to do a transparent background color on text?
CC BY-SA 3.0
null
2011-04-15T08:48:44.643
2011-04-15T08:57:47.403
null
null
266,642
[ "html", "css", "text", "transparent" ]
5,674,428
1
5,674,833
null
2
263
I have a window of type NSBorderlessWindow with a contentView that has the following hirarchy: ``` view 1 -> draws gray background | + view 2 -> draws rectangle with [NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:0.8] ``` This is what the result looks like: ![enter image description here](https://i.stack.imgur.com/SToY4.png) view 2 is a subview of view 1, from my understanding the semi transparent black should be overlaid over the gray. However, it seems that the black replaces the gray in the drawn area. I use NSRectFill for the drawing. How could I avoid this effect and have the semi transparent black really draw over the gray?
Subview overwrites superview
CC BY-SA 3.0
null
2011-04-15T08:54:09.213
2011-04-15T09:30:43.217
null
null
250,880
[ "cocoa", "drawing", "nsview", "subview" ]
5,674,511
1
5,816,775
null
0
105
The usual project properties page is not shown when I view properties for a BizTalk 2006R2 project in Visual Studio 2005. Instead I get the property dialog below. How do I get the one where you can choose to sign the assembly, the one with the tabs on the right side? ![Project properties](https://i.stack.imgur.com/diI8Y.png)
Signing assemblies in VS2005 BizTalk project
CC BY-SA 3.0
null
2011-04-15T09:00:06.490
2016-05-20T00:53:17.710
2016-05-20T00:53:17.710
2,571,021
163,573
[ "visual-studio-2005", "biztalk", "biztalk2006r2" ]
5,674,512
1
null
null
3
4,860
This is basic question about lighting and texturing in OpenGL. I tried to apply a texture in pure OpenGL app, unfortunately, the color is different from the texture. Here is the texture: ![texture screenshot](https://i.stack.imgur.com/glkPM.png) and here is what i got after applying the texture: ![textured teapot](https://i.stack.imgur.com/yLCe1.png) I used [Videotutorialrocks](http://www.videotutorialsrock.com/opengl_tutorial/textures/home.php) BMP Loader. This coloring problem does not exist if i use their BMP file (i.e. the color is the same as the texture file). Here's the code: ``` #include <windows.h> #include <GL/glut.h> #include <stdio.h> #include <stdlib.h> #include <iostream> #include <sstream> #include <iomanip> #include "imageloader.h" using std::stringstream; using std::cout; using std::endl; using std::ends; using namespace std; float lpos[4] = {1.0,0.0,0.0,0.0}; void *font = GLUT_BITMAP_8_BY_13; float color[4] = {0.0, 1.0, 0.0, 1.0}; GLuint _textureId; //The id of the texture float a = 0; float eye_x = 5.0; float eye_y = 5.0; float eye_z = 5.0; //Makes the image into a texture, and returns the id of the texture GLuint loadTexture(Image* image) { GLuint textureId; glGenTextures(1, &textureId); //Make room for our texture glBindTexture(GL_TEXTURE_2D, textureId); //Tell OpenGL which texture to edit //Map the image to the texture glTexImage2D(GL_TEXTURE_2D, //Always GL_TEXTURE_2D 0, //0 for now GL_RGB, //Format OpenGL uses for image image->width, image->height, //Width and height 0, //The border of the image GL_RGB, //GL_RGB, because pixels are stored in RGB format GL_UNSIGNED_BYTE, //GL_UNSIGNED_BYTE, because pixels are stored //as unsigned numbers image->pixels); //The actual pixel data return textureId; //Returns the id of the texture } // write 2d text using GLUT // The projection matrix must be set to orthogonal before call this function. void drawString(const char *str, int x, int y, float color[4], void *font) { glPushAttrib(GL_LIGHTING_BIT | GL_CURRENT_BIT); // lighting and color mask glDisable(GL_LIGHTING); // need to disable lighting for proper text color glColor4fv(color); // set text color glRasterPos2i(x, y); // place text position // loop all characters in the string while(*str) { glutBitmapCharacter(font, *str); ++str; } glEnable(GL_LIGHTING); glPopAttrib(); } void changeSize(int w, int h) { // Prevent a divide by zero, when window is too short. (you cant make a window of zero width). if(h == 0) h = 1; float ratio = 1.0* w / h; // Reset the coordinate system before modifying glMatrixMode(GL_PROJECTION); glLoadIdentity(); // Set the viewport to be the entire window glViewport(0, 0, w, h); // Set the correct perspective. gluPerspective(45,ratio,1,100); glMatrixMode(GL_MODELVIEW); } void initRendering(){ glEnable(GL_DEPTH_TEST); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); glEnable(GL_LIGHT1); glEnable(GL_NORMALIZE); glEnable(GL_COLOR_MATERIAL); Image* image = loadBMP("vtr_6.bmp"); _textureId = loadTexture(image); delete image; } void renderScene(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); //Add ambient light //GLfloat ambientColor[] = {0.4f, 0.2f, 0.2f, 1.0f}; //Color(0.2, 0.2, 0.2) GLfloat ambientColor[] = {1.0f, 1.0f, 1.0f, 1.0f}; //Color(0.2, 0.2, 0.2) glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambientColor); //Add positioned light //GLfloat lightColor0[] = {0.5f, 0.5f, 0.5f, 1.0f}; //Color (0.5, 0.5, 0.5) GLfloat lightColor0[] = {1.0f, 1.0f, 1.0f, 1.0f}; //Color (0.5, 0.5, 0.5) GLfloat lightPos0[] = {4.0f, 0.0f, 8.0f, 1.0f}; //Positioned at (4, 0, 8) glLightfv(GL_LIGHT0, GL_DIFFUSE, lightColor0); glLightfv(GL_LIGHT0, GL_POSITION, lightPos0); //Add directed light //GLfloat lightColor1[] = {0.7f, 0.2f, 0.1f, 1.0f}; //Color (0.5, 0.2, 0.2) GLfloat lightColor1[] = {1.0f, 1.0f, 1.0f, 1.0f}; //Coming from the direction (-1, 0.5, 0.5) GLfloat lightPos1[] = {1.0f, 0.5f, 0.5f, 0.0f}; glLightfv(GL_LIGHT1, GL_DIFFUSE, lightColor1); glLightfv(GL_LIGHT1, GL_POSITION, lightPos1); glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, _textureId); //Bottom glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); gluLookAt(eye_x,eye_y,eye_z, 0.0,0.0,0.0, 0.0f,1.0f,0.0f); stringstream ss; ss << std::fixed << std::setprecision(2); ss << "Eye Position : x,y,z = (" << eye_x << ", " << eye_y << ", " << eye_z << ")" << ends; drawString(ss.str().c_str(), -6, 1, color, font); ss.str(""); glRotatef(a,0,1,0); glutSolidTeapot(2); glDisable(GL_TEXTURE_2D); a+=0.1; glutSwapBuffers(); } void processNormalKeys(unsigned char key, int x, int y) { switch ( key ) { case 27: exit(0); break; case '1': eye_x += 0.1; break; case '2': eye_x -= 0.1; break; case '3' : eye_y += 0.1; break; case '4' : eye_y -= 0.1; break; case '5': eye_z += 0.1;; break; case '6': eye_z -= 0.1; break; case '0': eye_x = 5.0; eye_y = 5.0; eye_z = 5.0; break; } } #define printOpenGLError() printOglError(__FILE__, __LINE__) int printOglError(char *file, int line) { GLenum glErr; int retCode = 0; glErr = glGetError(); while (glErr != GL_NO_ERROR) { printf("glError in file %s @ line %d: %s\n", file, line, gluErrorString(glErr)); retCode = 1; glErr = glGetError(); } return retCode; } int main(int argc, char **argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); glutInitWindowPosition(100,100); glutInitWindowSize(800,600); glutCreateWindow("OpenGL Teapot w/ lighting"); initRendering(); glutDisplayFunc(renderScene); glutReshapeFunc(changeSize); glutKeyboardFunc(processNormalKeys); glutIdleFunc(renderScene); glEnable(GL_DEPTH_TEST); glClearColor(0.0,0.0,0.0,0.0); glutMainLoop(); return 0; } ``` Here is the code for Image Loader: ``` #include <assert.h> #include <fstream> #include "imageloader.h" using namespace std; Image::Image(char* ps, int w, int h) : pixels(ps), width(w), height(h) { } Image::~Image() { delete[] pixels; } namespace { //Converts a four-character array to an integer, using little-endian form int toInt(const char* bytes) { return (int)(((unsigned char)bytes[3] << 24) | ((unsigned char)bytes[2] << 16) | ((unsigned char)bytes[1] << 8) | (unsigned char)bytes[0]); } //Converts a two-character array to a short, using little-endian form short toShort(const char* bytes) { return (short)(((unsigned char)bytes[1] << 8) | (unsigned char)bytes[0]); } //Reads the next four bytes as an integer, using little-endian form int readInt(ifstream &input) { char buffer[4]; input.read(buffer, 4); return toInt(buffer); } //Reads the next two bytes as a short, using little-endian form short readShort(ifstream &input) { char buffer[2]; input.read(buffer, 2); return toShort(buffer); } //Just like auto_ptr, but for arrays template<class T> class auto_array { private: T* array; mutable bool isReleased; public: explicit auto_array(T* array_ = NULL) : array(array_), isReleased(false) { } auto_array(const auto_array<T> &aarray) { array = aarray.array; isReleased = aarray.isReleased; aarray.isReleased = true; } ~auto_array() { if (!isReleased && array != NULL) { delete[] array; } } T* get() const { return array; } T &operator*() const { return *array; } void operator=(const auto_array<T> &aarray) { if (!isReleased && array != NULL) { delete[] array; } array = aarray.array; isReleased = aarray.isReleased; aarray.isReleased = true; } T* operator->() const { return array; } T* release() { isReleased = true; return array; } void reset(T* array_ = NULL) { if (!isReleased && array != NULL) { delete[] array; } array = array_; } T* operator+(int i) { return array + i; } T &operator[](int i) { return array[i]; } }; } Image* loadBMP(const char* filename) { ifstream input; input.open(filename, ifstream::binary); assert(!input.fail() || !"Could not find file"); char buffer[2]; input.read(buffer, 2); assert(buffer[0] == 'B' && buffer[1] == 'M' || !"Not a bitmap file"); input.ignore(8); int dataOffset = readInt(input); //Read the header int headerSize = readInt(input); int width; int height; switch(headerSize) { case 40: //V3 width = readInt(input); height = readInt(input); input.ignore(2); assert(readShort(input) == 24 || !"Image is not 24 bits per pixel"); assert(readShort(input) == 0 || !"Image is compressed"); break; case 12: //OS/2 V1 width = readShort(input); height = readShort(input); input.ignore(2); assert(readShort(input) == 24 || !"Image is not 24 bits per pixel"); break; case 64: //OS/2 V2 assert(!"Can't load OS/2 V2 bitmaps"); break; case 108: //Windows V4 assert(!"Can't load Windows V4 bitmaps"); break; case 124: //Windows V5 assert(!"Can't load Windows V5 bitmaps"); break; default: assert(!"Unknown bitmap format"); } //Read the data int bytesPerRow = ((width * 3 + 3) / 4) * 4 - (width * 3 % 4); int size = bytesPerRow * height; auto_array<char> pixels(new char[size]); input.seekg(dataOffset, ios_base::beg); input.read(pixels.get(), size); //Get the data into the right format auto_array<char> pixels2(new char[width * height * 3]); for(int y = 0; y < height; y++) { for(int x = 0; x < width; x++) { for(int c = 0; c < 3; c++) { pixels2[3 * (width * y + x) + c] = pixels[bytesPerRow * y + 3 * x + (2 - c)]; } } } input.close(); return new Image(pixels2.release(), width, height); } ``` And this is the header file: ``` #ifndef IMAGE_LOADER_H_INCLUDED #define IMAGE_LOADER_H_INCLUDED //Represents an image class Image { public: Image(char* ps, int w, int h); ~Image(); /* An array of the form (R1, G1, B1, R2, G2, B2, ...) indicating the * color of each pixel in image. Color components range from 0 to 255. * The array starts the bottom-left pixel, then moves right to the end * of the row, then moves up to the next column, and so on. This is the * format in which OpenGL likes images. */ char* pixels; int width; int height; }; //Reads a bitmap image from file. Image* loadBMP(const char* filename); #endif ``` I have tried to replace the file format for [glTexImage2D](http://www.opengl.org/sdk/docs/man/xhtml/glTexImage2D.xml) with GL_BGR_EXT, but no result. Is there any way to correct the texture?
Texture color not displayed properly
CC BY-SA 3.0
null
2011-04-15T09:00:06.950
2013-02-15T23:57:39.967
2013-02-15T23:57:39.967
1,448,363
548,451
[ "opengl", "textures" ]
5,674,723
1
5,675,853
null
1
1,132
I have a hidden control which contains a textbox control and I want to set the text property of the textbox but i get an NullReferenceException. However if I show the control, set the value and then hide it then i get no exception. ``` miStatus1.Show(); miStatus1.ioItem1.popIoItem(caseState); miStatus1.Hide(); ``` However this feels like a really unclean and not very elegant way to do it. And i'm seeing some flickering because i have to do this to 4 controls with up to 8 textboxes on each. Is there any way to set the text propery of the textboxes while the control is hidden? Or is it perhaps a better idea to populate my textboxes when showing the control? And will this slow down my application as it needs to populate everytime the control is shown? ``` public void popIoItem(object obj){ if (ioType == 1) { tb.Text = (string)obj; } } ``` I'm trying to create the menu to the right and on each pressing of the categories the menus slide up/down and i hide/show the proper user control with the textboxes and other io-elements. ![Interface: it is the menu to the right i'm trying to create](https://i.stack.imgur.com/gOzm8.jpg) When one of the boxes to the left is click'ed the following method is run: ``` public void openMenu(int caseNum) { caseDB.casesDataTable chosenCase; chosenCase = _casesAdapter.GetDataByID(caseNum); string caseName = ""; int caseOwner = -1; DateTime caseDate = DateTime.Today; string caseDesc = ""; int caseState = -1; foreach (caseDB.casesRow casesRow in chosenCase) { if (!casesRow.IscaseNameNull()) caseName = casesRow.caseName; if (!casesRow.IscaseCreatedByNull()) caseOwner = casesRow.caseCreatedBy; if (!casesRow.IscaseCreatedNull()) caseDate = casesRow.caseCreated; if (!casesRow.IscaseDescNull()) caseDesc = casesRow.caseDesc; if (!casesRow.IscaseStateNull()) caseState = casesRow.caseState; } int caseJobs = (int)_jobsAdapter.JobCount(caseNum); string caseStateStr = Enum.GetName(typeof(caseState), caseState); caseInfoMenu1.popMenu(caseName, caseOwner, caseDate, caseDesc,caseJobs,caseStateStr); } ``` The caseInfoMenu is the right menu. It consists of some drawing and mouse logic that draws the menu and handles hit-detection. Besides this it contains 4 user controls, one for each of the vertical tabs. ``` public void popMenu(string caseName, int caseOwner ,DateTime caseDate, string caseDesc, int caseJobs, string caseState) { marked = 0; miGeneral1.Show(); miEconomy1.Hide(); miStatus1.Hide(); miHistory1.Hide(); miGeneral1.ioItem1.popIoItem(caseName); miGeneral1.ioItem2.popIoItem(caseOwner.ToString()); miGeneral1.ioItem3.popIoItem(caseDate.ToShortDateString()); miGeneral1.ioItem4.popIoItem(caseJobs.ToString()); miGeneral1.ioItem5.popIoItem(caseDesc.ToString()); //miStatus1.ioItem1.popIoItem(caseState); //This is commented out because it makes the application crash. However if I show miStatus1, set the value and hide it, it does not crash. this.Invalidate(); } ``` Inside each of these user controls I have io-items user controls which essentially draws a blue box and puts a control in front of if ie. the textbox. ``` public partial class ioItem : UserControl { public int ioType { get; set; } public int ioPadding { get; set; } RichTextBox tb; public ioItem() { InitializeComponent(); } public void popIoItem(object obj){ if (ioType == 1) { tb.Text = (string)obj; } } private void ioItem_Load(object sender, EventArgs e) { switch (ioType) { case 1: tb = new RichTextBox(); tb.Location = new System.Drawing.Point(ioPadding, ioPadding); tb.Name = "textbox"; tb.Size = new Size(this.Size.Width - (ioPadding * 2), this.Size.Height - (ioPadding * 2)); tb.BorderStyle = BorderStyle.None; tb.Visible = true; tb.BackColor = Color.FromArgb(255, 184, 198, 208); tb.Font = new Font("Microsoft Sans Serif", 7); this.Controls.Add(tb); break; case 2: historyCtrl hiCtrl = new historyCtrl(); hiCtrl.Location = new Point(0,0); hiCtrl.Size = new Size(this.Width, this.Height); hiCtrl.Name = "history"; hiCtrl.Visible = true; hiCtrl.BackColor = Color.FromArgb(255, 184, 198, 208); this.Controls.Add(hiCtrl); break; default: goto case 1; } } } ```
Is there anyway to set a value of a hidden control?
CC BY-SA 3.0
null
2011-04-15T09:19:28.703
2011-04-15T11:15:07.837
2011-04-15T10:21:04.243
436,802
436,802
[ "c#", "winforms", "textbox" ]
5,674,776
1
5,674,941
null
2
1,675
When writing a Nautilus script, `$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS` gives the path to the file whose context menu has been clicked, for instance `/home/nico/test.txt`. But when the file is within a [WebDAV](http://en.wikipedia.org/wiki/WebDAV) share, the variable is empty. Is it a bug? How to get the path for a WebDAV file? My script is [intended](https://github.com/nicolas-raoul/AlfrescoLinuxMacCheckInOut) to be used for files on WebDAV shares. ![enter image description here](https://i.stack.imgur.com/k3pmv.png)
Nautilus script: $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS empty for WebDAV folders
CC BY-SA 3.0
null
2011-04-15T09:24:11.067
2011-07-14T00:41:08.327
null
null
226,958
[ "webdav", "nautilus" ]
5,674,828
1
5,675,076
null
0
155
I need to develop a similar grid to the one for searching phone numbers. See sample picture below. ![enter image description here](https://i.stack.imgur.com/JOs2c.png) Any ideas?
wp7 which control is used for the PhoneNumberChooserTask
CC BY-SA 3.0
null
2011-04-15T09:30:24.700
2011-04-15T09:55:42.340
null
null
13,370
[ "windows-phone-7" ]
5,674,856
1
5,845,019
null
6
1,785
I am working on a challenging problem : finding a solution to get data after a booking process. Basically, I have a page with a form (SLIM FORM), that I need to automatically fill with informations coming from provider form (e.g. easyjet.com or hotels.com, any booking site basically). For instance : [https://secure.booking.com/hotel/es/royal.html?sid=1c2bab12a0c64a541728840f52cd6401;errorc_checkin_invalid=checkin;errorc_intro_error_message_invalid=intro_error_message;errorv_stage=1;errorv_checkin=2011-07-05;errorv_hotel_id=90228;errorv_installment_count=1;errorv_hostname=www.booking.com;errorv_nr_rooms_9022801_80638194_0=1;errorv_interval=1](https://secure.booking.com/hotel/es/royal.html?sid=1c2bab12a0c64a541728840f52cd6401;errorc_checkin_invalid=checkin;errorc_intro_error_message_invalid=intro_error_message;errorv_stage=1;errorv_checkin=2011-07-05;errorv_hotel_id=90228;errorv_installment_count=1;errorv_hostname=www.booking.com;errorv_nr_rooms_9022801_80638194_0=1;errorv_interval=1) the information in my Booking is what i need to get. ![enter image description here](https://i.stack.imgur.com/TW5wj.png) I made some tests and here are what I found out, for now : It's not possible to have both on the same page, because with cURL, there is no communication with the external server, and with iframes, it leaves the page ASAP the src of the iframe changes. So, I decided that the booking process should happen on a dedicated page, in the domain of the booking provider (easyjet.com...) 1) Am I right to consider performing the booking on the real site, or is there a way to include the external website on my page and perform the whole process of booking in it (basically filling forms on departure, arrival date etc...)? If not possible, I made some tests with cURL and came to this conclusion : _ I will have to define fitted regex for each provider, and I am under the impression that some have mechanisms to identify cURL and block it. (e.g. lufthansa.com) But it works quite well with others ( booking.com ) I have 2 additionnal questions : 2) Are there better solutions than cURL to parse some HTML in a page (especially since it doesn't work if the URL doesn't include sessionID)? I was thinking maybe of using something like Selenium... 3) How can I trigger my cURL parsing on an other tab or window? (I was thinking about a system similar to bookmarks that can trigger some JavaScript code) Thanks for your answers and sorry for the length :-) : Based on answers I received, here are fresh thoughts : for big providers (easyjet, hotels.com etc...), I will use an API if available. For small providers (e.g. [http://www.hotel-gare-clermont.com/en,1,6217.html](http://www.hotel-gare-clermont.com/en,1,6217.html) ), I think the proxy solution is worth another one, and I won't receive any complaints on legal issues from "Hotel de la Gare", while adding visibility to those small providers. What do you think?
Retrieve information after a booking is completed (cURL, iFrame...?) on an external website
CC BY-SA 3.0
null
2011-04-15T09:32:53.203
2014-07-07T00:54:39.317
2014-07-07T00:54:39.317
5,801
374,395
[ "php", "javascript", "iframe", "curl" ]
5,675,023
1
null
null
0
868
HI, I'm trying to achieve a custom buttons . I'm wondering how I can achieve this with Android. The result should look similar like this, ![enter image description here](https://i.stack.imgur.com/KQTTH.png) how I can make special shapes adjacent the problem it is because the image of each button must always be rectangle. Thanks.
custom Button android like media player button
CC BY-SA 3.0
null
2011-04-15T09:49:37.867
2011-04-15T10:05:49.497
2011-04-15T10:04:05.560
447,156
709,597
[ "android", "button", "media-player" ]
5,675,132
1
null
null
2
7,040
I have a DataGrid that looks something like this. ![enter image description here](https://i.stack.imgur.com/mJAYO.jpg) I have grouped data by Gender. My GroupItem style is ``` <Style TargetType="{x:Type GroupItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type GroupItem}"> <Expander x:Name="exp" IsExpanded="True" Background="White" Foreground="Black"> <Expander.Header> <TextBlock Text="{Binding Name}"/> </Expander.Header> <ItemsPresenter /> </Expander> </ControlTemplate> </Setter.Value> </Setter> </Style> ``` I want my Group Header 'Male' and 'Female' to look like 'Gender : Male' and 'Gender : Female' instead of simple plain 'Male' and 'Female'. How can I modify my GroupItem style to achieve this so that every time I group my data in datagrid the group header can appear like GroupHeaderTitle : GroupHeaderValue? or Do I need to change anything other than GroupItem style to achieve this?
How to customize Group Header in DataGrid Grouping?
CC BY-SA 3.0
null
2011-04-15T10:01:07.647
2015-04-11T14:11:45.750
null
null
421,611
[ "wpf", "datagrid", "grouping" ]
5,675,176
1
6,172,125
null
4
1,892
I'm looking for a way to create a one page installer in Inno Setup, just look at this screenshot: ![One Page Installer Image](https://i.stack.imgur.com/7XZiB.png) Can anyone please give me the codes for doing this? Or totally I would like to merge pages abilities in Inno Setup. For example merge page with page and etc
One Step Installer
CC BY-SA 4.0
0
2011-04-15T10:04:38.430
2020-10-19T06:28:28.363
2020-10-19T06:28:28.363
850,848
709,507
[ "scripting", "installation", "inno-setup" ]
5,675,248
1
null
null
0
988
Have a `ListBox` with couple of items. Select any item (say the v.first item) and keep try to Drag it in empty area (Outside of listbox), `ListBox` selection is getting changed. Albeit I'm moving mouse in area out of `ListBox`. I want selection change only when i move mouse within the `ListBox`. Or completely disable the selection change while mouse move (Dragged). Here is the snapshot of a small poc. ![enter image description here](https://i.stack.imgur.com/y9XCs.png) ``` <Grid> <ListBox HorizontalAlignment="Left" Margin="111,49,0,180" Name="listBox1" Width="154"> <ListBoxItem BorderThickness="2" Height="50" Width="Auto" Name="heig" BorderBrush="Chocolate">Rohit Item 1</ListBoxItem> <ListBoxItem Height="50" BorderThickness="2" BorderBrush="Blue" >Vivek</ListBoxItem> <ListBoxItem Height="50" BorderBrush="Cyan" BorderThickness="2" >Gaurav</ListBoxItem> <ListBoxItem Name="height" Height="50" BorderBrush="CornflowerBlue" BorderThickness="2" >Asit Item 2</ListBoxItem> </ListBox> </Grid>` ```
Automatic ListBox Selection/SelectedItem/SelectedIndex changed while moving mouse out of ListBox
CC BY-SA 3.0
0
2011-04-15T10:13:56.333
2013-10-10T01:17:34.310
2013-10-10T01:17:34.310
305,637
351,708
[ "wpf", "events", "listbox", "mouseevent" ]
5,675,252
1
5,680,388
null
1
1,148
I've recently set up solr and haystack to search one of my django models. I attempted to modify the default solr schema built by haystack to use the `NGramTokenizerFactory`: ``` <fieldType name="text" class="solr.TextField"> <analyzer type="index"> <tokenizer class="solr.NGramTokenizerFactory" minGramSize="3" maxGramSize="32" /> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> <analyzer type="query"> <tokenizer class="solr.NGramTokenizerFactory" minGramSize="3" maxGramSize="32" /> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> ``` I have a bunch of one or two word entries in my database which I would like to match against the user's query. So for example, I might have one object with title "dog" and another with title "cat". If the user searches for "dog cat" then I would like to return both the dog and cat objects for that query. Similarly, if I search for "my cool website" I would like the field with "website" to be returned. I tried using the solr admin interface to check to make sure my queries were getting matched. Everything seems okay there: ![enter image description here](https://i.stack.imgur.com/VfvJ7.png): The issue is when I use the haystack default search interface to search for that same query: ![enter image description here](https://i.stack.imgur.com/n3hYk.png) As you can see, no results are found. I tried using KeywordFactory and a bunch of different solr configurations. If I'm not mistaken then the query be getting matched. I'm not sure why haystack is coming up empty though. Thanks for any help / suggestions on if this is the best way to go about such a search.
Haystack Not Returning Results that Solr Admin Console Highlights
CC BY-SA 3.0
0
2011-04-15T10:15:04.963
2011-04-15T17:39:09.300
2020-06-20T09:12:55.060
-1
84,128
[ "django", "search", "solr", "django-haystack" ]
5,675,873
1
5,676,185
null
1
781
I have the following code: ``` glNormal3f(0, 0, 1); glColor3f(1, 0, 0); glBegin(GL_POINTS); glVertex3f(-45, 75, -5); glVertex3f(-45, 90, -5); glVertex3f(-30, 90, -5); glVertex3f(-30, 80, -5); glVertex3f(-35, 80, -5); glVertex3f(-35, 75, -5); glVertex3f(-45, 75, -5); glEnd(); glColor3f(1, 1, 0); glBegin(GL_POLYGON); glVertex3f(-45, 75, -5); glVertex3f(-45, 90, -5); glVertex3f(-30, 90, -5); glVertex3f(-30, 80, -5); glVertex3f(-35, 80, -5); glVertex3f(-35, 75, -5); glVertex3f(-45, 75, -5); glEnd(); ``` Notice how the code between glBegin and glEnd in each instance is identical. But the vertices of the GL_POLYGON (yellow) don't match up with the GL_POINTS (red). Here is a screenshot: ![openGL bug](https://i.stack.imgur.com/y1dw6.png) The more I use openGL the more I'm hating it. But I guess it's probably something I'm doing wrong... What is up?
openGL weird bug?
CC BY-SA 3.0
null
2011-04-15T11:16:38.613
2011-04-15T20:42:52.533
null
null
158,109
[ "c++", "opengl" ]
5,675,898
1
5,676,290
null
0
159
I created UI for Iphone that has a button and label above tableview. The problem is that data doesn't show in table despite setting it in cellForRowAtIndexPath method. I get this: ![enter image description here](https://i.stack.imgur.com/Qu6Ko.png) This is my code for controller of third tab. Header: ``` #import <UIKit/UIKit.h> @interface ThirdView : UIViewController <UITableViewDelegate,UITableViewDataSource> { //model NSMutableArray *podatki; //view UITableView *myTableView; } @property(nonatomic,retain) NSMutableArray *podatki; @property(nonatomic,retain) UITableView *myTableView; -(IBAction)pritisnuGumb:(UIButton *) sender; // @end ``` Implementation: ``` #import "ThirdView.h" @implementation ThirdView @synthesize podatki; @synthesize myTableView; -(void)viewDidLoad{ myTableView = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStylePlain]; myTableView.delegate = self; myTableView.dataSource = self; myTableView.autoresizesSubviews = YES; podatki = [[NSMutableArray alloc] init]; [podatki addObject:@"Sunday"]; [podatki addObject:@"MonDay"]; [podatki addObject:@"TuesDay"]; [super viewDidLoad]; //self.view = myTableView; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [podatki count]; } -(IBAction)pritisnuGumb:(UIButton *) sender { NSLog(@"buca"); } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease]; } cell.textLabel.numberOfLines = 4; cell.textLabel.lineBreakMode = UILineBreakModeWordWrap; cell.selectionStyle = UITableViewCellSelectionStyleNone; NSString *naslov = [podatki objectAtIndex:indexPath.row]; cell.textLabel.text = naslov; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSLog(@"kliknu na vrstico"); } - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { // Custom initialization } return self; } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } #pragma mark - View lifecycle - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { // Return YES for supported orientations return (interfaceOrientation == UIInterfaceOrientationPortrait); } - (void)dealloc { [podatki release]; [super dealloc]; } @end ``` If i uncomment line "self.view = myTableView;" i get tableview with data but label and button above it disappear (tableview is fullscreen). What am i doing wrong here? ![enter image description here](https://i.stack.imgur.com/gDtGK.png) @Jennis: I tried your solution and data inside table is now visible but upper part is squeezed like this:
Data not shown in UITableView below button
CC BY-SA 3.0
null
2011-04-15T11:18:48.113
2011-04-15T13:21:59.290
2011-04-15T13:21:59.290
324,417
324,417
[ "iphone", "uitableview", "button" ]
5,676,060
1
5,676,096
null
0
460
: I'm trying to display a loading screen while waiting for my asynchronous connection to return with data to populate the tableview. : Creating and adding the loadingscreen works fine, however, the tableview draws its lines over it, see screenshot: ![the problem](https://i.stack.imgur.com/9gdKF.png) . : I add the view with these lines: ``` -(void) viewDidLoad{ [super viewDidLoad]; _loadScreen = [[LoadScreen alloc] initWithFrame:self.view.bounds]; [self.view addSubview: _loadScreen]; [self fetchRemoteData]; } ``` : Is it possible to add the loading view ontop of the table? Or can i make sure the tableview does not draw its lines untill i call reloadData? -Thanks in advance, W
Tableview lines show trough loading view
CC BY-SA 3.0
0
2011-04-15T11:34:30.663
2011-04-15T11:53:41.140
null
null
262,691
[ "iphone", "ios", "uitableview", "uiview" ]
5,676,702
1
null
null
0
299
I have a strange "bug" in my layout file. I am new to Android, so perhaps I am missing something. I stripped the example down to the bare minimum to ease your understanding of the problem: I have a simple list, with a ListAdapter, which should display a line of text with an icon next to it. The icon should be centered vertically if the text is higher then the icon. If I leave the attribute "center" out, the sample works (the list item gets the correct heigth), but as soon as I include it, I get a bug. Any ideas on how to solve this issue? (btw, I need the tableLayout for streching columns, not sure if there is another way for this) The XML source for the row looks like this: ``` <TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:stretchColumns="1"> <TableRow> <TextView android:height="30dp" android:width="30dp" android:background="@color/blue" android:layout_gravity="center_vertical" /> <TextView android:layout_height="wrap_content" android:text="TextView" android:textSize="22dp" android:layout_width="120dp" android:layout_gravity="left" android:background="@color/yellow" android:id="@+id/simple_list_row_text1"/> </TableRow> ``` The desired result (which works on higher versions of android without any problems) is: ![working](https://i.stack.imgur.com/QpFUS.png) And the image on Android 1.6 ![enter image description here](https://i.stack.imgur.com/A08aI.png)
Android layout bug in 1.6 vs 2.2
CC BY-SA 3.0
null
2011-04-15T12:27:12.223
2011-04-15T12:43:06.093
null
null
109,646
[ "android", "user-interface" ]
5,676,910
1
5,679,147
null
1
2,680
I've been trying a get an update App working with UAC and after doing some digging I needed to include a manifest in my app. The manifest is called `MyApp.manifest`. In order to include this in the project I've created an RC file which is called `MyApp.rc`. This is built into a file called `MyApp.rec` with a Pre-Build Command `brcc32 $(PROJECTNAME).rc -fo$(PROJECTNAME).rec` Then in my DPR I Have ``` {$R *.REC} {$R *.RES} begin Application.Initialize; ``` This allows Delphi to handle things like version information. This all works fine when the App is copied into windows 7. I went to debug the app today and my dev environment is Windows XP where I immediately get: ![Unable to Create Process](https://i.stack.imgur.com/gpwKK.png) After some more digging I was pointed to the [XN Resource Editor](http://www.wilsonc.demon.co.uk/d10resourceeditor.htm). Which immediately showed the following problem: ![Duplicate Manifest](https://i.stack.imgur.com/Qevza.png) The first of these Manifests (the one marked 1) is the `MyApp.manifest` (which is maybe why it works ok in windows 7?) and sure enough if I delete the second manifest the app works perfectly. Strangely if I change the number in the RC file the number 1 changes with it but the second manifest remains at number 2. I think the second manifest may have something to do with runtime themes but disabling that simply doesn't work (I untick the checkbox, close project options, open project options and the checkbox is ticked). so what is causing the second manifest to appear? and how do I get rid of it? Delphi Version is 2007
Duplicate Manifest causes 'Unable to Create Process'
CC BY-SA 3.0
null
2011-04-15T12:43:10.900
2011-04-15T15:38:42.673
2011-04-15T13:09:40.030
265,419
265,419
[ "delphi", "manifest" ]
5,676,939
1
null
null
-1
641
![enter image description here](https://i.stack.imgur.com/GgV3g.png)The linked program is no longer installed Toast message on click of android market app
The linked program is no longer installed Toast message on click of android market app on HTC-Evo(Sprint)
CC BY-SA 3.0
0
2011-04-15T12:45:52.987
2011-04-15T12:49:27.340
null
null
478,700
[ "android" ]
5,676,993
1
5,677,257
null
10
934
I just noticed that if you have this in MMA (8.0.1 / win7-64): ![enter image description here](https://i.stack.imgur.com/IT4FY.png) and you copy it to SO (just ctrl-c ctrl-v), you get this: ``` (maxY - minY)/stepy/(maxX - minX)/stepx ``` which is . It should be this: ``` ((maxY - minY)/stepy)/((maxX - minX)/stepx) ``` or this (the `InputForm` of the above): ``` ((maxY - minY)*stepx)/((maxX - minX)*stepy) ``` It's not caused by StackOverflow's internals as the same happens with a copy to NotePad. Are there more issues like this (especially when working with SO, but also in general) that we should be aware of? What causes this, can it be fixed on our side, and if not, what is the best work-around?
Known issues with copying code from Mathematica to other platforms?
CC BY-SA 3.0
0
2011-04-15T12:50:27.760
2011-10-08T10:03:15.770
2011-10-08T10:03:15.770
618,728
615,464
[ "wolfram-mathematica", "mathematica-frontend" ]
5,677,102
1
5,677,134
null
0
117
for my app I need to load some content from my webservice. I want to display it within a simple `UILabel`. This works fine so far. But since the request is asynchronous the process might take some time. Now I want to indicate the loading process with a little image like you see in the picture. Is that a buildin-feature in xcode4 somewhere in the interface-builder? Is it possible to assign an image to a UILabel and how do I do that? ![enter image description here](https://i.stack.imgur.com/OB3q7.jpg)
How show that label content is loading?
CC BY-SA 3.0
0
2011-04-15T12:58:36.273
2011-04-15T13:00:58.780
null
null
401,025
[ "objective-c", "xcode", "xcode4", "uilabel" ]
5,677,104
1
5,677,408
null
7
7,411
Mysql Timediff function is not working for me for long date.. Actually i need to get the time difference between date_time field to now() so i used this query ``` SELECT `date_time`,now(),timediff(`date_time`,now()) FROM `table_datetime` ``` I have two rows date_time 2011-04-25 17:22:41 2011-06-14 17:22:52 my result is ![enter image description here](https://i.stack.imgur.com/YPK0T.png) Here first row result is changing but not for second one this one always return ``` 838:59:59 ``` constantly ... Why its not giving correct result Thanks for help !
MYSQL TIMEDIFF function not working for long date
CC BY-SA 3.0
null
2011-04-15T12:58:43.740
2013-08-24T13:36:35.183
null
null
430,112
[ "mysql", "datetime" ]
5,677,117
1
null
null
2
5,807
I have a ComboBox in WindowsForms and I draw items manually. Each item is composed from picture and text (Cell.Image and Cell.Title), so item is 34 px height. My problem is that when I drop down ComboBox, only 1 item is visible. MaxDropDownItems = 4 so ComboBox would draw 4 items. I know that I have set DropDownHeight = 34, but I want to display empty rectangle when there is no item in ComboBox like on the following picture. ComboBox with no item - OK: ![ComboBox with no item - OK](https://i.stack.imgur.com/L2ylw.png) ComboBox with only 1 visible item - Bad: ![ComboBox with only 1 visible item - Bad](https://i.stack.imgur.com/YdND0.png) My class derived from ComboBox: ``` public class ComboBoxCells : ComboBox { private List<Cell> _cells; public List<Cell> Cells { get { return this._cells; } set { this._cells = value; this.BeginUpdate(); this.Items.Clear(); if (value != null) this.Items.AddRange(value.ToArray()); this.EndUpdate(); } } public ComboBoxCells() { this.DrawMode = DrawMode.OwnerDrawVariable; this.DropDownHeight = 34; this.DropDownWidth = 200; this.DropDownStyle = ComboBoxStyle.DropDownList; this.MaxDropDownItems = 4; this.DrawItem += new DrawItemEventHandler(ComboBoxCells_DrawItem); this.MeasureItem += new MeasureItemEventHandler(ComboBoxCells_MeasureItem); } private void ComboBoxCells_DrawItem(object sender, DrawItemEventArgs e) { e.DrawBackground(); // Draw item inside comboBox if ((e.State & DrawItemState.ComboBoxEdit) != DrawItemState.ComboBoxEdit && e.Index > -1) { Cell item = this.Items[e.Index] as Cell; e.Graphics.FillRectangle(Brushes.Gray, new Rectangle(e.Bounds.Left + 6, e.Bounds.Top + 6, 22, 22)); e.Graphics.DrawImage(item.Image, new Rectangle(e.Bounds.Left + 7, e.Bounds.Top + 7, 20, 20)); e.Graphics.DrawString(item.Title, e.Font, new SolidBrush(e.ForeColor), e.Bounds.Left + 34, e.Bounds.Top + 10); } // Draw visible text else if (e.Index > -1) { Cell item = this.Items[e.Index] as Cell; e.Graphics.DrawString(item.Title, e.Font, new SolidBrush(e.ForeColor), e.Bounds.Left, e.Bounds.Top); } e.DrawFocusRectangle(); } private void ComboBoxCells_MeasureItem(object sender, MeasureItemEventArgs e) { e.ItemHeight = 34; } } ``` Thanks
Draw images and text in ComboBox
CC BY-SA 3.0
null
2011-04-15T12:59:43.523
2012-11-08T11:33:06.480
2012-05-16T20:56:40.020
259,014
506,848
[ "c#", "winforms", "combobox" ]
5,677,260
1
5,718,650
null
3
1,073
I have prepared a simple test case demonstrating my problem. It is just 1 file (CheckMenu.java, listed below) and instantly runnable. Once the user changes the sorting method by selecting 1 of the 2 MenuItems, how do I redraw the underlying [KeywordFilterField](http://www.blackberry.com/developers/docs/6.0.0api/net/rim/device/api/ui/component/KeywordFilterField.html)? I've tried calling and - it doesn't help - the myList items are not reorganized. Also I wonder, what to use instead of the deprecated MenuItem.setText(String)? ![enter image description here](https://i.stack.imgur.com/p1AVf.png) ``` package mypackage; import net.rim.device.api.system.*; import net.rim.device.api.ui.*; import net.rim.device.api.ui.component.*; import net.rim.device.api.ui.container.*; import net.rim.device.api.util.Comparator; import net.rim.device.api.util.StringUtilities; import net.rim.device.api.collection.util.*; public class CheckMenu extends UiApplication { public static void main(String[] args) { CheckMenu myApp = new CheckMenu(); myApp.enterEventDispatcher(); } public CheckMenu() { pushScreen(new MyScreen()); } } class MyScreen extends MainScreen { KeywordFilterField myList = new KeywordFilterField(); MyItemList myItems = new MyItemList(); public MyScreen() { setTitle(myList.getKeywordField()); myItems.doAdd(new MyItem(1, "Eins")); myItems.doAdd(new MyItem(2, "Zwei")); myItems.doAdd(new MyItem(3, "Drei")); myItems.doAdd(new MyItem(4, "Vier")); myList.setSourceList(myItems, new MyItem.MyProvider()); // XXX commenting the line below does not help myList.setCallback(new MyListFieldCallback()); add(myList); } private MenuItem numMenu = new MenuItem("num sort", 0, 0) { public void run() { MyItem.NUMERIC_SORT = true; Status.show("Use " + toString()); setText("num sort \u221A"); alphaMenu.setText("alpha sort"); myList.updateList(); } }; private MenuItem alphaMenu = new MenuItem("alpha sort", 1, 0) { public void run() { MyItem.NUMERIC_SORT = false; Status.show("Use " + toString()); setText("alpha sort \u221A"); numMenu.setText("num sort"); myList.updateList(); } }; protected void makeMenu(Menu menu, int instance) { super.makeMenu(menu, instance); menu.add(numMenu); menu.add(alphaMenu); } private class MyListFieldCallback implements ListFieldCallback { public void drawListRow(ListField list, Graphics g, int index, int y, int width) { Object obj = ((KeywordFilterField)list).getElementAt(index); if(obj != null && obj instanceof MyItem) { MyItem item = (MyItem) obj; g.drawText(item.toString(), 20 * (1 + index), y); } else if(index == 0) { g.drawText(list.getEmptyString(), 0, y); } } public Object get(ListField list, int index) { return null; } public int getPreferredWidth(ListField list) { return 0; } public int indexOfList(ListField list, String prefix, int start) { return 0; } } } class MyItemList extends SortedReadableList { public MyItemList() { super(new MyItem.MyComparator()); } protected void doAdd(Object obj) { super.doAdd(obj); } protected boolean doRemove(Object obj) { return super.doRemove(obj); } } class MyItem { public static boolean NUMERIC_SORT; private int _num; private String _name; public MyItem(int num, String name) { _num = num; _name = name; } public String toString() { return _num + ": " + _name; } static class MyComparator implements Comparator { public int compare(Object obj1, Object obj2) { if (! (obj1 instanceof MyItem && obj2 instanceof MyItem)) throw new IllegalArgumentException("Cannot compare non-MyItems"); MyItem item1 = (MyItem) obj1; MyItem item2 = (MyItem) obj2; if (MyItem.NUMERIC_SORT) { if (item1._num == item2._num) return 0; return (item1._num > item2._num ? 1 : -1); } return item1._name.compareTo(item2._name); } } static class MyProvider implements KeywordProvider { public String[] getKeywords(Object obj) { if (obj instanceof MyItem) { MyItem item = (MyItem) obj; return new String[]{ Integer.toString(item._num), item._name }; } return null; } } } ``` I've updated the code to use makeMenu() as suggested by Arhimed. I've also posted my question [at the BlackBerry forum](http://supportforums.blackberry.com/t5/Java-Development/Change-sorting-of-a-KeywordFilterField/td-p/1016663). Thank you! Alex
Blackberry: change sorting of a KeywordFilterField
CC BY-SA 3.0
null
2011-04-15T13:09:50.033
2011-05-20T11:16:12.677
2011-05-20T11:16:12.677
165,071
165,071
[ "java", "blackberry", "java-me", "menu", "menuitem" ]
5,677,316
1
5,677,410
null
2
1,722
Is there something similar to [DataRepeater](http://blogs.msdn.com/b/vsdata/archive/2009/08/12/datarepeater-control-for-windows-forms.aspx) Control for WPF? ![enter image description here](https://i.stack.imgur.com/v45Zs.jpg) ![enter image description here](https://i.stack.imgur.com/u2fnz.jpg)
DataRepeater control in WPF?
CC BY-SA 3.0
null
2011-04-15T13:13:35.500
2011-04-15T15:08:26.490
null
null
185,593
[ ".net", "wpf", "wpf-controls" ]
5,677,584
1
null
null
0
199
I have problem :( the application is work fine similar device. but when I try to upload .zip file this error is come . ![enter image description here](https://i.stack.imgur.com/BHia0.png)
Problem When I try to publish my Iphone app to appstore
CC BY-SA 3.0
null
2011-04-15T13:35:43.113
2011-04-15T13:47:42.097
2011-04-15T13:40:57.523
457,406
709,902
[ "iphone", "xcode", "app-store-connect" ]
5,677,897
1
5,718,478
null
2
4,274
SORRY: This is my bad. This error is due incorrect json produce and to Chrome extension "JSONView in Chrome". See my own answer (I had to answer this myself - as I could not delete the question anymore). I am using Velocity (Maven version 1.7 of org.apache.velocity) as templating engine, and I want output as follows: ``` { total : 234 } ``` now when I try: ``` { total : $listing.size() } ``` I get an error: ``` Error: Parse error on line 1: { total : 0} --^ Expecting 'STRING', '}' ``` ![enter image description here](https://i.stack.imgur.com/Vhy4i.png) and when I try to escape the curly braces: ``` \{ total : $listing.size() \} ``` I get the escape characters in the final output!: ``` \{ total : 234 \} ```
Escape a curly brace { in Velocity
CC BY-SA 3.0
0
2011-04-15T14:01:58.360
2015-01-21T15:24:02.990
2011-04-19T15:03:07.037
74,865
74,865
[ "java", "velocity" ]
5,678,159
1
5,678,213
null
10
9,159
I have a page layout with an inner `<div id="content">` element which contains the important stuff on the page. The important part about the design is: ``` #content { height: 300px; width: 500px; overflow: scroll; } ``` Now when the containing text is larger than 300px, I need to be able to scroll it. Is it possible to scroll the `<div>`, even when the mouse is not hovering the element (arrow keys should also work)? Note that I don’t want to disable the ‘global’ scrolling: There should be two scrollbars on the page, the global scrollbar and the scrollbar for the `<div>`. The only thing that changes is that the inner `<div>` should always scroll unless it can’t be moved anymore (in which case the page should start scrolling). Is this possible to achieve somehow? I think the problem was a bit confusing, so I’ll append a sequence of how I would like it to work. (Khez already supplied a proof-of-concept.) The first image is how the page looks when opened. Now, the mouse sits in the indicated position and scrolls and what should happen is that - - - Hope it is a bit clearer now. ![Scroll concept](https://i.stack.imgur.com/Owuu0.png) (Image thanks to gomockingbird.com)
Always scroll a div element and not page itself
CC BY-SA 3.0
0
2011-04-15T14:22:31.350
2015-11-02T22:58:45.653
2011-04-15T15:40:31.370
200,266
200,266
[ "javascript", "css", "scroll", "focus", "mousewheel" ]
5,678,166
1
5,678,554
null
5
3,876
Here is my current comment system design: ![enter image description here](https://i.stack.imgur.com/IqbHF.png) I'm developing it for a website that has lots of areas, blogs, tutorials, manuals etc etc. As supposed to developing a separate comment table for each (`tblBlogComments`, `tblTutorialComments`) etc etc, I'm trying to go for a one structure fits all approach. This way, I can turn the comment system into a web control, and just drop it on any page that I want comments for. It means I only have one set of rules, one set of code files to maintain. The only problem is, is coming up with a 'nice' way to determine which section (blog/tutorial/manual) belongs to. For example, one solution would be: ``` tblComment ------------- Section (int) SectionIdentifier (int) ``` Where '`Section`' maps to a unique to each part of the site, EG: ``` Blog = 1 Articles = 2 Tutorials = 3 ... ``` A `SectionIdentifier` is some sort of unique ID for that page, eg: ``` ViewBlog.aspx?ID=5 ``` This would be section 1, identifier 5. So now, a comment with `Section = 1`, `SectionIdentifier = 5` means it's a comment for blog entry number 5. This works great, but at the cost of maintainability, and a solid structure, as the `SectionIdentifier` is anonymous and no relationships can be built. Is this design OK, or is there a better solution (IE some sort of parent table for a comment?)
Comment system design
CC BY-SA 3.0
0
2011-04-15T14:22:46.083
2011-04-17T10:20:19.360
2011-04-15T14:35:33.380
356,635
356,635
[ "asp.net", "database-design", "foreign-keys", "relational-database", "normalization" ]
5,678,258
1
null
null
2
1,460
, I have a textbox (single line `<input/>`) for which I need to insert text where the caret/cursor is. The text within a div is inserted at the caret position when the div is double clicked. The following code works fine using the multiline input (no bug), the bug only occurs with the single line input. Here is the simple Javascript for IE : ``` $.fn.insertAtCaret = function (tagName) { return this.each(function () { if (this.selectionStart || this.selectionStart == '0') { //MOZILLA support } else if (document.selection) { //IE support this.focus(); sel = document.selection.createRange(); sel.text = tagName; } else { //ELSE } }); }; ``` Just so you have everything in front of you, `$.fn.insertAtCaret`: ``` $("#Subject").mousedown(function () { $("#InsertAtCaretFor").val("Subject"); }); $("#Subject").bind('click, focus, keyup', function () { $("#InsertAtCaretFor").val("Subject"); }); $("#Comment").mousedown(function () { $("#InsertAtCaretFor").val("Comment"); }); $("#Comment").bind('click, focus, keyup', function () { $("#InsertAtCaretFor").val("Comment"); }); $(".tag").dblclick(function () { if ($("#InsertAtCaretFor").val() == "Comment") $("#Comment").insertAtCaret($(this).text()); if ($("#InsertAtCaretFor").val() == "Subject") $("#Subject").insertAtCaret($(this).text()); }); ``` As you can see, when one of the two `<input/>`s are clicked, focused, etc., a hidden field (`ID="InsertAtCaretFor"`) value is set to either `"Subject"` or `"Comment"`. When the is double-clicked, its `.text()` is inserted at the caret position within the `<input/>` specified by the hidden field's value. Here are the fields: ``` <%=Html.Hidden("InsertAtCaretFor") %> <div class="form_row"> <label for="Subject" class="forField"> Subject:</label> <%= Html.TextBox("Subject", "", new Dictionary<string, object> { { "class", "required no-auto-validation" }, { "style", "width:170px;" }, { "maxlength", "200" } })%> </div> <div class="form_row"> <label for="Comment" class="forField"> Comment:</label> <%= Html.TextArea("Comment", new Dictionary<string,object> { {"rows","10"}, {"cols","50"}, { "class", "required"} })%> </div> ``` Finally, here is an image so you can visually understand what I'm doing: [http://www.danielmckenzie.net/ie8bug.png](http://www.danielmckenzie.net/ie8bug.png) ![bug behavior](https://i.stack.imgur.com/8r6Vp.png)
Bug w IE8 Using Javascript to Insert Text at Caret
CC BY-SA 3.0
null
2011-04-15T14:30:36.313
2012-10-20T15:17:44.950
2011-04-15T15:14:20.833
105,330
105,330
[ "javascript", "jquery", "html" ]
5,678,284
1
5,678,482
null
2
2,947
I finally managed to get my list to display properly ([http://stackoverflow.com/questions/5662277/how-to-line-up-intger-output-in-custom-android-dialog](https://i.stack.imgur.com/Zrl9y.jpg)). Now I am trying to add a button below the list. What happens is that when the list is too big the button doesn't show. The list is scrollable but that's it. Also, the scrollbar covers some of the data. This is the main XML file: ``` <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/lloPlayerNames" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/tvwPlayer1Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer2Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer3Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer4Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_margin="2dp"/> </LinearLayout> <ListView android:id="@+id/lvwScores" android:layout_below="@id/lloPlayerNames" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" /> <Button android:id="@+id/btnOK " android:layout_height="wrap_content" android:layout_width="wrap_content" android:layout_below="@id/lvwScores" android:layout_weight="1" android:text="OK" android:layout_centerHorizontal="true" /> </RelativeLayout> ``` This is the one for the rows: ``` <?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="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/tvwPlayer1Score" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer2Score" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer3Score" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer4Score" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> </LinearLayout> ``` I tried changing the main to a linear layout but that made it even worse! The list looked like it had been on a crash-diet and was super-thin. --- Tried: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <LinearLayout android:id="@+id/lloPlayerNames" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/tvwPlayer1Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer2Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer3Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer4Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginRight="2dp"/> </LinearLayout> <Button android:id="@+id/btnOK" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="OK" android:layout_centerHorizontal="true" layout_alignParentBottom="true"/> <ListView android:id="@+id/lvwScores" android:layout_above="@id/btnOK" android:layout_below="@id/lloPlayerNames" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_weight="1"/> </RelativeLayout> ``` and what I get is: ![enter image description here](https://i.stack.imgur.com/Zrl9y.jpg) when I try: ``` <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical">> <LinearLayout android:id="@+id/lloPlayerNames" xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <TextView android:id="@+id/tvwPlayer1Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer2Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer3Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <TextView android:id="@+id/tvwPlayer4Name" android:layout_weight="1" android:gravity="right" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginRight="2dp"/> </LinearLayout> <ListView android:id="@+id/lvwScores" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_weight="1"/> <Button android:id="@+id/btnOK" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="OK" android:layout_centerHorizontal="true" layout_alignParentBottom="true"/> </LinearLayout> ``` I get: ![enter image description here](https://i.stack.imgur.com/QoEFu.jpg)
Button below a list not showing
CC BY-SA 3.0
0
2011-04-15T14:32:29.377
2012-07-09T13:06:35.300
2012-07-09T13:06:35.300
1,288
648,746
[ "android", "listview" ]
5,678,403
1
7,818,618
null
0
693
I am unable to INSERT or UPDATE an item in my external list created from an external content type Here is the error:![Server Error](https://i.stack.imgur.com/fH3H3.png) I have created an external content type called "Product Status". It has all the operations possible e.g. Read / Create / Update etc Here is the table structure: ![table structure](https://i.stack.imgur.com/xudN3.png) The field as far as I know was created by the SQL Server replication. When creating my external content type, it does not allow me to not select the rowguid! [Update Operation](https://i.stack.imgur.com/dmhM3.png) ![Error](https://i.stack.imgur.com/H1Ly8.png) It seems that when it creates the external content type "Product Status", the update operation is trying to update the rowguid to null which it cannot be. It shouldn't update that field at all, however I cannot exclude it from my external content type item created.
Sharepoint 2010 External Content Type Create / Update Operations (SQL Server Replication Issue)
CC BY-SA 3.0
null
2011-04-15T14:41:36.020
2011-10-19T08:37:57.380
2011-04-15T15:28:45.293
13,302
366,323
[ "sharepoint-2010", "replication", "content-type" ]
5,678,514
1
5,679,301
null
5
9,307
I'm trying to accomplish a layout like the one below: ![enter image description here](https://i.stack.imgur.com/ipuUu.png) Two float:left divs are positioned side by side, each with 45% of the width. On the right, the div contains two subsections - one aligned to the bottom of the div and one aligned to the top. If the sections on the right get long enough, they will of course meet in the middle and then begin pushing out the height of the containing div: ![enter image description here](https://i.stack.imgur.com/QpLSy.png) I've been playing with faux-columns, clear:all, overflow:hidden, bottom:0, and any other tricks I could think of, but I can't get this behaviour to work. The real problem seems to be stemming from the smaller of the left and right div not expanding to the height of the container, which takes on the height of the larger of the two using overflow:hidden. Any thoughts? What I have so far: ``` <div style="overflow:hidden; clear:both"> <div id="column1" style="float: left; width:45%"> <div id="column2" style="float: left; width:45%"> <div style="float: left; top: 0">Content Here should sit up top</div> <div style="float: left; bottom: 0">Content Here should sit on bottom</div> </div> </div> ``` This is how it's turning out, I can't get the top and bottom to separate without using fixed heights somewhere: ![enter image description here](https://i.stack.imgur.com/z8vxs.png) Thanks for having a look guys!
CSS: two floating div columns with equal height, with vertically split right div
CC BY-SA 3.0
null
2011-04-15T14:50:21.020
2011-04-15T16:17:11.420
null
null
529,618
[ "css", "css-float" ]
5,678,667
1
null
null
6
28,001
Please view this image to get my clearly question: ![enter image description here](https://i.stack.imgur.com/nJE0Q.png)
[Excel][VBA] How to draw a line in a graph?
CC BY-SA 3.0
null
2011-04-15T15:02:49.440
2011-04-16T22:06:55.090
2011-04-15T21:20:37.243
149,573
240,622
[ "vba", "graph", "excel", "draw" ]
5,678,923
1
5,680,276
null
3
1,731
I investigating if there is a not to complicated project to have a camera mounted above a bridge table and identify played cards from the feed. A lot of bridge tournaments are broadcasted on-line but it demands a person to sit with a laptop and click ever card being played and is a tedious job :) There are 4 players and my thought was to have a marked area for card to be played in before registered. ![Bridge Playing](https://i.stack.imgur.com/C3voY.jpg) A few things I'm thinking of. By using a marked for played card OCR has only have to be made in few occasions but can I reach a 100% success rate? Will I need some uber machine to handle the OCR calculations and is there fast enough routines for what I want done? Would be nice to hear your input, suggestions and if you have any experience and ideas!
OCR of playing cards in a video stream
CC BY-SA 3.0
0
2011-04-15T15:22:20.150
2013-05-06T23:41:19.267
2011-04-15T17:38:07.257
353,410
67,872
[ "image", "image-processing", "ocr", "video-capture" ]
5,679,023
1
5,680,249
null
1
171
I would like to know how Apple built the about view. It looks like that text is inside UITableView element but the whole cell is scrollable. ![enter image description here](https://i.stack.imgur.com/i70nl.png)
iPad "about" UI element
CC BY-SA 3.0
null
2011-04-15T15:29:34.017
2015-11-26T10:33:36.553
2015-11-26T10:33:36.553
1,505,120
132,257
[ "iphone", "xcode", "ipad" ]
5,679,057
1
5,679,308
null
6
2,424
Is there a javascript plugin which replicates the same functionality as google calendar repeat options visually? ![Google calendar repeat options](https://i.stack.imgur.com/yhMai.png)
javascript plugin/form similar to google calendar repeat options
CC BY-SA 3.0
null
2011-04-15T15:32:10.567
2011-10-11T16:18:47.553
null
null
92,621
[ "javascript", "jquery", "google-calendar-api" ]
5,679,074
1
null
null
5
385
When debugging my Win32 Applications windows and dialogs sometimes (rarely) do not appear in the chosen Windows scheme, but rather reduced or broken: ![enter image description here](https://i.stack.imgur.com/X9lT1.jpg) The Window captions are all black (instead of blue or silver) and without any shadow. The Buttons doe not have any Button shape ("Abbrechen" in the screen shot). The black bar at the lower half is a windows progress bar. It doesn't show any progress when this happens. The screen shot (details in the center greyed out) was taken from a 64-Bit application debugged under Visual Studio 2010 on XP SP3 x64 and a 10 GB machine. The was plenty of RAM (some GB) spare. Does anyone have a clue for the reason? I never do non-client area drawing or something. The symptom only occurs when the Visual Studio Debugger has been attached to the program. But even when the application has been detached from the debugger the problem remains. It does not occur when starting the program without debugging.
Why are Window Captions Black and Buttons frameless sometimes during debugging
CC BY-SA 3.0
null
2011-04-15T15:33:22.773
2011-05-19T21:12:18.417
2011-05-19T21:12:18.417
439,166
53,420
[ "c++", "windows", "visual-studio-2010", "debugging", "windows-xp" ]
5,679,217
1
null
null
3
304
How did they do it? Look at these images: ![enter image description here](https://i.stack.imgur.com/izfsg.png) ![enter image description here](https://i.stack.imgur.com/7cDGQ.png) As you can see you can slide the right panel to the left and back. Is that UISplitViewController?
iPad slidable right hand side
CC BY-SA 3.0
null
2011-04-15T15:45:15.533
2012-08-14T07:44:01.063
null
null
132,257
[ "xcode", "ipad", "uisplitviewcontroller" ]
5,679,333
1
null
null
1
614
I wrote a simple Python CGI script but it has a bug : ``` #!/usr/bin/python2.7 import cgi,sys,random sys.stderr = sys.stdout num1 = random.randrange(1,11) num2 = random.randrange(1,11) answer = num1 + num2 print("Content-type: text/html\n") print("<code>%d + %d :</code>") % (num1,num2) print(""" <form method=POST action=""> <hr> <th align=right> <code><b>Answer:</b></code> <input type=text name="answer"> <tr>""") form = cgi.FieldStorage() try: if form["answer"].value == str(answer): print "<br><b>Good</b>" else: print "<br><b>Wrong</b>" except KeyError: pass ``` The numbers regenerates each time this code executes and it can't compare the user input to the answer becouse cgi.FieldStorage does not store that input: ![enter image description here](https://i.stack.imgur.com/pL7mf.png) PHP programmers use " session_start() " to do what I want to do : ``` <?php //Start the session so we can store what the code actually is. session_start(); $text = rand(1,11); $_SESSION["answer"] = $answer; ....... ?> ``` What about Python ? How can we do it? Edit : I'm really not sure if it is sessions or not .. what I just need is a way to keep what user has inputed so I can compare his answer with the correct answer
Making cgi.FieldStorage Store User Inputs?
CC BY-SA 3.0
null
2011-04-15T15:53:48.357
2011-06-29T01:59:35.507
2011-05-09T04:46:37.323
168,868
null
[ "python", "session", "cgi" ]
5,679,521
1
5,680,270
null
5
2,317
So here is the situation: I have an assembly called Lib1.dll. For some reason (not relevant to the question) I had to rename the assembly file name to Lib1New.dll, now while trying to load the renamed assembly using Assembly.LoadFile I noticed that the CLR tries to load the Lib1.dll as well. If Lib1.dll is found in the search path it gets loaded in the address space. The application works fine irrespective of whether Lib1.dll was found or not. (The problem is that if Lib1.dll is found the file gets locked and can't be deleted by other processes). ![enter image description here](https://i.stack.imgur.com/xtn0X.png) I don't understand why the LoadFile searches and loads Lib1.dll. LoadFile is supposed to load the contents of an assembly file on the specified location, why is it searching for files. MSDN documentation for LoadFile: > Use the LoadFile method to load and examine assemblies that have the same identity, but are located in different paths. LoadFile does not load files into the LoadFrom context, and does not resolve dependencies using the load path, as the LoadFrom method does. LoadFile is useful in this limited scenario because LoadFrom cannot be used to load assemblies that have the same identities but different paths; it will load only the first such assembly.
Assembly file renaming and Assembly.LoadFile
CC BY-SA 3.0
null
2011-04-15T16:09:22.003
2014-01-17T11:23:00.600
2014-01-17T11:23:00.600
321,731
60,786
[ "c#", "file-io", "clr", ".net-assembly" ]
5,680,047
1
5,681,678
null
2
4,014
I have a QAbstractItemDelegate and in the paint method, I am trying to paint the text from a label. But the problem I am seeing is that the size hint of the QLabel is always too small for the text it contains. How can I fix this? For example: ``` QLabel *testlabel = new QLabel(); testlabel->setText("This is some test text that doesnt fit:"); testlabel->adjustSize(); QRect rect(testlabel->geometry()); Qt::Alignment alignFlags = testlabel->alignment(); painter->setFont(testlabel->font()); painter->drawRect(rect); painter->drawText(rect, alignFlags, testlabel->text()); ``` And then it looks like: ![Screenshot](https://i.stack.imgur.com/w4cel.png) Any ideas why the bounding rectangle is too small? Thanks Stephen
QLabel sizehint is too small
CC BY-SA 3.0
0
2011-04-15T17:03:37.347
2015-10-28T13:14:50.720
null
null
147,226
[ "qt", "qt4" ]
5,680,238
1
5,680,621
null
1
799
I'm using TinyMCE with ImageManager. I have everything set up right, but i added 'doc,docx,mp3,pdf' to the list of permitted uploadable files in imagemanager's config.php. In my XAMPP localhost instalation, everything works fine, but when i try to upload anything other than an image or a pdf i get this: ![enter image description here](https://i.stack.imgur.com/Tq92K.png) please, some help? Thanks
tinyMCE mcimagemanager - upload other files
CC BY-SA 3.0
null
2011-04-15T17:22:49.773
2011-04-15T18:02:43.063
null
null
470,772
[ "tinymce", "mcimagemanager" ]
5,680,379
1
5,748,267
null
0
2,839
Using .NET 4.0, I have a small ASP.NET app that utilized the ReportViewer object, I have created a web page that takes some user input and generates a report that is displayed using the ReportViewer control with ProcessingMode set to local. Naturally, it works perfectly when run via VS 2010 in debugging mode and if I publish it to IIS running on my local machine. However, when I push it to production, I get the following error when actually trying to run the report![enter image description here](https://i.stack.imgur.com/42ryT.png) For the image impaired: ``` Failed to load expression host assembly. Details: Could not load file or assembly 'Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. Access is denied. ``` I have verified that the assembly (as well as the other reportviewer dependencies) is in the GAC. There don't seem to be any errors in the event log on the server. Any ideas what the permission problem might be?
Microsoft.ReportViewer.Common gives "Access Is Denied" error
CC BY-SA 3.0
null
2011-04-15T17:38:19.860
2011-04-21T18:30:55.523
2011-04-15T19:56:30.493
214,012
214,012
[ "asp.net", "reporting-services", "reportviewer" ]
5,681,159
1
5,681,806
null
1
332
I am trying to got own background for every cell but it looks like: ![example cell image](https://i.stack.imgur.com/UsDnt.png) Here's the code I'm working with ``` cell.team1Label.backgroundColor = [UIColor clearColor]; cell.team2Label.backgroundColor = [UIColor clearColor]; cell.dateLabel.backgroundColor = [UIColor clearColor]; cell.timeLabel.backgroundColor = [UIColor clearColor]; cell.stadiumLabel.backgroundColor = [UIColor clearColor]; cell.contentView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"cell.png"]]; ``` Thanks
Cell background
CC BY-SA 3.0
null
2011-04-15T18:58:12.477
2011-12-25T21:42:24.487
2011-04-15T19:08:40.007
643,383
709,609
[ "iphone", "objective-c", "cocoa-touch", "uitableview" ]
5,681,305
1
5,681,892
null
1
244
So the thing is that in Firefox 4 the list-style bullets transform to '0.' No matter which list-style-type I choose (except circle, disc and square). ![Screenshot](https://i.stack.imgur.com/8VWSY.png) All the other browsers don't seem to have a problem with it. Well except for IE then. You guys have any idea how I can solve this problem? => [http://icid-testing.heroku.com/](http://icid-testing.heroku.com/)
Why does Firefox 4 transform every list-item bullet into '0.'
CC BY-SA 3.0
null
2011-04-15T19:16:17.520
2012-02-25T22:18:54.333
2012-02-25T22:18:54.333
246,246
331,402
[ "css", "html-lists" ]
5,681,374
1
5,681,409
null
0
1,081
How would I set an alternate background image for this (text) through css? ``` <div id = 'id'></div> #id { background-image: url(image); } ``` By alternate I mean this: Say that `image` is this:![enter image description here](https://i.stack.imgur.com/j0QJC.png) If for some reason this image cannot load I want the `div` to contain the text "Stop"
Setting an alternate image for a div background with css
CC BY-SA 3.0
null
2011-04-15T19:23:34.507
2011-04-15T19:30:25.313
2011-04-15T19:30:25.313
650,489
650,489
[ "html", "css" ]
5,681,537
1
5,681,564
null
49
27,785
There is a `System` namespace inside my program's namespace. And as a result I can't see the standard `System` namespace from within mine. How can I resolve this problem? ![enter image description here](https://i.stack.imgur.com/Em46B.png) For example in C++ there is the `::` operator which 'shifts' me out of my namespace, so I can see external namespaces with the same name as my current namespace: ![enter image description here](https://i.stack.imgur.com/67a8S.png) Is there a similar operator in C#?
Namespace conflict in C#
CC BY-SA 3.0
0
2011-04-15T19:40:04.557
2012-07-16T14:15:21.660
2012-01-26T14:37:05.133
590,790
592,835
[ "c#", "namespaces" ]
5,681,819
1
5,681,877
null
1
3,866
I have a SQL query that returns two columns - "Title" and "Count". When "Title" is NULL or empty (''), I want to combine the result into one row. How can I do this? This is what I have so far: ``` SELECT [Title] WHEN '' THEN 'blank' ELSE ISNULL([Title],'blank') AS [Title], COUNT([value]) AS [Count] FROM .... WHERE .... GROUP BY [Title],[Count] ``` but because of the Group By, they are split into two different rows: ![enter image description here](https://i.stack.imgur.com/8dzde.png)
SQL: Combine value into one result when NULL or empty
CC BY-SA 3.0
0
2011-04-15T20:07:25.367
2011-04-15T20:41:37.717
null
null
180,424
[ "sql", "sql-server" ]
5,681,929
1
5,681,985
null
1
135
I learnt the reference type parameter passing is just a copy of the reference. If you set the passed in refernece parameter point to another object inside the called method, the orginal reference will not change. I have a test method to test the reference type parameter passing. A `refTest(SystemSwEvent systemSwEvent)` method is called from that test method with a valid SystemSwEvent type object. Inside the `refTest()` method, the `processEvScanDataAvailable(EvScanDataAvaialble systemSwEvent)` method is called. Inside the `processEvScanDataAvailable(EvScanDataAvaialble systemSwEvent)` method, I set the passed in reference parameter to `null`. I expect the parameter in `refTest()` should not be changed. But that is not true. It will be changed to null . why?![enter image description here](https://i.stack.imgur.com/ud6Wv.jpg) ![enter image description here](https://i.stack.imgur.com/EJv1a.jpg)
reference type parameter question
CC BY-SA 3.0
null
2011-04-15T20:16:27.333
2011-04-15T20:30:40.043
null
null
117,039
[ "c#", ".net" ]
5,681,952
1
5,681,965
null
0
116
I'm attempting to create a view with two UIButtons. The code compiles without any error but the buttons don't have any labels and they can't be clicked. ![enter image description here](https://i.stack.imgur.com/oBsKI.png) ``` -(id)initWithTabBar { if ([self init]) { self.title = @"Tab1"; self.tabBarItem.image = [UIImage imageNamed:@"promoters.png"]; self.navigationItem.title = @"Nav 1"; } UIButton *button = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button setTitle:@"Button" forState:UIControlStateNormal]; [button addTarget:self action:@selector(facebookAuthorize) forControlEvents:UIControlEventTouchDown]; [button setFrame:CGRectMake(10, 10, 100, 100)]; [self.view addSubview:button]; [button release]; UIButton *button2 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; [button2 setTitle:@"Button" forState:UIControlStateNormal]; [button2 addTarget:self action:@selector(facebookLogin) forControlEvents:UIControlEventTouchDown]; [button2 setFrame:CGRectMake(110, 10, 100, 100)]; [self.view addSubview:button2]; [button2 release]; return self; } ```
Bug when trying to create view with 2 UIButtons
CC BY-SA 3.0
null
2011-04-15T20:18:51.093
2011-04-15T20:35:40.633
2011-04-15T20:21:46.773
106,435
480,807
[ "objective-c", "cocoa-touch", "ios", "uibutton" ]
5,682,003
1
null
null
4
674
[http://shuttersonthebeach.com](http://shuttersonthebeach.com) --- Safari 5.0.4 +/Mac --- click on either 'calendar' or 'specials' in the masthead of the page. An overlay should reveal. Inside of that overlay there are columns of text w/ custom scroll bars ([jScrollPane](http://jscrollpane.kelvinluck.com/)). In Safari, only on pages that have a flash header, the text inside of the custom scroll area is being distorted. This is not the case in any other browser (including Chrome). My best educated guess was that it had something to do with the wmode parameter of the flash object. I tried changing the wmode from 'transparent' to 'opaque' but the problem persisted. I also considered the possibility of a z-index related issue... from what I can tell, this also is not the problem. I have searched the web high and low for someone else who is experiencing something similar but I have not been successful. Any assistance you could provide would be greatly appreciated. Thanks! UPDATE: I determined that removing jScrollPane and adding overflow auto fixes the text distortion issue [Please see attached image]. Of course, this is not a solution because I do not want to use the default browser scrollbars but it may be useful info for debugging. ANOTHER UPDATE: This issue is not related to flash specifically. The distorted/blurred text occurs over HTML5 video as well in Safari. ![panel without jscrollpane but with browser default scrolling](https://i.stack.imgur.com/jyPxD.jpg)
jScrollPane Over Video in Safari Resulting in Distorted Text
CC BY-SA 3.0
null
2011-04-15T20:24:01.030
2011-06-02T14:28:34.733
2011-05-24T16:36:17.213
659,711
659,711
[ "jquery", "flash", "safari", "jscrollpane", "swfobject" ]
5,682,055
1
5,682,172
null
7
1,448
I'm trying to figure out why our software runs so much slower when run under virtualization. Most of the stats I've seen, say it should be only a 10% performance penalty in the worst case, but on a Windows virtual server, the performance penalty can is 100-400%. I've been trying to profile the differences, but the profile results don't make a lot of sense to me. Here's what I see when I profile on my Vista 32-bit box with no virtualization: ![enter image description here](https://i.stack.imgur.com/qQAbX.jpg) And here's one run on a Windows 2008 64-bit server with virtualization:![enter image description here](https://i.stack.imgur.com/HV6lv.jpg) The slow one is spending a very large amount of it's time in `RtlInitializeExceptionChain` which shows as 0.0s on the fast one. Any idea what that does? Also, when I attach to the process my machine, there is only a single thread, `PulseEvent` however when I connect on the server, there are two threads, `GetDurationFormatEx` and `RtlInitializeExceptionChain`. As far as I know, the code as we've written in uses only a single thread. Also, for what it's worth this is a console only application written in pure C with no UI at all. Can anybody shed any light on any of this for me? Even just information on what some of these `ntdll` and `kernel32` calls are doing? I'm also unsure how much of the differences are 64/32-bit related and how many are virtual/not-virtual related. Unfortunately, I don't have easy access to other configurations to determine the difference.
Why would our software run so much slower under virtualization?
CC BY-SA 3.0
0
2011-04-15T20:30:18.387
2011-04-18T03:47:56.613
2011-04-15T20:35:38.110
391,531
45,077
[ "c", "windows", "profiling", "virtualization", "verysleepy" ]
5,682,231
1
5,683,047
null
0
1,362
I have asp.net chart intervel issue. I am feed data to chart like below ``` X1 Y1 X2 Y2 100 907 500 2395 100 745 500 2343 100 760 500 2403 ``` Each row is a series in the chart. In am iterating each row in code and making new serie and adding to chart ``` series1.Points.AddXY(dt.Rows(i)(0).ToString, dt.Rows(i)(1).ToString) series1.Points.AddXY(dt.Rows(i)(2).ToString, dt.Rows(i)(3).ToString) ``` chart is coming like it is fine. ![enter image description here](https://i.stack.imgur.com/FPotz.jpg) Now I want make intervel like 100,200,300,400, 500 (500 is max of the graph). I tried Chart1.ChartAreas(0).AxisX.Interval = 100, It did not worked out.
Asp.net chart control interval not working?
CC BY-SA 3.0
null
2011-04-15T20:50:04.107
2011-04-15T22:43:11.077
2020-06-20T09:12:55.060
-1
158,008
[ "c#", "asp.net", "vb.net", "dundas" ]
5,682,388
1
5,731,317
null
0
2,163
Background: I have a webForm app that registers a user in the database based on the information provided with a web service, auto-generates a random password and username, and e-mails the user a link to take an application based on the marketing company selected. Question: - Here's a screenshot of the front end: ![web app screenshot](https://i.stack.imgur.com/iP19n.jpg) I've been going off the code from [Wrox's Windows Authentication Tutorial](http://www.wrox.com/WileyCDA/Section/ASP-NET-3-5-Windows-Based-Authentication.id-310905.html) but it's not thorough enough for what I'm trying to do. web.config file: web.config file (pertinent code displayed only): ``` <authentication mode="Windows"/> <authorization> <allow users="alg\bmccarthy, alg\phoward" /> <allow roles="alg\ACOMP_user_Admin" /> <allow roles="alg\ACOMP_user_AMG" /> <allow roles="alg\ACOMP_user_BIG" /> <allow roles="alg\ACOMP_user_NIS" /> <allow roles="alg\ACOMP_user_GLA" /> <allow roles="alg\ACOMP_user_PIP" /> <allow roles="alg\ACOMP_user_PSM" /> <allow roles="alg\ACOMP_user_PAM" /> <allow roles="alg\ACOMP_user_ANN" /> <allow roles="alg\ACOMP_user_AAM" /> <allow roles="alg\ACOMP_user_MWM" /> <allow roles="alg\ACOMP_user_GIM" /> <deny users="*" /> </authorization> <bindings> <basicHttpBinding> <binding name="BasicHttpBinding_IAcompService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" /> <security mode="None"> <transport clientCredentialType="None" proxyCredentialType="None" realm="" /> <message clientCredentialType="UserName" algorithmSuite="Default" /> </security> </binding> </basicHttpBinding> </bindings> <client> <endpoint address="http://172.17.1.40/aCompService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAcompService" contract="aComp_ServiceReference.IAcompService" name="BasicHttpBinding_IAcompService" /> </client> </system.serviceModel> ``` default.aspx.vb code w/ the txtMarketerName_TextChanged() and Page_Load() Methods: ``` Private Sub GetCarriers() Dim ac1 As Array ac1 = proxy.GetCarrierNames("test", "test") For Each item In ac1 lbCarriers.Items.Add(String.Format("{0} | {1} | {2}", item.CarrierID, item.CarrierNameLong, item.CarrierNameShort)) Next End Sub Private Sub txtMarketerName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtMarketerName.TextChanged End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load, Me.Load, Me.Load If Not lbCarriers.Items.Count > 0 Then GetCarriers() GetMarketingCompanies() End If End Sub ``` default.aspx code where the text box field for the Marketer name is displayed: ``` <table id="Table1" border="0" cellpadding="6" cellspacing="0" align=center> <tr> <td class="style1"> My Name (auto-populated Current Logged In User's Name): </td> <td bgcolor="#ffffff" class="style6"> <asp:TextBox ID="txtMarketerName" runat="server" Width="250px"> </asp:TextBox> </td> <td bgcolor="#ffffff" class="style2"> <asp:RequiredFieldValidator ID="regValMarketerName" runat="server" ControlToValidate="txtMarketerName" ErrorMessage="Marketer Name is required" Text="*" ValidationGroup="Valtxt"> </asp:RequiredFieldValidator> </td> </tr> ``` Thanks for looking! If you have any helpful links or suggestions, I'll give you an up-vote!
ASP.NET VB.NET - How to populate Active Directory Logged in Current User's Name into Text Box Field
CC BY-SA 3.0
null
2011-04-15T21:07:04.457
2011-04-20T18:44:18.807
2011-04-20T13:44:25.120
606,805
606,805
[ "asp.net", "vb.net", "active-directory", "windows-authentication", "active-directory-group" ]
5,682,448
1
5,682,471
null
0
314
![enter image description here](https://i.stack.imgur.com/XlSLe.jpg) Can anyone help me out here. I have the Show and Ticket Tables but I'm confused on how I should link them. My main idea was to have a table full of different ticket types, but will need the ticket type for a specific show. But the Show will need ticket information to know what ticket is selected for the show. Which table should the foreign key be present in the relationship? Thanks.
Help with database design
CC BY-SA 3.0
null
2011-04-15T21:16:27.167
2011-04-15T21:26:05.013
null
null
251,671
[ "sql", "database", "foreign-keys", "entity-relationship" ]
5,682,592
1
5,683,039
null
1
611
I have added a VBA code to my excel, what it does is automatically writes the rest of the number `2``990112` This works fine when every number is typed, but When I use Auto Increment `(CTRL + Drag)` it throws an error This is my VBA Code ``` Private Sub Worksheet_Change(ByVal Target As Range) Dim oldText As String, aboveText As String, newText As String If Target.Column = 3 Then oldText = Target.Text aboveText = Target.Cells(0, 1).Text If aboveText <> "DESIGN" Or Target.Text <> "" Then If Len(aboveText) = 6 And Len(oldText) < 6 And Len(oldText) >= 1 Then Application.EnableEvents = False newText = Left(aboveText, 6 - Len(oldText)) + oldText Target.Value = newText Application.EnableEvents = True End If End If End If End Sub ``` ![Excel File](https://i.stack.imgur.com/frtso.png)
Excel VBA Code error, when using Number Increment (CTRL Drag)
CC BY-SA 3.0
null
2011-04-15T21:36:08.130
2011-04-15T22:41:36.563
null
null
107,129
[ "vba", "excel" ]
5,682,688
1
null
null
23
13,307
I'm trying to trace a route on a MKMapView using overlays (MKOverlay). However, depending on the current speed, I want to do something like the Nike app with a gradient while tracing the route, if the color is changing (for example, from green to orange if a user is driving from 65mph to 30mph). Here's a screenshot of what I want: ![gradient overlay image](https://i.stack.imgur.com/un0bo.png) So every 20 meters, I adding an overlay from the old to the new coordinates using: ``` // Create a c array of points. MKMapPoint *pointsArray = malloc(sizeof(CLLocationCoordinate2D) * 2); // Create 2 points. MKMapPoint startPoint = MKMapPointForCoordinate(CLLocationCoordinate2DMake(oldLatitude, oldLongitude)); MKMapPoint endPoint = MKMapPointForCoordinate(CLLocationCoordinate2DMake(newLatitude, newLongitude)); // Fill the array. pointsArray[0] = startPoint; pointsArray[1] = endPoint; // Erase polyline and polyline view if not nil. if (self.routeLine != nil) self.routeLine = nil; if (self.routeLineView != nil) self.routeLineView = nil; // Create the polyline based on the array of points. self.routeLine = [MKPolyline polylineWithPoints:pointsArray count:2]; // Add overlay to map. [self.mapView addOverlay:self.routeLine]; // clear the memory allocated earlier for the points. free(pointsArray); // Save old coordinates. oldLatitude = newLatitude; oldLongitude = newLongitude; ``` Basically I'm adding a lot of little overlays. Then I would like to create the gradient on this little line drawing, so I'm trying to do so in the overlay delegate: ``` - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay { MKOverlayView* overlayView = nil; if(overlay == self.routeLine) { // If we have not yet created an overlay view for this overlay, create it now. if(self.routeLineView == nil) { self.routeLineView = [[[MKPolylineView alloc] initWithPolyline:self.routeLine] autorelease]; if (speedMPH < 25.0) { self.routeLineView.fillColor = [UIColor redColor]; self.routeLineView.strokeColor = [UIColor redColor]; } else if (speedMPH >= 25.0 && speedMPH < 50.0) { self.routeLineView.fillColor = [UIColor orangeColor]; self.routeLineView.strokeColor = [UIColor orangeColor]; } else { self.routeLineView.fillColor = [UIColor greenColor]; self.routeLineView.strokeColor = [UIColor greenColor]; } // Size of the trace. self.routeLineView.lineWidth = routeLineWidth; // Add gradient if color changed. if (oldColor != self.routeLineView.fillColor) { CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = self.routeLineView.bounds; gradient.colors = [NSArray arrayWithObjects:(id)[oldColor CGColor], (id)[self.routeLineView.fillColor CGColor], nil]; [self.routeLineView.layer insertSublayer:gradient atIndex:0]; } // Record old color for gradient. if (speedMPH < 25.0) oldColor = [UIColor redColor]; else if (speedMPH >= 25.0 && speedMPH < 50.0) oldColor = [UIColor orangeColor]; else oldColor = [UIColor greenColor]; } overlayView = self.routeLineView; } return overlayView; } ``` I'm trying to add the gradient this way, but I guess it is not the way to do it because I can't make it to work. I can also trace the route every time there is an update on the user's location (in the location object's delegate), or as above every 20 meters. Can you please help me on that one, giving me tips! Thanks!
Gradient Polyline with MapKit ios
CC BY-SA 3.0
0
2011-04-15T21:48:52.597
2022-06-02T14:55:02.160
2013-11-30T02:34:40.187
2,606,068
318,830
[ "ios", "mkmapview", "overlay", "mapkit", "gradient" ]
5,682,668
1
null
null
2
4,728
nHibernate3; retrieving 4xxx records out of an EAV data schema. When nHibernate, or .NET, goes to initialize those collections for the first time, we're seeing a severe penalty. Subsequent calls appear to perform more efficiently. Running the same queries in SQL Server Management Studio result in expected quick return times. Using Fluent and runtime mapping instead of .hbm.xml; curious if serialized mapping would help here? nHibernate Profiler and log4net logging didn't seem to give me much to go on. A total of something like 140,000 entities are hydrated in this process. Attached a screenshot of my dotTrace performance tracing that shows the collection initialization penalty: ![dotTrace of slow nHibernate collection initialization](https://i.stack.imgur.com/oCTmu.png) Have tried join and eager fetchtypes, with no apparent results, but am not 100% certain I implemented those correctly -- does just the parent need to be so designated, or do the children tables also need to be flagged? ``` var products = ((HandleSession)_handleSession).Session.CreateCriteria(typeof(Product)) .SetFetchMode("Product", FetchMode.Eager) .List<Product>() .AsEnumerable(); ``` With reflection optimizer enabled (I think) via web.config: ![With reflection optimizer enabled](https://i.stack.imgur.com/bvjwp.png) This is where most time is spent: ``` return new ProductList(products.Select(p => p.ToProductContract())); ``` Which is simply an extension method doing this: ``` public static ProductContract ToProductContract(this Product product) { return new ProductContract { Name = product.ProductName, ProductTypeName = product.ProductType.ProductTypeName, UpdateTimeStamp = product.UpdateDateTime, ProductNumber = product.ProductNumber, Attributes = product.ProductAttributes.ToCommonAttribute().ToList(), GroupCategories = product.ProductGroups.ToGroupCategory().ToList(), PublicUniqueId = product.PublicUniqueId }; } ``` mappings: ``` internal class ProductMapping : ClassMap<Product> { private const string _iscurrentindicator = "IsCurrentIndicator=1"; public ProductMapping() { Table("Product"); Id(Reveal.Member<Product>("ProductId")).GeneratedBy.Identity().Column("ProductID"); Map(x => x.ProductNumber).Column("ProductNumber").Not.Nullable(); Map(x => x.ProductName).Column("ProductName").Not.Nullable(); Map(x => x.InsertDateTime).Column("InsertedDateTime").Nullable().ReadOnly(); Map(x => x.UpdateDateTime).Column("UpdatedDateTime").Nullable(); Map(x => x.PublicUniqueId).Column("ProductGUID").Generated.Insert(); References(x => x.ProductType).Column("ProductTypeId").Not.Nullable(); HasMany(x => x.ProductAttributes) .KeyColumn("ProductId") .Inverse() .Fetch .Subselect() .Where(_iscurrentindicator) .Cascade .SaveUpdate(); HasMany(x => x.ProductGroups).KeyColumn("ProductId").Fetch.Subselect().Where(_iscurrentindicator); DynamicUpdate(); DynamicInsert(); BatchSize(500); } } internal class ProductGroupMapping : ClassMap<ProductGroup> { public ProductGroupMapping() { Table("ProductGroup"); Id(x => x.ProductGroupId).Column("ProductGroupId").GeneratedBy.Identity(); References(x => x.Product).Column("ProductId").Not.Nullable(); References(x => x.Group).Column("GroupId").Not.Nullable(); //Where("IsCurrentIndicator=1"); } } internal class ProductAttributeMapping : ClassMap<ProductAttribute> { public ProductAttributeMapping() { Table("ProductAttribute"); LazyLoad(); Id(x => x.ProductAttributeId).GeneratedBy.Identity().Column("ProductAttributeID"); References(x => x.Product).Column("ProductID").Not.Nullable(); References(x => x.Attribute).Column("AttributeID").Not.Nullable().Fetch.Join(); Map(x => x.PositionNumber).Column("PositionNumber").Nullable(); Map(x => x.ValueText).Column("ValueText").Nullable(); Map(x => x.ValueBinary).Column("ValueBinary").Nullable(); Component(x => x.OperationalAuditHistory, m => { Table("ProductAttribute"); m.Map(x => x.ExpirationDateTime).Column("ExpirationDateTime").Nullable(); m.Map(x => x.IsCurrent).Column("IsCurrentIndicator").Not.Nullable(); m.Map(x => x.OperationCode).Column("OperationCode").Nullable(); m.Map(x => x.OperationDateTime).Column("OperationDateTime").Nullable(); m.Map(x => x.OperationSystemName).Column("OperationSystemName").Nullable(); m.Map(x => x.OperationUserName).Column("OperationUserName").Nullable(); m.Map(x => x.LastUserPriority).Column("LastUserPriority").Nullable(); }); DynamicInsert(); BatchSize(50); } } ``` Unfortunately with .Future I still appear to get similar results. Here's a new trace; I've switched to Release, and x64 for the key projects, for the moment, so the times are lower, but the proportions are still pretty much the same; as well as with .Eager: ``` var products = ((HandleSession) _handleSession).Session.CreateCriteria(typeof (Product)) .SetFetchMode("ProductAttribute", FetchMode.Join) .SetFetchMode("ProductGroup", FetchMode.Join) .SetFetchMode("ProductType", FetchMode.Join) .Future<Product>() .AsEnumerable(); ``` ![dotTrace - Release mode, targeting x64, with .Future()](https://i.stack.imgur.com/vlKoA.png) Generated SQL with .Eager and .Future in place: > SELECT this_.ProductID as ProductID0_1_, this_.ProductNumber as ProductN2_0_1_, this_.ProductName as ProductN3_0_1_, this_.InsertedDateTime as Inserted4_0_1_, this_.UpdatedDateTime as UpdatedD5_0_1_, this_.ProductGUID as ProductG6_0_1_, this_.ProductTypeId as ProductT7_0_1_, producttyp2_.ProductTypeID as ProductT1_6_0_, producttyp2_.ProductTypeName as ProductT2_6_0_ FROM Product this_ inner join ProductType producttyp2_ on this_.ProductTypeId=producttyp2_.ProductTypeID;SELECT productatt0_.ProductId as ProductId2_, productatt0_.ProductAttributeID as ProductA1_2_, productatt0_.ProductAttributeID as ProductA1_2_1_, productatt0_.PositionNumber as Position2_2_1_, productatt0_.ValueText as ValueText2_1_, productatt0_.ValueBinary as ValueBin4_2_1_, productatt0_.ProductID as ProductID2_1_, productatt0_.AttributeID as Attribut6_2_1_, productatt0_.ExpirationDateTime as Expirati7_2_1_, productatt0_.IsCurrentIndicator as IsCurren8_2_1_, productatt0_.OperationCode as Operatio9_2_1_, productatt0_.OperationDateTime as Operati10_2_1_, productatt0_.OperationSystemName as Operati11_2_1_, productatt0_.OperationUserName as Operati12_2_1_, productatt0_.LastUserPriority as LastUse13_2_1_, attribute1_.AttributeId as Attribut1_1_0_, attribute1_.AttributeName as Attribut2_1_0_, attribute1_.DisplayName as DisplayN3_1_0_, attribute1_.DataTypeName as DataType4_1_0_, attribute1_.ConstraintText as Constrai5_1_0_, attribute1_.ConstraintMin as Constrai6_1_0_, attribute1_.ConstraintMax as Constrai7_1_0_, attribute1_.ValuesMin as ValuesMin1_0_, attribute1_.ValuesMax as ValuesMax1_0_, attribute1_.Precision as Precision1_0_ FROM ProductAttribute productatt0_ inner join Attribute attribute1_ on productatt0_.AttributeID=attribute1_.AttributeId WHERE (productatt0_.IsCurrentIndicator=1) and productatt0_.ProductId in (select this_.ProductID FROM Product this_ inner join ProductType producttyp2_ on this_.ProductTypeId=producttyp2_.ProductTypeID)SELECT productgro0_.ProductId as ProductId1_, productgro0_.ProductGroupId as ProductG1_1_, productgro0_.ProductGroupId as ProductG1_3_0_, productgro0_.ProductId as ProductId3_0_, productgro0_.GroupId as GroupId3_0_ FROM ProductGroup productgro0_ WHERE (productgro0_.IsCurrentIndicator=1) and productgro0_.ProductId in (select this_.ProductID FROM Product this_ inner join ProductType producttyp2_ on this_.ProductTypeId=producttyp2_.ProductTypeID)
How to resolve poor nHibernate collection initialization
CC BY-SA 3.0
0
2011-04-15T21:45:47.763
2011-04-20T05:03:29.127
2011-04-19T15:41:05.927
25,952
25,952
[ ".net", "nhibernate", "fluent-nhibernate", "nhibernate-criteria" ]
5,683,099
1
5,684,123
null
1
2,453
At the moment, I just have a relative layout with a few buttons, and have set `android:background="#FFFFFF"` I would like to create a background image to use instead, however I'm unsure of what size image I should create. I understand that for menu icons/launcher icons I needed to create 3 sets of them for ldpi, mdpi and hdpi. However, for a background, what should the pixel sizes be for these be? I will create a background similar to the following : ![enter image description here](https://i.stack.imgur.com/bZEqQ.png)
Is there a recommended pixel size for android backgrounds?
CC BY-SA 3.0
0
2011-04-15T22:53:30.273
2011-04-16T03:02:36.980
null
null
155,695
[ "android", "android-2.1-eclair" ]
5,683,201
1
5,684,217
null
1
1,102
For example I have such a code: ``` <style> body { background: url('back.png') repeat-y center; } </style> <body> </body> ``` It works fine in all browsers, include Opera. Looks like this: ![enter image description here](https://i.stack.imgur.com/abpf8.png) But if Opera Turbo mode is turned on, than it looks like this: ![enter image description here](https://i.stack.imgur.com/g4s3I.png) Why is this, and can it be fixed? P.S. Opera 11.10 on Ubuntu 10.10
Opera Turbo and background-repeat doesn't work
CC BY-SA 3.0
null
2011-04-15T23:10:57.393
2011-04-17T11:53:22.183
2011-04-16T22:46:15.300
679,733
547,242
[ "browser", "opera", "image-conversion", "image-compression", "opera-turbo" ]
5,683,232
1
5,786,508
null
3
701
Is there a shortcut to selecting all the components of a user-defined datatype/structure in SYBASE 10? So if `Resrv` is a field based on a user-defined datatype/structure, something like: ``` SELECT Name, Resrv from AGC_AREAPARM ``` (which doesn't work) Note: `SELECT Name, * from AGC_AREAPARM` doesn't work either. What does work is specifying each child item, like: ``` SELECT Name, Resrv.SysReqOper, Resrv.SysReqSpin from AGC_AREAPARM ``` If anyone can give me the correct verbiage for the structure, that'd be great. I'm having a hard time finding it in the Sybase documentation. Here's a pic of some of the `sp_helptype` output, AGC_RESERVE is the type for the Resrv field: ![sphelptype](https://i.stack.imgur.com/H6G2B.png)
SELECT all of a user-defined datatype/structure
CC BY-SA 3.0
null
2011-04-15T23:15:22.050
2011-04-26T15:51:06.163
2011-04-26T15:51:06.163
13,295
13,295
[ "sql", "sybase", "shortcut", "user-defined-types" ]
5,683,471
1
5,684,556
null
8
2,133
This should be a bit of simple geometry: How do I calculate the points to draw the lines in the code below so that it makes a 2D cone or wedge shape? ``` import flash.geom.Point; //draw circle var mc=new Sprite() mc.graphics.lineStyle(0,0) mc.graphics.drawCircle(0,0,30) mc.x=mc.y=Math.random()*300+100 addChild(mc) //draw lines: graphics.lineStyle(0,0) var p=new Point(Math.random()*500,Math.random()*400) graphics.moveTo(p.x, p.y) graphics.lineTo(mc.x,mc.y) // << should be point on edge of circle graphics.moveTo(p.x, p.y) graphics.lineTo(mc.x,mc.y) // << should be point on opposite edge of circle ``` UPDATE: Thanks guys, I should have mentioned my aim is not to draw a wedge shape, but to draw a line from a random point to the edge of an existing circle. If you're more comfortable with algebra than actionscript, maybe you could have a look at this graphic and post a formula for me? ![tangents](https://i.stack.imgur.com/puv7E.png)
Draw a line from a point to opposite tangents on a circle? Cone/wedge shape in AS3
CC BY-SA 3.0
0
2011-04-15T23:58:55.607
2011-04-16T06:58:42.593
2011-04-16T01:31:04.987
661,643
661,643
[ "flash", "actionscript-3", "math", "geometry" ]
5,683,526
1
5,683,575
null
0
746
On one side of my page, I have a very simple email form. On the other side I have a preview of the proposed email. For example: ![enter image description here](https://i.stack.imgur.com/87zh8.png) As the user completes the fields, I'd like to update the preview on keyup. I wrote a little js function to do just that: ``` var email_previewer = function() { var fields = [ { input: $('input#editor_invitation_to'), preview: $('dt.to') }, { input: $('#editor_invitation_message'), preview: $('#message') } ]; var perserve_linebreaks = function(text) { var html = text.replace(/\r\n\r\n/g, "</p><p>"), html = html.replace(/\r\n/g, "<br />"), html = html.replace(/\n\n/g, "</p><p>"), html = html.replace(/\n/g, "<br />"), html = "<p>"+html+"</p>"; return html; }; var sync_text = function(input, preview) { var text = input.val(); if (input.is('textarea')) { text = perserve_linebreaks(text); } preview.text(text); } // sync preview on page load $.each(fields, function(index, field) { sync_text(field.input, field.preview); }); // create keyup events $.each(fields, function(index, field) { field.input.keyup(function() { sync_text(field.input, field.preview); }); }); }(); ``` Everything works great except rails wants to escape my html and make it look like crap: ![enter image description here](https://i.stack.imgur.com/vzzIz.png) Normally, I know this is no problem: just add `raw` or `html_safe`. But I can't do that here since the markup is being dynamically built on keyup (or page load). Am I missing some simple solution? Any ideas for a workaround? My only idea is to load the preview in an iframe, which seems totally weird. This is ridiculously frustrating. Someone please help!
How to escape javascript-generated html in Rails?
CC BY-SA 3.0
null
2011-04-16T00:08:57.287
2011-04-16T00:21:20.130
null
null
388,061
[ "javascript", "ruby-on-rails", "html-sanitizing", "html-safe" ]
5,683,755
1
null
null
1
211
This is what I'm talking about: ![http://i56.tinypic.com/vi2rrq.jpg](https://i.stack.imgur.com/Sxyyu.png) It's a javascript void link: `<a href="javascript:void(0)">Contact</a>` so it doesn't take the user anywhere. When clicked it shows off that traling ants border. Is there any way to prevent this using either css or javascript?
Is there any way to prevent the trailing ants border effect on links?
CC BY-SA 3.0
0
2011-04-16T01:03:32.710
2011-11-28T00:58:47.367
2011-11-28T00:58:47.367
234,976
710,733
[ "javascript", "jquery", "html", "css" ]
5,683,787
1
5,736,064
null
1
370
I am playing around with facebook application, making them in iframe using coldfusion. Following is the url of my app [http://apps.facebook.com/firstones/](http://apps.facebook.com/firstones/) Instead of going directly going to the permissions page, it goes to the page shown below in picture. ![View that I get when use the application first time](https://i.stack.imgur.com/NJbPO.jpg) And after clicking on that big 'Facebook' button it goes to ask for applications permission. And once permissions are granted it takes to my website, where I have hosted the application, instead of opening it in Facebook only. Following is the code of my canvas url [[http://www.dkyadav.com/firstOnes/auth/]](http://www.dkyadav.com/firstOnes/auth/]) ``` <cfparam name="client_id" default="1234"> <!---same as app_id ---> <cfparam name="redirect_uri" default="http://www.dkyadav.com/firstOnes/auth/"> <cfparam name="redirect_uri_final" default="http://www.dkyadav.com/firstOnes/"> <cfparam name="scope" default="user_education_history,user_hometown,friends_education_history "> <cfparam name="client_secret" default="56789"> <!---- App_secret key ----> <cfif not isdefined('url.code')> <Cflocation url="https://www.facebook.com/dialog/oauth?client_id=#client_id#&redirect_uri=#redirect_uri#&scope=#scope#" > <Cfelse> <Cfif isdefined('url.error')> <Cfoutput> #url.error#<br /> Access denied. </Cfoutput> <cfelse> <cfoutput>#url.code#<br /> <cfhttp url="https://graph.facebook.com/oauth/access_token" result="token"> <cfhttpparam name="client_id" value="#client_id#" encoded="no" type="url"> <cfhttpparam name="redirect_uri" value="#redirect_uri#" encoded="no" type="url"> <cfhttpparam name="client_secret" value="#client_secret#" encoded="no" type="url"> <cfhttpparam name="code" value="#url.code#" encoded="no" type="url"> </cfhttp> <cflocation url="#redirect_uri_final#?#token.filecontent#" addtoken="no"> </cfoutput> </Cfif> </cfif> ``` And in [http://www.dkyadav.com/firstOnes/index.cfm](http://www.dkyadav.com/firstOnes/index.cfm) I look for access_token and have rest of my application. I does the above said things only for the first time it run. Once its permission get approved, it works normally as expected. You can try out this app running yourself [http://apps.facebook.com/firstones/](http://apps.facebook.com/firstones/) Please help and let me know what I am actually missing. Thanks!!
Unwanted Facebook button at first time use of my FB application in coldfusion
CC BY-SA 3.0
null
2011-04-16T01:09:45.653
2011-04-20T20:12:06.190
null
null
217,294
[ "coldfusion", "facebook", "facebook-graph-api" ]
5,683,872
1
8,248,913
null
4
8,071
In my Android app, I have a GridView layout with a set of Buttons. The problem is, that I can't set properly the focus (I mean cursor, controlled with joystick on the Android device) on the buttons. I can describe my problem with a picture: ![Focus in GridView layout](https://i.stack.imgur.com/DaR15.png) I set the Buttons to the GridView dynamically in the code in BaseAdapter using LayoutInflater. In the code, I set button's text, image (CompoundDrawable) and background color, because my buttons works like a checkboxes (blue background means checked). It seems like the program is focusing the grid field and not the button itself. I mean something like cell of table and not the button in table. Because the focus color is default (green) however I set the blue color in selector. Focus press also doesn't work. And the focus is evidently behind the button, out of button's bounds. Can somebody help me with this trouble please? Code of my XML layouts: main.xml: ``` ... <GridView android:id="@+id/channels" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="6dip" android:verticalSpacing="10dip" android:horizontalSpacing="10dip" android:numColumns="auto_fit" android:columnWidth="60dip" android:stretchMode="columnWidth" android:gravity="center" android:background="@color/container_main"> </GridView> ... ``` channel.xml: ``` <Button android:id="@+id/channel" android:layout_height="fill_parent" android:layout_width="fill_parent" android:gravity="center_horizontal" android:background="@color/willBeSetInAdapter" <!-- white/blue/darkblue focus background --> android:drawableTop="@drawable/willBeSetInAdapter" <!-- icon --> android:drawablePadding="0dip" android:text="WillBeSetInAdapter" <!-- label text --> android:textColor="@color/text_container_main" android:textSize="12sp" android:focusable="true" android:focusableInTouchMode="false"> </Button> ``` I tried to set focus parametres in Button and also in GridView and tried a lot of things, but unfortunately it still doesn't work :(
Focus in GridView layout
CC BY-SA 3.0
0
2011-04-16T01:31:14.003
2013-01-17T13:18:53.943
2013-01-17T13:18:53.943
686,540
686,540
[ "android", "gridview", "button", "android-layout", "focus" ]
5,683,920
1
null
null
2
4,064
I have a class that is generic. `Class<T>` and depending in the switch statement in the calling code it can be `class<int>` `class<string>` `class<decimal>` The the method that returns this returns it as an object because the calling code has no idea what it is until after it is set. Is there a way to do this once I get the object back from the function? ``` load(object result) { Type t = result.GetType().GetGenericArguments()[0]; Class<t> x = (Class<t>) result; } ``` Or do I have to set up an a check to check for each type it can be. If `int` then `Class<int>`, etc... EDIT: Here is what I am trying to do, actual code: ``` public class ReportResult<TP> { public ReportResult() { ReportHeaders = new List<ReportHeader>(); ReportViews = new List<IDataAttributeChild<TP>>(); } public List<ReportHeader> ReportHeaders {get;set;} public List<IDataAttributeChild<TP>> ReportViews {get;set;} } ``` BAL ``` public object GetReportData(ReportProcedureNameEventArg procedureNameEventArg) { object result = null; switch (procedureNameEventArg.SelectedNode.Class) { case ReportClass.Count: var r = new ReportResult<int> { ReportViews = GetCountByReport(procedureNameEventArg), ReportHeaders = GetReportHeaders(procedureNameEventArg.SelectedNode.ReportViewId) }; result = r; break; case ReportClass.List: break; case ReportClass.Date: var r = new ReportResult<datetime> { ReportViews = GetDateSummaryReport(procedureNameEventArg), ReportHeaders = GetReportHeaders(procedureNameEventArg.SelectedNode.ReportViewId) }; result = r; break; default: throw new ArgumentOutOfRangeException(); } return result; } ``` The GUI ``` public void LoadTreeResult(object result) { Type t = result.GetType().GetGenericArguments()[0]; ReportResult<?> fff = (ReportResult<?>)result; dgResult.Columns.Clear(); foreach (var header in result.ReportHeaders) { dgResult.Columns.Add( new DataGridTextColumn { Header = header.Header, Binding = new Binding(header.Binding) }); } // This would also be a switch depending on a property coming // back to now what class to cast to in order to populate the grid. List<ReportCountByView> d = new List<ReportCountByView>(); foreach (var reportCountByView in result.ReportViews) { d.Add((ReportCountByView)reportCountByView); } dgResult.ItemsSource = d; } ``` This is a layout of the class model in case it might help. ![enter image description here](https://i.stack.imgur.com/4Or27.jpg) [image of layout](http://i1120.photobucket.com/albums/l489/nitefrog/Reports.jpg) Thanks.
C# Generic T Class TypeOf, is this possible?
CC BY-SA 3.0
null
2011-04-16T01:42:10.653
2011-04-16T02:34:27.193
2011-04-16T02:07:50.220
329,494
329,494
[ "c#", "generics", "type-conversion", "gettype" ]
5,684,002
1
5,694,446
null
3
2,740
big explanation (better safe...), question in bold if you don't want to read it all. Thanks a lot for your help! I have an app with a `ListView`, and two custom XMLs. One is a single TextView, for the headers. The other has 3 TextViews and 3 ImageViews that represent the data. As most of you know, [Jeff Sharkey](http://jsharkey.org/) already has a [very clever (imho) solution](http://jsharkey.org/blog/2008/08/18/separating-lists-with-headers-in-android-09/) (`SeparatedListAdapter`), which allows the class to work, without modifications, with ImageViews. Although it accepts `String`s, I can provide the `valueOf` of the drawable int resources, and it will figure it out. Great, see code and screen at end (his class not here for simplicity). The problem is that, . I'm not discussing the politics of it, so I appreciate if you don't. Besides, I'm not circumventing, I'm avoiding it legally. Right now, I've been able to find [cwac-merge](https://github.com/commonsguy/cwac-merge), which is ASL 2. But so far I couldn't "map" the strings and drawables to custom TextViews and ImageViews in a custom XML layout. Also, the example app uses a completely different approach to what I think I remotely need. In case you care to see what I'm up to, see `SeparatedListAdapter` and my class below. For cwac-merge, it force closes no matter what, so I won't bother posting. ``` package com.uitests; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import android.app.ListActivity; import android.os.Bundle; import android.widget.SimpleAdapter; public class TestActivity extends ListActivity { public final static String ITEM_TITLE = "title"; public final static String ITEM_STATE = "state"; public final static String ITEM_TEMPERATURE = "temperature"; public final static String ITEM_UP = "up"; public final static String ITEM_DOWN = "down"; public final static String ITEM_LEVEL = "level"; public Map<String,?> createItem( String title, String state, String temperature, String upImage, String downImage, String levelImage) { Map<String,String> item = new HashMap<String,String>(); item.put(ITEM_TITLE, title); item.put(ITEM_STATE, state); item.put(ITEM_TEMPERATURE, temperature); item.put(ITEM_UP, upImage); item.put(ITEM_DOWN, downImage); item.put(ITEM_LEVEL, levelImage); return item; } @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); // THIS IS JUST AN EXAMPLE TO POPULATE THE LIST FOR STACKOVERFLOW! List<Map<String,?>> controlA = new LinkedList<Map<String,?>>(); controlA.add(createItem( "Monitor 001AK", "Functional", "27", String.valueOf(R.drawable.ic_up), String.valueOf(R.drawable.ic_down_off), String.valueOf(R.drawable.ic_level07))); // MORE .adds HERE List<Map<String,?>> controlB = new LinkedList<Map<String,?>>(); controlB.add(createItem( "Monitor 003CK", "Functional", "29", String.valueOf(R.drawable.ic_up), String.valueOf(R.drawable.ic_down_off), String.valueOf(R.drawable.ic_level07))); // MORE .adds HERE SeparatedListAdapter adapter = new SeparatedListAdapter(this); adapter.addSection( "Control 1", new SimpleAdapter( this, controlA, R.layout.equip_row, new String[] { ITEM_TITLE, ITEM_STATE, ITEM_TEMPERATURE, ITEM_UP, ITEM_DOWN, ITEM_LEVEL }, new int[] { R.id.tide_row_title, // TextView R.id.tide_row_state, // TextView R.id.tide_row_temperature, // TextView R.id.tide_row_img_up, // ImageView R.id.tide_row_img_down, // ImageView R.id.tide_row_img_level } // ImageView ) ); adapter.addSection( "Control 2", new SimpleAdapter( this, controlB, R.layout.equip_row, new String[] { ITEM_TITLE, ITEM_STATE, ITEM_TEMPERATURE, ITEM_UP, ITEM_DOWN, ITEM_LEVEL }, new int[] { R.id.tide_row_title, R.id.tide_row_state, R.id.tide_row_temperature, R.id.tide_row_img_up, R.id.tide_row_img_down, R.id.tide_row_img_level } ) ); this.getListView().setAdapter(adapter); } } ``` all that simplicity results in this great screen: ![Jeff Sharkey's implementation of Sectioned ListViews](https://i.stack.imgur.com/SneQT.png)
License problem using sectioned ListView with J. Sharkey's SeparatedListAdapter
CC BY-SA 3.0
0
2011-04-16T02:04:23.397
2011-04-17T15:39:19.480
null
null
489,607
[ "android", "listview", "licensing", "adapter", "sections" ]
5,684,097
1
7,210,231
null
1
2,595
I want to show the admob ads like the following. My game is locked in landscape mode, and I want to show the ads vertically. I used the XML layout to placed my ads. ![enter image description here](https://i.stack.imgur.com/wvUZT.png)
How to show admob ads vertical in landscape mode? (Android)
CC BY-SA 3.0
0
2011-04-16T02:28:18.257
2016-09-10T15:21:07.933
null
null
522,915
[ "android", "admob", "ads", "xml-layout" ]
5,684,076
1
null
null
0
1,895
I am trying to make a ListView "float" in the middle of the screen, just like the Swype keyboard: ![enter image description here](https://i.stack.imgur.com/RTGg3.png) I've read how to do it in an Activity by using a FrameLayout, but it isn't working in my IME, which is a Service not an Activity. My input view consists of a FrameLayout as the root view, a child RelativeLayout containing several controls, and the ListView which is also a child of the FrameLayout. Here is my layout code: ``` <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:gravity="center_horizontal" > <!-- Most of the controls are children of this RelativeLayout --> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center" > <Button android:id="@+id/btnOption1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:layout_alignParentLeft="true" android:layout_toLeftOf="@+id/imgArrow" android:layout_marginTop="10dp" android:textSize="18dp" android:textColor="#ffffff" android:background="@drawable/button" android:padding="4dp" android:text="Option 1" /> <ImageView android:id="@id/imgArrow" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:layout_centerHorizontal="true" android:layout_alignBottom="@id/btnOption1" android:layout_marginTop="10dp" android:padding="4dp" android:src="@drawable/arrow_right" /> <Button android:id="@+id/btnOption2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_toRightOf="@id/imgArrow" android:layout_marginTop="10dp" android:textSize="18dp" android:textColor="#ffffff" android:background="@drawable/button" android:padding="4dp" android:text="Option 2" /> <!-- Translate button --> <Button android:id="@+id/btnContinue" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_below="@id/imgArrow" android:layout_marginTop="10dp" android:layout_marginBottom="10dp" android:textSize="22dp" android:textColor="#ffffff" android:background="@drawable/button" android:text="Translate!" /> <!-- Keyboard button --> <ImageButton android:id="@+id/btnKeyboard" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@id/btnContinue" android:layout_marginRight="4dp" android:textColor="#ffffff" android:background="@drawable/button" android:src="@drawable/sym_keyboard_kb" /> <!-- Undo button --> <ImageButton android:id="@+id/btnUndo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:layout_below="@id/btnContinue" android:textColor="#ffffff" android:background="@drawable/button" android:src="@drawable/sym_keyboard_undo" /> </RelativeLayout> <ListView android:id="@+id/menuOptions" style="@style/optionsMenu" /> </FrameLayout> ``` The ListView and IME look like this (inside the SMS app): ![enter image description here](https://i.stack.imgur.com/Gryhj.png) But I want it to look like this: ![enter image description here](https://i.stack.imgur.com/2i3tW.png) In other words I want it to appear the IME input view. If Swype can do it, I know I can (with a little help). Any suggestions? Thanks in advance! Barry
How do I make a view float above other views in an IME?
CC BY-SA 3.0
0
2011-04-16T02:20:13.780
2011-05-29T09:22:32.187
2011-04-16T02:31:20.170
706,628
706,628
[ "android", "ime" ]
5,684,161
1
5,684,369
null
2
4,587
I'm using the [Youtube API](http://gdata-python-client.googlecode.com/svn/trunk/pydocs/gdata.html) to search using a keyword query: ``` import gdata.youtube import gdata.youtube.service def youtube_query(query_text, max_results=50, start_index=1, racy='exclude', orderby='relevance'): client = gdata.youtube.service.YouTubeService() query = gdata.youtube.service.YouTubeVideoQuery() query.vq = query_text query.max_results = max_results query.start_index = start_index query.racy = racy #query.format = 5 query.orderby = orderby feed = client.YouTubeQuery(query) resultsCount = int(feed.total_results.text) entries = [] try: while resultsCount > int(query.start_index): print repr(feed.entry) entries += feed.entry query.start_index = int(query.start_index) + int(query.max_results) feed = client.YouTubeQuery(query) except gdata.service.RequestError: # # Cannot request beyond 1000 items. # pass return entries ``` Each entry is a [YoutubeVideoEntry](http://gdata-python-client.googlecode.com/svn/trunk/pydocs/gdata.youtube.html#YouTubeVideoEntry). The each video is uploaded should definitely be accessible, as it is displayed for every video: ![enter image description here](https://i.stack.imgur.com/Z1rhd.png) I need the as well. Does anybody know if this can be done?
Fetch the exact time a video was uploaded
CC BY-SA 3.0
0
2011-04-16T02:43:56.097
2013-11-19T23:21:24.437
null
null
356,020
[ "python", "youtube", "youtube-api" ]
5,684,190
1
null
null
2
257
When I attempt to add a SQL Server database to a website project (via add new items), I get the following error: ![enter image description here](https://i.stack.imgur.com/UjG5F.gif) > "Connections to SQL Server database files (.mdf) require SQL Server 2005 Express or SQL Server 2008 Express to be installed and running on the local computer. The current version can be downloaded from..." This is despite having installed SQL SErver Express 2008 - and seeing it running under services. A number of other instances of SQL have been on the machine in the past although they have been uninstalled. I have tried reinstalling SQL & VWD several times to no avail.
VWD can't create SQL Server database
CC BY-SA 3.0
0
2011-04-16T02:52:40.290
2012-01-17T14:35:11.887
2011-04-17T15:53:35.767
84,916
84,916
[ "asp.net", "sql-server", "visual-web-developer" ]
5,684,329
1
5,685,122
null
6
4,439
I need to find fixed points and attractors of a Tent map function given by the definition below: I am using the MATLAB code below to generate a cobweb diagram (shown below the code) to see if I can get some insight in to this particular tent map function. As you can see I am starting out by setting t=1 (and x(1) = 0.2001), but there are infinitely many possible places to start at. How can you determine fixed points/attractors if you don't test each and every starting point? ``` clear close all % Initial condition 0.2001, must be symbolic. nmax=200; t=sym(zeros(1,nmax));t1=sym(zeros(1,nmax));t2=sym(zeros(1,nmax)); t(1)=sym(2001/10000); mu=2; halfm=(2/3) *nmax; axis([0 1 0 1]); for n=2:nmax if (double(t(n-1)))>0 && (double(t(n-1)))<=2/3 % 0 <= x <= (2/3) t(n)=sym((3/2)*t(n-1)); % x(t) = (3/2) * x(t-1) else if (double(t(n-1)))<1 % else (2/3) <= x <= 1 t(n)=sym(3*(1-t(n-1))); % x(t) = 3* (1-x(t-1)) end end end for n=1:halfm t1(2*n-1)=t(n); t1(2*n)=t(n); end t2(1)=0;t2(2)=double(t(2)); for n=2:halfm t2(2*n-1)=double(t(n)); t2(2*n)=double(t(n+1)); end hold on fsize=20; plot(double(t1),double(t2),'r'); x=[0 (2/3) 1];y=[0 mu/2 0]; plot(x,y,'b'); ``` The following cobweb diagram is for t(1) = 0.2001 ![enter image description here](https://i.stack.imgur.com/lKpOl.jpg)
Finding fixed points / attractors / repellors of a Tent map
CC BY-SA 3.0
0
2011-04-16T03:45:24.997
2019-07-06T23:09:54.010
2019-07-06T23:09:54.010
2,751,851
710,810
[ "matlab", "wolfram-mathematica", "fixed-point-iteration" ]
5,684,365
1
5,690,636
null
41
84,543
[According to Wikipedia](http://en.wikipedia.org/wiki/Page_fault): > A page fault is a trap to the software raised by the hardware when a program accesses a page that is mapped in the virtual address space, . (emphasis mine) Okay, that makes sense. But if that's the case, why is it that whenever the process information in Process Hacker is refreshed, I see about 15 page faults? ![Screenshot](https://i.stack.imgur.com/JpvMz.png) Or in other words, why is any memory getting paged out? (I have no idea if it's user or kernel memory.) I have page file, and the RAM usage is about 1.2 GB out of 4 GB, which is after a clean reboot. There's no shortage of any resource; why would anything get paged out?
What causes page faults?
CC BY-SA 3.0
0
2011-04-16T03:59:12.810
2021-07-26T13:43:41.683
2012-11-11T06:45:52.500
309,308
541,686
[ "windows", "x86", "paging", "x86-64" ]