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 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,158,606 | 1 | 6,158,723 | null | 2 | 402 |
I have a really weird offset/padding/margin/whatever error with CSS3. Following markup is defining an article and a corresponding sidebar:
```
<section>
<article>
...
</article>
<aside>
...
</aside>
</section>
```
And I'm using CSS3 styles to display them side by side:
```
section {
display: table;
}
article {
display: table-cell;
}
aside {
display: table-cell;
}
```
The result should look like this (this is the top of the sidebar):

but actually it looks like this:

What is this gap, and why is it there? Both Safari's Web Inspector and Firefox's Firebug don't show any information, only Opera Inspector displays an "OffsetTop" layout value of 8 pixels. Any ideas how to fix it without positioning the sidebar absolute?
---
```
body
{
display:table;
font-family:Arial, sans-serif;
margin:0;
padding:0;
}
body article
{
display:table-cell;
border-right:1px solid #0088b9;
width:766px;
}
body article section
{
clear:both;
display:inline-block;
margin:0 34px 0 0;
padding:13px 0 13px 34px;
width:698px;
}
body article section.rule
{
border-bottom:1px solid #a6a6a6;
}
body article section.title
{
background-color:#0088b9;
color:#FFF;
font-size:39px;
font-style:bolder;
padding:13px 34px;
width:664px;
}
body article section.header
{
background-color:#7cb6d6;
color:#FFF;
font-size:26px;
font-style:bold;
padding:13px 34px;
width:664px;
}
body article section.text
{
padding:13px 34px;
width:664px;
}
body article section.text p
{
margin:0;
font-size:20px;
}
body article section.list ul
{
font-size:20px;
list-style-image:url(dot.png);
margin:0 0 0 -16px;
}
body article section.images figure
{
display:block;
float:left;
font-size:15px;
margin:0;
padding:0;
text-align:center;
width:332px;
}
body article section.images figure:last-child
{
margin-left:34px;
}
body article section.image figure
{
display:block;
font-size:15px;
padding:0;
text-align:center;
}
body aside
{
background-color:#ccd6e2;
border-left:1px solid #FFF;
display:table-cell;
width:256px;
}
body aside nav
{
width:256px;
}
body aside nav a
{
border-top:22px solid #a6a6a6;
border-bottom:22px solid #a6a6a6;
border-left:22px solid #a6a6a6;
display:block;
text-decoration:none;
line-height:20px;
}
body aside nav a strong
{
background-color:#0088b9;
border-bottom:1px solid #FFF;
color:#FFF;
display:block;
font-size:20px;
text-align:center;
}
body aside section.screen
{
top:68px;
}
body aside section.screen a
{
display:block;
padding:17px 22px;
}
```
---
```
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />
<title></title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<section>
<article>
<section class="title">
Überschrift Lorem ipsum3
</section>
<section class="header">
Einleitung Lorem ipsum dolor sit amet, consetetur sadip scing elitr, sed diam nonumy eirmod tempor.
</section>
<section class="text">
<p>Text Lorem ipsum dolor sit ametsadipscing elitr, sed invidunt takimata</p>
</section>
<section class="list">
<ul>
<li>Item 1</li>
<li>Item 2</li>
</ul>
</section>
<section class="images">
<figure>
<img src="5747714470_334146faa9_b.jpg" alt="Macaque in the trees">
<figcaption>Text Lorem ipsum</figcaption>
</figure>
<figure>
<img src="5747165065_67cbfa0a09_b.jpg" alt="Macaque in the trees">
<figcaption>Text Lorem ipsum</figcaption>
</figure>
</section>
<section class="image">
<figure>
<img src="5747167101_33b788b4dd_b.jpg" alt="Macaque in the trees">
<figcaption>Text Lorem ipsum</figcaption>
</figure>
</section>
<section class="rule"></section>
</article>
<aside>
<nav>
<a href="/"><strong>Zurück</strong></a>
</nav>
<section class="screen">
<a href="/" class="video">Lorem ipsum dolor sit amet</a>
<a href="/" class="image">Lorem ipsum dolor sit amet</a>
</section>
<section class="downloads">
<a href="/" class="pdf">Lorem ipsum dolor sit amet</a>
</section>
</aside>
</section>
</body>
</html>
```
|
Offset error with CSS3
|
CC BY-SA 3.0
| null |
2011-05-27T23:28:23.317
|
2011-05-27T23:57:52.140
|
2011-05-27T23:50:06.577
| 326,984 | 326,984 |
[
"html",
"css",
"rendering"
] |
6,158,876 | 1 | 6,158,900 | null | 2 | 2,549 |
i have pear's phpunit installed (see image)
I have that path in the include path (see image below) in php.ini. Note, other pear installations have worked with this include path, so I know there's nothing wrong with that path per see.
Yet, when I'm trying to do a an example functional test with Yii , I move into the directory protected/tests/ and run this code (provided by a book I'm learning)
```
% cd protected/tests/
% phpunit functional/SiteTest.php
```
I get told
```
-bash: phpunit: command not found
```
any idea what I'm doing wrong?


|
what's the meaning of -bash PHPUnit command not found
|
CC BY-SA 3.0
| null |
2011-05-28T00:29:41.843
|
2011-05-28T00:35:44.013
| null | null | 577,455 |
[
"php",
"bash",
"terminal",
"pear",
"yii"
] |
6,158,975 | 1 | 6,159,026 | null | 37 | 34,615 |
I know this is a sort of a common problem, and I looked up some solutions, but couldn't find exactly what I was looking for.
I would like to convert [this](http://pastehtml.com/view/av6fb8bir.html) to a tableless layout.

Note: header and footer have to be set to a fixed height in pixels (50px is ok).
The main problem I'm having is that I cannot get that "big box" in the middle to behave like it does when it's done with tables. There are solutions which work OK for a variable length content (text, images), but I would like this box look and behave like a box - with borders, rounded corners and all.
|
CSS 100% height layout
|
CC BY-SA 3.0
| 0 |
2011-05-28T00:52:00.597
|
2013-03-30T22:26:05.943
|
2013-03-30T22:26:05.943
| 871,050 | 306,337 |
[
"css",
"layout",
"height"
] |
6,159,021 | 1 | 6,159,120 | null | 5 | 735 |
[First read this](https://stackoverflow.com/questions/938429/scope-of-python-lambda-functions-and-their-parameters/938493#938493). It is about `lambda x=x: foo(x)` catching x even in `for` loop.
This is a window with label and two buttons generated in `for` loop. When button is clicked, it name appears in label.
If we use usual `lambda: label.setText("button -- " + str(i))`, then the result is last `i` in the loop, no matter what button is pressed:

And this is right.
When we change to `lambda i=i: label.setText("button -- " + str(i))` (snipet) and expect that now it will be everything ok, the result is:
![lambda i=i:foo(i)]](https://i.stack.imgur.com/vbbPq.jpg)
False!
Where this `False` comes from?
```
import sys
from PyQt4.QtGui import *
class MainWindow(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
vbox = QVBoxLayout(self)
# label for action
label = QLabel('')
vbox.addWidget(label)
# adding buttons
for i in range (1, 3):
btn = QPushButton(str(i))
btn.clicked.connect( lambda i=i: label.setText("button " + str(i)) )
vbox.addWidget(btn)
app = QApplication(sys.argv)
myapp = MainWindow()
myapp.show()
sys.exit(app.exec_())
```
Why this solution is not working as it should be? What this `false` means?
I know that you can make `foo_factory`, as in first link, but the question is what is wrong with `lambda i=i: foo(i)`
|
lambda i=i: foo(i) in for loop not working
|
CC BY-SA 3.0
| 0 |
2011-05-28T01:04:43.933
|
2022-08-21T21:42:44.863
|
2017-05-23T11:55:37.137
| -1 | 159,982 |
[
"python",
"lambda",
"pyqt"
] |
6,159,073 | 1 | 6,159,134 | null | 7 | 7,904 |
As you see in the image below, I have Pear installed, and there is a PhpUnit folder, but when I run this code (from a book on Yii),
```
% phpunit functional/SiteTest.php
```
it's telling me
```
-bash: phpunit: command not found
```
I am assuming from the fact that Phpunit folder is present that I have correctly installed it. In fact, it said install o.k. in the terminal.
Any ideas where I can find this command?

|
Where is the Pear PHPUnit command
|
CC BY-SA 3.0
| 0 |
2011-05-28T01:17:20.857
|
2013-02-07T08:51:19.813
| null | null | 577,455 |
[
"pear"
] |
6,159,136 | 1 | 6,224,601 | null | 3 | 458 |

Is there some way to get chrome to launch my text editor when I click on a stack trace link pointing to a file:// url?
|
Hook Chrome debugger up to text editor
|
CC BY-SA 3.0
| 0 |
2011-05-28T01:34:06.940
|
2011-06-03T08:14:10.460
| null | null | 88,696 |
[
"javascript",
"google-chrome",
"google-chrome-devtools"
] |
6,159,392 | 1 | 6,164,085 | null | 6 | 622 |
I use the code below get an overview of parts of my data.
- What would be the best way to make a function out of the below code ?- It would take a dataList as well as some graphical options (such as colors) as arguments and return a customized tabular representation as shown below.```
overviewtheData=Text@Grid[{Map[Rotate[Text[#],
90Degree]&,data[[1]]]}~Join~data[[2;;]],
Background->{{{{White,Pink}},{1->White}}},
Dividers->{All,{1->True,2->True,0->True}},
ItemSize->{1->5,Automatic},
Alignment->Top,
Frame->True,
FrameStyle->Thickness[2],
ItemStyle->{Automatic,Automatic,{{1,1},
{1,Length@data[[1]]}}->Directive[FontSize->15,Black,Bold]}]
```
---

|
Create a Function for Customized Tabular Representation
|
CC BY-SA 3.0
| 0 |
2011-05-28T02:59:14.267
|
2017-01-27T21:20:20.677
|
2017-01-27T21:20:20.677
| 4,370,109 | 769,551 |
[
"function",
"grid",
"wolfram-mathematica",
"tabular"
] |
6,159,385 | 1 | 6,159,782 | null | 4 | 1,836 |
I am drawing a cube with LWJGL library for Java, and it draws fine, but when I rotate the cube, it seems like the front side will draw on top of the back side when it should be cut off. Here is the code:
Init code:
```
GL11.glViewport(0, 0, width, height);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GLU.gluPerspective(45.0f, (float)width/(float)height, 0.1f, 100.0f);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
```
Cube Code:
```
GL11.glTranslatef(0.0f, 0.0f, -6.0f);
GL11.glRotatef(rquad, 0.0f, 1.0f, 0.0f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glColor3f(0.0f, 1.0f, 0.0f); // Set The Color To Green
GL11.glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Top)
GL11.glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Top)
GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Bottom Left Of The Quad (Top)
GL11.glVertex3f( 1.0f, 1.0f, 1.0f); // Bottom Right Of The Quad (Top)
GL11.glColor3f(1.0f, 0.5f, 0.0f); // Set The Color To Orange
GL11.glVertex3f( 1.0f,-1.0f, 1.0f); // Top Right Of The Quad (Bottom)
GL11.glVertex3f(-1.0f,-1.0f, 1.0f); // Top Left Of The Quad (Bottom)
GL11.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Bottom)
GL11.glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Bottom)
GL11.glColor3f(1.0f, 0.0f, 0.0f); // Set The Color To Red
GL11.glVertex3f( 1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Front)
GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Front)
GL11.glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Front)
GL11.glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Front)
GL11.glColor3f(1.0f, 1.0f, 0.0f); // Set The Color To Yellow
GL11.glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Back)
GL11.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Back)
GL11.glVertex3f(-1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Back)
GL11.glVertex3f( 1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Back)
GL11.glColor3f(0.0f, 0.0f, 1.0f); // Set The Color To Blue
GL11.glVertex3f(-1.0f, 1.0f, 1.0f); // Top Right Of The Quad (Left)
GL11.glVertex3f(-1.0f, 1.0f,-1.0f); // Top Left Of The Quad (Left)
GL11.glVertex3f(-1.0f,-1.0f,-1.0f); // Bottom Left Of The Quad (Left)
GL11.glVertex3f(-1.0f,-1.0f, 1.0f); // Bottom Right Of The Quad (Left)
GL11.glColor3f(1.0f, 0.0f, 1.0f); // Set The Color To Violet
GL11.glVertex3f( 1.0f, 1.0f,-1.0f); // Top Right Of The Quad (Right)
GL11.glVertex3f( 1.0f, 1.0f, 1.0f); // Top Left Of The Quad (Right)
GL11.glVertex3f( 1.0f,-1.0f, 1.0f); // Bottom Left Of The Quad (Right)
GL11.glVertex3f( 1.0f,-1.0f,-1.0f); // Bottom Right Of The Quad (Right)
GL11.glEnd();
rquad += 0.1;
```
Pictures:


|
OpenGL Z-Index Problem?
|
CC BY-SA 3.0
| 0 |
2011-05-28T02:54:55.950
|
2011-05-28T05:07:02.570
| null | null | 419,090 |
[
"java",
"opengl",
"z-index",
"lwjgl"
] |
6,159,484 | 1 | 6,159,545 | null | 6 | 5,393 |
I'm new to R programming and graphics. I'm trying to draw a graph but the (0,0) point is not at the right place. Can someone please tell me how to fix it? Thanks.

Here's my code:
```
layout(matrix(c(0,0,0,0,0,
0,1,3,2,0,
0,0,0,0,0), nc = 5, byrow = TRUE),
widths = c(lcm(2), 1, lcm(2), 1, lcm(2)),
heights = c(lcm(2), 1, lcm(2)))
layout.show(3)
box("outer", lty = "dotted")
plot.new()
plot.window(xlim=c(-200,0),ylim=c(0,21))
box()
axis(1)
axis(4)
rect(-113,0,0,1,col='cyan')
```
|
R plotting why not starting from (0,0)?
|
CC BY-SA 3.0
| 0 |
2011-05-28T03:31:53.733
|
2011-05-28T03:55:41.483
| null | null | 109,027 |
[
"r",
"plot"
] |
6,159,498 | 1 | 6,159,610 | null | 2 | 952 |
I have a table that looks like this:

And I need it to look like this, where net=gross-tare:

How do I do this?
---
I started by melting the data, then casting as columns, and then creating new columns for the net readings.
```
df_m <- melt(df, id = 1:3)
df_c <- cast(df_m, ... ~ variable + type)
df_c$wr_net <- df_c$wr_gross - df_c$wr_tare
df_c$wc_net <- df_c$wc_gross - df_c$wc_tare
df_c$tsa_net <- df_c$tsa_gross - df_c$tsa_tare
```
Which gives

But now I can't figure out how to melt this table to get the dataframe to look the way I need with a column for 'type' with values 'gross' and 'tare' and 'net'.
Is there an easier way? Am I barking up the wrong tree with melt/cast?
---
You can reproduce a small sample of my data using this...
```
df <- structure(list(train = structure(c(1L, 1L, 1L, 1L, 1L, 1L), .Label = "AC0485n", class = "factor"),
position = c(1L, 1L, 2L, 2L, 3L, 3L), type = structure(c(2L,
1L, 2L, 1L, 2L, 1L), .Label = c("gross", "tare"), class = "factor"),
wids_raw = c(24.85, 146.2, 26.16, 135, 24.7, 135.1), wids_corr = c(26.15,
145.43, 27.44, 134.43, 26, 134.52), tsa = c(24.1, 139.2,
25, 133.6, 24, 131.1)), .Names = c("train", "position", "type",
"wr", "wc", "tsa"), class = "data.frame", row.names = c(NA,
-6L))
```
|
Melting/casting my data into shape
|
CC BY-SA 3.0
| 0 |
2011-05-28T03:36:02.513
|
2015-12-03T21:48:54.480
|
2015-12-03T21:48:54.480
| 4,370,109 | 176,995 |
[
"r",
"reshape"
] |
6,159,702 | 1 | 6,159,735 | null | 38 | 82,703 |
I want to show a spinning wheel dialog while my app loads some data:

The spinning wheel dialog should show on a button click. I’m using the code below but it does now show the spinning wheel. What could be the problem?
```
public void CheckAccount(String username, String password) {
try {
final ProgressDialog progDailog = ProgressDialog.show(this,
"Progress_bar or give anything you want",
"Give message like ....please wait....", true);
new Thread() {
public void run() {
try {
// sleep the thread, whatever time you want.
sleep(1000);
} catch (Exception e) {
}
progDailog.dismiss();
}
}.start();
//getting data code here
//getting data code here
//getting data code here
//getting data code here
//getting data code here
} catch (Exception e) {
Log.e(LOG_TAG, e.getMessage());
PopIt("CheckAccountError", e.getMessage(), "Denied");
}
}
```
|
Show spinning wheel dialog while loading data on Android
|
CC BY-SA 3.0
| 0 |
2011-05-28T04:48:00.687
|
2018-12-06T04:36:44.577
|
2015-03-20T20:13:20.983
| 2,157,640 | 827,530 |
[
"java",
"android",
"dialog",
"loading",
"progress"
] |
6,159,740 | 1 | 6,159,797 | null | 0 | 92 |
Here's what I am trying to achieve:
I'm using MYSQLi objectively.
I connect to the database with:
```
<?php
$mysqli= new mysqli(
'xxxxx', #host
'xxxxx', #username
'xxxxx', #password
'xxxxx'); #database name
if ($mysqli->connect_error)
{
die("Connect Error: $mysqli->connect_error");
}
?>
```
I have an auto-incrementing ID field, a 'Title' Field, 'Description' field and a field which contains the URL to an image so I can use
```
<img src="<url from database>" alt="<title from database>" />
```
I need to have it formatted the same way as the picture and I'm stuck on how to separate the data so each row is formatted this way to form what will be a portfolio of artwork.
Doing this for a school project so any help is greatly appreciated.
|
Need help with displaying database content
|
CC BY-SA 3.0
| 0 |
2011-05-28T04:56:36.230
|
2011-05-28T05:11:39.240
|
2011-05-28T04:59:04.620
| 23,897 | 774,037 |
[
"php",
"html",
"css",
"database",
"mysqli"
] |
6,159,821 | 1 | null | null | 1 | 6,672 |
We are running a JAVA application in JBOSS with oracle.We have used Seam and Hibernate frameworks.The problem we are facing is,when we start tha application server the cpu utlizations increase and after one hour we found that CPU utilizaiton is close to 90%.It is bizarred and I am not able to identify the problem.
Please Help.Thanks in Advance.
Cheers,
Dwarak
|
Reason for aggresive CPU utilization by application server
|
CC BY-SA 3.0
| null |
2011-05-28T05:19:26.280
|
2011-06-02T11:00:23.350
|
2011-06-02T11:00:23.350
| 641,170 | 288,794 |
[
"java",
"performance",
"jboss",
"seam",
"cpu-usage"
] |
6,159,819 | 1 | 6,159,983 | null | 1 | 773 |
Thanks in advance...
i have a string array which i want to set in textview in proper alignment..
my textview is created dynamically..
my string is :
```
private String[] mDialogue =
{
"Copa de Agua 8 Oz\n"+
"Copa de Vino Tinto 6 Oz\n"+
"Copa de Vino Blanco 5 Oz\n"+
"Copa Flauta 5 Oz\n"+
"Copa Tulipan 6 Oz\n"+
"Copa Cocktail 5 Oz\n"+
"Copa Sour 5 Oz\n"+
"Copa Borgo–a 10 Oz\n"+
"Copa Licor 2 Oz\n"+
"Copa Sherry 3 Oz\n"+
"Copa Balon/Cognac 9-25 Oz\n"+
"Copa Champagne 5 Oz\n"+
"Copa Catavinos 3 Oz\n"+
"Vaso High Ball 8 Oz\n"+
"Vaso On the Rocks 6 Oz\n"+
"Vaso Collins/Tubo 10 Oz\n"+
"Vaso Pilsen 10 Oz\n"+
"Jarra de Cerveza 12 Oz",
"1 Mililitro 0,001 L\n"+
"1 Centilitro 0,01 L\n"+
"1 Decilitro 0,1 L\n"+
"2 Cucharadas 10 cc\n"+
"20 Cucharadas 10 cl\n"+
"1 Taza 236,5 cc\n"+
"1 Taza 23,6 cl\n"+
"1 Golpe 1 gota\n"+
"1 Chorro 10 gotas",
}
```
i set this string statically but for different layouts it doesn`t work properly..
when i run in my emulator its look like :i added screen shot for this..
is there any html format which i set my text in proper alignment..??
or if u have any kind of solution then please help me..
|
how do i set text alignment line by line in single textview
|
CC BY-SA 3.0
| 0 |
2011-05-28T05:18:26.750
|
2011-08-28T14:53:51.270
| null | null | 554,830 |
[
"android"
] |
6,159,949 | 1 | 6,165,985 | null | 4 | 6,268 |
I am trying to create a database with SQLite with c# then create a table insert data then close the connection. I have just downloaded System.Data.SQLite.dll lybrary and I am not sure how to use it. There are a lot of examples in the internet but all of them seem to have a database already. Or maybe I am doing something wrong.
It will be nice If I can have a short example to just create a database, table and basic query.
EDIT
I have tried the examples provided by the comments but I don't understand why I do get errors. Maybe I downloaded the wrong library?

|
SQLite basic example
|
CC BY-SA 3.0
| null |
2011-05-28T05:59:16.847
|
2013-04-30T15:27:53.453
|
2011-05-28T06:51:56.260
| 637,142 | 637,142 |
[
"c#",
"sqlite"
] |
6,159,998 | 1 | null | null | 1 | 542 |
I'm trying to install PHPUnit. I'm getting an error message that I need to update the version of Pear, but then when I try to do it, it says Nothing to update.
Any ideas what's happening here?

```
UPDATE - this is the output on `pear list`
=========================================
Package Version State
Archive_Tar 1.3.7 stable
Auth 1.6.4 stable
Auth_RADIUS 1.0.7 stable
Auth_SASL 1.0.4 stable
Benchmark 1.2.8 stable
Cache_Lite 1.7.9 stable
Console_CommandLine 1.1.3 stable
Console_Getopt 1.3.1 stable
Crypt_CHAP 1.5.0 stable
DB 1.7.13 stable
File_Passwd 1.1.7 stable
File_SMBPasswd 1.0.3 stable
HTML_Common 1.2.5 stable
HTML_QuickForm 3.2.12 stable
HTTP_Client 1.2.1 stable
HTTP_Request 1.4.4 stable
Log 1.12.6 stable
MDB 1.3.0 stable
MDB2 2.4.1 stable
Mail 1.2.0 stable
Mail_Mime 1.8.1 stable
Net_DIME 1.0.2 stable
Net_POP3 1.3.8 stable
Net_SMTP 1.5.2 stable
Net_Socket 1.0.10 stable
Net_URL 1.0.15 stable
Net_Vpopmaild 0.3.2 beta
PEAR 1.9.2 stable
Payment_DTA 1.4.1 stable
SOAP 0.12.0 beta
Structures_Graph 1.0.4 stable
XML_Parser 1.3.4 stable
XML_RPC2 1.0.8 stable
XML_Util 1.2.1 stable
```
|
Pear telling me to upgrade and then "Nothing to upgrade"
|
CC BY-SA 3.0
| null |
2011-05-28T06:13:29.460
|
2012-10-16T16:18:32.350
|
2011-05-28T08:34:22.617
| 577,455 | 577,455 |
[
"php",
"terminal",
"pear"
] |
6,160,353 | 1 | 6,212,774 | null | 7 | 2,101 |
How can I create buttons like this in silverlight. Do I need expression blend for this.
Since I need to use the modified buttons at many places in my application, should I do it as a user control?

|
Custom buttons in silverlight
|
CC BY-SA 3.0
| null |
2011-05-28T07:39:18.687
|
2011-06-02T09:57:24.387
|
2011-06-02T09:41:27.163
| 21,217 | 94,169 |
[
"silverlight",
"xaml",
"expression-blend"
] |
6,160,495 | 1 | 6,211,236 | null | 14 | 6,487 |
So, i'm trying to understand how the SVM algorithm works but i just cannot figure out how you transform some datasets in points of n-dimensional plane that would have a mathematical meaning in order to separate the points through a hyperplane and clasify them.
There's an example [here](http://www.cs.columbia.edu/~kathy/cs4701/documents/jason_svm_tutorial.pdf), they are trying to clasify pictures of tigers and elephants, they say "We digitize them into 100x100 pixel images, so we have x in n-dimensional plane, where n=10,000", but my question is how do they transform the matrices that actually represent just some color codes IN points that have a methematical meaning in order to clasify them in 2 categories?
Probably someone can explain me this in a 2D example because any graphical representation i see it's just 2D, not nD.
|
support vector machines - a simple explanation?
|
CC BY-SA 3.0
| 0 |
2011-05-28T08:16:02.587
|
2017-05-05T21:04:49.310
|
2011-06-02T06:33:14.010
| 21,234 | 479,493 |
[
"algorithm",
"linear-regression",
"svm"
] |
6,160,568 | 1 | 6,161,780 | null | 0 | 6,026 |
I am creating a Google Chrome extension that does some basic search based on the choices provided.
This is how it looks so far

The problem is that there is a lot of white space on the sides which does not look good, especially because this is a popup and overlays on the current page.
How can I make sure that the popup uses the minimum amount of space required?
|
How to restrict the size of a Google chrome extension popup?
|
CC BY-SA 3.0
| null |
2011-05-28T08:37:02.160
|
2012-03-29T06:04:32.593
| null | null | 113,124 |
[
"javascript",
"html",
"google-chrome",
"popup",
"google-chrome-extension"
] |
6,160,673 | 1 | 6,190,411 | null | 0 | 948 |
I am having that problem that my Jquery RateIt stars does not appear in IE. I have tested demos on the website for the RateIt plugin. And the stars works fine on the RateIt website.
My website: [http://www.vinderhimlen.dk](http://www.vinderhimlen.dk)
The Rateit plugin website: [http://rateit.codeplex.com](http://rateit.codeplex.com)
IE 9:

Firefox 4: 
|
JQuery RateIt plugin bug - Stars not showing in IE
|
CC BY-SA 3.0
| null |
2011-05-28T09:05:50.953
|
2011-05-31T16:09:28.150
|
2011-05-28T09:28:51.550
| 557,527 | 557,527 |
[
"javascript",
"jquery",
"ruby-on-rails",
"ruby-on-rails-3",
"internet-explorer"
] |
6,160,745 | 1 | 6,161,163 | null | 2 | 2,962 |
Is this possible to have external mercurial repository in redmine just like svn?
For svn i've got following configoration options and it work with external repos:

For mercurial i can only enter local path to repository:

|
External mercurial repository in redmine?
|
CC BY-SA 3.0
| null |
2011-05-28T09:20:35.947
|
2011-05-28T10:49:41.440
| null | null | 708,764 |
[
"mercurial",
"redmine"
] |
6,161,351 | 1 | 6,161,520 | null | 5 | 2,510 |
I'm making an interface for the AR Drone Quadcopter in WPF.
I neen some stuff on my HUD to make it usable.
One of the more advanced controls on the HUD is the artificial horizon, which tells the pilot the craft's current alignment to the horizon.
I have these 3 PNGs



The first image I will move (The current pitch of the craft) and rotate (The current roll of the craft).
I will put the second image over the first, this one will only rotate around the center axis, it has ticks at certain degrees which will visualize the craft's roll even more.
The last one I will put on top of the second, this image just a visual improver.
Then I want to mask first image so that you only see whats inside the circle in image 2.
Last but not least I want to add a textblock to it and display the current altitude
The result will look something like this

I know how to rotate and move the image, but how do I place the images on top of each other, and how do I mask the first image?
edit: Thanks to Ben I've gotten this far:

But I also need to translate the image Y position (The pitch of the aircraft)

When I add the translate transform I also translate the Clip (Mask) how can I translate the image without moving the mask?
|
Creating an advanced HUD
|
CC BY-SA 3.0
| 0 |
2011-05-28T11:28:52.447
|
2013-10-23T06:59:21.840
|
2013-10-23T06:59:21.840
| 548,048 | 548,048 |
[
"wpf",
"hud"
] |
6,161,566 | 1 | 6,217,000 | null | 2 | 838 |
I need to flip a div panel left once a some item div get clicked and hide,once item div get clicked again. (exactly like new twitter reading panel).
i have tried several methods but i couldn't animate it smooth.
recently i identified it not happen smoothly because of the bad what have i done.i increased width of outter div and decrese width.
are there any good suggestion or code snippet to work my need??
Here is the code that i have used for animate and gt show the more read div panel
```
$("#more-item").animate({"width": "toggle"}, { duration: 500,specialEasing: {width: 'linear', height: 'easeOutBounce'} });
```
Here is the scenario that i need to see.
```
1. clicked on item div
2. more read div panel animate and flip to left and show the
3. click again item div
4. more read div panel animate and flip right and hide
```
when we at third point if we again click another item div just load content of recent clicked div instead animate and hide the more read div
here is the screen shot what my need functioning on new twitter reading panel.

|
How to fix Jquery sliding panel issue?
|
CC BY-SA 3.0
| 0 |
2011-05-28T12:13:20.053
|
2011-06-02T15:58:10.873
|
2011-05-30T04:09:39.387
| 301,502 | 301,502 |
[
"javascript",
"jquery",
"html"
] |
6,161,629 | 1 | 6,166,575 | null | 1 | 267 |
I am having rating widget with style, It is displayed good in some devices but having the problem with some devices like with HTC
My xml is :
```
<LinearLayout android:layout_width="fill_parent"
android:id="@+id/linearLayout3"
android:gravity="left|center_vertical|center_horizontal"
android:orientation="horizontal"
android:layout_height="wrap_content">
<RatingBar android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:numStars="5" android:stepSize="0.1"
android:layout_weight="0.1"
style="?android:attr/ratingBarStyleIndicator"
android:id="@+id/ratingbar_incident"
android:isIndicator="false"/>
<TextView android:id="@+id/textViewVote"
android:layout_height="wrap_content"
android:layout_marginLeft="1dip"
android:textColor="@color/black"
android:text="(0 votes)" android:layout_width="wrap_content"/>
</LinearLayout>
```
.
How to resolve this issue?
|
Rating is not correctly displaying in HTC
|
CC BY-SA 3.0
| 0 |
2011-05-28T12:25:05.020
|
2011-05-29T10:56:53.533
|
2011-05-29T10:56:53.533
| 443,075 | 443,075 |
[
"android",
"widget",
"rating"
] |
6,161,755 | 1 | 6,161,857 | null | 2 | 916 |
When we use Google Maps, after we search something, Google will add a marker in the map. When we click on this marker, a detailed information window will show, just like this :

I search the "white house",then it create a marker "A".
This is not difficult. However I found something more interesting:
In the map view, even we do not search anything, when the map zoom to some specified level, there will be some anchors generated. If the mouse over it or click it, it will show something accordingly, see the image:

Here see the point "14H and F st NW". I did not search for it, but it show me an anchor. When I click it, it show me a information window accordingly.
But when I use Firebug to see what is downloading, I found that they are just images. I can not find any `<a>` tag in the HTML.
Also, through Firebug, I found when the map level changed, the browser will send a request to the server to get the features inside the current map view. The response are JSON format. It contain the location and name of the features, then it add the anchors in the map.
But I wonder how do they implement it?
---
---
Possible manner to implement this:
1)when the map zoom or pan,request feature location data from server,suppose they get the following data(just take the white house for example):
data:{{name:'white house',Latitude:-77 longitude:38}}
2)bind mouse over event to the map div,something like this:
```
$("#map").mousemove(function(e){
for(var i=0;i<data.length;i++){
if(e.clientX=getImageX(data[i].x) && e.clientY=getImageY(data[i].y)){
//it mean that the mouse is overing this feature,now set the cousor and show the tip
//show tip,see the iamge:
}
}
});
```

3)bind the click event to the map div"
```
$("#map").mousemove(function(e){
for(var i=0;i<data.length;i++){
if(e.clientX=getImageX(data[i].x) && e.clientY=getImageY(data[i].y)){
//it mean that the mouse is clicking this feature,show the infomation window
//show tip,see the iamge:
}
}
});
```
The above is what I can thougth until now. But it seems that it is not enough, there are still some problems:
1) The tip can information window can show only if the user click or mouser over the very point which is the same as the Latitude and longitude of the feature,but in google Map,you will find that if the mouse over the marker(at any point of the marker),the tip will show. The area which will cause the tip show is the same as the the area of the marker.
It seems that google do someting like this:
```
$("#map").mousemove(function(e){
for(var i=0;i<data.length;i++){
if(e.clientX.insideTheMarker(data[i]) && e.clientY=insideTheMarker(data[i])){
//it mean that the mouse is clicking this feature,show the infomation window
}
}
});
```
But the marder size is not the same,how do they caculate the real area which will make the tip show?
2)in the eventhandle function,I haev to iterator all the features to see if the current mouse's location is match with any of the feature,if the featrues in current map view is so many,so it must cause performance problem.
|
How do add anchor in the image dynamically
|
CC BY-SA 3.0
| 0 |
2011-05-28T12:52:02.507
|
2011-05-29T03:47:32.970
|
2011-05-29T03:47:32.970
| 306,719 | 306,719 |
[
"javascript",
"google-maps",
"google-maps-markers"
] |
6,161,786 | 1 | 6,162,310 | null | 9 | 12,212 |
I have an image like:

When I load the image to uiimageview and then adding as a subview to uiscrollview, at start the image is showing like:

The problem is I want to see all the image fit to screen at start but it is showing already zoomed. Is there a way to handle this please help ...
I have the code like:
```
[self.view addSubview:scrollView];
UIImageView *tempImageView =
[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Tree.jpg"]];
self.imageView = tempImageView;
[tempImageView release];
[scrollView setContentMode:UIViewContentModeScaleAspectFit];
[imageView sizeToFit];
scrollView.backgroundColor=[UIColor blackColor];
scrollView.contentSize = imageView.frame.size;
scrollView.minimumZoomScale = scrollView.frame.size.width / imageView.frame.size.width;
scrollView.maximumZoomScale = 4.0;
[scrollView setZoomScale:1.0];
scrollView.clipsToBounds = YES;
scrollView.delegate = self;
[scrollView addSubview:imageView];
```
|
UIImage Is Not Fitting In UIScrollView At Start
|
CC BY-SA 3.0
| 0 |
2011-05-28T12:58:00.897
|
2013-04-22T15:49:13.060
|
2011-05-28T13:17:19.663
| 743,793 | 743,793 |
[
"iphone",
"uiscrollview",
"uiimageview",
"uiimage"
] |
6,161,804 | 1 | 6,162,321 | null | 3 | 404 |
I am developing an Android app.
I have a custom button with a .9.png as background, it is perfect in the UI tool in Eclipse, shown here:

but on phone it's like this:

As you can see this is very jaggy(not sure I use the correct word)
and this is my 9-patch file:

I know I can replace this simple button with an Shape XML drawable, but does anyone know what may be causing this problem and how to solve it?
|
Jags in .9.png buttons in Android!
|
CC BY-SA 3.0
| 0 |
2011-05-28T13:01:16.823
|
2011-05-28T14:48:50.557
| null | null | 501,963 |
[
"android",
"user-interface",
"button"
] |
6,161,843 | 1 | 6,161,923 | null | 0 | 621 |
I have the following classes:
```
class cManipulator : public cEditor
{
public:
cManipulator( ICanvas *canvas, cCompositeRoot* obj );
~cManipulator();
private:
....
class VisitorSetProp* m_SetVisitor;
class VisitorGetProp* m_GetVisitor;
}
cManipulator::cManipulator( ICanvas* canvas, cCompositeRoot* obj ) :
...
{
...
m_SetVisitor = new VisitorSetProp (this);
m_GetVisitor = new VisitorGetProp (this);
}
cManipulator::~cManipulator()
{
delete m_SetVisitor;
delete m_GetVisitor;
}
class VisitorSetProp : public Visitor
{
public:
......
}
class VisitorGetProp : public Visitor
{
public:
....
}
```
What the variant on UML class diagram is right?

or

|
Notation of UML class diagram
|
CC BY-SA 3.0
| null |
2011-05-28T13:12:25.493
|
2011-06-10T14:36:19.570
|
2011-05-28T13:56:34.977
| 490,908 | 490,908 |
[
"c++",
"uml",
"class-diagram"
] |
6,161,881 | 1 | 6,161,938 | null | 3 | 141 |
I have `ItemControl`
It displays for each record inside `ObservableCollection`.
My Problem is….
When size of ObservableCollection increase window can’t accommodate more panels so it displays
So criteria, One panel for each record inside ObservableCollection,couldn't be accomplish.
So, I need to have scroll bar so I can access each panel.
How does it can be implement?
See one screen shot below and [Code](https://docs.google.com/document/d/1JA5EWd66K7lI3G2rlno0mjO1dvz1VR131hfIbH0i12s/edit?hl=en_US&authkey=CNWwr7EF#) of It Here

Thanks......
|
Scroll bar, if Items exceed inside itemControl
|
CC BY-SA 3.0
| null |
2011-05-28T13:19:21.867
|
2011-05-28T13:29:46.947
| null | null | 468,968 |
[
"c#",
".net",
"wpf"
] |
6,161,917 | 1 | 6,161,929 | null | 0 | 504 |
I have an Achievement dialog, and would like this:

And this is my code, each achievement is a relative layout, and all are contained in a LinearLayout (pnlAchievement):
```
RelativeLayout pnlItem = new RelativeLayout(Parent);
pnlItem.setLayoutParams(new LayoutParams(LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT));
TextView txtItemName = new TextView(Parent);
txtItemName.setText(ACHIEVEMENTS_NAME[i]);
txtItemName.setLayoutParams(new LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));
TextView txtAchived = new TextView(Parent);
txtAchived.setText(Achived[i] ? "Achieved!" : "Not Achieved!");
RelativeLayout.LayoutParams rlpAchived = new RelativeLayout.LayoutParams(
new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
rlpAchived.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
rlpAchived.addRule(RelativeLayout.ALIGN_RIGHT, txtItemName.getId());
txtAchived.setLayoutParams(rlpAchived);
TextView txtDescription = new TextView(Parent);
txtDescription.setText(ACHIEVEMENTS_DESCRIPTION[i]);
txtDescription.setHorizontallyScrolling(false);
RelativeLayout.LayoutParams rlpDesc = new RelativeLayout.LayoutParams(
new LayoutParams(LayoutParams.WRAP_CONTENT,
LayoutParams.WRAP_CONTENT));
rlpDesc.addRule(RelativeLayout.ALIGN_BOTTOM, txtItemName.getId());
rlpDesc.addRule(RelativeLayout.ALIGN_PARENT_LEFT);
txtDescription.setLayoutParams(rlpDesc);
pnlItem.addView(txtItemName);
pnlItem.addView(txtAchived);
pnlItem.addView(txtDescription);
pnlAchievement.addView(pnlItem);
```
It work well list all the achievements, but the description is NOT below the Name, it is OVER the Name, like this:

And, can you please tell me how to add the line between every item without using Canvas (this is not very important, but if there is, it's better)?
|
Programmatically RelativeLayout layouting issue
|
CC BY-SA 3.0
| null |
2011-05-28T13:26:19.380
|
2018-04-02T01:34:28.327
|
2018-04-02T01:34:28.327
| 1,033,581 | 653,457 |
[
"android",
"layout",
"android-relativelayout"
] |
6,161,944 | 1 | 6,162,428 | null | 8 | 2,386 |
I'm having an issue with trying to add a "quantity" to a product that a person is ordering. I've got a Products table, an orders table, an order_item table (which is a many-to-many table that contains the id's from both products and orders). I've got a dropdown box on the left which has the quantity that you want. The maximum value is the stock available in the system.
This is what the form looks like:

```
<form name ="order_form" method="post" action="add_order_action.php" enctype="multipart/form-data">
<table border=1 cellpadding=2 cellspacing=2>
<caption>Order Form</caption>
<tr>
<th align="right"> Property </th>
<th align="left"> Value </th>
</tr>
<tr>
<td class="col1"> Name </td>
<td class="col2"> <input type="text" name="customer" id ="customer" size=30> </td>
</tr>
<tr>
<td class="col1"> Address </td>
<td class="col2"> <input type="text" name="address" id ="address" size=30> </td>
</tr>
<tr>
<td class="col1"> Products </td>
<td class="col2">
<!-- Interests is an array of all interests in the database-->
{foreach $products as $product}
<select name="products[{$product.id}][quantity]" id ="quantities">
{section name=quantities start=0 loop=$product.stock + 1 step=1}
<option value="{$smarty.section.quantities.index}">{$smarty.section.quantities.index}</option>
{/section}
</select>
<input type="checkbox" name="products[{$product.id}][is_checked]" value="1">{$product.name}<br>
{/foreach}
</td>
</tr>
<tr>
<td colspan=2 align="center">
<input type="submit" name="submit" value="Submit">
<input type="reset" name="reset" value="Reset">
</td>
</tr>
</table>
</form>
```
The product names and stock numbers are both from the products table:
```
create table if not exists SEProducts
(
id int not null auto_increment primary key,
price double not null,
name varchar(30) not null,
stock int not null,
original_stock int not null,
sold_stock int not null
)ENGINE=INNODB;
```
Now, what I do is that I make an array from the product names that are checked. What I wanna do is associate the values from the dropdown menus, BUT ONLY IF THEY ARE ONE OF THE CHECKED VALUES. Additionally, if a value is checked, the quantity can't be 0. I'm probably doing this an extremely frustrating way but this is what I thought was the best. I could've done a text field but then you'd have to sanitise user input. That'd be okay if it works as opposed to this which doesn't =/
I add the orders by getting the product array:
```
<?php
include "includes/defs.php";
$customer = $_POST['customer'];
$delivery_address = $_POST['address'];
if (isset($_POST['products']))
{
$products = $_POST['products'];
}
else
{
$error = "An order must consist of 1 or more items.";
header("Location: list_inventory.php?error=$error");
exit;
}
$id = add_order($customer, $delivery_address, $products);
header("Location: order.php?id=$id");
exit;
?>
```
Then my add order function works like this:
```
function add_order($customer, $delivery_address, $products)
{
$connection = mysql_open();
$customer = mysql_escape_string($customer);
$delivery_address = mysql_escape_string($delivery_address);
$query = "insert into SEOrders (name, address, status) " .
"values ('$customer', '$delivery_address', 'New')";
$result = mysql_query($query, $connection) or show_error();
$id = mysql_insert_id();
foreach ($products as $product)
{
if ($product['is_checked'] != 0 && $product['quantity'] != 0)
{
$query2 = "insert into SEOrder_items (order_id, product_id, quantity) " .
"values ('$id', '$product.id', '$product.quantity')";
$result2 = mysql_query($query2, $connection) or show_error();
}
}
mysql_close($connection) or show_error();
return $id;
}
```
I was thinking I might have to do some JavaScript but I'm absolutely rubbish at that.
If I wasn't able to explain myself: Long story short; I need to add quantities to the products array but only if the products are checked and the quantity is > 0.
Thanks in advance,
Cheers :)
`db/SEOrder_items``SEOrder_items_ibfk_2``product_id``SEProducts``id`
|
PHP, MySQL - Associating a checkbox with a dropdown
|
CC BY-SA 3.0
| 0 |
2011-05-28T13:30:50.613
|
2012-09-10T13:05:51.623
|
2011-05-29T04:41:31.137
| 700,005 | 700,005 |
[
"php",
"mysql",
"html",
"drop-down-menu",
"associative-array"
] |
6,162,027 | 1 | 6,162,043 | null | 0 | 839 |
I have the following class cDrawObjectCreator:
```
class cDrawObjectCreator
{
public:
cDrawObjectCreator( cCompositeRoot *compositeObject ) { m_compositeRoot = compositeObject; }
~cDrawObjectCreator() {};
...
private:
cCompositeRoot *m_compositeRoot;
};
```
It is correct diagram?

or the following diagram is correct?

|
Notation of UML class diagram
|
CC BY-SA 3.0
| null |
2011-05-28T13:49:39.610
|
2011-05-29T04:34:21.607
|
2011-05-28T13:53:17.533
| 153,545 | 490,908 |
[
"c++",
"oop",
"uml",
"class-diagram"
] |
6,162,031 | 1 | 6,162,035 | null | 0 | 43 |
Suddenly a page in my asp.net mvc 2 cms starts crashing and give output like this

I dont have any clue why its stop working. Does any body knows?
My application is on asp.net mvc-2, c#, SQL Server 2008
|
Weird issue in cms base application
|
CC BY-SA 3.0
| null |
2011-05-28T13:50:15.713
|
2011-05-28T13:51:26.597
| null | null | 347,790 |
[
"c#",
"sql-server-2008",
"asp.net-mvc-2",
"content-management-system"
] |
6,162,801 | 1 | 6,169,871 | null | 2 | 178 |
in developing a more complicated script I am having a rather odd problem with Safari. I use 5.0.5 Win if it matters. I rely on jQuery's position().left when the browser window gets resized to reposition a position:fixed element. Depending on wether the window is being enlarged or shrinked I get different results for position().left though because of some odd element being rendered by Safari at that moment (and only at that very moment).
I wrote a demo page that shows the problem.

Load the source below in Safari in windowed mode and shrink the window a bit. The alert will make things freeze so that you will see the the odd element that troubles me in the top left corner of the document.
What on earth is that, where does it come from and how do I get around it?
Thanks.
```
<!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="de" lang="de">
<head>
<style type="text/css">
#test{
width:500px;
height:2000px;
margin: 0 auto;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5.js"></script>
<script type="text/javascript">
// <![CDATA[
function resizeWindow( e ) {
alert($('#test2').position().left);
};
$(window).bind("resize", resizeWindow);
// ]]>
</script>
</head>
<body>
<div id="test"><div id="test2">Something
</div></div>
</body></html>
```
|
Safari inserts an odd object into the DOM when shrinking window that messes up jQuery's position() results
|
CC BY-SA 4.0
| 0 |
2011-05-28T16:09:37.647
|
2018-12-07T00:51:19.780
|
2018-12-07T00:51:19.780
| 748,777 | 748,777 |
[
"javascript",
"jquery",
"html",
"browser",
"safari"
] |
6,162,836 | 1 | 6,162,879 | null | 1 | 4,629 |
I am using the D3DXSPRITE method to draw my map tiles to the screen, i just added a zoom function which zooms in when you hold the up arrow, but noticed you can now see gaps between the tiles, here's some screen shots
normal size (32x32) per tile

zoomed in (you can see white gaps between the tiles)

zoomed out (even worst!)

Here's the code snipplet which I translate and scale the world with.
```
D3DXMATRIX matScale, matPos;
D3DXMatrixScaling(&matScale, zoom_, zoom_, 0.0f);
D3DXMatrixTranslation(&matPos, xpos_, ypos_, 0.0f);
device_->SetTransform(D3DTS_WORLD, &(matPos * matScale));
```
And this is my drawing of the map, (tiles are in a vector of a vector of tiles.. and I haven't done culling yet)
```
LayerInfo *p_linfo = NULL;
RECT rect = {0};
D3DXVECTOR3 pos;
pos.x = 0.0f;
pos.y = 0.0f;
pos.z = 0.0f;
for (short y = 0;
y < BottomTile(); ++y)
{
for (short x = 0;
x < RightTile(); ++x)
{
for (int i = 0; i < TILE_LAYER_COUNT; ++i)
{
p_linfo = tile_grid_[y][x].Layer(i);
if (p_linfo->Visible())
{
p_linfo->GetTextureRect(&rect);
sprite_batch->Draw(
p_engine_->GetTexture(p_linfo->texture_id),
&rect, NULL, &pos, 0xFFFFFFFF);
}
}
pos.x += p_engine_->TileWidth();
}
pos.x = 0;
pos.y += p_engine_->TileHeight();
}
```
|
2D tile based game, shows gaps between the tile sprites when I zoom in with the camera?
|
CC BY-SA 3.0
| 0 |
2011-05-28T16:16:18.760
|
2018-05-07T17:02:32.163
| null | null | 394,242 |
[
"c++",
"direct3d",
"direct3d9"
] |
6,162,841 | 1 | 6,163,328 | null | 2 | 2,290 |
Before asking, I tried to search the answer for my question, buf I couldn't find.
My question is about changing edge direction in dot diagram. Rankdir is 'LR', but in certain part of graph, I want to use 'TB'. Let me give an example.
it gives out graph like this

But, this is not what I want.
I want the following image. "thread" is above "ui_thread" vertically.

You may think it can be solved easily using "rankdir=same" with "thread" and "ui_thread".
I sure tried this already. but I failed. "thread" is always below "ui_thread".
thanks,
|
how can I adjust direction of edge in dot diagram?
|
CC BY-SA 3.0
| 0 |
2011-05-28T16:16:48.240
|
2011-05-28T17:42:34.690
| null | null | 507,229 |
[
"graphviz",
"dot"
] |
6,163,227 | 1 | 6,241,957 | null | 8 | 2,722 |
I want to implement a fancy scroll bar for a multiline textbox like the picture below:

Any ideas for that fancy scroll bar?
P/S: I want vb.net solution.
|
How to implement fancy scroll bar for multiline textbox?
|
CC BY-SA 3.0
| 0 |
2011-05-28T17:26:43.257
|
2013-07-03T21:14:25.847
|
2013-07-03T21:14:25.847
| 488,657 | 774,411 |
[
".net",
"vb.net",
"winforms",
"scrollbar"
] |
6,163,312 | 1 | 6,163,496 | null | 4 | 2,080 |
I'm trying to create a trapeze like shape using any number of techinques so that it will be as much as possible. the shape i'm trying to create a shape like this:

(there will be content inside the shape [imgs & txt])
so far, the possible ways of doing that are: masking (webkit) and SVG effects on html content (firefox). but I cant seem to find any way to make this work with IE and opera.
So if anyone could show me how to do this, it will be greatly appreciated.
|
Creating complex shapes using CSS
|
CC BY-SA 3.0
| null |
2011-05-28T17:40:02.397
|
2012-03-12T22:46:44.710
|
2020-06-20T09:12:55.060
| -1 | 324,628 |
[
"css",
"cross-browser"
] |
6,163,431 | 1 | null | null | 1 | 238 |
I have a custom tooltip displaying on a graph. The tooltip arrow mark is to the right of where it should display. What am I doing wrong?
Please see the image here:

[http://imageshack.us/photo/my-images/13/arrowmark.png/](http://imageshack.us/photo/my-images/13/arrowmark.png/)
This is my CSS:
```
.mouse-value {
font-size: 14px;
font-weight:bold;
}
.mouse-value:after {
content: "";
border-color: #FFFF99 transparent transparent transparent;
border-style: solid;
border-width: 20px;
width: 0;
height: 0;
position: absolute;
bottom: -40px;
left: 10px
}
```
|
Custom tooltip not displaying in correct position
|
CC BY-SA 3.0
| null |
2011-05-28T17:59:39.290
|
2011-05-29T02:26:09.403
|
2011-05-28T18:01:19.797
| 451,969 | 675,179 |
[
"css"
] |
6,163,606 | 1 | 6,165,657 | null | 12 | 572 |
I am experiencing a problem with Swing that only occurs when the computer monitor is powered off, but my Swing application continues to run in the background. It seems that whenever the monitor is off, Swing/AWT cancels all painting operations, leading to a number of display issues in the GUI that are visible as soon as the monitor turns back on.
For example, when I turn off the monitor using a custom JNI function and subsequently open a simple message dialog, the message dialog is blank when the monitor turns back on:

But it paints correctly after the next repaint:

Is this the expected behavior of Swing? Is there a way to instruct Swing to continue drawing to the screen even if the monitor is powered off?
Here is an SSCCE:
```
package test;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;
public class App {
public static void main(String[] args) throws Throwable {
System.out.println("***** Please turn off the monitor in the next 70 seconds *****");
Thread.sleep(1000L * 70);
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
JOptionPane.showMessageDialog(null, "Test");
}
});
}
}
```
I am using 64-bit Windows 7 Home Premium SP1 and 64-bit Java 1.6.0_24.
Here is another program with which I experience the effect of "canceled painting operations":
```
package test;
import static com.mycompany.Util.turnOffMonitors;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.SwingUtilities;
public class DialogTest extends JDialog {
private final JLabel label;
public DialogTest() {
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
label = new JLabel("Test", JLabel.CENTER);
label.setOpaque(true);
Container contentPane = getContentPane();
contentPane.setLayout(new BorderLayout());
contentPane.add(BorderLayout.CENTER, label);
this.setPreferredSize(new Dimension(200, 110));
pack();
setLocationRelativeTo(null);
setVisible(true);
Thread t = new Thread() {
@Override
public void run() {
turnOffMonitors();
try {
Thread.sleep(3000L);
} catch (InterruptedException ex) { }
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
label.setBackground(Color.YELLOW);
}
});
}
};
t.start();
}
public static void main(String[] args) throws Throwable {
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new DialogTest();
}
});
}
}
```
Before the monitor shuts off, I see:

With the monitor off, the label background color is changed to yellow in the background. I then move the mouse to turn the monitor back on. The dialog is visually unchanged. It is only after I force a repaint (by ALT-TABbing, for example) do I see the yellow:

Reported to Oracle as [Bug ID 7049597](http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=7049597).
|
Does AWT/Swing cancel painting operations if the monitor is off?
|
CC BY-SA 3.0
| 0 |
2011-05-28T18:27:52.733
|
2011-05-31T16:20:18.227
|
2011-05-31T16:20:18.227
| 758,201 | 758,201 |
[
"java",
"swing",
"awt",
"repaint"
] |
6,163,655 | 1 | 6,164,591 | null | 1 | 745 |
In the below picture, the value of cell `B5` comes from a drop down menu of items.
I need a formula in C5 that will capture the following logic:
```
If B5 is 'Standard', C5 is 5.
If B5 is 'Square', C5 is 17.
If B5 is 'Large Landscape', C5 is 29.
etc...
```

|
On google-spreadsheet, is there a formula that equates to multiple if statements?
|
CC BY-SA 3.0
| 0 |
2011-05-28T18:35:11.150
|
2015-09-04T05:30:34.157
|
2015-09-04T05:30:34.157
| 1,505,120 | 290,150 |
[
"google-sheets",
"gs-vlookup"
] |
6,163,817 | 1 | null | null | 1 | 152 |
```
var query = from r in data.AsEnumerable()
select new Test
{
Name = r.Field<string>(0),
DateReported = r.Field<DateTime>(2)
};
var newQuery = from i in query
orderby i.Name, i.DateReported
select i;
myData.DataContext = newQuery;
```
So The problem is, I am reading an Excel Sheet and iteration over the values. If I bind the DataContext to the DataGrid using query then everything works fine. But when i bind it to the newQuery each Item gets outputted twice

|
LINQ Outputting The Values Twice in DataGrid
|
CC BY-SA 3.0
| null |
2011-05-28T19:06:17.463
|
2011-06-01T16:12:59.397
| null | null | 275,561 |
[
"c#",
"linq",
"datagrid"
] |
6,164,227 | 1 | 6,164,294 | null | 0 | 465 |
I have Eclipse for PHP developers installed, which I need. However, I also want to do Java/JUnit development. I'm expecting to see "File -> New -> JUnit test case", but it's not there.
Am I crazy? I've tried looking through the Eclipse Marketplace but I don't see it there either. I've downloaded the junit4.9b .JAR, and included it in my project, but I'm looking for that nice JUnit view in Eclipse, and the integrated way of running JUnit tests.
I also found this:
[http://www.eclipse.org/downloads/download.php?file=/technology/swtbot/helios/dev-build/org.eclipse.swtbot.eclipse.test.junit4-2.0.4.20110304_0338-e5aff47-dev-e36.zip](http://www.eclipse.org/downloads/download.php?file=/technology/swtbot/helios/dev-build/org.eclipse.swtbot.eclipse.test.junit4-2.0.4.20110304_0338-e5aff47-dev-e36.zip)
... but not sure (a) if this is what I need, and (b) if so, how to install it.
My "File -> New" menu looks like this image:

|
I installed Eclipse for PHP, but want to add Java/JUnit
|
CC BY-SA 3.0
| null |
2011-05-28T20:40:18.470
|
2011-05-28T20:54:09.380
|
2011-05-28T20:48:02.850
| 249,543 | 249,543 |
[
"eclipse",
"junit"
] |
6,164,297 | 1 | 6,164,381 | null | 1 | 1,144 |
I am trying to get the hang of how to do animations using WPF XAML. I'm struggeling to get my animation to trigger based on the right conditions and now I need some help.
Just for laughs I want to make a page with a button that will dodge any attempt to be pressed by moving to a different place on the canvas. Here is an illustration of my desired animations:

I want to solve the problem simply using XAML (and no code-behind), but I am open to a solution which uses code if the code is accompanied with an explanation of why this can not be solved simply by declaring the appropriate XAML.
This is what I have so far:
```
<Page x:Class="myApp.SecondPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
xmlns:c="clr-namespace:myApp"
d:DesignHeight="300" d:DesignWidth="500"
Title="SecondPage" Height="300" Width="500">
<Page.Resources>
<PathGeometry x:Key="AnimationPath" Figures="M 0,0 C -130,-100 -130,-60 -130,-0"/>
<Style x:Key="secondButton" TargetType="Button">
<Setter Property="Content" Value="Button"></Setter>
<Style.Triggers>
<MultiTrigger >
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"></Condition>
<!--Doesn't work --><Condition Property="TranslateTransform.X" Value="0"></Condition>
</MultiTrigger.Conditions>
<MultiTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimationUsingPath x:Name="XAnim"
FillBehavior="HoldEnd"
Storyboard.TargetProperty="RenderTransform.X"
PathGeometry="{StaticResource AnimationPath}"
Source="X"
Duration="0:0:.2"
/>
<DoubleAnimationUsingPath x:Name="YAnim"
FillBehavior="HoldEnd"
Storyboard.TargetProperty="RenderTransform.Y"
PathGeometry="{StaticResource AnimationPath}"
Source="Y"
Duration="0:0:.2"
/>
</Storyboard>
</BeginStoryboard>
</MultiTrigger.EnterActions>
</MultiTrigger>
</Style.Triggers>
</Style>
</Page.Resources>
<Grid>
<Canvas HorizontalAlignment="Stretch" Name="MyCanvas" VerticalAlignment="Stretch" IsManipulationEnabled="True">
<Button Style="{StaticResource secondButton}" Canvas.Left="150" Canvas.Top="240" Height="48" x:Name="theButton" Width="115" FontSize="18" ForceCursor="False">
<Button.RenderTransform>
<TranslateTransform x:Name="AnimatedTranslateTransform"/>
</Button.RenderTransform>
</Button>
</Canvas>
</Grid>
```
In my second multitrigger condition I am trying to check where the button is (in order to start the right storyboard). I simply cannot seem to figure out which property and value to use in the condition to evaluate whether the button is on the or hand side. The `TranslateTransform.X` property doesn't work. Any suggestions?
|
WPF Windows Presentation Foundation Animation using MultiTrigger
|
CC BY-SA 3.0
| null |
2011-05-28T20:54:30.167
|
2011-05-28T21:18:24.340
| null | null | 619,275 |
[
"wpf",
"xaml",
"animation",
"multitrigger"
] |
6,164,522 | 1 | 6,164,534 | null | 3 | 361 |
>
[PHP: the ultimate clean/secure function](https://stackoverflow.com/questions/4223980/php-the-ultimate-clean-secure-function)
I found this code snippet here: [http://snipplr.com/view/12853/clean-variables-from-sql-injections/](http://snipplr.com/view/12853/clean-variables-from-sql-injections/)
The author claims:
> This little function helps to fight common security issue with SQL injections, it can sanitize any global variable like $POST, $GET, $_SERVER etc and escape unsafe characters.

```
function _clean($str){
return is_array($str) ? array_map('_clean', $str) : str_replace("\\", "\\\\"
, htmlspecialchars((get_magic_quotes_gpc() ? stripslashes($str) : $str)
, ENT_QUOTES));
}
//usage call it somewhere in beginning of your script
_clean($_POST);
_clean($_GET);
_clean($_REQUEST);// and so on..
```
Please enlighten me whether this is safe, 'cause it looks jury-rigged to me.
|
Will this code actually work against SQL-injection?
|
CC BY-SA 3.0
| 0 |
2011-05-28T21:43:23.503
|
2011-05-28T22:03:16.853
|
2017-05-23T10:34:35.053
| -1 | 650,492 |
[
"php",
"sql-injection"
] |
6,164,685 | 1 | 6,164,701 | null | 0 | 3,193 |
Using CSS, how can I display an image behind some text and also offset it on both the X and Y axis?
I have a design that is 950px wide, so I'm wanting want this image to remain 'in sync' with the rest of the header by placing it in a container that is centered and also 950px wide.
My problem is that instead of the image being 'a layer behind' the header text, it is instead displaying the image in full and pushing the rest of the contents down.
Any help is greatly appreciated.

Thanks,
Andy.
|
Image Behind Header and Offset on X and Y
|
CC BY-SA 3.0
| null |
2011-05-28T22:18:07.570
|
2011-05-28T23:03:34.320
|
2011-05-28T22:46:52.170
| 382,134 | 382,134 |
[
"css",
"center",
"transparent"
] |
6,164,937 | 1 | 6,176,486 | null | 0 | 613 |
I have a database containing a table with an "Image" colum:

This column actually contains a long string encoded as HEX byte values.
I need to select all records where the string encoded by this column contains a certain substring. Pseudocode would be:
```
Select *
From SomeTable
Where dataColumnofTypeImage.ToString().Contains("somesubstring")
```
I tried to do this in Linq (LinqPad) using:
```
from z in Zanus
let p = z.Udata.ToArray() // z.Udata will be of type System.Linq.Binary so I want to make a byte array out of it...
where System.Text.ASCIIEncoding.ASCII.GetString(p).Contains("EXED")
select new
{
z.Idnr,
z.Udatum,
z.Uzeit,
z.Unr,
z.Uart,
z.Ubediener,
z.Uzugriff,
z.Ugr,
z.Uflags,
z.Usize,
z.Udata
}
```
But this does not work at all saying:
NotSupportedException: Method 'Byte[] ToArray()' has no supported translation to SQL.
I just cannot believe it would not be possible to check a binary datatype in a Where clause just as I might check some other datatype...
Can somebody help me out here?
|
Evaluate "image" SQL column in a query
|
CC BY-SA 3.0
| null |
2011-05-28T23:15:14.017
|
2011-05-30T12:47:56.743
| null | null | 101,812 |
[
"c#",
"sql",
"linq",
"linqpad"
] |
6,164,971 | 1 | null | null | 0 | 1,121 |
Following the instructions in my book, I altered my table twice. Both queries were reported as successful in the terminal. However, when I double check PHP MYAdmin the 'FK_project_user' doesn't show up. However, FK_user_project query does show up in database.
I'm not sure if I'm misunderstanding the intent of the SQL or if there's some problem. I deleted the table and redid the whole process over again and got same result.
Can anyone explain?
```
mysql> ALTER TABLE `tbl_project_user_assignment` ADD CONSTRAINT `FK_project_user` FOREIGN KEY (`project_id`) REFERENCES `tbl_project` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
Query OK, 0 rows affected (0.21 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> ALTER TABLE `tbl_project_user_assignment` ADD CONSTRAINT `FK_user_project` FOREIGN KEY (`user_id`) REFERENCES `tbl_user` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT;
Query OK, 0 rows affected (0.15 sec)
Records: 0 Duplicates: 0 Warnings: 0
```

|
successful MYSQL query not showing in Database?
|
CC BY-SA 3.0
| null |
2011-05-28T23:21:39.900
|
2011-05-28T23:29:31.383
| null | null | 577,455 |
[
"mysql",
"phpmyadmin"
] |
6,164,998 | 1 | 6,165,026 | null | 0 | 227 |

How does one create the triangle thing for a container that points to something? Is it photoshop?
|
How do you create this triangle thingy?
|
CC BY-SA 3.0
| null |
2011-05-28T23:26:53.393
|
2012-06-03T04:54:49.030
|
2012-06-03T04:54:49.030
| 825,789 | 773,804 |
[
"html",
"css",
"tooltip"
] |
6,165,103 | 1 | 6,165,848 | null | 5 | 347 |
I'm running Visual Studio 2010 Ultimate, and I'm working on a project hosted on CodePlex to which I connect through TFS. Each time I open the solution, VS prompts me for the account information.
Is there any way I can make VS remember my credentials, so I don't have to enter them each time?
This is currently the only project on TFS I'm working on, but to be future-proof I'd like to save the credentials on solution-level, so I can work on other projects on other TFS servers and have those accounts saved as well.

|
Visual Studio can't remember my account information for CodePlex TFS
|
CC BY-SA 3.0
| 0 |
2011-05-28T23:55:55.347
|
2011-05-29T03:51:15.553
| null | null | 38,055 |
[
"visual-studio-2010",
"tfs",
"credentials"
] |
6,165,239 | 1 | 6,165,347 | null | 4 | 9,844 |
Here is the code generating a plot of an xts object:
```
require("quantmod")
getSymbols("SPY")
plot(Cl(SPY))
```
Which yields the following plot:

Can you remove the y-axis values (the prices) from a plot of an xts object?
: `yaxt='n'` .
|
Remove y-axis label from plot of an xts object
|
CC BY-SA 3.0
| null |
2011-05-29T00:37:46.990
|
2012-10-26T07:24:39.240
|
2012-01-31T23:25:21.513
| 2 | 296,155 |
[
"r",
"plot",
"xts"
] |
6,165,466 | 1 | 6,165,610 | null | 0 | 242 |

User clicks on "Remote" button and then the following UITableViewController loads up:

The user then selects any value upon which I call:
```
[self.navigationController popViewControllerAnimated:YES];
```
to go back again to the previous UITableViewController (screen shot 1).
How do I add the selected value to the UITableViewController?
I hope I am making sense.
|
How to add a selected UITableViewController value to a previous UITableViewController?
|
CC BY-SA 3.0
| null |
2011-05-29T01:42:29.407
|
2011-05-29T07:52:12.290
| null | null | 323,698 |
[
"iphone",
"ios",
"uinavigationcontroller",
"uitableview"
] |
6,165,639 | 1 | 6,166,226 | null | 1 | 2,107 |
I have my development PC on Windows 7 for ASP.NET and running Visual Studio 2010 and IIS 7 (NOT using the development web server). I have created multiple websites on different ports on my PC. E.g. [http://localhost:8080](http://localhost:8080) points to Website A. But when I open the site in Visual Studio, the project name shows as [http://localhost:8080](http://localhost:8080), as follows.

I would like to change that name to [http://WebsiteA](http://WebsiteA) or [http://WebsiteA:8080](http://WebsiteA:8080). Some identification.
I edited hosts and added
127.0.0.1 WebsiteA
Ping works fine. Also browsing WebsiteA:8080 works fine. But when I try opening the site ([http://websitea:8080](http://websitea:8080)) in Visual Studio, it says Web site does not have Frontpage server extensions installed.
Is there any way to at least rename what's shown in the project list in Visual studio. I just need an identification on each website. I have about a dozen project and more may be added.
Thanks
|
Need to name websites on localhost running on different Ports
|
CC BY-SA 3.0
| 0 |
2011-05-29T02:35:30.817
|
2012-01-25T19:54:53.490
|
2011-05-29T03:31:24.337
| 161,633 | 161,633 |
[
"visual-studio-2010",
"windows-7"
] |
6,165,869 | 1 | 6,165,982 | null | 4 | 3,187 |
I want to group the records on its timestamp field Fortnightly. I am doing it weekly now but i want it to be fortnightly also. How do i do that ? Is there a specific way to do this like how we group by weeks using WEEK('timestamp','%d-%m-%Y') function ?
In the below image can you see date 21 and 14 coming up for fortnight 10. Any suggestions ?

|
Grouping mysql records fortnightly
|
CC BY-SA 3.0
| null |
2011-05-29T03:57:06.057
|
2020-08-21T12:25:20.130
|
2011-05-29T05:31:44.107
| 402,610 | 402,610 |
[
"mysql"
] |
6,166,070 | 1 | 6,167,505 | null | 1 | 263 |
I just started with Android and I'm doing a simple app that I want to look like this:
```
-------------------------------------------
| | | |
| T A B | T A B | T A B |
| SELECTED | | |
|-----------------------------------------|
| |
| VIEW FLIP CONTENT |
| |
| |
| |
| |
| |
| |
| |
| |
-------------------------------------------
```
That is, I have some tabs and each one has a view flip component. Which enables them to have internal "tabs". The problem is that with this configuration I have to run everything on a single Activity! Also, my layout is getting huge (see image attached). How can I solve this mess? Run each tab as a single activity?

|
Problem with huge android layout
|
CC BY-SA 3.0
| null |
2011-05-29T05:09:27.760
|
2011-05-29T11:29:08.973
|
2011-05-29T05:38:56.463
| 603,891 | 196,886 |
[
"android",
"performance",
"android-layout"
] |
6,166,134 | 1 | 6,166,282 | null | 0 | 88 |
I installed android in my new laptop. I keep getting the below error whenever I try open the "Android SDK and AVD manager" from the Window drag down menu in Eclipse IDE.

I have already set the path in the preferences of eclipse IDE.
|
Android Installation Error
|
CC BY-SA 3.0
| null |
2011-05-29T05:30:00.473
|
2011-05-29T06:26:20.157
| null | null | 421,730 |
[
"android"
] |
6,166,151 | 1 | 6,207,809 | null | 3 | 300 |
Following on from a [previous question](https://stackoverflow.com/questions/6148370/fluent-nhibernate-visual-designer), I am evaluating MindScape's NHibernate Designer.
When I add a many to many mapping, it says that it won't propagate this to the database..
Is there a way to map the many to many using this tool (a code generator). If I manually edit the mappings xml I lose it on changing the model.
The produced map:
```
<bag name='Roles' table='`RoleUser`'>
<key column='`UserId`' />
<many-to-many column='`RoleId`' class='Role' />
</bag>
```
I don't want to create an entity item_item and do a one to many on that link table as this should be done by the designer (adding an entity pollutes the business objects and is wrong).
Their [help documents](http://www.mindscapehq.com/help/nhdesigner/Index.aspx) say that this can happen if you set the source column name, and destination column name... Not working!

|
NHibernate Designer - many to many
|
CC BY-SA 3.0
| null |
2011-05-29T05:37:28.443
|
2011-06-01T22:22:09.520
|
2017-05-23T10:32:35.693
| -1 | 200,653 |
[
"nhibernate",
"nhibernate-mapping",
"many-to-many",
"designer"
] |
6,166,174 | 1 | 6,166,329 | null | -1 | 110 |
I have a requirement to create a view and the business scenario is explained below
Consider i am having table Products(all product information) and Settings(settings for a country/state/City)
Now i have to create a view which gives product information by considering settings, It might be possible to have cities/states/country have there own settings.
It means first i need to check
1. any city is having there custom settings then output those records
UNION ALL
2. any state is having there custom settings then output those records by excluding cities under this state in step 1
UNION ALL
3. any country is having there custom settings or not then output those records by excluding cities ans states records in step1 and step2
This is the design which i thought of, is there anything wrong in the design?
With this existing design its taking 5 minutes for a query to run without any indexes on view and base tables.
Now what is the best option for me to improve the performance.
Creating indexed views or create index on base tables? which one helps me to make the query run in seconds :)
Product Table

Settings table

Expected Output

|
Designing SQL view and improving Perfromance
|
CC BY-SA 3.0
| null |
2011-05-29T05:44:26.060
|
2011-05-29T06:48:57.050
|
2011-05-29T06:38:57.067
| 322,022 | 322,022 |
[
"tsql"
] |
6,166,484 | 1 | 6,166,585 | null | 3 | 2,367 |
How can I make all widgets shrink, if one of their children changed height?
They expand if new height is bigger, but don't shrink if smaller.
I tried `updateGeometry()`, but it changed nothing.
Here is example, after child element shran, parents' height don't change:

```
import sys
from PyQt4.QtGui import *
class MainWindow(QWidget):
def __init__(self, parent=None):
QWidget.__init__(self, parent)
# inner widget
self.widget = QGroupBox('inner')
vbox_inner = QVBoxLayout(self.widget)
button1 = QPushButton('100')
button1.clicked.connect(lambda: self.change_height(100))
vbox_inner.addWidget(button1)
button2 = QPushButton('200')
button2.clicked.connect(lambda: self.change_height(200))
vbox_inner.addWidget(button2)
# outer layout
vbox = QVBoxLayout(self)
vbox.addWidget(self.widget)
# resizing element
def change_height(self, height):
self.widget.setFixedHeight(height)
app = QApplication(sys.argv)
myapp = MainWindow()
myapp.show()
sys.exit(app.exec_())
```
Is there any way to adjust all parents widgets?
in Python:
```
widget = self.parent()
while widget:
widget.adjustSize()
widget = widget.parent()
```
|
shrink parents widgets after child size changed
|
CC BY-SA 3.0
| 0 |
2011-05-29T07:34:27.603
|
2011-05-29T08:47:18.023
|
2011-05-29T08:47:18.023
| 159,982 | 159,982 |
[
"python",
"qt",
"pyqt"
] |
6,166,637 | 1 | 6,311,375 | null | 13 | 703 |
The doc for `RegionFunction` states:

However, `RegionFunction` is not mentioned in the doc for `ListLinePlot`.
Trying to use it:

So, it seems a doc issue. Any ideas?
|
Mathematica: ListLinePlot & RegionFunction - a bug or a documentation issue?
|
CC BY-SA 3.0
| 0 |
2011-05-29T08:07:11.643
|
2011-08-24T04:12:23.977
|
2011-08-24T04:12:23.977
| 353,410 | 353,410 |
[
"wolfram-mathematica"
] |
6,166,795 | 1 | 6,186,968 | null | 8 | 52,806 |
I am trying to work with Eclipse Helios on my x64 machine (Im pretty sure now that this problem could occur with any eclipse) but it just doesn't cooperate.
When I try to run eclipse I get the following:

I have installed
- -
I have linked my Environment Variables up correctly and tried to compile a Java file through `cmd` and have succeeded.
Whenever I tried running eclipse i get `exit code=13 (required java version=1.5)`
`-vm "mypath\jdk1.6.025\jre\bin"`
command as forums suggested
as well as other paths
`-vm "mypath\jdk1.6.025\bin"`
`-vm "mypath\jdk1.6.025\jre\bin\javaw.exe"`
even
`-vm "mypath\jre6\bin"` out of desperation
to no avail.
---
I am all out of ideas and I wonder if anybody had this problem. I even downloaded the helios x86 version and x86 JDK version yet it did not fix the problem. (I changed the environment variables)
I changed everything back but I'm stuck...
[Cannot Run Eclipse](https://stackoverflow.com/questions/4945178/cannot-run-eclipse-jvm-terminated-exit-code-13)
|
Eclipse crashes at startup; Exit code=13
|
CC BY-SA 3.0
| null |
2011-05-29T08:53:04.073
|
2014-12-26T08:37:33.080
|
2017-05-23T12:01:11.803
| -1 | 774,972 |
[
"java",
"eclipse",
"java-6",
"exit-code"
] |
6,167,062 | 1 | 6,167,310 | null | 9 | 1,015 |
## QUESTION
---
I'm trying to replicate a Train Diagram like this one ([full size](http://www.nzetc.org/etexts/Gov06_07Rail/Gov06_07Rail046a.jpg)) using some train movement data of my own.

The graph looks to consist of...
1. Horizontal Axis: Time
2. Vertical Axis: Location
3. Lines: Delineate the path of individual trains
4. Colours: Not shown in the B&W image, but trains should be coloured separately
And my data looks like this...

Thanks for the help :)
---
Sample can be reproduced like so...
```
dat <- structure(list(id = structure(c(1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L,
1L, 1L, 1L, 1L, 1L, 1L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L, 2L,
2L, 2L, 2L, 2L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L, 3L,
3L, 3L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L, 4L,
5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 5L, 6L, 6L,
6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 6L, 7L, 7L, 7L, 7L,
7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 7L, 8L, 8L, 8L, 8L, 8L, 8L,
8L, 8L, 8L, 8L, 8L, 8L, 8L, 8L, 9L, 9L, 9L, 9L, 9L, 9L, 9L, 9L,
9L, 9L, 9L, 9L, 9L, 9L, 10L, 10L, 10L, 10L, 10L, 10L, 10L, 10L,
10L, 10L, 10L, 10L, 10L, 10L), .Label = c("2011U0024", "2011U0025",
"2011U0026", "2011U0035", "2011U0039", "2011U0040", "2011U0041",
"2011U0046", "2011U0047", "2011U0049"), class = "factor"), location = structure(c(1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L, 1L,
2L, 3L, 4L, 5L, 6L, 7L, 8L, 9L, 10L, 11L, 12L, 13L, 14L), .Label = c("a",
"b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n"
), class = "factor"), time = structure(c(1294079880, 1294093080,
1294094880, 1294100400, 1294102380, 1294124100, 1294125240, 1294126920,
1294129020, 1294140120, 1294140900, 1294143960, 1294145100, 1294146600,
1294086240, 1294100400, 1294105440, 1294111560, 1294114740, 1294137180,
1294138380, 1294140120, 1294141320, 1294152420, 1294158000, 1294158900,
1294160100, 1294162200, 1294100700, 1294113180, 1294115220, 1294120980,
1294134780, 1294153920, 1294155060, 1294156680, 1294158480, 1294169460,
1294170420, 1294171020, 1294171200, 1294173900, 1294290660, 1294307040,
1294308720, 1294313880, 1294315860, 1294342200, 1294344600, 1294345080,
1294347180, 1294358400, 1294360200, 1294360440, 1294360800, 1294364100,
1294348860, 1294361400, 1294363500, 1294369560, 1294379160, 1294405080,
1294407240, 1294407900, 1294409940, 1294421040, 1294421400, 1294421880,
1294423200, 1294425240, 1294364100, 1294378200, 1294380180, 1294385700,
1294388220, 1294414500, 1294416600, 1294421040, 1294422720, 1294434720,
1294435500, 1294435920, 1294436400, 1294438920, 1294384440, 1294399440,
1294401120, 1294406520, 1294408800, 1294429560, 1294431960, 1294434720,
1294435980, 1294448160, 1294448340, 1294449360, 1294451400, 1294453500,
1294468860, 1294502640, 1294504020, 1294509360, 1294514520, 1294537980,
1294541400, 1294543920, 1294544640, 1294555860, 1294556520, 1294557120,
1294558200, 1294564860, 1294501680, 1294513560, 1294515300, 1294521120,
1294523820, 1294545960, 1294548780, 1294556820, 1294557420, 1294571580,
1294572000, 1294572420, 1294575600, 1294579500, 1294549080, 1294562460,
1294566300, 1294572180, 1294575420, 1294602180, 1294604520, 1294605300,
1294606020, 1294617060, 1294620540, 1294620720, 1294624800, 1294630080
), class = c("POSIXct", "POSIXt"), tzone = "")), .Names = c("id",
"location", "time"), row.names = c(NA, -140L), class = "data.frame")
```
|
R ggplot2 - Help Replicating Train Diagram
|
CC BY-SA 3.0
| 0 |
2011-05-29T09:58:23.230
|
2011-05-29T10:52:48.560
|
2011-05-29T10:52:48.560
| 602,276 | 176,995 |
[
"r",
"visualization",
"ggplot2"
] |
6,167,236 | 1 | 6,167,302 | null | 8 | 9,011 |
>
[Android How to draw a smooth line following your finger](https://stackoverflow.com/questions/8287949/android-how-to-draw-a-smooth-line-following-your-finger)
I'm new to Android and java programming and have been playing around a bit with mobile app development. I recently created a View which simply keeps draws lines in step with the user's finger movements. However, I've been having some trouble with the Canvas.drawLines method.
Instead of getting a continuous set of lines between all points I am getting more of a dashed pattern with breaks between segments:

Here is a sample set of data and simple code to reproduce the issue (point data was taken from a real finger swipe):
```
public class SomeView extends android.view.View
{
private float[] _data = { 292.36545f, 104.37576f, 285.3567f, 112.39249f, 274.34293f, 113.39456f, 254.3179f, 115.39874f, 248.3104f, 116.40082f, 228.28535f, 118.405f, 214.26784f, 119.407104f, 211.26408f, 119.407104f, 204.25533f, 120.40918f, 202.25282f, 120.40918f, 201.25157f, 121.411255f, 199.24907f, 124.41754f, 197.24657f, 125.41962f, 196.24532f, 130.43005f, 195.24406f, 139.44885f, 197.24657f, 144.45929f };
private Paint _paint;
public SomeView( Context c, AttributeSet attrs)
{
super( c, attrs );
_paint = new Paint();
_paint.setColor(Color.BLUE);
_paint.setStrokeWidth(6);
}
@Override
public void onDraw(Canvas canvas)
{
canvas.drawLines( _data, _paint);
}
}
```
After plotting out each point and overlaying it atop the line I realized that the problem is actually that each point is not being connected, only every two points. Instead of connecting point 1 to point 2 to point 3 and so on, the method is connecting 1 to 2 and then 3 to 4 as shown below:

I can get what I want by drawing calling `drawLines` again and providing an offset this time so that the other pairs are drawn together as well, but this seems inefficient and generally clunky to me, and the line still isn't completely smooth (gets slightly choppy on corners).
So, my question is; what am I doing wrong and how can I draw a simple, smooth line given some number of points? Heck, forget the points, if there is a better way to trace the user's finger with a line I am all ears. Thanks in advance.
|
Canvas.drawLines displaying disjointed segments
|
CC BY-SA 3.0
| 0 |
2011-05-29T10:40:36.997
|
2013-02-03T06:01:30.630
|
2017-05-23T12:08:54.160
| -1 | 1,053 |
[
"java",
"android",
"drawing",
"gesture"
] |
6,167,319 | 1 | 6,167,403 | null | 0 | 261 |
Goal:
To use entity framework with N-tier in my WPF application.
Problem:
When I tried solving the problem I always retrieve this error message:
> Error 1 Cannot implicitly convert type
'System.Collections.Generic.List'
to
'System.Collections.Generic.List' D:\Arbete\kurser\C#.NET\Labbar\Lab3\ny\MediaStore\DataAccessLibrary\ProductRepository\ProductRepository.cs 45 20 DataAccessLibrary
Just a little reminder:
I would like to the class Product to be flexible that also can be used in business and presentation layer.
```
namespace DataAccessLibrary.ProductRepository
{
public partial class Product
{
public Int32 ArticleNumber_id { get; set; }
public string Name { get; set; }
public decimal SalePrice { get; set; }
public decimal PurchasePrice { get; set; }
//public string Book_url { get; set; }
public Int32 ProductCategory_id { get; set; }
public Int32 Supplier_id { get; set; }
public Int32 Role_id { get; set; }
}
}
```
---
```
namespace DataAccessLibrary.ProductRepository
{
/// <summary>
/// Responsible for uppdating, adding, deleting, retrieving data from product list.
/// </summary>
public class Productrepository : IProductrepository
{
private List<Product> myProductList;
private MediaStoreEntities _myMediaStoreEntities = new MediaStoreEntities();
public Productrepository()
{
myProductList = new List<Product>();
}
/// <summary>
/// Retrieve all data from the product list
/// </summary>
/// <returns>A list with full of product data.</returns>
public List<Product> GetAllProductList()
{
var productListt = (from a in _myMediaStoreEntities.Products
select a).ToList();
return productListt;
//return productList;
}
}
}
```
---
Class: ProductRepository
Namespace: DataAccessLibrary.ProductRepository
```
/// <summary>
/// Retrieve all data from the product list
/// </summary>
/// <returns>A list with full of product data.</returns>
public List<Product> GetAllProductList()
{
var productListt = (from a in _myMediaStoreEntities.Products
select a).ToList();
return productListt;
//return productList;
}
```
---



|
Connection error with Entity framework and class product from data layer
|
CC BY-SA 3.0
| null |
2011-05-29T10:53:36.433
|
2011-05-29T11:33:11.877
|
2011-05-29T11:21:51.863
| 413,501 | 484,390 |
[
"c#",
"wpf",
"entity-framework",
"repository-pattern",
"n-tier-architecture"
] |
6,167,703 | 1 | 6,167,721 | null | 0 | 5,759 |
What program was used to draw the picture below?

|
Tool for drawing mockup web interfaces
|
CC BY-SA 3.0
| 0 |
2011-05-29T12:24:53.360
|
2011-05-29T12:54:31.103
|
2011-05-29T12:54:31.103
| 553,308 | 707,729 |
[
"drawing",
"mockups"
] |
6,167,692 | 1 | null | null | 9 | 3,158 |
I am drawing a custom window by setting a custom content view for the window. When I draw the custom view I give it rounded corners and a nice outline to mimic a proper window.
However, I see another 1 px outline around the window which strays from the edge at the corners. I have found that if I turn off the shadow it goes away, but obviously as this wants to act like a window I need the shadow. Here's what I mean about the 1px outline:

How can I prevent this?
---
Code for drawing the custom window's content view:
```
NSBezierPath *path = [NSBezierPath bezierPathWithRoundedRect:[self bounds] cornerRadius:5];
NSGradient* aGradient = [[[NSGradient alloc] initWithColorsAndLocations:
[NSColor colorWithDeviceRed:0.5569 green:0.5137 blue:0.4588 alpha:1.0000], 0.0,
[NSColor colorWithDeviceRed:0.5569 green:0.5137 blue:0.4588 alpha:1.0000], 1.0,
nil] autorelease];
[aGradient drawInBezierPath:path angle:90];
[path setLineWidth:4];
[[NSColor colorWithDeviceRed:0.4235 green:0.3922 blue:0.3451 alpha:0.9000] setStroke];
[path strokeInside];
[path setLineWidth:3];
[[NSColor colorWithDeviceRed:0.8431 green:0.8314 blue:0.8078 alpha:1.0000] setStroke];
[path strokeInside];
[path setLineWidth:1];
[[NSColor colorWithDeviceRed:0.4235 green:0.3922 blue:0.3451 alpha:0.9000] setStroke];
[path strokeInside];
```
|
NSWindow Shadow Outline
|
CC BY-SA 3.0
| 0 |
2011-05-29T12:23:15.467
|
2015-09-06T20:22:29.683
|
2011-06-03T16:32:52.243
| 92,714 | 92,714 |
[
"objective-c",
"cocoa",
"macos",
"nswindow",
"shadow"
] |
6,167,738 | 1 | 6,167,896 | null | 1 | 161 |
I have a mysql query which works in a strange way. I am posting the 2 queries with input data changed and the output are listed under each query.
Query 1 (Area to be noted `BETWEEN '13/05/11' AND '30/05/11'`):
Output:

Query 2 (Area to be noted `BETWEEN '3/05/11' AND '30/05/11'`):
Output:

Now when the range is increased in the second query why am I getting just one record ? And even in the first query I am getting records which is out of range. What is wrong with it??
EDIT
The changed query looks like this and still not doing what I wanted it to do.
The output is:

|
Explain how the following query works?
|
CC BY-SA 3.0
| 0 |
2011-05-29T12:34:19.623
|
2011-05-29T13:08:40.307
|
2011-05-29T12:59:42.960
| 402,610 | 402,610 |
[
"mysql",
"join",
"aggregate-functions"
] |
6,167,990 | 1 | null | null | 4 | 14,168 |
I have the following directory structure

[http://img853.imageshack.us/img853/7092/96816871.jpg](http://img853.imageshack.us/img853/7092/96816871.jpg)
My CSS tries to use an image as a background
```
#search-text {
width: 213px;
height: 28px;
padding: 6px 0 0 7px;
border: none;
background: url(../images/img02.jpg) no-repeat left top;
color: #000000;
```
}
and it doesn't work while other parts of css work fine.
Firebug shows that application tries to access image by URL _http://localhost:8080/images/img02.jpg and gets 404 error
When I try to access image directly I also get this error. Also I tried
_http://localhost:8080/paygate/images/img02.jpg
_http://localhost:8080/paygate/resources/images/img02.jpg
...and this error doesn't stop follow me.
When I've changed my CSS file to the following
```
background: url(images/img02.jpg) no-repeat left top;
```
warning appeared in webserver log:
```
WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/paygate/images/img02.jpg] in DispatcherServlet with name 'appServlet'
```
and Firebug showed 404 error for URL _http://localhost:8080//images/img02.jpg
How should I organize my directory structure or what should I do to make my images accessible. Thank's!
P.S. I'm using springsource tc server as a webserver.
|
JSP with CSS does not display the background image
|
CC BY-SA 3.0
| 0 |
2011-05-29T13:30:11.353
|
2011-12-21T09:31:35.033
|
2011-12-21T09:31:35.033
| 53,195 | 775,164 |
[
"java",
"html",
"css",
"jsp",
"tomcat"
] |
6,168,053 | 1 | 6,168,088 | null | 12 | 4,284 |
I want to archive:
```
Map2[f,{a,b,c,d}]
{f[a,b], f[b,c], f[c,d]}
```
But for some reason, I can only think of iterative approaches.
What's the functional way?
# Edit:
Use of this, was to generate graph examples. If number list is given, following generates the graph of what it would mean, to sequentially visit all the nodes.
For example:
```
Map2 = # @@@ Partition[#2, 2, 1] &;
MG[elems_] := Graph[Map2[DirectedEdge, elems]]
nrs = RandomInteger[{1, 15}, 20]
MG[nrs]
```
{10,13,9,7,13,3,5,1,15,10,15,6,14,3,1,2,11,4,8,5}
Radial layout:

|
Mapping two argument function in Mathematica
|
CC BY-SA 3.0
| 0 |
2011-05-29T13:44:33.470
|
2014-05-27T21:49:17.707
|
2020-06-20T09:12:55.060
| -1 | 97,754 |
[
"wolfram-mathematica"
] |
6,168,102 | 1 | 6,168,459 | null | 3 | 2,469 |
I cannot get the Theme.Dialog activity to get smaller.
The problem is that i want half the hight only.
Look at the picture down below.
Here is the manifest:
```
<activity android:name=".PopUpSettings"
android:label="@string/app_name"
android:theme="@android:style/Theme.Dialog"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation">
```
here is the xml:
```
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="15dp"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:paddingBottom="15dp"
>
<com.hellberg.ptppservice.imageedit.ColorPicker
android:id="@+id/color_picker_popup_settings"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
/>
<TextView android:id="@+id/exampeltext_popup_settings"
android:text = "This is the best app in the world"
android:textSize="20sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toLeftOf="@+id/color_picker_popup_settings"
/>
<Button android:id="@+id/fontleft_button_popup_settings"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentLeft="true"
android:layout_alignParentBottom="true"
/>
<Button android:id="@+id/fontright_button_popup_settings"
android:layout_width="50dp"
android:layout_height="50dp"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
/>
<TextView android:id="@+id/textlogo_popup_settings"
android:text = "©2011"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentBottom="true"
/>
</RelativeLayout>
```
Here is the screen:

|
android RelativeLayout how to get smaller size window
|
CC BY-SA 3.0
| 0 |
2011-05-29T13:54:28.587
|
2012-01-18T19:51:32.063
|
2012-01-18T19:51:32.063
| 538,837 | 538,837 |
[
"android",
"android-relativelayout"
] |
6,168,174 | 1 | 6,168,186 | null | 2 | 1,357 |
How to avoid an error from displaying the little Windows error box?
`Try` and `Except` dont work because the error isnt showned by Delphi but from Program or I think from Windows.
`try Size:=TFileStream.Create(BitFile,fmOpenRead); except on E: EFCreateError do EC.Add('Error: ' + IntToStr(GetLastError)); end;`
|
How to avoid an error from displaying?
|
CC BY-SA 3.0
| null |
2011-05-29T14:08:30.837
|
2011-05-29T18:02:39.220
|
2011-05-29T18:02:39.220
| 715,707 | 715,707 |
[
"delphi",
"error-handling",
"delphi-7"
] |
6,168,297 | 1 | null | null | 1 | 1,288 |
I have been trying to alter my AlertDialog so that it will show the text right justified (for Hebrew).
With inazaruk's help here: [Right justify text in AlertDialog](https://stackoverflow.com/questions/6131133/right-justify-text-in-alertdialog/6131224#6131224)
I managed to get the dialog showing but it only works correctly in the emulator (Eclipse).
When I move it onto my device (Xpersia X10a) the alert box appears at the top of the screen with the background blocking out everything behind it.
The image on the emulator:

The image on my device:

Code:
```
public class test extends Activity {
/** Called when the activity is first created. */
public class RightJustifyAlertDialog extends AlertDialog {
public RightJustifyAlertDialog(Context ctx) {
super(ctx, R.style.RightJustifyTheme); } }
@Override
public void onCreate(Bundle savedInstanceState) {
final Context con = this;
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button button1 = (Button) findViewById(R.id.button1);
button1.setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
AlertDialog dialog = new RightJustifyAlertDialog(con);
dialog.setButton("button", new OnClickListener(){
public void onClick(DialogInterface arg0, int arg1)
{
}
});
dialog.setTitle("Some Title");
dialog.setMessage("Some message");
dialog.show();
}
});
}
}
```
Styles:
```
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="RightJustifyTextView" parent="@android:style/Widget.TextView">
<item name="android:gravity">right|center_vertical</item>
<item name="android:layout_centerVertical">true</item>
</style>
<style name="RightJustifyDialogWindowTitle" parent="@android:style/DialogWindowTitle" >
<item name="android:gravity">right|center_vertical</item>
<item name="android:layout_centerVertical">true</item>
</style>
<style name="RightJustifyTheme" parent="@android:style/Theme.Dialog.Alert">
<item name="android:textViewStyle">@style/RightJustifyTextView</item>
<item name="android:windowTitleStyle">@style/RightJustifyDialogWindowTitle</item>
</style>
</resources>
```
My device is working with Android 2.1-update1 and the emulator is set to same.
|
Right justify text in AlertDialog
|
CC BY-SA 3.0
| null |
2011-05-29T14:29:26.663
|
2011-05-29T17:33:11.677
|
2017-05-23T12:07:02.087
| -1 | 648,746 |
[
"android",
"android-alertdialog",
"justify"
] |
6,168,393 | 1 | 6,769,936 | null | 5 | 1,934 |
[In his blog](http://ayende.com/blog/2381/nhibernate-one-to-one), Ayende suggests that using a one-to-one is probably not the best way to implement a traditional 1:1 object relationship (e.g. customer.Name == name.Customer).
1. How do I choose when to use the one-to-one relationship?
2. Why should I choose 2 one-to-many relationships
3. How does the one-to-one work (There are no FK columns generated)
One to one:

2 many-to-one:

|
NHibernate one-to-one vs 2 many-to-one
|
CC BY-SA 3.0
| 0 |
2011-05-29T14:50:38.457
|
2011-07-21T00:02:57.393
| null | null | 200,653 |
[
"c#",
"nhibernate"
] |
6,168,972 | 1 | 6,169,000 | null | 12 | 5,577 |
I have black background color. How do I change the background color of the window JavaDoc?

similar problem
[http://www.eclipse.org/forums/index.php?t=tree&th=77817&](http://www.eclipse.org/forums/index.php?t=tree&th=77817&)
|
Setting window background JavaDoc in Eclipse
|
CC BY-SA 3.0
| 0 |
2011-05-29T16:40:55.050
|
2015-02-27T15:16:39.107
|
2011-05-29T17:07:05.103
| 494,657 | 494,657 |
[
"eclipse",
"ubuntu",
"colors"
] |
6,169,039 | 1 | 6,169,077 | null | 2 | 1,514 |
I'm using [colorbox](http://colorpowered.com/colorbox/) to display images for a website. In Chrome version 11.0.696.65 only when the color box is activated, the soundcloud player appears infront of the displayed image.
I've tried changing the z-index of the colorbox, but with no success. I'm pretty sure this is a new problem with chrome/soundcloud as I wasn't having the problem before.

The following code works and might help someone.
```
#Add transparent mode to youtube
embeded_link.gsub!(/("http:\/\/www\.youtube\.com\/embed\/.{11})(")/,'\1?wmode=transparent\2')
#Add transparent mode to soundcloud
embeded_link.gsub!(/(<object height=".+" width=".+">\s*)(<param name="movie" value="http:\/\/player\.soundcloud\.com\/player\.swf)/,'\1<param name="wmode" value="transparent"></param>\2')
```
|
Soundcloud player appears over colorbox in chrome
|
CC BY-SA 3.0
| null |
2011-05-29T16:53:57.900
|
2011-06-10T22:46:52.020
|
2011-06-10T22:46:52.020
| 160,917 | 160,917 |
[
"ruby-on-rails",
"google-chrome",
"z-index",
"colorbox",
"soundcloud"
] |
6,169,055 | 1 | 6,169,234 | null | 1 | 1,127 |
I want to randomly generate points. Well at least there should be a limitation on the y-axis. Later I connect the points to a line which should proceed in a simple animation. You can imagine this as a random walk of a drunken person, going uphill and downhill.

This sounds very simple. I searched around the web and found that this could be accomplished using the [markov chain](http://en.wikipedia.org/wiki/Markov_chain). I think this idea is really interesting.
You can create the first state of your scene by yourself and pass this state as input to the markov chain algorithm. The algorithm randomly changes this state and creates a walk.
However I cannot find any example of that algorithm and no source code. I just found an applet that demonstrates the markov chain algorithm: [http://www.probability.ca/jeff/java/unif.html](http://www.probability.ca/jeff/java/unif.html)
Please suggest some code. Any other ideas how to accomplish this are appreciated too.
I painted an example

So I want the line to proceed in a similar way. There are valleys, slopes ... they are random but the randomness still apply to the initial state of the line. This is why I found makrov chain so interesting here: [http://www.suite101.com/content/implementing-markov-chains-a24146](http://www.suite101.com/content/implementing-markov-chains-a24146)
|
Generating random points to build a procedural line
|
CC BY-SA 3.0
| 0 |
2011-05-29T16:55:57.083
|
2011-05-29T19:30:01.593
|
2011-05-29T19:30:01.593
| 401,025 | 401,025 |
[
"algorithm",
"random",
"procedural-generation"
] |
6,169,164 | 1 | 6,169,414 | null | 0 | 1,701 |
I want to put in a adjacency matrix the following graph:

The left figure is a node link representation of an 8 node network. The right one is an adjacency matrix representation of the same network. The number of
grey cells is equal to the number of links in the graph.
So I want to make a static assigned . What would be the best approach in `C language`?
I was thinking something like:
```
int Matrix[8][8];
```
and then assign a 1 if the node is connected to other node and 0 if it is not. Also I was thinking to keep a counter for the number of neighbours a node has, like A has 2, B has 3...
But all this I want to be static not dynamic.
|
Static allocated adjacency matrix Graph in C
|
CC BY-SA 3.0
| null |
2011-05-29T17:16:44.897
|
2011-05-29T18:14:23.040
|
2011-05-29T18:02:14.793
| 91,282 | 265,519 |
[
"c",
"graph",
"adjacency-matrix"
] |
6,169,255 | 1 | null | null | 13 | 3,313 |
I have a `NSToolbarItem` that uses a view similar to the Xcode status view. It currently has no label, but I can't figure out a way to draw into the area where the item label would normally be drawn. I would like the view to extend into that area just as the Xcode status view does. I know the very bottom portion of pixels of `NSToolbar` is out of bounds, but I have seen other applications draw into the label area. Any ideas?
Edit: For clarification, this is the status view I'm referring to in Xcode:

I want the bounds of my view to extend past the label area of the toolbar just as the view in Xcode does.
|
Is it possible to draw in the label area of NSToolbar?
|
CC BY-SA 3.0
| 0 |
2011-05-29T17:32:11.113
|
2012-10-28T06:26:21.227
|
2011-05-31T23:54:45.457
| null | 296,961 |
[
"objective-c",
"cocoa",
"nstoolbar",
"nstoolbaritem"
] |
6,169,398 | 1 | 6,169,515 | null | 5 | 282 |
I am trying to get results from 3 tables, but its repeating the PART_ID and displaying the same id over and over. How can I fix this?
```
<?php
$product_list = "";
$sql = mysql_query("SELECT * FROM PART, PART_TYPE, RACK");
$productCount = mysql_num_rows($sql);
if ($productCount >0){
while($row= mysql_fetch_array($sql)){
$id = $row["PART_ID"];
$PART_DESC = $row["PART_DESC"];
$SERIAL_NUM = $row["SERIAL_NUM"];
$RACK_NUM = $row["RACK_NUM"];
$PART_TYPE_ID = $row["PART_TYPE_ID"];
$PART_TYPE_DESC = $row["PART_TYPE_DESC"];
$product_list .= " <strong>PART_ID:</strong> $id -<strong>$PART_DESC</strong> -<strong>Product Type</strong> $SERIAL_NUM - <em><strong>RACK_NUM</strong> $RACK_NUM - <em> <strong>PART_TYPE_ID</strong> $PART_TYPE_ID - <em> <strong>PART_TYPE_DESC </strong> $PART_TYPE_DESC - <em> <a href='inventory_edit.php?pid=$id'>edit</a> • <a href='inventory_list.php?deleteid=$id'>delete</a><br />";
}
}else
$product_list = "You have not items in the inventory yet"
?>
```
```
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R1S1 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R1S2 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R1S3 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R1S4 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R1S5 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R1S6 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R2S1 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R2S2 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R2S3 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R2S4 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R2S5 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R2S6 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R3S1 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R3S2 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
PART_ID: 1001 -Power Mac G4 Desktop -Product Type XBO31 1WAJ3B - RACK_NUM R3S3 - PART_TYPE_ID 101 - PART_TYPE_DESC MAC - edit • delete
```

|
PHP/MYSQL Query by id "duplicate ids"
|
CC BY-SA 3.0
| null |
2011-05-29T17:54:42.790
|
2011-05-29T18:21:27.770
|
2011-05-29T18:04:48.093
| 327,073 | 327,073 |
[
"php",
"mysql"
] |
6,169,474 | 1 | null | null | 10 | 14,989 |
I'm building an app with a custom navigation bar. After some research I decided to do this using a category on UINavigationBar. The navigation bar needs to be a bit larger than usual to accomodate a drop shadow. Here is the code:
```
#import "UINavigationBar+CustomWithShadow.h"
@implementation UINavigationBar (CustomWithShadow)
- (void)drawRect:(CGRect)rect {
// Change the tint color in order to change color of buttons
UIColor *color = [UIColor colorWithHue:0.0 saturation:0.0 brightness:0.0 alpha:0.0];
self.tintColor = color;
// Add a custom background image to the navigation bar
UIImage *image = [UIImage imageNamed:@"NavBar.png"];
[image drawInRect:CGRectMake(0, 0, self.frame.size.width, 60)];
}
- (void)layoutSubviews {
self.frame = CGRectMake(0, 20, self.frame.size.width, 60);
}
@end
```
The only problem now is that the larger navigation bar means that the navigation bar buttons end up too far down, like so:

Does anyone know how I can correct the position of the buttons?
Thanks for all help!
I add the buttons to the nav bar in the init method of the view controller like so:
```
// Create "Add" button for the nav bar
UIBarButtonItem *addButton = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemAdd
target:self
action:@selector(createNewEntry:)];
[[self navigationItem] setRightBarButtonItem:addButton];
[addButton release];
```
|
iOS: Positioning navigation bar buttons within custom navigation bar
|
CC BY-SA 3.0
| 0 |
2011-05-29T18:09:00.283
|
2011-11-23T15:33:40.523
|
2011-05-29T19:17:05.580
| 622,981 | 622,981 |
[
"iphone",
"ios",
"uinavigationcontroller",
"uinavigationbar",
"frontend"
] |
6,169,626 | 1 | 6,310,847 | null | 3 | 1,410 |
I have a script which dynamically adds rows to a form with default values:
```
$(document).ready(function() {
var defaults = {
'name[]': 'Name',
'email[]': 'Email',
'organisation[]': 'Organisation',
'position[]': 'Position'
};
var setDefaults = function(inputElements, removeDefault)
{
$(inputElements).each(function() {
if (removeDefault)
{
if ($(this).data('isDefault'))
{
$(this).val('')
.removeData('isDefault')
.removeClass('default_value');
}
}
else
{
var d = defaults[this.name];
if (d && d.length)
{
this.value = d;
$(this).data('isDefault', true)
.addClass('default_value');
}
}
});
};
setDefaults(jQuery('form[name=booking] input'));
$(".add").click(function() {
var x = $("form > p:first-child").clone(true).insertBefore("form > p:last-child");
setDefaults(x.find('input'));
return false;
});
$(".remove").click(function() {
$(this).parent().remove();
});
// Toggles
$('form[name=booking]').delegate('input', {
'focus': function() {
setDefaults(this, true);
},
'blur': function() {
if (!this.value.length) setDefaults(this);
}
});
});
```
For the following form:
```
<form method="post" name="booking" action="bookingengine.php">
<p><input type="text" name="name[]">
<input type="text" name="email[]">
<input type="text" name="organisation[]">
<input type="text" name="position[]">
<span class="remove">Remove</span></p>
<p><span class="add">Add person</span><br /><br /><input type="submit" name="submit" id="submit" value="Submit" class="submit-button" /></p>
</form>
```
I would now like to split the form into 2 sections, each of which can have rows added dynamically to it. The second section would only have spaces for name and email, so the form as a whole, before any additional rows are added, would look something like this:

But I'm not sure how to achieve this. Either I would create a separate form with a seperate script, and then would need to know how to submit the information from both forms together, or I would just have one form but would then need to work out how to add rows dynamically to each section.
Could someone help with this?
Thanks,
Nick
|
adjusting dynamic form to work with multiple sections
|
CC BY-SA 3.0
| 0 |
2011-05-29T18:36:10.647
|
2011-06-10T18:55:21.427
| null | null | 672,147 |
[
"javascript",
"forms",
"dynamic",
"add"
] |
6,169,760 | 1 | 6,169,796 | null | 1 | 3,177 |
I have a problem. I get an error if the objectAtIndex:x is empty. In my code the user has to insert a code separated by "/" like 32/31/43 or even 32//12. Everything works but if the user insert a single number without the "/" I got the error shown in the picture but I would like to get an alert view that tell the user that the code has been inserted in a wrong format. I hope it's clear. thanks

|
NSArray - objectAtIndex:
|
CC BY-SA 3.0
| null |
2011-05-29T18:59:44.297
|
2011-05-29T19:12:33.873
| null | null | 651,871 |
[
"iphone",
"objective-c",
"nsarray"
] |
6,169,854 | 1 | 6,170,270 | null | 0 | 349 |
How do I get rid of the shadow in the red area below? I have seen other similar questions but don't know how to apply that here.

Live Demo: [http://jsfiddle.net/xFa9M/](http://jsfiddle.net/xFa9M/)
CSS:-
```
#list li{
border: 2px solid black;
border-top-width: 1px;
border-bottom-width: 1px;
padding: 4em;
z-index: 1;
}
#list li .tip{
position: absolute;
left: 200px;
top: 0px;
border: 2px solid black;
border-left-width: 0px;
z-index: 0;
display: none;
}
#list li:hover{
-moz-box-shadow: -5px 5px 5px black;
-webkit-box-shadow: -5px 5px 5px black;
box-shadow: -5px 5px 5px #555;
}
#list li:hover .tip{
-moz-box-shadow: -5px 5px 5px black;
-webkit-box-shadow: -5px 5px 5px black;
box-shadow: -5px 5px 5px #555;
}
```
Html:-
```
<ul id="list">
<li class="top">About Me
<div class="tip">Asas</div>
<li>Garage
<li class="bottom">My Blog
</ul>
```
Please note that it is ok for me to use JS code tricks, if needed.
|
How do I disable the shadow only on one edge?
|
CC BY-SA 3.0
| null |
2011-05-29T19:15:21.580
|
2011-05-29T21:00:25.773
|
2011-05-29T20:41:48.747
| 137,893 | 137,893 |
[
"html",
"css"
] |
6,169,971 | 1 | null | null | 0 | 66 |
I would like to change the standard links and buttons in Rails to a graphic version. How would I achieve this?

|
Rails3 - changing links into graphic button
|
CC BY-SA 3.0
| 0 |
2011-05-29T19:39:03.317
|
2011-05-30T12:14:46.117
| null | null | 372,237 |
[
"ruby-on-rails-3"
] |
6,169,966 | 1 | 6,170,064 | null | 7 | 2,589 |
I tried to follow [Bjarne Stroustups](http://www2.research.att.com/~bs/C++0xFAQ.html#std-function) explanation of the `function` template. I specifically played with the interchangability of , , and
Given the defintions:
```
struct IntDiv { // functor
float operator()(int x, int y) const
{ return ((float)x)/y; }
};
// function pointer
float cfunc(int x, int y) { return (float)x+y; }
struct X { // member function
float mem(int x, int y) const { return ...; }
};
using namespace placeholders; // _1, _2, ...
```
I want to assign to `function<float(int,int)>` everything possible:
```
int main() {
// declare function object
function<float (int x, int y)> f;
//== functor ==
f = IntDiv{}; // OK
//== lambda ==
f = [](int x,int y)->float { return ((float)y)/x; }; // OK
//== funcp ==
f = &cfunc; // OK
// derived from bjarnes faq:
function<float(X*,int,int)> g; // extra argument 'this'
g = &X::mem; // set to memer function
X x{}; // member function calls need a 'this'
cout << g(&x, 7,8); // x->mem(7,8), OK.
//== member function ==
f = bind(g, &x,_2,_3); // ERROR
}
```
And the last line gives a typical unreadable compiler-template-error. .
I want to bind `f` to an existing `x` instances member function, so that only the signature `float(int,int)` is left.
```
f = bind(g, &x,_2,_3);
```
---
Background:
Here comes Bjarnes example for using `bind` and `function` with a member function:
```
struct X {
int foo(int);
};
function<int (X*, int)> f;
f = &X::foo; // pointer to member
X x;
int v = f(&x, 5); // call X::foo() for x with 5
function<int (int)> ff = std::bind(f,&x,_1)
```
I `bind` is used this way: The un-assigned places get `placeholders`, the rest is filled in the `bind`. Should `_1` nut get `this`, then`? And therefore the last line be:
```
function<int (int)> ff = std::bind(f,&x,_2)
```
---
below I tried it :-) 
|
C++0x function<>, bind and members
|
CC BY-SA 3.0
| 0 |
2011-05-29T19:38:05.107
|
2011-05-31T14:32:17.547
|
2011-05-31T14:32:17.547
| 472,245 | 472,245 |
[
"c++11",
"bind",
"functional-programming",
"pointer-to-member"
] |
6,170,065 | 1 | 6,172,927 | null | 11 | 7,954 |
I've got an element that I want to have a shadow accent just on one end, like this (from Photoshop):

The closest I've gotten is like this (HTML + CSS3):

So, is it possible to make the shadow fade, like in the first picture? Here's my code as is:
```
box-shadow: 0px 0px 5px 1px rgba(0,0,0,.4);
```
|
CSS box-shadow: Only apply to part of an element
|
CC BY-SA 3.0
| 0 |
2011-05-29T19:56:45.210
|
2016-10-17T22:42:20.073
|
2011-05-29T20:01:57.800
| 515,160 | 515,160 |
[
"html",
"shadow",
"css"
] |
6,170,049 | 1 | 6,171,058 | null | 2 | 356 |
I have a basic "To-Do List" iPhone app backed by Core Data. I am having problems implementing a system that allows the user to select sort order (Alpha, Date Created, Custom). If they select custom, then they can move items manually via edit mode.
Right now, the table display and core data reflect the sort selection correctly. However, if I do something like the following I get a weird situation as shown in the screenshot below.
Causes Issue:
1. Start App and change sorting - say from Date Changed to Alpha
2. Change to Custom Sort
3. Try moving an item in edit mode (error only appear while I am holding and dragging an item)
Screenshot:

When the sort preference is changed, I am essentially killing my NSManagedResultsFetcher, creating a new one with the new sort descriptor and reloading the table
```
- (void)startFetcher
{
BOOL success;
NSError * error;
NSFetchRequest * fetchRequest;
NSSortDescriptor * sortDescriptor;
OurListsAppDelegate* delegate;
delegate = [[UIApplication sharedApplication] delegate];
assert([ListMaster sharedListMaster] != nil);
assert([ListMaster sharedListMaster].managedObjectContext != nil);
NSPredicate *predicate = [NSPredicate predicateWithFormat:
@"(parentCreatedUdid = %@) AND (parentCreatedDate = %@)", self.parentCreatedUdid, self.parentCreatedDate];
if (self.parentItem != nil)
{
sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:self.parentItem.sortPreference ascending:YES] autorelease];
}
else
{
sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:delegate.rootSortPreference ascending:YES] autorelease];
}
assert(sortDescriptor != nil);
fetchRequest = [[[NSFetchRequest alloc] init] autorelease];
assert(fetchRequest != nil);
[fetchRequest setPredicate:predicate];
[fetchRequest setEntity:[ListMaster sharedListMaster].listEntity];
[fetchRequest setFetchBatchSize:20];
[fetchRequest setSortDescriptors:[NSArray arrayWithObject:sortDescriptor]];
assert(self.fetcher == nil);
self.fetcher = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:[ListMaster sharedListMaster].managedObjectContext sectionNameKeyPath:nil cacheName:nil];
assert(self.fetcher != nil);
self.fetcher.delegate = self;
success = [self.fetcher performFetch:&error];
if ( ! success ) {
[[QLog log] logWithFormat:@"viewer fetch failed %@", error];
}
}
```
And the method called when the sort order has been changed
```
- (void)restartFetcher
{
[_fetcher release];
self.fetcher = nil;
[self startFetcher];
[self reloadTable];
}
```
Edit: Added code below per request
```
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell * result;
assert(tv == self.tableView);
assert(indexPath != NULL);
if ( [self hasNoItems] )
{
// There are no items to display; return a cell that simple says "No items".
result = [self.tableView dequeueReusableCellWithIdentifier:@"cell"];
if (result == nil) {
result = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] autorelease];
assert(result != nil);
result.textLabel.text = @"No items";
result.textLabel.textColor = [UIColor darkGrayColor];
result.textLabel.textAlignment = UITextAlignmentCenter;
}
result.selectionStyle = UITableViewCellSelectionStyleNone;
}
else
{
ListItem * item;
item = [self.fetcher objectAtIndexPath:indexPath];
assert([item isKindOfClass:[ListItem class]]);
UITableViewCell *cell = [tv dequeueReusableCellWithIdentifier:@"cell"];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"] autorelease];
assert(cell != nil);
assert(cell.selectionStyle == UITableViewCellSelectionStyleBlue);;
}
ToggleImageControl *toggleControl = [[ToggleImageControl alloc] initWithFrame: CGRectMake(4, 6, 32, 32) status:item.isDone];
toggleControl.tag = indexPath.row;
[cell.contentView addSubview: toggleControl];
[toggleControl release];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(50, 0, 260, 44)];
label.text = item.name;
label.textAlignment = UITextAlignmentLeft;
[cell.contentView addSubview:label];
[label release];
if ([item.isList boolValue] == YES)
{
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
else
{
cell.accessoryType = UITableViewCellAccessoryNone;
}
result = cell;
}
return result;
}
```
|
UITableViewCell showing two different items while I move it in edit mode
|
CC BY-SA 3.0
| null |
2011-05-29T19:53:34.277
|
2011-05-29T23:18:24.107
|
2011-05-29T22:47:10.683
| 407,725 | 407,725 |
[
"iphone",
"ios",
"uitableview",
"core-data"
] |
6,170,156 | 1 | 6,170,214 | null | 2 | 470 |
So let me explain my problem a little better now (please reopen this question). I heard of markov chain theory when thinking about a method to generate procedural lines to build terrain.
> The main thing that's generated is the
map which can extend to infinity. At
first I've built a demo with
perlin-based procedural maps having a
lot of various terrain features. It
was even meant to be isometric, more
like Sentinel. This
proved to be too confusing to play on
with the movement mechanics I had in
mind. I had to reduce it to a much
simpler tile based system. It's not
only easier to grasp and navigate but
it's looking a lot better too.The map is generated using the Markov
chain. The algorithm is fed a short
human made terrain sequence. It then
goes on and produce a map of any size
mimicking the structure of the input.
So an example visual output may look like you see in the following image

Actually I experienced a similar thing that is described in the quotation ending up with this random lines:

So instead of having this random line I look for a solution to create little canyons from the first picture. First time I read about markov chain I thought WOW, take a human made line as input and let the algorithm proceed, sounds brilliant.
So how does markov chain theory actually help on creating this kind of terrain? If you think there is a better way to do this please suggest.
> The map is generated using the Markov
chain.
...confused me and I tought their actually is a markov chain algorithm.
|
Generate a infinite line with the help of markov chain theory
|
CC BY-SA 3.0
| 0 |
2011-05-29T20:13:45.767
|
2011-05-30T19:27:37.813
|
2011-05-30T19:27:37.813
| 401,025 | 401,025 |
[
"java",
"algorithm",
"markov-chains"
] |
6,170,529 | 1 | 6,170,570 | null | 0 | 356 |
I wrote a program that will simulate a ball being thrown off a 50 meter building.
I added in collision detection by reversing the velocity in the y direction when the ball hits the ground (y < 0), keeping the horizontal velocity the same, and multiplying both velocities by some min value, so that the ball will ultimately come to a rest.
```
#include<stdio.h>
#include<math.h>
#include <stdlib.h>
int main() {
FILE *fp;
FILE *fr;
float ax = 0, ay = 0, x = 0, y = 0, vx = 0, vy = 0;
float time = 0, deltaTime = .001;
float min = -.00000000001;
int numBounces = 0;
fr = fopen("input_data.txt", "rt");
fp = fopen( "output_data.txt", "w" );
if(fr == NULL){ printf("File not found");}
if(fp == NULL){ printf("File not found");}
fscanf(fr, "ax: %f ay: %f x: %f y: %f vx: %f vy: %f\n", &ax, &ay, &x, &y, &vx, &vy);
while (vx > min && vy > min) {
time = time + deltaTime;
vx = vx + ax*deltaTime;
vy = vy + ay*deltaTime;
x = x + vx*deltaTime + (.5*ax*deltaTime*deltaTime);
y = y + vy*deltaTime + (.5*ay*deltaTime*deltaTime);
fprintf(fp, "%f\t%f\t%f\t%f\t%f\t%f\t%f\t\n", ax, ay, x, y, vx, vy, time);
//Collision occurs; implement collision response
if(y < 0) {
vx = vx + ax*deltaTime*(.00001);
vy = -(vy + ay*deltaTime*(.00001));
numBounces++;
fprintf(fp, "%f\t%f\t%f\t%f\t%f\t%f\t%f\t\n", ax, ay, x, y, vx, vy, time);
}
}
fclose(fp);
fclose(fr);
system ("PAUSE");
return 0;
}
```
I am not getting the correct values needed to produce a correct graph of the data.
It could be because my conditions in the while loop need to be changed, or that I did not implement collision response correctly.
Here is also some sample data:
ax: 0 ay: -9.8 x: 0 y: 50 vx: 8.66 vy: 5

|
Implementing Collision Detection
|
CC BY-SA 3.0
| null |
2011-05-29T21:28:52.177
|
2011-05-30T21:25:42.833
|
2011-05-30T21:25:42.833
| 503,901 | 503,901 |
[
"c",
"physics"
] |
6,170,654 | 1 | 6,170,744 | null | 4 | 2,228 |
I have a UITableView with a UIView transparent over it. It looks really cool. The fact that you can see beyond the UITableView.
My problem is that if I make the UITableView extend to the end of the UIView, you can't scroll to see the last one.
I tried adding a cell but the sizes don't match up and it looks kinda funny. What's the best solution to this?
Thanks,
Coulton

|
Show UITableView Overflow?
|
CC BY-SA 3.0
| 0 |
2011-05-29T21:52:01.917
|
2011-05-29T22:20:46.810
|
2011-05-29T22:18:25.020
| 106,224 | 613,860 |
[
"iphone",
"objective-c",
"uiview",
"uitableview"
] |
6,170,702 | 1 | null | null | -1 | 4,389 |
I am trying to update a database using a form, but its not adding the item or updating. Deleting the item works but that's it. What am I doing wrong and how can I do to resolve this?

Thank You in advance your assistance is appreciated.
```
<?php
// Parse the form data and add inventory item to the system
if (isset($_POST['PART_DESC'])) {
$PART_DESC = $row["PART_DESC"];
$SERIAL_NUM = $row["SERIAL_NUM"];
$RACK_NUM = $row["RACK_NUM"];
$PART_TYPE_ID = $row["PART_TYPE_ID"];
$PART_TYPE_DESC = $row["PART_TYPE_DESC"];
// See if that product name is an identical match to another product in the system
$sql = mysql_query("SELECT PART_ID FROM PART WHERE ='$PART_ID' LIMIT 1");
$productMatch = mysql_num_rows($sql); // count the output amount
if ($productMatch > 0) {
echo 'Sorry you tried to place a duplicate "Product Name" into the system, <a href="inventory.php">click here</a>';
exit();
}
// Add this product into the database now
$sql = mysql_query("INSERT INTO PART (PART_DESC, SERIAL_NUM, RACK_NUM, PART_TYPE_DESC, LOCATION)
VALUES('$PART_DESC','$SERIAL_NUM','$RACK_NUM','$PART_TYPE_ID','$PART_TYPE_DESC',now() )") or die (mysql_error());
$pid = mysql_insert_id();
exit();
}
?>
<?php
// Script Error Reporting
error_reporting(E_ALL);
ini_set('display_errors', '1');
?>
```
```
<?php
// Gather this product's full information for inserting automatically into the edit form below on page
if (isset($_GET['pid'])) {
$targetID = $_GET['pid'];
$sql = mysql_query("SELECT PART_ID, PART_DESC, SERIAL_NUM, RACK.RACK_NUM, PART.PART_TYPE_ID, PART_TYPE_DESC, LOCATION
FROM PART
INNER JOIN PART_TYPE ON PART.PART_TYPE_ID = PART_TYPE.PART_TYPE_ID
INNER JOIN RACK ON RACK.RACK_NUM = PART.RACK_NUM
WHERE PART_ID='$targetID' LIMIT 1");
$productCount = mysql_num_rows($sql); // count the output amount
if ($productCount > 0) {
while($row = mysql_fetch_array($sql)){
$id = $row["PART_ID"];
$PART_DESC = $row["PART_DESC"];
$SERIAL_NUM = $row["SERIAL_NUM"];
$RACK_NUM = $row["RACK_NUM"];
$PART_TYPE_ID = $row["PART_TYPE_ID"];
$PART_TYPE_DESC = $row["PART_TYPE_DESC"];
$LOCATION = $row["LOCATION"];
}
} else {
echo "Sorry dude that crap dont exist.";
exit();
}
}
?>
<?php
// Parse the form data and add inventory item to the system
if (isset($_POST['PART_DESC'])) {
$pid = mysql_real_escape_string($_POST['thisID']);
$PART_DESC = $row["PART_DESC"];
$SERIAL_NUM = $row["SERIAL_NUM"];
$RACK_NUM = $row["RACK_NUM"];
$PART_TYPE_ID = $row["PART_TYPE_ID"];
$PART_TYPE_DESC = $row["PART_TYPE_DESC"];
$LOCATION = $row["LOCATION"];
// See if that product name is an identical match to another product in the system
$sql = mysql_query("UPDATE PART SET PART_DESC='$PART_DESC', SERIAL_NUM='$SERIAL_NUM', PART.PART_TYPE_DESC='$PART_TYPE_DESC', RACK.RACK_NUM='$RACK_NUM', LOCATION='$LOCATION'
INNER JOIN PART_TYPE ON PART.PART_TYPE_ID = PART_TYPE.PART_TYPE_ID
INNER JOIN RACK ON RACK.RACK_NUM = PART.RACK_NUM WHERE PART.PART_ID='$pid'");
header("location: inventory.php");
exit();
}
```
?>
|
PHP/MYSQL How to Insert/Update Multiple Tables
|
CC BY-SA 3.0
| 0 |
2011-05-29T22:01:51.860
|
2011-05-29T22:37:06.573
| null | null | 327,073 |
[
"php",
"mysql"
] |
6,170,912 | 1 | 6,171,145 | null | 10 | 2,215 |
I'm scaling images down in c#, and I've compared my methods with the best method in Photoshop cs5 and cannot replicate it.
In PS i'm using bicubic sharper, which looks really good. However, when trying to do the same in c# I don't get as high quality results. I've tried bicubic interpolation as well as HQ bicubic, smoothing mode HQ/None/AA. Composition modes, I've tried about 50 different variations and each one comes out pretty close to the image on the right.
You'll notice the pixelation on her back and around the title, as well as the authors name not coming out too well.
(Left is PS, right is c#.)

It seems that c# bicubic does too much smoothing even with smoothing set to none. I've been playing around with many variations of the following code:
```
g.CompositingQuality = CompositingQuality.HighQuality;
g.InterpolationMode = InterpolationMode.HighQualityBicubic;
g.PixelOffsetMode = PixelOffsetMode.None;
g.SmoothingMode = SmoothingMode.None;
```
As requested here is the starting image (1mb).

|
How can I get better results when shrinking an image
|
CC BY-SA 3.0
| 0 |
2011-05-29T22:45:54.127
|
2011-05-30T00:20:23.087
|
2011-05-29T22:52:41.630
| 445,303 | 445,303 |
[
"c#",
"image-processing"
] |
6,170,929 | 1 | 6,180,561 | null | 0 | 119 |
How can I create a multiple check list items control as in the picture bellow using Symbian ?
I'm going to use this control in my SettingList view.
I'm using Carbide.C++ 2.7 , And Symbian S60 5th Ed SDK.
Many thanks in advance.

|
How can I create a check list items control in Symbian
|
CC BY-SA 3.0
| null |
2011-05-29T22:47:48.923
|
2011-05-30T20:35:47.193
| null | null | 749,796 |
[
"symbian"
] |
6,170,963 | 1 | null | null | 2 | 2,187 |
i'm on this problem since a very long time and I really can't understand where the problem come, maybe you can help me.
I'm creating a J2EE web application using JMS topics for async messages. The problem is that when retrieving my Topic with a lookup on the InitialContext, my topic is always set as null and this exceptions is thrown :
```
ATTENTION: RAR7096: Exception null while trying to set the value jms/Topic on property Name
GRAVE: enterprise_naming.serialctx_communication_exception
GRAVE: com.sun.appserv.connectors.internal.api.PoolingException
at com.sun.enterprise.resource.beans.AdministeredObjectResource.createAdministeredObject(AdministeredObjectResource.java:199)
at com.sun.enterprise.resource.naming.AdministeredObjectFactory.getObjectInstance(AdministeredObjectFactory.java:128)
at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
at com.sun.enterprise.naming.impl.SerialContext.getObjectInstance(SerialContext.java:472)
at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:437)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at org.apache.jsp.index_jsp.jspInit(index_jsp.java from :36)
at org.apache.jasper.runtime.HttpJspBase.init(HttpJspBase.java:90)
at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:208)
at org.apache.jasper.servlet.JspServletWrapper.getDependants(JspServletWrapper.java:317)
at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:615)
at org.apache.jasper.compiler.Compiler.isOutDated(Compiler.java:483)
at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:618)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:377)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:483)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:373)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)
at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
at java.lang.Thread.run(Thread.java:680)
Caused by: java.security.PrivilegedActionException: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.resource.beans.AdministeredObjectResource.createAdministeredObject(AdministeredObjectResource.java:176)
... 41 more
Caused by: com.sun.appserv.connectors.internal.api.ConnectorRuntimeException
at com.sun.enterprise.connectors.util.SetMethodAction.handleException(SetMethodAction.java:140)
at com.sun.enterprise.connectors.util.SetMethodAction.run(SetMethodAction.java:126)
... 43 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.enterprise.connectors.util.SetMethodAction.run(SetMethodAction.java:99)
... 43 more
Caused by: java.lang.IllegalArgumentException: MQ:Topic:Invalid Topic Name - jms/Topic
at com.sun.messaging.Topic.setName(Topic.java:90)
... 48 more
```
Here is my code, the problematic line is "topic = (Topic) ic.lookup("jms/Topic");"
```
<%!
@Resource(mappedName = "jms/ConnectionFactory")
ConnectionFactory connectionFactory;
@Resource(mappedName = "jms/Topic")
Topic topic;
Connection connection = null;
Session jmsSession = null;
MessageProducer messageProducer = null;
public void jspInit() {
try {
InitialContext ic = new InitialContext();
connectionFactory = (ConnectionFactory) ic.lookup("jms/ConnectionFactory");
topic = (Topic) ic.lookup("jms/Topic");
connection = connectionFactory.createConnection();
jmsSession = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
messageProducer = jmsSession.createProducer(topic);
connection.start();
} catch (Exception e) {
System.out.println("Couldn't create nsl : " + e.getMessage());
}
}
```
I hope you can help me to figure out what is wrong in this file !
Thanks !
EDIT : Server ressources

|
Exception null while trying to set the value jms/Topic
|
CC BY-SA 3.0
| 0 |
2011-05-29T22:56:00.663
|
2014-10-10T07:23:46.477
|
2011-05-29T23:38:40.330
| 317,689 | 317,689 |
[
"exception",
"jakarta-ee",
"jms"
] |
6,171,204 | 1 | 6,171,262 | null | 2 | 468 |
I have the following code:
```
[avatar.layer setBorderColor:[[UIColor whiteColor] CGColor]];
[avatar.layer setBorderWidth:2.0];
[avatar.layer setShadowOffset:CGSizeMake(-1.0, -1.0)];
[avatar.layer setCornerRadius:8];
```
It does give me a rounded white border surrounding the UIImage, however there is that extra tip around the 4 corners.. is there a way to cut it off?

|
rounded corner in UIImageView
|
CC BY-SA 3.0
| 0 |
2011-05-29T23:49:34.883
|
2012-06-16T21:26:03.640
|
2012-06-15T09:09:44.047
| 363,363 | 721,937 |
[
"iphone",
"objective-c",
"uiimageview"
] |
6,171,386 | 1 | 6,171,431 | null | 1 | 57 |
I'm working on a project, and I need know how I can force breakline, giving preference to a float:right element.
See this picture:

There are some CSS attribute that I can use to work with this case? I have tried `clear: left`, but nothing.
: [jsFiddle](http://jsfiddle.net/G9UAR/)
: what you think that have a better visual? `:p`
|
Preferential break on float attribute
|
CC BY-SA 3.0
| null |
2011-05-30T00:45:44.137
|
2011-05-30T00:57:51.057
|
2011-05-30T00:54:15.397
| 755,393 | 755,393 |
[
"html",
"css"
] |
6,171,406 | 1 | 6,554,441 | null | 3 | 744 |
I assign a mask to a simple MovieClip with a square Bitmap in it. The mask is fairly complex shape drawn by an artist. The resulting masked bitmap looks correct inside Flash CS5, but when I run the SWF in Flash Player 10.2, the mask is corrupted. Let me try and describe it:
The shape itself is mostly visible, but certain scan lines (horizontal lines) of the resulting image "leak" to the right of the mask shape, all the way to the right border of the square bitmap. Some lines are also missing.
Here's an image:

The shape on the left is the mask used for the cracked bitmap, which you can see on the right, masked, with flaws.
Are there some limitations that we should be aware of when using masks? Does flash only handle simple shapes for masking?
|
Complex mask draws corrupted shapes
|
CC BY-SA 3.0
| null |
2011-05-30T00:50:27.743
|
2011-07-02T00:48:27.293
|
2011-05-31T05:32:05.333
| 715,663 | 715,663 |
[
"flash",
"actionscript-3"
] |
6,171,502 | 1 | 6,171,923 | null | 9 | 43,943 |
I have a class that populates a ListView by passing a list of objects. The class uses reflection to see the properties of each object in order to generate the ListView. How could I change the background color of a row in the ListView.
This [page](http://www.csharp411.com/add-shaded-rows-to-listview-details-view/) does exactly what I am looking for. The only problem is that my ListView is bound to the list of objects. In other words each item of the ListView is an object that is bound instead of a ListViewItem. I am assuming that is the reason why I cannot cast some item in the ListView to a ListViewItem. For example when I do this:
```
ListViewItem someItem = (ListViewItem)listView1.Items[0];
```
I get an InvalidcastException because if I where to physically add the objects to the ListView like:
listview.items.add(someObject) then this will work, but because I am binding the list to the ListView that line does not work. I think that is the reason why I am not able to cast. The reason why I want to cast it is becasue a ListViewItem has a Background property.
EDIT
I am able to do that with the first 12 objects I have tried the folowing:
```
for (int i = 0; i < listView1.Items.Count; i++)
{
var lvitem = listView1.ItemContainerGenerator.ContainerFromIndex(i) as ListViewItem;
lvitem.Foreground = Brushes.Green;
}
```
and I get this error:

and I also have tried this:
```
foreach (Tiro t in listView1.Items)
{
var lvitem = listView1.ItemContainerGenerator.ContainerFromItem(t) as ListViewItem;
if (t.numero == 0 || t.numero == 37)
{
//lvitem.Background = Brushes.Green;
lvitem.Foreground = Brushes.Green;
}
else if (t.numero % 2 == 0)
{
//lvitem.Background = Brushes.Red;
lvitem.Foreground = Brushes.Red;
}
else
{
//lvitem.Background = Brushes.Gray;
lvitem.Foreground = Brushes.Black;
}
}
```
and I get the same error:

I don't understand why lvitem is null after the 12 iteration?
It only works with the items that are being displayed....
|
Change background color of ListView row programmatically (wpf)
|
CC BY-SA 3.0
| 0 |
2011-05-30T01:15:17.780
|
2018-06-21T03:45:44.010
|
2011-05-30T02:49:00.463
| 637,142 | 637,142 |
[
"c#",
"wpf",
"listview"
] |
6,171,489 | 1 | 6,171,613 | null | 3 | 2,447 |
I am a little OCD and this is driving me insane. I have been messing around with these settings for a long time.
I have a UITableView grouped that I have a shadow on the top. When you tap the top cell, it removes. What gives?
I've been stressing over this for the past hour or so. Is there a simple solution for this? Or am I just going insane?
Thanks,
Coulton

viewDidLoad:
```
formTableView.backgroundColor = [UIColor clearColor];
formTableView.layer.borderColor = [UIColor clearColor].CGColor;
formTableView.separatorColor = [UIColor colorWithRed:(194.0 / 255.0) green:(194.0 / 255.0) blue:(194.0 / 255.0) alpha: 1];
```
Here is how I display my cells. It's a lot of code. There's a bunch of stuff in there you will have to sort through, so sort through it at your own risk! :)
```
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath {
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (UITableViewCellEditingStyle)tableView:(UITableView *)tableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath {
return UITableViewCellEditingStyleNone;
}
// What to do when you click delete.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
return NO;
}
//RootViewController.m
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return [formDataOne count];
} else {
return [formDataTwo count];
}
}
//RootViewController.m
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
for (UIView *subview in [cell.contentView subviews]) {
[subview removeFromSuperview];
}
// Set up the cell...
NSString *cellValue;
if (indexPath.section == 0) {
cellValue = [formDataOne objectAtIndex:indexPath.row];
} else {
cellValue = [formDataTwo objectAtIndex:indexPath.row];
}
if (indexPath.section == 0) {
cell.text = @"";
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if (indexPath.row == 0) {
addTitle = [[UITextField alloc] initWithFrame:CGRectMake(13, 13, 280, 20)];
addTitle.borderStyle = UITextBorderStyleNone;
addTitle.textColor = [UIColor blackColor]; //text color
addTitle.font = [UIFont systemFontOfSize:16.0]; //font size
addTitle.placeholder = @"Album Name"; //place holder
addTitle.backgroundColor = [UIColor clearColor]; //background color
addTitle.autocorrectionType = UITextAutocorrectionTypeNo; // no auto correction support
addTitle.keyboardType = UIKeyboardTypeDefault; // type of the keyboard
addTitle.returnKeyType = UIReturnKeyDone; // type of the return key
addTitle.clearButtonMode = UITextFieldViewModeWhileEditing; // has a clear 'x' button to the right
addTitle.delegate = self; // let us be the delegate so we know when the keyboard's "Done" button is pressed
[cell.contentView addSubview:addTitle];
} else if (indexPath.row == 1) {
// Set up loading text and show it
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(13, 13, 280, 20)];
myLabel.text = @"Private Album";
myLabel.textColor = [UIColor blackColor];
myLabel.textAlignment = UITextAlignmentLeft;
myLabel.backgroundColor = [UIColor clearColor];
myLabel.font = [UIFont fontWithName:@"Helvetica" size: 16.0];
myLabel.numberOfLines = 0;
//[myLabel sizeToFit];
privateSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(199, 8, 0, 0)];
[privateSwitch addTarget:self action:@selector(switchToggled:) forControlEvents: UIControlEventTouchUpInside];
[cell.contentView addSubview:privateSwitch];
//[privateSwitch setOn:NO animated:NO];
if ([howToDisplay isEqualToString:@"no"]) {
[privateSwitch setOn:NO animated:NO];
} else {
[privateSwitch setOn:YES animated:NO];
}
[cell.contentView addSubview:myLabel];
} else {
// Set up loading text and show it
UILabel *myLabel = [[UILabel alloc] initWithFrame:CGRectMake(13, 13, 280, 20)];
myLabel.text = @"Comments";
myLabel.textColor = [UIColor blackColor];
myLabel.textAlignment = UITextAlignmentLeft;
myLabel.backgroundColor = [UIColor clearColor];
myLabel.font = [UIFont fontWithName:@"Helvetica" size: 16.0];
myLabel.numberOfLines = 0;
//[myLabel sizeToFit];
[cell.contentView addSubview:myLabel];
commentsSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(199, 8, 0, 0)];
[cell.contentView addSubview:commentsSwitch];
[commentsSwitch setOn:YES animated:NO];
}
} else {
//cell.text = cellValue;
UILabel *labelOne = [[UILabel alloc] initWithFrame:CGRectMake(48, 12, 130, 20)];
labelOne.text = cellValue;
labelOne.textColor = [UIColor blackColor];
[labelOne setFont:[UIFont boldSystemFontOfSize:16]];
labelOne.textAlignment = UITextAlignmentLeft;
labelOne.backgroundColor = [UIColor clearColor];
//labelOne.font = [UIFont fontWithName:@"Helvetica"];
labelOne.numberOfLines = 0;
[cell.contentView addSubview:labelOne];
if (indexPath.row == 0) {
cell.selectionStyle = UITableViewCellSelectionStyleNone;
} else if (indexPath.row == 1) {
int countFacebook = [dataCeter.connectionFacebookArray count];
if (countFacebook == 0) {
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
} else {
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
} else if (indexPath.row == 2) {
//} else if (indexPath.row == 3) {
} else if (indexPath.row == 3) {
int countTumblr = [dataCeter.connectionTumblrArray count];
if (countTumblr == 0) {
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
} else {
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
} else if (indexPath.row == 4) {
} else if (indexPath.row == 5) {
} else {
cell.selectionStyle = UITableViewCellSelectionStyleBlue;
}
}
// Set imageView with correct thumbnail
UIImage *theImage;
if ([cellValue isEqualToString:@"Facebook"]) {
theImage = [UIImage imageNamed:@"icon_small_facebook.png"];
int countFacebook = [dataCeter.connectionFacebookArray count];
NSLog(@"facebook? %d // %@", countFacebook, dataCeter.connectionFacebookArray);
if (countFacebook != 0) {
facebookSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(199, 8, 0, 0)];
[cell.contentView addSubview:facebookSwitch];
[facebookSwitch setOn:YES animated:NO];
cell.accessoryType = UITableViewCellAccessoryNone;
} else {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
} else if ([cellValue isEqualToString:@"Twitter"]) {
theImage = [UIImage imageNamed:@"icon_small_twitter.png"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else if ([cellValue isEqualToString:@"Flickr"]) {
theImage = [UIImage imageNamed:@"icon_small_flickr.png"];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
} else if ([cellValue isEqualToString:@"Tumblr"]) {
theImage = [UIImage imageNamed:@"icon_small_tumblr.png"];
int countTumblr = [dataCeter.connectionTumblrArray count];
if (countTumblr != 0) {
tumblrSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(199, 8, 0, 0)];
[cell.contentView addSubview:tumblrSwitch];
[tumblrSwitch setOn:YES animated:NO];
cell.accessoryType = UITableViewCellAccessoryNone;
} else {
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
} else if ([cellValue isEqualToString:@"Email"]) {
theImage = [UIImage imageNamed:@"icon_small_email.png"];
int countEmail = [dataCeter.connectionEmailArray count];
} else if ([cellValue isEqualToString:@"MMS"]) {
theImage = [UIImage imageNamed:@"icon_small_mms.png"];
int countMMS = [dataCeter.connectionSMSArray count];
} else if ([cellValue isEqualToString:@"Photostream"]) {
theImage = [UIImage imageNamed:@"icon_small_photostream.png"];
cell.accessoryType = UITableViewCellAccessoryNone;
photostreamSwitch = [[UISwitch alloc] initWithFrame:CGRectMake(199, 8, 0, 0)];
[cell.contentView addSubview:photostreamSwitch];
[photostreamSwitch setOn:YES animated:NO];
} else {
theImage = nil;
cell.accessoryType = UITableViewCellAccessoryNone;
}
cell.imageView.image = theImage;
return cell;
}
```
|
Remove top shadow in my grouped UITableView?
|
CC BY-SA 3.0
| null |
2011-05-30T01:12:16.907
|
2011-11-27T19:01:45.510
|
2011-05-30T01:39:48.463
| 613,860 | 613,860 |
[
"objective-c",
"uitableview"
] |
6,171,845 | 1 | 6,172,689 | null | 1 | 2,178 |
Sorry for the obtuse title; [here's a jsfiddle example](http://jsfiddle.net/KPAVU/).
Basically, I've got a div inside of another one. The big one has a light blue background, and the little one has a darker blue background.
I want to give the smaller one a border on hover, so I start it with the same size border but the same color as the background (so that it doesn't move around when the border is added).
This border that is the same color as the background artifacts when there's a border radius. Take a look at Chrome:

But Safari is fine:

Is this a known bug? Can I submit a report?
And more importantly, is there a workaround?
|
Chrome bug: border-radius + border with same color as background -> artifacts
|
CC BY-SA 3.0
| null |
2011-05-30T02:45:57.227
|
2011-05-30T06:13:22.417
| null | null | 515,160 |
[
"html",
"css",
"google-chrome",
"webkit"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.