Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
sequence
2,032,500
1
2,034,076
null
2
2,109
I have asked a similar question [here](https://stackoverflow.com/questions/1864552/what-about-this-custom-uialertview) and got some answers, so first of all sorry for making you people bother once again. But I have an argument this time. First I will show my piece of code ``` - (void) showTheAlert{ UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Hey!" message:@"?" delegate:self cancelButtonTitle:nil otherButtonTitles:@"Yes",@"No",@"Don't know eaxactly.",nil]; [alertView setTag:101]; [alertView show]; } - (void)willPresentAlertView:(UIAlertView *)alertView{ if(alertView.tag == 101){ [[[alertView subviews] objectAtIndex:2] setBackgroundColor:[UIColor colorWithRed:0.5 green:0.0f blue:0.0f alpha:0.5f]]; [[[alertView subviews] objectAtIndex:3] setBackgroundColor:[UIColor colorWithRed:0.0 green:0.5f blue:0.0f alpha:0.5f]]; } } ``` And my final alert looks like ![enter image description here](https://i.stack.imgur.com/ZhX43.png) Now my confusion is that, `[alertView subviews]` is not documented as some people may say but alertview is a subclass of `UIView`, which has a property called `subviews`. So I am using the documented property of a superclass which is definitely allowed. So if this alertview may cause rejection of my app or not? ( I don't think apple will have any base to say I am using the undocumented or a private api. The look and feel is also alike to alertview.)
Is using subviews in Alert undocumented
CC BY-SA 3.0
null
2010-01-09T05:56:57.013
2017-04-22T18:30:58.150
2017-05-23T12:34:11.847
-1
165,260
[ "objective-c", "iphone" ]
2,034,037
1
2,034,258
null
7
5,619
I am trying to emboss an image using [PIL](http://en.wikipedia.org/wiki/Python_Imaging_Library). PIL provides a basic way to emboss an image ( using `ImageFilter.EMBOSS`). In image editing packages like GIMP, you can vary parameters like Azimuth, depth and elevation in this embossed image. How to do this with PIL? At the very least I want to adjust the "depth" of the embossed image. I tried things suggested by Paul (modifying the `filterargs`such as `scale, offset` and the matrix), but I couldn't change the "depth" effect. So still looking for an answer. Here is the comparison of embossing effect using PIL (left) and GIMP (right). The original picture is located here, [http://www.linuxtopia.org/online_books/graphics_tools/gimp_advanced_guide/gimp_guide_node74.html](http://www.linuxtopia.org/online_books/graphics_tools/gimp_advanced_guide/gimp_guide_node74.html). ![alt text](https://lh6.ggpht.com/_VmG9BRg2ZAU/S0qgDIk70fI/AAAAAAAAABk/3ff6dB53R08/s128/PIL_Vs_GIMP.png)
Image embossing in Python with PIL -- adding depth, azimuth, etc
CC BY-SA 3.0
0
2010-01-09T16:39:51.010
2011-04-22T04:23:27.470
2017-02-08T14:19:22.277
-1
243,708
[ "python", "image-processing", "python-imaging-library" ]
2,035,943
1
2,037,163
null
20
11,518
The following snippet: ``` <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Grid> <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center"> <Label Content="Name:"/> <Label Content="Itzhak Perlman" FontSize="44"/> </StackPanel> </Grid> </Window> ``` Renders the following: ![alt text](https://farm5.static.flickr.com/4034/4260633381_1a8a71c79b_o.png) Is there any way I can set in the Labels' styles so that their text bottoms should be aligned? I have the same question with TextBlocks as well. NOTE: since I've been struggling with this issue for a while, please post only certains answers that you know that work. I already tried: VerticalAlignment, VerticalContentAlignment, Padding, Margin. Is there anything else I am not aware of? I've read [this](https://stackoverflow.com/questions/1099754/vertically-aligning-labels-and-textblocks-at-top-in-xaml) post, but it doesn't talk about a scenario of different font size. : The problem is, that even Padding is set to 0 there is still an indeterminate space around the font, within the ContentPresenter area. this space varies on the font size. If I could control this space I would be in a better situation. Thanks
Align bottoms of text in controls
CC BY-SA 2.5
0
2010-01-10T03:09:20.133
2020-09-25T23:20:06.820
2017-05-23T11:46:24.413
-1
75,500
[ "wpf", "layout", "textblock" ]
2,036,154
1
2,036,409
null
1
1,168
In VS2010 Beta 2, from the Help Library Manager, after selecting local help, and downloading the VS Documentation, it won't launch. Here's what I have installed: ![alt text](https://farm5.static.flickr.com/4045/4261627106_e8054d10bb.jpg) Here's what I'm clicking in the Start Menu: ![alt text](https://farm5.static.flickr.com/4055/4261627072_5f572a45da_o.jpg) Here's the result: ![alt text](https://farm5.static.flickr.com/4040/4260872833_1fa2f72ea3_o.jpg) Ideas? Thanks, Adam
VS2010 Beta 2: Can't launch local help documentation
CC BY-SA 2.5
null
2010-01-10T05:01:31.113
2018-01-27T16:10:51.827
2018-01-27T16:10:51.827
1,677,912
90,837
[ "visual-studio-2010" ]
2,036,216
1
2,036,237
null
21
24,987
In the context of a Visual Studio 2008 Setup Project, what are "Content Files". In other words, when creating a setup project and defining the File System settings and choosing: Add Project Output > Content Files, what files will be added? For example, what has to be true about a file or its location for it to be considered a Content File for a given project's output? ![alt text](https://farm5.static.flickr.com/4004/4261691678_d056936a2f.jpg)
What are "Content Files" (in Visual Studio : Setup Project : File System
CC BY-SA 2.5
0
2010-01-10T05:28:16.440
2016-06-29T12:19:44.637
2017-02-08T14:19:25.687
-1
90,837
[ "visual-studio", "deployment", "installation" ]
2,038,139
1
2,038,153
null
8
190
I have a fairly simple app. It compiles fine. Unfortunately, when I Build and Go, it fails before even the first line of code, thus making it impossible for me to even debug it. Where do I start? I do have the stack track though.![alt text](https://i.imgur.com/AaAam.png)
How to debug iPhone app errors that occur before the first line
CC BY-SA 2.5
null
2010-01-10T18:56:34.357
2010-01-10T19:17:24.843
null
null
9,382
[ "iphone", "terminate" ]
2,038,247
1
2,038,319
null
27
7,866
I'm going to add a python console widget (into a C++ GUI) below some other controls: ![Python Console screenshot](https://img-fotki.yandex.ru/get/4012/goodrone.0/0_2f2ae_b37ea156_orig) Many classes are going to be exposed to the python code, including some access to GUI (maybe I'll consider PyQt). > Should I run the Python code in a separate thread? I think it's a good approach, because GUI won't be frozen while executing long commands. But on the other hand, shouldn't other controls be disabled to preserve objects' state and avoid conflicts?
Integration of Python console into a GUI C++ application
CC BY-SA 2.5
0
2010-01-10T19:26:09.997
2020-04-11T13:52:37.717
2017-02-08T14:19:27.383
-1
13,543
[ "c++", "python", "multithreading", "user-interface", "integration" ]
2,039,103
1
null
null
8
11,931
![alt text](https://imgur.com/yP4BE.png) My eyes kind of burn when I code for too long and this will definitely help me sooth them. I would ask this in SuperUser but there are few people from the dev world there. Mostly Windows Vista/7 savvy people. I know someone can help me out here. :D Thanks SO!
How can I make my Visual Studio look like this?
CC BY-SA 2.5
0
2010-01-10T23:27:21.803
2010-05-09T00:21:49.133
2010-05-09T00:21:49.133
76,337
112,355
[ "c#", "visual-studio", "visual-studio-express" ]
2,040,604
1
2,042,001
null
2
3,062
I am working with a database with the following design. I read it is not a good practice to have closed loops in a database design, and i have more than one. But i cannot remember why. So not sure how this might affect me. Any examples how this could be dangerous? ![schematic of part of our database](https://imgur.com/ChFL1.jpg) Edit: went through my ebooks, found what i was reading was , publisher: APRESS. they just warn against this, but give a vague reason why. No, we are not using triggers. Anyone has a clearer explanation? Thanks Excerpt, p.109: > A small company has employees who each work for one of a number of different small project groups. Each group and all its employees are housed in one particular room with larger rooms housing several groups.We may require information such as where each employee is located, a particular employee’s phone number, where to find a particular group, which employees work in each group, who is in each room, and so on. One possible data model is shown in Figure 5-7. Take a moment to understand the data model and the information it contains about the number of groups in a room and so on for this particular problem. The model has redundant information. Can you see what it is? ![example figure](https://imgur.com/W6pkU.jpg) > With respect to Example 5-3, if we regularly want to find an employee’s phone number, we might think that the top relationship in Figure 5-7 between Employee and Room would be a useful direct route. However, this same information is very easily available by an alternative route through Group. We can find the employee’s (one only) group and then find that group’s (one only) room. This is a very simple retrieval (it does not involve all the complications with dates that plagued the small hostel in Example 5-2). However, the extra relationship is not just unnecessary, it is dangerous. With two routes for the same information, we risk getting two different answers unless the data is very carefully maintained. Whenever an employee changes group or a group shifts rooms, there will be two relationship instances to update. Without very careful updating procedures, we could end up having that Jim is in Group A, which is in Room 12, while the other route may have Jim associated directly with Room 15. Redundant information is prone to inconsistencies and should always be removed.
sql closed loop relations; what could go wrong?
CC BY-SA 2.5
null
2010-01-11T08:21:03.900
2010-01-22T19:44:07.350
2010-01-12T04:14:22.883
153,614
153,614
[ "sql", "relationship", "cyclic" ]
2,043,737
1
2,043,846
null
2
1,522
I have a PDF file located (under my Project) in an Assets > Documents folder: ![alt text](https://imgur.com/IqaU1.png) When my application gets deployed, it gets deployed to a particular folder on the domain. For example, [http://www.domain.com/MyAppFolder](http://www.domain.com/MyAppFolder). I want to be able to access this PDF file by linking to [http://www.domain.com/MyAppFolder/Assets/Documents/EZTrac_UserGuide_NewSys.pdf](http://www.domain.com/MyAppFolder/Assets/Documents/EZTrac_UserGuide_NewSys.pdf) I can't seem to get the routing correct for this, as it keeps trying to route this request to a controller. Here is the modification I made to the routing: ``` routes.IgnoreRoute("MyAppFolder/Assets/Documents/EZTrac_UserGuide_NewSys.pdf"); ``` But this is the result that I get: > The IControllerFactory 'EZTrac.DependencyResolution.ControllerFactory' did not return a controller for a controller named 'Assets'.
Why isn't my Route.Ignore working on this static file in my ASP.NET MVC application?
CC BY-SA 2.5
null
2010-01-11T17:59:48.437
2010-01-11T18:16:04.410
null
null
121,682
[ "c#", "asp.net-mvc", "asp.net-mvc-routing" ]
2,044,752
1
2,045,014
null
9
75,623
This is a SQL design question. First, the setup. I have three tables: 1. A, which is automatically populated based on a query against a linked server. The data in this table cannot be changed; 2. B, which has just a dozen or so rows, containing the names for collections of As; 3. AtoB, which is the mapping table by which As are organized into named collections, with foreign keys on both columns; ![SQL Mapping Table](https://i.stack.imgur.com/XQ46g.png) For example, A contains: 1. Giraffe 2. Owl 3. Tiger And B contains: 1. Seattle Zoo 2. San Jose Zoo And AtoB contains: 1,1 (Giraffe in Seattle) 2,1 (Owl in Seattle) 3,1 (Tiger in Seattle) 2,2 (Owl in San Jose) Now, the problem: I've been asked to include in some of these collections items not found in A. So, I create a table, C, with the same identity and Name columns as A, and populate it. In keeping with the earlier example, let's say C contains: 1. Dragon The question is, how do I include items from C in AtoB? What if I need to include a Dragon in the Seattle Zoo? My first instinct, being naive, was to create a view V containing the union of A and C, and modifying AtoB to be VtoB. That's where my naivety paid off: one cannot create a foreign key to a view. I suspect that there's a standard, correct means of relating one or more A OR C with a B.
SQL mapping between multiple tables
CC BY-SA 3.0
0
2010-01-11T20:40:32.653
2022-11-21T10:29:52.683
2017-07-03T14:38:55.877
3,990,145
4,593
[ "sql", "database-design", "union", "foreign-key-relationship" ]
2,046,553
1
2,314,350
null
20
36,568
Initially I was thinking to use SSIS to parse an EDI file, however I've seen a few manual EDI parsers (field mapping), and would like to use automate this functionality in C#. Example EDI File: ![Example EDI File](https://i.stack.imgur.com/53Csy.gif)
EDI Flat File parsing with C#?
CC BY-SA 3.0
0
2010-01-12T03:36:58.450
2016-08-02T16:39:05.393
2016-08-02T15:32:59.897
61,577
172,359
[ "c#", "parsing", "flat-file", "edi", "x12" ]
2,049,196
1
2,049,640
null
29
16,547
I'm trying to come up with an iterative function that generates xyz coordinates for a hexagonal grid. With a starting hex position (say 0,0,0 for simplicity), I want to calculate the coordinates for each successive "ring" of hexagons, as illustrated here: ![](https://i.imgur.com/AJoDm.gif) So far, all I've managed to come up with is this (example in javascript): ``` var radius = 3 var xyz = [0,0,0]; // for each ring for (var i = 0; i < radius; i++) { var tpRing = i*6; var tpVect = tpRing/3; // for each vector of ring for (var j = 0; j < 3; j++) { // for each tile in vector for(var k = 0; k < tpVect; k++) { xyz[0] = ???; xyz[1] = ???; xyz[2] = ???; console.log(xyz); } } } ``` I know each ring contains six more points than the previous and each 120° vector contains one additional point for each step from the center. I also know that `x + y + z = 0` for all tiles. But how can I generate a list of coordinates that follow the sequence below? ``` 0, 0, 0 0,-1, 1 1,-1, 0 1, 0,-1 0, 1,-1 -1, 1, 0 -1, 0, 1 0,-2, 2 1,-2, 1 2,-2, 0 2,-1,-1 2, 0,-2 1, 1,-2 0, 2,-2 -1, 2,-1 -2, 2, 0 -2, 1, 1 -2, 0, 2 -1,-1, 2 ```
Generating triangular/hexagonal coordinates (xyz)
CC BY-SA 3.0
0
2010-01-12T13:24:22.530
2022-02-04T18:57:45.890
2018-03-23T21:46:50.183
241,211
119,955
[ "math", "coordinates", "vector", "coordinate-systems", "hexagonal-tiles" ]
2,050,945
1
2,051,064
null
5
9,726
This is a little difficult to describe, but basically there is undesired space left by a floated div on my page. Here are pictures describing the problem. The black boxes are divs. Before floating: ![alt text](https://i46.photobucket.com/albums/f105/Elwood54/before-float.png) After floating: ![alt text](https://i46.photobucket.com/albums/f105/Elwood54/after-float.png) Desired effect: ![alt text](https://i46.photobucket.com/albums/f105/Elwood54/should-look.png) And I'm not sure if it makes a difference, but I also have an empty div with "clear: both" placed immediately after the floated div. How can I achieve this?
Floats in CSS - Gap/space left on top when floated to the right?
CC BY-SA 2.5
0
2010-01-12T17:29:35.857
2013-05-23T23:50:29.687
2017-02-08T14:19:30.437
-1
175,098
[ "html", "css", "css-float" ]
2,051,096
1
2,053,075
null
1
2,017
Have a very simple powershell script to count the number of trades in a file: ``` (gc \\mimkeimc11n\Batch\FundQuest\TradeFiles\trades.dat |? {$_ -match 'SL|BY'} | Measure-Object | select count).count > \\mimkeimc11n\Batch\FundQuest\ConfirmtoFQ\NumberofTrades.txt ``` The problem I am running into is the output NumberofTrades.txt is including the number that I want, but also a CR LF, not sure why??? Any help would be greatly appreciated. ![image](https://i.stack.imgur.com/MTARW.png) [http://screencast.com/t/MGM3ZTc0Mzct](http://screencast.com/t/MGM3ZTc0Mzct)
Powershell and getcontent CR LF
CC BY-SA 3.0
null
2010-01-12T17:49:38.997
2011-12-21T00:39:11.957
2011-12-21T00:39:11.957
53,195
249,114
[ "powershell" ]
2,052,321
1
2,052,857
null
7
2,041
Assume a group of data points, such as one plotted here (this graph isn't specific to my problem, but just used as a suitable example): ![](https://upload.wikimedia.org/wikipedia/commons/0/0f/Oldfaithful3.png) Inspecting the scatter graph visually, it's fairly obvious the data points form two 'groups', with some random points that do not obviously belong to either. I'm looking for an algorithm, that would allow me to: - - -
Group detection in data sets
CC BY-SA 2.5
0
2010-01-12T20:58:34.643
2010-01-12T22:48:55.820
2017-02-08T14:19:30.773
-1
200,244
[ "algorithm", "statistics", "probability", "feature-detection" ]
2,054,727
1
2,055,182
null
5
7,521
![alt text](https://farm5.static.flickr.com/4015/4271186240_8e2f8f73c9.jpg) Here is the function I use to create the graph. It's a whole bunch of code, and I'm not quite sure which piece might be off to not display the x-axis. Could the x-axis not showing have something to do with my data? ``` - (void) showGraph:(SavedDetailScreen*)dataSource { // create the graph and add it to the view CPXYGraph *graph = [[CPXYGraph alloc] initWithFrame: CGRectZero]; graph.plotArea.masksToBorder = NO; CPLayerHostingView *graphView = [[CPLayerHostingView alloc] initWithFrame:CGRectMake(0,0, 280, 240)]; [self addSubview:graphView]; graphView.hostedLayer = graph; graph.paddingLeft = 50.0; graph.paddingTop = 20.0; graph.paddingRight = 10.0; graph.paddingBottom = 40.0; // set up the ranges for the graph axis float minElevation = dataSource.track.tbStats.minAlt; float maxElevation = dataSource.track.tbStats.maxAlt-dataSource.track.tbStats.minAlt; float minDistance = 0.0f; float maxDistance = dataSource.track.tbStats.totalDistance; CPXYPlotSpace *plotSpace = (CPXYPlotSpace *)graph.defaultPlotSpace; plotSpace.xRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(minDistance) length:CPDecimalFromFloat(maxDistance)]; plotSpace.yRange = [CPPlotRange plotRangeWithLocation:CPDecimalFromFloat(minElevation) length:CPDecimalFromFloat(maxElevation)]; // style the graph with white text and lines CPTextStyle *whiteText = [CPTextStyle textStyle]; whiteText.color = [CPColor whiteColor]; CPLineStyle *whiteStyle = [CPLineStyle lineStyle]; whiteStyle.lineColor = [CPColor whiteColor]; whiteStyle.lineWidth = 2.0f; // set up the axis CPXYAxisSet *axisSet = (CPXYAxisSet *)graph.axisSet; CPXYAxis *x = axisSet.xAxis; CPXYAxis *y = axisSet.yAxis; x.majorIntervalLength = CPDecimalFromFloat(maxDistance/10.0f); x.minorTicksPerInterval = 0; x.majorTickLineStyle = whiteStyle; x.minorTickLineStyle = whiteStyle; x.axisLineStyle = whiteStyle; x.minorTickLength = 5.0f; x.majorTickLength = 10.0f; x.labelOffset = 3.0f; x.labelTextStyle = whiteText; y.majorIntervalLength = CPDecimalFromFloat(maxElevation/5.0f); y.minorTicksPerInterval = 0; y.majorTickLineStyle = whiteStyle; y.minorTickLineStyle = whiteStyle; y.axisLineStyle = whiteStyle; y.minorTickLength = 5.0f; y.majorTickLength = 10.0f; y.labelOffset = 3.0f; y.labelTextStyle = whiteText; CPScatterPlot *plot = [[[CPScatterPlot alloc] initWithFrame:graph.bounds] autorelease]; plot.dataLineStyle.lineWidth = 2.0f; plot.dataLineStyle.lineColor = [CPColor blueColor]; plot.dataSource = dataSource; [graph addPlot:plot]; CPPlotSymbol *greenCirclePlotSymbol = [CPPlotSymbol ellipsePlotSymbol]; greenCirclePlotSymbol.fill = [CPFill fillWithColor:[CPColor greenColor]]; greenCirclePlotSymbol.size = CGSizeMake(2.0, 2.0); plot.plotSymbol = greenCirclePlotSymbol; } ``` ![alt text](https://farm5.static.flickr.com/4042/4270334347_d291f65f3a.jpg)
Why won't my x-axis show with core-plot on the iPhone?
CC BY-SA 2.5
0
2010-01-13T05:51:32.883
2015-07-11T05:04:16.650
2017-02-08T14:19:32.140
-1
108,512
[ "iphone", "objective-c", "cocoa-touch", "core-plot" ]
2,055,146
1
null
null
2
555
I want to make a iPhone application which can switch screens by touch and drag, follow below picture: ![](https://farm3.static.flickr.com/2692/4270465093_a9b9172251.jpg) Please guide for me!
[iPhone]How to switch screens by touch and drag?
CC BY-SA 2.5
null
2010-01-13T07:39:14.517
2010-01-13T07:48:19.737
2017-02-08T14:19:33.160
-1
240,622
[ "iphone", "touch" ]
2,055,802
1
null
null
2
690
I wish to give an effect to images, where the resultant image would appear as if it is painted on a rough cemented background, and the cemented background customizes itself near the edges to highlight them... Please help me in writing an algorithm to generate such an effect. The first image is the original image ![alt text](https://lh3.ggpht.com/_-nAnDpDziYY/S02ZjGkdnoI/AAAAAAAABc0/H2ODzgug1gc/Input.png) and the second image is the output im looking for. ![alt text](https://lh6.ggpht.com/_-nAnDpDziYY/S02ZjTizcgI/AAAAAAAABc4/YFq4XZEkKkI/Output.png) please note the edges are detected and the mask changes near the edges to indicate the edges clearly
Cement Effect - Artistic Effect
CC BY-SA 2.5
0
2010-01-13T10:02:53.883
2010-01-13T16:20:24.183
2020-06-20T09:12:55.060
-1
246,307
[ "c++", "c", "algorithm", "graphics", "image-processing" ]
2,057,208
1
null
null
0
1,733
I Have two databases generated from the same SQL code and two datasets created from this databases. I want to create one dataset from these two datasets, and i thought i could do this like this: ``` public void MergeGatunek() { DB1.DataSetGatunek.Tables[0].Merge(DB2.DataSetGatunek.Tables[0], true); DataSetGatunek.Tables[0].Merge(DB1.DataSetGatunek.Tables[0], true); //DataSetGatunek is the final DataSet } ``` and this is the result: ![](https://i.stack.imgur.com/xhM1R.jpg) App is in Polish but it shouldnt be a problem. Every next new row just multiplies the results of previous adds. My goal is to show data from two databases in one DataGridView, and to add missing rows(if there are any). I'm using this method for filling dataset, adding new rows etc. ``` public void SelectGatunek(string SQL) { try { Connection.Open(); DataAdapter = new SqlDataAdapter(SQL, Connection); commandBuilder = new SqlCommandBuilder(DataAdapter); DataSetGatunek.Clear(); DataAdapter.Fill(DataSetGatunek); Connection.Close(); } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.Message); } } SelectGatunek("Select * FROM t_gatunek"); SelectGatunek("INSERT INTO t_gatunek (gatunek) VALUES ('" + DG.GetGatunek + "')"); ```
How to merge DataTable without copies?
CC BY-SA 3.0
null
2010-01-13T14:16:03.060
2015-06-21T02:34:30.707
2015-06-21T02:34:30.707
5,032,383
249,864
[ "c#", "datagridview", "datatable", "dataset" ]
2,057,998
1
null
null
0
853
Well I'm creating an iPhone application which contains some features like Cycle routes and a Photoviewer. For these Cycle routes im useing the Cloudmade api, and for the PhotoViewer im useing Three20's TTPhotoviewcontroller. These Cycle routes map works perfect but i think it has todo something with the errors im getting. I will describe 2 cases down here about what I tried and what problem I received. Compiling goes wrong and receiving following error: ``` duplicate symbol _aatan2 in /Users/wesleycoppens/Documents/MooiWest/libs/Proj4/Device/libProj4.a(aasincos.o) and /Users/wesleycoppens/Documents/MooiWest/libs/route-me/Device/libMapView.a(aasincos.o) Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1 ``` I am getting this error when i am trying to add to the Other linker flags the flag -all_load. See the image below here how my Other linker flags currently look like. see [link](https://i.stack.imgur.com/sUTlk.png) for image: [](https://i.stack.imgur.com/sUTlk.png) Compiling goes fine, app runs in simulator perfectly but receiving SIGABRT with device. In this case I removed the flag -all_load in my Other linker flags. Now I am not receiving any compiling error, but I'm receiving a SIGABRT when tapping the tablerow which links to the photoviewer app. I aint sure if I do link correctly to the Photoviewer to, so here is the part where I push the other photoview. ``` PhotoTest2Controller *photoViewController = [[PhotoTest2Controller alloc] init]; [self.navigationController pushViewController:photoViewController animated:YES]; [photoViewController release]; ``` Also here another screenshot of the linker flags how they are defined in this case: see [link](https://i.stack.imgur.com/unaYc.png) for image: ![http://i47.tinypic.com/vhuv0z.png](https://i.stack.imgur.com/unaYc.png)
Receiving SIGABRT error when launching TTPhotoviewController in iPhone
CC BY-SA 4.0
null
2010-01-13T15:49:44.990
2019-06-01T19:04:46.510
2019-06-01T19:04:46.510
4,751,173
249,946
[ "c", "xcode", "three20", "cloudmade", "sigabrt" ]
2,058,599
1
2,105,371
null
11
7,559
I am attempting to modify the standard Swing JTree to intermingle nodes with and without checkboxes. This is an example: ![alt text](https://imgur.com/zkhGi.png) When I attempt to check/uncheck one of the checkboxes (the 'User 01' node in this example), the tree loses nodes: ![alt text](https://imgur.com/IjZOl.png) I my code is an adaptation of this example: [http://forums.sun.com/thread.jspa?threadID=5321084&start=13](http://forums.sun.com/thread.jspa?threadID=5321084&start=13). Instead of embedding a JCheckBox in a DefaultMutableTreeNode like this: ``` new DefaultMutableTreeNode(new CheckBoxNode("Accessibility", true)); ``` I thought it made more sense to create a model node that derived from the DefaultMutableTreeNode, which I call JTreeNode. This class automatically sets the DefaultMutableTreeNode's UserObject to a JCheckBox. The class' ShowCheckBox property is used by the TreeCellRenderer to determine if the JCheckBox or DefaultTreeCellRenderer is used. The JTreeNode is used like this: ``` JTreeNode user01 = new JTreeNode("User 01"); user01.setShowCheckBox(true); user01.setSelected(true); ``` I believe the problem is with the class that implements the TreeCellEditor, specifically in the getCellEditorValue() or getTreeCellEditorComponent() methods. I suspect the issue has something to with the getCellEditorValue() returning a derivative of the DefaultMutableTreeNode, rather than a simpler model instance. ``` public Object getCellEditorValue() { JCheckBox checkBox = renderer.getCheckBoxRenderer(); JTreeNode node = new JTreeNode(checkBox.getText()); node.setShowCheckBox(true); node.setSelected(checkBox.isSelected()); return node; } public Component getTreeCellEditorComponent(JTree tree, Object value, boolean isSelected, boolean expanded, boolean leaf, int row) { Component editor = renderer.getTreeCellRendererComponent(tree, value, true, expanded, leaf, row, true); // editor always selected / focused ItemListener itemListener = new ItemListener() { public void itemStateChanged(ItemEvent itemEvent) { if (stopCellEditing()) { fireEditingStopped(); } } }; if (editor instanceof JCheckBox) { ((JCheckBox) editor).addItemListener(itemListener); } return editor; } ``` Here is the TreeCellRender's getTreeCellRendererComponent() method: ``` public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { Component component; //if object being passed for rendering is a JTreeNode that should show a JCheckBox, attempt to render it so if (((JTreeNode) value).getShowCheckBox()) { String stringValue = tree.convertValueToText(value, selected, expanded, leaf, row, false); //set default JCheckBox rendering checkBoxRenderer.setText(stringValue); checkBoxRenderer.setSelected(false); //not checked checkBoxRenderer.setEnabled(tree.isEnabled()); if (selected) { //removed colorization //checkBoxRenderer.setForeground(selectionForeground); //checkBoxRenderer.setBackground(selectionBackground); } else { checkBoxRenderer.setForeground(textForeground); checkBoxRenderer.setBackground(textBackground); } //DefaultMutableTreeNode if ((value != null) && (value instanceof JTreeNode)) { //userObject should be a JTreeNode instance //DefaultMutableTreeNode //Object userObject = ((JTreeNode) value).getUserObject(); //if it is //if (userObject instanceof JTreeNode) { //cast as a JTreeNode //JTreeNode node = (JTreeNode) userObject; JTreeNode node = (JTreeNode) value; //set JCheckBox settings to match JTreeNode's settings checkBoxRenderer.setText(node.getText()); checkBoxRenderer.setSelected(node.isSelected()); //} } component = checkBoxRenderer; } //if not, render the default else { component = defaultRenderer.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); } return component; } ``` Any thoughts are greatly appreciated.
JTree rendering with JCheckBox nodes
CC BY-SA 3.0
0
2010-01-13T16:58:31.797
2015-10-05T13:47:24.383
2011-12-15T00:40:56.913
606,664
134,367
[ "java", "swing", "rendering", "jtree", "jcheckbox" ]
2,061,942
1
2,062,098
null
9
14,901
I created this to simply explain my problem. It is of some list items being displayed as inline blocks. I had an original method that didn't work either, so I used this [CSS](https://stackoverflow.com/questions/628407/hidden-features-of-css/1973313#1973313). [http://jsbin.com/upexu/edit](http://jsbin.com/upexu/edit) This works great in FF and IE7, as a standalone. Unfortunately, in my implementation on my site, it doesn't display correctly in IE7 (they appear stacked one above the other). ## Firefox ![firefox](https://i.stack.imgur.com/A16YF.png) ## IE7 ![ie7](https://i.stack.imgur.com/7WsNg.png) Now can anyone tell me why they don't work in my example (see images above and look at site, it is in the far right (can't miss it). It seems to work in IE7 if I give the list items an explicit width - but this seems dangerous, as well as an extra piece of maintenance I don't want to do. I could probably do `li#nsw { width: 3.5em }` but is ugly and I have to. I do use [Eric Meyer's CSS Reset Reloaded](http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/). If you know of a solution, please tell! Thanks. ## Update Here is the HTML of the checkboxes ``` <ul class="checkboxes"> <li><input type="radio" id="free-case-review-nsw" value="nsw" name="state" /><label for="free-case-review-nsw"><acronym title="New South Wales">NSW</acronym></label></li> <li><input type="radio" checked="checked" id="free-case-review-qld" value="qld" name="state" /><label for="free-case-review-qld"><acronym title="Queensland">QLD</acronym></label></li> <li><input type="radio" id="free-case-review-nt" value="nt" name="state" /><label for="free-case-review-nt"><acronym title="Northern Territory">NT</acronym></label></li> <li><input type="radio" id="free-case-review-other" value="other" name="state" /><label for="free-case-review-other">Other</label></li> </ul> ``` And here is the CSS ``` #free-case-review-form .checkboxes { border: 1px solid #000; padding: 5px 0; margin-bottom: 8px; overflow: hidden; } #free-case-review-form .checkboxes li { display: inline-block; display: -moz-inline-box; *display: inline; /* for ie */ zoom: 1; overflow: hidden; } #free-case-review-form .checkboxes li input { display: inline; width: auto; border: none; margin-bottom: 0; padding: 0; float: left; } #free-case-review-form .checkboxes li label { display: inline; /* just an attempt - they should be block level anyway */ float: right; } ``` Though I do recommend looking at the site above, as a lot more CSS is inherited, especially by using the style reset.
CSS display: inline-block doesn't work in IE7
CC BY-SA 4.0
null
2010-01-14T03:15:23.800
2019-06-02T10:11:18.233
2019-06-02T10:11:18.233
4,751,173
31,671
[ "css", "firefox", "internet-explorer-7" ]
2,061,970
1
2,062,270
null
3
1,491
I have a relatively complex layout that I'd like to be the "row" of a ListView in Android and I'm having trouble getting the right-most element to show up on each row. Here's what the row look like: There's an icon (50dip x 50dip) on the left and an icon (9 x 13) on the right. The icons should be left and right justified, respectively with variable text in the middle. Problem is that my right-most icon (9 x 13) is pushed off of the visible area using my current XML layout and my attempted fixes have all failed. Suggestions?? ![alt text][1] [1]: ![Hosted by imgur.com](https://imgur.com/3bNqs.png) ``` <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:padding="5dip"> <LinearLayout android:orientation="horizontal" android:gravity="center" android:layout_width="fill_parent" android:layout_height="60dip"> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:minHeight="55dip" android:padding="5dip" android:layout_height="fill_parent"> <ImageView android:id="@+id/img" android:layout_width="50dip" android:layout_height="50dip" android:layout_marginRight="6dip" /> <TextView android:ellipsize="end" android:textColor="#454545" android:id="@+id/ttt" android:textSize="18sp" android:gravity="center_vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> <ImageView android:layout_height="13dip" android:minWidth="9dip" android:layout_width="fill_parent" android:id="@+id/disclosure" /> </LinearLayout> </LinearLayout> ```
Android -- Help with XML of a "complex" row in a ListView
CC BY-SA 2.5
null
2010-01-14T03:25:33.530
2010-01-14T05:01:50.577
null
null
141,146
[ "xml", "android", "listview" ]
2,062,762
1
2,062,778
null
1
153
How to make a zone where user can tap to do a specify action)? same below picture: ![alt text](https://farm5.static.flickr.com/4041/4272993673_b38a4ab960.jpg) Please help me!
How to make a zone where user can tap to do a specify action)?
CC BY-SA 2.5
null
2010-01-14T07:34:47.187
2010-01-14T07:43:42.527
2017-02-08T14:19:36.187
-1
240,622
[ "iphone", "cocoa-touch", "touch" ]
2,062,761
1
null
null
5
11,799
I have tried to connect to SQL Server 2000 through TCP/IP. I followed [these steps](http://ww2.recruitmentsystems.com.au/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=32) and enabled SQL Server 2000 on port 1433. Then I used the command to test whether the port is opened up: ``` telnet localhost 1433 ``` But I found the following error: ``` Connecting To localhost...Could not open connection to the host, on port 1433: Connect failed ``` And I also failed to connect to the server by following [these steps](http://aquesthosting.com/SQL2000RemoteConnection). How to solve this problem and connect to Sql Server 2000 through TCP/IP? See my configs ![alt text](https://farm5.static.flickr.com/4041/4273931322_75c8b4d9cb_o_d.jpg) ![alt text](https://farm3.static.flickr.com/2786/4273931324_bda32a5836_o_d.jpg)
Connecting to SQL Server 2000 through TCP/IP on localhost failed
CC BY-SA 2.5
null
2010-01-14T07:34:44.363
2020-01-09T06:33:17.380
2017-02-08T14:19:35.850
-1
159,072
[ "sql-server", "sql-server-2000", "tcp" ]
2,063,484
1
2,063,555
null
4
5,755
To customize cell, we implement class inherit UITableViewCell. Now, to customize header of Section in grouped UITableView (same to below picture), how to do? Please guide to me! ![alt text](https://farm5.static.flickr.com/4007/4273969640_8c59907977.jpg)
[iPhone]How to customize header of Section in grouped TableView?
CC BY-SA 2.5
0
2010-01-14T10:39:34.977
2012-12-01T21:32:42.313
2017-02-08T14:19:36.880
-1
240,622
[ "iphone", "uitableview", "grouped-table" ]
2,064,799
1
2,065,271
null
3
958
I have an ASP.NET web application, which operates just fine on IE7, IE8, IE8(Compatibility mode) and on Firefox, however, we have now some users on IE6 (and no they aren't going to change any time soon)... When displaying the buttons on IE6, they don't render correctly, and the onclick events don't fire. There isn't any detection taking place to determine the browser at present. Should I need to change what the page is doing to support IE6 ? These are the non working buttons ![alt text](https://dl.dropbox.com/u/2765900/BadButtons.JPG) These are the working buttons ![alt text](https://dl.dropbox.com/u/2765900/GoodButtons.JPG) Example of one of the Buttons definitions: ``` <asp:Button ID="Button1" SkinID="formbutton" runat="server" Text="Cancel" OnClick="Button2_Click" CausesValidation="False" ToolTip="Cancels any changes"/> ``` Any thoughts would be gratefully received. Cheers Edit 1: Before Rendering, the code is : ``` <input type="button" name="ctl00$ContentPlaceHolder1$btnSaveInProgress" value="Save as In Progress" onclick="clickOnce(this, 'Cargando...');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$btnSaveInProgress&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))" id="ctl00_ContentPlaceHolder1_btnSaveInProgress" title="Saves this commission as 'In Progress'" style="color:White;background-color:#547ED8;border-style:Double;padding:3px;" /> ``` After rendering, it is this: ``` <INPUT class=rfdDecorated id=ctl00_ContentPlaceHolder1_btnSaveInProgress title="Saves this commission as 'In Progress'" style="PADDING-RIGHT: 3px; PADDING-LEFT: 3px; PADDING-BOTTOM: 3px; COLOR: white; BORDER-TOP-STYLE: double; PADDING-TOP: 3px; BORDER-RIGHT-STYLE: double; BORDER-LEFT-STYLE: double; BACKGROUND-COLOR: #547ed8; BORDER-BOTTOM-STYLE: double" onclick="clickOnce(this, 'Cargando...');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(&quot;ctl00$ContentPlaceHolder1$btnSaveInProgress&quot;, &quot;&quot;, true, &quot;&quot;, &quot;&quot;, false, true))" type=button value="Save as In Progress" name=ctl00$ContentPlaceHolder1$btnSaveInProgress> ``` Probably worth mentioning that it is also using the Telerik AjaxManager on the page, though I don't know if this is relevant.
An ASP Button problem on IE6
CC BY-SA 2.5
null
2010-01-14T14:35:14.810
2010-01-15T07:44:40.753
2017-02-08T14:19:38.250
-1
79,055
[ "asp.net", "internet-explorer-6", "button", "telerik" ]
2,065,709
1
null
null
0
895
I have a very simple example of an html that calls a jsp page that returns a very simple JSON object. My problem is that what I expect the screen to show is not being displayed. Here is a screen shot of what I see. ![screenshot](https://i.stack.imgur.com/dqLiT.jpg) [screen shot link](http://www.flickr.com/photos/sky_dive_bound/4274347238/sizes/l/) Here is the relevent parts of the HTML file. ```<script type="text/javascript" src="resources/dojo/dojo.js" djConfig="isDebug:false,parseOnLoad:true"></script> <script> dojo.require("dojo.data.ItemFileReadStore"); dojo.require("dojox.grid.DataGrid"); dojo.require("dojo.parser"); dojo.require("dijit.form.TextBox"); dojo.require("dijit.layout.ContentPane"); dojo.require("dojox.data.StoreExplorer"); var jsonStore; dojo.xhrGet({ url: "json.jsp", handleAs: "json", //handleAs: "text", load: populateDiv, error: function(type, data, evt){alert("error");} }); function populateDiv(dataItems) { console.log(dataItems); jsonStore = new dojo.data.ItemFileReadStore(dataItems); } </script> <div id="strexplr" dojoType="dojox.data.StoreExplorer" store="jsonStore" style="height:500px;width:100%;border:1px solid black"/>``` Here is my JSP page. (forgive the formatting) `<%@ page language="java" contentType="application/json; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %>``<json:object> <json:property name="identifier" value="customer_name"></json:property> <json:property name="label" value="customer_address"></json:property> <json:array name="items" var="item" items="2"> <json:object> <json:property name="customer_name" value="nancy"></json:property> <json:property name="customer_address" value="LA"></json:property> </json:object> <json:object> <json:property name="customer_name" value="ken"></json:property> <json:property name="customer_address" value="CA"></json:property> </json:object> </json:array> </json:object>``` Using the Firefox Plugin for JSON objects, I was able to determine I had a valid JSON object. Here is the output from the JSP page using that plugin. ``` { identifier: "customer_name" label: "customer_address" items: [ { customer_name: "nancy" customer_address: "LA" } { customer_name: "ken" customer_address: "CA" } ] } ```
DOJO StoreExplorer not displaying correctly
CC BY-SA 3.0
null
2010-01-14T16:33:17.957
2011-12-01T08:15:36.317
2011-12-01T08:15:36.317
234,976
4,811,030
[ "json", "dojo" ]
2,065,984
1
2,066,050
null
1
2,007
The task is to have SQL Server read an Excel spreadsheet, and import only the new entries into a table. The entity is called . Consider an Excel spreadsheet like this: ![alt text](https://i.imgur.com/tYHcU.png) Its target table is like this: ![alt text](https://i.imgur.com/E9sPp.png) The task is to: - - - - - How can I use the SQL 2008 toolset (Import and Export wizard likely) to achieve this goal? I suspect I'll need to "Write a query to specify the data to transfer". Problem being is that I cannot find the query as the tool would be generating to make fine adjustments. ![alt text](https://i.imgur.com/6zMsW.png)
SQL Server: importing from Excel, only want the new entries
CC BY-SA 2.5
null
2010-01-14T17:08:39.660
2010-03-15T19:10:45.050
null
null
23,199
[ "sql-server", "dts", "import-from-excel" ]
2,066,279
1
2,066,360
null
8
4,632
I am profiling my twisted server. It uses much more memory than I expected. Its memory usage grows over time. ``` ps -o pid,rss,vsz,sz,size,command PID RSS VSZ SZ SZ COMMAND 7697 70856 102176 25544 88320 twistd -y broadcast.tac ``` As you can see it costs , namely, . And I use guppy from a twisted manhole to watch the memory usage profile. ``` >>> hp.heap() Partition of a set of 120537 objects. Total size = 10096636 bytes. Index Count % Size % Cumulative % Kind (class / dict of class) 0 61145 51 5309736 53 5309736 53 str 1 27139 23 1031596 10 6341332 63 tuple 2 2138 2 541328 5 6882660 68 dict (no owner) 3 7190 6 488920 5 7371580 73 types.CodeType 4 325 0 436264 4 7807844 77 dict of module 5 7272 6 407232 4 8215076 81 function 6 574 0 305776 3 8520852 84 dict of class 7 605 1 263432 3 8784284 87 type 8 602 0 237200 2 9021484 89 dict of type 9 303 0 157560 2 9179044 91 dict of zope.interface.interface.Method <384 more rows. Type e.g. '_.more' to view.> ``` Hum... It seems there is something wrong. Guppy shows that the total usage of memory is 10096636 bytes, namely or . That's a huge difference. What's wrong this strange result? What am I doing wrong? I wrote a monitor script last night. It records the memory usage and number of on-line users. It is a radio server, so you can see there is radios and total listeners. Here is the figure I generated by matplotlib. ![alt text](https://web.archive.org/web/20190515063235/http://static.ez2learn.com/temp/mem_figure.svg) Something is strange. Sometimes the memory usage printed by ps is very low, like this ``` 2010-01-15 00:46:05,139 INFO 4 4 17904 36732 9183 25944 2010-01-15 00:47:03,967 INFO 4 4 17916 36732 9183 25944 2010-01-15 00:48:04,373 INFO 4 4 17916 36732 9183 25944 2010-01-15 00:49:04,379 INFO 4 4 17916 36732 9183 25944 2010-01-15 00:50:02,989 INFO 4 4 3700 5256 1314 2260 ``` What is the reason of the super low value of memory usage? And what's more, even there is no on-line radios, no listeners, the memory usage is still high.
The memory usage reported by guppy differ from ps command
CC BY-SA 4.0
0
2010-01-14T17:54:07.543
2019-05-15T06:32:51.347
2019-05-15T06:32:51.347
4,751,173
25,077
[ "python", "memory-management", "twisted", "guppy" ]
2,066,402
1
2,084,315
null
0
567
I'm working on a Firefox extension that creates a toolbar in the browser. I'm using a with type="menu" to create a menu that pops up when the button is clicked. By default, setting `type="menu"` creates a little menu indicator triangle, like in this image: ![example button](https://i.imgur.com/bu7EF.png) Is there any way, either in XUL or in the CSS, to get rid of this indicator triangle?
How to remove drop down menu indicator on a button in a XUL Firefox extension?
CC BY-SA 3.0
null
2010-01-14T18:13:03.747
2017-04-27T06:57:51.390
2017-04-27T06:57:51.390
4,927,984
85,688
[ "css", "firefox", "firefox-addon", "xul" ]
2,067,070
1
2,067,263
null
3
3,078
I am trying to learn how to use the Silverlight 3 control, because I need to define the DataForm fields myself in the XAML code, that is, I don't want to use the AutoGenerateFields property. My problem is: the dataform works perfectly when the AutoGenerateFields is set to true, but when I create a DataForm and set the fields manually and run the application, all I get is an empty blank rectangle where my form and its fields should be. I created a blank Silverligh Navigation Application to test this, and below is the code of the Home.xaml page: ```<Grid x:Name="LayoutRoot"> <StackPanel> <!-- This doesn't work. It renders a blank rectangle --> <dataFormToolkit:DataForm x:Name="DataForm"> <dataFormToolkit:DataForm.EditTemplate> <DataTemplate> <StackPanel dataFormToolkit:DataField.IsFieldGroup="True"> <dataFormToolkit:DataField> <TextBox Text="Test1" /> </dataFormToolkit:DataField> <dataFormToolkit:DataField> <TextBox Text="Test2" /> </dataFormToolkit:DataField> <dataFormToolkit:DataField> <TextBox Text="Test3" /> </dataFormToolkit:DataField> </StackPanel> </DataTemplate> </dataFormToolkit:DataForm.EditTemplate> </dataFormToolkit:DataForm> <!-- This works. --> <dataFormToolkit:DataForm x:Name="DataForm2"/> </StackPanel> </Grid>``` To make the second DataForm work, I simply created a Person class, and put the following in : ``` protected override void OnNavigatedTo(NavigationEventArgs e) { Person client = new Person { Age = 10, DateOfBirth = new DateTime(1980, 10, 20), FirstName = "John", LastName = "Doe" }; DataForm2.CurrentItem = client; } ``` You can see what happens when I run the application: ![screenshot](https://i.stack.imgur.com/dxfr9.png) Does anyone know what's wrong? Thank you in advance.
Dataform fields won't appear
CC BY-SA 3.0
null
2010-01-14T19:46:20.907
2012-07-29T12:49:22.003
2012-07-13T22:11:41.273
100,297
148,588
[ "silverlight", "silverlight-3.0", "dataform" ]
2,067,501
1
2,068,219
null
0
321
I have a legacy PHP form that I'm moving over to Drupal 6. I'm trying to make things easy for me as well as the future admins of the site. The below form is the heart of the old site data. So far in cck I have Locations, in taxonomy I have Countries, now I just need to allow these Species data to be added. I would do it in CCK, but I also want to be able to add N number of Species to each form with all 12 Quadrats of % Cover and Density. (For each species in that location there is % Cover, Density, Flower, Fruit, etc ie alot of data!) Basically my question is, can this form be accomplished in 1) CCK where the whole form can be filled out on one page, 2) by creating a custom CCK field to enter in a Species (using FormAPI) or 3) bite the bullet and write a custom module with FormAPI fields and keep track of the data in tables myself? Thanks for your insight. ![PHP form](https://farm5.static.flickr.com/4049/4275080232_e5a19afdac_o.png)
Drupal: module, cck or other
CC BY-SA 2.5
null
2010-01-14T20:58:18.670
2018-08-22T23:31:27.007
2018-08-22T23:31:27.007
8,366,499
124,524
[ "drupal", "module", "drupal-6", "cck", "form-api" ]
2,067,669
1
2,067,860
null
8
2,338
I'm using a record node in graphviz to make a simple table, but it looks wrong: ``` digraph g { node [shape = record,height=.08]; node1[label = "{DBAT|{ 0|1|2|3|4|5|6|7}|{8|9|10|11|12|13|14|15}|...|{248|249|250|251|252|253|254|255}}"]; } ``` ![alt text](https://farm3.static.flickr.com/2564/4274398225_57481fc52c_o.jpg) Is there any way to get the subrecords to line up?
how to get graphviz records to have cells that line up
CC BY-SA 2.5
null
2010-01-14T21:24:01.410
2022-06-03T07:43:31.463
2017-02-08T14:19:38.923
-1
44,330
[ "graphviz" ]
2,068,013
1
2,072,944
null
14
50,708
I'm trying to use OpenCV to "parse" screenshots from the iPhone game [Blocked](http://itunes.apple.com/us/app/blocked/id289903775?mt=8). The screenshots are cropped to look like this: ![Blocked screenshot](https://imgur.com/28Tv6.png) I suppose for right now I'm just trying to find the coordinates of each of the 4 points that make up each rectangle. I did see the sample file squares.c that comes with OpenCV, but when I run that algorithm on this picture, it comes up with 72 rectangles, including the rectangular areas of whitespace that I obviously don't want to count as one of my rectangles. What is a better way to approach this? I tried doing some Google research, but for all of the search results, there is very little relevant usable information.
Finding location of rectangles in an image with OpenCV
CC BY-SA 2.5
0
2010-01-14T22:26:35.873
2019-10-03T01:48:07.940
2010-01-15T12:00:38.040
13,565
42,891
[ "image-processing", "opencv", "computer-vision" ]
2,068,134
1
2,085,510
null
8
5,416
I'm making a software rasterizer, and I've run into a bit of a snag: I can't seem to get perspective-correct texture mapping to work. My algorithm is to first sort the coordinates to plot by `y`. This returns a highest, lowest and center point. I then walk across the scanlines using the delta's: ``` // ordering by y is put here order[0] = &a_Triangle.p[v_order[0]]; order[1] = &a_Triangle.p[v_order[1]]; order[2] = &a_Triangle.p[v_order[2]]; float height1, height2, height3; height1 = (float)((int)(order[2]->y + 1) - (int)(order[0]->y)); height2 = (float)((int)(order[1]->y + 1) - (int)(order[0]->y)); height3 = (float)((int)(order[2]->y + 1) - (int)(order[1]->y)); // x float x_start, x_end; float x[3]; float x_delta[3]; x_delta[0] = (order[2]->x - order[0]->x) / height1; x_delta[1] = (order[1]->x - order[0]->x) / height2; x_delta[2] = (order[2]->x - order[1]->x) / height3; x[0] = order[0]->x; x[1] = order[0]->x; x[2] = order[1]->x; ``` And then we render from `order[0]->y` to `order[2]->y`, increasing the `x_start` and `x_end` by a delta. When rendering the top part, the delta's are `x_delta[0]` and `x_delta[1]`. When rendering the bottom part, the delta's are `x_delta[0]` and `x_delta[2]`. Then we linearly interpolate between x_start and x_end on our scanline. UV coordinates are interpolated in the same way, ordered by y, starting at begin and end, to which delta's are applied each step. This works fine except when I try to do perspective correct UV mapping. The basic algorithm is to take `UV/z` and `1/z` for each vertex and interpolate between them. For each pixel, the UV coordinate becomes `UV_current * z_current`. However, this is the result: ![alt text](https://imgur.com/woOqP.png) The inversed part tells you where the delta's are flipped. As you can see, the two triangles both seem to be going towards different points in the horizon. Here's what I use to calculate the Z at a point in space: ``` float GetZToPoint(Vec3 a_Point) { Vec3 projected = m_Rotation * (a_Point - m_Position); // #define FOV_ANGLE 60.f // static const float FOCAL_LENGTH = 1 / tanf(_RadToDeg(FOV_ANGLE) / 2); // static const float DEPTH = HALFHEIGHT * FOCAL_LENGTH; float zcamera = DEPTH / projected.z; return zcamera; } ``` Am I right, is it a z buffer issue?
Perspective correct texture mapping; z distance calculation might be wrong
CC BY-SA 3.0
0
2010-01-14T22:51:59.020
2014-05-15T19:13:02.357
2014-05-15T19:13:02.357
321,731
141,057
[ "c++", "rasterizing", "zbuffer" ]
2,069,114
1
2,073,310
null
1
844
I am doing some stuff with GIS(or map), and I know how to calculate Y position from latitude in mercator projection. But I don't know how it comes? ![alt text](https://upload.wikimedia.org/math/d/1/c/d1cb0a4e6851fac55f6a95c20bfeed87.png) Why it is ln(tan(x)+sec(x)) ? I couldn't figure out why there is a 'ln'? I know it is not directly related to programming, but I hope some one could help me understanding about this (better with some pictures to illustrate)
GIS, Mercator projection, calculate Y position
CC BY-SA 2.5
0
2010-01-15T02:43:20.687
2010-01-15T16:54:41.063
2017-02-08T14:19:39.990
-1
115,781
[ "google-maps", "dictionary", "gis", "projection" ]
2,069,153
1
2,069,176
null
0
526
In wikispaces, they use one of two HTML elements as buttons in a wikispace. Here they are... ``` <button name="lock" type="submit" class="btn"><span><span>Lock Topic</span></span></button> ``` ``` <a onclick="jQuery(this).parents('form').submit();" class="btn"><span><span>Search Posts</span></span></a> <a class="btn primary" id="newPostTrigger" href="#"><span><span><img width="11" height="14" alt="New Post" src="http://www.wikispaces.com/i/icon_14_add.png"/> New Post</span></span></a> ``` As you can see in this photo below, I've cleaned up the buttons quite a bit with some CSS. ![alt text](https://wikispacetuts.s3.amazonaws.com/buttons.jpg) But with all those unnecessary `<span>`'s, I'm having to use a lot of CSS to deal with all of the default CSS that wikispaces inserts for the spans. `<span>` Thanks for your help!
How Can You Remove Unnecessary HTML elements with jQuery?
CC BY-SA 2.5
null
2010-01-15T02:53:46.197
2015-02-01T16:27:02.683
2015-02-01T16:27:02.683
3,204,551
245,246
[ "jquery", "html" ]
2,069,836
1
2,074,719
null
15
13,863
I'm having difficulties reading in a .shp (esri shape file) into R. I have tried several options in R, and tried to convert the shape file in ArcMap to something that correctly reads in the shape file but nothing worked yet. (In ArcMap I corrected the geometry, converted from single to multipolygon, etc which was probably not necessary or relevant) It probably has something to with the fact that my shape file contains 'regions' (multi-polygons) instead of 'polygons'... How can I read that type of shape file correctly in R for plotting? (it looks like a normal shape in ArcMap) In ArcMap the shape file looks like this: [http://bfast.r-forge.r-project.org/arcmapshape.jpg](http://bfast.r-forge.r-project.org/arcmapshape.jpg) (shows a shape file with polygons within other polygons) In R it looks like this: ![enter image description here](https://i.stack.imgur.com/jRwBp.jpg) (shows a shape file where some polygons are wrongly filled) I used the following code in R: ``` require(maptools) require(rgdal) newproj <- "+proj=utm +zone=55 +south +ellps=GRS80 +units=m" shape<- readShapeSpatial(pdir, proj4string = CRS(newproj),repair=TRUE,force_ring=T,verbose=TRUE) # without any errors plot(shape, col="gray",border="blue", axes=TRUE) # via rgdal folder <- c("spatial") lyr <- c("clipped_forest_mga") shp <- readOGR(dsn=folder,layer=lyr) plot(shp, col="gray",border="blue", axes=TRUE) ``` Both plot() commands give the same R result. No errors occur. only the following message ``` OGR data source with driver: ESRI Shapefile Source: "P:/Victoria_DSE/BFAST_spatial/vector/PLM_excl_fire03_09_GDA94LL/mgaz94z55/clipped_EG", layer: "clipped_forest_mga" with 1 features and 4 fields Feature type: wkbMultiPolygon with 2 dimensions ``` How can this be solved?
reading and plotting an esri shape file in R
CC BY-SA 3.0
0
2010-01-15T06:23:33.493
2019-11-20T21:45:28.250
2013-04-29T18:44:58.267
2,173,428
215,244
[ "r", "vector", "geospatial", "plot", "esri" ]
2,072,455
1
2,072,516
null
6
2,715
I'm using [HTML nodes](http://www.graphviz.org/doc/info/shapes.html#html) for graphviz [per my previous question](https://stackoverflow.com/questions/2067669/how-to-get-graphviz-records-to-have-cells-that-line-up/2067860#2067860). Why do I get the extra box around the outside, and how do I get rid of it? Also how do I make the figure smaller? ``` digraph g { node [shape = record,height=0.08]; node1[label = < <TABLE BORDER="0" CELLBORDER="1" CELLSPACING="0" CELLPADDING="4"> <TR> <TD ROWSPAN="3">hello<BR/>world</TD> <TD COLSPAN="3">b</TD> <TD ROWSPAN="3">g</TD> <TD ROWSPAN="3">h</TD> </TR> <TR> <TD>c</TD><TD PORT="here">d</TD><TD>e</TD> </TR> <TR> <TD COLSPAN="3">f</TD> </TR> </TABLE>>]; } ``` ![alt text](https://farm3.static.flickr.com/2775/4276761520_c7db5a6147_o.png)
graphviz: HTML nodes have extra box around it?
CC BY-SA 2.5
null
2010-01-15T15:01:35.490
2010-01-15T15:07:58.377
2017-05-23T11:53:27.663
-1
44,330
[ "graphviz" ]
2,074,450
1
2,074,504
null
0
1,827
Hopefully these diagrams explain what I'm after. The red signifying the background and the grey the webpage. ### Wrong ![Hosted by imgur.com](https://imgur.com/fROVb.png) ### Right ![Hosted by imgur.com](https://imgur.com/NQdxv.png) How do I achive this? I've tried `background-position: bottom right;` but it's just all wrong.
CSS: background-position: ???;
CC BY-SA 2.5
null
2010-01-15T20:08:14.263
2010-01-15T23:04:56.953
null
null
111,669
[ "css", "background-position" ]
2,074,860
1
2,075,286
null
2
1,807
Does anyone know of password strength meter component for delphi Win32? must be for a Win32 Form, not for Web. something like that (but for Win32) ![alt text](https://phiras.files.wordpress.com/2009/07/pms.png)
password strength meter component for delphi
CC BY-SA 2.5
0
2010-01-15T21:17:33.670
2010-01-15T22:52:42.490
2017-02-08T14:19:41.687
-1
91,299
[ "delphi", "components", "vcl", "password-checker" ]
2,075,544
1
2,076,104
null
1
1,251
HI all - I am using anchor points and control points to create a shape using curveTo. It's all working fine, but I cannot figure out how to get my lines to go through the center of the control points (blue dots) when the line is not straight. Here is my code for drawing the shape: ``` // clear old line and draw new / begin fill var g:Graphics = graphics; g.clear(); g.lineStyle(2, 0, 1); g.beginFill(0x0099FF,.1); //move to starting anchor point var startX:Number = anchorPoints[0].x; var startY:Number = anchorPoints[0].y; g.moveTo(startX, startY); // Connect the dots var numAnchors:Number = anchorPoints.length; for (var i:Number=1; i<numAnchors; i++) { // curve to next anchor through control g.curveTo(controlPoints[i].x,controlPoints[i].y, anchorPoints[i].x, anchorPoints[i].y); } // Close the loop g.curveTo(controlPoints[0].x,controlPoints[0].y,startX,startY); ``` And the shape I'm drawing for reference: ![](https://imgur.com/bW4Ca.png) How can I modify my code so that the lines go directly through the blue control points? Thanks in advance! b
How can I modify my code to line through the bezier control points?
CC BY-SA 2.5
0
2010-01-16T00:00:05.553
2019-06-03T07:04:25.467
null
null
46,445
[ "flash", "actionscript-3", "actionscript", "drawing", "bezier" ]
2,075,720
1
2,077,528
null
42
41,886
Is there any way to make a WPF app look like it's running on Windows 7 even if it's running on XP? I'm looking for some kind of theme I can just paste in. I'm aware of the themes project on Codeplex ([https://archive.codeplex.com/?p=wpfthemes](https://archive.codeplex.com/?p=wpfthemes)), but it lacks support for `DataGrid`, which is something I critically need. I was thinking maybe the Windows 7 theme would just be an easy port, or exists in some file somewhere already. --- Using @Lars Truijens idea, I was able to get the Windows 7 look for the major controls, but unfortunately it did not work for the WPF Toolkit `DataGrid` control, which I need. `DataGrid` ![Windows XP-look DataGrid](https://web.archive.org/web/20131221215623/http://img198.imageshack.us/img198/4446/xpdatagrid.jpg) `DataGrid` ![Windows 7-look DataGrid](https://i.stack.imgur.com/tb7Oo.jpg) So, I'm still looking for a solution to this problem if anyone has any ideas. Maybe someone has built an extension to the Aero theme that covers the WPF toolkit controls? Again, any information you have is much appreciated. --- To get the Aero theme to work with the DataGrid or any other WPF Toolkit controls, you just need to add a second Aero dictionary, so your App.xaml should now look like this. ``` <Application.Resources> ... <ResourceDictionary> <ResourceDictionary.MergedDictionaries> <ResourceDictionary Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" /> <ResourceDictionary Source="pack://application:,,,/WPFToolkit;component/Themes/Aero.NormalColor.xaml" /> ... </ResourceDictionary.MergedDictionaries> </ResourceDictionary> </Application.Resources> ``` Also, I would recommend turning the gridlines off in your `DataGrid` controls (because they look ): ``` <DataGrid GridLinesVisibility="None" ...> ```
Windows 7 theme for WPF?
CC BY-SA 4.0
0
2010-01-16T00:44:33.137
2020-03-21T19:01:12.180
2019-12-29T08:11:56.473
1,033,581
129,164
[ ".net", "wpf", "windows", "themes", "wpftoolkit" ]
2,077,013
1
2,077,584
null
2
1,111
I have a UINavigationController in which the root view doesn't display the top navigation bar via `[[self navigationController] setNavigationBarHidden:YES animated:NO];` The view I'm pushing onto this does need to display the navigation bar, and I'm currently using the above method to show it and then hide it again when the view is popped. This results in some weird going-ons, which I would like not to have going on. EDIT: To clarify, right now I'm using `[[self navigationController] setNavigationBarHidden:NO animated:NO];` in the pushed view, and what's happening is the navigationBar appears in both the outgoing view and the new one, and it looks pretty messy to have that flash happen. Here's what's currently happening: ![alt text](https://i.imgur.com/kTVIel.png) And What I'd like: ![alt text](https://i.imgur.com/ypCRf.png) Instead what I would like is for the navigation bar to already be showing while the view is being pushed, and not on the root view, much like the behaviour of the `hidesBottomBarWhenPushed` property. Can anyone point me in the right direction here?
topBar equivalent of hidesBottomBarWhenPushed?
CC BY-SA 2.5
null
2010-01-16T10:39:51.487
2010-01-17T15:29:45.773
2010-01-17T06:01:52.247
74,574
74,574
[ "iphone", "uinavigationcontroller", "uinavigationbar" ]
2,079,109
1
2,079,191
null
0
528
Why ul border is wider than table border? Why ul height isn't contain every li elements? Thanks you very much for your helps... ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/9b5eaa87-70e0-4e7a-9a28-9a01556be216/2010-01-17_0019.png) ``` ul { font-family: Verdana; font-size: 8pt; } ul a { text-decoration: none; color: Black; } ul a:hover { text-decoration: underline; } table { background-color: Transparent; border-collapse: collapse; } table tr td { vertical-align: top; text-align: left; font: Verdana, Geneva, sans-serif; font-size: 12px; } #tblYayinAkisi { border:1px white solid; background-color: #222222; font-family: Verdana; color: #ffffff; vertical-align: middle; font-size: 10pt; width:100%; } #tblYayinAkisi th { background-color: Transparent; background-image: url(../images/bckSiyahGriTram.png); background-repeat: repeat-x; height: 20px; padding-left: 10px; } #tblYayinAkisi td { background-color: #222222; } #tblYayinAkisi td ul { border:1px white solid; width:100%; margin-left: 10px; } #tblYayinAkisi td ul li { clear:both; padding-top: 7px; list-style: none; } #tblYayinAkisi td ul li b { margin-right: 10px; float: left; } #tblYayinAkisi td ul li a { color: #ffffff; float: left; } ``` Full code: ``` <html> <head> <style> body { background-color: Red; } ul { font-family: Verdana; font-size: 8pt; } ul a { text-decoration: none; color: Black; } ul a:hover { text-decoration: underline; } table { background-color: Transparent; border-collapse: collapse; } table tr td { vertical-align: top; text-align: left; font: Verdana, Geneva, sans-serif; font-size: 12px; } #tblYayinAkisi { border: 1px white solid; background-color: #222222; font-family: Verdana; color: #ffffff; vertical-align: middle; font-size: 10pt; width: 100%; } #tblYayinAkisi th { background-color: Transparent; background-image: url(../images/bckSiyahGriTram.png); background-repeat: repeat-x; height: 20px; padding-left: 10px; } #tblYayinAkisi td { background-color: #222222; } #tblYayinAkisi td ul { border: 1px white solid; width: 100%; margin-left: 10px; } #tblYayinAkisi td ul li { clear: both; padding-top: 7px; list-style: none; } #tblYayinAkisi td ul li b { margin-right: 10px; float: left; } #tblYayinAkisi td ul li a { color: #ffffff; float: left; } </style> </head> <body> <table id="tblYayinAkisi"> <tbody> <tr> <th> YABAN'da bugün </th> </tr> <tr> <td> <ul> <li><b>00:00</b><a target="_blank" href="programlar.aspx?id=24">TROFE ODASI</a></li> <li><b>01:00</b><a target="_blank" href="programlar.aspx?id=17">YERLİ YABAN</a></li> <li><b>01:30</b><a target="_blank" href="programlar.aspx?id=16">HEDEF</a></li> <li><b>02:00</b><a target="_blank" href="programlar.aspx?id=28">İZCİ</a></li> <li><b>02:30</b><a target="_blank" href="programlar.aspx?id=4">KUŞLAR</a></li> </ul> </td> </tr> <tr> <td> <div style="text-align: center;"> <img src="images/canliYayin.png" /> <img src="images/tumAkis.png" /> </div> <br /> </td> </tr> </tbody> </table> </body> </html> ```
Why ul border is wider than table border?
CC BY-SA 2.5
0
2010-01-16T22:24:33.243
2010-01-16T22:50:07.630
2017-02-08T14:19:44.450
-1
104,085
[ "css" ]
2,079,342
1
null
null
1
335
I'm creating 3 tables. ``` <table id="first"> <tr> <td> 1. CAPTION </td> </tr> <tr> <td> <table id="second"> <tr> <td> 2. CAPTION </td> </tr> <tr> <td> <img src="" width="100" height="100" /> </td> </tr> </table> </td> </tr> <tr> <td> <table id="third"> <tr> <td> 3. CAPTION </td> </tr> <tr> <td> <img src="" width="100" height="100" /> </td> </tr> </table> </td> </tr> </table> ``` I want to add 10px padding (padding-top:10px) for the main table td elements. ``` #first tr td { padding-top: 10px; padding-left: 0pt; } ``` But this padding is adding to inner tables td elements. ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/62a489d9-dfd5-4870-a3fc-c56767114fa9/beforePadding.png) How can i prevent to pass padding-top setting to the inner tables?
How to prevent to pass css attributes to the inner elements?
CC BY-SA 2.5
null
2010-01-16T23:23:14.620
2010-01-17T06:23:38.383
2017-02-08T14:19:44.790
-1
104,085
[ "css" ]
2,079,518
1
2,079,530
null
1
4,246
UL element margins same but Firefox and IE showing different. ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/f122c0a0-0d40-441b-bc6c-b2abb2238792/2010-01-17_0232.png) ![alt text](https://content.screencast.com/users/uzay95/folders/Jing/media/ec47ecfc-6b6f-48dd-8cc4-3197ce2d28f6/2010-01-17_0226.png) FULL CODE: ``` <html> <head> <style> body { background-color: Red; } ul { font-family: Verdana; font-size: 8pt; } ul a { text-decoration: none; color: Black; } ul a:hover { text-decoration: underline; } table { background-color: Transparent; border-collapse: collapse; } table tr td { vertical-align: top; text-align: left; font: Verdana, Geneva, sans-serif; font-size: 12px; } #tblYayinAkisi { border: 1px white solid; background-color: #222222; font-family: Verdana; color: #ffffff; vertical-align: middle; font-size: 10pt; width: 100%; } #tblYayinAkisi th { background-color: Transparent; background-image: url(../images/bckSiyahGriTram.png); background-repeat: repeat-x; height: 20px; padding-left: 10px; } #tblYayinAkisi td { background-color: #222222; } #tblYayinAkisi td ul { border: 1px white solid; width: 100%; margin-left: 10px; } #tblYayinAkisi td ul li { clear: both; padding-top: 7px; list-style: none; } #tblYayinAkisi td ul li b { margin-right: 10px; float: left; } #tblYayinAkisi td ul li a { color: #ffffff; float: left; } </style> </head> <body> <table id="tblYayinAkisi"> <tbody> <tr> <th> YABAN'da bugün </th> </tr> <tr> <td> <ul> <li><b>00:00</b><a target="_blank" href="programlar.aspx?id=24">TROFE ODASI</a></li> <li><b>01:00</b><a target="_blank" href="programlar.aspx?id=17">YERLİ YABAN</a></li> <li><b>01:30</b><a target="_blank" href="programlar.aspx?id=16">HEDEF</a></li> <li><b>02:00</b><a target="_blank" href="programlar.aspx?id=28">İZCİ</a></li> <li><b>02:30</b><a target="_blank" href="programlar.aspx?id=4">KUŞLAR</a></li> </ul> </td> </tr> <tr> <td> <div style="text-align: center;"> <img src="images/canliYayin.png" /> <img src="images/tumAkis.png" /> </div> <br /> </td> </tr> </tbody> </table> </body> </html> ```
How to make same margins in the different browser? UL margins
CC BY-SA 2.5
null
2010-01-17T00:35:44.673
2010-01-17T10:59:39.137
2017-02-08T14:19:45.493
-1
104,085
[ "css" ]
2,079,828
1
2,079,840
null
8
3,733
![](https://lh6.ggpht.com/_Xb25fTcjIRQ/S1J-_KE7JGI/AAAAAAAAAIM/ikFmV-SBz2k/WTF.PNG) Oh as for the whole (LPCWSTR) casting thing: It wouldn't compile unless I put those in. It gave me this error message: > Error 1 error C2664: 'MessageBoxW' : cannot convert parameter 2 from 'const char [22]' to 'LPCWSTR'
Why does my simple C++ GUI application show a message box in Chinese?
CC BY-SA 3.0
null
2010-01-17T03:08:48.050
2015-12-29T17:13:31.433
2017-02-08T14:19:46.597
-1
126,196
[ "c++", "winapi" ]
2,080,443
1
2,080,533
null
6
4,886
After quite a few hours playing with rebase, the repo still looks different from what I need: I would like to accomplish the following tasks: [some of which were OK before I started messing with rebase :( ] - - - - - ![enter image description here](https://i.stack.imgur.com/zOpOs.jpg) I realize that this is asking a lot, but please include actual GIT commands. I don't mind reading and trying on my own, but am a bit confused by the results not matching what I would've expected, and I really don't want to accidentally destroy any commits.
How can I reorder/combine commits using Git rebase?
CC BY-SA 3.0
0
2010-01-17T08:43:07.550
2013-12-07T17:26:04.197
2011-08-29T23:31:16.270
600,500
87,520
[ "git", "rebase" ]
2,081,245
1
2,094,827
null
3
980
I have an xbap application which is basically a Windows Form hosted in a WPF control. When I run it with Firefox, I get toolbar, which I can't seem to remove. This toolbar does not appear with IE if I execute the xbap directly, but it does appear if I embed the xbap within an `iframe`. ![alt text](https://imgur.com/yODHN.png) Any ideas how to remove this?
Strange toolbar in Firefox-hosted xbap application
CC BY-SA 2.5
null
2010-01-17T14:16:16.593
2010-10-25T16:09:24.233
null
null
8,205
[ "firefox", "iframe", "embed", "xbap" ]
2,082,701
1
2,089,785
null
4
912
[Charlie Calvert](https://stackoverflow.com/users/253576/ccalvert) The MSDN Visual C# Developer Center has a section called . I found this through a Bing search. The code for [SelectMany - Compound from 1](http://msdn.microsoft.com/en-us/vcsharp/aa336758#SelectManyCompoundfrom1) is: ``` public void Linq14() { int[] numbersA = { 0, 2, 4, 5, 6, 8, 9 }; int[] numbersB = { 1, 3, 5, 7, 8 }; var pairs = from a in numbersA, b in numbersB where a < b select new {a, b}; Console.WriteLine("Pairs where a < b:"); foreach (var pair in pairs) { Console.WriteLine("{0} is less than {1}", pair.a, pair.b); } } ``` However, . I noticed that if I remove the comma at the end of `from a in numbersA,` and instead add `from` in front of `b in numbersB`, it will compile and work fine: ``` var pairs = from a in numbersA from b in numbersB where a < b select new {a, b}; ``` I'm not sure if this is a bug in MSDN's example or if possibly I'm running a version of C# and .NET that doesn't support this syntax. If I look at the breadcrumb at the top of the website, I see it says "Future Versions". Does this indicate that future versions of C#/.NET will support using a comma instead of `from` in LINQ syntax? ![](https://i474.photobucket.com/albums/rr103/ossavir/LINQ_sample_breadcrumb.png) I'm using Visual Studio 2008 Standard with .NET 3.5 SP1.
Is there a bug in this code from 101 LINQ Samples on MSDN? (Update: Fixed)
CC BY-SA 2.5
null
2010-01-17T21:20:59.753
2010-01-19T00:01:10.467
2017-05-23T12:33:39.247
-1
166,258
[ "c#", ".net", "linq", "msdn" ]
2,082,843
1
2,083,931
null
1
1,366
I just picked up Agile Web Development with Rails 3rd Ed., and I'm going thru the Depot Application chapters, I'm attempting to create a simple Edit quantity function, and delete function. I've had luck with the delete function but no luck with the edit quantity function. I'm going to provide a lot of information, so please don't feel overwhelmed. I've found this to be a challenging problem. ``` <div class="cart-title">Your cart</div> <table> <% for item in @cart.items %> <tr> <td><% form_for @cart.items, :url => {:action => "cart_update", :id => "#{item.getinventoryid}"} do |f| %> <%= f.text_field :quantity, :size => '3' %> <%= f.hidden_field :id, :value => "#{item.getinventoryid}" %> <%= f.submit 'cart_update' %> <% end %></td> <td><%=h item.quantity %> &times;</td> <td><%=h item.title %></li></td> <td><%=h item.description %></td> <td class="item-price"><%= number_to_currency(item.price) %></td> <td><%= link_to 'remove', {:controller => 'inventories', :action => 'remove_cart_item', :id => "#{item.getinventoryid}"} %></td> </tr> <% end %> <tr class="total-line"> <td colspan="4">Total</td> <td class="total-cell"><%= number_to_currency(@cart.total_price) %></td> </tr> </table> <%= button_to "Checkout", :action => 'checkout' %> <%= button_to 'Empty cart', :action => 'empty_cart' %> ``` ``` def cart_update @inventory = Inventory.find(params[:id]) @cart = find_cart @cart.increment_inventory_quantity(params[:inventory]) end def remove_cart_item inventory = Inventory.find(params[:id]) @cart = find_cart @cart.remove_inventory(inventory) redirect_to_index("The item was removed") end ``` `attr_accessor :items` ``` def increment_inventory_quantity(id, quantity) inventory_to_increment = @items.select{|item| item.inventory == inventory} # We do this because select will return an array unless product_to_increment.empty? inventory_to_increment = inventory_to_increment.first else # error handling here end inventory_to_increment.quantity = quantity end def remove_inventory(inventory) @items.delete_if {|item| item.inventory == inventory } end ``` `attr_accessor :inventory, :quantity` ``` def getinventoryid @inventory.id end ``` This produces strange results: ![alt text](https://farm3.static.flickr.com/2755/4282358599_3b997882a8_o.png) Notice the quantity appears in both items from my loop (#Fail). When I submit the form a ArgumentError in InventoriesController# wrong number of arguments (1 for 2) error is returned. Parameters being passed: ``` {"commit"=>"cart_update", "_method"=>"put", "authenticity_token"=>"sH1tWXTJPltpSq5XaAkww7259IR5ZiflnqSFB2Zb0IY=", "id"=>"50", "cart_item"=>{"quantity"=>"16", "id"=>"50"}} ```
Simple quantity function problems, shopping cart
CC BY-SA 2.5
0
2010-01-17T21:59:54.687
2010-01-18T04:39:46.437
2017-02-08T14:19:47.267
-1
165,448
[ "ruby-on-rails", "ruby", "shopping-cart", "agile" ]
2,083,191
1
null
null
3
4,099
I've got a list of transaction dates and the user id of the person who made the transaction on that date (just 1 Tx/day allowed). For example: ![](https://farm5.static.flickr.com/4045/4282685403_9d4412878c_o.png) I'd like to create a matrix which shows, as of each date, the number of users who have made 1 transaction, 2-10 transactions, 10-20 transactions, etc. For example (note, the below data doesn't correspond to the transaction data above): ![](https://farm5.static.flickr.com/4007/4282685425_aa3f85b625_o.png) Is a pivot table my best mechanism here? If so (or not) how would I approach this?
Using Excel to display the number of occurrences within a date range
CC BY-SA 2.5
0
2010-01-18T00:01:31.560
2010-01-23T10:13:30.497
2017-02-08T14:19:47.940
-1
133,247
[ "excel", "statistics", "pivot-table", "histogram" ]
2,083,377
1
null
null
6
1,345
If I just make a standard `TextView` with the `Justification` set to `Center`, it looks something like this: ![Center-Justified TextView](https://i.imgur.com/nd37f.png) If I also want to center the text vertically, as well as horizontally, how do I do this?
In Gtk, how do I center the text within a TextView vertically?
CC BY-SA 2.5
0
2010-01-18T01:13:19.553
2012-07-19T17:07:01.917
null
null
105,084
[ "c#", "gtk", "gtk#" ]
2,083,390
1
null
null
18
17,631
I want to prototype an idea for a game I have. The idea for this game is that the player will dig through the ground, creating tunnels and finding treasure. I'm looking to create 'worms style' terrain, with collision detection for the player wandering and jumping around the tunnels. Examples of this type of dynamic terrain can be seen in these pictures. [](https://i.stack.imgur.com/UWt10.png) ![Example 2](https://2.bp.blogspot.com/_WwRDyay1lRQ/SzESDncoC3I/AAAAAAAABCs/MHo2Hr7QdQA/s320/worms.png) My question is how is the best way to implement this type of destructible terrain? I am using XNA game studio.
How to implement a Worms style destructible terrain in XNA?
CC BY-SA 4.0
0
2010-01-18T01:16:58.667
2019-06-03T19:03:43.307
2019-06-03T19:03:43.307
4,751,173
null
[ "c#", "xna", "terrain" ]
2,083,516
1
2,083,868
null
6
1,492
I am trying to wrap my mind around the best way to implement nested state transitions in a single threaded programming language (Actionscript). Say I have a structure like this behavior tree: ![behavior tree](https://conkerjo.files.wordpress.com/2009/07/image2.png) Now imagine that each leaf node is a destination point on a website, like an image in a gallery, or a comment nested in a post view nested in a page view... And the goal is to be able to run animated transitions from leaf node to leaf node, by animating out the previous tree (from bottom to top), and animating in the current tree (from top to bottom). So, if we were at the bottom-left-most leaf node, and we wanted to go to the bottom-right-most leaf node, we would have to: - - - - - - My question is: If you imagine each of these nodes as HTML views (where the leaves are 'partials', borrowing the term from rails), or MXML views, where you're nesting sub components, and you don't necessarily know the nest levels from the application root, what is the best way to animate the transition as described above? One way is to store all possible paths globally, and then to say "Application, transition out this path, transition in this path". That works if the application is very simple. That's how [Gaia](http://www.gaiaflashframework.com/wiki/index.php?title=Pages) does it, an Actionscript framework. But if you want it to be able to transition in/out arbitrarily nested paths, you can't store that globally because: 1. Actionscript couldn't handle all that processing 2. Doesn't seem like good encapsulation So this question can be reworded as, Where is that information stored (what to transition in and out)? Another possible solution would be to just say "Application, transition out previous child node, and when that's complete, transition in the current child node", where the "child node" is the direct child of the application root. Then the left-most child of the application root (which has two child nodes, which each have two child nodes), would check if it's in the right state (if it's children are 'transitioned out'). If not, it would call "transitionOut()" on them... That way everything would be completely encapsulated. But it seems like that'd be pretty processor intensive. What do you think? Do you have any other alternatives? Or can you point me to any good resources on [AI Behavior Trees](http://aigamedev.com/open/articles/behavior-trees-part1/) or Hierarchical State Machines that describe how they practically implement asynchronous state transitions: - - I have seen/read many articles/books on AI and State Machines, but I have yet to find something describing how they actually implement asychronous/animated transitions in a complex MVC Object Oriented Project with 100s of Views/Graphics participating in the behavior tree. Should I call the transitions from the parent-most object, or from the child? Here are some of the things I've examined: - [An Architecture for Game Behavior AI: Behavior Multi-Queues](http://webdocs.cs.ualberta.ca/~duane/publications/pdf/2009aiideMC.pdf)- [Hierarchical State Machines — a Fundamentally Important Way of Design](http://bears.ece.ucsb.edu/class/ece253/samek0311.pdf)- [Programming Game AI by Example](https://rads.stackoverflow.com/amzn/click/com/1556220782)- [Goal-Driven Agent Behavior](http://web.cs.wpi.edu/~rich/courses/imgd400x-b08/lectures/J-Goal.pdf)- [Advanced State Management by Troy Gardner](http://tv.adobe.com/watch/360flex-conference/advanced-state-management-by-troy-gardner)- [Troyworks' AS3 COGS Library](http://code.google.com/p/troyworks/)- [Popular Approaches to Behavior-Tree Design](http://aigamedev.com/open/articles/popular-behavior-tree-design/)- [Building Event-Driven Conditions for an Asynchronous Sensory System](http://aigamedev.com/open/tutorials/asynchronous-event-driven-conditions/) While this is not necessarily an AI problem, there are no other resources describing how to apply nested state architectures to websites; these are the closest things. Another way to word the question: How do you broadcast state changes to the application? Where do you keep the event listeners? How do you find what view to animate when it's arbitrarily nested? Note: I am not trying to build a game, just trying to build animated websites.
Best Practice for Transitioning From Nested State to Nested State (see diagram)
CC BY-SA 2.5
0
2010-01-18T02:01:51.980
2019-11-05T18:37:21.023
2019-11-05T18:37:21.023
966,247
169,992
[ "optimization", "actionscript", "state-machine", "hsm", "behavior-tree" ]
2,086,368
1
null
null
4
316
``` ALTER PROCEDURE ReadNews @CategoryID INT, @Culture TINYINT = NULL, @StartDate DATETIME = NULL, @EndDate DATETIME = NULL, @Start BIGINT, -- for paging @Count BIGINT -- for paging AS BEGIN SET NOCOUNT ON; --ItemType for news is 0 ;WITH Paging AS ( SELECT news.ID, news.Title, news.Description, news.Date, news.Url, news.Vote, news.ResourceTitle, news.UserID, ROW_NUMBER() OVER(ORDER BY news.rank DESC) AS RowNumber, TotalCount = COUNT(*) OVER() FROM dbo.News news JOIN ItemCategory itemCat ON itemCat.ItemID = news.ID WHERE itemCat.ItemType = 0 -- news item AND itemCat.CategoryID = @CategoryID AND ( (@StartDate IS NULL OR news.Date >= @StartDate) AND (@EndDate IS NULL OR news.Date <= @EndDate) ) AND news.Culture = @Culture and news.[status] = 1 ) SELECT * FROM Paging WHERE RowNumber >= @Start AND RowNumber <= (@Start + @Count - 1) OPTION (OPTIMIZE FOR (@CategoryID UNKNOWN, @Culture UNKNOWN)) END ``` Here is the structure of `News` and `ItemCategory` tables: ``` CREATE TABLE [dbo].[News]( [ID] [bigint] NOT NULL, [Url] [varchar](300) NULL, [Title] [nvarchar](300) NULL, [Description] [nvarchar](3000) NULL, [Date] [datetime] NULL, [Rank] [smallint] NULL, [Vote] [smallint] NULL, [Culture] [tinyint] NULL, [ResourceTitle] [nvarchar](200) NULL, [Status] [tinyint] NULL CONSTRAINT [PK_News] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] CREATE TABLE [ItemCategory]( [ID] [bigint] IDENTITY(1,1) NOT NULL, [ItemID] [bigint] NOT NULL, [ItemType] [tinyint] NOT NULL, [CategoryID] [int] NOT NULL, CONSTRAINT [PK_ItemCategory] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] ``` This query reads news of a specific category (sport, politics, ...). `@Culture` parameter specifies the language of news, like 0 (english), 1 (french), etc. `ItemCategory` table relates a news record to one or more categories. `ItemType` column in `ItemCategory` table specifies which type of `itemID` is there. for now, we have only `ItemType` 0 indicating that `ItemID` refers to a record in `News` table. Currently, I have the following index on `ItemCategory` table: ``` CREATE NONCLUSTERED INDEX [IX_ItemCategory_ItemType_CategoryID__ItemID] ON [ItemCategory] ( [ItemType] ASC, [CategoryID] ASC ) INCLUDE ( [ItemID]) ``` and the following index for News table (suggested by query analyzer): ``` CREATE NONCLUSTERED INDEX [_dta_index_News_8_1734000549__K1_K7_K13_K15] ON [dbo].[News] ( [ID] ASC, [Date] ASC, [Culture] ASC, [Status] ASC ) ``` With these indexes, when I execute the query, the query executes in less than a second for some parameters, and for another parameters (e.g. different @Culture or @CategoryID) may take up to 2 minutes! I have used `OPTIMIZE FOR (@CategoryID UNKNOWN, @Culture UNKNOWN)` to prevent parameter sniffing for `@CategoryID` and `@Culture` parameters but seems not working for some parameters. There are currently around 2,870,000 records in `News` table and 4,740,000 in `ItemCategory` table. Now I greatly appreciate any advice on how to optimize this query or its indexes. update: execution plan: ![enter image description here](https://i.stack.imgur.com/GA4oF.jpg) (in this image, ItemNetwork is what I referred to as ItemCategory. they are the same)
Please help me with this query (sql server 2008)
CC BY-SA 3.0
null
2010-01-18T13:44:03.800
2015-05-15T16:09:39.537
2013-04-23T12:40:27.103
1,616,443
69,537
[ "sql-server", "performance", "indexing", "query-optimization" ]
2,086,581
1
null
null
6
1,017
Given a union of convex objects and a point inside this union, how does one find the closest point on the (concave) surface of the union from ? For what it's worth I can easily find the closest point on the surface of a single convex object, it's the union of several that's giving me problems. I'm terribly sorry, I meant the union of the objects and not the intersection :( Apologies to everyone who answered. Here's a small image describing the situation courtesy AakashM, is the closest point on the surface of from , is the closest point on the surface of from and is the point I'm actually looking for ( == ). ![alt text](https://i.imgur.com/mKJhq.png) My objects are not polygonal objects but lines with radius (I think the term capsule is sometimes used for this but I don't know if this term is universally accepted).
Nearest point on concave surface from point
CC BY-SA 2.5
0
2010-01-18T14:17:11.187
2010-01-19T06:41:51.080
2010-01-19T06:41:51.080
125,672
125,672
[ "algorithm", "geometry" ]
2,090,326
1
2,090,332
null
4
5,841
Is there some way to access webpage warning/error details using JavaScript? For instance, errors in IE show up in the bottom left corner like so: ![alt text](https://www.mediacollege.com/internet/javascript/basic/images/statusbar-alert.gif) I would like to able to access the details of this error (in IE as well as other browsers if possible) using JavaScript. Any suggestions? EDIT: I'm not looking for debuggers. I want to access the content of the error details/error console. Alternately, figuring out how to create a global exception handler equivalent for JavaScript would help too
Programmatically access webpage error details in browsers
CC BY-SA 4.0
0
2010-01-19T00:51:14.270
2019-01-22T11:33:39.343
2019-01-22T11:33:39.343
1,033,581
106,095
[ "javascript", "internet-explorer", "firefox", "browser", "google-chrome" ]
2,091,051
1
2,091,085
null
0
2,526
I am working on a flot graph where i have a few data points i want to display next to each other as bars per x axis, by default the bars overlap and i cant seem to find out where to do this. I found a basic example of what im trying to do here: ![jquery chart](https://farm5.static.flickr.com/4008/4271690739_f0bced3a78.jpg)
displaying bars next to each other in jquery flot
CC BY-SA 2.5
0
2010-01-19T04:23:44.090
2010-01-19T04:32:27.337
2017-02-08T14:19:51.677
-1
79,722
[ "jquery", "flot" ]
2,091,141
1
2,094,560
null
2
906
I wrote a handler for the OnGetHint event of the Virtual StringTree control, and I'm sure that the hint text is returned, but the hint window is blank, see the screenshot below, what might caused this problem? thank you in advance. ![Screenshot](https://dl.dropbox.com/u/367923/Screenshots/Virtual%20TreeView%20OnGetHint%20Problem.JPG) The settings of the control: ``` AnimationDuration := 0; ClipboardFormats.Clear; ClipboardFormats.Add('HTML Format'); ClipboardFormats.Add('Plain text'); ClipboardFormats.Add('Rich Text Format'); ClipboardFormats.Add('Rich Text Format Without Objects'); ClipboardFormats.Add('Unicode text'); ClipboardFormats.Add('Virtual Tree Data'); DefaultPasteMode := amInsertBefore; DragOperations := [doCopy, doMove, doLink]; EditDelay := 200; HintMode := hmHint; Images := dmImages.lstProjectTree; IncrementalSearch := isAll; Indent := 16; Margin := 0; ParentFont := False; PopupMenu := pmTree; SelectionCurveRadius := 5; OnCollapsed := treePrjCollapsed; OnColumnClick := treePrjColumnClick; OnDblClick := treePrjDblClick; OnDragAllowed := treePrjDragAllowed; OnDragOver := treePrjDragOver; OnDragDrop := treePrjDragDrop; OnExpanded := treePrjExpanded; OnFocusChanged := treePrjFocusChanged; OnGetCursor := treePrjGetCursor; OnGetText := treePrjGetText; OnPaintText := treePrjPaintText; OnGetImageIndexEx := treePrjGetImageIndexEx; OnGetHint := treePrjGetHint; OnKeyDown := treePrjKeyDown; OnMouseDown := treePrjMouseDown; OnNewText := treePrjNewText; OnNodeMoving := treePrjNodeMoving; with Columns.Add do begin Position := 0; Width := 153; end; with Columns.Add do begin Layout := blGlyphRight; MinWidth := 20; Position := 1; Width := 20; end; with Columns.Add do begin Layout := blGlyphRight; MinWidth := 20; Position := 2; Width := 20; end; with Columns.Add do begin Layout := blGlyphRight; MinWidth := 16; Position := 3; Width := 20; end; ```
Virtual StringTree: Text returned by the OnGetHint event handler is not shown in the hint window
CC BY-SA 2.5
null
2010-01-19T04:47:15.207
2010-01-19T15:27:48.200
2017-02-08T14:19:52.040
-1
133,516
[ "delphi", "virtualtreeview" ]
2,092,730
1
2,093,494
null
1
814
How to load in a following EF entities: ![alt text](https://blogs.microsoft.co.il/blogs/idof/WindowsLiveWriter/EntityFrameworkLazyLoading_D193/image_2.png) [http://blogs.microsoft.co.il/blogs/idof/archive/2008/08/20/entity-framework-and-lazy-loading.aspx](http://blogs.microsoft.co.il/blogs/idof/archive/2008/08/20/entity-framework-and-lazy-loading.aspx) Let's say we have address id and we want to load address with person and the pets. How to do that? We can do that ``` var address = contex.Addresses.Include("Peson").Where(add => add.Id == GivenId); ``` But it loads address and person w/o pets. If I include a pets entity, like this: ``` var address = contex.Addresses.Include("Peson").Include("Pets").Where(add => add.Id == GivenId); ``` I get error: So the question is how to load a whole entity tree.
Entitiy Framework object tree loading
CC BY-SA 2.5
0
2010-01-19T10:25:33.157
2010-01-19T12:43:19.777
2017-02-08T14:19:52.717
-1
99,422
[ "c#", "entity-framework" ]
2,093,316
1
2,109,711
null
0
730
Hello I'm trying to install maven plugin with eclipse and I have a following problem, more in picture below : ![alt text](https://i.stack.imgur.com/9wHfO.gif) So my question is, is this supposed to take this long or I did something wrong? I'm using eclipse galileo , I went to the window-> install new software -> typed in ``` http://m2eclipse.sonatype.org/update/ website and name maven ``` Pressed next then finish, did I do something wrong, or is there another way to get maven working with eclipse? I need it for my project . thank you
Installation of maven eclipse plugin doesn't finish
CC BY-SA 4.0
null
2010-01-19T12:13:52.720
2019-06-04T19:07:27.217
2019-06-04T19:07:27.217
4,751,173
190,623
[ "eclipse", "maven-2", "eclipse-plugin", "maven-plugin", "m2eclipse" ]
2,094,105
1
2,094,530
null
11
72,043
Under the Build menu, I can see 'Execute' option, but it is greyed out. The only option available is 'Set Includes and Arguments'. When I click that both fields are already filled out. What do I have to write there? ![alt text](https://imgur.com/MXFfW.png)
How can I configure Geany to compile and run my Python programs?
CC BY-SA 2.5
0
2010-01-19T14:27:26.403
2020-06-01T20:12:51.573
2010-01-19T14:42:37.933
12,855
112,355
[ "python", "geany" ]
2,094,380
1
2,095,173
null
10
6,941
I have a test graph here that I would like to tweak to make it look nicer. ![alt text](https://farm3.static.flickr.com/2708/4288196078_879a4c385b_o.png) Here is the graphviz (dot) source, `test6.dot`: ``` digraph G { ranksep=0.3; size="6.0,6.0"; node [fontsize=11]; subgraph clusterA { X2 [shape=box]; node [style=filled]; 1 -> 2 -> 3 -> X2 -> 5; 6; 7; label = "A"; color=blue } X1 [shape=box]; subgraph clusterB { node [style=filled]; 8; 9; 10 -> 11 -> 12; 12 -> 9; 12 -> 8 -> 13; 13 -> 14; label = "B"; color=blue } subgraph clusterC { label = "C"; { node [style="invis"]; gap; } node [shape=box]; edge [style="invis"]; X3 -> gap -> X4; } 14 -> X4 -> 3; 6 -> X1 -> 10; { edge [dir="both"]; 8 -> X3 -> 7; } 9 -> X3 } ``` Questions / changes I would like to make: - `10 -> 11 -> 12 -> 8 -> 13 -> 14``1 -> 2 -> 3 -> X2 -> 5`- - - `ranksep=0.3;``8 -> 13 -> 14``X3 -> gap -> X4`
graphviz: minor tweaks to make the graph look nicer
CC BY-SA 2.5
0
2010-01-19T15:03:16.337
2010-01-19T16:46:24.743
2020-06-20T09:12:55.060
-1
44,330
[ "graphviz" ]
2,094,663
1
2,129,589
null
7
10,443
I want to programmatically determine if the current user (or process) has access to create symbolic links. In Windows (Vista and greater), one cannot create a symbolic link without the SeCreateSymbolicLinkPrivilege and by default, this is only assigned to administrators. If one attempts to create a symbolic link without this privilege, a Windows error 1314 (A required privilege is not held by the client) occurs. To demonstrate this restriction, I created a clean install of Windows, logged in as the initial Administrator account (restricted through UAC), and was unable to create a symlink in the home directory. ![Command Prompt demonstrates mklink fails due to insufficient privilege](https://dl.dropbox.com/u/54081/linked/cant-create-symlink%202.png) After running the Command Prompt as Administrator or disabling UAC, that command executes without error. According to [this article](http://msdn.microsoft.com/en-us/library/ms721532%28VS.85%29.aspx), "every process executed on behalf of the user has a copy of the [access] token". So I've created [a Python script to query for the permissions](https://svn.jaraco.com/jaraco/python/incubator/has-create-symlink-privilege.py). For convenience and posterity, I include an excerpt below. The idea behind the script is to enumerate all privileges and determine if the process has the required privilege. Unfortunately, I find that the current process does not in fact have the desired privilege, even when it can create symlinks. I suspect the problem is that even though the current user's privileges does not explicitly include the privilege, his group membership does afford that privilege. In short, how can I determine if a given process will have privilege to create symbolic links (without attempting to create one)? An example in C or C++ or Python is preferred, though anything utilizing the Windows API will be suitable. ``` def get_process_token(): token = wintypes.HANDLE() TOKEN_ALL_ACCESS = 0xf01ff res = OpenProcessToken(GetCurrentProcess(), TOKEN_ALL_ACCESS, token) if not res > 0: raise RuntimeError("Couldn't get process token") return token def get_privilege_information(): # first call with zero length to determine what size buffer we need return_length = wintypes.DWORD() params = [ get_process_token(), TOKEN_INFORMATION_CLASS.TokenPrivileges, None, 0, return_length, ] res = GetTokenInformation(*params) # assume we now have the necessary length in return_length buffer = ctypes.create_string_buffer(return_length.value) params[2] = buffer params[3] = return_length.value res = GetTokenInformation(*params) assert res > 0, "Error in second GetTokenInformation (%d)" % res privileges = ctypes.cast(buffer, ctypes.POINTER(TOKEN_PRIVILEGES)).contents return privileges privileges = get_privilege_information() print("found {0} privileges".format(privileges.count)) map(print, privileges) ```
Determine if Windows process has privilege to create symbolic link
CC BY-SA 2.5
0
2010-01-19T15:40:56.473
2010-01-25T00:42:51.637
2017-02-08T14:19:55.513
-1
70,170
[ "windows", "winapi", "permissions", "privileges" ]
2,095,272
1
2,095,885
null
5
1,321
I've been beating my head against a wall trying to figure out how I had a memory leak in a garbage collected Cocoa app. (The memory usage in Activity Monitor would just grow and grow, and running the app using the GC Monitor instruments would also show an ever-growing graph.) I eventually narrowed it down to a single pattern in my code. Data was being loaded into an NSData and then parsed by a C library (the data's bytes and length were passed into it). The C library has callbacks which would fire and return sub-string starting pointers and lengths (to avoid internal copying). However, for my purposes, I needed to turn them into NSStrings and keep them around awhile. I did this by using NSString's initWithBytes:length:encoding: method. I assumed that would copy the bytes and NSString would manage it appropriately, but something is going wrong because this leaks like crazy. This code will "leak" or somehow trick the garbage collector: ``` - (void)meh { NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"holmes" ofType:@"txt"]]; const int substrLength = 80; for (const char *substr = [data bytes]; substr-(const char *)[data bytes] < [data length]; substr += substrLength) { NSString *cocoaString = [[NSString alloc] initWithBytes:substr length:substrLength encoding:NSUTF8StringEncoding]; [cocoaString length]; } } ``` I can put this in timer and just watch memory usage go up and up with Activity Monitor as well as with the GC Monitor instrument. (holmes.txt is 594KB) This isn't the best code in the world, but it shows the problem. (I'm running 10.6, the project is targeted for 10.5 - if that matters). I read over the garbage collection docs and noticed a number of possible pitfalls, but I don't think I'm doing anything obviously against the rules here. Doesn't hurt to ask, though. Thanks! [Project zip](http://dl.dropbox.com/u/545670/Meh.zip) Here's a pic of the object graph just growing and growing: ![alt text](https://dl.dropbox.com/u/545670/Meh-gc-monitor.png)
Leaking memory with Cocoa garbage collection
CC BY-SA 2.5
0
2010-01-19T17:00:10.047
2010-06-24T07:32:26.107
2017-02-08T14:19:56.190
-1
177,379
[ "cocoa", "garbage-collection" ]
2,096,518
1
2,100,462
null
48
2,058
Using my iPhone, I would like to measure human flatulence in order to measure, quantify, and provide a statistical report based on various properties of the overall event quality. Outrageous, maybe. Fun, definitely. If I'm going to "release" an iPhone app, I want to do it in style. That's right, I want to measure farts/stinkers/toots. So that bring's me to my question, In order to provide an extremely accurate analysis, at a very minimum, I would need to be able to measure a propagating wave packet, specifically one that would measure the envelope of a burst, distance between adjacent peaks, momentum, and velocity. ![A propagating Wave Packet](https://upload.wikimedia.org/wikipedia/commons/b/b0/Wave_packet_%28dispersion%29.gif) As I am no sound expert of sound analysis, I was wondering if there are development libraries available for sound analysis that would provide a robust set of tools with the qualifications as I mentioned above? For those scope-creepers out there, your ideas are welcome, however, leave ideas only as comments, as I am seriously looking for an answer to my issue.
Measuring Human-Flatulence Propagating Wave Packet on the iPhone
CC BY-SA 2.5
0
2010-01-19T19:43:41.330
2010-01-28T15:24:27.933
2017-02-08T14:19:56.540
-1
225,239
[ "iphone", "objective-c", "waveform", "envelope" ]
2,097,678
1
2,097,688
null
27
2,837
I just ran into one of the most mind boggling errors ever. false == true What information would you guys need to confirm/debug this behavior? I've never seen anything like it. ![enter image description here](https://i.stack.imgur.com/eFqMq.png) - - - Edit: I did a clean->rebuild and still the same. Here's the assembly and registers. I don't know how to read this, but maybe it could help someone else.
C# How can false == true ? See Picture
CC BY-SA 3.0
0
2010-01-19T22:31:22.780
2011-11-30T02:09:40.383
2011-11-30T02:09:40.383
362,634
16,628
[ "c#", ".net", "visual-studio", "debugging" ]
2,098,106
1
null
null
0
524
I am trying to create a TreeView control that would behave in a similar fashion to the object tree in Blend (pictured below). I would like to have a button displayed all the way to the right side of the TreeView for each tree item. By massaging the templates, I've been able to get buttons to appear all the way to the right. This is very close, but there is a difference: in Blend, the buttons always appear on the right edge of the control. When you shrink the size of the control, those buttons will cover over tree items that don't fit the width. The closest I've been able to accomplish is to have buttons line up to the right so that when the control size shrinks, the buttons will go out of view, as opposed to sticking to the right side and staying on top. I think the Blend developers might have done something tricky to get this to work, like smashing together a treeview and a list box. Any ideas on how to get this to work? Maybe there's another control out there that does this? Thanks! ![alt text](https://4.bp.blogspot.com/_Q_BibWE3zeg/SYiuj8aqGZI/AAAAAAAAKiI/0NAfFcJ7oYI/s400/controlTree.jpg)
Create TreeView with buttons that behaves like Blend's objects tree
CC BY-SA 2.5
null
2010-01-19T23:53:10.067
2010-01-20T11:33:12.750
2017-02-08T14:19:57.907
-1
74,346
[ "silverlight", "silverlight-3.0", "treeview" ]
2,099,061
1
null
null
2
881
I chage size of cell of a table to 20 but Delete button don't change. So, how to resize this button is this case? ![alt text](https://farm3.static.flickr.com/2781/4289158251_a4d1c6730d.jpg) Please help me!
How to resize of Delete button of UITableView in delete editting mode?
CC BY-SA 2.5
null
2010-01-20T04:35:46.350
2010-01-20T09:49:51.770
2017-02-08T14:19:58.270
-1
240,622
[ "iphone", "cocoa-touch", "uitableview" ]
2,100,184
1
2,100,460
null
11
1,181
I am interested in understanding the internals of [JavaScript](http://en.wikipedia.org/wiki/JavaScript). I've tried to read the source for [SpiderMonkey](http://en.wikipedia.org/wiki/SpiderMonkey_%28JavaScript_engine%29) and [Rhino](http://en.wikipedia.org/wiki/Rhino_%28JavaScript_engine%29) but it's quite complex to wrap my head around. The reason I ask is: why does something like - `(![]+[])[+!![]+[]]``"a"`- `(Å=[],[µ=!Å+Å][µ[È=++Å+Å+Å]+({}+Å)[Ç=!!Å+µ,ª=Ç[Å]+Ç[+!Å],Å]+ª])()[µ[Å]+µ[Å+Å]+Ç[È]+ª](Å)``alert(1)` Source: [http://sla.ckers.org/forum/read.php?24,32930,page=1](http://sla.ckers.org/forum/read.php?24,32930,page=1). There's many more examples of JavaScript oddities on that forum and I wanted to know how it works from a programming point of view with respect to web application security.
Why does (![]+[])[+!![]+[]] produce "a"
CC BY-SA 3.0
0
2010-01-20T09:17:22.390
2011-12-28T21:27:01.560
2011-12-28T21:27:01.560
204,535
204,535
[ "javascript", "security" ]
2,101,456
1
3,737,146
null
2
15,654
I have a bunch of SSRS 2008 reports which I'd like to run on several different machines (development, test, production). Each machine has it's own database, so I need to use different connection strings depending on where the report is running. One workaround I found is to specify the server and catalog name in a hidden parameter that is passed to the report at runtime. It's described in [this tutorial](http://www.sqlservercentral.com/articles/Development/2945/), but it applies to SSRS 2005 and I could not make it work in SSRS 2008. Everything works fine when the connection string in my shared datasource looks like this: ![Working Connection String](https://content.screencast.com/users/pluggy13/folders/Jing/media/94cc76b4-c386-4705-b714-678b24679aee/2010-01-20_1355.png) Just so to see if expressions can be used at all for the connection string, I replaced the connection string with this: ![Dynamic but broken connection string](https://content.screencast.com/users/pluggy13/folders/Jing/media/cb3bdb1b-a893-4ca3-9d2b-213e3cd9afbc/2010-01-20_1357.png) But this gives me the following error when I try to preview the report in Visual Studio: > An error occurred during local report processing. The item '/Zeiterfassung-Adrian' cannot be found. Are dynamic connection strings still working in SSRS 2008? If yes, what am I doing wrong? If not, what else can I do?
Using Dynamic Connection Strings in SSRS2008
CC BY-SA 2.5
null
2010-01-20T13:00:20.010
2015-02-20T16:04:26.887
2017-02-08T14:19:58.933
-1
59,301
[ "connection-string", "ssrs-2008", "reportingservices-2005", "reporting-services" ]
2,102,125
1
2,105,187
null
2
1,158
I'm importing an SSIS package into SQL Server 2008 Integration Services . The package name contains dots and I'm getting this error message: > The package name, What.No.Dots, contains characters that are not valid. The following characters are not valid: \ / : . * ? " < > | [ ] = Parameter name: What.No.Dots (MsDtsSrvr) ![alt text](https://i.imgur.com/Tep6D.jpg) Is this really the case with SQL Server 2008? I could import packages with dots in the name into SQL Server 2005. I know this sounds like a dumb question, but I want to double check before I rename (I like dots).
SSIS package not importing into SS2008 due to dots in the name
CC BY-SA 2.5
null
2010-01-20T14:44:43.827
2010-01-20T21:37:53.967
null
null
16,279
[ "sql-server-2008", "ssis" ]
2,103,189
1
null
null
0
72
I have a php web site under apache (at enginehosting.com). I rewrote it in asp.net MVC and installed it at discountasp.net. I am comparing response times with firebug. Here is the old time profile: ![](https://farm3.static.flickr.com/2798/4290252553_79f7a8d8ba_o.jpg) Here is the new one: ![](https://farm3.static.flickr.com/2692/4290994136_49aa11c777_o.jpg) Basically, I get longer response times with the new site (not obvious on the pictures I posted here but in average yes with sometimes a big difference like 2s for the old site and 9s for the new one) and images appear more progressively (as opposed to almost instantly with the old site). Moreover, the time profile is completely different. As you can see on the second picture, there is a long time passed in DNS search and this happens for images only (the raw html is even faster on the new site). I thought that once a url has been resolved, then it would be applied for all subsequent requests... Also note that since I still want to keep my domain pointed on the old location while I'm testing, my new site is under a weird URL like myname.web436.discountasp.net. Could it be the reason? Otherwise, what else? If this is more a serverfault question, feel free to move it. Thanks
Web site migration and differences in firebug time profiles
CC BY-SA 2.5
null
2010-01-20T16:49:45.070
2010-06-27T23:00:25.073
2017-02-08T14:19:59.917
-1
29,244
[ "apache", "iis", "dns", "firebug", "webserver" ]
2,103,959
1
2,423,099
null
7
7,770
During a migration of reports which contain EAN128 / Code128 barcodes to Fast Report I found that Fast Report does not use the correct symbology. The lines of a Code128 barcode are very wide so that they are perfect for long distance scanning in a warehouse. I reported it, but only received a recommendation for a third-party barcode library. This one seems to use the correct symbology but it is still in development (for many months now) and not working with Fast Report in Delphi 2009 yet. Are there other Code128 / EAN128 barcode libraries available for Fast Report? Code128 barcode example: ![alt text](https://upload.wikimedia.org/wikipedia/commons/thumb/b/b5/Code_128B-2009-06-02.svg/262px-Code_128B-2009-06-02.svg.png) : one month later. In the meantime we have received source code from the third-party barcode developer - but it is the same buggy code we received in October 2009. So our projectas are stuck with * Fast Reports wrong Code128 implementation * incomplete and buggy third party library * too little time to implement this ourself, so we still use the Delphi 7 printing system based on QuickReport
Code128/EAN128 barcode component for Fast Report?
CC BY-SA 2.5
0
2010-01-20T18:39:27.063
2013-03-05T06:07:50.943
2017-02-08T14:20:01.033
-1
80,901
[ "delphi", "delphi-2009", "barcode", "fastreport", "code128" ]
2,104,041
1
null
null
0
576
Lots of WYSIWYG editor implements HTML table functionalities, however I noticed that such functionalities were not spread evenly accross browsers.. And by editable table, I mean the ability to add/remove rows and columns and resize the table with controls like these:![text editor with controls](https://i.imgur.com/BcJJr.png) However if I edit a table in another WYSIWYG editor I get this: ![editor with some controls](https://i.imgur.com/46sOA.png) Now one would think this is specific to the editor implementation, but take the first one and run it in Google Chrome and you can't edit the table at all. So .. are they browser native controls or editor specific controls ? And how can I enable/disable it ? I tried to inspect the arrows in Firebug without much luck ..
Editable HTML tables
CC BY-SA 2.5
null
2010-01-20T18:51:09.127
2017-05-20T21:01:07.830
2017-05-20T21:01:07.830
4,370,109
105,905
[ "javascript", "html", "html-table" ]
2,105,010
1
null
null
17
5,222
Regarding Notification Area recommendations by Microsoft, I'm looking for ideas or a Delphi component to implement [Notification Area Flyouts](http://msdn.microsoft.com/en-us/library/aa511448.aspx#flyouts). ![alt text](https://i.stack.imgur.com/ezMAO.png) The first "natural" idea is to use a standard Delphi form, but I'm facing two issues with it: 1. I can't get the form border behavior using the standard "BorderStyle" property. Tried to "mimic" the border using the GlassFrame property along with BorderStyle set to bsNone, but there's no GlassFrame when there's no border (at least, in Delphi 2007). 2. I can't figure out how to make the form close when the user clicks everywhere out of the form itself. Yesterday I was trying with different messages, but no one works as expected. I will thank any clue or component to make it happen :) Best regards. jachguate. ps. There's a related question in [converting notification area icon to Program icon in Win7 (Delphi)](https://stackoverflow.com/questions/1264883/converting-notification-area-icon-to-program-icon-in-win7-delphi). I'm still looking for advise. @skamradt answer looks very good, but unfortunately doesn't work well in practice. Finally, The auto-close behavior is working with the WM_ACTIVATE message after a calling SetForegroundWindog to force flyout "activation" ``` begin FlyoutForm.Show; SetForegroundWindow(FlyoutForm.Handle); end; ``` Now, I'm looking for advise to reach the border behavior and visual style, because the closest behavior is achieved with style as WS_POPUP or WS_DLGFRAME, while the closest visual goal is achieved setting style as WS_POPUP or WS_THICKFRAME.
Windows 7 style Notifications Flyouts in Delphi
CC BY-SA 2.5
0
2010-01-20T21:14:49.997
2010-11-30T02:58:08.773
2017-05-23T11:48:36.173
-1
255,257
[ "delphi", "windows-7", "notification-area" ]
2,105,770
1
2,105,817
null
4
534
I want a jQuery modal box that appears near or next to the button that triggers it. The box should appear in shape as well as in the following: ![clicking modal like a boss](https://imgur.com/ItSjY.png) It should be height resizeable, so if the content is long, the box will refit. How can I do this?
Create a jQuery modal box that appears beside the trigger action
CC BY-SA 3.0
0
2010-01-20T23:12:01.383
2011-11-16T03:58:57.477
2011-11-16T03:58:57.477
9,314
255,178
[ "javascript", "jquery", "modal-dialog" ]
2,107,019
1
null
null
11
16,235
I'm trying to figure out how to use Mathematica to solve systems of equations where some of the variables and coefficients are vectors. A simple example would be something like ![A + Vt = Pt](https://dl.dropbox.com/u/23059/sopix/61d85ee72382eef9fd5f305ae639e74b.png) where I know , , and the magnitude of , and I have to solve for and the of P. (Basically, given two rays A and B, where I know everything about A but only the origin and magnitude of B, figure out what the direction of B must be such that it intersects A.) Now, I know how to solve this sort of thing by hand, but that's slow and error-prone, so I was hoping I could use Mathematica to speed things along and error-check me. However, I can't see how to get Mathematica to symbolically solve equations involving vectors like this. I've looked in the VectorAnalysis package, without finding anything there that seems relevant; meanwhile the Linear Algebra package only seems to have a solver for linear systems (which this isn't, since I don't know or , just ). I tried doing the simpleminded thing: expanding the vectors into their components (pretend they're 3D) and solving them as if I were trying to equate two parametric functions, ``` Solve[ { Function[t, {Bx + Vx*t, By + Vy*t, Bz + Vz*t}][t] == Function[t, {Px*t, Py*t, Pz*t}][t], Px^2 + Py^2 + Pz^2 == Q^2 } , { t, Px, Py, Pz } ] ``` but the "solution" that spits out is a huge mess of coefficients and congestion. It also forces me to expand out each of the dimensions I feed it. What I want is a nice symbolic solution in terms of dot products, cross products, and norms: ![alt text](https://dl.dropbox.com/u/23059/sopix/bb3f45e1e9ad64c1134bada5b404ac24.png) But I can't see how to tell `Solve` that some of the coefficients are vectors instead of scalars. Is this possible? Can Mathematica give me symbolic solutions on vectors? Or should I just stick with No.2 Pencil technology? (Just to be clear, I'm not interested in the solution to the particular equation at top -- I'm asking if I can use Mathematica to solve computational geometry problems like that generally without my having to express everything as an explicit matrix of `{Ax, Ay, Az}`, etc.)
Solving vector equations in Mathematica
CC BY-SA 2.5
0
2010-01-21T04:57:28.927
2011-09-07T10:12:45.463
2017-02-08T14:20:02.973
-1
53,543
[ "wolfram-mathematica", "linear-algebra" ]
2,107,876
1
2,107,897
null
87
74,018
In a UINavigationController-based iPhone app, in a method I would like to perform the programmatic equivalent of the back button being pressed and going back a view. i.e. automatically press the Jobs button as seen here: ![Navigation Controller image](https://i.stack.imgur.com/qsijZ.png) Is there a generic iOS call I can make, or is more information required?
Programmatically call navigation controller back button on iOS
CC BY-SA 4.0
0
2010-01-21T08:44:09.407
2019-05-27T16:48:56.627
2019-05-27T16:48:56.627
1,033,581
243,560
[ "ios", "objective-c", "button", "uinavigationcontroller" ]
2,110,389
1
null
null
1
367
I have `<dl>`, and can't style it to look like this: ![image of desired styling](https://i.stack.imgur.com/QHFOq.png) Is it possible to style a definition list like that? Or maybe, better idea would be table?
How to style <dl> as shown in image?
CC BY-SA 3.0
0
2010-01-21T15:28:42.950
2012-04-18T19:50:42.653
2012-04-18T19:50:42.653
327,466
255,921
[ "html", "css", "xhtml" ]
2,110,513
1
2,110,539
null
1
266
I know it is an humiliating and basic problem, but I can't align the navigation div (green borders) with the logo div (red borders) in the bottom of the parent div (blue borders). I tried vertical-align: bottom, but didn't work, any suggestions? ![alt text](https://i.stack.imgur.com/Db7qK.png) HTML: ``` <div id="banner"> <h1><a href="http://widerdesign.co.nr/">wider design</a></h1> <ul id="lang"> <li><a href="index.php">English</a></li> <li><a href="es/index.php">Español</a></li> <li><a href="tw/index.php">中文(繁體)</a></li> <li><a href="cn/index.php">中文(简体)</a></li> </ul> <ul id="nav"> <li class="home"><a href="index.html">home</a></li> <li class="portfolio"><a href="portfolio.php">portfolio</a></li> <li class="about"><a href="about.php">about</a></li> <li class="contact"><a href="form.html">contact</a></li> </ul> </div> ``` CSS: ``` #banner { background-color: #FBFBFB; float: left; padding: 10px 15px; width: 928px; /* 720 */ border: 1px solid #E2E2E2; } #banner h1 { background: url(../images/logo.png) no-repeat scroll 0 0; display: inline; /* ie6 hack for double margin */ height: 21px; font-size: 32px; float: left; text-indent: -9999px; width: 169px; } #header a { color: #999; } #lang { float: right; } #lang li { float: left; margin: 0 0 0 20px; } #lang li a { font-size: 10px; } #nav { float: left; list-style: none; padding: 0 0 0 20px; } #nav li { float: left; margin: 0 30px 0 0; } #nav li a { float: left; font-size: 16px; outline: none; text-decoration: none; } #nav li a:hover { color: #666; } ```
Aligning elements with vertical-align: bottom doesn't work
CC BY-SA 4.0
null
2010-01-21T15:42:36.900
2019-06-06T07:51:41.280
2019-06-06T07:51:41.280
4,751,173
122,536
[ "html", "css", "alignment" ]
2,110,914
1
null
null
19
12,052
Is there any way to get graphviz to left-align or right-align nodes in the same rank, instead of centering? ![alt text](https://farm5.static.flickr.com/4011/4292688021_fb6acf1eeb_o.png) ``` digraph h { rankdir=LR; node [shape=record,height=.08,fontsize=11]; elk[label="elk|I am an American Elk"]; buffalo[label="buffalo|Just a buffalo|everywhere I go|people know the part I'm playing"]; cow[label="cow|moo"]; moose[label="Bullwinkle J. Moose|Hey Rocky, watch me pull a rabbit out of my hat!"]; zoo [label="zoo|<p0>|<p1>|<p2>|<p3>"]; zoo:p0 -> elk; zoo:p1 -> cow; zoo:p2 -> moose; zoo:p3 -> buffalo; } ```
graphviz: left/right align nodes instead of centering?
CC BY-SA 2.5
0
2010-01-21T16:32:08.653
2014-10-25T21:29:49.423
2017-02-08T14:20:03.677
-1
44,330
[ "graphviz" ]
2,111,174
1
2,116,336
null
0
1,105
If I make a `Statusbar`, and `PackEnd` a `Label` to it, it looks something like this: ![alt text](https://i.imgur.com/LY5g4.png) The Shadow disappears over the `Label`, but remains over the rest of the `Statusbar`. I want to remove the Shadow from the entire `Statusbar`. The [PyGTK documentation](http://www.pygtk.org/docs/pygtk/class-gtkstatusbar.html) mentions a property called `shadow-type`, but it's readonly, and nowhere to be found in GTK#. How do I get rid of this shadow?
In Gtk, how do I remove the shadow from a Statusbar?
CC BY-SA 2.5
null
2010-01-21T17:05:13.837
2010-01-28T23:44:35.277
null
null
105,084
[ "c#", "gtk", "gtk#" ]
2,112,127
1
null
null
1
1,808
I'm trying to decorate an ItemsControl so that each item will have a Delete button that floats over the item's content under a specific condition inspired by somewhat by the iPhone UI. I have a few ways in mind of how I can approach this but I could use some guidance from other WPF folks who might have a better idea about how this would best be done. Below is a mock-up image to help express what I'm trying to do. ![Example mock-up](https://lh5.ggpht.com/_K6uP32RV6wo/S1in-ar7EuI/AAAAAAAAAGc/UBx0Lxp7PdA/s800/ItemsControl%20Remove%20Button%20Mockup.png) My current thoughts are to try to attempt this by only using XAML only using styles, templates, and maybe attached properties if necessary. The idea is to create conditional DataTemplate for the items control that would somehow wrap the original content with an adorner that contains my Delete button. In order to have a state on my ItemsControl to know whether I'm in a or not I'm thinking maybe to create an attached property that I can then set in a variety of ways such as binding it to the state of a toggle button or a checkbox for example. At this point the concept makes sense but the fine details are a little unclear to me whether using the ItemTemplate is the best move since in some cases an ItemTemplate may already exist for a given ItemsControl and I do not want to overwrite it but instead would only want to wrap it (if that makes sense). I'm thinking that if I pull if off right I should be able to apply this to any items control by specifying the style and maybe an attached property. If anybody could help illustrate these finer details or offer any better suggestions on how I could go about please share.
How to create an overlay for each item in an ItemsControl?
CC BY-SA 2.5
null
2010-01-21T19:17:47.193
2010-02-28T17:00:04.607
2017-02-08T14:20:04.370
-1
83,658
[ "wpf", "xaml", "overlay", "itemscontrol", "adorner" ]
2,112,714
1
2,112,817
null
0
1,371
``` <RelativeLayout android:layout_width="fill_parent" android:layout_height="50dip"> <Button android:text="Edit" android:width="50dip" android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_alignParentLeft="true" android:layout_alignParentTop="true" /> <ToggleButton android:textOn="All" android:textOff="Wishlist" android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_centerHorizontal="true" android:layout_alignParentTop="true" /> <Button android:text="+" android:width="50dip" android:layout_height="fill_parent" android:layout_width="wrap_content" android:layout_alignParentRight="true" android:layout_alignParentTop="true" /> </RelativeLayout> ``` ![enter image description here](https://i.stack.imgur.com/Q6eMn.jpg) I have these three buttons I want to align them in a similar fashion to the iphone version. I've tried using gravity and things but I can't seem to get them to look the same without absolute positioning. Thanks So I figured it out. I replaced my original code with the solution if any one happens to need it.
Android Layout How to?
CC BY-SA 3.0
null
2010-01-21T20:40:40.707
2015-01-17T18:13:57.897
2015-01-17T18:13:57.897
3,879,847
255,123
[ "android" ]
2,112,766
1
2,112,980
null
4
9,225
This question is based on a [previous similar question.](https://stackoverflow.com/questions/992509/determining-if-a-dataset-approximates-a-sine-wave) I have the following equation and an adjusted (some random data): 0.44*sin(N* 2*PI/30) I am trying to use the FFT to get the frequency from the data generated. However the frequency ends up being close but not equal to the frequency (which makes the wave a bit larger than intended) The frequencies that are at the maximum for the FFT is 7hz, however the expected frequency is (30/2PI) 4.77hz. I've included a graph of the FFT and plotted values. ![alt text](https://imgur.com/b1HGQ.jpg) The code I am using is: ``` [sampleFFTValues sFreq] = positiveFFT(sampledata, 1); sampleFFTValues = abs(sampleFFTValues); [v sFFTV]= max(sampleFFTValues) ``` Positive FFT can be [found here](http://blinkdagger.com/matlab/matlab-introductory-fft-tutorial/). Basically it centers the FFT graph and cuts off the negative signals. My question is how can I get the FFT to be more accurate without having to resort to least squares for just the frequency?
Sine wave frequency fitting
CC BY-SA 3.0
0
2010-01-21T20:46:57.697
2016-03-28T11:05:33.230
2017-05-23T11:53:49.883
-1
80,701
[ "math", "matlab", "fft", "octave", "data-fitting" ]
2,112,973
1
2,113,273
null
0
2,292
Is there a possibility to render an visualization of an audio file? Maybe with SoundManager2 / Canvas / HTML5 Audio? Do you know some technics? I want to create something like this: ![alt text](https://www.pendriveapps.com/wp-content/uploads/mp3directcut.jpg)
Render image from audio
CC BY-SA 2.5
null
2010-01-21T21:16:05.393
2012-05-14T19:08:44.630
2017-02-08T14:20:04.733
-1
242,751
[ "javascript", "html", "soundmanager2" ]
2,114,231
1
2,114,373
null
3
7,523
I'm trying to create a modal status indicator display for an iPhone app, and would like one similar to this one used in Tweetie: ![enter image description here](https://i.stack.imgur.com/NgP1Z.jpg) Specifically, this one "shades out" the entire screen, including the toolbar. I don't believe through any normal UIView manipulation, I can extend past the bounds of my window, can I? I believe I've seen a status indicator like this somewhere else on iPhone, possibly when I added an Exchange e-mail account. I've tried subclassing UIAlertView and overriding its drawRect method. If I don't call [super drawRect:] it doesn't ever display the normal UIAlertView text box, however my drawing rectangle is in an odd size and position. Anyone have any advice to accomplish this?
How to create a full-screen modal status display on iPhone?
CC BY-SA 3.0
0
2010-01-22T01:01:23.370
2014-03-16T21:51:20.700
2014-03-16T21:51:20.700
1,709,587
256,303
[ "iphone", "objective-c", "cocoa-touch", "iphone-sdk-3.0" ]
2,115,837
1
2,119,368
null
0
914
The bottom of the FCKEditor seems to cut off - the border is not seen. This only happens in Google Chrome. IE and Firefox seem to be ok. This is the FCKEditor control with barely any customization. ![alt text](https://i.imgur.com/Z1hYV.png) Is there anyway to fix this?
FCKEditor 2.6x seems to cut off at the bottom in Chrome
CC BY-SA 2.5
null
2010-01-22T08:00:36.480
2010-07-22T19:28:17.490
2010-01-22T17:31:16.157
9,382
9,382
[ "google-chrome", "border", "fckeditor" ]
2,116,085
1
null
null
1
515
See this screenshot, in the middle it's the small hint windows that are generated by a TVirtualStringTree control and were left out on the screen, these hint windows will remain there until the application exits. the problem happens when the treeview's hint is shown and the mouse leaves quickly to the window next to it. Any idea about how to avoid this or how to clear those un-erased hint windows if it's difficult to avid this? ![alt text](https://dl.dropbox.com/u/367923/Screenshots/Virtual_TreeView_Hint_Widows_Are_not_erased.JPG) Few days ago I asked [a similar question](https://stackoverflow.com/questions/2091141/virtual-stringtree-text-returned-by-the-ongethint-event-handler-is-not-shown-in), while the hint windows in the screenshots look the same, the are not the same problem. That problem, the hint text never shows and only that kind of uncompleted hint windows are shown; This problem, the hint text shows but the hint windows are not completely erased in a case (as I described above). Hope it's clear.
Virtual StringTree's hint windows are left out on the screen
CC BY-SA 2.5
null
2010-01-22T09:01:03.637
2012-03-30T13:10:44.630
2017-05-23T12:08:51.063
-1
133,516
[ "delphi", "virtualtreeview", "tvirtualstringtree" ]
2,117,583
1
null
null
6
11,384
Using the [ASP.Net Chart Controls](http://www.microsoft.com/downloads/details.aspx?FamilyId=130F7986-BF49-4FE5-9CA8-910AE6EA442C&displaylang=en), which [are a subset](http://blogs.msdn.com/alexgor/archive/2008/11/07/microsoft-chart-control-vs-dundas-chart-control.aspx) of the [Dundas Chart Controls](http://www.dundas.com/Components/Products/Chart/NET/index.aspx), How can I make charts that look like this: ![alt text](https://lh3.ggpht.com/_Psti3TsSy9w/S1msBD7NrsI/AAAAAAAAQX4/Z_TTPeQFLPk/s400/dundas.png) Instead of this: ![MS Chart Example](https://lh5.ggpht.com/_Psti3TsSy9w/S1msBl6N3tI/AAAAAAAAQX8/R4S6uhH0RxQ/s800/mschart.png) EDIT: I've made [some progress](https://stackoverflow.com/questions/2137157/force-a-gap-between-points-on-the-x-axis-ms-net-chart-controls-column-chart), since asking this question. The styling elements that improve the default graph in both Dundas and MSChart are: - - - - -
Styling the asp.net charting controls
CC BY-SA 2.5
0
2010-01-22T13:48:23.023
2011-01-23T04:07:37.957
2017-05-23T10:29:31.030
-1
68,115
[ "asp.net", "charts", "dundas", "asp.net-charts" ]
2,118,345
1
2,186,800
null
2
445
For the past two days i have been looking around the net to find how Opera made their pre-alpha build with that UI. I mean its like built with windows shell here are some screenshots ![alt text](https://i.stack.imgur.com/t4wnw.png) ![alt text](https://i.stack.imgur.com/wnLYR.png) any tutorials , books or videos would be helpful P.S. I also saw the win 7 SDK but its all C++ samples and i learn C#
How to imitate Opera 10.50's custom UI?
CC BY-SA 4.0
null
2010-01-22T15:38:00.313
2019-06-07T09:16:18.610
2019-06-07T09:16:18.610
4,751,173
122,765
[ "c#", ".net", "windows-7", "opera" ]
2,118,882
1
null
null
4
975
The context: I'm writing JavaScript to run an executable and tweak some registry entries on the client machine. I've signed the .JAR using SignTool and my company's Authenticode certificate, but running the script produces a dialog saying: ![scary certificate dialog](https://i.stack.imgur.com/iibur.jpg) There is no mention of the root certificate authority (in this case Comodo, I believe), so I could just as well have generated a self-signed certificate to put the company name string in the dialog. My question is: is this all the user is meant to see? This example page at `jar:http://www.mozilla.org/projects/security/components/signed-script-demo.jar!/signed-script-demo.html` shows the same dialog, but there's still a lack of any "examine this certificate" link or mention of a root CA. Are there any recent resources for writing signed scripts? The mozilla pages are mostly several years old and many reference now-defunct documentation at developer.netscape.com. -- Martin
Firefox: Signed script shows scary certificate dialog
CC BY-SA 3.0
0
2010-01-22T16:51:21.550
2017-05-04T06:57:17.340
2017-05-04T06:57:17.340
962,603
59,313
[ "javascript", "firefox", "certificate" ]
2,121,082
1
null
null
5
17,502
I'm trying to make my Compliance Worksheet more efficient. I have a list of controls in sections (and sub-sections), and I use a value as a placeholder to count the number of controls per section (or sub-section), as well as exceptions per section. I use the value "1" if there is a valid control, and sum up these values per section or sub-section. I often have to add rows to the bottom of a section, and this throws my sum-formula off, requiring manual updating to these formulas. I would LIKE to utilize a formula to either "sum-until" or "count-until" the next section. I've attached an example. Is there a way to Sum (or Count) until the next formula or non-"1"-value? Would it just be easier to put an "end" value at the bottom of each of these sections, and count until "end"? This wouldn't be an ideal way to perform such a function (as there will be a good number of unnecessary "ends" between sections), but if there's not a better way, perhaps I'll explore that avenue. ![Link to screenshot](https://i.stack.imgur.com/7pRlT.jpg)
Sum or Count until?
CC BY-SA 3.0
null
2010-01-22T22:46:18.120
2016-01-21T00:22:51.877
2016-01-21T00:22:51.877
-1
257,173
[ "excel", "count", "sum", "worksheet-function" ]
2,126,949
1
2,126,959
null
1
656
This code: ``` <table cellpadding=0 cellspacing=0 border=0> <tr> <td bgcolor=red> <input type='text' /> </td> </tr> </table> ``` Gives this output in Safari and all other browsers: ![alt text](https://imgur.com/i2Ve6.jpg) The question is how to remove the indent that is highlighted with background color. Problem occurs in Safari only, CSS margin/padding/border does not help.
Strange input field indent in Safari
CC BY-SA 2.5
null
2010-01-24T12:08:24.737
2010-01-24T12:15:37.750
null
null
179,746
[ "html", "css", "input", "safari", "indentation" ]
2,127,692
1
2,160,370
null
15
3,674
Ok so I have bunch of balls: ![Ignight Balls](https://i.imgur.com/NuJce.png) --- What I'm trying to figure out is how to make these circles: - based on the surfaces they are touching- when dealing with touching objects. --- This is what I mean by ![alt text](https://imgur.com/UWYU1.png) - will rotate as it's - will rotate as it's --- Even though solutions to this are universal, just for the record I'm using Javascript and SVG, and would prefer implementing this myself rather than using a library. Help would be very much appreciated. Thanks! :)
Need help with circle collision and rotation? - Game Physics
CC BY-SA 2.5
0
2010-01-24T16:11:14.047
2019-06-10T01:05:51.827
2010-07-25T04:03:10.607
226,086
208,827
[ "algorithm", "math", "physics" ]