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,547,302 | 1 | 4,547,383 | null | 1 | 972 | I'm starting to learn NHibernate (3.0) and picked up a copy of Packt Publishing's [NHibernate 3.0 Cookbook](https://www.packtpub.com/nhibernate-3-0-cookbook/book).
There's a section on one-to-many mappings which I'm walking through but with my own database. It suggests I should do something like this to model a one to many relationship between customers and their domains:
```
public class Customer
{
public virtual int Id { get; protected set; }
public virtual string CustomerName { get; set; }
// Customer has many domains
public virtual IList<Domain> Domains { get; set; }
}
public class Domain
{
public virtual int Id { get; protected set; }
public virtual int CustomerID { get; set; }
public virtual string DomainName { get; set; }
}
```
Customer Mapping:
```
<class name="Customer" table="tblCustomer">
<id name="Id">
<column name="CustomerID" sql-type="int" not-null="true"/>
<generator class="identity"/>
</id>
<property name="CustomerName" column="Customer"/>
<list name="Domains">
<key column="CustomerID"/>
<one-to-many class="Domain" />
</list>
</class>
```
When I run this I get the following error:
The book's example is a bit more complex in that they use table-per-subclass mappings:

```
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
assembly="Eg.Core"
namespace="Eg.Core">
<subclass name="Movie" extends="Product">
<property name="Director" />
<list name="Actors" cascade="all-delete-orphan">
<key column="MovieId" />
<index column="ActorIndex" />
<one-to-many class="ActorRole"/> <-- Is this wrong?
</list>
</subclass>
</hibernate-mapping>
```
I'm guessing the book is wrong?
| Is my NHibernate book wrong? | CC BY-SA 2.5 | null | 2010-12-28T15:55:54.950 | 2010-12-28T16:07:13.000 | null | null | 419 | [
"nhibernate",
"nhibernate-mapping"
]
|
4,547,548 | 1 | 4,547,605 | null | 4 | 11,671 | We have a flex app that will typically run for long periods of time (could be days or weeks). When I came in this morning I noticed that the app had stopped running and a white exclamation point in a gray circle was in the center of the app. I found a post about it on the Adobe forums, but no one seems to know exactly what the symbol means so I thought I'd reach out to the SO community.
Adobe forum post: [http://forums.adobe.com/message/3087523](http://forums.adobe.com/message/3087523)
Screen shot of the symbol:

Any ideas?
| Flex error- White exclamation point in gray circle: What does it mean? | CC BY-SA 2.5 | 0 | 2010-12-28T16:32:24.067 | 2015-03-25T23:58:54.443 | null | null | 275,643 | [
"apache-flex",
"actionscript-3",
"flex3",
"flex4"
]
|
4,547,627 | 1 | 4,548,510 | null | 1 | 2,928 | I realize this one is a bit strange, so I'll explain. For a simple internet radio player I need a control to specify rating (1-5 "stars"). I have no experience or talent for graphical design, so all my attempts at drawing bitmaps look ridiculous/awful, take your pick. I couldn't find a 3rd party control with that functionality and look that fits standard VCL controls. So...
It occurred to me that I could achieve an OK look and consistency with Windows UI by using standard radiobuttons without captions, like this:

I had a vague (and incorrect) recollection of a GroupIndex property; assigning a different value to each radiobutton would let multiple radiobuttons be checked at the same time. Alas, TRadioButton does not have a GroupIndex property, so that's that.
1. Is it possible to completely override the natural radiobutton behavior, so that more than one button can show up as checked at the same time? Or,
2. Can I acquire all the bitmaps Windows uses for radiobuttons (I assume they're bitmaps) from the system and draw them directly, including theming support? In this case I would still like to retain all the effects of a radiobutton, including the mouse hover "glow", etc, so that means getting all the "native" bitmaps and drawing them as necessary, perhaps on a TPaintBox.
| How to suppress standard RadioButton check behavior in Delphi? | CC BY-SA 2.5 | 0 | 2010-12-28T16:41:45.527 | 2019-07-30T11:00:22.450 | 2014-06-25T22:32:22.583 | 881,229 | 9,226 | [
"delphi",
"radio-button"
]
|
4,548,235 | 1 | 4,548,291 | null | 1 | 2,570 | I'm using mouseleave to close a popup menu. This works correctly in all of my target browsers except IE7. In IE7, mouseleave triggers while the cursor is clearly still over the target element. I've highlighted the main container for the popup in yellow below. If I position the mouse as shown and move it a bit (still within the yellow), mouseleave is triggered on the yellow containing element. Any ideas about what's going on here? What might cause mouseleave to be triggered on an element when the cursor was still visibly inside it?

After looking closer, I see that the mouseleave event is triggered even when the cursor is over the opaque part of the popup.

| mouseleave is triggering in IE7 while the cursor is still over the element | CC BY-SA 2.5 | 0 | 2010-12-28T18:08:26.393 | 2013-09-23T07:30:50.080 | 2010-12-28T19:13:12.310 | 44,683 | 44,683 | [
"jquery",
"internet-explorer",
"events",
"mouseleave"
]
|
4,548,357 | 1 | null | null | 4 | 10,111 | How to open local .html file in Android and Blackberry emulators?
I'm able to open any url from internet, but I'm developing a site for mobile on my local PC and I want to run my locally developed HTML files in emulators.


| How to open local .html file in Android and Blackberry emulators, for testing? | CC BY-SA 2.5 | null | 2010-12-28T18:25:18.110 | 2013-05-06T09:26:50.023 | 2010-12-28T18:35:37.767 | 84,201 | 84,201 | [
"android",
"html",
"css",
"mobile-website",
"blackberry-simulator"
]
|
4,548,350 | 1 | null | null | 0 | 4,032 | regarding of this question..
[PHP Booking timeslot](https://stackoverflow.com/questions/4512784/php-booking-timeslot)
I tried 'GROUP BY' id_timeslot still didnt work, as its only showing the booked timeslot not available
i tried that solution, but give me an error and not quite understand how to use 'coelence'
```
table timeslot (id_timeslot integer);
table doctor (id_doctor integer);
table bookslot (id_bookslot, id_doctor, id_timeslot integer);
insert into doctor (id_doctor)
values (1 = doc_A), (2 = doc_B), (3 = doc_C);
insert into TimeSlot (id_timeslot)
values (1 = 10:00:00), (2 = 10:15:00), (3 = 10:30:00), (4 = 10:45:00);
insert into bookslot (id_doctor,id_timeslot)
values (1,1), (1,5), (2,1), (2,4), (3,1);
```
Join mysql table
```
$q = $mysqli->query("SELECT * FROM bookslot
RIGHT JOIN timeslot ON bookslot.id_timeslot = timeslot.id_timeslot
LEFT JOIN doctor ON bookslot.id_doctor = doctor.id_doctor ");
```
echoing result and checking if it matches todays date or else set available
```
while($r = $q->fetch_array(MYSQLI_ASSOC)) :
echo '<tr>';
echo '<td align="center">' . $r['times'] . '</td>';
if($r['booked_date'] == date('Y-m-d') && $r['id_doctor'] == 1):
echo '<td><a href="#available" class="booked">booked</a></td>';
else :
echo '<td><a href="#" class="available">available</a></td>';
endif;
if($r['booked_date'] == date('Y-m-d') && $r['id_doctor'] == 2):
echo '<td><a href="#available" class="booked">booked</a></td>';
else :
echo '<td><a href="#" class="available">available</a></td>';
endif;
if($r['booked_date'] == date('Y-m-d') && $r['id_doctor'] == 3):
echo '<td><a href="#available" class="booked">booked</a></td>';
else :
echo '<td><a href="#" class="available">available</a></td>';
endif;
echo '</tr>';
endwhile;
```
result from webpage

and i want the result look like:
```
id_timeslot doc_A doc_B doc_C
----------------------------------------------
1 booked booked booked
2 available available available
3 available available available
4 available booked available
5 booked available available
```
Any other solution please!
| PHP timeslot booking | CC BY-SA 2.5 | null | 2010-12-28T18:23:47.627 | 2010-12-28T19:01:09.143 | 2017-05-23T11:48:23.740 | -1 | 551,559 | [
"php",
"sql",
"timeslots"
]
|
4,548,878 | 1 | 4,549,643 | null | 1 | 3,412 | I'm trying to retrieve player statistics for the last 20 weeks:
```
# select yw, money
from pref_money where id='OK122471020773'
order by yw desc limit 20;
yw | money
---------+-------
2010-52 | 1130
2010-51 | 3848
2010-50 | 4238
2010-49 | 2494
2010-48 | 936
2010-47 | 3453
2010-46 | 3923
2010-45 | 1110
2010-44 | 185
(9 rows)
```
But I would like to have the result as a string, where all values are concatenated by colons and semicolons like this:
```
"2010-44:185;2010-45:1110; .... ;2010-52:1130"
```
So I'm trying to create the following PL/pgSQL procedure:
```
create or replace function pref_money_stats(_id varchar)
returns varchar as $BODY$
begin
declare stats varchar;
for row in select yw, money from pref_money
where id=_id order by yw desc limit 20 loop
stats := row.id || ':' || row.money || ';' stats;
end loop;
return stats;
end;
$BODY$ language plpgsql;
```
But I get the syntax error:
```
ERROR: syntax error at or near "for"
LINE 7: for row in select yw, money from pref_money where id...
```
Using PostgreSQL 8.4.6 with CentOS 5.5 Linux.
I'm trying to perform all this string concatenation with PL/pgSQL and not in PHP script, because I already have a main SQL select statement, which returns user information and that information is printed row by row as XML for my mobile app:
```
select u.id,
u.first_name,
u.female,
u.city,
u.avatar,
m.money,
u.login > u.logout as online
from pref_users u, pref_money m where
m.yw=to_char(current_timestamp, 'YYYY-IW')
and u.id=m.id
order by m.money desc
limit 20 offset ?
```
Here is the screenshot of the mobile app:

And here is an XML excerpt:
```
<?xml version="1.0"?>
<pref>
<user id="OK510352632290" name="ирина" money="2067" pos="1" medals="1" female="1" avatar="http://i221.odnoklassniki.ru/getImage?photoId=259607761026&photoType=0" city="староконстантинов" />
<user id="OK19895063121" name="Александр" money="1912" pos="2" online="1" avatar="http://i69.odnoklassniki.ru/getImage?photoId=244173589553&photoType=0" city="Сызрань" />
<user id="OK501875102516" name="Исмаил" money="1608" pos="3" online="1" avatar="http://i102.odnoklassniki.ru/res/stub_128x96.gif" city="Москва" />
.....
</pref>
```
But my problem is that I have 3 other tables, from which I need that statistics for the last 20 weeks. So I'm hoping to create 3 procedures returning varchars as in my original post and integrate them in this SQL select statement. So that I can add further attributes to the XML data:
```
<user id="OK12345" .... money_stats="2010-44:185;2010-45:1110; .... ;2010-52:1130" ..... />
```
Thank you!
Alex
| PL/pgSQL: concatenating row values to a JSON-like string | CC BY-SA 2.5 | 0 | 2010-12-28T19:35:32.913 | 2021-12-01T10:31:53.023 | 2010-12-28T20:04:27.467 | 165,071 | 165,071 | [
"postgresql",
"plpgsql"
]
|
4,548,971 | 1 | 4,548,993 | null | 0 | 2,469 | I have problem with width using percentage in Mozilla Firefox.
In Firefox:

In Opera:

### Code
```
<!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=iso-8859-1">
<meta name="author" content="adminite">
<title>Untitled 2</title>
<style>
#cont {
width:99.8%;
height:125px;
border:1px solid red;
background-color:#1ea1de;
margin: 0px 0px 0px 0px;
}</style>
</head>
<body>
<div id="cont">
</div>
</body>
</html>
```
| Problem with width in percentage in Firefox | CC BY-SA 2.5 | null | 2010-12-28T19:49:32.087 | 2010-12-28T19:54:59.360 | 2020-06-20T09:12:55.060 | -1 | null | [
"css",
"firefox"
]
|
4,549,066 | 1 | null | null | 3 | 2,724 | I have some custom extensions. They're shown in the right sidebar, and I previously had them appearing directly underneath the sidebar cart, which appears at the top, as it has in the checkout.xml file.
Since upgrading to 1.4.2, my custom extensions now appear at the top of the sidebar. I've added to the extensions xml layouts, but they still appear above the sidebar cart regardless.
Changing the order of the extensions, they only move amongst themselves, always at the top - for example, if I add to any of them, they just appear after the other custom extensions, but still at the top above the cart and other default sidebar items.
Anyone any idea why?
I turned on the "Template Path Hints", and for my custom sidebar blocks, the red text showing the template paths appears further down the sidebar, where the block should be showing, but the actual html of the block is appearing at the top of the sidebar still!

| Magento xml layouts - before="-" not working in 1.4.2 | CC BY-SA 2.5 | 0 | 2010-12-28T20:02:10.333 | 2011-01-13T20:04:23.357 | 2011-01-13T20:04:23.357 | 161,056 | 161,056 | [
"magento"
]
|
4,549,165 | 1 | 4,551,097 | null | 0 | 119 | I'm trying to line up `<Image>`s in a Canvas based on absolute positioning, but the images always have a border around them. Is there anyway to get rid of it?
In this example, I have one picture called "yellow.png" that is 135h x 180w and I'm trying to place it like tiles in the Canvas. Here's the code:
```
<Grid x:Name="LayoutRoot" Background="Black" Width="720" Height="540">
<Canvas Width="720" Height="540">
<Image Source="yellow.png" Canvas.Left="0" Canvas.Top="0"/>
<Image Source="yellow.png" Canvas.Left="0" Canvas.Top="135" Width="180" Height="135"/>
<Image Source="yellow.png" Canvas.Left="0" Canvas.Top="270" Width="180" Height="135"/>
<Image Source="yellow.png" Canvas.Left="0" Canvas.Top="405"/>
<Image Source="yellow.png" Canvas.Left="180" Canvas.Top="0"/>
<Image Source="yellow.png" Canvas.Left="180" Canvas.Top="135"/>
<Image Source="yellow.png" Canvas.Left="180" Canvas.Top="270"/>
<Image Source="yellow.png" Canvas.Left="180" Canvas.Top="405"/>
</Canvas>
</Grid>
```
And here's how it looks:

Any thoughts on how i can get rid of the line between the images (so that it looks like it's just a single picture of those yellows)?
| Lining up <Image> in Silverlight leaves a line between the images - How to get rid of it? | CC BY-SA 2.5 | null | 2010-12-28T20:16:07.350 | 2010-12-29T02:39:36.643 | 2010-12-28T20:27:07.070 | 353,716 | 353,716 | [
"silverlight",
"image"
]
|
4,549,625 | 1 | 4,549,657 | null | 13 | 3,544 | A brief background: I'm working on a web-based drawing application and one of the tools I'm implementing is a 1-pixel thick pencil. The tool allows the user to draw 1px aliased lines on the canvas.
In order to determine where the user is drawing on the canvas, mouse coordinates are monitored. If mouse1 is held down, the pixel the cursor is over will change. Essentially it works just like the pencil tool in Photoshop.
The issue I'm having is that my resulting lines do not have a perfectly clean 1px weight. Here's an example:

Note that both of the lines are hand drawn, so there is some variance. What's interesting is that Photoshop is able to make a much cleaner 1px representation of the line that I draw. The reason why my line looks dirtier is because of this:


When drawing with the tool in my application, the red pixels are filled in. In Photoshop, the red pixels are not filled in. This makes sense because in order to move from a given pixel to, say, its south-east neighbor, either the east or south neighbor will likely be passed over. There is an extremely slim chance that the cursor will pass over the corner into the south-east neighbor, avoiding the drawing of the red pixel, but this usually doesn't happen.
So, the question I'm left with is how Photoshop is able to skip the red pixels that are showing up in my lines. The only thing I could think of was waiting until two pixels are queued up before drawing either of them so I would know if a "corner-neighbor" was passed over. In that case I would just not draw the first of the two pixels because it would be equivalent to a red pixel in my diagram. This runs the risk of not drawing an intended pixel if the user draws a pixel, moves the cursor one pixel south, and then one pixel east. Both of the pixels should be drawn, but the algorithm would say otherwise.
Any ideas? How might Photoshop be handling this issue?
| Drawing 1-pixel thick, aliased lines in real-time | CC BY-SA 2.5 | 0 | 2010-12-28T21:21:50.807 | 2016-10-23T00:00:34.990 | 2010-12-28T21:39:50.160 | 555,322 | 555,322 | [
"algorithm",
"graphics",
"drawing",
"paint"
]
|
4,549,640 | 1 | 4,549,727 | null | 0 | 93 | i'm trying to make some change in the following code which updates the number of votes by clicking on it with jquery. However, as shown in the image below, i want to display the vote number out of the box. I want to make it so that I click on the same green box, however I display the number out of the green box. I having difficulty making that.

Here's the original code:
Jquery:
```
<script type="text/javascript">
$(function() {
$(".vote").click(function() {
var id = $(this).attr("id");
var name = $(this).attr("name");
var dataString = 'id='+ id ;
var parent = $(this);
if(name=='up'){
$(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">');
$.ajax({
type: "POST",
url: "up_vote.php",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
} });
}else{
$(this).fadeIn(200).html('<img src="dot.gif" align="absmiddle">');
$.ajax({
type: "POST",
url: "down_vote.php",
data: dataString,
cache: false,
success: function(html) {
parent.html(html);
}
});
}
return false;
});
});
</script>
```
and here's html part:
```
<div id="main">
<div class="box1">
<div class='up'><a href="" class="vote" id="<?php echo $mes_id; ?>" name="up"><?php echo $up; ?></a></div>
</div>
<div class='box2' ><?php echo $msg; ?></div>
</div>
```
Here's Css:
```
<style type="text/css">
body{
font-family:'Georgia', Times New Roman, Times, serif;
}
#main{
height:80px; border:1px dashed #29ABE2;margin-bottom:7px;
width:500px;
}
a{
color:#DF3D82;
text-decoration:none;
}
a:hover{
color:#DF3D82;
text-decoration:underline;
}
.up{
height:40px; font-size:24px; text-align:center; background-color:#009900; margin-bottom:2px;
-moz-border-radius: 6px;-webkit-border-radius: 6px;
}
.up a{
color:#FFFFFF;
text-decoration:none;
}
.up a:hover{
color:#FFFFFF;
text-decoration:none;
}
.down{
height:40px; font-size:24px; text-align:center; background-color:#cc0000; margin-top:2px;
-moz-border-radius: 6px;-webkit-border-radius: 6px;
}
.down a{
color:#FFFFFF;
text-decoration:none;
}
.down a:hover{
color:#FFFFFF;
text-decoration:none;
}
.box1{
float:left; height:80px; width:50px;
}
.box2{
float:left; width:440px; text-align:left;
margin-left:10px;height:60px;margin-top:10px;
font-weight:bold;
font-size:18px;
}
</style>
```
Thank you very much for helping.
| request for jquery related simple help | CC BY-SA 2.5 | null | 2010-12-28T21:24:08.297 | 2010-12-28T21:45:29.813 | null | null | 523,364 | [
"jquery"
]
|
4,549,687 | 1 | 4,549,722 | null | 1 | 1,951 | How do you create a raised item within a UITabBar?
For example, Instagram has this:

How would I achieve something similar in my application?
| How do you create a raised tab bar item, like is found in Instagram? | CC BY-SA 2.5 | 0 | 2010-12-28T21:33:03.133 | 2010-12-28T22:26:15.973 | 2010-12-28T22:26:15.973 | 19,679 | 499,990 | [
"iphone",
"cocoa-touch",
"ios"
]
|
4,549,890 | 1 | 4,549,942 | null | 10 | 1,427 | Im trying to create something that looks like this using php gd library:

I've figured out how to create simple text using gd library, but im stuck on how to put a patterned text in it.
Anybody have any idea on how to do this?
| Patterned text using php GD library | CC BY-SA 2.5 | 0 | 2010-12-28T22:02:48.550 | 2011-04-20T04:00:31.073 | 2011-04-20T04:00:31.073 | 458,490 | 458,490 | [
"php",
"gd"
]
|
4,549,933 | 1 | 4,549,966 | null | 3 | 245 | I have this situation that is really irritating me now. At random times with a success rate of approximately 70-80%, running solutions in Visual Studio 2010 in Debug mode hangs the entire system to the point I need to stick my dirty finger in the restart button of my box.
This is my setup:
- - - -
My box it's been running the same configuration for more than a year now, and only recently (1-2 weeks ago) this started happening. I've noticed this happens more often with projects targeting 4.0, and even more with 4.0 ASP.NET web sites and web services. These projects have been working great for a long time and they seem to be working fine on other dev machines, convincing me further more that the problem rests on the machine itself.
This is what I've tried without success:
- - - - - -
I figured I wouldn't need to completely uninstall VS and install it again, since I tried the repair option. It seems there are other isolated people that have had the problem before.
See:
[MSDN Thread](http://social.msdn.microsoft.com/Forums/eu/vsdebug/thread/b0f8db47-b3f1-4f03-90cd-e9d8fb609548)
[MS Connect thread](https://connect.microsoft.com/VisualStudio/feedback/details/599221)
Please help. This is the most annoying and frustrating issue I think I've had to dealt with latently. I need something NOT in the margin of:
"Clean Windows 7 install"
or
"Buy a new computer"
Thanks for the help in advance!
[]
(In response to Madhur's answer)
This is my Debugging->Symbols settings' page.

| Fix for VS 2010 Debbugger BUG? | CC BY-SA 2.5 | 0 | 2010-12-28T22:09:47.480 | 2010-12-28T22:32:17.903 | 2010-12-28T22:29:39.857 | 439,166 | 439,166 | [
"visual-studio-2010",
"iis-7",
"windows-7",
"debugging"
]
|
4,549,972 | 1 | 4,550,092 | null | 4 | 1,482 | Starting with a bitmap image ..

Is there a trivial way to do this in cocoa I don't know about? (Like "CAShapeLayer for images!")?
| Bending bitmap images - just like in PS5. Algorithms? Code? image processing? | CC BY-SA 3.0 | 0 | 2010-12-28T22:15:59.727 | 2017-04-23T22:57:53.357 | 2017-04-23T22:57:53.357 | 294,884 | 294,884 | [
"iphone",
"cocoa",
"image-processing",
"bitmap"
]
|
4,550,414 | 1 | null | null | 2 | 1,673 | I wanted to draw a rectangle in android, but not just by specifying the left, top, right and bottom. What I have are 4 vertex coordinates. The rectangle is not horizontal but oblique, so something like the image of the rectangle below:

I've been trying to see if I can use a matrix to perform some kind of rotation or use `canvas.rotate()`, but I'm still not clear how to do it. Can somebody help me with how to draw such a rectangle?
| drawing oblique rectangle in android | CC BY-SA 3.0 | 0 | 2010-12-28T23:41:04.323 | 2015-04-17T02:27:34.757 | 2015-04-17T02:27:34.757 | 975,741 | 556,555 | [
"android",
"matrix",
"rotation",
"drawable"
]
|
4,550,524 | 1 | 4,581,422 | null | 7 | 2,620 |
## Willing to award a +500 bounty for a working example.
There are only 2 source code examples that I know of to accomplish the Document Preview interface on the iPad, like those found in Number, Pages, etc.
[infoNgen](https://github.com/jsjohnst/InfoNgen-iPad) and [OmniGroup Framework](https://github.com/omnigroup/OmniGroup)
Are there any other example? `infoNgen` is a good simple example, however, the code is extremely sloppy, and horribly written, very unorganized.
`OmniGroup` is an awesome library, but way too complicated for simple projects.

## Update
I was able to break down infoNgen's project and make a barebones document viewer with an HTML preview, which seems to work fairly well with updating info in the document and keeping it sync'd with the preview. Only issue now to tackle is making the documents save for when the app exits and relaunches.
| How to create iPad Document Preview interface like those found in iWorks for iPad | CC BY-SA 2.5 | 0 | 2010-12-29T00:09:19.590 | 2011-06-28T04:20:57.680 | 2011-02-02T22:49:26.110 | 171,206 | 171,206 | [
"ipad",
"ios",
"user-interface",
"document-carousel",
"document-preview"
]
|
4,550,622 | 1 | 4,555,129 | null | 2 | 2,535 | >
[Change NSTextField font size to fit](https://stackoverflow.com/questions/4503307/change-nstextfield-font-size-to-fit)
I am trying to fit a string of variable length (the number of words in the string is unknown) inside a given rectangle. I want to optimally size the string so that it is as big as possible and fits inside the rectangle. Further more, the string should word wrap if there is more than one word and that a word should not be partially rendered on multiple lines. My problem is sometimes a word is partially laid out on multiple lines as seen below. Any suggestions on what I might be doing wrong?
Thank you.

I am using an NSLayoutManager, NSTextStorage and NSTextContainer.
I initialize everything as follows:
```
textStorage = [[NSTextStorage alloc] initWithString:@""];
layoutManager = [[NSLayoutManager alloc] init];
textContainer = [[NSTextContainer alloc] init];
[layoutManager addTextContainer:textContainer];
[textStorage addLayoutManager:layoutManager];
paraStyle = [[NSMutableParagraphStyle alloc] init];
[paraStyle setLineBreakMode:NSLineBreakByWordWrapping];
[paraStyle setParagraphStyle:[NSParagraphStyle defaultParagraphStyle]];
[paraStyle setAlignment:NSCenterTextAlignment];
```
I then compute the font size as follows,
```
- (float)calculateFontSizeForString:(NSString *)aString andBoxSize:(NSSize)aBox
{
//Create the attributed string
NSAttributedString *attrString = [[NSAttributedString alloc] initWithString:aString];
[textStorage setAttributedString:attrString];
[textContainer setContainerSize:NSMakeSize(aBox.width, FLT_MAX)];
[attrString release]; //Clean up
//Initial values
float fontSize = 50.0;
float fontStepSize = 100.0;
NSRect stringRect;
BOOL didFindHeight = NO;
BOOL shouldIncreaseHeight = YES;
while (!didFindHeight)
{
NSMutableDictionary *stringAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
paraStyle, NSParagraphStyleAttributeName,
[NSFont systemFontOfSize:fontSize], NSFontAttributeName, nil];
[textStorage addAttributes:stringAttributes range:NSMakeRange(0, [textStorage length])];
(void)[layoutManager glyphRangeForTextContainer:textContainer];
stringRect = [layoutManager usedRectForTextContainer:textContainer];
if (shouldIncreaseHeight)
{
if (stringRect.size.height > aBox.height)
{
shouldIncreaseHeight = NO;
fontStepSize = fontStepSize/2;
}
fontSize += fontStepSize;
}
else
{
if (stringRect.size.height < aBox.height)
{
shouldIncreaseHeight = YES;
fontStepSize = fontStepSize/2;
if (fontStepSize <= 0.5)
{
didFindHeight = YES;
}
}
if ((fontSize - fontStepSize) <= 0)
{
fontStepSize = fontStepSize/2;
}
else
{
fontSize -= fontStepSize;
}
}
}
return fontSize;
}
```
| How to optimally fit a NSString in a rectangle? | CC BY-SA 2.5 | 0 | 2010-12-29T00:27:30.030 | 2010-12-29T14:56:43.400 | 2017-05-23T12:13:29.403 | -1 | 378,698 | [
"cocoa",
"macos",
"nsstring"
]
|
4,550,777 | 1 | null | null | 1 | 907 | I'm developing a network redirector using RDBSS.
In our network redirector volume, a executable file which is packed from [Inno Setup](http://www.jrsoftware.org/isinfo.php)(Open source packer) can not be run.
When we do double-click the file in Windows Explorer, the Explorer shows this messagebox.

It works well on 32bit Windows. Only 64bit Windows is problem.
I guess it is related with npdll or MUP.
We have implemented npdll, and I thought it doesn't have any bug now. - Of course we also have npdll 64bit version.
Other executable files and any files work well for both 32 and 64OS.
If we run this file in 64bit Windows SMB volume, it runs fine.
So, I'm pretty sure some our codes have a bug.(npdll or redirector driver)
Could you guess anything about this?
P.S Is there a good document describing how MUP works? If you know, let me know please.
Thanks.
| ShellexecuteEx fails with ERROR_NO_NET_OR_BAD_PATH | CC BY-SA 2.5 | null | 2010-12-29T01:04:27.597 | 2010-12-29T08:19:24.907 | 2010-12-29T08:19:24.907 | 252,047 | 252,047 | [
"windows",
"winapi",
"filesystems",
"shellexecute",
"windows-shell"
]
|
4,550,940 | 1 | 4,550,970 | null | 3 | 173 | I'm frustrated with having to develop Rails on Windows.
So, I installed Ubuntu 10.04 on a laptop and remote desktop'ped into it. That works.
All I really want/need to do is to have a Rails server running on Ubuntu. But can I do all the code editing, terminal access etc. from Windows?
In short, is the following possible to do:
1. Code is in some folder in Ubuntu (say /home/app1)
2. Using some sort of file sharing (Samba?), I map the /home/app1 so I can access the folder in Windows.
3. Then I access and edit the code in Windows via the file share.
4. Use some terminal (puTTY?) to do things like rails server, run generators etc, tail the log file.
5. Access the Rails site in a browser on Windows.
Any help would be much appreciated!
I know I could simply use Ubuntu via the remote desktop, but I don't want to because:
1. Don't like x-windows.
2. Too much of a hassle when cannot Alt+Tab from Remote Desktop to Windows Desktop.

| Editing code in Windows but running Rails in Ubuntu? | CC BY-SA 2.5 | null | 2010-12-29T01:54:08.473 | 2010-12-29T15:30:03.120 | 2010-12-29T15:30:03.120 | 382,818 | 382,818 | [
"windows",
"ubuntu",
"ruby-on-rails-3"
]
|
4,551,324 | 1 | null | null | 1 | 668 | this site has been really amazing for helping me with game development however I'm unable to find an answer for the following question (nor am I able to solve it on my own).
I am trying to do rectangle collision in my game. My idea is to 1) get the original collision bounding rectangle 2) Transform the texture (pos/rot/scale) 3) Factor changes of item into a matrix and then use this matrix to change the original collision bounds of the item.
However, my textures contain a lot of transparency, transparency that affect the overall height/width of the texture (I do this to maintain power of two dimensions).
My problem: How to create a rectangle that forms dimensions which ignore transparency around the object. A picture is provided below:

| Forming bounding box only around visible sprites | CC BY-SA 2.5 | null | 2010-12-29T03:45:21.743 | 2011-01-04T23:41:54.003 | 2010-12-29T07:21:21.433 | 38,206 | 556,703 | [
"c#",
".net",
"xna"
]
|
4,551,409 | 1 | 4,551,560 | null | 4 | 1,879 | Where can I get the MenuItem TopLevelHeader Control Template? The [MSDN](http://msdn.microsoft.com/en-us/library/ms752296.aspx) link for styling menu items gives a modified template.

I need to obtain a control template that contains a default pop-up/context menu.
| Default MenuItem TopLevelHeader Control Template | CC BY-SA 2.5 | null | 2010-12-29T04:10:37.293 | 2010-12-29T04:56:55.737 | null | null | 504,310 | [
"wpf",
"wpf-controls"
]
|
4,551,582 | 1 | 4,551,809 | null | 25 | 13,829 | I am trying to combine a histogram and boxplot for visualizing a continuous variable. Here is the code I have so far
```
require(ggplot2)
require(gridExtra)
p1 = qplot(x = 1, y = mpg, data = mtcars, xlab = "", geom = 'boxplot') +
coord_flip()
p2 = qplot(x = mpg, data = mtcars, geom = 'histogram')
grid.arrange(p2, p1, widths = c(1, 2))
```

It looks fine except for the alignment of the x axes. Can anyone tell me how I can align them?
Alternately, if someone has a better way of making this graph using `ggplot2`, that would be appreciated as well.
| Combination Boxplot and Histogram using ggplot2 | CC BY-SA 3.0 | 0 | 2010-12-29T04:56:15.850 | 2018-04-25T15:25:45.593 | 2016-09-08T02:14:30.923 | 3,604,745 | 235,349 | [
"r",
"ggplot2",
"histogram",
"boxplot"
]
|
4,551,647 | 1 | 4,607,475 | null | 0 | 1,561 | I just published a C# [Windows Forms](http://en.wikipedia.org/wiki/Windows_Forms) application with the "From a Web Site" option. Then I installed it in my computer and successfully ran it. The only problem is that every time I run my installed application, this window pops up and then disappears:

Is there any way to get rid of it?
| ClickOnce published an application installed from web showing annoying "Launching Application" window every time I run it | CC BY-SA 3.0 | 0 | 2010-12-29T05:14:55.097 | 2013-06-07T09:13:56.910 | 2013-06-07T09:13:56.910 | 63,550 | 1,219,414 | [
"c#",
".net",
"winforms",
"clickonce"
]
|
4,551,767 | 1 | 4,573,089 | null | 0 | 136 | I mostly use safari for web browsing, and testing for web development, but I have noticed that on a few pages "Paint" is constantly being fired under the rendering timeline in the timeline pane under the debug menu. I was wondering if anyone could explain what that possibly could be or mean. I have tried searching the internet, but can not find any information on it. It looks like this:

| Help With Developer Menu In Web Browsers | CC BY-SA 2.5 | null | 2010-12-29T05:44:36.787 | 2011-01-07T07:21:12.667 | null | null | 476,412 | [
"performance",
"browser",
"safari",
"timeline"
]
|
4,551,708 | 1 | 4,554,288 | null | 0 | 1,368 | Im new to ofbiz.So is my question is have any mistake forgive me for my mistakes.Im new to ofbiz so i did not know some terminologies in ofbiz.Sometimes my question is not clear because of lack of knowledge in ofbiz.So try to understand my question and give me a good solution with respect to my level.Because some solutions are in very high level cannot able to understand for me.So please give the solution with good examples.
My project namely "productionmgntSystem" is in "ofbiz/hot-deploy" folder.In my project i had a file namely "app_details_1.ftl" with the following codings
```
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<!--<meta http-equiv="Content-Type" content="multipart/form-data; charset=ISO-8859-1">-->
<title>Insert title here</title>
<script TYPE="TEXT/JAVASCRIPT" language=""JAVASCRIPT">
function uploadFile()
{
//alert("Before calling upload.jsp");
window.location='<@ofbizUrl>testing_service1</@ofbizUrl>'
}
function logout1()
{
//alert("Logout1");
alert("<@ofbizUrl>logout1</@ofbizUrl>");
window.location='<@ofbizUrl>logout1</@ofbizUrl>'
}
</script>
</head>
<!-- <form action="<@ofbizUrl>testing_service1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> -->
<form enctype="multipart/form-data" action="<@ofbizUrl>uploadAttachFile</@ofbizUrl>" METHOD=POST>
<center style="height: 299px; ">
<table border="0" style="height: 177px; width: 788px">
<tr style="height: 115px; ">
<td style="width: 103px; ">
<td style="width: 413px; "><h1>APPLICATION DETAILS</h1>
<td style="width: 55px; ">
</tr>
<tr>
<td style="width: 125px; ">Application name : </td>
<td>
<input name="app_name_txt" id="txt_1" value=" " />
</td>
</tr>
<tr>
<td style="width: 125px; ">Excell sheet : </td>
<td>
<input type="file" name="filename"/>
</td>
</tr>
<tr>
<td>
<input type="button" name="logout1_cmd" value="Logout" onclick="logout1()"/>
<!-- <input type="submit" name="logout_cmd" value="logout"/>-->
</td>
<td>
<input type="submit" name="upload_cmd" value="UPLOAD" />
<!-- <input type="button" name="upload1_cmd" value="Upload" onclick="uploadFile()"/> -->
</td>
</tr>
</table>
</center>
</form>
</html>
```
the following are the some of the coding present in the "controller.xml" file
```
..........
..........
...........
<request-map uri="uploadAttachFile">
<security https="true" auth="true"/>
<!-- <event type="simple" invoke="createCommunicationContent" path="component://productionmgntSystem/script/org/ofbiz/productionmgntSystem/CommunicationEventEvents.xml"/> -->
<event type="java" path="org.ofbiz.productionmgntSystem.web_app_req.Uploading" invoke="uploadFile"/>
<response name="AttachementSuccess" type="view" value="AttachementSuccess"/>
<response name="AttachementException" type="view" value="AttachementException"/>
</request-map>
...............
...........
............
<!-- I DEFINED - START -->
<view-map name="AttachmentError" type="ftl" page="file_attach_error.ftl"/>
<view-map name="AttachementException" type="ftl" page="file_attach_error.ftl"/>
<view-map name="AttachementSuccess" type="ftl" page="AttachementSuccess.ftl"/>
<!-- I DEFINED - END -->
...............
...............
.............
```
The following are the coding in the file "AttachementSuccess.ftl"
```
<html>
<head>
<title>FILE ATTACH SUCCESS</title>
</head>
<form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="file_attach_error_frm">
<table>
<tr>
<td>
<td>
<td>
</tr>
<tr>
<td>
<td>File attachement success</td>
<td>
</tr>
<tr>
<td>
<td><input type="submit" value="LOGOUT"/></td>
<td>
</tr>
</table>
</form>
</html>
```
The following are the coding present in the file "file_attach_error.ftl"
```
<html>
<head>
<title>FILE ATTACH ERROR</title>
</head>
<form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="file_attach_error_frm">
<table>
<tr>
<td>
<td>
<td>
</tr>
<tr>
<td>
<td>File attachement error</td>
<td>
</tr>
<tr>
<td>
<td><input type="submit" value="LOGOUT"/></td>
<td>
</tr>
</table>
</form>
</html>
```
the following are the coding inside the file "Uploading.java"
```
//UPLOADING A CONTENT TO THE SERVER
package org.ofbiz.productionmgntSystem.web_app_req;
import java.io.File;
import java.nio.ByteBuffer;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.ofbiz.service.ServiceUtil;
import java.util.List;
public class Uploading
{
public static String uploadFile(HttpServletRequest request,HttpServletResponse response)
{
//ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory(10240, new File(new File("runtime"), "tmp"))); //Creation of servletfileupload
System.out.println("\n\n\t****************************************\n\tuploadFile(HttpServletRequest request,HttpServletResponse response) - start\n\t");
ServletFileUpload fu = new ServletFileUpload(new DiskFileItemFactory()); //Creation of servletfileupload
java.util.List lst = null;
String result="AttachementException";
try
{
lst = fu.parseRequest(request);
}
catch (FileUploadException fup_ex)
{
System.out.println("\n\n\t****************************************\n\tException of FileUploadException \n\t");
fup_ex.printStackTrace();
result="AttachementException";
return(result);
}
if(lst.size()==0) //There is no item in lst
{
System.out.println("\n\n\t****************************************\n\tLst count is 0 \n\t");
result="AttachementException";
return(result);
}
FileItem file_item = null;
FileItem selected_file_item=null;
//Checking for form fields - Start
for (int i=0; i < lst.size(); i++)
{
file_item=(FileItem)lst.get(i);
String fieldName = file_item.getFieldName();
//Check for the attributes for user selected file - Start
if(fieldName.equals("filename"))
{
selected_file_item=file_item;
break;
}
//Check for the attributes for user selected file - End
}
//Checking for form fields - End
//Uploading the file content - Start
if(selected_file_item==null) //If selected file item is null
{
System.out.println("\n\n\t****************************************\n\tThe selected file item is null\n\t");
result="AttachementException";
return(result);
}
byte[] file_bytes=selected_file_item.get();
ByteBuffer byteWrap=ByteBuffer.wrap(file_bytes);
byte[] extract_bytes=null;
byteWrap.get(extract_bytes);
System.out.println("\n\n\t****************************************\n\tExtract succeeded :content are : \n\t");
if(extract_bytes==null)
{
System.out.println("\n\n\t****************************************\n\tExtract bytes is null\n\t");
result="AttachementException";
return(result);
}
for(int k=0;k<extract_bytes.length;k++)
System.out.print((char)extract_bytes[k]);
System.out.println("\n\n\t****************************************\n\tuploadFile(HttpServletRequest request,HttpServletResponse response) - end\n\t");
return("AttachementSuccess");
//Uploading the file content - End
}
}
```
I want to upload a file into the server using " tag.When i execute the application the following error is shown in browser.

The following are the stackTrace print in the console
```
[java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [ JavaEventHandler.ja
va:100:ERROR]
[java] ---- runtime exception report --------------------------------------
------------
[java] Problems Processing Event
[java] Exception: java.lang.NullPointerException
[java] Message: null
[java] ---- stack trace ---------------------------------------------------
------------
[java] java.lang.NullPointerException
[java] java.nio.ByteBuffer.get(ByteBuffer.java:675)
[java] org.ofbiz.productionmgntSystem.web_app_req.Uploading.uploadFile(Uplo
ading.java:76)
[java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:39)
[java] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:25)
[java] java.lang.reflect.Method.invoke(Method.java:597)
[java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:92)
[java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:78)
[java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java
:592)
[java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.jav
a:361)
[java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:20
2)
[java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:7
8)
[java] javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
[java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
[java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:290)
[java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
[java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:2
59)
[java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:235)
[java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
[java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:233)
[java] org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:175)
[java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:128)
[java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:102)
[java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:109)
[java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
:568)
[java] org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(Cross
SubdomainSessionValve.java:62)
[java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:286)
[java] org.apache.coyote.http11.Http11Processor.process(Http11Processor.jav
a:844)
[java] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
ess(Http11Protocol.java:583)
[java] org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
47)
[java] java.lang.Thread.run(Thread.java:619)
[java] --------------------------------------------------------------------
------------
[java]
[java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [ ControlServlet.ja
va:205:ERROR]
[java] ---- exception report ----------------------------------------------
------------
[java] Error in request handler:
[java] Exception: org.ofbiz.webapp.event.EventHandlerException
[java] Message: Problems processing event: java.lang.NullPointerException (
null)
[java] ---- cause ---------------------------------------------------------
------------
[java] Exception: java.lang.NullPointerException
[java] Message: null
[java] ---- stack trace ---------------------------------------------------
------------
[java] java.lang.NullPointerException
[java] java.nio.ByteBuffer.get(ByteBuffer.java:675)
[java] org.ofbiz.productionmgntSystem.web_app_req.Uploading.uploadFile(Uplo
ading.java:76)
[java] sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl
.java:39)
[java] sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcce
ssorImpl.java:25)
[java] java.lang.reflect.Method.invoke(Method.java:597)
[java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:92)
[java] org.ofbiz.webapp.event.JavaEventHandler.invoke(JavaEventHandler.java
:78)
[java] org.ofbiz.webapp.control.RequestHandler.runEvent(RequestHandler.java
:592)
[java] org.ofbiz.webapp.control.RequestHandler.doRequest(RequestHandler.jav
a:361)
[java] org.ofbiz.webapp.control.ControlServlet.doGet(ControlServlet.java:20
2)
[java] org.ofbiz.webapp.control.ControlServlet.doPost(ControlServlet.java:7
8)
[java] javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
[java] javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
[java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:290)
[java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
[java] org.ofbiz.webapp.control.ContextFilter.doFilter(ContextFilter.java:2
59)
[java] org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(App
licationFilterChain.java:235)
[java] org.apache.catalina.core.ApplicationFilterChain.doFilter(Application
FilterChain.java:206)
[java] org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapper
Valve.java:233)
[java] org.apache.catalina.core.StandardContextValve.invoke(StandardContext
Valve.java:175)
[java] org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.
java:128)
[java] org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.
java:102)
[java] org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVa
lve.java:109)
[java] org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java
:568)
[java] org.ofbiz.catalina.container.CrossSubdomainSessionValve.invoke(Cross
SubdomainSessionValve.java:62)
[java] org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.ja
va:286)
[java] org.apache.coyote.http11.Http11Processor.process(Http11Processor.jav
a:844)
[java] org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proc
ess(Http11Protocol.java:583)
[java] org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:4
47)
[java] java.lang.Thread.run(Thread.java:619)
[java] --------------------------------------------------------------------
------------
[java]
[java] 2010-12-29 10:56:38,336 (http-0.0.0.0-443-1) [ ControlServlet.ja
va:221:ERROR] An error occurred, going to the errorPage: /error/error.jsp
[java] 2010-12-29 10:56:38,351 (http-0.0.0.0-443-1) [ ControlServlet.ja
va:228:ERROR] Including errorPage: /error/error.jsp
[java] 2010-12-29 10:56:38,367 (http-0.0.0.0-443-1) [ ControlServlet.ja
va:302:INFO ] [[[uploadAttachFile] Request Done- total:0.063,since last([uploadA
ttachFile...):0.063]]
```
I cannot able to solve the issue.So please help me to solve the issue.
Thanks & Regards,
Sivakumar.J
| How to debug the ofbiz application from the error "865 (http-0.0.0.0-443-5) [ JavaEventHandler.ja va:100:ERROR]" | CC BY-SA 2.5 | 0 | 2010-12-29T05:30:08.613 | 2010-12-29T12:57:24.607 | null | null | 385,138 | [
"java",
"xml",
"web-services",
"web-applications",
"ofbiz"
]
|
4,551,864 | 1 | 4,552,007 | null | 0 | 72 | I am trying to create a list view from the database. this is the code
List Activity
```
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.inbox);
DBAdapter db = new DBAdapter(InboxActivity.this);
db.open();
long userID = Long.parseLong(MessagingApplication.getUserID());
Cursor inbox = db.readInbox(userID);
startManagingCursor(inbox);
String[] mails = new String[] { DBAdapter.KEY_NAME };
int[] to = new int[] { R.id.name };
SimpleCursorAdapter inboxmail = new SimpleCursorAdapter(this,
R.layout.inbox_list, inbox, mails, to);
setListAdapter(inboxmail);
db.close();
}
```
This is the code that fetches data from the DB
```
public Cursor readInbox(long toId) throws SQLException {
return db.query(TABLE_MAILS, new String[] { ID, KEY_FROM, KEY_TO,
KEY_SUB, KEY_BODY, KEY_DATETIME, KEY_READ }, KEY_TO + "="
+ toId, null, null, null, null, null);
}
```
My DB
```
private static final String CREATE_MAILS = "CREATE TABLE mails (id INTEGER PRIMARY KEY AUTOINCREMENT, pid INTEGER DEFAULT '0', from_id INTEGER, to_id INTEGER, subject TEXT, body TEXT, datetime TEXT, read INTEGER);";
```
Error:

[http://variable3.com/files/screenshots/2010-12-29_1136.png](http://variable3.com/files/screenshots/2010-12-29_1136.png)
| Db to ListView error | CC BY-SA 2.5 | null | 2010-12-29T06:09:04.360 | 2010-12-29T06:40:34.407 | null | null | 155,196 | [
"android",
"listview"
]
|
4,552,008 | 1 | 4,655,782 | null | 18 | 6,362 | I need the opposite of the `GraphicsPath.Widen()` method in .Net:
```
public GraphicsPath Widen()
```
The `Widen()` method does not accept a negative parameter, so I need the equivalent of an `Inset` method:
```
public GraphicsPath Inset()
```
You can do this in the open source Inkscape application (www.Inkscape.org) by going to menu and selecting "Path / Inset" (the Inset amount is stored in the Inkscape Properties dialog). Since Inkscape is open source, it should be possible to do this in C#.Net, but I can't follow the the Inkscape C++ source for the life of me (and I just need this one function so I can't justify learning C++ to complete this).
Basically, I need a GraphicsPath extension method with this signature:
```
public static GraphicsPath Inset(this GraphicsPath original, float amount)
{
//implementation
}
```
As the signature states, it will take a `GraphicsPath` object and `.Inset()` the path by a passed amount... just like Inkscape does today. If it simplifies matters any, the GraphicsPaths in question are all created from the `.PolyBezier` method (and nothing else), so there is no need to account for rects, ellipses, or any other shapes unless you want to do it for completeness.
Unfortunately, I have no experience with C++ code, so its just about impossible for me to follow the C++ logic contained in Inkscape.
.
[EDIT:]
As requested, here is the "MakeOffset" Inkscape code. The second parameter (double dec) will be negative for an Inset, and the absolute value of that parameter is the amount to bring in the shape.
I know that there are a lot of dependencies here. If you need to see more of the Inkscape source files, they are here: [http://sourceforge.net/projects/inkscape/files/inkscape/0.48/](http://sourceforge.net/projects/inkscape/files/inkscape/0.48/)
```
int
Shape::MakeOffset (Shape * a, double dec, JoinType join, double miter, bool do_profile, double cx, double cy, double radius, Geom::Matrix *i2doc)
{
Reset (0, 0);
MakeBackData(a->_has_back_data);
bool done_something = false;
if (dec == 0)
{
_pts = a->_pts;
if (numberOfPoints() > maxPt)
{
maxPt = numberOfPoints();
if (_has_points_data) {
pData.resize(maxPt);
_point_data_initialised = false;
_bbox_up_to_date = false;
}
}
_aretes = a->_aretes;
if (numberOfEdges() > maxAr)
{
maxAr = numberOfEdges();
if (_has_edges_data)
eData.resize(maxAr);
if (_has_sweep_src_data)
swsData.resize(maxAr);
if (_has_sweep_dest_data)
swdData.resize(maxAr);
if (_has_raster_data)
swrData.resize(maxAr);
if (_has_back_data)
ebData.resize(maxAr);
}
return 0;
}
if (a->numberOfPoints() <= 1 || a->numberOfEdges() <= 1 || a->type != shape_polygon)
return shape_input_err;
a->SortEdges ();
a->MakeSweepDestData (true);
a->MakeSweepSrcData (true);
for (int i = 0; i < a->numberOfEdges(); i++)
{
// int stP=a->swsData[i].stPt/*,enP=a->swsData[i].enPt*/;
int stB = -1, enB = -1;
if (dec > 0)
{
stB = a->CycleNextAt (a->getEdge(i).st, i);
enB = a->CyclePrevAt (a->getEdge(i).en, i);
}
else
{
stB = a->CyclePrevAt (a->getEdge(i).st, i);
enB = a->CycleNextAt (a->getEdge(i).en, i);
}
Geom::Point stD, seD, enD;
double stL, seL, enL;
stD = a->getEdge(stB).dx;
seD = a->getEdge(i).dx;
enD = a->getEdge(enB).dx;
stL = sqrt (dot(stD,stD));
seL = sqrt (dot(seD,seD));
enL = sqrt (dot(enD,enD));
MiscNormalize (stD);
MiscNormalize (enD);
MiscNormalize (seD);
Geom::Point ptP;
int stNo, enNo;
ptP = a->getPoint(a->getEdge(i).st).x;
double this_dec;
if (do_profile && i2doc) {
double alpha = 1;
double x = (Geom::L2(ptP * (*i2doc) - Geom::Point(cx,cy))/radius);
if (x > 1) {
this_dec = 0;
} else if (x <= 0) {
this_dec = dec;
} else {
this_dec = dec * (0.5 * cos (M_PI * (pow(x, alpha))) + 0.5);
}
} else {
this_dec = dec;
}
if (this_dec != 0)
done_something = true;
int usePathID=-1;
int usePieceID=0;
double useT=0.0;
if ( a->_has_back_data ) {
if ( a->ebData[i].pathID >= 0 && a->ebData[stB].pathID == a->ebData[i].pathID && a->ebData[stB].pieceID == a->ebData[i].pieceID
&& a->ebData[stB].tEn == a->ebData[i].tSt ) {
usePathID=a->ebData[i].pathID;
usePieceID=a->ebData[i].pieceID;
useT=a->ebData[i].tSt;
} else {
usePathID=a->ebData[i].pathID;
usePieceID=0;
useT=0;
}
}
if (dec > 0)
{
Path::DoRightJoin (this, this_dec, join, ptP, stD, seD, miter, stL, seL,
stNo, enNo,usePathID,usePieceID,useT);
a->swsData[i].stPt = enNo;
a->swsData[stB].enPt = stNo;
}
else
{
Path::DoLeftJoin (this, -this_dec, join, ptP, stD, seD, miter, stL, seL,
stNo, enNo,usePathID,usePieceID,useT);
a->swsData[i].stPt = enNo;
a->swsData[stB].enPt = stNo;
}
}
if (dec < 0)
{
for (int i = 0; i < numberOfEdges(); i++)
Inverse (i);
}
if ( _has_back_data ) {
for (int i = 0; i < a->numberOfEdges(); i++)
{
int nEd=AddEdge (a->swsData[i].stPt, a->swsData[i].enPt);
ebData[nEd]=a->ebData[i];
}
} else {
for (int i = 0; i < a->numberOfEdges(); i++)
{
AddEdge (a->swsData[i].stPt, a->swsData[i].enPt);
}
}
a->MakeSweepSrcData (false);
a->MakeSweepDestData (false);
return (done_something? 0 : shape_nothing_to_do);
}
```
.
- Amazing work. The code was even clean and readable! Nice work, sir. I did have a couple of questions for you, though.
First, what does a positive number for the Amount represent? I was thinking that for the Offset method, positive would be "outset" and negative would be "inset", but your example seems to do the opposite.
Second, I did some basic testing (just extending your sample), and found some oddities.
Here is what happens to the "l" in cool when the offset grows (for such a simple letter, it sure likes to cause problems!).

...and the code to reproduce that one:
```
private void Form1_Paint(object sender, PaintEventArgs e)
{
GraphicsPath path = new GraphicsPath();
path.AddString("cool", new FontFamily("Arial"), 0, 200, new PointF(), StringFormat.GenericDefault);
GraphicsPath offset1 = path.Offset(32);
e.Graphics.DrawPath(new Pen(Color.Black, 1), path);
e.Graphics.DrawPath(new Pen(Color.Red, 1), offset1);
}
```
Finally, something a little different. Here is the "S" character from Wingdings (appears like a tear drop):

Here is the code:
```
private void Form1_Paint(object sender, PaintEventArgs e)
{
GraphicsPath path = new GraphicsPath();
path.AddString("S", new FontFamily("Wingdings"), 0, 200, new PointF(), StringFormat.GenericDefault);
GraphicsPath offset1 = path.Offset(20);
e.Graphics.DrawPath(new Pen(Color.Black, 1), path);
e.Graphics.DrawPath(new Pen(Color.Red, 1), offset1);
}
```
Man, this is so close, it makes me want to cry. It still doesn't work, though.
I think what would fix it is to see when the inset vectors intersect, and stop insetting past that point. If the Inset amount is so large (or the path so small) that there is nothing left, the path should disappear (become null), instead of reversing on itself and re-expanding.
Again, I'm not knocking what you've done in any way, but I was wondering if you know what might be going on with these examples.
(PS - I added the 'this' keyword to make it an extension method, so you might need to call the code using method(parameters) notation to get these samples to run)
.
Ran come up with a similar output, by re-using the GraphicsPath native methods. Man, this is tough. Both of them are so close.
Here is a screen shot of both examples, using the character "S" from Wingdings:

@Simon is on the left, @Ran on the right.
Here is the same tear drop "S" character after doing an "Inset" in Inkscape. The Inset is clean:

By the way, here is the code for @Ran's test:
```
private void Form1_Paint(object sender, PaintEventArgs e)
{
GraphicsPath path = new GraphicsPath();
path.AddString("S", new FontFamily("Wingdings"), 0, 200, new PointF(), StringFormat.GenericDefault);
e.Graphics.DrawPath(new Pen(Color.Black, 1), path);
GraphicsPath offset1 = path.Shrink(20);
e.Graphics.DrawPath(new Pen(Color.Red, 1), offset1);
}
```
| .Net Opposite of GraphicsPath.Widen() | CC BY-SA 3.0 | 0 | 2010-12-29T06:35:31.560 | 2015-02-27T02:18:12.850 | 2015-02-27T02:16:44.230 | 494,219 | 494,219 | [
"c#",
"open-source",
"graphicspath"
]
|
4,552,272 | 1 | null | null | 3 | 1,236 | I require actual Text width from a TextView.
To expalin this heres my TextView description:
1. TextView lies in a LinearLayout with some internal padding.
2. TextView is set to fill the width and wrap up the height.
3. TextView has a leftCompoundDrawable set and a rightCompoundDrawable set.
4. Theres also padding given to text of textview from left compound drawable.
5. Text from text view can be multiline.
What I meant from from is property of TextView which can be set using `android:text` property from XML or by calling setText() on TextView.
Heres what I am doing.
```
[ScreenWidth]-[LeftCompundDrawableIntrinsic Width]-[RightDrawabaleIntrinsicWidth]-[LeftCompoundDrawablePadding]
```
Heres an image describing my TextView

| Actual Text Width android | CC BY-SA 2.5 | null | 2010-12-29T07:27:27.503 | 2010-12-29T13:16:01.557 | null | null | 447,238 | [
"android",
"width",
"textview",
"measure"
]
|
4,552,313 | 1 | 4,553,279 | null | 5 | 1,595 | I have implemented IDataErrorInfo in my ViewModel to return a string if the text box has error.
```
public string this[string columnName]
{
get { return "Error-- This is a long error message - sd"; }
}
```
But this error message goes behind the other control on the UI as shown below.

Below is the xaml:
```
<Window x:Class="Test.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="600" Width="600">
<Window.Resources>
<ControlTemplate x:Key="validationTemplateNew">
<DockPanel LastChildFill="True">
<TextBlock Name="ErrorText" DockPanel.Dock="Bottom" Foreground="White" Background="Red"
FontSize="12" Padding="2" FontFamily="Trebuchet MS"
Margin="5,5,0,0"
TextWrapping="Wrap"
Text="{Binding [0].ErrorContent}" ></TextBlock>
<AdornedElementPlaceholder Name="ErrorTextBox" />
</DockPanel>
</ControlTemplate>
<Style x:Key="ValidationStyle" TargetType="{x:Type TextBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BitmapEffect">
<Setter.Value>
<BitmapEffectGroup>
<OuterGlowBitmapEffect GlowColor="Red" GlowSize="3" Noise="0.6"></OuterGlowBitmapEffect>
</BitmapEffectGroup>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<ItemsControl Name="ItemCtrl">
<AdornerDecorator>
<TextBox
FontSize="11"
Margin="10"
Width="250"
VerticalAlignment="Center"
Text="{Binding Path=StrText, ValidatesOnDataErrors=True,
UpdateSourceTrigger=PropertyChanged}"
Validation.ErrorTemplate="{StaticResource validationTemplateNew}"
Style="{StaticResource ValidationStyle}"
>
</TextBox>
</AdornerDecorator>
<TextBox Width="250" Text="ASDFASFASDFASDFASDFASDFASDF"/>
<TextBox Width="250" Text="ASDFASFASDFASDFASDFASDFASDF"/>
<TextBox Width="250" Text="ASDFASFASDFASDFASDFASDFASDF"/>
<TextBox Width="250" Text="ASDFASFASDFASDFASDFASDFASDF"/>
<TextBox Width="250" Text="ASDFASFASDFASDFASDFASDFASDF"/>
</ItemsControl>
</Grid>
</Window>
```
Please let me know how to use AdornerDecorator such that the error message overlaps the other controls and doesn't go behind.
My application is such that if I don't use AdornerDecorator, the error message is not displayed at all.
| WPF- Validation -The validation error message goes behind the other controls because of AdornerDecorator | CC BY-SA 2.5 | 0 | 2010-12-29T07:37:09.213 | 2010-12-29T10:25:58.390 | 2020-06-20T09:12:55.060 | -1 | 473,376 | [
"wpf",
"idataerrorinfo",
"adornerdecorator"
]
|
4,552,621 | 1 | 4,553,139 | null | 0 | 989 | I am new in sharepoint development. I have 2 webparts attached on a page. The first webpart (MyTestingWebpart[1](https://i.stack.imgur.com/e7mHm.jpg)) basically it does only inserting of data and the other webpart (MyTestingWebpart[2]) displays the records from the database. Now my problem is when I try to click on the save button, somehow I don't know how to refresh the webpart that displays the newly inserted record. Is this possible?
I have added a query at the page load event of MyTestingWebPart[2]. Both of the webparts attached are web user controls. Thanks!

| Need to reload the information of the sharepoint 2007 webpart after a button is clicked from another webpart | CC BY-SA 2.5 | 0 | 2010-12-29T08:39:14.517 | 2010-12-29T10:03:37.860 | null | null | 249,580 | [
"c#",
"asp.net",
"sharepoint",
"web-parts"
]
|
4,553,007 | 1 | null | null | 2 | 37,452 | I have put an image in border-less `button` tag. When the button is selected with , a brown border appears around the image. How do I change color of that rectangle from brown to white. Is is possible to have a white rectangle with inner and outer shadow of blue.
HTML
```
<td align=center valign=middle>
<figure>
<button style="background-color:black; height:160px;width:160px ; border:none">
<img src="F:\rashmi\icons_tv\Help_Normal.png">
</button>
<figcaption><font size="5" color="white" style="font-weight:bold"><center>help</center></font>
</figcaption>
</figure>
</td>
```

I can change highlight color by using `style=outline-color:white`
HTML
```
<html>
<body>
<tr>
<td align=center valign=middle>
<figure>
<button style="background-color:black; height:160px;width:160px ; border:none;outline-color:white;">
<img src="F:\rashmi\icons_tv\Help_Normal.png">
</button>
<figcaption><font size="5" color="white" style="font-weight:bold"><center>help</center></font>
</figcaption>
</figure>
</td>
<td align=center valign=middle>
<figure>
<button style="background-color:black; height:160px;width:160px ; border:none;outline-color:white;">
<img src="F:\rashmi\icons_tv\Help_Normal.png">
</button>
<figcaption><font size="5" color="white" style="font-weight:bold"><center>help</center></font>
</figcaption>
</figure>
</td>
</tr>
</body>
</html>
```

Here is my initial page load image and if I press I get a highlight similar to what is shown

How do I increase the rectangle width.
| changing button tag border color | CC BY-SA 3.0 | null | 2010-12-29T09:45:18.393 | 2016-03-09T14:06:52.547 | 2013-07-10T17:01:09.043 | 1,470,950 | 509,491 | [
"html"
]
|
4,553,073 | 1 | null | null | 1 | 974 | I'm trying to make a custom gridview in WPF but I just realized that as this [link](http://msdn.microsoft.com/en-us/library/system.windows.controls.gridviewcolumnheader.role.aspx) says:
> The GridViewHeaderRowPresenter class
performs layout for the column headers
in a GridView and places an additional
column header at the end to add space
and because of the additional column header at the end, there's an extra column to the right of the last column. so I was wondering if I can modify it, please refer to this image below 
My questions are:
1. Is there anyway I can remove the 'A' part from the grid?
2. Is there anyway I can add the same effect of 'B' part (the role = padding header) to the 'C' Part (before the first column)?
Thanks
| How to remove the auto added column (HeaderRole=Padding) in WPF GridView | CC BY-SA 2.5 | null | 2010-12-29T09:53:54.040 | 2023-01-04T19:45:12.723 | 2010-12-29T10:50:44.407 | 318,425 | 269,963 | [
"wpf",
"xaml",
"gridview"
]
|
4,553,150 | 1 | 4,561,057 | null | -1 | 841 | How to stretch image according to it's content horizontally with css.

```
//html code
<style>
html, body{
margin: 0;
padding: 0;
}
#cont {
width:100%;
height:125px;
background-color:#1ea1de;
}
.logo {
height:100px;
width:300px;
background: url(logo3.png) no-repeat;
margin-top:-105px;
}
#liniq {
height:2.5px;
width:100%;
background-color: #b5babc;
margin-top:5px;
}
#levo {
background: url(levo.gif) no-repeat;
width:64px;
height:104px;
margin-left:280px;
margin-top:-170px;
}
#middle {
background:url(middle.gif) repeat-x;
height:41px;
margin-top:-62px;
margin-left:321px;
border:1px solid red;
overflow:hidden;
}
</style>
</head>
<body>
<div id="cont"></div>
<div class="logo"></div>
<div id="liniq"></div>
<div id="buttons">
<div id="levo"></div>
<div id="middle"></div>
</div>
</body>
</html>
```
But it don't stretch according to the content...
| Stretch image according to the content css | CC BY-SA 2.5 | null | 2010-12-29T10:05:31.813 | 2010-12-30T08:18:01.470 | 2010-12-29T10:24:24.657 | null | null | [
"css",
"stretch"
]
|
4,553,260 | 1 | 4,553,296 | null | 0 | 302 | I just want to create those buttons at the bottom of the image attached saying "Messages", "Updates", "Sent".
Are these buttons ready-made UIKit buttons? if so what controls are they?
Thank you!
F.

| Facebook-Messages-like Bar Button Items? | CC BY-SA 2.5 | 0 | 2010-12-29T10:22:29.600 | 2010-12-29T12:09:50.313 | null | null | 552,312 | [
"iphone",
"uikit"
]
|
4,553,622 | 1 | 4,554,425 | null | 3 | 980 | CC.Net is pretty cool and we have been using it in our organisation for just under a year now.
However the project list is on about 30 projects at the moment. and It takes ages just to scan though the list looking for the correct build and trying not to click on the wrong one!
Is there anyway to group builds into folders on the dashboard UI i.e. this screen:

(Random CCNEt dashboard image I found on the web)
Jason
| Cruise control - project list is so long on dashboard - can we have folders? | CC BY-SA 2.5 | null | 2010-12-29T11:21:53.773 | 2010-12-29T14:07:16.727 | null | null | 138,234 | [
"cruisecontrol.net"
]
|
4,553,692 | 1 | 4,554,309 | null | 11 | 19,065 | I followed `ChrisF` [here](https://stackoverflow.com/questions/2899948/get-rid-of-button-border-in-wpf) and write a [simple demo](https://docs.google.com/uc?id=0B0fBOJ9vvqOfZjA0NDI5MGEtY2E1Yi00ODYzLWJmMWEtMjU3MmQyZmNkYjQ3&export=download&hl=en_US).
> ...open your project in Expression Blend,
select the button and then right click
and select "Edit Template > Edit a
Copy..". This copies the existing
template into one you can modify. It's
easier if you create it in a resource
dictionary.
And I can see the behind-the-screen template of the button as below screenshot (The in Resource).
I want to remove the white-gradient border of the . How can I do that?
ps. To make the problem simple I use the ButtonChrome as a normal control on my view. I browse the properties but still got NO idea where to remove the "white" border.
(The in-use)

(The in Resource)

| How to remove ButtonChrome border (when defining the template of a border)? | CC BY-SA 2.5 | 0 | 2010-12-29T11:31:40.473 | 2017-02-11T09:47:27.233 | 2017-05-23T12:33:41.987 | -1 | 248,616 | [
"wpf",
"xaml",
"button",
"border"
]
|
4,553,813 | 1 | 4,553,879 | null | 3 | 950 | I am trying to build the library into an application built with the PHP framework.
In a test app the Kohana framework, I can create and read Excel files fine.
And the Kohana application, a file works:
```
$objPHPExcel = new PHPExcel();
$objPHPExcel->getProperties()->setCreator("Test Generator")
->setTitle("Test Excel5 File");
$objPHPExcel->setActiveSheetIndex(0)->setCellValue('A1', 'Hello');
$objPHPExcel->getActiveSheet()->setTitle('Test Sheet');
$objPHPExcel->setActiveSheetIndex(0);
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
$objWriter->save('test123.xls'); //created in the root directory of application
```
However, when the Kohana framework when I try to with this code:
```
$objReader = PHPExcel_IOFactory::createReader('test123.xls');
```
I get this :

| Why does PHPExcel try to create a class name out of the Excel file name when used inside Kohana? | CC BY-SA 2.5 | null | 2010-12-29T11:48:20.320 | 2015-09-04T04:02:28.047 | 2015-09-04T04:02:28.047 | 1,505,120 | 4,639 | [
"php",
"kohana",
"phpexcel"
]
|
4,553,916 | 1 | 4,554,506 | null | 0 | 3,059 | I'm trying to upload a PNG file through Winsock2 HTTP Post. Here's my request string:
```
boundary = "-----rueldotme";
request += "POST " + uri + " HTTP/1.1\r\n";
request += "Host: " + hostname + "\r\n";
request += "User-Agent: " + UserAgent + "\r\n";
request += "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\r\n";
request += "Accept-Language: en-us,en;q=0.5\r\n";
request += "Accept-Encoding: gzip,deflate\r\n";
request += "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\r\n";
request += "Keep-Alive: 115\r\n";
request += "Connection: keep-alive\r\n";
request += "Content-Length: " + fileSize + "\r\n";
request += "Content-Type: multipart/form-data, boundary=" + boundary + "\r\n";
request += "\r\n";
request += "--" + boundary + "\r\n";
request += "Content-Disposition: form-data; name=\"filename\"; filename=\"" + fileName + "\"\r\n";
request += "Content-Type: image/png; charset=binary\r\n";
request += "Content-Transfer-Encoding: binary\r\n";
request += "\r\n";
request += "%s\r\n";
request += "\r\n";
```
The connection is OK, no errors and such, the `fileCon` by the way is from `ReadFile()`. And there's no error code. The number of bytes read is the same as the output of `GetFileSize()`. I tried displaying the contents of `fileCon` but only gave me this:

Don't mind the title "" (I set it).
Also, the request takes ages to complete, and gives me a blank response. Yep, blank with no HTTP headers. Am I doing the request right? Should I really have to include the file contents at the POST data?
Thanks in advance.
: The PNG size is about 256KB. I'm in a 1mbps connection.
: Sorry if the information was insufficient. Anyway, here's what I did lately:
```
int flz;
char bdata[BSIZE];
DWORD dwe, bytesRead = 0;
HANDLE fh = CreateFile(fileName.c_str(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
LPVOID fbuff = NULL;
flz = GetFileSize(fh, NULL);
fbuff = malloc(flz);
ReadFile(fh, fbuff, flz, &bytesRead, NULL));
...
sprintf_s(bdata, BSIZE, request.c_str(), reinterpret_cast<char *>(fbuff)); //BSIZE = 1024
...
send(sock, bdata, std::strlen(bdata), 0);
```
| Uploading PNG File (HTTP POST) with C++ Winsock API | CC BY-SA 2.5 | 0 | 2010-12-29T12:04:32.763 | 2010-12-29T14:14:51.030 | 2010-12-29T13:44:25.487 | 459,338 | 459,338 | [
"c++",
"file-upload",
"http-post",
"winsock2"
]
|
4,553,947 | 1 | 5,036,706 | null | 0 | 1,294 | if i got two decision trees on the same amount of nodes, which is considered better?
tree 1:
(F is false an T is True)

meaning the first one is wider but the second one deeper.
| decision tree on information gain | CC BY-SA 2.5 | null | 2010-12-29T12:09:53.420 | 2011-06-28T08:03:41.970 | null | null | 369,507 | [
"tree",
"decision-tree"
]
|
4,554,072 | 1 | 4,554,122 | null | 2 | 1,769 | I am having a problem with resizing my gui's made from Qt.
In full screen basically they don't scale to the available space.
.



What am i doing wrong?
Thanks.
| Qt application not resizing properly | CC BY-SA 2.5 | 0 | 2010-12-29T12:28:00.020 | 2010-12-29T12:35:09.283 | 2010-12-29T12:30:40.100 | 35,060 | 200,399 | [
"qt4",
"qt-creator"
]
|
4,554,104 | 1 | null | null | 1 | 1,306 | 
i want to create exact screen like above... should display horizontal scroll options below the product(mobile) image.
and the screen should have swipe feature when swipe to left it shows next product(mobile)
how to design this? which controller to use
can i use tab view for horizontal menu??
please give some examples and ideas.....
| horizontal scroll menu in iphone? | CC BY-SA 2.5 | null | 2010-12-29T12:33:00.890 | 2011-03-02T18:01:59.510 | null | null | 505,854 | [
"iphone",
"menu",
"scroll",
"swipe"
]
|
4,554,156 | 1 | null | null | 12 | 15,221 | I am trying to upgrade an ASP.NET application to .NET 4, but one page on my site contains an exception:
> Argument Exception: an entry with the same key already exists".
What is different about ASP.NET 4 that might cause this problem?

Not sure why but setting `clientIDMode="Predictable"` rather than `Static` seems to have avoided this exception message.
| "An entry with the same key already exists" appears when compiled under .NET 4 | CC BY-SA 3.0 | 0 | 2010-12-29T12:39:34.743 | 2018-01-18T09:03:03.293 | 2013-07-15T19:02:23.193 | 23,199 | 457,148 | [
"asp.net",
".net-4.0",
"asp.net-4.0"
]
|
4,554,831 | 1 | 5,893,961 | null | 4 | 3,268 | I'm in a bit of a situation with my HTML dropdowns, when they are displayed in an iPhone or Android browser. I often need to render labels that are quite long, such as for instance
> [AccountType] [EUR] - [Customer] - CH12 3456 7890 1234 5678 9
On Android, this will render something like that:
> 
On the iPhone it's even worse. While I like the native look and feel, the cropping of the labels is a no-go. Circled in red, you'll find how the dropdown itself is rendered. I could live with that. But check out the blue popup that appears, when I click on it. The user will never find his data...
## PLEASE, before you answer...
... consider these points:
- - - [here](https://stackoverflow.com/questions/4554831/html-select-element-is-abbreviated-too-much-in-iphone-or-android-browsers#4554858)- [jQuery UI Selectmenu prototype](http://www.filamentgroup.com/lab/jquery_ui_selectmenu_an_aria_accessible_plugin_for_styling_a_html_select/)- -
| HTML <select> element is abbreviated in iPhone or Android browsers | CC BY-SA 2.5 | 0 | 2010-12-29T14:13:35.387 | 2017-04-20T08:36:47.547 | 2017-05-23T12:02:14.477 | -1 | 521,799 | [
"iphone",
"jquery",
"android",
"html",
"jquery-ui"
]
|
4,555,083 | 1 | 4,556,028 | null | 1 | 580 | I'm having a problem with my TextBoxs not "Auto" resizing. I'm trying to create a form that behaves and looks like the Properties Editor in Visual Studio. What appears to be happening is that the third column is not expanding to fill all of the available remaining space in the grid. Image below is how my form looks on startup.
The width of the textboxs is determined by the MinWidth setting on the third ColumnDefinition statement. Also, the Width is set to "*". With any other setting, the resizing done with the GridSplitter doesn't work correctly.

```
<StackPanel Orientation="Vertical" VerticalAlignment="Top" x:Name="Stacker" Grid.IsSharedSizeScope="True">
<Expander x:Name="Expand" IsExpanded="True" Header="This is a test of a Second Panel" Width="{Binding Width, ElementName=Stacker}">
<Grid x:Name="EditGrid1" Margin="3" >
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" MinWidth="50" SharedSizeGroup="SharedSize1" />
<ColumnDefinition Width="Auto" SharedSizeGroup="SharedSize2" />
<ColumnDefinition Width="*" MinWidth="50" x:Name="ValueCol" />
</Grid.ColumnDefinitions>
<GridSplitter Grid.Column="1" x:Name="ToolBoxSplitter1" Grid.Row="1" Grid.RowSpan="6" Panel.ZIndex="1" HorizontalAlignment="Stretch" ResizeBehavior="PreviousAndNext" Width="3"/>
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="1" Text="{x:Static lex:DoSomeThingView.Name}" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="2" Text="{x:Static lex:DoSomeThingView.Address}" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="3" Text="{x:Static lex:DoSomeThingView.Zip}" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="4" Text="{x:Static lex:DoSomeThingView.NumberOfDoors}" TextTrimming="CharacterEllipsis" Grid.IsSharedSizeScope="True" />
<TextBlock MaxHeight="40" Grid.Column="0" Grid.Row="5" Text="{x:Static lex:DoSomeThingView.DoubleNumber}" />
<TextBox Grid.Column="2" Grid.Row="1" x:Name="UserName1" MaxHeight="50" TextWrapping="Wrap"
VerticalScrollBarVisibility="Auto" SpellCheck.IsEnabled="True" />
<TextBox Grid.Column="2" Grid.Row="2" x:Name="Address1" />
<TextBox Grid.Column="2" Grid.Row="3" x:Name="Zip1" />
<TextBox Grid.Column="2" Grid.Row="4" x:Name="NumberOfDoors1" />
<TextBox Grid.Column="2" Grid.Row="5" x:Name="DoubleNumber1" />
</Grid>
</Expander>
</StackPanel>
```
Any suggestions on how to correct this?
| Last Grid Column Not Auto Resizing With Grid | CC BY-SA 2.5 | null | 2010-12-29T14:47:44.917 | 2010-12-29T16:56:34.123 | null | null | 136,717 | [
"wpf"
]
|
4,555,385 | 1 | 4,555,536 | null | 3 | 351 | Requirement:
Need to display an error message when the user types a forlder name that doesn't exist as shown below:

Problem: I am able to display the UI but not able to call a method in the view model when the user clicks on the button "CreateNew"
View Model Code:
```
public string this[string columnName]
{
get { return "The entered folder name doesn't exist."; }
}
RelayCommand createNewFolder;
public RelayCommand CreateNewFolder
{
get
{
if (createNewFolder == null)
createNewFolder = new RelayCommand(param => this.OnCreateNewFolder());
return createNewFolder;
}
}
public void OnCreateNewFolder()
{
MessageBox.Show("CreateNewFolder");
}
```
RelayCommand.cs can be downloaded at: [http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=mag200902MVVM&DownloadId=4357](http://code.msdn.microsoft.com/Project/Download/FileDownload.aspx?ProjectName=mag200902MVVM&DownloadId=4357)
Xaml Code:
```
<Window.Resources>
<ControlTemplate x:Key="validationTemplate">
<DockPanel LastChildFill="True">
<Border Margin="5,5,0,0" DockPanel.Dock="Bottom" Background="Red">
<StackPanel>
<TextBlock Name="ErrorText" Foreground="White" Background="Red"
FontSize="12" Padding="2" FontFamily="Trebuchet MS"
TextWrapping="Wrap"
Text="{Binding [0].ErrorContent}" ></TextBlock>
<StackPanel Margin="0" Orientation="Horizontal">
<Button Content="Create New" Command="{Binding Path=CreateNewFolder}" Margin="10" Padding="5"></Button>
<Button Content="Cancel" Margin="10" Padding="5" ></Button>
</StackPanel>
</StackPanel>
</Border>
<AdornedElementPlaceholder Name="ErrorTextBox" />
</DockPanel>
</ControlTemplate>
<Style x:Key="ValidationStyle" TargetType="{x:Type ComboBox}">
<Style.Triggers>
<Trigger Property="Validation.HasError" Value="True">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="BitmapEffect">
<Setter.Value>
<BitmapEffectGroup>
<OuterGlowBitmapEffect GlowColor="Red" GlowSize="3" Noise="0.6"></OuterGlowBitmapEffect>
</BitmapEffectGroup>
</Setter.Value>
</Setter>
<Setter Property="DataContext"
Value="{Binding RelativeSource={x:Static RelativeSource.Self},Path=DataContext}">
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<AdornerDecorator >
<ComboBox IsEditable="True" FontSize="11" Margin="10" Width="250"
VerticalAlignment="Center"
Text="{Binding Path=StrText, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"
Validation.ErrorTemplate="{StaticResource validationTemplate}"
Style="{StaticResource ValidationStyle}"></ComboBox>
</AdornerDecorator>
</Grid>
```
Please note that i set the DataContext property in the style:
```
<Setter Property="DataContext" Value="{Binding RelativeSource={x:Static
RelativeSource.Self},Path=DataContext}">
</Setter>
```
Please let me know how to bind the method to a button in the validation template.
| Can we have buttons in a validation template, and how can we bind it to the ViewModel method? | CC BY-SA 3.0 | 0 | 2010-12-29T15:31:45.490 | 2012-09-13T16:14:17.550 | 2012-09-13T16:14:17.550 | 133 | 473,376 | [
"wpf",
"binding",
"command",
"idataerrorinfo"
]
|
4,555,578 | 1 | 4,555,605 | null | 1 | 1,301 | I am creating an an application for iPhone (based on the template for "utility application").
Using interface builder, I have created a settings view as shown below. The gray background is an UIView with gray background color. But when I run the app, the background becomes black!
Can someone explain why?

| iOS: Why is the background black? | CC BY-SA 2.5 | null | 2010-12-29T15:53:06.680 | 2010-12-29T15:57:11.573 | 2020-06-20T09:12:55.060 | -1 | 165,729 | [
"iphone",
"ios",
"interface-builder"
]
|
4,555,561 | 1 | 4,555,618 | null | 3 | 3,395 | First off, I can see that my mvc3 project already had jquery ui in it but no theme css files.
I needed a date picked and as usual needed to override the EditorFor DateTime. I started off today by just using the default jquery ui js files supplied with the project under scripts. The date picker shows up fine, only with a completed messed up UI based on Site.css.
So now I downloaded a build of jquery (with the theme) and followed [this page](http://www.asp.net/ajaxLibrary/jquery_ui_mvc_intro.ashx) about how to put it together.
I'm using T4MVC so my page looks like this:
:
```
<script src="@Links.Scripts.jquery_1_4_4_js" type="text/javascript"></script>
<link href="@Links.Content.Site_css" rel="stylesheet" type="text/css" />
<script src="@Links.Content.start.jquery_ui_1_8_7_custom_css" type="text/javascript"></script>
```
```
<script src="@Links.Scripts.jquery_validate_min_js" type="text/javascript"></script>
<script src="@Links.Scripts.jquery_validate_unobtrusive_min_js" type="text/javascript"></script>
<script src="@Links.Scripts.jquery_ui_1_8_7_custom_min_js" type="text/javascript"></script>
```
And this is the result:

Any ideas, I tried a couple combinations of where I put the script and css files tags in different places, but nothing seems to work.
---
: So I was a dumbhead to have a `<script>` instead of a `<link>` tag in the layout! But there is still a problem, the date picker shows with the css from .

---
So I checked chrome and under resources I can't see the jquery css file. I fire fiddler and I don't see any request for the css file.
The I see it!
`<link href="@Links.Content.start.jquery_ui_1_8_7_custom_css" **rel="Stylesheet"** type="text/css" />`
Yes! Thats right, I didn't add a rel!
| jquery ui css not loading and creating problems with asp.net mvc3 page (unexpected token error) | CC BY-SA 3.0 | null | 2010-12-29T15:50:44.000 | 2017-09-12T02:49:39.810 | 2017-09-12T02:49:39.810 | 1,033,581 | 368,070 | [
"asp.net-mvc",
"jquery-ui",
"asp.net-mvc-3",
"jquery-ui-theme"
]
|
4,555,715 | 1 | 4,653,516 | null | 0 | 355 | I am using the latest GWT Designer version 8.1.1.r36x201012191024 in SpringSource Tool Suite. From the official [user guide](http://code.google.com/webtoolkit/tools/gwtdesigner/index.html), it should have feature like Factories, Morphing etc. .
---
However, I can't find such features. What I am getting is just like the below..
---
Am I missing some step to enable advance features? I found out the user guide is exactly same as [WindowBuilder Pro](http://code.google.com/javadevtools/wbpro/index.html). Are these features only for WindowBuilder Pro, which is for desktop Java application? Thanks.
| Missing GWT Designer Features | CC BY-SA 2.5 | null | 2010-12-29T16:10:26.800 | 2011-01-12T07:34:12.200 | 2011-01-03T08:22:10.513 | 255,844 | 418,439 | [
"user-interface",
"gwt",
"ide",
"gwt-designer"
]
|
4,556,041 | 1 | null | null | 2 | 494 | When I step through code in Chrome's JavaScript debugger, I regularly run into a situation where a variable tooltip gets stuck and stays on screen, obscuring code that's behind it. Clicking off the tooltip or on other scope variables doesn't help, and the only way to fix this is usually to close and reopen the Inspector pane, which ends the debugging session.
Is there any better way to hide the tooltip when it decides to stick around?

| Hiding scope variable tooltip in Chrome's script debugger | CC BY-SA 2.5 | null | 2010-12-29T16:58:03.733 | 2011-10-14T13:45:41.877 | null | null | 100,335 | [
"javascript",
"debugging",
"google-chrome"
]
|
4,556,224 | 1 | 4,556,269 | null | 3 | 128 | I want to achiece the following scenario,

My idea is to have three different tableview. But i have stuck up with the scrolling problem that if i scroll tableview3 vertically, tableview1 & tableview2 should also scroll.
Is there any other idea for implementing this? Or else a solution for my scrolling problem?
The number of columns are dynamic.
| UIDesign Advice | CC BY-SA 2.5 | 0 | 2010-12-29T17:21:47.627 | 2010-12-30T12:30:01.057 | 2010-12-29T17:32:22.247 | 433,794 | 433,794 | [
"user-interface",
"ipad",
"uitableview",
"scroll"
]
|
4,556,602 | 1 | null | null | 13 | 3,357 | I'm using the GoogleMaps API v3.0 and trying to save a DirectionsResult to my database and then retrieve it later to use on a map. My problem is that when I try to re-hydrate the saved object by pulling its JSON representation from my database, the object is just dumb JSON, it doesn't have the original methods and functions of its constituent objects. So, I built a fix routine that takes the dumbalt text JSON and rebuilds it by reconstructing all the LatLng and LatLngBound objects. But, something is still missing because my fixed object doesn't work like the original, the two points show up on my map but the purple line between them is missing.
Would appreciate any advice on either a better technique for serialization/hydration or any ideas as to what my fix routine might be missing.
Thanks


```
request = {
origin: homeLocation,
destination: jobLocation,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
var str = Ext.encode(response); //<<==SAVING RAW JSON OBJECT TO DB (I USE ExtJs)
var z = eval('(' + str + ')'); //<<==REHYDRATING DirectionsResult RAW JSON OBJECT
FixDirectionResult(z); //<<==ATTEMPT TO RE-ESTABLISH ORIGINAL OBJECTS
directionsRenderer.setDirections(z); //<<==THIS WORKS WITH response BUT NOT WITH z
}
);
function FixDirectionResult(rslt) {
for(r=0; r<rslt.routes.length; r++) {
var route = rslt.routes[r];
var bounds = route.bounds;
route.bounds = new google.maps.LatLngBounds(
new google.maps.LatLng(bounds.U.b,bounds.O.d),
new google.maps.LatLng(bounds.U.d,bounds.O.b));
for(l=0; l<route.legs.length;l++) {
var leg = route.legs[l];
leg.start_location = new google.maps.LatLng(leg.start_location.wa,leg.start_location.ya);
leg.end_location = new google.maps.LatLng(leg.end_location.wa,leg.end_location.ya);
for(s=0; s<leg.steps.length;s++) {
var step = leg.steps[s];
step.start_location =
new google.maps.LatLng(step.start_location.wa,step.start_location.ya);
step.end_location =
new google.maps.LatLng(step.end_location.wa,step.end_location.ya);
for(p=0;p<step.path.length;p++) {
var path=step.path[p];
step.path[p] = new google.maps.LatLng(step.path.wa,step.path.ya);
}
}
}
for(o=0; o<route.overview_path.length;o++) {
var overview = route.overview_path[o];
route.overview_path[o] = new google.maps.LatLng(overview.wa,overview.ya);
}
}
}
```
| Can't Deserialize GoogleMaps DirectionsResult Object | CC BY-SA 2.5 | 0 | 2010-12-29T18:11:44.767 | 2021-02-14T13:04:33.953 | 2011-04-22T16:47:46.150 | 476,945 | 462,477 | [
"javascript",
"json",
"google-maps",
"serialization"
]
|
4,557,091 | 1 | 4,557,256 | null | 0 | 474 | I have to make an application that looks like UI same to same how can i make i have to do it in c#.

| WPF or win forms? | CC BY-SA 2.5 | 0 | 2010-12-29T19:17:33.183 | 2010-12-29T19:42:27.667 | null | null | 430,167 | [
"wpf",
"winforms"
]
|
4,557,533 | 1 | null | null | 4 | 5,086 | The background color of the selected item in an uneditable JComboBox is a sort of blue:

I know that you can change it to a different color, such as white, for example with the [following code](https://stackoverflow.com/questions/4412902/background-color-of-the-selected-item-in-an-uneditable-jcombobox/4413027#4413027):
```
jComboBox1.setRenderer(new DefaultListCellRenderer() {
@Override
public void paint(Graphics g) {
setBackground(Color.WHITE);
setForeground(Color.BLACK);
super.paint(g);
}
});
```
That gives you something like this:

However, if you double-click on that combo-box, some of it turns gray (the part with the triangle and the border):

Is there a way to stop these parts from turning gray when you double-click on it?
Note that, if you call super.paint() first, the whole thing turns dark (including the part behind "Select..."), so that doesn't help.
| Color of the dropdown control and border in an uneditable JComboBox | CC BY-SA 2.5 | null | 2010-12-29T20:21:25.860 | 2018-09-27T00:40:14.230 | 2017-05-23T12:13:26.330 | -1 | 7,648 | [
"java",
"swing",
"jcombobox"
]
|
4,557,899 | 1 | 4,575,174 | null | 7 | 1,430 | I am doing some really basic experiments around some 2D work in GL. I'm trying to draw a "picture frame" around an rectangular area. I'd like for the frame to have a consistent gradient all the way around, and so I'm constructing it with geometry that looks like four quads, one on each side of the frame, tapered in to make trapezoids that effectively have miter joins.
The vert coords are the same on the "inner" and "outer" rectangles, and the colors are the same for all inner and all outer as well, so I'd expect to see perfect blending at the edges.
But notice in the image below how there appears to be a "seam" in the corner of the join that's lighter than it should be.
I feel like I'm missing something conceptually in the math that explains this. Is this artifact somehow a result of the gradient slope? If I change all the colors to opaque blue (say), I get a perfect solid blue frame as expected.
Code added below. Sorry kinda verbose. Using 2-triangle fans for the trapezoids instead of quads.
Thanks!

```
glClearColor(1.0, 1.0, 1.0, 1.0);
glClear(GL_COLOR_BUFFER_BIT);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
// Prep the color array. This is the same for all trapezoids.
// 4 verts * 4 components/color = 16 values.
GLfloat colors[16];
colors[0] = 0.0;
colors[1] = 0.0;
colors[2] = 1.0;
colors[3] = 1.0;
colors[4] = 0.0;
colors[5] = 0.0;
colors[6] = 1.0;
colors[7] = 1.0;
colors[8] = 1.0;
colors[9] = 1.0;
colors[10] = 1.0;
colors[11] = 1.0;
colors[12] = 1.0;
colors[13] = 1.0;
colors[14] = 1.0;
colors[15] = 1.0;
// Draw the trapezoidal frame areas. Each one is two triangle fans.
// Fan of 2 triangles = 4 verts = 8 values
GLfloat vertices[8];
float insetOffset = 100;
float frameMaxDimension = 1000;
// Bottom
vertices[0] = 0;
vertices[1] = 0;
vertices[2] = frameMaxDimension;
vertices[3] = 0;
vertices[4] = frameMaxDimension - insetOffset;
vertices[5] = 0 + insetOffset;
vertices[6] = 0 + insetOffset;
vertices[7] = 0 + insetOffset;
glVertexPointer(2, GL_FLOAT , 0, vertices);
glColorPointer(4, GL_FLOAT, 0, colors);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
// Left
vertices[0] = 0;
vertices[1] = frameMaxDimension;
vertices[2] = 0;
vertices[3] = 0;
vertices[4] = 0 + insetOffset;
vertices[5] = 0 + insetOffset;
vertices[6] = 0 + insetOffset;
vertices[7] = frameMaxDimension - inset;
glVertexPointer(2, GL_FLOAT , 0, vertices);
glColorPointer(4, GL_FLOAT, 0, colors);
glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
/* top & right would be as expected... */
glDisableClientState(GL_COLOR_ARRAY);
glDisableClientState(GL_VERTEX_ARRAY);
```
| Gradient "miter" in OpenGL shows seams at the join | CC BY-SA 2.5 | 0 | 2010-12-29T21:12:16.543 | 2011-01-03T14:47:22.217 | 2010-12-30T02:31:05.190 | 73,297 | 73,297 | [
"opengl",
"gradient"
]
|
4,557,943 | 1 | 4,558,454 | null | 11 | 86,326 | I would like to access the company server's Active Directory so I can write a simple phonebook program. It would seem that I need to use LDAP to connect to it in order to grab a recordset. Is there anyway to figure out what the LDAP URL is based on settings and properties in Outlook (or otherwise)?
Thanks

| Finding An LDAP URL? | CC BY-SA 2.5 | 0 | 2010-12-29T21:18:07.270 | 2015-01-06T16:30:03.317 | 2015-01-06T16:30:03.317 | 545,127 | 47,868 | [
"vba",
"url",
"active-directory",
"outlook",
"ldap"
]
|
4,558,032 | 1 | 4,558,094 | null | 2 | 98 | I'm having a problem with an image viewer I'm creating. Like the image below, the 'window' is where the image is shown and 'paging' is where the user can change the image. I've used this Jquery script to make the 'paging' fade in whenever the window is hovered over - It's hidden to start with. Although when the user hovers onto 'paging', it flickers. (Like shows then hides, etc.)
I suppose it's because the mouse isn't hovering over the 'window' anymore. Can anyone suggest how I can make 'paging' remain showing? Thanks for the help! :)
```
$(".window").hover(function() {
$(".paging").fadeIn('fast');
}, function() {
$(".paging").fadeOut('fast');
});
```

| Help needed with showing and hiding a div | CC BY-SA 2.5 | null | 2010-12-29T21:31:30.137 | 2010-12-29T21:56:43.230 | null | null | 303,221 | [
"javascript",
"jquery",
"hover",
"fadein",
"fadeout"
]
|
4,558,066 | 1 | 4,558,588 | null | 0 | 343 | Is there a way to use the same tree graph component as Apple uses for iAd producer? An equivalent would be fine, but if it's already in the cocoa framework, can somebody point to the specific component?

| Graph view like iAd producer | CC BY-SA 2.5 | null | 2010-12-29T21:35:51.017 | 2010-12-29T23:38:16.817 | 2010-12-29T23:25:37.043 | 138,352 | 138,352 | [
"cocoa",
"graph",
"iad"
]
|
4,558,179 | 1 | 4,765,871 | null | 1 | 1,604 | I've implemented `- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row` in my NSTableView's delegate to resize the height of my table's rows as the width of the leftmost column changes. The problem is that only that column redraws during the resizing (and any column that slide into view during the resize).
This results in the funky visual below after resizing. What I'd like is a way to tell the table view to completely redraw while the user is resizing a column. Right now the most I've been able to do is call `setNeedsDisplay` after that column finishes resizing.

| Force redraw as resizing NSTableColumn in NSTableView? | CC BY-SA 2.5 | null | 2010-12-29T21:50:42.670 | 2011-01-22T02:52:52.940 | 2011-01-01T17:07:53.500 | 105,717 | 105,717 | [
"objective-c",
"cocoa",
"macos",
"nstableview"
]
|
4,558,271 | 1 | 4,573,700 | null | 2 | 2,832 | celery works wonderfully! :) e.g. results are returned with no problems!
---
This is what my panel looks like, celeryev looks the same.

---
I'm usingthe following commands:
> python manage.py celeryd -l info -Epython manage.py celerycam
My BROKER is
My DATABASE is
Django, Celery and RabbitMQ are running on a clean Ubuntu 10 install.
---
Any ideas folks? Would be amazing if someone could help me on this one :|
| CeleryCAM not working... - Django/Celery | CC BY-SA 2.5 | 0 | 2010-12-29T22:04:34.553 | 2011-01-01T09:46:18.913 | 2020-06-20T09:12:55.060 | -1 | 208,827 | [
"python",
"django",
"ubuntu",
"celery"
]
|
4,558,478 | 1 | 4,558,559 | null | 0 | 131 | I am very new to this, and I more looking for what information I need to study to be able to accomplish this.
What I want to do is use my GUI I have built for my app, but pull the information from a website.
If I have a website that looks like this:

(full website can be seen at [http://www.atmequipment.com/Error-Codes](http://www.atmequipment.com/Error-Codes))
What would I need from the website so that if a user entered an error code here:

It would use the search from the website, and populate the error description in my app?
I know this is a huge question, I'm just looking for what is actually needed to accomplish this, and then I can start researching from there. -- Or is it even possible?
| Using Website Information Without WebView | CC BY-SA 3.0 | null | 2010-12-29T22:37:14.727 | 2015-12-12T15:47:22.373 | 2017-02-08T14:31:18.200 | -1 | 557,431 | [
"android",
"url",
"web"
]
|
4,558,528 | 1 | 4,558,541 | null | 0 | 272 | I've just used Instagram application. I like the effect when I click on comment.
When you click "comment" you'll see a fade in view for insert the comment text.
How can I implement something like this?
Here two screenshot's:



| iPhone effect comment box | CC BY-SA 2.5 | 0 | 2010-12-29T22:44:30.370 | 2010-12-29T23:44:30.807 | 2010-12-29T23:44:30.807 | 545,004 | 545,004 | [
"iphone",
"fadein",
"comments"
]
|
4,558,749 | 1 | null | null | 1 | 832 | I posted that [question](https://stackoverflow.com/questions/4526336/how-erase-part-of-uiimage) and I have not yet found a solution.
I was wondering if there is a way to use an `UIImage` to delete a part of an other `UIImage`

I would use an `UIImage` to 'mask' this ugly black background to let a transparency color.
Maybe with `CGContextAddPath` but I don't know how to use it...
Regards,
KL94
| How erase part of UIImage with an other UIImage | CC BY-SA 2.5 | 0 | 2010-12-29T23:23:13.567 | 2012-03-21T05:51:20.877 | 2017-05-23T12:30:36.930 | -1 | 553,488 | [
"iphone",
"objective-c",
"uiimage",
"core-graphics",
"erase"
]
|
4,558,839 | 1 | null | null | 0 | 1,021 | I want to make some changes in the following piece of code.
The above example shows calculated number of votes (vote ups - votes down). And when you click on any thumbe, it disappears the thumbs and shows the updated votes. I want to make changes that in begining it shows vote up and vote down separately (which are stored in database separately). and after thumb up or down is pressed, it should not remove the thumbs, but it should show the updated vote up and down separatetly. As shown in the image below.

Here are pieces of code:
Main page having html/CSS and jquery code.
[http://pastebin.com/RC6dj6N5](http://pastebin.com/RC6dj6N5)
vote processng code:
[http://pastebin.com/heszKyDc](http://pastebin.com/heszKyDc)
PS. I have tried to change by myself but I could not do. Any help will be much appriciated. Thanks.
| jquery vote up down, request for some help | CC BY-SA 2.5 | null | 2010-12-29T23:38:44.960 | 2010-12-30T03:11:18.000 | 2010-12-30T00:03:59.677 | 523,364 | 523,364 | [
"javascript",
"jquery",
"voting"
]
|
4,558,896 | 1 | 4,558,969 | null | 2 | 783 | Ok, so once upon a time, my code worked. Since then I did some refactoring (basic stuff so I thought) but now I'm getting a null reference exception, and I can't bloody well figure out why.
Here's where it starts.
```
Function LogOut(ByVal go As String) As ActionResult
ActivityLogService.AddActivity(AuthenticationHelper.RetrieveAuthUser.ID, _
IActivityLogService.LogType.UserLogout, _
HttpContext.Request.UserHostAddress)
ActivityLogService.SubmitChanges()
'more stuff happens after this'
End Function
```
The service is pretty straight forward ()
```
Public Sub AddActivity(ByVal userid As Integer, ByVal activity As Integer, ByVal ip As String) Implements IActivityLogService.AddActivity
Dim _activity As ActivityLog = New ActivityLog With {.Activity = activity,
.UserID = userid,
.UserIP = ip.IPAddressToNumber,
.ActivityDate = DateTime.UtcNow}
ActivityLogRepository.Create(_activity) ''#ERROR THROWN HERE
End Sub
```
And the Interface that the Service uses looks like this
```
Public Interface IActivityLogService
Sub AddActivity(ByVal userid As Integer, ByVal activity As Integer, ByVal ip As String)
Function GetUsersLastActivity(ByVal UserID As Integer) As ActivityLog
Sub SubmitChanges()
''' <summary> '
''' The type of activity done by the user '
''' </summary>
''' <remarks>Each int refers to an activity. There can be no duplicates or modifications after this application goes live</remarks> '
Enum LogType As Integer
''' <summary> '
''' A new session started '
''' </summary> '
SessionStarted = 1
''' <summary> '
''' A new user is Added/Created '
''' </summary> '
UserAdded = 2
''' <summary> '
''' User has updated their profile '
''' </summary> '
UserUpdated = 3
''' <summary> '
''' User has logged into they system '
''' </summary> '
UserLogin = 4
''' <summary> '
''' User has logged out of the system '
''' </summary> '
UserLogout = 5
''' <summary> '
''' A new event has been added '
''' </summary> '
EventAdded = 6
''' <summary> '
''' An event has been updated '
''' </summary> '
EventUpdated = 7
''' <summary> '
''' An event has been deleted '
''' </summary> '
EventDeleted = 8
''' <summary> '
''' An event has received a Up/Down vote '
''' </summary> '
EventVoted = 9
''' <summary> '
''' An event has been closed '
''' </summary> '
EventCloseVoted = 10
''' <summary> '
''' A comment has been added to an event '
''' </summary> '
CommentAdded = 11
''' <summary> '
''' A comment has been updated '
''' </summary> '
CommentUpdated = 12
''' <summary> '
''' A comment has been deleted '
''' </summary> '
CommentDeleted = 13
''' <summary> '
''' An event or comment has been reported as spam '
''' </summary> '
SpamReported = 14
End Enum
End Interface
```
And the repository is equally straight forward
```
Public Class ActivityLogRepository : Implements IActivityLogRepository
Private dc As MyAppDataContext
Public Sub New()
dc = New MyAppDataContext
End Sub
''' <summary> '
''' Adds the activity. '
''' </summary> '
''' <param name="activity">The activity.</param>
Public Sub Create(ByVal activity As ActivityLog) Implements IActivityLogRepository.Create
dc.ActivityLogs.InsertOnSubmit(activity)
End Sub
''' <summary> '
''' Gets the activities. '
''' </summary> '
''' <returns>results AsQueryable</returns>
Public Function Read() As IQueryable(Of ActivityLog) Implements IActivityLogRepository.Read
Dim activity = (From a In dc.ActivityLogs
Order By a.ActivityDate Descending
Select a)
Return activity.AsQueryable
End Function
''' <summary> '
''' Submits the changes. '
''' </summary> '
Public Sub SubmitChanges() Implements IActivityLogRepository.SubmitChanges
dc.SubmitChanges()
End Sub
End Class
```
The stack trace is as follows
> [NullReferenceException: Object reference not set to an instance of an object.]
MyApp.Core.Domain.ActivityLogService.AddActivity(Int32 userid, Int32 activity, String ip) in E:\Projects\MyApp\MyApp.Core\Domain\Services\ActivityLogService.vb:49
MyApp.Core.Controllers.UsersController.Authenticate(String go) in E:\Projects\MyApp\MyApp.Core\Controllers\UsersController.vb:258
lambda_method(Closure , ControllerBase , Object[] ) +163
System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters) +51
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +409 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +52
System.Web.Mvc.<>c__DisplayClass15.b__12() +127
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +436 System.Web.Mvc.<>c__DisplayClass17.<InvokeActionMethodWithFilters>b__14() +61 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList`1 filters, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +305 System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +830 System.Web.Mvc.Controller.ExecuteCore() +136 System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +232 System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +39 System.Web.Mvc.<>c__DisplayClassb.<BeginProcessRequest>b__5() +68 System.Web.Mvc.Async.<>c__DisplayClass1.<MakeVoidDelegate>b__0() +44 System.Web.Mvc.Async.<>c__DisplayClass8`1.b__7(IAsyncResult _) +42
System.Web.Mvc.Async.WrappedAsyncResult`1.End() +141
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +54
System.Web.Mvc.Async.AsyncResultWrapper.End(IAsyncResult asyncResult, Object tag) +40
System.Web.Mvc.<>c__DisplayClasse.b__d() +61
System.Web.Mvc.SecurityUtil.b__0(Action f) +31
System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +56
System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +110
System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result) +38
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +690
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +194
here's an image of the error when attached to the debugger.

And here's an image of the DB schema in question

Can anyone shed some light on what I might be missing here?
| NullReferenceException makes me want to shoot myself | CC BY-SA 2.5 | 0 | 2010-12-29T23:47:32.190 | 2010-12-30T09:52:26.563 | 2010-12-30T09:52:26.563 | 41,956 | 124,069 | [
"asp.net",
"asp.net-mvc",
"vb.net",
"nullreferenceexception"
]
|
4,558,957 | 1 | 4,559,130 | null | 3 | 3,888 | I have the following partial view code
```
@model IEnumerable<PDoc.Web.Models.UserDocModel>
@using MvcContrib.UI.Grid;
@using MvcContrib.UI.Pager;
@using MvcContrib.Pagination;
<div id="docList">
@Html.Grid(Model).Columns( column => {
column.For( u => u.Description ).Named( "Description" );
column.For( u => u.FileName ).Named( "File name" );
column.For( u => u.FileSize ).Named( "Size" );
column.For( u => u.UploadDate.ToShortDateString() ).Named( "Upload Date" );
} ).Attributes( @class => "table-list" ).Empty( "No documents uploaded" )
<div style="position:absolute; bottom: 3px; width: 95%;">
@Html.Pager( (IPagination)Model )..First( "First" ).Next( "Next" ).Previous( "Previous" ).Last( "Last" ).Format( "{0}-{1} di {2}" )
</div>
</div>
```
This renders encoded html for the pagination as in the following snippet copied with Chrome Developer Tool
```
<div id="myDocs">
<div id="docList">
<table class="table-list">...</table>
<div style="position:absolute; bottom: 3px; width: 95%;">
<div class='pagination'><span class='paginationLeft'>1-1 di 1</span></div>
</div>
</div>
```
Why?
Also with Chrome DT I can see two double quote surrounding the encoded markup. Is that only a way to show something tht's encoded?

| Problem with razor view and mvccontrib grid pagination | CC BY-SA 2.5 | 0 | 2010-12-29T23:59:11.223 | 2010-12-30T00:41:35.113 | 2010-12-30T00:24:27.717 | 431,537 | 431,537 | [
"asp.net-mvc",
"asp.net-mvc-3",
"razor",
"mvccontrib",
"mvccontrib-grid"
]
|
4,559,034 | 1 | 4,676,372 | null | 8 | 1,713 | I have noticed lately that the Visual Studio 2010 debugger keeps jumping into this method that is marked with the `[DebuggerStepThrough]` attribute.

The callstack looks something like this:
1. Page.OnLoad calls a method IsSubclassOfGeneric in a class marked as [DebuggerStepThrough].
2. IsSubclassOfGeneric calls GetHierarchy as shown, passing a lambda expression to the System.Linq.Enumerable.Any extension.
3. Visual Studio steps into the method as shown above.
I have just replaced the Linq call with a foreach loop as below, to no avail:

This is a bit of an annoyance, since this method is called pretty frequently, and I do not understand why the attribute is being ignored.
| DebuggerStepThrough being ignored | CC BY-SA 2.5 | null | 2010-12-30T00:19:01.977 | 2011-01-13T03:05:44.423 | null | null | 227,020 | [
"visual-studio-2010",
"debugging"
]
|
4,559,058 | 1 | 4,559,124 | null | 1 | 5,761 | I am making an ajax request to a php page and I cannot for the life of me get it to just return plain text.
```
$.ajax({
type: 'GET',
url: '/shipping/test.php',
cache: false,
dataType: 'text',
data: myData,
success: function(data){
console.log(data)
}
});
```
in test.php I am including [this script](http://www.marksanborn.net/php/calculating-ups-shipping-rate-with-php/) to get UPS rates. I am then calling the function with `$rate = ups($dest_zip,$service,$weight,$length,$width,$height);`
I am doing `echo $rate;` at the bottom of test.php. When viewed in a browser shows the rate, that's great. But when I request the page via ajax I get a bunch of XML. Pastie here: [http://pastie.org/1416142](http://pastie.org/1416142)
My question is, how do I get it so I can just return the plain text string from the ajax call, where the result `data` will be a number?
Edit, here's what I see in Firebug- Response tab:

HTML tab:

| jQuery ajax request to php, how to return plain text only | CC BY-SA 2.5 | null | 2010-12-30T00:24:48.770 | 2010-12-30T00:56:39.723 | null | null | 150,803 | [
"php",
"jquery",
"ajax",
"xmlhttprequest"
]
|
4,559,180 | 1 | 4,559,300 | null | 177 | 82,470 |
Looks like [browsers are starting to support copy natively in JS](https://developers.google.com/web/updates/2015/04/cut-and-copy-commands?hl=en)
---
In the console windows of both Chrome and Firefox on Mac I can execute
```
copy("party in your clipboard!");
```
and the text gets copied to my clipboard. I have searched SO and Google and can't seem to find anything on this.
- -
Browser versions:


JavaScript returned from Chrome console when executing 'copy'
```
function (object)
{
if (injectedScript._type(object) === "node") {
var nodeId = InjectedScriptHost.pushNodePathToFrontend(object, false, false);
InjectedScriptHost.copyNode(nodeId);
} else
InjectedScriptHost.copyText(object);
}
```
-
Here are 2 screenshots of executing copy function in Chrome console with all chrome extensions disabled


| Secret copy to clipboard JavaScript function in Chrome and Firefox? | CC BY-SA 3.0 | 0 | 2010-12-30T00:53:26.983 | 2020-03-20T18:06:22.190 | 2016-08-04T17:05:35.993 | 117,068 | 117,068 | [
"javascript",
"firefox",
"google-chrome",
"copy",
"clipboard"
]
|
4,559,222 | 1 | 4,559,287 | null | 0 | 304 | How could I resize menu entries to have, for example, only one entry on the bottom row. Here is an example:

Notice how the "Add" and "Wallpaper" are both on the top and the others are on the bottom. How could I accomplish the same feat, but having just one menu entry on the bottom and two on the top?
| Resize Options Menu entries | CC BY-SA 2.5 | null | 2010-12-30T01:03:53.453 | 2010-12-30T01:17:32.417 | null | null | 200,477 | [
"java",
"android",
"options-menu"
]
|
4,559,229 | 1 | 4,559,610 | null | 25 | 21,703 | I need to draw a pyramid plot, like the one attached.

I found an example using R (but not ggplot) from [here](http://sas-and-r.blogspot.com/2010/08/example-83-pyramid-plots.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SASandR+%28SAS+and+R%29), can anyone give me some hint on doing this using ggplot? Thanks!
| drawing pyramid plot using R and ggplot2 | CC BY-SA 2.5 | 0 | 2010-12-30T01:05:47.290 | 2020-06-23T20:18:19.197 | 2011-01-27T03:15:32.810 | 108,518 | 373,908 | [
"r",
"ggplot2"
]
|
4,559,392 | 1 | 4,559,401 | null | -1 | 667 | Is there a way to remove function alias in PHP?
I can rename my function but it would be nice to use name `"fetch"`.
Problem:

| Remove function alias in PHP | CC BY-SA 3.0 | null | 2010-12-30T01:44:51.457 | 2012-12-24T17:33:37.970 | 2012-12-24T17:33:37.970 | 367,456 | 424,004 | [
"php",
"mysqli"
]
|
4,559,698 | 1 | 4,559,815 | null | 0 | 774 | I know how I'd do this with NSTextView, but NSTextField doesn't seem to provide a way to access the `NSTextStorage` backing it, so I can't set myself as a delegate and process `-textStorageDidProcessEditing:`.
I have a `NSTextField` as part of a sheet. If that text field is emtpy at any point, the OK button should be disabled until some input is provided. That's basically all I'm looking to do, and I'm sure there's a really simple way to do this?
I tried:
```
[[[filenameInput cell] textStorage] setDelegate:self];
```
Thinking that `NSTextFieldCell` would provide the text storage (mostly since Xcode kindly auto-completed it for me) and then of course, did my validation via the delegate method:
```
-(void)textStorageDidProcessEditing:(NSNotification *)notification {
BOOL allowSubmit = ([[filenameInput stringValue] length] > 0)
&& (([relativePathSwitch state] == NSOnState) || ([[localPathInput stringValue] length] > 0));
[createButton setEnabled:allowSubmit];
}
```
This compiles but causes a runtime error as `NSTextFieldCell` does not respond to `textStorage`.
What's the standard pattern I should be following here? This must be one of those "every day" tasks for Cocoa devs, I imagine :)

| Validate a user interface (NSButton) as user type in NSTextField | CC BY-SA 2.5 | null | 2010-12-30T03:01:15.090 | 2010-12-30T03:32:54.400 | 2010-12-30T03:32:54.400 | 714 | 322,122 | [
"cocoa",
"macos",
"nstextfield"
]
|
4,559,835 | 1 | 4,559,847 | null | 1 | 382 | I am writing a program to read and write a specific binary file format.
I believe I have it 95% working. I am running into a a strange problem.
In the screenshot I am showing a program I wrote that compares two files byte by byte. The very last byte should be 0 but is FFFFFFF.
Using a binary viewer I can see no difference in the files. They appear to be identical.
Also, windows tells me the size of the files is different but the size on disk is the same.
Can someone help me understand what is going on?

The original is on the left and my copy is on the right.
| c# Why is last byte of copied file different? | CC BY-SA 2.5 | null | 2010-12-30T03:40:53.123 | 2010-12-30T04:15:00.710 | null | null | 352,278 | [
"c#",
"file-io"
]
|
4,560,000 | 1 | null | null | 2 | 581 | I am curious know if and how it is possible to combine 2 values of an array together instead of overriding the other. I will show you an example:
I have a form that is mapping fields to a database from a CSV file. The problem I am running into is say for example there are 2 address fields that need to be merged into 1 address field in my database. (IE: photo below)

So my problem comes when I look at the $_POST[] array. It will show that there are 2 HOME ADDRESSES Selected and import into my database with the LAST selected home-address.
How can I merge the information into 1. I hope this gives you enough information on my problem, please let me know if you need something specific.
I am dealing with all arrays, and when I post into my database it requires an Array to loop through, as I use a reflection class. I hope this makes sense...
Any light would be appreciated on this matter.
Cheers,
I appreciate the quite comments back, the problem that I have with your responses is that I can't create my inputs to be address[] as that will be dynamic and I won't know which one will be set to address and which would perhaps be set to 'phone'... I hope this new picture helps a bit in understanding.
Some of the code (Shortened):
```
<select name="Home_Address_1"> // name is dynamically generated from the CSV headings
<option>...</option>
</select>
<select name="Home_Address_2"> // name is dynamically generated from the CSV headings
<option>...</option>
</select>
```
| PHP Array combining 2 or more values together | CC BY-SA 2.5 | null | 2010-12-30T04:25:37.813 | 2011-01-03T21:53:12.177 | 2011-01-03T21:53:12.177 | 679,601 | 679,601 | [
"php",
"arrays",
"datamapper",
"dynamic-arrays"
]
|
4,560,032 | 1 | 4,560,101 | null | 0 | 200 | I've a custom UITableViewCell like this:
```
+--------------------------+
| username |
| |
| --- <image> -- |
| |
| <like it> |
+--------------------------+
```
It display an username, an image and a button "Like it" to like image.
I don't want that the entire cell is selectable, I want a user can tap on "username" to see a new view that show username information. The same for image, when user tap on image, he could see the image in a new view.
Now I can only select my entire cell. How can I implement something like this?
Thanks.
When you click on the username you'll see a view for user information. The entire cell is not selectable.

| Question about select UITableViewCell fields | CC BY-SA 2.5 | null | 2010-12-30T04:33:12.247 | 2010-12-30T06:10:42.637 | 2010-12-30T04:46:30.247 | 545,004 | 545,004 | [
"iphone",
"uitableview"
]
|
4,560,163 | 1 | null | null | 1 | 5,178 | i have a simple app, it consist of 2 textview, 1 uiview as a coretext subclass, and then 1 scrollview. the others part is subviews from scrollview. I use this scrollview because i need to scroll the textviews and uiview at the same time. I already scroll all of them together, but the problem is, the keyboard hiding some lines in the textview. I have to change the frame of scrollview when keyboard appear, but it still not help.
This is my code :
```
UIScrollView *scrollView;
UIView *viewTextView;
UITextView *lineNumberTextView;
UITextView *codeTextView;
-(void) viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillAppear:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(keyboardWillDisappear:)
name:UIKeyboardWillHideNotification
object:nil];
self.scrollView.frame = CGRectMake(0, 88, self.codeTextView.frame.size.width,
self.codeTextView.frame.size.height);
scrollView.contentSize = CGSizeMake(self.view.frame.size.width, viewTextView.frame.size.height);
[scrollView addSubview:viewTextView];
CGAffineTransform translationCoreText = CGAffineTransformMakeTranslation(60, 7);
[viewTextView setTransform:translationCoreText];
[scrollView addSubview:lineNumberTextView];
[self.scrollView setScrollEnabled:YES];
[self.codeTextView setScrollEnabled:NO];
```
}
```
-(void)keyboardWillAppear:(NSNotification *)notification {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:[[[notification userInfo]
objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
CGRect keyboardEndingUncorrectedFrame = [[[notification userInfo]
objectForKey:UIKeyboardFrameEndUserInfoKey ] CGRectValue];
CGRect keyboardEndingFrame =
[self.view convertRect:keyboardEndingUncorrectedFrame
fromView:nil];
self.scrollView.frame = CGRectMake(0, 88, self.codeTextView.frame.size.width,
self.codeTextView.frame.size.height - keyboardEndingFrame.size.height);
[UIView commitAnimations];
```
}
```
-(void)keyboardWillDisappear:(NSNotification *) notification {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:[[[notification userInfo]
objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue]];
CGRect keyboardEndingUncorrectedFrame = [[[notification userInfo]
objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];
CGRect keyboardEndingFrame =
[self.view convertRect:keyboardEndingUncorrectedFrame
fromView:nil];
self.scrollView.frame = CGRectMake(0, 88, self.codeTextView.frame.size.width,
self.codeTextView.frame.size.height + keyboardEndingFrame.size.height);
[UIView commitAnimations];
```
}
can somebody help me please?
this is a pic from this problem :

some text still hiding by the keyboard after i do my code
i think the keyboard still hiding the text because i set the textview scroll enable to be NO. is that right??
i have add this code to the keyboardwillappear method
`codeBuilderSelectedRange = self.codeTextView.selectedRange; [self.viewTextViewScroll setContentOffset:CGPointMake(0, (CGFloat)codeBuilderSelectedRange.location) animated:YES];`
but it just make the textview dissappear from the view...can somebody tell the answer?
| keyboard hiding my textview | CC BY-SA 2.5 | 0 | 2010-12-30T05:09:25.173 | 2013-11-15T12:35:54.703 | 2011-01-03T09:39:03.790 | 515,986 | 515,986 | [
"iphone",
"uiview",
"keyboard",
"uiscrollview",
"uitextview"
]
|
4,560,497 | 1 | 4,560,642 | null | 45 | 6,590 | In Visual Studio , the Exceptions window has two columns with check boxes:

In contrast to this, in Visual Studio the column seems to be missing:

My questions are:
- -
The following extensions are installed in my Visual Studio 2010 installation:
- - - - -
| Exception window in VS.NET 2010 is missing the "User-unhandled" column | CC BY-SA 3.0 | 0 | 2010-12-30T06:26:11.903 | 2014-12-12T14:53:05.597 | 2014-12-12T14:53:05.597 | 233,152 | 107,625 | [
"visual-studio-2010",
"visual-studio",
"debugging",
"visual-studio-2012",
"visual-studio-2008"
]
|
4,560,831 | 1 | null | null | 2 | 3,124 | Does the ZedGraph API allow us to create a [radar chart](http://en.wikipedia.org/wiki/Radar_chart)? An example of a radar chart can be seen at [http://www.internet4classrooms.com/excel_files/radar_chart3.gif](http://www.internet4classrooms.com/excel_files/radar_chart3.gif) and is also listed below.
Language used: C#, getting data from a database dynamically and shown on the radar chart.
---

| ZedGraph radar chart | CC BY-SA 3.0 | 0 | 2010-12-30T07:29:39.203 | 2011-05-08T19:28:18.707 | 2011-05-08T19:28:18.707 | 63,550 | 558,027 | [
"c#",
"charts",
"zedgraph",
"radar-chart"
]
|
4,560,859 | 1 | 4,561,089 | null | -1 | 1,992 | Here is the structure of my database:

i have textbox1 and textbox2 and 8 checkboxes in my ASP.NET (VB.NET) webform.
i want to retrieve the seats on the particular dates means if i enter 11/12/2010 in textbox1 then in textbox2 the output would be from seat_select column, let say (1,2,3) where date would be 11/12/2010
If i enter 13/12/2010 in textbox1 then in textbox2 the output would be 1,2
How to do this in VB.NET?
| How to retrieve the record in comma seperated string from multiple database column? | CC BY-SA 2.5 | null | 2010-12-30T07:34:48.623 | 2010-12-30T08:30:15.790 | 2010-12-30T08:01:24.793 | 41,956 | 522,211 | [
"asp.net",
"vb.net"
]
|
4,560,973 | 1 | 4,562,945 | null | 5 | 2,958 | I'm a super newbie in RoR. Right now I'm working on this interesting Rails for Zombies exercises. And I got stuck with some syntax questions...
My code to this is:
```
Weapon.where(:zombie => "Ash")
```
But it won't work. If instead I typed:
```
Weapon.find(1)
```
I passed (since the first weapon belongs to the zombie Ash anyway).
Thanks in advance.



| Ruby on Rails syntax question | CC BY-SA 2.5 | 0 | 2010-12-30T07:57:04.457 | 2014-12-05T08:20:40.067 | null | null | 544,504 | [
"ruby-on-rails",
"ruby-on-rails-3"
]
|
4,561,347 | 1 | null | null | 1 | 3,636 | I am using register-plus plugin for registration purpose in my wordpress site. I have enalbled E-mail verifiacation whereby user will be getting an activation link. What i want to do is when the user clicks the link, i want the user to be enabled automatically.......currently admin has to login to the system and verify the users for the new user to login.....how do i achieve my task ...ANy help is appreciated

| E-mail verification in wordpress | CC BY-SA 2.5 | 0 | 2010-12-30T09:12:30.277 | 2010-12-31T05:09:02.797 | 2010-12-31T05:09:02.797 | 396,543 | 396,543 | [
"wordpress"
]
|
4,561,378 | 1 | 4,652,378 | null | 8 | 2,106 | First of all I want to tell you what kind of system I have and I want to build on.
```
1- A Solution (has)
a- Shared Class Library project (which is for lots of different solutions)
b- Another Class Library project (which is only for this solution)
c- Web Application project (which main part of this solution)
d- Shared Web Service project (which also serves for different solutions)
2- B Solution (has)
a- Shared Class Library project (which is for lots of different solutions)
c- Windows Form Application project (which is main part of this solution)
d- Web Service project (which also serves for different solutions)
```
and other projects like that....
I am using xp-dev.com as our svn repository server. And I opened different projects for these items () .
I want to do the versioning of all these projects of course.
is, should I put each project(one solution) to one svn repository to get their revision number later on?
Or should I put each of them to different svn repository and keep( write down) their correct version number that is used to publish/deploy every solution?

If I use one svn for each project(Shared Class Lib, Web App, Shared Web Service....) how can I relate the right svn address and version on VS.2010 within the real solution?

So, how do you manage your repositories and projects?
| Code management in different projects with different svn repositories | CC BY-SA 2.5 | 0 | 2010-12-30T09:16:37.087 | 2011-01-13T16:29:35.427 | null | null | 104,085 | [
"visual-studio",
"svn"
]
|
4,561,410 | 1 | null | null | 0 | 552 | 
Basically I need one Subject class and one Student class. One student can register for many subjects and one subject can have many students?
How can I connect the classes? Thanks.
| How to connect the two tables? (C++) | CC BY-SA 2.5 | null | 2010-12-30T09:22:43.257 | 2010-12-30T19:57:41.393 | 2010-12-30T09:27:06.237 | 253,056 | 505,425 | [
"c++"
]
|
4,561,540 | 1 | null | null | 0 | 3,213 | I'm not an expert in CSS, and I having some trouble with a template. The problem is in the scroll down. I can't put them correctly across all the template.
I have the full code of the template here. Just copy/paste and will work.
```
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title> stu nicholls | CSS PLaY | cross browser fixed header/footer layout basic method </title>
<style type="text/css" media="screen">
#printhead {display:none;}
html {
height:100%;
max-height:100%;
padding:0;
margin:0;
border:0;
background:#fff;
font-size:80%;
font-family: "trebuchet ms", tahoma, verdana, arial, sans-serif;
/* hide overflow:hidden from IE5/Mac */
/* \*/
overflow: hidden;
/* */
}
body {height:100%; max-height:100%; overflow:hidden; padding:0; margin:0; border:0;}
#content {display:block; height:100%; max-height:100%; overflow:hidden; padding-left:0px; position:relative; z-index:3; word-wrap:break-word;}
#head {position:absolute; margin:0; top:0; right:18px; display:block; width:100%; height:50px; background:#fff; font-size:1em; z-index:5; color:#000; border-bottom:1px solid #000;}
#foot {position:absolute; margin:0; bottom:-1px; right:18px; display:block; width:100%; height:25px; background:#fff; color:#000; text-align:right; font-size:2em; z-index:4; border-top:1px solid #000;}
.pad1 {display:block; width:18px; height:50px; float:left;}
.pad2 {display:block; height:50px;}
.pad3 {display:block; height:500px;}
#content p {padding:5px;}
.bold {font-size:1.2em; font-weight:bold;}
.red {color:#c00; margin-left:5px; font-family:"trebuchet ms", "trebuchet", "verdana", sans-serif;}
h2 {margin-left:5px;}
h3 {margin-left:5px;}
</style>
</head>
<body>
<div id="head">
<div class="pad1"></div><h1>Header</h1>
</div>
<div id="content">
<div class="pad2"></div>
<IFRAME name="teste" src="http://www.yahoo.com" width="100%" height="100%" frameborder=0></IFRAME>
<!--<div class="pad3"></div>-->
</div>
<div id="foot">Footer</div>
</body>
</html>
```
Can some one give me some clues about what can I do to solve this?
See image bellow, I'm testing with Firefox. I need that the scroll down is placed all across the webpage, and in this moment they skipp the header section.

Best Regards. (Edited)
| How to solve scroll down problem in CSS Layout | CC BY-SA 2.5 | 0 | 2010-12-30T09:39:11.073 | 2010-12-30T15:02:39.643 | 2010-12-30T10:27:30.383 | 488,735 | 488,735 | [
"html",
"css",
"scroll"
]
|
4,561,907 | 1 | null | null | 3 | 5,903 | A google chrome extension can have a browser action which displays a 'popup' when clicked on. I would like to display such a popup when someone hovers over an element on a page. Below is an example of a popup that floats over the actual page. How can I achieve this with a chrome extension?
Cheers,
Pete

| Chrome Extension - Popup / Floating iFrame | CC BY-SA 2.5 | 0 | 2010-12-30T10:39:07.187 | 2010-12-30T14:29:56.807 | null | null | null | [
"popup",
"google-chrome-extension"
]
|
4,562,215 | 1 | null | null | 5 | 1,513 | In `data2` directory, I have these files:

With the following code (running on Mac), I want to only get the files that end with `.xls`:
```
$file_names = glob('data2/*.xls');
foreach ($file_names as $file_name) {
echo $file_name . '<br/>';
}
```
I would expect that this code would return one file `27template.xls`, however, it also returns the files with `TEMP` in them and adds a `.xls` to them:

: also if I change `smaller.xls` to `smaller.xlsx` then it does NOT find it as expected, but if I change it to `smaller.NNN` it finds `smaller.NNN.xls`.
`glob()``.xls`
| Why does the PHP function glob() return files that do not match the wildcard? | CC BY-SA 2.5 | null | 2010-12-30T11:30:43.863 | 2011-04-11T14:06:11.323 | 2011-03-29T22:23:31.183 | 109,678 | 4,639 | [
"php",
"glob"
]
|
4,562,527 | 1 | 4,562,600 | null | 45 | 102,410 | With the following code, I am able to read the cells out of an Excel file with PHPExcel.
I currently define how many rows and columns to read.
```
$file_name = htmlentities($_POST['file_name']);
$sheet_name = htmlentities($_POST['sheet_name']);
$number_of_columns = htmlentities($_POST['number_of_columns']);
$number_of_rows = htmlentities($_POST['number_of_rows']);
$objReader = PHPExcel_IOFactory::createReaderForFile("data/" . $file_name);
$objReader->setLoadSheetsOnly(array($sheet_name));
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("data/" . $file_name);
echo '<table border="1">';
for ($row = 1; $row < $number_of_rows; $row++) {
echo '<tr>';
for ($column = 0; $column < $number_of_columns; $column++) {
$value = $objPHPExcel->setActiveSheetIndex(0)->getCellByColumnAndRow($column, $row)->getValue();
echo '<td>';
echo $value . ' ';
echo '</td>';
}
echo '</tr>';
}
echo '</table>';
```
# Solution:
Thanks, Mark, here's the full solution with those functions:
```
$file_name = htmlentities($_POST['file_name']);
$sheet_name = htmlentities($_POST['sheet_name']);
$number_of_columns = htmlentities($_POST['number_of_columns']);
$number_of_rows = htmlentities($_POST['number_of_rows']);
$objReader = PHPExcel_IOFactory::createReaderForFile("data/" . $file_name);
$objReader->setLoadSheetsOnly(array($sheet_name));
$objReader->setReadDataOnly(true);
$objPHPExcel = $objReader->load("data/" . $file_name);
$highestColumm = $objPHPExcel->setActiveSheetIndex(0)->getHighestColumn();
$highestRow = $objPHPExcel->setActiveSheetIndex(0)->getHighestRow();
echo 'getHighestColumn() = [' . $highestColumm . ']<br/>';
echo 'getHighestRow() = [' . $highestRow . ']<br/>';
echo '<table border="1">';
foreach ($objPHPExcel->setActiveSheetIndex(0)->getRowIterator() as $row) {
$cellIterator = $row->getCellIterator();
$cellIterator->setIterateOnlyExistingCells(false);
echo '<tr>';
foreach ($cellIterator as $cell) {
if (!is_null($cell)) {
$value = $cell->getCalculatedValue();
echo '<td>';
echo $value . ' ';
echo '</td>';
}
}
echo '</tr>';
}
echo '</table>';
```

| How to find out how many rows and columns to read from an Excel file with PHPExcel? | CC BY-SA 2.5 | 0 | 2010-12-30T12:17:54.143 | 2019-03-27T12:32:31.430 | 2015-09-04T01:56:40.883 | 1,505,120 | 4,639 | [
"php",
"phpexcel"
]
|
4,562,983 | 1 | 4,563,066 | null | 0 | 402 | I have the following html (i'm also using Jquery and JqueryUI)
```
<div style="display:none; position:fixed; z-index:100;padding:0;margin:0" class="ui-state-highlight" id="Info">
<table cellpadding="0" cellspacing="0" style="padding:0;margin:0">
<tr style="padding:0;margin:0;">
<td><span class="ui-icon ui-icon-info"></span></td>
<td width = "100%" style="padding:0;margin:0;"><div id = "InfoText"></div></td>
<td><button style="width:25px;height:25px;margin:0;padding:0" id="closeInfo"></button></td>
</tr>
</table>
</div>
```
It procudes the following:

See where i circled in red? I want to get rid of that yellow space under the button, but i can't figure out how...

Thanks!
Solved:
```
<div style="display:none; position:fixed; z-index:100" class="ui-state-highlight" id="Info">
<table cellpadding="0" cellspacing="0">
<tr>
<td><span class="ui-icon ui-icon-info"></span></td>
<td width = "100%"><div id = "InfoText"></div></td>
<td><button style="width:25px;height:25px;vertical-align:middle;display:block;" id="closeInfo"></button></td>
</tr>
</table>
</div>
```
| help with css formatting on table and div | CC BY-SA 2.5 | null | 2010-12-30T13:33:57.200 | 2010-12-30T13:52:50.860 | 2010-12-30T13:52:50.860 | 351,980 | 351,980 | [
"jquery",
"html",
"css",
"jquery-ui"
]
|
4,562,982 | 1 | 4,567,252 | null | 4 | 2,265 | Good day,
[TValue](http://www.delphifeeds.com/postings/60805-tvalue_in_depth) is a Delphi-2010 and up RTTI feature.
Following on from my [earlier question](https://stackoverflow.com/questions/4561569/rtti-dynamic-array-tvalue-delphi-2010), I had tried to make recurrent function to return a TValue as a n-dimensional. matrix(2D, 3D, 4D...)
for example, this procedure will show a n-dimensional matrix(it will list all elements from a n-dimensional matrix as TValue variable):
```
Procedure Show(X:TValue);
var i:integer;
begin
if x.IsArray then
begin
for i:=0 to x.GetArrayLength-1 do
show(x.GetArrayElement(i));
writeln;
end else
write(x.ToString,' ');
end;
```
I don't understand how to create a function to create from a TValue an n-dimensional matrix. For example i need a Function CreateDynArray(Dimensions:array of integer; Kind:TTypeKind):TValue; and the function will return a TValue which is a dynamic array how contain the dimenssions for example:
Return=CreateDynArray([2,3],tkInteger); will return a TValue as tkDynArray
and if i will show(Return) will list
```
0 0 0
0 0 0
```
Is not terminated.
From a TValue i try to create a DynArray with n-dimensions
```
Procedure CreateArray(var Value:TValue; NewDimmension:integer; NewValue2Kind:TTypeKind; NewValue2:TValue; IsLast:Boolean);
var i:integer;
NewValue:TValue;
len:Longint;
begin
If Value.IsArray then// we have components in this dimension
begin
for i:=0 to Value.GetArrayLength-1 do// list all
begin
NewValue:=Value.GetArrayElement[i];
CreateArray(newValue,NewDimension,NewValue2Kind,NewValue2,IsLast);
Value.SetArrayElement(i,NewValue);
end;
end;
end else
begin
if isLast then
begin
len:=NewDimension;
DynArraySetLength(PPointer(Value.GetRefereneToRawData)^,Value.TypeInfo,1,@len); //set length to NewDimension
for i:=0 to NewDimension-1 do //Fill all with 0
Value.SetArrayElement(i,NewValue2);
end else
begin
len:=NewDimension;
DynArraySetLength(PPointer(Value.GetRefereneToRawData)^,Value.TypeInfo,1,@len);//I will create len TValues
end;
end;
var Index:array of integer;
Value:TValue;
ValuKind:TTypeKind;
......
......
....
Case token of
tokInt:
begin
ValueKind:=tkInteger;
Value:=0;
end;
.....
end;
Index:=GetIndexFromSintacticTree;//for example if i have int[20][30] index=[20,30]
for i:=0 to high(index) do
begin
if i = high(index) then CreateArray(Variable.Value,Index[i],ValueKind,Value,True)
else CreateArray(Variable.Value,Index[i],ValueKind,Value,False)
//Variable.Value is TValue
end;
//first TValue have 1 element, after that it will have 20 elements, and after that will have 20*30 elements
```

Thank you very much, and have a nice day!
| RTTI Delphi Create as TValue an n-dimensional matrix | CC BY-SA 2.5 | 0 | 2010-12-30T13:33:43.410 | 2011-01-01T12:48:25.770 | 2017-05-23T10:32:35.693 | -1 | 558,126 | [
"delphi",
"matrix",
"delphi-2010",
"rtti",
"tvalue"
]
|
4,563,108 | 1 | 4,563,164 | null | 0 | 1,093 | Hello,
I am using update panel in my ASP.net page for partial page postbacks. I have gridview and a button "Export" which on click will call the Export method from the below class.
If I remove the update Panel everything will work as expected. But if there is a update panel it will not work and throws this error.
Please help. Below is the code for the
```
using System;
using System.Data;
using System.Configuration;
using System.IO;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
/// <summary>
///
/// </summary>
public class GridViewExportUtil
{
/// <summary>
///
/// </summary>
/// <param name="fileName"></param>
/// <param name="gv"></param>
public static void Export(string fileName, GridView gv)
{
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.AddHeader(
"content-disposition", string.Format("attachment; filename={0}", fileName));
HttpContext.Current.Response.ContentType = "application/ms-excel";
using (StringWriter sw = new StringWriter())
{
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
{
// Create a form to contain the grid
Table table = new Table();
// add the header row to the table
if (gv.HeaderRow != null)
{
GridViewExportUtil.PrepareControlForExport(gv.HeaderRow);
table.Rows.Add(gv.HeaderRow);
}
// add each of the data rows to the table
foreach (GridViewRow row in gv.Rows)
{
GridViewExportUtil.PrepareControlForExport(row);
table.Rows.Add(row);
}
// add the footer row to the table
if (gv.FooterRow != null)
{
GridViewExportUtil.PrepareControlForExport(gv.FooterRow);
table.Rows.Add(gv.FooterRow);
}
// render the table into the htmlwriter
table.RenderControl(htw);
// render the htmlwriter into the response
HttpContext.Current.Response.Write(sw.ToString());
HttpContext.Current.Response.End();
}
}
}
/// <summary>
/// Replace any of the contained controls with literals
/// </summary>
/// <param name="control"></param>
private static void PrepareControlForExport(Control control)
{
for (int i = 0; i < control.Controls.Count; i++)
{
Control current = control.Controls[i];
if (current is LinkButton)
{
control.Controls.Remove(current);
control.Controls.AddAt(i, new LiteralControl((current as LinkButton).Text));
}
else if (current is ImageButton)
{
control.Controls.Remove(current);
control.Controls.AddAt(i, new LiteralControl((current as ImageButton).AlternateText));
}
else if (current is HyperLink)
{
control.Controls.Remove(current);
control.Controls.AddAt(i, new LiteralControl((current as HyperLink).Text));
}
else if (current is DropDownList)
{
control.Controls.Remove(current);
control.Controls.AddAt(i, new LiteralControl((current as DropDownList).SelectedItem.Text));
}
else if (current is CheckBox)
{
control.Controls.Remove(current);
control.Controls.AddAt(i, new LiteralControl((current as CheckBox).Checked ? "True" : "False"));
}
if (current.HasControls())
{
GridViewExportUtil.PrepareControlForExport(current);
}
}
}
}
```
| Update Panel and content type issue | CC BY-SA 2.5 | null | 2010-12-30T13:51:03.860 | 2010-12-30T14:00:38.430 | null | null | 199,931 | [
"asp.net",
"ajax"
]
|
4,563,282 | 1 | null | null | -1 | 1,063 | I am working in a small task that allow the user to enter the regions of any country and store them in one array. Also, each time he enters a region, the system will ask him to enter the neighbours of that entered region and store these neighbours.
I did the whole task but I have small two problems:
1. when I run the code, the program does not ask me to enter the name of the first region (This is happened only to the first region)
2. I could not be able to print each region and its neighbours like the following format: Region A: neighbour1 neighbour2 Region B: neighbour1 neighbour2 and so on.
My code is the following:
```
import java.io.*;
import java.util.Arrays;
import java.util.Scanner;
public class Test6{
public static void main(String[] args) {
Scanner kb = new Scanner(System.in);
System.out.print("Please enter the number of regions: ");
int REGION_COUNT = kb.nextInt();
String[][] regions = new String[REGION_COUNT][2];
for (int r = 0; r < regions.length; r++) {
System.out.print("Please enter the name of region #" + (r+1) + ": ");
String region = kb.nextLine();
System.out.print("How many neighbors for region #" + (r+1) + ": ");
if (kb.hasNextInt()) {
int size = kb.nextInt();
regions[r] = new String[size];
kb.nextLine();
for (int n = 0; n < size; n++) {
System.out.print("Please enter the neighbour #"
+ (n) + ": ");
regions[r][n] = kb.nextLine();
}
} else System.exit(0);
}
for(int i=0; i<REGION_COUNT; i++){
for(int k=0; k<2; k++){
System.out.println(regions[i][k]);
}
}
}
}
```
Thanks everybody for your immediate helps. But let me explain to you what I want in more details.
First of all, I need to use the two dimensional array.
Secondly, my problem now is just with the printing of the result. I want to print the results like the following format:
```
> RegionA : its neighbours
```
For example, let us take USA
```
> Washington D.C: Texas, Florida, Oregon
--------------------------------------------------------------------------
```
Dear ykartal,
I used your program and it gave me the following:

| Printing Two Dimensional Array | CC BY-SA 2.5 | 0 | 2010-12-30T14:15:44.710 | 2010-12-30T16:14:52.843 | 2010-12-30T16:14:52.843 | 19,679 | 2,087,707 | [
"java"
]
|
4,563,893 | 1 | 4,564,630 | null | 21 | 13,453 | I'm using a textured window that has a tab bar along the top of it, just below the title bar.
I've used [-setContentBorderThickness:forEdge:](https://developer.apple.com/documentation/appkit/nswindow/1419541-setcontentborderthickness?language=objc#) on the window to make the gradient look right, and to make sure sheets slide out from the right position.
What's not working however, is dragging the window around. It works if I click and drag the area that's actually the title bar, but since the title bar gradient spills into a (potentially/often empty) tab bar, it's easy to click too low and it feels really frustrating when you try to drag and realise the window is not moving.
I notice `NSToolbar`, while occupying roughly the same amount of space below the title bar, allows the window to be dragged around when the cursor is over it. How does one implement this?
Thanks.

| Allow click and dragging a view to drag the window itself? | CC BY-SA 3.0 | 0 | 2010-12-30T15:34:38.393 | 2021-09-14T20:27:15.517 | 2018-10-21T18:13:01.160 | 819,340 | 322,122 | [
"objective-c",
"macos",
"cocoa",
"nswindow",
"appkit"
]
|
4,563,914 | 1 | 4,563,947 | null | 0 | 103 | This is a general design question not relating to any language. I'm a bit torn between going for minimum code or optimum organization.
I'll use my current project as an example. I have a bunch of tabs on a form that perform different functions. Lets say Tab 1 reads in a file with a specific layout, tab 2 exports a file to a specific location, etc. The problem I'm running into now is that I need these tabs to do something slightly different based on the contents of a variable. If it contains a 1 I may need to use Layout A and perform some extra concatenation, if it contains a 2 I may need to use Layout B and do no concatenation but add two integer fields, etc. There could be 10+ codes that I will be looking at.
Is it more preferable to create an individual path for each code early on, or attempt to create a single path that branches out only when absolutely required.
Creating an individual path for each code would allow my code to be extremely easy to follow at a glance, which in turn will help me out later on down the road when debugging or making changes. The downside to this is that I will increase the amount of code written by calling some of the same functions in multiple places (for example, steps 3, 5, and 9 for every single code may be exactly the same.
Creating a single path that would branch out only when required will be a bit messier and more difficult to follow at a glance, but I would create less code by placing conditionals only at steps that are unique.
I realize that this may be a case-by-case decision, but in general, if you were handed a previously built program to work on, which would you prefer?
---
Edit: I've drawn some simple images to help express it. Codes 1/2/3 are the variables and the lines under them represent the paths they would take. All of these steps need to be performed in a linear chronological fashion, so there would be a function to essentially just call other functions in the proper order.
Different Paths

Single Path

| Design - When to create new functions? | CC BY-SA 3.0 | null | 2010-12-30T15:37:48.767 | 2012-04-29T16:11:02.637 | 2012-04-29T16:11:02.637 | 1,140,748 | 403,952 | [
"reusability"
]
|
4,564,147 | 1 | null | null | 0 | 2,251 | I have an admin page where a user will select a document path and add that path to a certain column of a database. I am using a fileupload on the page where they can find the document and copy the path and then paste it into the details view. However, I want to skip this step and I want them to select a document and automatically make the path show up in the details view.
```
<asp:FileUpload ID="FileUpload1" runat="server" Visible="False" Width="384px" /><br />
<br />
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<center> <asp:DetailsView ID="DetailsView1" runat="server" AllowPaging="True" AutoGenerateRows="False"
DataKeyNames="ID" DataSourceID="SqlDataSource1" Height="128px" Width="544px" Visible="False" OnModeChanged="Button2_Click" CellPadding="4" ForeColor="#333333" GridLines="None" >
<Fields>
<asp:BoundField DataField="Order" HeaderText="Order" SortExpression="Order" />
<asp:BoundField DataField="Department" HeaderText="Department" SortExpression="Department"/>
<asp:BoundField DataField="DOC_Type" HeaderText="DOC_Type" SortExpression="DOC_Type" />
<asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" />
<asp:BoundField DataField="Revision" HeaderText="Revision" SortExpression="Revision" />
<asp:BoundField DataField="DOC" HeaderText="DOC" SortExpression="DOC" />
<asp:BoundField DataField="Active" HeaderText="Active" SortExpression="Active" />
<asp:BoundField DataField="Rev_Date" HeaderText="Rev_Date" SortExpression="Rev_Date" />
<asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True"
SortExpression="ID" Visible="False" />
<asp:CommandField ShowInsertButton="True" />
</Fields>
<FooterStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" />
<CommandRowStyle BackColor="#E2DED6" BorderStyle="None" Font-Bold="True" />
<RowStyle BackColor="#F7F6F3" BorderStyle="None" ForeColor="#333333" />
<FieldHeaderStyle BackColor="#E9ECF1" BorderStyle="None" Font-Bold="True" />
<EmptyDataRowStyle BorderStyle="None" />
<PagerStyle BackColor="#284775" BorderStyle="None" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" BorderStyle="None" Font-Bold="True" ForeColor="White" />
<InsertRowStyle BorderStyle="None" />
<EditRowStyle BackColor="#999999" BorderStyle="None" />
<AlternatingRowStyle BackColor="White" BorderStyle="None" ForeColor="#284775" />
</asp:DetailsView>
<br />
```
I need to get the fileupload1 into the DOC contenttemplate area so instead of showing an empty textbox it will show just a textbox it will show the fileupload


| Use fileupload as template field in a details view | CC BY-SA 2.5 | 0 | 2010-12-30T16:07:28.057 | 2011-01-06T09:49:05.730 | 2010-12-30T19:35:52.087 | 497,470 | 497,470 | [
"asp.net",
"vb.net"
]
|
4,564,709 | 1 | 4,564,748 | null | 9 | 9,094 | I wish to increase the size of a control whenever the user hovers the mouse.
The size increase should not readjust the other controls, rather the current control should overlap the neighboring controls as is the case with google search (images tab) shown below:

The image with red border overlaps the other images.
| WPF: On Mouse hover on a particular control, increase its size and overlap on the other controls | CC BY-SA 3.0 | 0 | 2010-12-30T17:19:47.560 | 2013-03-18T11:56:52.330 | 2013-03-18T11:56:52.330 | 601,179 | 473,376 | [
"wpf",
"wpf-controls"
]
|
4,564,828 | 1 | 4,565,081 | null | 0 | 117 | I currently have this database structure:

One entry can have multiple items of the type "file", "text" and "url".
Everyone of these items has exactly one corresponding item in either the texts, urls or files table - where data is stored.
I need a query to efficiently select an entry with all its corresponding items and their data.
So my first approach was someting like
```
SELECT * FROM entries LEFT JOIN entries_items LEFT JOIN texts LEFT JOIN urls LEFT JOIN files
```
and then loop through it and do the post processing in my application.
But the thing is that its very unlikely that multiple items of different types exist. Its even a rare case that more then one item exists per entry. And in most cases it will be a file. But I need It anways...
So not to scan all 3 tables for eveyr item I thought I could do something like case/switch and scan the corresponding table based on the value of "type" in entries_items.
But I couldn't get it working.
I also thought about making the case/switch logic in the application, but then I would have multiple queries which would probabably be slower as the mysql server will be external.
I can also change the structure if you have a better approach!
I also having all the fields of "texts", "urls" and "files" in side the table entries_items, as its only a 1:1 relation and just have everything that is not needed null.
What would be the pros/cons of that? I think it needs more storage space and i cant do my cosntraints as i have them now. Everything needs also to be null...
Well I am open to all sorts of ideas. The application is not written yet, so I can basically change whatever I like.
| SQL Modeling / Query Question | CC BY-SA 2.5 | null | 2010-12-30T17:36:25.657 | 2010-12-30T19:34:29.033 | null | null | 413,910 | [
"sql",
"mysql",
"database-design"
]
|
4,565,004 | 1 | 4,565,124 | null | 6 | 9,879 | Complete PHP novice here, almost all my previous work was in ASP.NET. I am now working on a PHP project, and the first rock I have stumbled upon is retaining values across postback.
For the most simple yet still realistic example, i have 10 dropdowns. They are not even databound yet, as that is my next step. They are simple dropdowns.
I have my entire page inclosed in a tag. the onclick() event for each dropdown, calls a javascript function that will populate the corrosponding dropdowns hidden element, with the dropdowns selected value. Then, upon page reload, if that hidden value is not empty, i set the selected option = that of my hidden.
This works great for a single postback. However, when another dropdown is changed, the original 1'st dropdown loses its value, due to its corrosponding hidden value losing its value as well!
This draws me to look into using querystring, or sessions, or... some other idea.
Could someone point me in the right direction, as to which option is the best in my situation? I am a PHP novice, however I am being required to do some pretty intense stuff for my skill level, so I need something flexable and preferribly somewhat easy to use.
Thanks!
-----edit-----
A little more clarification on my question :)
When i say 'PostBack' I am referring to the page/form being submitted. The control is passed back to the server, and the HTML/PHP code is executed again.
As for the dropdowns & hiddens, the reason I used hidden variables to retain the "selected value" or "selected index", is so that when the page is submitted, I am able to redraw the dropdown with the previous selection, instead of defaulting back to the first index. When I use the $_POST[] command, I am unable to retrieve the dropdown by name, but I am able to retrieve the hidden value by name. This is why upon dropdown-changed event, I call javascript which sets the selected value from the dropdown into its corrosponding hidden.
-------- edit again --------
Alright alright, i see that i need to take a step wayyy back and explain the overall goal :) i apologize for not being very clear to begin with.
My final design would be a page where a user can select a department within our company, to view data for. Once that department is selected (from a dropdown), then I will display more specific data selection dropdowns for: color, size, vendor, style, date, store#, etc... at this point i will also display the sales data for the selected department. Upon selection of any color,size,etc- i will update the sales data results to meet the new criteria
--------- edit ----------
I cannot provide external access to my example, however here is a sceenshot with explination. In the image below, The user would expand the Department dropdown, to pick a department. At this point, the sales data below would refresh according to that department. Then, the user would select a "Group By" option such as Store, and the page/data would refresh to display data grouped by store. Then they could select a color such as black in my example, and the data would show sales for the selected department and color, grouped by store.
In order to do all this however, the page needs to retain the department, color, and grouping dropdown selections every refresh/post...

| PHP - Best practice to retain form values across postback | CC BY-SA 2.5 | 0 | 2010-12-30T18:00:30.833 | 2010-12-31T19:59:33.553 | 2010-12-31T19:35:45.677 | 558,552 | 558,552 | [
"php",
"postback",
"retain"
]
|
4,565,338 | 1 | null | null | 2 | 1,148 | In each app I develop, I like to add three types of messages:
- - -
And perhaps, a neutral one for information, which is gray or blue if the success one is green.
The success one is used for when an item is created or updated, the yellow one is when there's something wrong, but not we-are-going-to-die wrong and the red one is when something is blocked or we are going to die.

However, there's one thing I can't figure out, when I delete an object, what kind of notification should I use? I think the success one is not because it is not expected, altough the deletion was successful, the user tends not to read the message, just to see the color.
The red one might be, but it can be misunderstood (I tried to delete it but there was an error), the warning and the information one might be good choices, but I'm not really sure.



Also, when you ask for confirmation about deleting something, the 'cancel' button should be green or red?

I'm just curious how you guys handle this. Thanks.
| Usability for notification messages, colors [web apps] | CC BY-SA 2.5 | null | 2010-12-30T18:50:12.540 | 2010-12-30T19:09:19.260 | 2010-12-30T18:56:07.520 | 201,877 | 201,877 | [
"colors",
"notifications",
"usability"
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.