Id
int64
1.68k
75.6M
PostTypeId
int64
1
2
AcceptedAnswerId
int64
1.7k
75.6M
ParentId
int64
1.68k
75.6M
Score
int64
-60
3.16k
ViewCount
int64
8
2.68M
Body
stringlengths
1
41.1k
Title
stringlengths
14
150
ContentLicense
stringclasses
3 values
FavoriteCount
int64
0
1
CreationDate
stringlengths
23
23
LastActivityDate
stringlengths
23
23
LastEditDate
stringlengths
23
23
LastEditorUserId
int64
-1
21.3M
OwnerUserId
int64
1
21.3M
Tags
list
4,722,663
1
4,722,990
null
0
332
I have a web page with 3 web forms, where the first two expect digital input and the last one may not be empty. ![A web form showing three text fields, two of them containing invalid inputs](https://i.stack.imgur.com/d8xF0.png) Here is the reduced and ready-to-run test case: ``` <html> <head> <style> .invalid { border: 2px solid #FF0000; background-color: #FFCCCC; } </style> <script type="text/javascript" src="jquery-1.4.4.min.js"></script> <script type="text/javascript"> $(function() { //$('body').click(....) $('#cl_txt, #mks_txt, #comment_txt').blur(function() { $('#cl_txt, #mks_txt, #comment_txt').removeClass('invalid'); }); $('#mks_btn').click(function(e) { if (! $('#mks_txt').val().match(/^[0-9]{6,}$/i)) { $('#mks_txt').addClass('invalid'); e.preventDefault(); } }); $('#cl_btn').click(function(e) { if (! $('#cl_txt').val().match(/^[0-9]{6,}$/i)) { $('#cl_txt').addClass('invalid'); e.preventDefault(); } }); $('#comment_btn').click(function(e) { if ($('#comment_txt').val().length < 2) { $('#comment_txt').addClass('invalid'); e.preventDefault(); } }); }); </script> </head> <body> <table border=1> <form><tr><th>MKS</th><td> <input name="toggle_mks" id="mks_txt" type="text" size="10"> <input type="submit" id="mks_btn" value="Add MKS" class="toggle"> </td></tr> <form><tr><th>CL</th><td> <input name="toggle_cl" id="cl_txt" type="text" size="10"> <input type="submit" id="cl_btn" value="Add CL" class="toggle"> </td></tr></form> <form><tr><th>Comments</th><td> <textarea name="comment" id="comment_txt" rows="4" cols="40"> </textarea> <input type="submit" id="comment_btn" value="Add comment" class="toggle"> </td></tr></form> </table> </body> </html> ``` When invalid text has been entered and the corresponding submit button clicked, then I add the class to that text field or text area to make it appear red. My problem is in handling situations, where the user changes her mind and decides not to submit that web form again. Instead she clicks into another web form or maybe just clicks somewhere in the web page. In that case I would like the red class to be removed from the text elements , and again. But I don't know how to arrange it. I've tried setting but it never works consistently. I've tried instead, but then form validation seems to break, the text fields are never painted red. Any help please?
jQuery: clear a web form when the user clicks elsewhere
CC BY-SA 3.0
null
2011-01-18T09:55:17.830
2012-02-20T10:31:29.600
2012-02-20T10:31:29.600
561,309
165,071
[ "jquery", "blur" ]
4,722,689
1
4,723,187
null
14
12,409
I need to create a "tree diagram"-like graph to present the number of cases for different scenarios, like the one shown below: ![](https://i.stack.imgur.com/z1oTZ.jpg) The picture is quoted from : ``` Pediatrics. 2005 Dec;116(6):1317-22. Electronic surveillance system for monitoring surgical antimicrobial prophylaxis. Voit SB, Todd JK, Nelson B, Nyquist AC. ``` I can get the numbers easily from R using the `table` command, but it is not a very good way to present it. The chart can be made without any fancy colors or stuff, I just want to use the format to present the numbers. Any suggestions?
creating tree diagram for showing case count using R
CC BY-SA 3.0
0
2011-01-18T09:57:44.093
2017-11-14T17:18:22.830
2012-02-20T10:24:42.023
561,309
373,908
[ "r", "data-visualization" ]
4,722,716
1
null
null
1
5,090
I have the following script which I use in to export all the worksheets of an Excel file to .csv files. ``` Sub save_all_csv() On Error Resume Next Dim ExcelFileName As String ExcelFileName = ThisWorkbook.Name For Each objWorksheet In ThisWorkbook.Worksheets ExcelFileNameWithoutExtension = RemoveExtension(ExcelFileName) CsvFileName = ExcelFileNameWithoutExtension & "__" & objWorksheet.Name & ".csv" Application.DisplayAlerts = False objWorksheet.SaveAs Filename:="data:storage:original_excel:" & CsvFileName, FileFormat:=xlCSV, CreateBackup:=False Application.DisplayAlerts = True Next Application.DisplayAlerts = False Application.Quit End Sub Function RemoveExtension(strFileName As String) strFileName = Replace(strFileName, ".xlsx", "") strFileName = Replace(strFileName, ".xls", "") RemoveExtension = strFileName End Function ``` The problem is that they save as which I can't get to convert to UTF-8 via PHP, so I would like to have VBA save these files in UTF-8 format in the first place. ![alt text](https://i.stack.imgur.com/us0Fd.png) I've found some solutions for saving text from VBA via a Stream object and with [CreateObject](https://stackoverflow.com/questions/2524703/save-text-file-utf-8-encoded-with-vba) but it's [apparently not possibile on the Mac to use CreateObject to write directly to files](https://stackoverflow.com/questions/4670420/how-can-i-install-use-scripting-filesystemobject-in-excel-2010-for-mac/4670622#4670622).
How to save worksheets as CSV files in UTF-8 format with Excel for Mac 2011?
CC BY-SA 2.5
0
2011-01-18T10:00:12.920
2020-03-27T17:43:34.847
2018-07-09T18:41:45.953
-1
4,639
[ "macos", "utf-8", "excel", "vba" ]
4,722,776
1
4,766,487
null
1
783
# Screenshot ![alt text](https://i.stack.imgur.com/4n3r3.png) # Question I noticed some people can show the left bar as shown above. How to do that?
How to show the vertical bar on the left side of code block in Visual Studio? (see the figure to get the idea)
CC BY-SA 2.5
null
2011-01-18T10:05:40.963
2011-01-22T06:27:01.937
2011-01-22T05:59:06.703
397,524
397,524
[ "visual-studio-2010" ]
4,722,864
1
4,723,014
null
8
12,813
I have files being exported by Excel for Mac 2011 VBA in as shown here: ![alt text](https://i.stack.imgur.com/pLMsO.png) I haven't been successful in [getting Excel for Mac VBA to export directly to UTF-8](https://stackoverflow.com/questions/4722716/how-to-save-worksheets-as-csv-files-in-utf-8-format-with-excel-for-mac-2011) so I want to convert these files with PHP before I save them to MySQL, I am using this command: ``` $dataset[$k] = mb_convert_encoding($line, 'ASCII', 'UTF-8'); //not correctly converted $dataset[$k] = mb_convert_encoding($line, 'ISO-8859-8', 'UTF-8'); //not correctly converted $dataset[$k] = mb_convert_encoding($line, 'macintosh', 'UTF-8'); //unrecognized name $dataset[$k] = mb_convert_encoding($line, 'Windows-1251', 'UTF-8'); //changes "schön" to "schљn" $dataset[$k] = mb_convert_encoding($line, 'Windows-1252', 'UTF-8'); //changes "schön" to "schšn" ``` I found this [list of valid encoding formats](http://www.eatmybusiness.com/food/2008/01/30/list-of-accepted-encodings-that-can-be-passed-to-mb_convert_encoding-as-arguments/63/) from 2008, but none of them seem to represent `Western (Mac OS Roman)`. ``` * UCS-4 * UCS-4BE * UCS-4LE * UCS-2 * UCS-2BE * UCS-2LE * UTF-32 * UTF-32BE * UTF-32LE * UTF-16 * UTF-16BE * UTF-16LE * UTF-7 * UTF7-IMAP * UTF-8 * ASCII * EUC-JP * SJIS * eucJP-win * SJIS-win * ISO-2022-JP * JIS * ISO-8859-1 * ISO-8859-2 * ISO-8859-3 * ISO-8859-4 * ISO-8859-5 * ISO-8859-6 * ISO-8859-7 * ISO-8859-8 * ISO-8859-9 * ISO-8859-10 * ISO-8859-13 * ISO-8859-14 * ISO-8859-15 * byte2be * byte2le * byte4be * byte4le * BASE64 * HTML-ENTITIES * 7bit * 8bit * EUC-CN * CP936 * HZ * EUC-TW * CP950 * BIG-5 * EUC-KR * UHC (CP949) * ISO-2022-KR * Windows-1251 (CP1251) * Windows-1252 (CP1252) * CP866 (IBM866) * KOI8-R ```
How can I convert "Western (Mac OS Roman)" formatted text to UTF-8 with PHP?
CC BY-SA 2.5
0
2011-01-18T10:16:14.043
2013-10-11T11:12:07.117
2017-05-23T12:24:58.297
-1
4,639
[ "php", "macos", "utf-8", "mb-convert-encoding" ]
4,722,943
1
4,722,975
null
0
4,028
In my iPhone app, I am using a single tableview to display different sets of data based on the button clicked. Now as I am using the same tableView I need to blank out the tableView contents everytime a new button is selected. And this is quite normal requirement rite? As such it is inefficient to take 7 tables to show 7 different data sets. I have seen that table clears out but when we display some other data in the table then the previous data appears in background as in Screenshot AFTER. I have tried setting the array as nil and reloading the tableView but then it doesnt seem to work. What can be a fix for this issue? I have checked the code and it seems proper to me. You can refer to the Screen shot to get a better idea of what actually is happening. ![alt text](https://i.stack.imgur.com/xmX47.png) You can clearly see a different image in background where as it should be same as image in above screenshot. This is not a button, I am adding a UIImageView to tableViewCell. ![alt text](https://i.stack.imgur.com/QjICw.png)
How to empty out the whole tableview on a button click in iPhone SDK?
CC BY-SA 3.0
null
2011-01-18T10:24:29.887
2013-01-17T11:19:55.463
2013-01-17T11:19:55.463
463,857
463,857
[ "iphone", "objective-c", "cocoa-touch", "uitableview", "ios4" ]
4,723,004
1
4,723,117
null
13
4,353
When we analyse memory heaps, following 4 types of GC handles we generally come across: 1. Weak:- A weak GC handle will not prevent the instance it corresponds to from being garbage collected. Example, used by the System.WeakReference class instances. 2. Normal:- A normal GC handle prevents the corresponding instance from being garbage collected.Example, used by the instances of strong references. 3. RefCounted:- A reference counted GC handle is used internally by the runtime, example, when dealing with COM interfaces. 4. Pinned:- Why do we need this kind of GC handle? Is it just for avoiding the movement of that instance in memory or is there any other notion behind this? I want to know the notion behind Pinned GC handle(with an example). :- I have a non empty array- which is bound to a data grid in WPF. When I close the window on which this data grid is present, on heap I see pointing to this empty array through (see snapshot). `I am not using any unsafe code. I am just setting ItemsSource of data grid to null before closing that window. So my question is who does pin this array on heap and why?` ![alt text](https://i.stack.imgur.com/5qBA9.png)
What is the notion behind 'Pinned GC handle'?
CC BY-SA 2.5
0
2011-01-18T10:31:20.873
2011-01-20T09:43:48.813
2011-01-20T09:17:38.140
212,823
212,823
[ ".net", "wpf", "garbage-collection" ]
4,723,353
1
null
null
2
2,205
``` .v-captiontext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; font-weight: bold; text-align: right; } ``` I have a div as below and above is what I defined in css for this ``` <div class="v-captiontext">User ID :</div> ``` Below is the screen shot. Still it align left only but I want to align all fields to right pointing to text fields side. ![alt text](https://i.stack.imgur.com/esCMd.jpg) ``` <div> <div style="position: relative; overflow: hidden; height: 297px; width: 698px;"> <div style="top: 30px; left: 10px;" class="v-absolutelayout-wrapper"> <div style="height: 267px; width: 688px;" class="v-label"></div> </div> <div style="position: absolute; left: 10px; top: 17px;" class="v-caption"> <div class="v-captiontext">User ID :</div> <div style="clear: both; width: 0px; height: 0px; overflow: hidden;"></div> </div> <div style="top: 15px; left: 110px;" class="v-absolutelayout-wrapper"><input style="width: 192px;" disabled="disabled" class="v-textfield v-disabled" tabindex="0" type="text"></div> <div style="top: 60px; left: 10px;" class="v-absolutelayout-wrapper"> <div style="height: 237px; width: 688px;" class="v-label"></div> </div> <div style="position: absolute; left: 10px; top: 47px;" class="v-caption"> <div class="v-captiontext">First Name :</div> <div style="clear: both; width: 0px; height: 0px; overflow: hidden;"></div> </div> <div style="top: 45px; left: 110px;" class="v-absolutelayout-wrapper"><input style="width: 192px;" class="v-textfield" tabindex="0" type="text"></div> <div style="top: 90px; left: 10px;" class="v-absolutelayout-wrapper"> <div style="height: 207px; width: 688px;" class="v-label"></div> </div> <div style="position: absolute; left: 10px; top: 77px;" class="v-caption"> <div class="v-captiontext">Last Name :</div> <div style="clear: both; width: 0px; height: 0px; overflow: hidden;"></div> </div> <div style="top: 75px; left: 110px;" class="v-absolutelayout-wrapper"><input style="width: 192px;" class="v-textfield" tabindex="0" type="text"></div> <div style="top: 120px; left: 10px;" class="v-absolutelayout-wrapper"> <div style="height: 177px; width: 688px;" class="v-label"></div> </div> <div style="position: absolute; left: 10px; top: 107px;" class="v-caption"> <div class="v-captiontext">Phone :</div> <div style="clear: both; width: 0px; height: 0px; overflow: hidden;"></div> </div> <div style="top: 105px; left: 110px;" class="v-absolutelayout-wrapper"><input style="width: 192px;" class="v-textfield" tabindex="0" type="text"></div> <div style="top: 150px; left: 10px;" class="v-absolutelayout-wrapper"> <div style="height: 147px; width: 688px;" class="v-label"></div> </div> <div style="position: absolute; left: 10px; top: 137px;" class="v-caption"> <div class="v-captiontext">App ID :</div> <div style="clear: both; width: 0px; height: 0px; overflow: hidden;"></div> </div> <div style="top: 135px; left: 110px;" class="v-absolutelayout-wrapper"><input style="width: 192px;" class="v-textfield" tabindex="0" type="text"></div> </div> </div> ``` --- ## My CSS Code ``` .v-app-VaadinMainApplication,.v-app-VaadinApplication{ background-color: white; } .top_header{ border: 1px solid #e78f08; background: #f6a828 url(common/img/ui-bg_gloss-wave_35_f6a828_500x100.png) 50% 50% repeat-x; height: 30px; } .v-caption-top_header .v-captiontext { color:white; margin-top:23px; margin-left:10px; font-size: 13px; } .intro_key{ border: 1px solid #e78f08; background: #F6F6F6 url("common/img/ui-bg_glass_100_f6f6f6_1x400.png") 50% 50% repeat-x; } .v-caption-intro_key .v-captiontext{ margin-top:25px; margin-left:5px; color: #000000; font-weight: bolder; font-size: 100%; line-height: 200%; text-indent: 10px; } .v-textfield{ border: 1px solid #467BB3; background-color: #E8F1FB; } .v-app .v-textfield-focus{ border: 1px solid #467BB3; background-color: #E8F1FB; } .v-captiontext { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 90%; font-weight: bold; text-align: right; } ```
CSS Text Alignment to Right Problem
CC BY-SA 2.5
null
2011-01-18T11:09:54.803
2011-01-18T11:21:22.817
2011-01-18T11:21:22.817
537,515
537,515
[ "css" ]
4,723,418
1
4,758,549
null
-1
187
I'm relatively new to Flex however needed to take over maintenance and development of an application after a bit of a crisis. I'm familiar with AS3 and OOP in general if that's any help. The application is built using Flex builder 3, Flex SDK 4.1 and is based around the Halo theme. Main.mxml contains a few navigation bits and pieces, application border and a canvas named placeholder. As the user navigates around the site the state of the Main.mxml is changed, and based upon that the appropriate "screen" is then swapped within the placeholder with no animation applied (Sometimes a ProgressBar halts progress until data has loaded). Each screen is the same size as the main application, based around a `mx:Canvas` and set to position its self at 0,0 thus filling the entire window. First off, is this a good approach, would you make any recommendations on things to change? Next, some screens are suffering from some strange jumping with the layout and positioning and for the life of me I cannot figure out why. It's happening on a number of visual elements. My first example being a button built using hbox, image and text controls. The hbox has been modified to include gradient backgrounds however the issue occurs when using the default mx hbox. The first image is on first render having had no interaction, the second is after I have rolled my mouse over it, and the 3rd (and correct) image is after leaving that screen and then returning. Notice it is no longer being clipped and includes the rounded corners on the right hand side too. ![Example 1](https://i.stack.imgur.com/TCeFl.png) My second example is harder to capture but I have a series of 4 gradient buttons based around the [flexlib advanced button skin](http://flexlib.googlecode.com/svn/trunk/docs/flexlib/skins/EnhancedButtonSkin.html) stacked in a `mx:vbox`. On first display they are correct, on second display they appear correct but when hovering over them something seems to change but I'm not sure what which causes the buttons beneath to jump down by about a pixel for each button hovered over. After each button has caused that jump, everything is ok again. And finally, when returning to the previous screen the entire screen appears to jump to the left slightly just after it has displayed giving it a very jerky appearance. Many thanks for any help After many hours of trying your suggestions and messing about removing elements from the stage one by one i eventually discovered the source of the problem to be the `borderMetrics` property of the `VideoDisplay` control. After removing these (i'm not even sure why they were there in the first place) all of the strange display issues I was suffering from went away. Many thanks for the suggestions!
Jumpy flex layout
CC BY-SA 3.0
null
2011-01-18T11:17:45.707
2011-12-09T22:26:24.097
2011-12-09T22:26:24.097
85,950
468,214
[ "actionscript-3", "apache-flex", "flex4", "flexbuilder", "halo" ]
4,723,520
1
4,724,192
null
0
334
i am trying to design a table for storing unit this table is used for unit convertion also the structure of my table is like in the image ![table Structure](https://i.stack.imgur.com/WBsax.jpg) is this table structure enough for convertion of units from one type to another
Database design for Unitconvertion Table?
CC BY-SA 2.5
null
2011-01-18T11:29:05.097
2011-01-18T13:20:17.470
null
null
543,047
[ "sql-server-2008", "database-design" ]
4,724,398
1
4,749,068
null
5
2,234
Sessions work perfectly in all other browsers that I have tested. If I try to get the session id with `sessionid = request.COOKIES['sessionid']`, I get this error: `KeyError: 'sessionid'` This is what I have in my settings.py: ``` CACHE_BACKEND = 'memcached://127.0.0.1:11211/' SESSION_COOKIE_DOMAIN = '.vb.is' SESSION_ENGINE = 'django.contrib.sessions.backends.cache' ``` Sites are vb.is, fiskifrettir.vb.is and hestabladid.vb.is ![alt text](https://i.stack.imgur.com/4wbu4.png) Server setup is: apache2 (mod_wsgi) and nginx
Django sessions not working in Internet Explorer
CC BY-SA 2.5
0
2011-01-18T13:08:06.653
2011-01-20T15:33:06.630
2011-01-20T15:28:55.177
412,252
412,252
[ "django", "internet-explorer", "session", "cookies", "session-cookies" ]
4,724,974
1
4,725,522
null
4
1,066
I'm trying to allow signing for a pdf using iText and Java. I'm not interested in actually signing it, just enabling the "Signing" flag as seen in the image below. Also, I don't need the signing to appear visually anywhere in the document. ![Signing](https://i.stack.imgur.com/rI9vY.png)
Allow signing of pdf using iText
CC BY-SA 2.5
null
2011-01-18T14:04:20.313
2014-03-05T00:34:06.787
2011-01-19T07:59:26.697
206,755
206,755
[ "java", "pdf", "itext", "signature", "signing" ]
4,725,084
1
4,725,857
null
2
1,720
How do I color a cell in a datagridview with the alpha-channel? RGB works ok, but when specifying the alpha I get distorted numbers instead. I make this color change in the cellPainting event. ![alt text](https://i.stack.imgur.com/07LKg.png) ``` e.CellStyle.BackColor = Color.FromArgb(120, 255, 0, 0) ```
Color alpha-channel in DataGridView
CC BY-SA 2.5
null
2011-01-18T14:16:24.443
2011-01-18T15:26:04.923
null
null
445,533
[ "c#", "datagridview", "colors", "alpha" ]
4,725,205
1
4,760,552
null
1
347
I want to create a web application with the following architecture: ![Architecture of my app](https://i.stack.imgur.com/bso9X.png) There is some functionality, whiсh is encapsulated in the "Business logic" module (1). It uses MongoDB as a data store (5) and an external (command line) application (4). The functionality of the application is brought to the end users via two channels: 1. The web application itself (2) and 2. public API (3), which allows third-party applications and mobile devices to access the business logic functionality. The web application is written in Java and based on the Vaadin platform. Currently it runs in Jetty web server. One important requirement: The web application should be scalable, i. e. it must be possible to increase the number of users/transactions it can service by adding new hardware. I have following questions regarding the technical implementation of this architecture: 1. What technology can be used to implement the business logic part? What are the sensible options for creating a SCALABLE app server? 2. What web server can I choose for the web interface part (2) to make it scalable? What are the options? 3. Calculations done in the external system (4) are potentially CPU-intensive. Therefore I want to do them in an asynchronous way, i. e. a) the user sends a request for this operation (via web interface or public API, 2 and 3 in the above image), that b) request is put into a queue, then c) the CPU-intensive calculations are done and d) at some point in time the answer is sent to the user. What technological options are there to implement this queueing (apart from JMS) ? Thanks in advance Dmitri
Architecture: Technological questions
CC BY-SA 2.5
null
2011-01-18T14:29:48.433
2011-08-15T13:03:50.007
2020-06-20T09:12:55.060
-1
399,457
[ "web-services", "architecture", "jakarta-ee", "jms", "vaadin" ]
4,725,455
1
null
null
1
823
I just want to make the seekbar as shown in the image. How can I achieve this? ![Slider](https://i.stack.imgur.com/q0cAk.png)
How to make two way slider bar?
CC BY-SA 3.0
0
2011-01-18T14:49:24.243
2014-09-03T09:39:32.930
2014-09-03T09:39:32.930
356,895
411,359
[ "android", "android-layout", "slider", "range" ]
4,725,634
1
4,727,511
null
5
4,910
In Delphi XE, I'm trying to implement an "instant search" feature - one that resembles Firefox's "search as you type" somewhat, but is better illustrated by a similar feature in an open source clipboard extender, [Ditto](http://ditto-cp.sourceforge.net/): ![Ditto search interface](https://i.stack.imgur.com/5I8db.png) There is a list of items that handles typical navigation events. However, any alphanumeric keys as well as navigation and editing commands (right/left arrows, shift+arrows, backspace, delete etc.) should be rerouted to the edit box below the list. An OnChange event of the edit box will trigger a refresh of the list. The point of the UI is that user does not have to tab or shift-tab between the controls. The two controls (the list and the edit box) should 'feel" as if they were a single control. The behavior of the search UI should be contingent on which control has focus. It seems my best option is to from the list control (I'm using [TcxTreeList](http://www.devexpress.com/Products/VCL/ExQuantumTreeList/)) to the edit box, and forward a handful of navigation keys from the edit box to the list. How can I achieve that? 1. TcxTreeList supports incremental search of course, but this is not what I'm after. The search goes to an SQLite database and looks for substring matches. The list displays only the matching items from the db. 2. There is some overlap, e.g. both controls would normally handle VK_HOME and VK_END, but that's OK - in this case the keys would go to the list. I'll need to decide whether to forward each individual keypress, or handle it in the control that received it. One obvious way seemed to be to invoke the respective KeyDown, KeyUp and KeyPress methods of the edit control, like so: ``` type THackEdit = class( TEdit ); procedure TMainForm.cxTreeList1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin THackEdit( edit1 ).KeyDown( Key, Shift ); end; ``` Unfortunately, this has no effect. My guess is TEdit won't process key events unless it is focused. Using SendMessage( THackEdit( edit1 ).Handle, WM_KEYDOWN, Key, 0 ) has no effect, either.
Forwarding keyboard events from one Windows control to another
CC BY-SA 2.5
0
2011-01-18T15:05:23.720
2011-01-18T18:14:06.787
2011-01-18T18:14:06.787
9,226
9,226
[ "windows", "delphi", "keyboard-events", "forwarding" ]
4,726,053
1
11,199,639
null
3
9,374
a program of mine uses AxShockwaveFlash component used as stream player. The problem is that my code works with most stream-providers (livestream, ustream, own3d.tv) but Justin.TV's player is somewhat problematic. Before moving on the actual problem let me summarize my code; Inherited FlashControl - this allows me to override the flashplayer's built-in menu: ``` public class FlashPlayer : AxShockwaveFlashObjects.AxShockwaveFlash // Customized Flash Player. { private const int WM_MOUSEMOVE = 0x0200; private const int WM_MOUSEWHEEL = 0x020A; private const int WM_LBUTTONDOWN = 0x0201; private const int WM_LBUTTONUP = 0x0202; private const int WM_LBUTTONDBLCLK = 0x0203; private const int WM_RBUTTONDOWN = 0x0204; private const int WM_RBUTTONUP = 0x0205; public new event MouseEventHandler DoubleClick; public new event MouseEventHandler MouseDown; public new event MouseEventHandler MouseUp; public new event MouseEventHandler MouseMove; public FlashPlayer():base() { this.HandleCreated += FlashPlayer_HandleCreated; } void FlashPlayer_HandleCreated(object sender, EventArgs e) { this.AllowFullScreen = "true"; this.AllowNetworking = "all"; this.AllowScriptAccess = "always"; } protected override void WndProc(ref Message m) // Override's the WndProc and disables Flash activex's default right-click menu and if exists shows the attached ContextMenuStrip. { if (m.Msg == WM_LBUTTONDOWN) { if (this.MouseDown != null) this.MouseDown(this, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 1, Cursor.Position.X, Cursor.Position.Y, 0)); } else if (m.Msg == WM_LBUTTONUP) { if (this.MouseUp != null) this.MouseUp(this, new MouseEventArgs(System.Windows.Forms.MouseButtons.None, 0, Cursor.Position.X, Cursor.Position.Y, 0)); } else if (m.Msg == WM_MOUSEMOVE) { if (this.MouseMove != null) this.MouseMove(this, new MouseEventArgs(System.Windows.Forms.MouseButtons.None, 0, Cursor.Position.X, Cursor.Position.Y, 0)); } else if (m.Msg == WM_RBUTTONDOWN) { if (this.ContextMenuStrip != null) this.ContextMenuStrip.Show(Cursor.Position.X, Cursor.Position.Y); m.Result = IntPtr.Zero; return; } else if (m.Msg == WM_LBUTTONDBLCLK) { if (this.DoubleClick != null) this.DoubleClick(this, new MouseEventArgs(System.Windows.Forms.MouseButtons.Left, 2, Cursor.Position.X, Cursor.Position.Y, 0)); m.Result = IntPtr.Zero; return; } base.WndProc(ref m); } } ``` Player window code: (Player is an instance of FlashPlayer) ``` private void Player_Load(object sender, EventArgs e) { try { this.Text = string.Format("Stream: {0}", this._stream.Name); // set the window title. this.Player.LoadMovie(0, this._stream.Movie); // load the movie. if (this._stream.ChatAvailable && Settings.Instance.AutomaticallyOpenChat) this.OpenChatWindow(); } catch (Exception exc) { // log stuff. } } ``` So this works great for livestream.com, ustream.com, own3d.tv but when it come's to justin.tv's player i'm getting a 1337 error (invalid embed code). So i tried to [ask them](http://community.justin.tv/forums/showthread.php?t=5604) for support but could't get a valid answer. _stream.movie variable actually holds a valid URL for the stream source like; > [http://cdn.livestream.com/grid/LSPlayer.swf?channel=%slug%&autoPlay=true](http://cdn.livestream.com/grid/LSPlayer.swf?channel=%slug%&autoPlay=true) (livestream sample) or > [http://www.justin.tv/widgets/live_embed_player.swf?channel=%slug%&auto_play=true&start_volume=100](http://www.justin.tv/widgets/live_embed_player.swf?channel=%slug%&auto_play=true&start_volume=100) (justin.tv sample) Tried to urlencode the 'channel=%slug%&auto_play=true&start_volume=100' part for justin.tv but that did not work also. So i started trying some work-arounds which at first place i thought setting flashVars variable of the control. But i've a strange problem there, whenever i try to set flashVars variable it never get's set. I found a sample screenshot on the issue; ![alt text](https://i.stack.imgur.com/FcfwJ.jpg) So if i was able to set the flashVariables may be i could work-around the justin.tv player's error. Btw, i also tried setting variables using Player.SetVariable(key,value) - that didn't work also. Notes: - - -
Setting FlashVars of AxShockwaveFlash
CC BY-SA 2.5
0
2011-01-18T15:50:59.783
2012-10-21T07:23:28.770
null
null
170,181
[ "c#", "axshockwaveflash", "justin.tv" ]
4,726,083
1
null
null
8
276
Screenshot of a footer: ![Screenshot](https://i.stack.imgur.com/E0aeQ.jpg) I'm unsure if there is a particular name for that kind of footer or if it's a widget for a certain framework. That particular example was taken from buffalonews.com After I know the name I can refine my searching for implementing it. Thank you for your input.
Is there a name for this type of popular footer?
CC BY-SA 2.5
0
2011-01-18T15:53:46.980
2011-01-31T21:32:37.290
2011-01-31T21:32:37.290
298,053
580,185
[ "html", "widget", "footer" ]
4,726,302
1
4,726,356
null
0
602
Sup fellas, I am using the script that a fellow stack overflow user posted [here](https://stackoverflow.com/questions/1767322/pre-load-existing-data-into-a-core-data-based-iphone-app)(the post by kalperin) to pre-load data to an SQL Lite store. So I have a command-line utility project that I am using and I have an iPhone application in which I successfully parsed my .plist file and stored it in Core Data, and I am trying to copy over code from my iPhone application to this command-line utility(the plist parsing parts at least). The data model I have made looks like so: ![alt text](https://i.stack.imgur.com/bIXZf.png) Those two classes inherit from ParkingRegionOverlay which requires the MapKit framework which is not addable to a project of this type(as far as I know). So my questions: 1. How would I bypass this problem(i.e. How do I get the Mapkit framework as part of my command-line utility project?)? 2. Do I need to include my .xcdatamodel file in the command-line utility project and reference it in any way? If someone wouldn't mind shedding some light in this area it would be greatly appreciated, as I think I do need my project to know about the data model, but am not quite sure. Thanks in advance for any help!
Attempting to Pre-load Data into Core Data Store
CC BY-SA 2.5
null
2011-01-18T16:15:23.100
2011-01-18T16:21:39.493
2017-05-23T12:13:26.330
-1
347,339
[ "iphone", "xcode", "core-data", "command-line", "preloader" ]
4,726,318
1
4,728,050
null
0
5,033
# The Situation: I have two classes that are represented in a TreeView. DiskSpec and DiskSet. DiskSpec can exist by itself, or it can be a child of DiskSet. I am working on enabling DragDrop functionality so that the user can drag a DiskSpec from the DiskSpec node onto a DiskSet to add it to that DiskSet. Now all is working except for one thing. My DragDropHelper class needs to specify in an ItemsPresenter (or related class) that that control is a drag source or a drop target. My TreeView is set up like so: ![TreeView](https://i.stack.imgur.com/QFxfI.png). # The Problem: So I really need to have two TreeViewItem Styles. Once for DiskSets (which specifies that the ItemsPresenter that will present the DiskSpecs is a DropTarget) and one for everything else which specifies that it's ItemsPresenter is a DragSource. Unfortunately I have not seen any way to set the TreeViewItem Style or Template from the HierarchicalDataTemplate object, and there does not appear to be a way to specify that this ItemTemplate is only for a particular DataType. Any thoughts? Or am I missing something? Find below some samples from my XAML. ## Default TreeViewItem See the ItemsPresenter section for an example of the DragDropHelper properties settings. ``` <Style TargetType="{x:Type TreeViewItem}"> <Setter Property="IsExpanded" Value="{Binding IsExpanded, Mode=TwoWay}"/> <Setter Property="Background" Value="Transparent"/> <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/> <Setter Property="Padding" Value="1,0,0,0"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> <Setter Property="FocusVisualStyle" Value="{StaticResource TreeViewItemFocusVisual}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TreeViewItem}"> <Grid Margin="0,4,0,0"> <Grid.ColumnDefinitions> <ColumnDefinition Width="Auto" MinWidth="10"/> <ColumnDefinition Width="*"/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" MinHeight="27.75"/> <RowDefinition/> </Grid.RowDefinitions> <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="#00376206" Foreground="#00000000" Style="{DynamicResource ToggleButtonStyle1}" Grid.Column="1"> <ToggleButton.Background> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="White" Offset="0"/> <GradientStop Color="#00F3EEDB" Offset="0.9"/> </LinearGradientBrush> </ToggleButton.Background> </ToggleButton> <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.Column="0" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" Grid.ColumnSpan="2" CornerRadius="7" Height="26" VerticalAlignment="Top" Margin="0,0,8,0" Background="#59000000"> <ContentPresenter x:Name="PART_Header" ContentSource="Header" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="5,3,0,3" VerticalAlignment="Center"/> </Border> <ItemsPresenter x:Name="ItemsHost" Grid.ColumnSpan="2" Grid.Column="1" Grid.Row="1" drag:DragDropHelper.IsDropTarget="False" /> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsExpanded" Value="false"> <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/> </Trigger> <Trigger Property="HasItems" Value="false"> <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/> </Trigger> <Trigger Property="IsSelected" Value="true"> <Setter Property="BitmapEffect" TargetName="Bd"> <Setter.Value> <DropShadowBitmapEffect /> </Setter.Value> </Setter> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}"/> <Setter Property="Background" TargetName="Bd"> <Setter.Value> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"> <GradientStop Color="#FF5C5C5C" Offset="0.27"/> <GradientStop Color="#FF585858" Offset="1"/> <GradientStop Color="#FF747474" Offset="0"/> </LinearGradientBrush> </Setter.Value> </Setter> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsSelected" Value="true"/> <Condition Property="IsSelectionActive" Value="false"/> </MultiTrigger.Conditions> <Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/> </MultiTrigger> <Trigger Property="IsEnabled" Value="false"> <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="VirtualizingStackPanel.IsVirtualizing" Value="true"> <Setter Property="ItemsPanel"> <Setter.Value> <ItemsPanelTemplate> <VirtualizingStackPanel/> </ItemsPanelTemplate> </Setter.Value> </Setter> </Trigger> </Style.Triggers> </Style> ``` ## TreeView structure ``` <TreeView x:Name="treeView" Margin="4,40,4,4" Style="{DynamicResource SnazzyTreeView}" > <TreeView.Resources> </TreeView.Resources> <TreeViewItem ItemsSource="{Binding Disks}" IsExpanded="True" drag:DragDropHelper.IsDragSource="True" drag:DragDropHelper.IsDropTarget="False" drag:DragDropHelper.DragDropTemplate="{StaticResource draggedDisk}"> <TreeViewItem.Header> <TextBlock Text="Disks" Foreground="White" FontSize="16"/> </TreeViewItem.Header> </TreeViewItem> <TreeViewItem ItemsSource="{Binding DiskSets}" IsExpanded="True"> <TreeViewItem.Header> <TextBlock Text="DiskSets" Foreground="White" FontSize="16"/> </TreeViewItem.Header> </TreeViewItem> </TreeView> ``` [Bea Stolnitz's Blog Post: How can I drag and drop items between data bound ItemsControls?](http://bea.stollnitz.com/blog/?p=53)
How can I specify which TreeViewItem Style/Template for a TreeViewItem Generated from HierarchicalDataTemplate?
CC BY-SA 2.5
null
2011-01-18T16:17:37.570
2011-01-19T15:06:04.173
2011-01-19T15:06:04.173
281,348
281,348
[ "wpf", "drag-and-drop", "hierarchicaldatatemplate", "treeviewitem" ]
4,726,451
1
4,726,714
null
0
976
![alt text](https://i.stack.imgur.com/5e4kW.png) how do i get rid of the borders in ul > li ? i have : ``` errorLabelContainer: $("ul", $('div.error')), wrapper: 'li', errorContainer: $('div.error'), ``` i tried : ``` div.message{ background: transparent url(images\ad_next.png) no-repeat scroll left center; padding-left: 17px; border:0px; } div.message ul, li { border:0px; } div.error{ background-color:#F3E6E6; border-color: #924949; border-style: solid solid solid solid; border-width: 2px; padding: 5px; } ```
jquery validate and error styles
CC BY-SA 2.5
null
2011-01-18T16:31:15.283
2011-01-18T16:54:39.713
null
null
121,400
[ "jquery", "css", "validation" ]
4,726,455
1
null
null
0
550
I've got a container view that holds 2 view controllers, each of which in turn hosts a CPGraphHostingView. The heirarchy is something like this ContainerView - TopView - BottomView I initialize topViewController(initWithNibName), resize the view to 70% of the height and add the topViewController.view to containerView subviews Similarly for BottomView, except that the height is 30% These 2 views now span the height of the container view. However, the bar plot drawn in the bottom view does not respect the super views height coordinates and draws the bars out of range resulting in the need for a vertical scroll. I've also tried adjusting the plotScale post addition of graph, but causes me to lose some alignment. Strangely, the scatter chart view in the top view seems to behave better and scales when i flip the top: bottom ratio to 3:7 from the original 7:3. Are bar plots supposed to behave differently ? Or am i missing something here. Attached are the images for my issue. notice that in both cases , the top scatter chart seems to have scaled correctly. Also, i tested by using the scatter chart code in the bottomViewController (to make sure that this wasn't some nib issue) and again with scatter chart the scaling seems to just work. Thanks a lot. PS: i didn't use google groups because i could not post images there. ![bar chart does not scale to 30%](https://i.stack.imgur.com/5nAVr.png) ![does not eve scale to 70% properly](https://i.stack.imgur.com/oqPXh.png) ![alt text](https://i.stack.imgur.com/3UUKm.png) ![alt text](https://i.stack.imgur.com/2Q3ap.png)
Core plot not sizing the plot area appropriately for bar graph
CC BY-SA 2.5
null
2011-01-18T16:31:23.963
2011-07-16T18:22:56.213
2011-01-18T21:09:07.843
154,353
154,353
[ "iphone", "charts", "core-plot" ]
4,726,853
1
null
null
1
537
I have this config in my file: ``` <connectionStrings> <add name="LocalConnString" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\NCU.Joberwocky.Db.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" /> </connectionStrings> ``` This in my : ``` <?xml version="1.0"?> <configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform"> <connectionStrings> <add name="LocalConnString" connectionString="metadata=res://*/;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=192.168.10.3;Initial Catalog=AeorionJobs;User Id=aeorionjobs;Password=aejobs3695;MultipleActiveResultSets=True&quot;" xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/> </connectionStrings> </configuration> ``` When I switch the build to release, it still uses the config from . Any idea what the problem is? ![alt text](https://i.stack.imgur.com/QAefj.png)
Config Transform does not work?
CC BY-SA 2.5
null
2011-01-18T17:09:05.250
2011-08-26T08:46:59.017
null
null
400,861
[ "visual-studio-2010" ]
4,726,875
1
4,756,983
null
0
2,293
The image below represents what I'm trying to achieve. The main object is a div that is position:relative. The two protruding arrow tabs are divs that are position:absolute with negative values so that they sit outside of the parent's perimeter. This works fine in all browsers except IE7 and IE8 which cut the tabs off completely as if the parent object had the style overflow:hidden. HTML: ``` <div id='parent'> <div id='arrowLeft'></div> <div id='arrowRight'></div> </div> ``` CSS: ``` #parent{ position:relative; width:600px; height:400px; } #arrowLeft{ width:40px; height:50px; position:absolute; left:-40px; top:50%; margin-top:-25px; } #arrowRight{ width:40px; height:50px; position:absolute; right:-40px; top:50%; margin-top:-25px; } ``` Thanks all, appreciate your time! W. ![alt text](https://i.stack.imgur.com/UDtws.png)
Negative Absolute Positioning Causing Hidden Overflow (IE7/8)
CC BY-SA 2.5
null
2011-01-18T17:10:38.033
2011-01-21T08:57:47.527
2011-01-19T20:46:03.063
405,015
516,629
[ "css", "internet-explorer-8", "internet-explorer-7", "overflow", "positioning" ]
4,727,083
1
null
null
3
6,963
I'm having a problem with the "overflow: hidden" CSS property. In Firefox, IE8 and Safari 5 when I apply this property to a div that is used for containing ad banners (like adsense leader boards or flash) at the top of my content there is still some overlap happening in Chrome when the window is resized to be small enough that they collide. In Firefox and IE8 it works as expected and everything is completely hidden behind the right sidebar. In Chrome the actual content is hidden but it is replaced with a white background that still overlaps and blocks out the sidebar. I have linked to a screenshot showing what the problem looks like. Is there anything I can do to fix this?! ![Screenshot](https://i.stack.imgur.com/DrYb9.png) [http://tinypic.com/r/259cs95/7](http://tinypic.com/r/259cs95/7)
Overflow:hidden not working as expected in Google Chrome
CC BY-SA 3.0
0
2011-01-18T17:29:19.457
2012-09-16T11:14:04.043
2011-12-12T09:09:05.693
1,022,826
580,310
[ "css", "google-chrome", "overflow", "hidden" ]
4,727,115
1
4,727,646
null
0
58
I have just made a very simple static side via wordpress. However, I made the theme from scratch with html and css. It looks perfect and exactly how I want in FFox,Chrome,Safari etc...but upon inspection in IE 6,7,8 is is not right. Click {[here](http://www.paradeofflesh.com)} to see the site and if you don't have IE... Here is a screen shot of how it is rendering in there. ![alt text](https://i.stack.imgur.com/SLVhn.png) Any idea on what this may be or an idea on how to fix it would be greatly appreciated. I can't find any syntax errors in my css and the html seems right Thanks
IE structural problems
CC BY-SA 2.5
null
2011-01-18T17:32:04.803
2011-01-18T18:29:17.997
2011-01-18T17:40:24.273
302,093
302,093
[ "html", "css", "internet-explorer", "wordpress", "syntax-error" ]
4,727,119
1
4,729,534
null
11
10,054
Continuing from this thread: [What are good algorithms for vehicle license plate detection?](https://stackoverflow.com/questions/4707607/what-are-good-algorithms-for-vehicle-license-plate-detection) I've developed my image manipulation techniques to emphasise the license plate as much as possible, and overall I'm happy with it, here are two samples. ![alt text](https://i.stack.imgur.com/maaMm.png) ![alt text](https://i.stack.imgur.com/gZRfr.png) Now comes the most difficult part, actually detecting the license plate. I know there are a few edge detection methods, but my maths is quite poor so I'm unable to translate some of the complex formulas into code. My idea so far is to loop through every pixel within the image (for loop based on img width & height) From this compare each pixel against a list of colours, from this an algorithm is checked to see if the colors keep differentiating between the license plate white, and the black of the text. If this happens to be true these pixels are built into a new bitmap within memory, then an OCR scan is performed once this pattern has stopped being detected. I'd appreciate some input on this as it might be a flawed idea, too slow or intensive. Thanks
Continued - Vehicle License Plate Detection
CC BY-SA 2.5
0
2011-01-18T17:32:30.880
2013-10-26T18:59:23.950
2017-05-23T12:10:15.103
-1
408,757
[ "c#", "image", "computer-vision", "gdi+", "object-detection" ]
4,727,210
1
4,727,446
null
1
5,801
Trying to run the following query on a mysql table that has over 3 million rows. Its very slow to the point it pretty much hangs until the script times out. Below is the query and the explain from that query, any suggestions? ``` SELECT SQL_CALC_FOUND_ROWS listing_track.listingid, listing_track.commid, listing.listingname, listing_package.packagename, listing.active, community.commname, SUM( listing_track.impression ) AS listing_impressions, SUM( listing_track.view ) AS listing_views, SUM( listing_track.phone ) AS listing_phones, SUM( listing_track.forward ) AS listing_forward, SUM( listing_track.coupon ) AS listing_coupons, SUM( listing_track.email ) AS listing_emails FROM listing_track INNER JOIN listing ON listing_track.listingid = listing.id INNER JOIN community ON listing_track.commid = community.id INNER JOIN listing_package ON listing.packageid = listing_package.id WHERE listing_track.commid =2 GROUP BY listing_track.commid, listing_track.listingid, listing_track.trackip LIMIT 0 , 25 ``` Here is the explain: ![alt text](https://i.stack.imgur.com/KrXgx.jpg)
Mysql Query Slow on large table
CC BY-SA 2.5
0
2011-01-18T17:42:56.800
2017-11-14T20:34:27.310
2017-11-14T20:34:27.310
4,370,109
500,805
[ "mysql", "sql", "performance" ]
4,727,436
1
4,727,532
null
1
389
I have lists nested within lists like this: ``` <ul> <li><a href="#">Rings</a></li> <li><a href="#">Bracelets</a></li> <li><a href="#">Earrings</a> <ul> <li><a href="#">Diamond Earrings</a></li> <li><a href="#">Hoop Earrings</a></li> ... </ul> </li> <li><a href="#">Necklaces and Pendants</a> ... </ul> ``` The lists are floated left. The nested lists are defaulted to not be displayed. So it ends up looking like this: ![alt text](https://i.stack.imgur.com/SAnMO.jpg) This so far I have. Now what I want to do is whenever a list is hovered that has a nested list (for example ). I want the nested list to be revealed like so: ![alt text](https://i.stack.imgur.com/OMT8q.jpg) Notice what all is going on here, Its putting them in a block between the first level lists where they wrap (between "Sports Jewelry" and "Charms"). I am not sure how to go about this. Any ideas?
How to display nested lists like this?
CC BY-SA 2.5
null
2011-01-18T18:06:41.340
2011-01-18T18:15:25.943
2011-01-18T18:14:11.843
46,011
46,011
[ "javascript", "jquery", "css" ]
4,727,454
1
null
null
0
226
My client wants to create a form on his new WP site that when filled out and submitted will be submitted to his admin post queue to approve and if he approves gets posted on his site in the "blog" (which is actually a bunch of guitar like tabs). The form would be custom and have custom fields. Below is the form, but in the old design before I did a refresh on it. So, how hard would this be? He does want it in the WP admin panel which i began to do, but outside in a page like `/contribute` ![](https://i.stack.imgur.com/nlVZY.png)
WordPress Anonymous Postings?
CC BY-SA 2.5
null
2011-01-18T18:08:28.023
2012-12-13T08:51:55.293
null
null
144,833
[ "wordpress", "forms", "plugins", "content-management-system", "customization" ]
4,727,486
1
null
null
1
2,195
I'm working on a JDialog (by hand, no GUI builders) and I'm having a problem doing the layout. I have this: ![alt text](https://i.stack.imgur.com/0WcUn.jpg) My problem is that I don't know what how to tell that JList (within a JScrollPane) to have a Maximum width, I used the setSize, setMaximumSize and nothing works! I need that JList's width to be the half of the picture's size. Explain the layouts: The "Gene Information" is a GridLayout 2x4, it's contained by a JPanel with BoxLayout, the +/- JButtons is a BoxLayout also, all what I said before is within a BoxLayout. Now, the "Genes" JPanel is a GridBagLayout. What can I do? Thanks in advance! PD: The other borders are just for seeign the boundaries of the components. `Source Code:``scpGenesList.setViewportView(lstGenesList); pnlGeneInfo.setLayout(new GridLayout(4, 2, 10, 10)); pnlGeneInfo.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("Gene Information"), BorderFactory.createEmptyBorder(10, 10, 10, 10))); lblGeneSymbol.setText("Symbol:"); lblGeneSymbol.setHorizontalAlignment(SwingConstants.RIGHT); lblGeneChromosome.setText("Chromosome:"); lblGeneChromosome.setHorizontalAlignment(SwingConstants.RIGHT); lblGeneStartPosition.setText("Start Position:"); lblGeneStartPosition.setHorizontalAlignment(SwingConstants.RIGHT); lblGeneStopPosition.setText("Stop Position:"); lblGeneStopPosition.setHorizontalAlignment(SwingConstants.RIGHT); pnlGeneInfo.add(lblGeneSymbol); pnlGeneInfo.add(lblGeneSymbolValue); pnlGeneInfo.add(lblGeneChromosome); pnlGeneInfo.add(lblGeneChromosomeValue); pnlGeneInfo.add(lblGeneStartPosition); pnlGeneInfo.add(lblGeneStartPositionValue); pnlGeneInfo.add(lblGeneStopPosition); pnlGeneInfo.add(lblGeneStopPositionValue); pnlGWASAddRemoveButtons.setLayout(new BoxLayout(pnlGWASAddRemoveButtons, BoxLayout.X_AXIS)); pnlGWASAddRemoveButtons.add(Box.createHorizontalGlue()); pnlGWASAddRemoveButtons.add(cmdGenesAdd); pnlGWASAddRemoveButtons.add(Box.createHorizontalStrut(10)); pnlGWASAddRemoveButtons.add(cmdGenesRemove); pnlGWASAddRemoveButtons.add(Box.createHorizontalGlue()); pnlGeneInfoButtons.setLayout(new BoxLayout(pnlGeneInfoButtons, BoxLayout.Y_AXIS)); pnlGeneInfoButtons.add(pnlGeneInfo); pnlGeneInfoButtons.add(Box.createVerticalStrut(10)); pnlGeneInfoButtons.add(pnlGWASAddRemoveButtons); pnlGenesPanel.setLayout(new GridBagLayout()); pnlGenesPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder("Genes"), BorderFactory.createEmptyBorder(10, 10, 10, 10))); GridBagConstraints ctrGenes = new GridBagConstraints(); ctrGenes.fill = GridBagConstraints.BOTH; ctrGenes.gridx = 0; ctrGenes.gridy = 0; ctrGenes.gridwidth = 1; ctrGenes.gridheight = 1; ctrGenes.weighty = 1.0; ctrGenes.weightx = 1.0; ctrGenes.insets = new Insets(0, 0, 0, 10); pnlGenesPanel.add(scpGenesList, ctrGenes); GridBagConstraints ctrGenesInfoButton = new GridBagConstraints(); ctrGenesInfoButton.fill = GridBagConstraints.BOTH; ctrGenesInfoButton.gridx = 1; ctrGenesInfoButton.gridy = 0; ctrGenesInfoButton.gridwidth = 1; ctrGenesInfoButton.gridheight = 1; ctrGenesInfoButton.weighty = 1.0; ctrGenesInfoButton.weightx = 1.0; pnlGenesPanel.add(pnlGeneInfoButtons, ctrGenesInfoButton); contentPane.add(pnlGenesPanel); pack();```
Java-Swing: A problem using layout managers!
CC BY-SA 2.5
null
2011-01-18T18:11:23.783
2011-01-19T06:29:24.623
2011-01-18T19:00:21.880
159,652
159,652
[ "java", "swing", "layout-manager" ]
4,727,835
1
4,727,884
null
8
9,892
When I open the visual studio 2010 premium, Solution explorer doesn't show up. It was working and now its not. It is showing a out of memory exception. Any help would be greatly appreciated. Attached is the screen shot![alt text](https://i.stack.imgur.com/JzWO5.jpg)
Visual Studio solution explorer out of memory exception
CC BY-SA 2.5
null
2011-01-18T18:51:01.440
2011-01-18T20:03:26.200
2011-01-18T19:00:49.447
2,424
495,188
[ "visual-studio-2010" ]
4,728,078
1
4,728,190
null
2
1,531
On my local development server, I am running version 2.0.50727.4955 on the live server I am running 2.0.50727.42. On my live server I get: Compiler Error Message: CS0117: 'System.Web.UI.HtmlControls.HtmlForm' does not contain a definition for 'Action' On my development server everything works fine. Is this a .NET version issue or something else? Is there a way to make this work on my liver server with its current .Net version? Is there a way to upgrade from 2.0.50727.42 to 2.0.50727.4955? Thanks EDIT (Code): ``` if (Request.PathInfo.Length != 0) { string reqPath = Request.PathInfo; string raw = Request.RawUrl; string url = Request.Url.ToString(); if (reqPath.Length > 0) url = url.Replace(reqPath, ""); if (raw.Length > 0) url = url.Replace(raw, ""); litBasePath.Text = "<base href=\"" + url + "\">"; Page.Form.Attributes["Action"] = raw; } ``` EDIT (Local Setup) This is my local setup. I am not getting any compile errors when i run this locally. ![alt text](https://i.stack.imgur.com/oexCK.png) ![alt text](https://i.stack.imgur.com/u9hSi.png) ![alt text](https://i.stack.imgur.com/HLhrq.png)
ASP.NET - Page.Form.Action error
CC BY-SA 2.5
null
2011-01-18T19:20:31.743
2011-01-18T20:00:13.253
2011-01-18T19:50:09.670
308,079
308,079
[ "c#", "asp.net" ]
4,728,217
1
4,728,442
null
5
1,386
Considering the following table ![Key(KeyId int, Sequence varchar(14))](https://i.stack.imgur.com/7QLHk.png) The sequence value is a custom auto increment key combining letters and numbers that a particular client need for his system. We made a function called GetNextSequence() which should return the next value of the sequence. The step to reading and updating the sequence goes as follow 1. Read the sequence value using the KeyId: SELECT Sequence FROM [Key] WHERE KeyId = @Id 2. Parse the sequence value and determine the next value 3. Write the sequence value to the table: UPDATE [Key] SET Sequence = @Sequence WHERE KeyId = @Id Here is the C# code (simplified for clarity): ``` var transaction = connection.BeginTransaction(IsolationLevel.RepeatableRead); var currentSequenceValue = SqlUtils.ExecuteScalar(connection, transaction, "SELECT Sequence FROM [Key] WHERE KeyId = @Id", new SqlParameter("@Id", keyId)); var updatedSequenceValue = ParseSequence(currentSequenceValue); SqlUtils.ExecuteScalar(connection, transaction, "UPDATE [Key] SET Sequence = @Sequence WHERE KeyId = @Id", new SqlParameter("@Id", keyId), new SqlParameter("@Sequence", updatedSequenceValue)); transaction.Commit(); return updatedSequenceValue; ``` Our problem reside in that two different servers can access the same sequence and we end up getting a deadlock In C#, I tried to set up different lock combination like a transaction isolation `IsolationLevel.RepeatableRead` or `IsolationLevel.Serializable` or in SQL using table hint `ROWLOCK` and `HOLDLOCK`, but without success. I want that each server be able to read, manipulate and update a sequence in a atomic way. What is the proper way to setup a lock for this situation?
How to setup a lock for a read-manipulate-write operation?
CC BY-SA 2.5
null
2011-01-18T19:35:29.810
2011-01-18T23:13:09.733
2011-01-18T20:10:01.897
151,488
151,488
[ "c#", "sql-server-2008" ]
4,728,555
1
4,729,336
null
2
1,021
I've got a terrible issue with parallax normal mapping and I don't know what can be the problem. (OpenGL 2.0, C++, WinXP) My results: ![alt text](https://i.stack.imgur.com/Mn6GR.png) ![alt text](https://i.stack.imgur.com/CSDzc.png) (green are normals, blue are tangents and red are binormals (bitangents) ) Normal mapping is working fine so I assume the tangent vectors are good. The weird thing is, on some walls of cube, parallax mapping is done correctly and in others it is not. I'm sure my GLSL code is OK because I copied it from [http://www.dhpoware.com/demos/index.html](http://www.dhpoware.com/demos/index.html) where you can find a working parallax normal mapping demo - which works on my computer, too. I tried also 2 ways to calculate tangent vectors so it should not be an issue. I tried switching from DisplayList to VBO and in reverse, it gave the same results, so tangents are probably transferred correctly (I even tried to transfer it as gl_Color). Height map is loading correctly, I tried to set it as a diffuse map and it looked OK. glGetError() gives me No Errors and shader compile logs says so. Of course, I checked texture coordinates over nine thousand times. mystery... I don't even know what part of code analyze, have you guys got any suggestions ?
Problem with Parallax Normal Mapping in Opengl , GLSL
CC BY-SA 2.5
null
2011-01-18T20:14:17.233
2011-01-18T21:38:02.820
2011-01-18T20:26:42.090
503,776
503,776
[ "c++", "opengl", "glsl" ]
4,728,556
1
4,730,340
null
2
557
## Description I have a Parent GWT project that uses the gwt-maven-plugin. This project is split into 2 sub-projects: Domain and WebApp and each project contains pom.xml files. I'd like to split the domain code from GWT client code. ## Parent project - - ## Domain project [1] I think of of it as the server-side part of the application that runs on the server - - - - - - - - - ## WebApp project [2] I think of it as the client-side of the application that runs in the web browser. - - - - - - - ## Sequence diagram ![alt text](https://i.stack.imgur.com/siKkl.png) PersonUI will call GWTPersonService's methods which calls PersonService(I need this separation because PersonService.java will be called by non-GWT clients as well). PersonService will call PersonDAO which uses and returns PersonBean instances. Then, PersonBean gets converted to GWTPersonDTO and sent to the client by GWTPersonServiceImpl. ## Questions (edited) 1. In which project should I put the shared GWT code that normally lives under /shared folder? 2. Does it make sense to have GWTPersonServiceImpl.java and GWTPersonService.java in the domain project? My reason is that since all servlets live on the server, and the domain is for server-side then those classes should be in the Domain project. 3. Should I move GWTUtility.java inside Domain project? 4. Does it make sense to use DTO's? Is there any way to make it more straight-forward: i.e. use directly the PersonBean? 5. Is it possible to run this scenario in GWT Developer mode using maven? How easy is it to configure? 6. If you have any modifications/additions to the above scenario, please post them - or even better if you have already done an app it would help much to know how you did to solve this separation. Thank you!
is this GWT modules structure ok?
CC BY-SA 2.5
0
2011-01-18T20:14:28.373
2011-07-27T11:21:56.560
2011-01-19T07:52:59.417
361,272
361,272
[ "maven-2", "gwt", "dto", "gwt-rpc" ]
4,729,116
1
4,729,179
null
0
197
I'm puzzled why one of my queries is slow, I have indexes and I've just created a new one. Yet its still been quite slow and appears in my slow log. Heres my query... ``` SELECT *, COUNT( Word ) AS WordCount FROM `keywords` WHERE `LetterIdx` = 'A' GROUP BY Word ORDER BY Word; ``` Heres the query EXPLAIN'd ![alt text](https://i.stack.imgur.com/NRP7T.png) Heres my table structure and indexes. ![alt text](https://i.stack.imgur.com/6Vaz0.png)
MySQL, puzzled why query is slow, have an index?
CC BY-SA 2.5
null
2011-01-18T21:15:36.947
2012-07-11T15:24:46.067
2011-01-18T21:16:31.610
135,152
450,456
[ "sql", "mysql", "indexing", "query-optimization" ]
4,729,202
1
4,730,105
null
0
675
Thanks for all yor help. My requrirement is to prepend the column to a row with image. But my image is moving all the columns to the right. How to add image to only matching rows but not moving other columns to right. Iam attaching my screenshot here. Please help me.![alt text](https://i.stack.imgur.com/iy3E8.gif) Thanks, ``` <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script src="http://dlglobal.dl.com/Admin/IT/operations/Documents/jquery.SPServices-0.5.8.min.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function() { //alert("alert test"); /*$Textsql = $("td.ms-vb2:contains('Budakov')"); $Textsql.css("background-color", "#461B7E"); */ $().SPServices({ operation: "GetListItems", async: false, listName: "OnCallList", completefunc: function (xData, Status) { //alert(xData.responseXML.xml); $("#ctl00_m_g_87fe292c_7976_4ad4_bf5c_3c1ecf08b2d8_AdvancedDataGrid tr:first").append("<th></th>"); $(xData.responseXML).find("[nodeName=z:row]").each(function() { var TextList=$(this).attr("ows_Title"); $Textsql = $("td.ms-vb2:contains('" + TextList.toString() + "')"); $Textsql.parent().prepend("<td class='ms-vb2'><img src='http://dlglobal.dl.com/Admin/IT/operations/PublishingImages/OnCall.png' /></td>"); }); } }); }); </script> ```
Adding a table column using jquery and the new column should be the first column
CC BY-SA 2.5
null
2011-01-18T21:22:26.680
2011-01-18T23:08:59.753
null
null
346,514
[ "jquery" ]
4,729,325
1
4,736,445
null
6
6,921
So far, my uploadify implementation is running relatively smoothly except for one nagging issue. I have my uploadify browse prompt in a jquery-ui dialog modal window. Files get uploaded fine but for each file item chosen, two identical queue items (same id) appear. Only one of these queue items is actually updated with the progress bar although both seem to get the percentage updates. When the file upload is complete only one of these queue items (the same one updated with the progress bar) is removed. ![alt text](https://i.stack.imgur.com/4SLli.jpg) I tested it outside of the jquery-ui dialog modal window and the double queue item behavior vanished. I'd love to keep the uploadify prompt and queue within a modal dialog window if possible though. Any clues as to why using uploadify in a jquery-ui modal window causes this double queue item behavior? ``` $("#Filedata").uploadify({ 'scriptAccess': 'allways', 'uploader' :'<?php echo base_url();?>js/jquery.uploadify-v2.1.4/uploadify.allglyphs.swf', 'script': '<?php echo site_url();?>/upload/process_upload', 'cancelImg': '<?php echo base_url();?>js/jquery.uploadify-v2.1.4/cancel.png', 'folder' : '/', 'fileDataName' :'Filedata', 'buttonText' : 'Document...', 'width': '273', 'height': '51', 'wmode': 'transparent', 'auto' : true, 'multi' : false, 'fileExt' : '*.pdf;', 'fileDesc' :'Document', 'sizeLimit' : 10485760, 'simUploadLimit' : 1, 'queueSizeLimit' :'1', 'uploaderType' : 'flash', 'scriptData' : {'userdata':'<?php echo $userdata;?>','upload_token':'<?php echo $token['value'];?>'}, onProgress: function() { //hide upload button $("object#FiledataUploader").height(0); }, //workaround for bug in jQuery UI dialog/upoadify (double progress bars ) onOpen : function(event,ID,fileObj) { $('#FiledataQueue div.uploadifyQueueItem:first-child').hide(); }, onError: function(a, b, c, d) { if (d.status == 404) alert('Could not find upload script. Use a path relative to: ' + '<?= getcwd() ?>'); else if (d.type === "HTTP") alert('error ' + d.type + ": " + d.info); else if (d.type === "File Size") alert(c.name + ' ' + d.type + ' Limit: ' + Math.round(d.sizeLimit / 1024) + 'KB'); else alert('error ' + d.type + ": " + d.info); }, onComplete : function (event, queueID, fileObj, response, data) { var r = JSON.parse(response); $('#token').val(r['token']); $('#uploaded_filename').val(r['uploaded_filename']); $('#filename_encryption').val(r['encryption']); $('#FiledataQueue').html('Document <span class="bold" style="font-weight:bold;">'+ r['filename'] + '</span>'); }, onQueueFull: function(event, queueSizeLimit) { // supress dialog that mentions the queue is full return false; } }); ``` HTML: ``` <form id="form-document" method="" action=""> <input type="file" name="Filedata" id="Filedata" size="20" /> <input type="hidden" name="response" id="response" value=""/> <input type="hidden" name="upload_token" id="upload_token" value=""/> <input type="hidden" name="uploaded_filename" id="uploaded_filename" value=""/> <input type="hidden" name="filename_encryption" id="filename_encription" value=""/> <input type="hidden" name="uploaded_extension" id="uploaded_extension" value=""/> <input type="hidden" name="token" id="token" value="<?php echo $token['value'];?>"/> </form> ``` jQuery UI dialog: ``` dialog_data.dialog({ autoOpen: false, height: 700, width: 800, modal: true, bigframe: true, buttons: { 'Save': function() { $.ajax({ type: "GET", url: "<?php echo site_url();?>/upload/finish", dataType: 'html', data: $('#form-document').serialize(), success: function(){ oCache.iCacheLower = -1; oTable.fnDraw(); dialog_data.dialog('close'); } }); }, 'Close': function() { $(this).dialog('close'); $('.loading').hide(); } }, open: function(){ $('.loading').hide(); $("object#FiledataUploader").height(30); }, close: function() { $('#uploaded_filename').val(''); $('#filename_encription').val(''); $('#FiledataQueue').html(''); } }); ```
Uploadify + jQuery UI
CC BY-SA 2.5
0
2011-01-18T21:37:03.963
2015-03-25T14:03:41.100
2011-01-20T08:09:44.963
580,591
580,591
[ "jquery", "jquery-ui", "user-interface", "uploadify" ]
4,729,383
1
4,729,455
null
1
3,149
It possible vertical align text in TableColumn on middle? I add paragraph to the table cell of table. And this table I add to richTexBox control. Problem is that middle column consists of images(emoticons) and it is "align to the vertical center". It’s difficult for me to describe it. Here is an image: ![alt text](https://i.stack.imgur.com/8uGcw.jpg) I would like align first and third column vertical on the middle. I want text in this 3 columns on the same "level:. Func which create Table with this 3 columns is here: ``` public Table ConvertToTabRp(IRp rp, string avatarNick) { var tempRp = new Rp { RpText = rp.RpText, Nick = rp.Nick, Time = rp.Time, Your = rp.Your }; if (tempRp.Your) tempRp.Nick = avatarNick; string time = string.Format(CultureInfo.CurrentCulture, "{0}", DateTime.ParseExact(tempRp.Time, "yyyy-MM-dd HH:mm:ss", null) .ToString("dd-MM-yyyy HH:mm:ss").Replace("-", ".")); var tab = new Table {Margin = new Thickness(0, 0, 0, 0)}; var gridLenghtConvertor = new GridLengthConverter(); //1. col tab.Columns.Add(new TableColumn { Name = "colNick", Width = (GridLength)gridLenghtConvertor.ConvertFromString("100") }); //2.col tab.Columns.Add(new TableColumn { Name = "colMsg", Width = (GridLength)gridLenghtConvertor.ConvertFromString("Auto") }); //3.col tab.Columns.Add(new TableColumn { Name = "colDt", Width = (GridLength)gridLenghtConvertor.ConvertFromString("150") }); tab.RowGroups.Add(new TableRowGroup()); tab.RowGroups[0].Rows.Add(new TableRow()); var tabRow = tab.RowGroups[0].Rows[0]; //1.col - NICK var pNick = new Paragraph(new LineBreak()) { TextAlignment = TextAlignment.Left }; pNick.Inlines.Add(new Run(tempRp.Nick)); if (!tempRp.Your) { pNick.Foreground = Brushes.DodgerBlue; } tabRow.Cells.Add(new TableCell(pNick)); //2.col - MESSAGE tabRow.Cells.Add(new TableCell(ConvertToRpWithEmoticons(tempRp.RpText)) { TextAlignment = TextAlignment.Left}); //3.col - DATE TIME var pTime = new Paragraph(new LineBreak()) { TextAlignment = TextAlignment.Right }; pTime.Inlines.Add(time); tabRow.Cells.Add(new TableCell(pTime)); return tab; } ``` maybe solution can be: ``` var pNick = new Paragraph(new LineBreak()) { TextAlignment = TextAlignment.Left , **VerticalTextAligment = Center** }; ``` I don’t how vertical align in paragraph. Maybe is problem in way how I add image to paragraph, here is it code: ``` var image = new Image { Source = new BitmapImage(new Uri(path, UriKind.RelativeOrAbsolute)), Width = 20, Height = 20, }; para.Inlines.Add(new Run(separatemsg.Text) { BaselineAlignment = BaselineAlignment.TextBottom }); //insert smile para.Inlines.Add(new InlineUIContainer(image) {BaselineAlignment = BaselineAlignment.Bottom}); ``` and this paragraph is add to 2. column.
Align text in TableColumn /Paragraph
CC BY-SA 3.0
null
2011-01-18T21:43:07.670
2017-07-23T08:16:56.857
2017-07-23T08:16:56.857
4,370,109
null
[ "wpf", "paragraph" ]
4,729,872
1
null
null
7
2,461
So I've recorded some data from an Android GPS, and I'm trying to find the peaks of these graphs, but I haven't been able to find anything specific, perhaps because I'm not too sure what I'm looking for. I have found some MatLab functions, but I can't find the actual algorithms that do it. I need to do this in Java, but I should be able to translate code from other languages. ![alt text](https://i.stack.imgur.com/Tat1a.jpg) As you can see, there are lots of 'mini-peaks', but I just want the main ones.
Algorithm for detecting peaks from recorded, noisy data. Graphs inside
CC BY-SA 2.5
0
2011-01-18T22:38:22.433
2013-12-16T17:41:18.577
2011-01-18T22:41:50.830
127,059
580,645
[ "graph-algorithm" ]
4,730,114
1
4,730,134
null
2
5,205
I am having a problem with the following code: ``` int errorCount = 0; foreach (var cinf in client.GetType().GetProperties()) { var vinf = viewModel.GetType().GetProperty(cinf.Name); if (vinf != null) { if (cinf.GetValue(client, null) != vinf.GetValue(viewModel, null)) { errorCount++; } } } ``` It's for an automated test to see whether mapping a model object from a DTO has worked. If I use the more cumbersome approch of writing this for each property: ``` Assert.AreEqual(viewModel.ClientCompanyID, client.ClientCompanyID); ``` This works fine. The problem is: the reflection code evaluates "if val1 != val2" statement incorrectly (or so it seems). If I step through this code, the evaluation basically says "1 does not equal 1", and incorrectly adds an error. Furthermore, if I test this with this code, I get the same seemingly false result: ``` var clientEx = client.GetType().GetProperty("ClientCompanyID"); var viewModelEx = viewModel.GetType().GetProperty("ClientCompanyID"); var clientVal = clientEx.GetValue(client, null); var viewModelVal = viewModelEx.GetValue(viewModel, null); bool test = (clientVal == viewModelVal); ``` The bool returns false even when, stepping through the code, clientVal = 1 and viewModelVal = 1. See attached picture. ![alt text](https://i.stack.imgur.com/oTS5P.jpg) Any help with this would be greatly appreciated! Thanks guys. Tim. EDIT: Could have given you all the answer. Glad it was simple in the end. Thanks alot for your help. Cheers.
C# Reflection Property.GetValue() Problem
CC BY-SA 2.5
null
2011-01-18T23:09:54.400
2011-01-18T23:25:55.460
2011-01-18T23:25:55.460
422,327
422,327
[ "c#", "reflection" ]
4,730,152
1
4,730,266
null
47
46,667
I'm reading an .xlsx file using the [Office Open XML SDK](http://www.microsoft.com/downloads/en/details.aspx?FamilyId=C6E744E5-36E9-45F5-8D8C-331DF206E0D0&displaylang=en) and am confused about reading Date/Time values. One of my spreadsheets has this markup (generated by Excel 2010) ``` <x:row r="2" spans="1:22" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main"> <x:c r="A2" t="s"> <x:v>56</x:v> </x:c> <x:c r="B2" t="s"> <x:v>64</x:v> </x:c> . . . <x:c r="J2" s="9"> <x:v>17145</x:v> </x:c> ``` Cell J2 has a date serial value in it and a style attribute `s="9"`. However, the Office Open XML Specification says that 9 corresponds to a followed hyperlink. This is a screen shot from page 4,999 of . ![alt text](https://i.stack.imgur.com/s9bnI.png) The presetCellStyles.xml file included with the spec also refers to `builtinId` 9 as a followed hyperlink. ``` <followedHyperlink builtinId="9"> ``` All of the styles in the spec are simply visual formatting styles, not number styles. Where are the number styles defined and how does one differentiate a style reference `s="9"` from indicating a cell formatting (visual) style vs a number style? Obviously I'm looking in the wrong place to match styles on cells with their number formats. Where's the right place to find this information?
What indicates an Office Open XML Cell contains a Date/Time value?
CC BY-SA 2.5
0
2011-01-18T23:14:40.637
2021-01-20T07:19:51.073
2016-04-26T02:18:58.487
3,160,967
118,703
[ "excel", "openxml", "openxml-sdk" ]
4,730,464
1
4,865,667
null
1
1,572
I recently discovered a way to audit SMTP emails prior to them actually leaving the SMTP server. This is accomplished by changing the "Smart Host" value to something that is 1. Named a host that doesn't exist 2. Less than 15 characters 3. Has no periods in the name ![alt text](https://i.stack.imgur.com/xS7ye.png) This allows me to view the messages with Outlook Express, check the file attachments, and other programatically generated content through `System.Net.Mail` I release the messages by changing this to a valid value and restarting the SMTP service. How can I programatically change this value so I can allow for the controlled queueing, audit, and release of these email messages?
Possible to programatically change IIS's SMTP server "Smart Host"
CC BY-SA 2.5
0
2011-01-19T00:05:50.237
2011-02-04T14:53:58.593
2011-02-04T14:53:58.593
3,527
328,397
[ "c#", "iis", "smtp", "windows-server-2008", "wmi" ]
4,730,513
1
4,979,850
null
3
2,361
I am following this tutorial: [link text](http://webcache.googleusercontent.com/search?q=cache:U2ENWxCHB20J:www.kaloer.com/android-preferences+android+preference+screen&cd=3&hl=hu&ct=clnk&gl=hu) Preferences.java: ``` public class Preferences extends PreferenceActivity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); addPreferencesFromResource(R.xml.preferences); } ``` } PreferencesTutorial.java: ``` public class PreferencesTutorial extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button prefBtn = (Button) findViewById(R.id.prefButton); prefBtn.setOnClickListener(new OnClickListener() { public void onClick(View v) { Intent settingsActivity = new Intent(getBaseContext(), Preferences.class); startActivity(settingsActivity); } }); } ``` } Preferences.xml: ![alt text](https://i.stack.imgur.com/5FsxE.jpg) When application starts, and i click the prefButton, an error occures: "The application PreferencesTutorial (process PreferencesTutorial.com.examples) has stopped unexpectedly. Please try again" I haven't found any mistakes in the code. I would also like to show my filestructure if that helps: ![alt text](https://i.stack.imgur.com/3CY4T.jpg) AndroidManifest.xml: ![alt text](https://i.stack.imgur.com/Of7LT.jpg) What is wrong with the code? Even if i add (where the cursor is) ``` <activity android:name=".Preferences" android:label="@string/set_preferences"> </activity> ``` i still get the error.
Android preferences problem
CC BY-SA 2.5
null
2011-01-19T00:17:03.170
2012-05-10T23:12:02.833
2011-01-19T09:45:28.670
571,648
571,648
[ "android", "preferences" ]
4,730,588
1
4,740,999
null
1
304
Why would WCF be able to receive a message just fine, yet freezes when it tries to execute the Operation on the server? Specifically according to the Service Trace Viewer, it successfully opens the ServiceChannel and but is unable to open an InstanceContext or do any other action. No exceptions are thrown, it simply stops. What's really got me confused is that I setup my code just like I normally do, but, this service doesn't want to run, I have two other servers full of services that work great. I'm thinking its a minute detail in the configuration somewhere that I missed, but I can't find it. Anybody have any suggestions of where I should start looking? ![alt text](https://i.stack.imgur.com/XrVcc.png)
WCF Service won't execute incoming message
CC BY-SA 2.5
0
2011-01-19T00:30:49.440
2011-01-19T21:31:17.863
2011-01-19T06:14:54.903
13,302
580,741
[ "wcf" ]
4,730,666
1
4,730,718
null
35
34,706
I have the following HTML code ``` <form action="/script/upload_key.py" method="POST" enctype="multipart/form-data"> Key filename: <input name="file_1" type="file"> <input name="submit" type="submit"> </form> ``` which gives me the following stuff. ![alt text](https://i.stack.imgur.com/xkHea.png) I was wondering 1. How I can use JavaScript, to eliminate the need of Submit button. That's mean, once I Choose File, the selected file will be uploaded immediately? 2. How can I make sure the field to display selected file name is long enough, so that ... will not be shown?
POST immediately after select a file
CC BY-SA 2.5
0
2011-01-19T00:46:10.170
2018-07-04T12:42:18.470
2011-01-19T01:17:05.067
425,275
72,437
[ "javascript", "html" ]
4,730,691
1
4,856,003
null
13
17,299
Have read over a number of related questions here at SO, as well as looked through the Android docs and source to try to figure this out, but I am stumped, although given that the listSelector seems to only apply styles on selected items, I'm not shocked... I have a Listview defined in main.xml here: ``` <?xml version="1.0" encoding="utf-8"?> <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent"> <ListView android:id="@android:id/list" android:layout_width="fill_parent" android:layout_height="fill_parent" android:fadingEdgeLength="5dp" android:divider="#000000" android:dividerHeight="1dp" android:listSelector="@drawable/list_selector" /> <TextView android:id="@android:id/empty" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:singleLine="false" android:text="@string/message_list_empty" /> </FrameLayout> ``` The listSelector referenced is here (borrowed largely from the default Android State List found in the SDK: /android/platforms/android-8/data/res/drawable/list_selector_background.xml): ``` <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <!-- the window has lost focus, disable the items --> <item android:state_window_focused="false" android:drawable="@drawable/shape_row_disabled" /> <!-- the list items are disabled --> <item android:state_enabled="false" android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/shape_row_disabled" /> <item android:state_enabled="false" android:state_focused="true" android:drawable="@drawable/shape_row_disabled" /> <item android:state_enabled="false" android:drawable="@drawable/shape_row_disabled" /> <!-- the list items are enabled and being pressed --> <item android:state_focused="true" android:state_pressed="true" android:drawable="@drawable/shape_row_transition" /> <item android:state_focused="false" android:state_pressed="true" android:drawable="@drawable/shape_row_transition" /> <!-- the list items are enabled and being used --> <item android:state_focused="true" android:drawable="@drawable/shape_row_selected" /> <!-- the default item --> <item android:drawable="@drawable/shape_row" /> </selector> ``` The drawables referenced are shapes, rounded rectangles, like so: ``` <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle"> <gradient android:startColor="#EF6100" android:centerColor="#FF8E00" android:endColor="#EF6100" android:angle="270" /> <corners android:bottomRightRadius="7dp" android:bottomLeftRadius="7dp" android:topLeftRadius="7dp" android:topRightRadius="7dp" /> </shape> ``` So, the end result should be a ListView with items with a @drawable/shape_row background by default, and then different colored backgrounds depending on the state. When I fire up my list, everything works fine in terms of when states are active, such as an item gets focus, is pressed, etc, but the items themselves have a transparent background when none are selected (i.e. the default view state). I had hoped that the last rule of the State List, ``` <item android:drawable="@drawable/shape_row" /> ``` would capture that state, but for some reason it is not working. I have moved things around and tried different settings, and nothing. If I edit the row.xml file which I use to define the list items in the ListView and try to add a specific android:background that points to @drawable/shape_row, every row gets the correct background, BUT on pressed, on focus, etc states fail to process (or at least, can't be seen as the background never changes). Can anyone point me in the right direction here? I am SO close to putting this one to bed, but after trying nearly everything, just can't get the ListView items to take a default background AND respond to the implemented State List via android:listSelector. Thanks, Paul EDIT: Also just tried adding android:itemBackground="@drawable/shape_row" to the ListView in main.xml, and unsurprisingly no luck (the docs state it should be used to specify menu items' backgrounds, but thought it was worth a shot with list items). Another thing tried, adding android:visible="true" to each of the selector and item definitions. The StateListDrawable docs seem to indicate that the ["Provides initial visibility state of the drawable; the default value is false"](http://developer.android.com/reference/android/graphics/drawable/StateListDrawable.html#attr_android:visible), but adding this changed nothing. EDIT2: So, based on the research done below by Qberticus, it seems that there can be only one set of list selectors per view, which confirms the list selector behavior. I can also confirm that setting the android:drawSelectorOnTop does move the selector IN FRONT of the selected item, but this of course obscures the item itself such that I only see the selector itself (which in my case is a colored shape). Here is what the list looks like with backgrounds set: ![normal, unselected list with background set](https://i.stack.imgur.com/nyc0D.png) Due to the set background, there is no change in appearance when items are selected. If I change the android:drawSelectorOnTop directive to true and select an item, I get: ![selected, with drawSelectorOnTop set to true](https://i.stack.imgur.com/fejrN.png) And finally, if I set no background image for the list items, the selector works as expected, but of course, there are no background images as the last rule of the StateSelector does not appear to be followed (shouldn't it act as a catchall?) for non-selected items meaning no nice custom rounded shapes: ![selected, no background](https://i.stack.imgur.com/PpRBS.png) So, my problem remains; if I don't set a background for each list item, I can see the selector working BUT the items have no background when not selected. If I set a background for the item, they look great when not selected, but the background obscures the selector. Is it simply not possible to have a uniquely shaped list item with working selectors? Thanks for anyone else who can weight in.
Android ListView State List not showing default item background
CC BY-SA 2.5
0
2011-01-19T00:50:34.613
2013-01-23T15:48:03.283
2011-01-28T21:01:06.360
357,801
357,801
[ "android", "listview", "background", "state" ]
4,731,179
1
null
null
4
6,545
Create a local Proxy Judge using a Console or Windows Form application for debugging and testing connections. 1. Project must request and receive proxy ServerVariables to display on client side. 2. Parse IPAddress and return Anonymity state. 3. Implement Basic Athentifcation Scheme. 4. Project must not use Scripts for functionality (e.g) PHP, Perl, Asp, etc. 5. Multi-platform Compatible (possibilty) ![alt text](https://i.stack.imgur.com/p85yI.png) --- 1. Is it possible to use Request.ServerVariables on a local Windows or Console Application or is it ASP specific? 2. If this method is ASP specific is there another way to request the ServerVariables from a browser session? 3. If the method above is possible what is the proper approach for achieving this functionality? 4. What is a good example for verifing/Setting the Basic Authentification Scheme here? Like setting the password and user to be used and so on. --- [http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx](http://msdn.microsoft.com/en-us/library/system.web.httpapplication.aspx) [http://www.java2s.com/Code/CSharpAPI/System.Net/HttpListenerContextResponseStatusCode.htm](http://www.java2s.com/Code/CSharpAPI/System.Net/HttpListenerContextResponseStatusCode.htm) [http://en.cship.org/wiki/ProxyJudge](http://en.cship.org/wiki/ProxyJudge) ``` using System.IO; using System.Net; using System.Web; using System.Collections.Specialized; namespace IPJudge { public class IPJudgeClass : IHttpModule { public static void Main() { using (HttpListener listener = new HttpListener()) { listener.AuthenticationSchemes = AuthenticationSchemes.None; listener.Prefixes.Add("http://localhost:8080/"); //listener.Prefixes.Add("https://localhost/"); listener.Start(); HttpListenerContext ctx = listener.GetContext(); ctx.Response.StatusCode = 200; string name = ctx.Request.QueryString["name"]; StreamWriter writer = new StreamWriter(ctx.Response.OutputStream); writer.WriteLine("<P>Hello, {0}</P>", name); writer.WriteLine("<ul>"); foreach (string header in ctx.Request.Headers.Keys) { writer.WriteLine("<li><b>{0}:</b> {1}</li>", header, ctx.Request.Headers[header]); } writer.WriteLine("</ul>"); writer.Close(); ctx.Response.Close(); listener.Stop(); } } public void Init(HttpApplication app) { app.AcquireRequestState += new System.EventHandler(app_AcquireRequestState); app.PostAcquireRequestState += new System.EventHandler(app_PostAcquireRequestState); } public void app_AcquireRequestState(object o, System.EventArgs e) { HttpApplication httpApp = (HttpApplication)o; HttpContext ctx = HttpContext.Current; ctx.Response.Write(" Executing AcquireRequestState "); ctx.Response.Close(); } public void Dispose() { // TODO: // Add code to clean up the // instance variables of a module. } public void app_PostAcquireRequestState(object o, System.EventArgs e) { HttpApplication httpApp = (HttpApplication)o; HttpContext ctx = HttpContext.Current; string remotehost = ctx.Request.ServerVariables["REMOTE_ADDR"]; string httpuseragent = ctx.Request.ServerVariables["HTTP_USER_AGENT"]; string requstmethod = ctx.Request.ServerVariables["REQUEST_METHOD"]; string httpreferer = ctx.Request.ServerVariables["HTTP_REFERER"]; string HTTPXFORWARDEDFOR = ctx.Request.ServerVariables["HTTP_X_FORWARDED_FOR"]; string HTTPFORWARDEDFOR = ctx.Request.ServerVariables["HTTP_FORWARDED_FOR"]; string HTTPXFORWARDED = ctx.Request.ServerVariables["HTTP_X_FORWARDED"]; ctx.Response.Write("<P>REMOTE_ADDR: " + remotehost + "</P>"); ctx.Response.Write("<P>HTTP_USER_AGENT: " + httpuseragent + "</P>"); ctx.Response.Write("<P>REQUEST_METHOD: " + httpuseragent + "</P>"); ctx.Response.Write("<P>HTTP_REFERER: " + httpreferer + "</P>"); ctx.Response.Write("<P>HTTP_X_FORWARDED_FOR: " + httpreferer + "</P>"); ctx.Response.Write("<P>HTTP_FORWARDED_FOR: " + httpreferer + "</P>"); ctx.Response.Write("<P>HTTP_X_FORWARDED: " + httpreferer + "</P>"); ctx.Response.Close(); } } } ```
C# using HttpListener and Request.ServerVariables on Windows Forms or Console
CC BY-SA 2.5
null
2011-01-19T02:22:42.963
2011-01-22T22:38:00.257
2011-01-22T22:38:00.257
339,789
339,789
[ "c#", "windows", "forms", "httplistener", "request.servervariables" ]
4,731,790
1
4,780,346
null
4
3,706
I'm a NotePad++ user, new to TextMate. There are some features that I really like in NP++ but couldn't figure out if TextMate support them. ![alt text](https://i.stack.imgur.com/BbUvK.png) ![alt text](https://i.stack.imgur.com/Sr9LA.png) For this one, I don't know how to generate a screenshot ;-p. Basically, you can drag a file from Windows Explorer and drop it into NP++ to have it opened.
Are these NotePad++ features available in TextMate?
CC BY-SA 2.5
0
2011-01-19T04:39:11.420
2011-01-24T22:42:49.987
null
null
65,313
[ "textmate", "notepad++" ]
4,731,964
1
null
null
0
333
Can some please help me with making a similar saving calculator just like this one at the bottom right corner of this page [http://www.clickitrealtyinc.com/](http://www.clickitrealtyinc.com/) ![Savings Calculator](https://i.stack.imgur.com/hVsXt.png) I need to install something like this on my website and have no idea where to start.
How do I make saving calculator like this?
CC BY-SA 2.5
null
2011-01-19T05:15:22.260
2011-05-05T15:17:22.510
2011-01-19T05:23:58.250
313,758
580,940
[ "javascript" ]
4,731,976
1
4,741,235
null
1
5,277
SSRS2008R2 Merchant1 works below. MerchantX doesn't - see the widths of the columns span more than 1 day! Raw data is displayed below each chart. ![alt text](https://i.stack.imgur.com/y8Q3n.png) Here is chart data: ![alt text](https://i.stack.imgur.com/nX80i.png) I'm using Scalar to give me 0 date values. ![alt text](https://i.stack.imgur.com/QiIJp.png)
SSRS - Column Chart Thickness too thick
CC BY-SA 2.5
null
2011-01-19T05:17:30.823
2011-01-19T21:54:24.413
null
null
26,086
[ "reporting-services" ]
4,732,056
1
4,779,676
null
0
4,645
i am developing web application and contain modal popup extender in which update panel made and it contain file upload control but file upload control not working in it. This is my modal popup which contain fileupload control ![alt text](https://i.stack.imgur.com/VvaZS.jpg) and my modal popup source code ``` <cc1:ModalPopupExtender ID="AddNews" runat="server" PopupControlID="pnlPopUp1" BehaviorID="AddNews" TargetControlID="btnNews" BackgroundCssClass="modalBackground"> </cc1:ModalPopupExtender> <asp:Panel ID="pnlPopUp1" runat="server" CssClass="modalPopup" Height="450px" Width="660px" Style="display:none; z-index: 100000"> <asp:UpdatePanel ID="Upanel1" runat="server"> <ContentTemplate> <div> <table cellpadding="0" cellspacing="0" width="100%"> <tr style="height: 35px;"> <td style="width:170px"> </td> <td style="text-align: center"> <h1> Add News</h1> </td> <td style="text-align: right"> <asp:ImageButton ID="ImageButton2" AlternateText="Close Image" runat="server" ImageUrl="~/images/delete_32i.GIF" OnClientClick="return closePopup('News')" /> </td> </tr> <tr> <td colspan="2"> <asp:Label ID="lblAddNewsError" runat="server" Text="" ForeColor="Red"></asp:Label> </td> </tr> <tr> <td>News Title:</td><td> <asp:TextBox ID="txtNewTitle" Width="250px" runat="server" MaxLength="500"></asp:TextBox> </td><td> <asp:RequiredFieldValidator ID="rfvNewsTitle" runat="server" ControlToValidate="txtNewTitle" ErrorMessage="*" ToolTip="Enter news title" ValidationGroup="AddNews"></asp:RequiredFieldValidator> </td> </tr> <tr> <td>Upload News Video</td><td> <asp:FileUpload ID="FileUpload1" runat="server" /> </td><td><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="FileUpload1" ErrorMessage="Invalid video File" ValidationExpression="^([0-9a-zA-Z_\-~ :\\])+(.avi|.AVI|.wmv|.WMV|.flv|.FLV|.mpg|.MPG|.mp4|.MP4)$" ToolTip="Only allow avi, wmv, flv, mpg, mp4 formats video files" ValidationGroup="AddNews"></asp:RegularExpressionValidator></td> </tr> <tr style="height: 5px"> <td> </td> </tr> </table> <div> <table cellpadding="0" cellspacing="0" width="100%"> <tr> <td style="width: 675px"> <FCKeditorV2:FCKeditor ID="FCKAddNewsContent" basepath="~/fckeditor/" runat="server" Height="300px"></FCKeditorV2:FCKeditor> </td> <td valign="top"> </td> </tr> <tr> <td style="text-align:right"> <asp:Button ID="btnAddNews" runat="server" Text="Add News" onclick="btnAddNews_Click" ValidationGroup="AddNews" /> &nbsp;<asp:Button ID="btnClose" runat="server" Text="Close" OnClientClick="return closePopup('News')" CausesValidation="False" /></td><td></td> </tr> </table> </div> </div> </ContentTemplate> <Triggers> <asp:PostBackTrigger ControlID="btnAddNews" /> </Triggers> </asp:UpdatePanel> </asp:Panel> ``` as you see my one button also mentioned in postback trigger as i click on this button the result which i got is ![alt text](https://i.stack.imgur.com/eLx3J.jpg) can anyone help me out from this problem.
FileUpload not working in update panel(modal popup extender)
CC BY-SA 2.5
null
2011-01-19T05:33:02.467
2011-11-21T19:22:42.107
2011-01-19T06:50:07.193
306,567
306,567
[ "c#", "asp.net", "file-upload", "updatepanel", "modalpopupextender" ]
4,732,356
1
4,732,387
null
0
399
Using the existing `Binding` class, we can write, ``` <TextBox Text="{Binding Email, Mode=TwoWay}"/> ``` So we can write as Email; there is no validity check by `Binding` itself. I started writing a class `BindingMore` deriving from `Binding` so that eventually I could write, ``` <TextBox Text="{local:BindingMore Email, Validate=SomeMethod, Mode=TwoWay}"/> ``` Where `SomeMethod` is some `ICommand` or `delegate` which will be triggered to validate the `Email` . That is my objective, and I've not written that yet. As of now, I've written just this code, ``` public class BindingMore : System.Windows.Data.Binding { public BindingMore() : base() { } public BindingMore(string path) : base(path) { } } ``` So, at this stage, `BindingMore` is exactly equivalent to `Binding`, yet when I write ``` <TextBox Text="{local:BindingMore Email, Mode=TwoWay}"/> ``` It's giving me runtime error. But when I write, ``` <TextBox Text="{local:BindingMore Path=Email, Mode=TwoWay}"/> ``` It's working fine. Can anybody tell me why it's giving runtime error in the first case? Unfortunately, the error is not shown. All it shows is this: ![alt text](https://i.stack.imgur.com/2YOTQ.png) Also, I get the following error message from XAML (even when it builds perfectly and runs (in the second case)): > Type 'local:BindingMore' is used like a markup extension but does not derive from MarkupExtension.
Deriving from Binding class (Silverlight 4.0)
CC BY-SA 2.5
null
2011-01-19T06:27:00.693
2011-01-19T06:32:05.477
null
null
415,784
[ "wpf", "silverlight", "silverlight-4.0", "binding", "markup-extensions" ]
4,732,629
1
null
null
1
3,051
I want to resize width and height of inkcanvas to fit the screen. When I resized it, the width expands to the right and height expands to the bottom. But inkcanvas is not fit to screen. I also want to fix the position of inkcanvas child element. If I can resize inkcanvas to fit the screen, the position of inkcanvas child element will not change. How do I resize inkcanvas to the left and top to fit the screen? ![alt text](https://i.stack.imgur.com/uwfY3.jpg) ``` <Canvas x:Name="Screen" > <InkCanvas Name="inkcanvas" ResizeEnabled="True" Width="{Binding ElementName=LayoutRoot, Path=ActualWidth}" Height="{Binding ElementName=LayoutRoot, Path=ActualHeight}" EditingMode="Select" ClipToBounds="False" Background="Bisque" SelectionChanging="OnSelectionChanging" Visibility="Collapsed" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> <!-- InkCanvas' Child Elements --> </InkCanvas> <Canvas.RenderTransform> <MatrixTransform/> </Canvas.RenderTransform> </Canvas> ``` Thanks I put inkcanvas in a grid. It fit to the screen but the position of child element is changed. I want to fix the red rectangle position. ![alt text](https://i.stack.imgur.com/9D94r.jpg) The position of red rectangle should not be changed. ![alt text](https://i.stack.imgur.com/LUizs.jpg) ``` <Grid> <InkCanvas x:Name="inkcanvas" Background="Transparent"> <Rectangle Height="41" HorizontalAlignment="Left" Name="rectangle1" Stroke="Black" VerticalAlignment="Top" Width="69" Fill="#FFDB1111" /> </InkCanvas> </Grid> ``` My WPF Application contain many pictures. I can zoom in/out the canvas. I can select the pictures by using selection tool. I have canvas and inkcanvas. - canvas: contain picture and zoom in/out- inkcanvas: has selection tool If I zoom out, the canvas and inkcanvas become smaller. If I use selection tool, I copy all pictures from canvas to inkcanvas. But the inkcanvas is zoom out, I cannot use selection tool if outside the inkcanvas boundary. It is the reason why I want to resize inkcanvas and fix the children position.
Resizing inkcanvas to the left and top
CC BY-SA 2.5
null
2011-01-19T07:11:40.907
2018-07-06T10:33:23.107
2011-01-19T08:39:10.557
556,917
556,917
[ "c#", "wpf", "inkcanvas" ]
4,732,624
1
null
null
5
5,460
All, I have a SVG rectangle in my application which can be stretched horizontally by dragging the end bar (left & right) on either side of the rectangle. The rectangle can be (1) resized (by stretching as per above), (2)dragged, (3)& rotated. Everything works fine, however, one strange experience is that when I rotate the rectangle to a degree close to 90, & then try to resize the rectangle, it starts stretching from the opposite border of the rectangle instead of the original borders. (here is the image): ![rendition of functionality](https://i.stack.imgur.com/GMdF2.jpg) It appears to be getting confused between left and right when I use the rotate function. Here is the revised HTML, JS & SVG: ``` <%@page contentType="text/html" pageEncoding="UTF-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <!-- <script type="text/javascript" src="CPolyline.js"> </script>--> </head> <body> <object id="oo" data="rect2.svg" style="position:fixed;width: 800px;height:800px;bottom:-100px;right: 375px;"> </object> path: <input type="button" id="path" onclick="X()"> path2: <input type="button" id="path2" onclick="Y()"> <input type="button" value="Rotate" onclick="Rotate1()"> <script type="text/javascript"> var ob=document.getElementById("oo") var svgDoc=null; var svgRoot=null; var MyGroupObjectsObj = null; var svgNS = "http://www.w3.org/2000/svg"; var dragTarget = null; var rectTemplate = null; var grabPoint = null; var clientPoint = null; var rectX = null; var rectY = null; var rectWidth = null; var rectHeight = null; var arr=new Array(); var resizingLeft = false; var resizingRight = false; var rectrot=null ob.addEventListener("load", function(){ svgDoc=ob.contentDocument; svgRoot=svgDoc.documentElement; grabPoint = svgRoot.createSVGPoint(); clientPoint = svgRoot.createSVGPoint(); rectTemplate = svgDoc.getElementById('rectTemplate') rectrot=svgDoc.getElementById("rect1") }, false) var angel=0 function Rotate1() { angel=angel+10 //alert(rectrot) var c=rectTemplate.getAttribute("transform"); var widt=Number(rectTemplate.getAttribute("width"))/2; var hie=Number(rectTemplate.getAttribute("height"))/2 var tran=c.match(/[\d\.]+/g); var newxpo=Number(tran[0])+widt; var newypo=Number(tran[1])+hie; var r=Math.tan((newxpo)/(newypo)) rectTemplate.parentNode.setAttribute("transform","translate("+newxpo+" "+newypo+")"+"rotate("+angel+") translate("+(newxpo*-1)+" "+(newypo*-1)+")"); } function MouseDown(evt) { var targetElement = evt.target; var checkForResizeAttempt = false; if (targetElement == rectTemplate) { //arr.push(cir ,cir1,rectTemplate) dragTarget = targetElement; checkForResizeAttempt = true; var transMatrix = dragTarget.getCTM(); grabPoint.x = evt.clientX - Number(transMatrix.e); grabPoint.y = evt.clientY - Number(transMatrix.f); } var transMatrix = dragTarget.getCTM(); //var transMatrix = dragTarget.getCTM().inverse(); grabPoint.x = evt.clientX - Number(transMatrix.e); grabPoint.y = evt.clientY - Number(transMatrix.f); if (window.console) console.log(grabPoint.x + " " + grabPoint.y); if (window.console) console.log(evt.clientX + " " + evt.clientY); if (checkForResizeAttempt) { clientPoint.x = evt.clientX; clientPoint.y = evt.clientY; rectX = Number(dragTarget.getAttributeNS(null, "x")); rectY = Number(dragTarget.getAttributeNS(null, "y")); rectWidth = Number(dragTarget.getAttributeNS(null, "width")); rectHeight = Number(dragTarget.getAttributeNS(null, "height")); if ((grabPoint.x - rectX) < 10) { resizingLeft = true; } else if (((rectX + rectWidth) - grabPoint.x) < 10) { resizingRight = true; } if (resizingLeft || resizingRight) { dragTarget.setAttributeNS(null,"stroke","green"); } else { dragTarget.setAttributeNS(null,"stroke","black"); } } } function MouseMove(evt) { evt.stopPropagation(); if (dragTarget == null) { return; } if (resizingLeft) { if (window.console) console.log(evt.clientX + " " + evt.clientY); deltaX = (clientPoint.x - evt.clientX); if (window.console) console.log("deltaX = " + deltaX); dragTarget.setAttributeNS(null,"width",rectWidth + deltaX); dragTarget.setAttributeNS(null,"x",rectX - deltaX); } else if (resizingRight) { deltaX = (clientPoint.x - evt.clientX); if (window.console) console.log("rectWidth = " + rectWidth + " deltaX = " + deltaX); dragTarget.setAttributeNS(null,"width",rectWidth - deltaX); } else { var newXX = evt.clientX-grabPoint.x; var newYX = evt.clientY-grabPoint.y; dragTarget.setAttributeNS(null,'transform','translate(' + newXX + ',' + newYX + ')'); } } function MouseUp(evt) { evt.stopPropagation(); if (dragTarget == null) { return; } resizingLeft = false; resizingRight = false; resizingTop = false; resizingBottom = false; // var transMatrix = dragTarget.getCTM().inverse(); dragTarget.setAttributeNS(null,"stroke","blue"); dragTarget = null; } </script> </body> </html> -- =======SVG ==== <?xml version="1.0" standalone="no"?> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"> <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:a="http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/" x="0px" y="0px" width="612px" height="792px" xml:space="preserve" onmousedown="ecmascript:top.MouseDown(evt)" onmousemove="ecmascript:top.MouseMove(evt)" onmouseup="ecmascript:top.MouseUp(evt)"> <g id="rect1"> <rect id="rectTemplate" x="0" y="0" stroke="blue" width="100" height="30" /> </g> ```
SVG - resizing a rectangle positioned at an angle
CC BY-SA 2.5
0
2011-01-19T07:11:00.680
2011-03-11T11:33:54.393
2011-03-11T11:33:54.393
434,697
434,697
[ "svg", "rotation" ]
4,732,869
1
4,732,904
null
15
41,145
[question](https://stackoverflow.com/questions/4725686/how-to-best-display-large-number-of-items-in-program) ## Question: I am trying to draw a filled triangle using `DrawingContext`, which is rendered on a `DrawingVisual` Currently, I have managed to draw the outline of a triangle using the following C# code: ``` private DrawingVisual CreateTriangle() { DrawingVisual triangle = new DrawingVisual(); using ( DrawingContext dc = triangle.RenderOpen() ) { Pen drawingPen = new Pen(Brushes.Black,3); dc.DrawLine(drawingPen, new Point(0, 50), new Point(50, 0)); dc.DrawLine(drawingPen, new Point(50, 0), new Point(50, 100)); dc.DrawLine(drawingPen, new Point(50, 100), new Point(0, 50)); } return triangle; } ``` I get this: ![Unfilled Triangle](https://i.stack.imgur.com/zs9dc.png) How do I draw a triangle that, in addition to th border I have drawn also has a red fill? ![Filled Triangle](https://i.stack.imgur.com/f6tpf.png)
Draw a filled triangle in DrawingContext
CC BY-SA 2.5
0
2011-01-19T07:43:35.733
2015-03-25T06:48:27.063
2017-05-23T12:08:59.340
-1
504,310
[ "c#", ".net", "wpf" ]
4,732,856
1
4,732,877
null
1
1,073
i get a system null reference exception error that displays as follows.![alt text](https://i.stack.imgur.com/vKAiU.jpg) Am performing validation on 4 "dropdownlists". what could i have done wrong? code behind below. ``` protected void addExhibitButton_Click(object sender, EventArgs e) { if (Page.IsValid) { DateTime exhibitDate = DateTime.Now; int caseid = Convert.ToInt32(DropDownListcaseid.SelectedItem.Text); string exhibittype = exhibitTypeDropDownList.Text.ToString(); string storedloc = storedLocationDropDownList.Text.ToString(); string offid = DropDownList1.SelectedItem.Text.ToString(); string status = "Pending"; Stream imgStream = exhibitImageFileUpload.PostedFile.InputStream; int imgLen = exhibitImageFileUpload.PostedFile.ContentLength; byte[] imgBinaryData = new byte[imgLen]; int n = imgStream.Read(imgBinaryData,0,imgLen); try { SqlConnection connections = new SqlConnection(strConn); SqlCommand command = new SqlCommand("INSERT INTO Exhibits (CaseID, ExhibitType, ExhibitImage, DateReceived, StoredLocation, InvestigationStatus, OfficerID, SuspectID, InvestigatorID, ManagerID, AdminID ) VALUES (@CaseID, @ExhibitType, @ExhibitImage, @DateReceived, @StoredLocation, @InvestigationStatus, @OfficerID, @SuspectID, @InvestigatorID, @ManagerID, @AdminID)", connections); SqlParameter param0 = new SqlParameter("@CaseID", SqlDbType.Int); param0.Value = caseid; command.Parameters.Add(param0); SqlParameter param1 = new SqlParameter("@ExhibitType", SqlDbType.NText); param1.Value = exhibittype; command.Parameters.Add(param1); SqlParameter param2 = new SqlParameter("@ExhibitImage", SqlDbType.Image); param2.Value = imgBinaryData; command.Parameters.Add(param2); SqlParameter param3 = new SqlParameter("@DateReceived", SqlDbType.SmallDateTime); param3.Value = exhibitDate; command.Parameters.Add(param3); SqlParameter param4 = new SqlParameter("@StoredLocation", SqlDbType.NText); param4.Value = storedloc; command.Parameters.Add(param4); SqlParameter param5 = new SqlParameter("@InvestigationStatus", SqlDbType.VarChar, 50); param5.Value = status; command.Parameters.Add(param5); SqlParameter param6 = new SqlParameter("@OfficerID", SqlDbType.NChar, 10); param6.Value = offid; command.Parameters.Add(param6); SqlParameter param7 = new SqlParameter("@SuspectID", SqlDbType.NChar, 10); param7.Value = DBNull.Value; command.Parameters.Add(param7); SqlParameter param8 = new SqlParameter("@InvestigatorID", SqlDbType.NChar, 10); param8.Value = DBNull.Value; command.Parameters.Add(param8); SqlParameter param9 = new SqlParameter("@ManagerID", SqlDbType.NChar, 10); param9.Value = DBNull.Value; command.Parameters.Add(param9); SqlParameter param10 = new SqlParameter("@AdminID", SqlDbType.NChar, 10); param10.Value = adminID; command.Parameters.Add(param10); connections.Open(); int numRowsAffected = command.ExecuteNonQuery(); connections.Close(); if (numRowsAffected != 0) { DropDownListcaseid.ClearSelection(); exhibitTypeDropDownList.Text = null; storedLocationDropDownList.Text = null; DropDownList1.ClearSelection(); messageLabel.Text = "Rows Inserted successfully"; messageLabel.Visible = true; } else { messageLabel.Text = "An error occured while inserting columns."; messageLabel.Visible = true; } } catch (Exception ex) { string script = "<script>alert('" + ex.Message + "');</script>"; } } } ``` Image of page being run below ![alt text](https://i.stack.imgur.com/PxH7D.jpg) I applied validation items to all drop down lists except the one with the browse button(which offcourse is not a dropdown item). clearly according to my knowledge i havent left out any field.so what could be the cause?
null reference exception
CC BY-SA 2.5
0
2011-01-19T07:41:42.253
2011-01-19T07:50:18.367
2011-01-19T07:50:18.367
569,285
569,285
[ "c#", "asp.net" ]
4,733,025
1
4,733,201
null
5
3,486
I've attached a picture to better illustrate what I'm going for. I have two `LinearLayout`s positioned side by side. Both are able to expand vertically, using wrap_content. I would like to position another container (HorizontalScrollView) below whichever one has the greater height. It's currently set to go below the right-most column, as generally it is taller, but in some cases the ScrollView will cover up the content in the left-most column. Is there a way to set this in the .xml file or will I need to resort to setting this in my onCreate method? ![Example screen](https://i.stack.imgur.com/P5aEm.jpg)
Android Layout: position element below lowest view
CC BY-SA 2.5
null
2011-01-19T08:07:18.567
2011-01-19T08:37:02.037
null
null
508,912
[ "android", "android-layout" ]
4,733,090
1
4,733,105
null
0
503
I have a page with the following mark up ``` <%@ Page Title="" Language="C#" MasterPageFile="~/CaseAdmin.master" AutoEventWireup="true" CodeBehind="AddExhibit.aspx.cs" Inherits="Prototype5.AddExhibit" %> ``` ``` <h2 class="style2"> <strong><span style="color: #FFFFFF">Add Exhibit Form</span></strong></h2> <div style="width: 600px"> <table style="width: 303px" align="left"> <tr> <td class="style26" style="background-color: #666666"> <p class="style5" style="color: #000000; background-color: #666666;"> <strong style="background-color: #666666">Select Existing Case ID: </strong> </p></td> <td class="" style="background-color: #C0C0C0" align="left"> <asp:DropDownList ID="DropDownListcaseid" runat="server" onselectedindexchanged="DropDownListcaseid_SelectedIndexChanged"> </asp:DropDownList> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="DropDownListcaseid" ErrorMessage="Please select a valid case id from the dropdown menu" ForeColor="Red">*</asp:RequiredFieldValidator> </td> </tr> <tr> <td class="style4" colspan="2"> &nbsp;</td> </tr> </table> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>" SelectCommand="SELECT [CaseID] FROM [Cases]"></asp:SqlDataSource> </div> <div style="width: 603px; height: 75px; "> <table style="height: 66px; width: 598px; top: 277px; left: 268px;" align="left"> <tr> <td class="bold" style="color: #000000; background-color: #666666; width: 127px;"> <strong>Exhibit Type</strong></td> <td class="bold" style="background-color: #666666; width: 228px;"> <span style="color: #000000">Exhibit Image</td> <td class="bold" style="background-color: #666666; width: 111px;"> <span style="color: #000000">Stored Location</span></td> <td class="bold" style="background-color: #666666; color: #000000;"> Officer ID</span></td> </tr> <tr> <td class="style32" style="background-color: #C0C0C0; width: 127px;"> <asp:DropDownList ID="exhibitTypeDropDownList" runat="server"> <asp:ListItem></asp:ListItem> <asp:ListItem>Hard Disk</asp:ListItem> <asp:ListItem>Pen Drive</asp:ListItem> <asp:ListItem>Laptop</asp:ListItem> <asp:ListItem>Palm Devce</asp:ListItem> <asp:ListItem>Mobile Phone</asp:ListItem> <asp:ListItem>Tablet PC</asp:ListItem> <asp:ListItem>Pager</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="exhibitTypeDropDownList" ErrorMessage="Please Enter the type of exhibit. eg. Harddisk" ForeColor="Red" ondisposed="addExhibitButton_Click">*</asp:RequiredFieldValidator> </td> <td class="style28" style="background-color: #C0C0C0; width: 228px;"> <asp:FileUpload ID="exhibitImageFileUpload" runat="server" /> </td> <td class="style20" style="background-color: #C0C0C0; width: 111px;"> <asp:DropDownList ID="storedLocationDropDownList" runat="server"> <asp:ListItem></asp:ListItem> <asp:ListItem>B-15/4</asp:ListItem> <asp:ListItem>B-10/1</asp:ListItem> <asp:ListItem>B-5/4</asp:ListItem> </asp:DropDownList> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="storedLocationDropDownList" ErrorMessage="Please enter a valid stored location" ForeColor="Red" ondisposed="addExhibitButton_Click">*</asp:RequiredFieldValidator> </td> <td class="style30" style="background-color: #C0C0C0"> <asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="officersSqlDataSource" DataTextField="PoliceID" DataValueField="PoliceID" Width="79px" Height="26px"> </asp:DropDownList> <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="DropDownList1" ErrorMessage="Please select a valid Officer id from the dropdown list" ForeColor="Red" ondisposed="addExhibitButton_Click">*</asp:RequiredFieldValidator> </td> </tr> </table> </div> <div style="width: 609px; height: 23px;"> </div> <div style="margin-top:12px; width: 232px; text-align:left; font-size:1.3em;"> <asp:SqlDataSource ID="officersSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:CMSSQL3ConnectionString1 %>" SelectCommand="SELECT PoliceID FROM PoliceOfficers"></asp:SqlDataSource> <table align="left"> <tr> <td align="center"> <asp:ValidationSummary ID="ValidationSummary1" runat="server" ForeColor="Red" HeaderText="The following errors occured." /> </td> </tr> </table> </div> <div style="margin-top:12px; width: 456px;"> <table style="width: 450px" align="left"> <tr> <td align="center" colspan="3"> <asp:Label ID="messageLabel" runat="server" BackColor="White" ForeColor="Red" Visible="False"></asp:Label> </td> </tr> <tr> <td align="center" style="width: 96px"> <asp:Button ID="cancelButton" runat="server" Text="Cancel" onclick="cancelButton_Click" height="26px" width="101px" /> </td> <td style="width: 237px"> &nbsp;</td> <td align="center"> <asp:Button ID="addExhibitButton" runat="server" Text="Add Exhibit" onclick="addExhibitButton_Click" /> </td> </tr> </table> </div> ``` and the following interface look ![alt text](https://i.stack.imgur.com/dUikM.jpg) I wish to perform validation on the page only when the "add exhibit button" is clicked. so in my code behind, i used an "if(page.isvalid)" to check for page validation when the button is clicked. However any other button i click fires the validation as well... I presume its because every button click tries to load a page and that calls the validator to action. how do i allow work around the validation such that, only the " add exhibit button" triggers the page validation?
Field Validator Fires undesirably
CC BY-SA 2.5
null
2011-01-19T08:17:41.033
2011-01-19T08:32:01.810
null
null
569,285
[ "c#", "asp.net" ]
4,733,249
1
4,734,314
null
0
358
Can anyone suggest how I can improve my query, its used for a site map and theres 80000 pages, hence the limit. Heres my query ``` SELECT PageName FROM pads WHERE RemoveMeDate = '2001-01-01 00:00:00' ORDER BY PadID DESC LIMIT 20000 , 30000 ``` Heres my EXPLAIN ![alt text](https://i.stack.imgur.com/p4fX0.png) Heres the indexes I have already ![alt text](https://i.stack.imgur.com/xXy6S.png)
MySql, can anyone suggest how to improve my query / index?
CC BY-SA 2.5
null
2011-01-19T08:41:52.150
2011-01-19T10:45:26.390
null
null
450,456
[ "sql", "mysql", "indexing", "query-optimization" ]
4,733,258
1
null
null
0
816
I wondered what installing apk files into emulator or device means and tried to install manually with eclipse first. I opened file explorer tab in ddms section in eclipse and realized that all files with apk extension are in app folder. I selected app directory and clicked push a file onto device button on the top. With selecting apk file i want it was installed to the emulator. However, i am getting this error![alt text](https://i.stack.imgur.com/RUmhZ.png) when try to run app , Is this error about my installation method or caused by something different ?
android installing apk file manually error
CC BY-SA 2.5
null
2011-01-19T08:43:13.417
2011-09-28T19:04:05.340
2011-01-19T08:45:10.527
21,234
459,904
[ "android", "apk" ]
4,733,480
1
4,887,187
null
6
3,668
I have made a custom Dialog, and I want the title to have a background like the AlertDialog. Better said: The place where it says "Custom Dialog" ![alt text](https://i.stack.imgur.com/fNtuv.png) Needs to have a 'header' like this: ![alt text](https://i.stack.imgur.com/lEKuL.png) I don't want to just add the image left to the text, but really implement the complete UI style shown. Is this possible? Here's the code I used for my custom dialog: [Adding Image to Custom AlertDialog](https://stackoverflow.com/questions/4302439/adding-image-to-custom-alertdialog)
Change Custom Dialog 'header' to AlertDialog 'header'
CC BY-SA 2.5
0
2011-01-19T09:15:50.127
2011-02-08T21:54:11.227
2020-06-20T09:12:55.060
-1
517,460
[ "android", "layout", "dialog", "android-alertdialog" ]
4,733,548
1
4,734,627
null
1
933
I am currently developing a sharepoint webpart to display a private discussion board. The discussion can only be viewed by limitted users. The following allowed users as of now could be: Site Collection Owner, Discussion Board Members, Discussion Board Owner. The way I setup the security of the webpart is by getting all the users and check if they belong to the said allowed persons in the discussion board. My logic seems to be working right now but, the concern here of my client is: What if in the future they will change the settings or security of the discussion board and I might no longer be around to fix the code of the webpart such that the settings and security of the webpart will sync to the discussion board? My idea as of now is, instead of developing a code that will copy the settings and security of the discussion board and apply it to the webpart, I will point the settings and security of the webpart right directly to the discussion board. My question right now is, would this be possible? Please see the attached pic to have a better view of what I wanted to happen. ![First Image](https://i.stack.imgur.com/FUtE7.jpg) ![Second Image](https://i.stack.imgur.com/EicHp.jpg)
Sharepoint discussion board, replicate the settings and rules to a webpart
CC BY-SA 3.0
null
2011-01-19T09:24:54.813
2017-08-25T12:56:33.330
2017-08-25T12:56:33.330
1,000,551
249,580
[ "sharepoint", "sharepoint-2007", "web-parts", "sharepoint-discussion-board" ]
4,733,578
1
4,733,689
null
0
406
I have a website where I am using the JSON webservice. I have uploaded my website on the server. When I try to access the webservice it gives me the error as shown in below screenshot. In the below screenshot MyServices is my webservice. MyServices.asmx is the name of the file that I am trying to access. I tried cleaning the bin folder and rebuilding again. But it didn't work. What could be wrong? ![alt text](https://i.stack.imgur.com/Q01St.png)
ASP.NET: Error while accessing the JSON Webservice from server
CC BY-SA 3.0
null
2011-01-19T09:27:34.533
2017-12-07T01:11:56.457
2017-12-07T01:11:56.457
472,495
463,857
[ ".net", "asp.net", "web-services", "json" ]
4,734,386
1
5,347,242
null
3
1,262
I've created a simple DirectX app that renders a field of vertices. Vertices are rendered like this (if viewed from top): ``` |\|\|\|\| |\|\|\|\| ``` Each triangle is rendered like this: ``` 1 |\ 2 3 ``` Which should mean that the polygon is counterclockwise and not be rendered, but it is. Anyway when viewed from top the plane is perfect. However, when viewed from another level some polygons are sort of transparent and you can see geometry behind them. I've highlighted some of the place where this is happening. I am thinking this is some of the basic, beginner problems. What am I missing? My rasterizer description is such: ``` new RasterizerStateDescription { CullMode = CullMode.Front, IsAntialiasedLineEnabled = true, IsMultisampleEnabled = true, IsDepthClipEnabled = true, IsFrontCounterclockwise = false, IsScissorEnabled = true, DepthBias = 1, DepthBiasClamp = 1000.0f, FillMode = FillMode.Wireframe, SlopeScaledDepthBias = 1.0f }; ``` ![alt text](https://i.stack.imgur.com/ek3Gi.jpg)
DirectX: "see through" polygons
CC BY-SA 2.5
0
2011-01-19T10:54:08.943
2011-03-18T01:56:13.630
null
null
178,980
[ "directx", "directx-11" ]
4,734,488
1
4,734,508
null
0
708
In some area I have this big space between some sentence: ![Alt text](https://i.stack.imgur.com/Czk9y.png) ![Alt text](https://i.stack.imgur.com/QHenm.png) Is there a way to correct this with CSS? HTML for a second example: ``` <span style="color: rgb(197, 0, 0); text-align: justify; font-size: 14px;"> <span id="MainContent_rptTest_lblTitle_2">Support to Efficient, Effictive and Transparent</span><br> <div style="color: rgb(197, 0, 0); text-align: justify; font-size: 12px;"> <strong> <span id="MainContent_rptTest_lblDescription_2">September 2009 &ndash; January 2010</span></strong></div> </span> ```
Big blank space HTML
CC BY-SA 3.0
null
2011-01-19T11:04:10.983
2014-06-01T02:59:23.607
2014-06-01T02:59:00.573
63,550
325,932
[ "asp.net", "html", "css" ]
4,734,566
1
4,734,639
null
4
1,706
![alt text](https://i.stack.imgur.com/droHW.png) Can we change the order in which the destructive button and Other buttons appear in an UIActionSheet. By default the destructive button (red colored) appears above other buttons, in my app I would like the other buttons to appear above the destructive button.
UIActionSheet Customization
CC BY-SA 2.5
null
2011-01-19T11:15:27.400
2011-01-19T11:24:39.827
null
null
null
[ "iphone" ]
4,734,570
1
4,734,926
null
0
248
Maybe this is simple, but is making me nuts. To understand the problem, the easy way is to look at the image. ![alt text](https://i.stack.imgur.com/7TYgY.png) Div width is truncating either word or the rounded border(also in case there is a space or dash between words). How can I force each "a" element to go into a new line if width is not enough to contain the element? Here's the code ``` <div id="post-tags"> <span class="tag-title">Tagged:</span> <a href="#">tag2</a> <a href="#">tag3</a> <a href="#">tag4</a> <a href="#">longtag5</a> <a href="#"li>longtag6</a> <a href="#">longtag7</a> <a href="#">longtag8</a> <a href="#">longtag9</a> <a href="#">longtag10</a> <a href="#">longtag11</a> <a href="#">longtag12</a> </div> ``` And the CSS ``` #post-tags{ width: 560px; float: left; padding: 15px; font-size: 11px; } #post-tags .tag-title{ color: #6b6b6b; padding: 5px 0 0 5px; } #post-tags a{ line-height: 24px; padding: 3px; background: #a7d1e3; padding: 4px 10px 4px 10px; margin: 0 0 10px 0; -moz-border-radius: 10px; -webkit-border-radius: 10px; border-radius: 10px; } #post-tags a:hover{ color: #a7d1e3; background: #205F82; } ```
Div is truncating words and border on wrapping
CC BY-SA 2.5
0
2011-01-19T11:16:33.857
2011-01-19T11:56:43.690
null
null
355,613
[ "css", "xhtml", "word-wrap" ]
4,734,720
1
4,734,757
null
1
1,615
I'm trying to write a very simple program in C++ that finds the modulus of two numbers as follows: ``` #include <iostream> using namespace std; int n; int d; int modulus; int main() { cout<<"***Welcome to the MODULUS calculator***"; cout<<"Enter the numerator, then press ENTER: "; cin>>n; cout<<"Enter the denominator, then press ENTER: "; cin>>d; modulus=n%d; cout<<"The modulus is ---> "<<modulus; return 0; } ``` But, when I try to compile it, I get the following: ![alt text](https://i.stack.imgur.com/u14PK.png) How can this be solved? Thanks.
C++ modulus small program issue
CC BY-SA 2.5
null
2011-01-19T11:32:56.740
2011-01-19T11:43:11.123
null
null
588,855
[ "c++", "modulus" ]
4,734,937
1
null
null
0
1,301
I am totally confused with google maps and maps of iPhone... i have read that iPhone uses google maps.....and also spent some time on it.... But it never display the items like location pictures, balloons etc. --- ![alt text](https://i.stack.imgur.com/pf7fV.png) ![alt text](https://i.stack.imgur.com/BVIyN.png) second one did not show the annotation added by people..... (this is what i was asking for ballons or other pictures which people adds to location on oogle maps) --- I want to display all those in my application.... what should i do... if you suggests implement Google maps API, then please suggest a working link...or provide some sample code if possible.....if anybody has done it...then please mail me at [email protected] waiting for answer......
How to implement google maps in my iPhone application
CC BY-SA 2.5
0
2011-01-19T11:57:44.003
2011-01-19T12:20:39.993
2011-01-19T12:16:12.583
554,865
554,865
[ "iphone", "google-maps" ]
4,735,146
1
4,735,262
null
7
20,313
Is it possible margin Text in TextBlock control ? My style on textBlock control is here : ``` <Style x:Key="InfosStyle" TargetType="{x:Type TextBlock}"> <Setter Property="FontSize" Value="13"/> <Setter Property="FontWeight" Value="Normal"/> <Setter Property="Height" Value="35"/> <Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="TextAlignment" Value="Justify"/> <!--<Setter Property="BorderThickness" Value="1"/>--> <!--<Setter Property="BorderBrush" Value="#BFE3FE"/>--> <Setter Property="Background" Value="#BFE3FE"/> <Setter Property="Margin" Value="2,4,0,1" /> </Style> ``` Result is here: ![alt text](https://i.stack.imgur.com/my4lA.jpg) For examole I would like align or set margin on text in textBlock. Now: |Chatuje to |_Chatuje I would like have some free space on left side in TextBlock. Free space TextOfTextBlock No TextOfTextBlock
margin text in TextBlock
CC BY-SA 3.0
null
2011-01-19T12:21:21.400
2017-10-22T22:53:55.300
2017-10-22T22:53:55.300
3,885,376
null
[ "wpf", "margin", "textblock", "alignment" ]
4,735,156
1
4,736,937
null
116
152,787
My code in a UITableViewController: ``` delegate.myData = [myData objectAtIndex:indexPath.row]; ``` How can I see the values of `delegate.myData` or `indexPath.row` in the Debugger? `delegate.myData` should be an array and `indexPath.row` an `int`. I can only see memory addresses of the objects `delegate` and `indexPath` but where are `myData` and `row`? ![alt text](https://i.stack.imgur.com/GBX5y.png)
Xcode Debugger: view value of variable
CC BY-SA 2.5
0
2011-01-19T12:22:15.727
2022-01-06T23:10:01.997
null
null
509,535
[ "iphone", "objective-c", "xcode", "debugging", "ios" ]
4,735,171
1
4,975,167
null
0
601
I need to protect images embedded in a swf file. I've noticed [Swf Encrypt](http://www.amayeta.com/software/swfencrypt/) scrambles the images, like so: ![scrambled/coloured noise image](https://i.stack.imgur.com/yRu7B.gif) How is something like this achieved ? ? I've noticed the image is stored a bitmap. Not sure how information is stored. I imagine it would be possible to use something like [AS3SWF](https://github.com/claus/as3swf/) to access the content of a swf, but what would I need to change for the image swf tags ? I don't know much about security/obfuscation/encryption, so any tips will be handy. The programming language for this shouldn't matter much.
How can I protect images embedded in swf files?
CC BY-SA 2.5
null
2011-01-19T12:23:57.623
2011-02-11T23:42:44.717
2011-02-11T22:56:08.210
89,766
89,766
[ "flash", "obfuscation" ]
4,735,219
1
4,735,268
null
3
15,977
I was trying to add my ASP.NET website in IIS 7.5 on my local computer. I followed these steps in IIS Manager. - - On trying to browse the website, I am getting this error > The requested page cannot be accessed because the related configuration data for the page is invalid Here's the screenshot: ![http://i.stack.imgur.com/r7BPj.jpg](https://i.stack.imgur.com/r7BPj.jpg)
Add a website to IIS on localhost
CC BY-SA 4.0
0
2011-01-19T12:28:33.533
2018-06-11T07:25:16.843
2018-06-11T07:25:16.843
3,682,162
458,790
[ "asp.net", "iis" ]
4,735,304
1
4,736,163
null
2
2,102
How does Visual Studio and other similar programs display a form in their IDE? Is it possible to achieve the same or a similar effect using C# or VB.NET? Please see the picture below to get what I mean. ![Visual Studio IDE with a form in design view](https://i.imgur.com/H06sp.png)
How to display a form inside another form like Visual Studio
CC BY-SA 3.0
0
2011-01-19T12:36:37.053
2011-07-07T16:13:02.497
2011-07-07T16:13:02.497
117,870
117,870
[ "c#", ".net", "vb.net", "interface", "interface-builder" ]
4,735,650
1
4,738,567
null
7
1,026
I am currently helping a friend working on a geo-physical project, I'm not by any means a image processing pro, but its fun to play around with these kinds of problems. =) The aim is to estimate the height of small rocks sticking out of water, from surface to top. The experimental equipment will be a ~10MP camera mounted on a distance meter with a built in laser pointer. The "operator" will point this at a rock, press a trigger which will register a distance along of a photo of the rock, which will be in the center of the image. The eqipment can be assumed to always be held at a fixed distance above the water. As I see it there are a number of problems to overcome: 1. Lighting conditions Depending on the time of day etc., the rock might be brighter then the water or opposite. Sometimes the rock will have a color very close to the water. The position of the shade will move throughout the day. Depending on how rough the water is, there might sometimes be a reflection of the rock in the water. 2. Diversity The rock is not evenly shaped. Depending on the rock type, growth of lichen etc., changes the look of the rock. Fortunateness, there is no shortage of test data. Pictures of rocks in water is easy to come by. Here are some sample images: ![alt text](https://i.stack.imgur.com/zrXpj.jpg) I've run a edge detector on the images, and esp. in the fourth picture the poor contrast makes it hard to see the edges: ![alt text](https://i.stack.imgur.com/8W8oB.png) Any ideas would be greatly appreciated!
Finding the height above water level of rocks
CC BY-SA 2.5
0
2011-01-19T13:14:39.253
2011-01-20T17:21:31.397
2011-01-19T14:47:31.517
441,337
441,337
[ "image-processing", "computer-vision" ]
4,735,699
1
4,747,868
null
2
1,717
![alt text](https://i.stack.imgur.com/HqDlc.png)In my current project, I have a webservice file called MyServices.asmx. This webservice I want to reference in my Default.aspx.cs file. : ``` MyServices newService = new MyServices(); newService.addUser(txFirstName.Text, txLastName.Text, txtEmail.Text, txtUserName.Text, txtPassword.Text, txtBalance.Text); ``` --- But when I refer to that webservice (as shown below), I get error saying: "" What should I do to correct this error? Current Solution of Adding Service Reference still gives me that error. Can you please suggest what could be wrong?
Unable to reference webservice (.asmx) in my ASP.NET Project
CC BY-SA 2.5
null
2011-01-19T13:19:35.317
2011-01-20T13:45:41.247
2011-01-19T13:52:11.567
480,346
480,346
[ ".net", "asp.net" ]
4,736,077
1
4,737,820
null
8
3,139
Annoying problem! When I zoom-in on my view-port window (happens in Firefox, chrome) and then scroll horizontally to the right, my background images are clipped the images best depicts what's happening: ![zoom in](https://i.stack.imgur.com/1ACeW.png) - image is only as wide as view-port ![zoom out - problem gone](https://i.stack.imgur.com/Eh5PF.png) Here are some sections from my css which might be relevant: ``` article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; } body{ width: 100%; } header#header { width: 100%; } header#header #background-image { height: 150px; background: url(/images/header/silhouette.png) repeat-x; } ``` This happens with and without cssgradients applied too - really stumped here
Background is only as wide as view-port
CC BY-SA 4.0
0
2011-01-19T14:01:31.920
2019-11-14T07:14:40.257
2019-11-14T07:14:40.257
11,393,381
227,863
[ "html", "css", "width" ]
4,736,344
1
4,885,512
null
2
1,184
Inside my eclipse plugin I want to create this button in a composite: ![alt text](https://i.stack.imgur.com/qUHts.png) Where do I get the icon? How do I create that button?
How do I create this button in an eclipse plugin
CC BY-SA 2.5
null
2011-01-19T14:26:35.380
2012-07-28T14:57:53.400
null
null
60,610
[ "button", "eclipse-plugin", "eclipse-pde" ]
4,736,582
1
4,737,204
null
1
2,251
i want to fill the bottom-left half of a a rectangle (i.e. a triangle): ![alt text](https://i.stack.imgur.com/MEkCJ.png) with a LinearGradient, going from color to transparent: ![alt text](https://i.stack.imgur.com/B2WJj.png) Filling half a rectangle: ![alt text](https://i.stack.imgur.com/pKRiz.png) i know the point (x,y), and the size of the rectangle. If i try using a [LinearGradientBrush](http://msdn.microsoft.com/en-us/library/ms534473(v=VS.85).aspx), to perform my linear gradient: ``` brush = new LinearGradientBrush( MakePoint(0, y), //bottom left corner MakePoint(x, 0), //upper right corner MakeColor(255, c), //fully opaque color MakeColor(0, c)); //fully transparent color graphics.FillRectangle(brush, MakeRect(0, 0, w, h)); ``` The linear gradient brush fills the entire rectangle, which would be fine if it continued to fill the rest of the rectangle with the final (transparent) color; but instead it wraps around: ![alt text](https://i.stack.imgur.com/ihbu9.png) i have my `LinearGradientBrush` how i like, i just want to `FillTriangle` or `FillPolygon`, rather than `FillRectangle`. Except there is no FillTriangle or FillPolygon, only FillRectangle, and FillEllipse. # See also [link text](https://math.stackexchange.com/questions/18057/simpler-solution-to-this-geometry-trig-problem)
GDI+: How to fill a triangle?
CC BY-SA 2.5
null
2011-01-19T14:46:29.217
2011-01-19T15:36:14.410
2017-04-13T12:19:15.777
-1
12,597
[ "gdi+", "linear-gradients" ]
4,736,709
1
4,737,596
null
-1
486
I'm a newbie in C#. I set URL for WebBrowser and when i run it.It's giving a DialogBox like this:![alt text](https://i.stack.imgur.com/sipAo.png)> How can i avoid from this? I mean this dialogbox shouldn't appear when i run it.
How to force WebBrowser Control to continue the script?
CC BY-SA 2.5
null
2011-01-19T14:56:58.317
2011-01-19T16:08:15.380
null
null
416,996
[ "c#", "webbrowser-control" ]
4,736,828
1
4,737,187
null
1
2,809
In PHP/Kohana, I have controller action method which does some processing. When it is finished, I want to send it to another controller, e.g.: ``` public function action_import_csv() { Kohana_Import_Driver_Csv::process_files_from_csv_to_mysql($this->import_directory); //url::redirect(Route::get('backend_application')->uri()); //undefined method URL::redirect() //redirect(Route::get('backend_application')->uri(), null); //undefined function } ``` According to [this documentation](http://docs.kohanaphp.com/helpers/url) at least the first redirect should work. I'm using . # Addendum For some reason, url::redirect is not available, here is the code completion I get for `url::`: ![alt text](https://i.stack.imgur.com/GDsq3.png) @bharath, I tried `url::current()` and got this error: ![alt text](https://i.stack.imgur.com/xsTJa.png)
In Kohana/PHP, how can send execution to a new controller/action?
CC BY-SA 2.5
null
2011-01-19T15:05:10.150
2011-01-19T17:56:50.197
2011-01-19T17:56:50.197
183,791
4,639
[ "php", "kohana", "kohana-3" ]
4,737,096
1
4,737,227
null
2
2,332
I've been trying to get this working for some time... Is there any way to put a transparent fixed header on a listview, so it looks kind of like this: ![Transparent sticky header](https://i.stack.imgur.com/qca9C.jpg) As you scroll up, the header will eventually be a regular header with item 1 below it. I guess I'll have to implement onScrollListener and do something like when the first visible item is item 2 in the list, start moving the listview margins by 1 pixel, until it is below the header? Or are there better ways? Any ideas on how one would do something like that?
Attaching a fixed, transparent, header to a ListView?
CC BY-SA 2.5
null
2011-01-19T15:28:22.290
2011-01-19T16:20:10.223
null
null
397,060
[ "android", "listview" ]
4,737,175
1
null
null
6
8,765
I am getting the error: > "The breakpoint will not currently be hit. Unable to bind SQL breakpoint at this time. Object containing the breakpoint not loaded" ![alt text](https://i.stack.imgur.com/4xkXB.png) When I did the [steps](http://p://support.microsoft.com/kb/316549) to debug a stored proc called from my .net app? What should I be checking? (VS 2005 and SQL Server 2005 both running on the same PC, I can debug a stored proc if I do "step into" from the Server Explorer)
"The breakpoint will not currently be hit..." error when trying to debug a TSQL stored proc called by .NET code
CC BY-SA 2.5
0
2011-01-19T15:34:27.873
2019-01-25T08:51:12.343
null
null
57,159
[ ".net", "sql-server", "debugging", "stored-procedures" ]
4,737,292
1
null
null
1
2,391
i need some help understanding something with php, mysql and phpmyadmin. im sorry if this is the wrong place to ask this, but i dont know where else to ask it. i have 2 tables, one is the parent table and it has just 2 rows with the indexes 1 and 2, and the second on is the child table and it has a foreign key constraint that relates to the id filed in the parent table. when i wanted to insert data in the child table using phpmyadmin, in the foreign key filed i am allwoed to enter 4 values that are given to me in a drop down list, but i dont understand what they mean because these values have dashes in front of them and after like in the image: ![alt text](https://i.stack.imgur.com/ZZT5g.jpg) what do those dashes mean? and what does it mean if they are after or before? and my second question is, if i insert data into the child table can i use a normal SQL query like this ``` INSERT INTO table(f_key) VALUES("foreign_key_value") ``` or do i have to use dashes somewhow? thank you, and im sorry again if i am asking this in the wrong place.
how do i insert foreign keys in phpmyadmin
CC BY-SA 2.5
0
2011-01-19T15:44:55.170
2012-02-20T07:25:38.463
null
null
394,328
[ "sql", "mysql", "phpmyadmin" ]
4,737,511
1
null
null
2
332
Which type of artificial neural network would you suggest to be able to make ? It should predict smallscale steps over very few signals up to very large scale steps with very many signals, possibly with less precision (abstraction by some kind of hierarchy?). See: ![alt text](https://i.stack.imgur.com/VCWzF.jpg) Actually the system should learn and predict simultaneously.
Continuous time-dependent signal prediction
CC BY-SA 2.5
0
2011-01-19T16:01:13.773
2012-04-29T19:37:20.147
2012-04-29T19:37:20.147
892,493
416,061
[ "artificial-intelligence", "neural-network", "prediction" ]
4,737,599
1
4,739,223
null
0
720
I have the below image (the white bubble in the image) to draw in a canvas. When I draw the image using the code.., the image 's edge is getting black circle and rounded .. the edge's alpha is 0x00. image.setBounds(left, top, right, bottom); image.draw(canvas); Expected ![alt text](https://i.stack.imgur.com/GEBRo.png) When I draw ![alt text](https://i.stack.imgur.com/edIld.png) How could I remove the black circle??? Is the image wrong?? or Anyone know the clue, Please give me a clue.. Thanks in advance.. ^^
Drawing translucency drawable in Android, but black edge
CC BY-SA 2.5
0
2011-01-19T16:08:19.823
2011-01-20T07:47:33.247
2011-01-19T16:26:24.793
417,294
417,294
[ "android", "canvas", "alpha", "drawable" ]
4,737,914
1
4,738,120
null
4
2,069
My Parallax mapping gives wrong results. I don't know what can be wrong. ![alt text](https://i.stack.imgur.com/8oUAt.jpg) ![alt text](https://i.stack.imgur.com/3Y3vO.png) Light is pointing from the viewer and goes towards the cube. Shader program (based on dhpoware.com): ``` [vert] varying vec3 lightDir; varying vec3 viewDir; attribute vec4 tangent; void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; gl_TexCoord[0] = gl_MultiTexCoord0; vec3 vertexPos = vec3(gl_ModelViewMatrix * gl_Vertex); vec3 n = normalize(gl_NormalMatrix * gl_Normal); vec3 t = normalize(gl_NormalMatrix * tangent.xyz); vec3 b = cross(n, t) * tangent.w; mat3 tbnMatrix = mat3(t.x, b.x, n.x, t.y, b.y, n.y, t.z, b.z, n.z); lightDir = (gl_LightSource[0].position.xyz - vertexPos) / 1000.0; lightDir = tbnMatrix * lightDir; viewDir = -vertexPos; viewDir = tbnMatrix * viewDir; } [frag] varying vec3 lightDir; varying vec3 viewDir; uniform sampler2D diffuseMap; uniform sampler2D normalMap; uniform sampler2D heightMap; uniform float scale; uniform float bias; void main() { vec3 v = normalize(viewDir); vec2 TexCoord = gl_TexCoord[0].st; { float height = texture2D(heightMap, gl_TexCoord[0].st).r; height = height * scale + bias; TexCoord = gl_TexCoord[0].st + (height * v.xy); } vec3 l = lightDir; float atten = max(0.0, 1.0 - dot(l, l)); l = normalize(l); vec3 n = normalize(texture2D(normalMap, TexCoord).rgb * 2.0 - 1.0); vec3 h = normalize(l + v); float nDotL = max(0.0, dot(n, l)); float nDotH = max(0.0, dot(n, h)); float power = (nDotL == 0.0) ? 0.0 : pow(nDotH, gl_FrontMaterial.shininess); vec4 ambient = gl_FrontLightProduct[0].ambient * atten; vec4 diffuse = gl_FrontLightProduct[0].diffuse * nDotL * atten; vec4 specular = gl_FrontLightProduct[0].specular * power * atten; vec4 color = gl_FrontLightModelProduct.sceneColor + ambient + diffuse + specular;color *= texture2D(diffuseMap,TexCoord); gl_FragColor = color ; } ``` log from cube content (tangents included, the fourth component is handedness): ``` ------------------------------------------------------------------------------------------------------------------ VecContainer<Vertex> vertices = size: 36 space: 36 { -4.000000, -4.000000, -4.000000, -4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, 4.000000, -4.000000, -4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, -4.000000, -4.000000, 4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, -4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, -4.000000, -4.000000, -4.000000, -4.000000, 4.000000, -4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, -4.000000, -4.000000, 4.000000, -4.000000, -4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, -4.000000, -4.000000, 4.000000, -4.000000, -4.000000, -4.000000, 4.000000, 4.000000, -4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, 4.000000, -4.000000, 4.000000, 4.000000, -4.000000, -4.000000, 4.000000, } ------------------------------------------------------------------------------------------------------------------ VecContainer<Vertex> texcoords = size: 36 space: 36 { 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 1.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 0.000000, 1.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000, 0.000000, 1.000000, 0.000000, 0.000000, } ------------------------------------------------------------------------------------------------------------------ VecContainer<Vertex> normals = size: 36 space: 36 { 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 1.000000, } ------------------------------------------------------------------------------------------------------------------ VecContainer<tangent>* tangents = size: 36 space: 36 { 1.000000, -0.000000, 0.000000, 1.000000, 1.000000, -0.000000, 0.000000, 1.000000, 1.000000, -0.000000, 0.000000, 1.000000, 1.000000, -0.000000, 0.000000, 1.000000, 1.000000, -0.000000, 0.000000, 1.000000, 1.000000, -0.000000, 0.000000, 1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 0.000000, 0.000000, 1.000000, -1.000000, 0.000000, 0.000000, 1.000000, -1.000000, 0.000000, 0.000000, 1.000000, -1.000000, 0.000000, 0.000000, 1.000000, -1.000000, 0.000000, 0.000000, 1.000000, -1.000000, 0.000000, 0.000000, 1.000000, -1.000000, 0.000000, 0.000000, -1.000000, -1.000000, 0.000000, 0.000000, -1.000000, -1.000000, 0.000000, 0.000000, -1.000000, -1.000000, 0.000000, 0.000000, -1.000000, -1.000000, 0.000000, 0.000000, -1.000000, -1.000000, 0.000000, 0.000000, -1.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, 0.000000, -1.000000, 1.000000, 0.000000, -0.000000, -1.000000, 1.000000, 0.000000, -0.000000, -1.000000, 1.000000, 0.000000, -0.000000, -1.000000 } ------------------------------------------------------------------------------------------------------------------ VecContainer<GLuint> indices = size: 12 space: 12 { 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 0, 1, 2 } ``` What could cause this problem?
Parallax mapping issue in GLSL, Opengl
CC BY-SA 3.0
null
2011-01-19T16:32:18.267
2012-07-07T13:22:20.867
2012-07-07T13:22:20.867
503,776
503,776
[ "c++", "opengl", "glsl" ]
4,738,103
1
null
null
4
9,393
Im trying to do layout that has header, content and footer. Footer must be bottom of the page(done). But my problem is how can I get content 100% strech between header and footer. When my content is empty, then I can't see that, but when I'm writing some word to html in to content div, like "hello", then the content is only so long than the content in content. I guess you can understand what I mean. Can somebody explain what is wrong in my css code. Red is header, green is footer, cyan is content and blue is container. Problem is that Content does not cover the container area. ![t](https://i.stack.imgur.com/iJZBE.jpg) ``` <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Praktika1</title> <link rel="stylesheet" href="style1.css" type="text/css" /> </head> <body> <div id="container"> <div id="header"> </div> <div id="content"> </div> <div id="footer"> </div> </div> </body> </html> ``` CSS: ``` @CHARSET "UTF-8"; *{padding:0; margin:0;} html,body{ height:100%; } #container{ width: 1024px; position:relative; background-color:#cce; margin: 0 auto; min-height:100%; } #header{ width: 1024px; height:100px; background-color: #CCC; } #content{ height:100%; width:1024px; background-color:yellow; } #footer{ width: 1024px; height: 100px; position:absolute; bottom:0; background-color: #ced; } ```
Content 100% stretch
CC BY-SA 2.5
0
2011-01-19T16:49:17.677
2022-06-28T22:21:02.480
2011-01-19T17:47:13.537
581,785
581,785
[ "css", "layout" ]
4,738,220
1
4,807,019
null
3
3,826
I'm trying to use a TreeView/DataGrid to display some data. I need to display columns for the top level items, but also display a header for the expanded level. I have a dataset with two tables, e.g. Orders and Items, items has a foreign key to Orders. ![Dataset from Visual Studio](https://i.stack.imgur.com/3Z8uW.jpg) I'm trying to bind the dataset to the datagrid/tree view so that I show the list of orders. The WinFrom DataGrid can show multiple tables from the DataSet: ![Data Grid Example](https://i.stack.imgur.com/4uPBd.jpg) Which I set with: ``` dataGrid.DataSource = dataSet; dataGrid.DataMember = "Orders"; ``` Clicking the [+] expands the row to show the link: ![Expanded DataGrid](https://i.stack.imgur.com/Sk8mH.jpg) Following that link brings up the Items Table: ![DataGrid Items shown](https://i.stack.imgur.com/hZK8t.jpg) What I'm after is a mix of both but in WPF: ![Merged](https://i.stack.imgur.com/hfixy.jpg) I've used a dataset for this example but I can massage my data into collections etc that WPF can use to display the data in the way I'm trying to achieve. I've looked at the [TreeListView](http://blogs.msdn.com/b/atc_avalon_team/archive/2006/03/01/541206.aspx) which gives me the top level item headers, but I'm scratching my head trying to get the expanded items header to be shown. Could someone point me in the right direction, thanks. I've come back to looking at this issue. As per @offapps-cory's answer I tried using a ListView with expander with a listview. 1st attempt: ![enter image description here](https://i.stack.imgur.com/ZKGlf.jpg) As you can see, it expanded in the cell :) I'm thinking maybe I can throw a treeview into the mix...
How do I display two tables in a data grid/tree view showing columns for both the parent and child tables (when child expanded)
CC BY-SA 2.5
0
2011-01-19T17:00:17.177
2012-10-23T07:38:11.170
2011-02-04T15:52:28.037
107,142
107,142
[ "c#", "wpf", "datagrid", ".net-4.0", "treeview" ]
4,738,249
1
4,738,632
null
2
1,822
I have a customer preference widget (xml) which basically contains a TextView and next to that a right aligned ImageButton. What I am trying to do is set the image for my image button to whatever is used as default by the preferences system. For example see the attached image where I've highlighted the type of image I want to use. I've tried looking online and saving the ic_btn_round image into my drawables and using that, but it just doesn't look right. Any advice welcome, thank you ![alt text](https://i.stack.imgur.com/lrQ1e.jpg)
How to reference the system select button image for custom preference in Android
CC BY-SA 2.5
0
2011-01-19T17:02:12.950
2011-01-19T17:44:58.220
null
null
333,276
[ "android", "android-widget" ]
4,738,336
1
4,739,608
null
2
3,280
Can anyone explain why I get a vertical overflow with this code please? ``` <html> <body style="width:120px; height:120px; background-color:white;"> <div style="padding:20px; background-color:blue;"> <div style="width:100%; height:100%; background-color:white"> <div style="padding:20px; background-color:green;"> <div style="width:100%; height:100%; background-color:white"> </div> </div> </div> </div> </body> </html> ``` In Chrome 8 it renders like this: ![alt text](https://i.stack.imgur.com/RfMCj.png)
Div overflow with padding in Chrome
CC BY-SA 2.5
null
2011-01-19T17:08:53.290
2011-12-05T14:04:26.953
null
null
114,928
[ "css", "google-chrome", "padding" ]
4,738,410
1
4,738,443
null
0
2,516
I m having trouble with some code and the ie7 browser, its a vertical CATEGORY menu made with the ul tag, and css properties. Works fine with safari, ie8, firefox 3.5 and 3.6 but with ie7 A BIG LEFT MARGIN IS BEING CREATED This is the code that is being generated by the server: ``` <div id="menu"> <ul><li><a class="level1" href="catalog.html?category=21">PRODUCTOS</a></li> <li><a class="level1" href="catalog.html?category=21">Daniela Kosan</a></li> <li><a class="level2" href="catalog.html?category=21">Lo Nuevo</a></li> <li><a class="level2" href="catalog.html?category=22">Fragancias</a></li> <li><a class="level2" href="catalog.html?category=23">Rostro</a></li> <li><a class="level2" href="catalog.html?category=24">Accesorios</a></li></ul> </div> ``` and this is the css i'm using: *{ margin-top:0; padding:0; } ``` #menu{ background:#fff; width:205px; padding-left:9px; } #menu ul{ list-style:none; } #menu li{ list-style:none; } #menu li a{ list-style:none; font-family: arial, sans-serif; background:#F0CFD6; color:#944862; text-transform:none; font-size:14px; font-weight:normal; text-decoration:none; display:block; } #menu li a:hover{ color:#fff; text-decoration:none; } #menu li a.level1{ padding-left:10px; padding-top:10px; width:205px; height:20px; color:#fff; background:#DA8298; } #menu li a:hover.level1{ color:#000; } #menu li a.level2{ padding-left:20px; padding-top:12px; width:205px; height:20px; color:#8B5169; border-width:0 0px 0px 0px; background:#F0CFD6; border-bottom:1px dashed #CEABB2; } #menu li a:hover.level2{ color:#000; } ``` Here is the bad render, NOTE THE BIG LEFT MARGIN BESIDES THE CATEGORY MENU ![alt text](https://i.stack.imgur.com/rVF0Y.jpg) This is how it renders on the other browsers... good! Thank you guys! ![alt text](https://i.stack.imgur.com/G7RWv.png)
css html ie7 (ul and li tags) menu problem
CC BY-SA 2.5
null
2011-01-19T17:15:38.247
2011-01-19T17:19:22.157
null
null
360,903
[ "html", "css", "browser", "internet-explorer-7", "render" ]
4,738,676
1
4,738,701
null
1
507
I'm currently working on a plug-in dll for a 3rd party application. Part of my dll includes a pop-up window with a `System.Windows.Forms.MonthCalendar` in it. Now when I work on it in Visual Studio and when I open the pop-up with a test application I wrote it looks one way, but when the 3rd party app opens it, it looks different. On top of looking different they also have different behaviors. Does anyone have any idea why? One thing that I thought might be an issue is that my dll is built with .Net 3.5 and the 3rd party app is .Net 2.0 (I think). But when I built my test application as .Net 2.0 it still worked the same way. Here's what I'm expecting: ![alt text](https://i.stack.imgur.com/ORJtw.jpg) And here's what I'm getting: ![alt text](https://i.stack.imgur.com/XH08l.jpg)
Why does MonthCalendar look different in 3rd party app?
CC BY-SA 2.5
null
2011-01-19T17:39:37.987
2011-01-19T17:42:03.070
null
null
302,918
[ "c#", "monthcalendar" ]
4,738,673
1
4,738,777
null
4
3,445
I'm investigating the how best to develop/code a flow-chart like scenario. For example, given the following diagram I could write the pseudo-code beneath it to satisy the requirements. However, as the flow chart changes, this would become difficult to maintain. Also, there's a fair amount of duplication which, again, would only get worse when the flow-chart becomes more complex. Is the problem I'm trying to solve exactly what Windows Workflow foundation is for? Or would that be too heavy-handed an approach for the task at hand? Perhaps there is an obvious solution I'm overlooking? Thanks for your help! (P.S. I should mention that I'm looking for a .NET based solution) ![alt text](https://i.stack.imgur.com/QVDPK.png) ..and the pseudo code... ``` Public Function Inbox() as Result If IsItImportant() Then If IsItUrgent() Then If IsItBestUseOfMyTime() Then If WillItTakeMoreThan15Mins() Then Return Result.ProjectList Else If CanDoItNow() Then Return Result.Now Else If DoesItHaveDeadline() Then Return Result.Calendar Else Return Result.NextAction End If End If End If Else Return Result.Delegate End If Else If IsItActionable() Then If IsItBestUseOfMyTime() Then If WillItTakeMoreThan15Mins() Then Return Result.ProjectList Else If CanDoItNow() Then Return Result.Now Else If DoesItHaveDeadline() Then Return Result.Calendar Else Return Result.NextAction End If End If End If Else Return Result.Delegate End If Else If IsItReferenceMaterial() Then Return Result.File Else Return Result.Trash End If End If End If Else If IsItWant() Then Return Result.Someday Else Return Result.Trash End If End If End Function ```
How should I write flow-chart-like code? Or should I use something like Windows Workflow Foundation?
CC BY-SA 2.5
null
2011-01-19T17:39:20.750
2022-04-11T13:10:21.610
2022-04-11T13:10:21.610
4,294,399
162,641
[ ".net", "workflow", "flowchart" ]
4,739,263
1
null
null
0
766
I am integrating map feature into my application. I have displayed the current location. In my problem is, i am developing two applications and displayed the current location. But both the applications displayed the current location in different location and different view in the map. See my screenshots![alt text](https://i.stack.imgur.com/sQY8k.png) ![alt text](https://i.stack.imgur.com/Yurqv.png) Both the screenshots are taken by simulator with two applications and it shows the different Map view frame. But i have used the same code for that.(This happens in device also, show the different place with the map frame). I donno why the map view frame is changed? I have created the map view frame in XIB. And i have included the required frameworks and switched on the location services. Why the Map frame view change? It's weird to me. Here my sample code is, ``` - (void)viewDidLoad { [super viewDidLoad]; self.locationManager = [[[CLLocationManager alloc] init] autorelease]; self.locationManager.delegate = self; [mapview setShowsUserLocation:YES]; [locationManager startUpdatingLocation]; ``` } ``` - (void)locationManager: (CLLocationManager *)manager didUpdateToLocation: (CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { MKCoordinateRegion region1; region1.center = newLocation.coordinate; //Change the Zoom level of the current location //region1.span.latitudeDelta = 0.1;//0.0001 //region1.span.longitudeDelta = 0.1; //0.0001 mapview.mapType = MKMapTypeStandard; //[mapview setRegion:region1 animated:TRUE]; [locationManager stopUpdatingLocation]; } ``` I hope, the first screen shot map view frame is correct. Because i have passed the map view co-ordinates(North East, North West, South East and South West) to the server. If the frame size is wrong, i will get the wrong user details from the server. Please help me out. Thanks!
Current Location Problem using MKMapView in iPhone?
CC BY-SA 2.5
null
2011-01-19T18:40:28.923
2011-01-20T10:55:45.520
2020-06-20T09:12:55.060
-1
249,916
[ "iphone", "mkmapview" ]
4,739,360
1
4,739,704
null
25
39,149
Currently I'm using matplotlib to plot a 3d scatter and while it gets the job done, I can't seem to find a way to rotate it to see my data better. Here's an example: ``` import pylab as p import mpl_toolkits.mplot3d.axes3d as p3 #data is an ndarray with the necessary data and colors is an ndarray with #'b', 'g' and 'r' to paint each point according to its class ... fig=p.figure() ax = p3.Axes3D(fig) ax.scatter(data[:,0], data[:,2], data[:,3], c=colors) ax.set_xlabel('X') ax.set_ylabel('Y') ax.set_zlabel('Z') fig.add_axes(ax) p.show() ``` I'd like a solution that lets me do it during execution time but as long as I can rotate it and it's short/quick I'm fine with it. Here's a comparison of the plots produced after applying a PCA to the iris dataset: 1. mayavi ![alt text](https://i.stack.imgur.com/HkWkm.jpg) 2. matplotlib ![alt text](https://i.stack.imgur.com/McrY1.jpg) Mayavi makes it easier to visualize the data, but MatPlotLib looks more professional. Matplotlib is also lighter.
Any easy way to plot a 3d scatter in Python that I can rotate around?
CC BY-SA 2.5
0
2011-01-19T18:49:48.053
2014-11-25T18:50:17.547
2011-01-19T20:28:57.823
551,914
551,914
[ "python", "charts", "matplotlib", "scatter-plot" ]
4,739,409
1
4,748,707
null
0
202
As part of my [ongoing quest](https://stackoverflow.com/questions/4318073/why-might-graphics-rotatetransform-not-be-applied) to generate stimuli for experiments, I'm having a strange problem. The desired outcome this time is to "shuffle" an image by dividing an image into segments of equal size and then swapping these randomly. This worked fine in initial tests and I swiftly forgot about the program. When my colleague tried it with her images though, the segments suddenly became smaller than they should be. In order to illustrate the problem, I've filled each segment rectangle with a hatched brush: ![A series of experimental images](https://i.stack.imgur.com/E2j1H.png) Image pair A shows my initial results from a test image (downloaded from facebook). Image pair B shows the same operation applied to my colleagues test image; note that the hatched areas have gaps between them. The third image pair show the same effect after I modified the original image in GIMP and re-saved it. (I originally did this to see if the orientation had any effect - it didn't.) It seems to me that the process of exporting the image from GIMP affected some property of the image such that the dimensions were interpreted incorrectly. Is there any way I can detect and correct this? --- My code (edited for your sanity): ``` this.original = Image.FromFile(this.filename); Image wholeImage = (Image)this.original.Clone(); int segwidth = (int)Math.Floor((double)(this.original.Width / segsX)); int segheight = (int)Math.Floor((double)(this.original.Height / segsY)); int segsCount = segsX * segsY; Image[] segments = new Image[segsCount]; for (i = 0; i < segsCount; i++) { x = (i % segsX); y = (int)Math.Floor((double)(i / segsX)); segments[i] = Crop(wholeImage, new Rectangle(x * segwidth, y * segheight, segwidth, segheight), (i%2>0)); } // Call to an array shuffling helper class using (Graphics g = Graphics.FromImage(wholeImage)) { for (j = 0; j < segsCount; j++) { x = (j % segsX); y = (int)Math.Floor((double)(j / segsX)); insertPoint = new Point(x * segwidth, y * segheight); g.DrawImage(segments[j], insertPoint); } } wholeImage.Save(this.targetfolder + Path.DirectorySeparatorChar + aggr_filename, ImageFormat.Png); // The cropping function (including the hatch generation, which would be commented out when no longer needed) static private Image Crop(Image wholeImage, Rectangle cropArea, Boolean odd = true) { Bitmap cropped = new Bitmap(cropArea.Width, cropArea.Height); Rectangle rect = new Rectangle(0, 0, cropArea.Width, cropArea.Height); System.Drawing.Drawing2D.HatchBrush brush; if (odd) { brush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.Plaid, Color.Red, Color.Blue); } else { brush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.Plaid, Color.Beige, Color.CadetBlue); } using(Graphics g = Graphics.FromImage(cropped)) { g.DrawImage(wholeImage, rect, cropArea, GraphicsUnit.Pixel); g.FillRectangle(brush, rect); } return cropped as Image; } ```
What properties of an image might cause sizing problems?
CC BY-SA 2.5
null
2011-01-19T18:55:49.890
2011-01-20T15:04:49.760
2017-05-23T10:32:36.017
-1
50,151
[ "c#", "graphics", "image-processing" ]
4,739,490
1
4,740,041
null
0
1,518
Easiest said with pictures. ![alt text](https://i.stack.imgur.com/YcmGB.png) I'm not sure how to create the 2nd column with the button. Then how to add an id so that the button runs code for the specific record.
How to have a grid with buttons in the Django admin and and pass the button a record id?
CC BY-SA 2.5
null
2011-01-19T19:03:28.977
2011-01-20T07:55:01.477
2011-01-20T07:55:01.477
234,543
234,543
[ "django", "django-admin" ]