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,077,510 | 1 | null | null | 6 | 1,380 |
If I create a CheckBox control in WPF (with no Content -- I only need the check/uncheck part), it puts the "box" visual (the 3-D rectangle that either has or doesn't have a check mark in it) in the top-left corner of the control.
Can I put the "box" visual in the of the CheckBox control instead? That is, centered both horizontally and vertically? Something like this:

I can get something visually similar to this by setting the CheckBox's HorizontalAlignment and VerticalAlignment to Center. This causes the CheckBox control to shrink to just the size of its "box" visual, and then that gets centered within its parent. However, then it only responds to clicks on the "box" visual, which presents a much smaller and more inconvenient target.
|
How can I center a WPF checkbox inside its clickable region?
|
CC BY-SA 3.0
| null |
2011-05-20T20:56:33.830
|
2011-05-20T22:11:46.197
| null | null | 87,399 |
[
"wpf",
"checkbox"
] |
6,077,526 | 1 | 6,084,029 | null | 10 | 3,941 |
I am writing my own API to perform some of the functionality of the SndVol system utility. I would like part of this API to be the ability to set the volume level of a given [audio session](http://msdn.microsoft.com/en-us/library/ms678707.aspx).
SndVol displays a slider on the "Device" panel that the user can use to change the master volume level of the audio device as well as a slider for each audio session (on the "Applications" panel) that changes the volume level of the session:

If I drag the slider handle for one of the audio sessions, then SndVol is able to change the audio session's volume level. How does it do that?
I thought that it was possible using Windows Vista's [Core Audio API](http://msdn.microsoft.com/en-us/library/dd370805%28v=VS.85%29.aspx), but I encountered the problem that although I am able to iterate audio sessions of a device using an [IAudioSessionEnumerator](http://msdn.microsoft.com/en-us/library/dd368281%28v=VS.85%29.aspx), the `IAudioSessionEnumerator` only gives me access to [IAudioSessionControl](http://msdn.microsoft.com/en-us/library/dd368246%28v=VS.85%29.aspx) objects, but I need the [IAudioClient](http://msdn.microsoft.com/en-us/library/dd370865%28v=VS.85%29.aspx) object to obtain an [ISimpleAudioVolume](http://msdn.microsoft.com/en-us/library/dd316531%28v=VS.85%29.aspx) object that I can use to set the audio session volume level. Is it possible to get the `IAudioClient` object associated with an `IAudioSessionControl` object?
|
How is SndVol able to change the volume level of a given audio session?
|
CC BY-SA 3.0
| 0 |
2011-05-20T20:58:07.043
|
2011-05-21T19:43:35.623
|
2011-05-21T01:12:13.543
| 742,496 | 758,201 |
[
"c++",
"winapi",
"com",
"core-audio",
"wasapi"
] |
6,077,603 | 1 | 6,085,853 | null | 0 | 882 |
So what I am trying to produce is something like this:

Except, I do not want duplicates, when there is more than one sign, it becomes duplicated as well as re creating the "C" list view header. My SQL query is creating a column known as first_char which is holding the first character of one of the other columns.......below is my code:
```
<?php foreach ($data as $name=>$signs): ?>
<!-- If name is not empty, create the header -->
<?php if (isset($name) && !empty($signs)): ?>
<div data-role='collapsible-set' data-theme='d'>
<h2>Username: <strong id="headerName"><?=$name?></strong></h2>
<?php endif; ?>
<?php endforeach; ?>
<!-- for every sign, take the first char and create a list view -->
<?php foreach ($signs as $char):
$current_char = '';
if ($char['first_char'] != $current_char){
$current_char = $char['first_char'];
echo '<ul data-role="listview" data-dividertheme="d" style="margin-top: 0;"><li data-role="list-divider">'.$current_char.'</li></ul><br>';
}
foreach ($signs as $sign):
if($current_char == $sign['first_char'] and !empty($signs)):
?>
<div data-role='collapsible' data-collapsed='true' data-icon='arrow-l'>
<h3><?=$sign['sign_name']?></h3>
<div class='ui-grid-a'>
<div class="ui-block-a">
<div class="ui-bar ui-bar-d" style="height:25px;">
<strong>Last Seen:</strong><strong id="text"><?=$sign['last_connected']?></strong>
</div>
</div>
<div class="ui-block-a">
<div class="ui-bar ui-bar-d" style="height:25px;">
<strong>Resolution:</strong><strong id="text"><?=$sign['resolution_x'].'x'.$sign['resolution_y']?></strong>
</div>
</div>
<div class="ui-block-a">
<div class="ui-bar ui-bar-d" style="height:25px;">
<strong>Group Name:</strong><strong id="text"><?=$sign['group_name']?></strong>
</div>
</div>
<div class="ui-block-a">
<div class="ui-bar ui-bar-d" style="height:25px;">
<strong>Sign Number:</strong><strong id="text"><?=$sign['sign_id']?></strong>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
```
Thanks in advance
|
PHP dynamic alphabetical list with headers
|
CC BY-SA 3.0
| null |
2011-05-20T21:07:05.467
|
2012-09-24T19:42:55.267
| null | null | 631,179 |
[
"php",
"jquery",
"mysql",
"mobile"
] |
6,077,609 | 1 | 6,078,466 | null | 2 | 1,278 |
I am trying to get started with Maven and m2eclipse but I keep getting missing artifact errors:

`log4j` is in my local repository. I have m2eclipse set up to use an external installation of Maven although I realize that for dependency resolution it uses the embedded maven. I don't have any custom settings for maven set up, this is a plain install of m2eclipse and maven. I am able to add the dependencies I want through m2eclipse (such as log4j) and it adds them to my pom file. I am at home and not behind a corporate or particularly restrictive firewall.
Can anybody help me figure out what is going on?
Pom file:
```
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.xonatype.mavenbook.ch04</groupId>
<artifactId>simple-weather</artifactId>
<version>1.0</version>
<name>Simple Weather</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<type>jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<type>bundle</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>20040902.021138</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>1.1.1</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>velocity</groupId>
<artifactId>velocity</artifactId>
<version>1.5</version>
<type>pom</type>
<scope>compile</scope>
</dependency>
</dependencies>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
```
|
m2eclipse Missing Artifact
|
CC BY-SA 3.0
| null |
2011-05-20T21:08:05.473
|
2011-05-20T23:15:24.920
| null | null | 355,325 |
[
"java",
"eclipse",
"m2eclipse",
"maven-3"
] |
6,077,633 | 1 | null | null | 1 | 2,657 |
Due to subject area (writing on a wall) interesting condition is added - letters cannot change their order, so .
---
I saw a long word, written by paint on a wall, and now suddenly
I want all possible words and phrases I can get from this word by painting out any combination of letters. Wo r ds, randomly separated by whitespace are OK.
To broaden possible results let's make an assumption, that space is not necessary to separate words.
: Obviously letter order should be maintained (thanks idz for pointing that out). Also, phrases may be meaningless. Here are some examples:
```
Source word: disestablishment
paint out: ^ ^^^ ^^^^ ^^
left: i tabl e -> i table
or paint out:^^^^^^^^^ ^ ^^
left: ish e -> i she (spacelessness is ok)
```
Visual example 
Hard mode/bonus task: consider possible slight alterations to letters (D <-> B, C <-> O and so on) 
Please suggest your variants of solving this problem.
### Here's my general straightforward approach
It's clear that we'll need an English dictionary to find words.
Our goal is to get words to search for in dictionary.
We need to find all possible letters variations to match them against dictionary: each letter can be itself (1) or painted out (0).
Taking the 'space is not needed to separate words' condition in consideration, to distinguish words we must assume that there might be a space between any two letters (1 - there's a space, 0 - there isn't).
```
d i s e s t a b l i s h m e n t
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ - possible whitespace
```
`N` = number of letters in source word
`N-1` = number of 'might-be spaces'
Any of the `N + N - 1` elements can be in two states, so let's treat them as booleans. The number of possible variations is `2^(N + N - 1)`. Yes, it counts useless variants like pasting a space between to spaces, but I didn't come up with more elegant formula.
Now we need an algorithm to get all possible variations of `N+N-1` sequence of booleans (I haven't thought it out yet, but word flows through my mind). Then substitute all 1s with corresponding letters (if index of boolean is odd) or whitespace (even)
and 0s with whitespace (odd) or nothing (even). Then trim leading and trailing whitespace, separate words and search them in dictionary.
I don't like this monstrous approach and hope you will help me find good alternatives.
|
Find all words and phrases from one string
|
CC BY-SA 4.0
| null |
2011-05-20T21:10:53.073
|
2018-07-12T12:29:24.017
|
2020-06-20T09:12:55.060
| -1 | 196,171 |
[
"algorithm"
] |
6,077,908 | 1 | 6,078,200 | null | 6 | 4,810 |

Check the screenshot. You'll notice that the checkbox that has focus is actually rendering differently from the other checkboxes. What would make it appear this way in IE9?
I've got the following CSS snippet, and I've noticed only that if I remove ALL of the following CSS this issue no longer happens. But if I just remove any one or two of these rules it will still happen. I'm baffled.
```
textarea:active,
textarea:focus,
textarea:active:hover,
textarea:focus:hover,
select:active,
select:focus,
select:active:hover,
select:focus:hover,
input:active,
input:focus,
input:active:hover,
input:focus:hover{
background-color:#f9f9f5;
border-color:#658cae;
-webkit-box-shadow:inset 0 1px 2px #b8b7b3, 0 0 8px #7899b5;
-moz-box-shadow:inset 0 1px 2px #b8b7b3, 0 0 8px #7899b5;
box-shadow:inset 0 1px 2px #b8b7b3, 0 0 8px #7899b5;
z-index:1;/* for Opera */
}
input[type="file"]:focus,
input[type="file"]:active,
input[type="radio"]:focus,
input[type="radio"]:active,
input[type="checkbox"]:focus,
input[type="checkbox"]:active {
-moz-box-shadow: none;
-webkit-box-shadow: none;
box-shadow: none;
}
input[type="file"]:focus,
input[type="file"]:active,
input[type="file"][disabled],
input[type="radio"]:focus,
input[type="radio"]:active,
input[type="radio"][disabled],
input[type="checkbox"]:focus,
input[type="checkbox"]:active,
input[type="checkbox"][disabled]{
background-color:transparent;
}
```
Here's a live Demo: [http://jsfiddle.net/QRzRw/1/](http://jsfiddle.net/QRzRw/1/)
|
IE9 Checkbox rendering oddity on focus
|
CC BY-SA 3.0
| 0 |
2011-05-20T21:50:32.243
|
2011-09-29T09:53:48.137
| null | null | 79,677 |
[
"css",
"internet-explorer",
"checkbox"
] |
6,077,953 | 1 | 6,077,985 | null | 13 | 41,844 |
I want to test the performance of my app . I have started it with simple application and try to put traceview but its suddenly fail on my android phone with force to close. Please guide me how can i set my code propley for simple android app to get hands dirt with Trace view
Here is the code
package test.check;
```
import android.app.Activity;
import android.os.Bundle;
import android.os.Debug;
public class tracev extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Debug.startMethodTracing("traceview");
setContentView(R.layout.main);
}
@Override
protected void onStop() {
Debug.stopMethodTracing();
super.onStop();
}
}
```
Here is the manifest file
```
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.check"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="4" />
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".tracev"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
```
I have also added
```
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
```
but its not working . I think its becasue of this line in the logcat but i am not sure how to deal with it
```
05-20 23:39:43.913: ERROR/dalvikvm(11673): Unable to open trace file '/sdcard/traceview.trace': Permission denied
```
Logcat
```
05-20 23:39:43.903: DEBUG/dalvikvm(11673): +++ active profiler count now 1
05-20 23:39:43.913: INFO/dalvikvm(11673): TRACE STARTED: '/sdcard/traceview.trace' 8192KB
05-20 23:39:43.913: ERROR/dalvikvm(11673): Unable to open trace file '/sdcard/traceview.trace': Permission denied
05-20 23:39:43.913: DEBUG/dalvikvm(11673): +++ active profiler count now 0
05-20 23:39:43.913: DEBUG/AndroidRuntime(11673): Shutting down VM
05-20 23:39:43.913: WARN/dalvikvm(11673): threadid=3: thread exiting with uncaught exception (group=0x4001e390)
05-20 23:39:43.913: ERROR/AndroidRuntime(11673): Uncaught handler: thread main exiting due to uncaught exception
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): java.lang.RuntimeException: Unable to start activity ComponentInfo{test.check/test.check.tracev}: java.lang.RuntimeException: file open failed
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2596)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2621)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.ActivityThread.access$2200(ActivityThread.java:126)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1932)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.os.Handler.dispatchMessage(Handler.java:99)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.os.Looper.loop(Looper.java:123)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.ActivityThread.main(ActivityThread.java:4595)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at java.lang.reflect.Method.invokeNative(Native Method)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at java.lang.reflect.Method.invoke(Method.java:521)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:860)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at dalvik.system.NativeStart.main(Native Method)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): Caused by: java.lang.RuntimeException: file open failed
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at dalvik.system.VMDebug.startMethodTracing(Native Method)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at dalvik.system.VMDebug.startMethodTracing(VMDebug.java:156)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.os.Debug.startMethodTracing(Debug.java:443)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.os.Debug.startMethodTracing(Debug.java:391)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at test.check.tracev.onCreate(tracev.java:12)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2544)
05-20 23:39:43.983: ERROR/AndroidRuntime(11673): ... 11 more
05-20 23:39:44.013: INFO/Process(94): Sending signal. PID: 11673 SIG: 3
05-20 23:39:44.013: INFO/dalvikvm(11673): threadid=7: reacting to signal 3
05-20 23:39:44.023: INFO/dalvikvm(11673): Wrote stack trace to '/data/anr/traces.txt'
05-20 23:39:51.213: DEBUG/KeyguardViewMediator(94): pokeWakelock(15000)
05-20 23:39:51.213: INFO/HtcLockScreen(94): Press Menu key to unlock screen
```
I am wondering about one point there is nothing in the sdcard and in front of it there is no device selected . May be it can be the cause of error , here is the picture

|
unable to open trace file
|
CC BY-SA 3.0
| 0 |
2011-05-20T21:54:38.310
|
2018-03-12T13:27:31.927
|
2011-05-20T22:30:56.733
| 667,340 | 667,340 |
[
"android"
] |
6,078,290 | 1 | 6,079,404 | null | 4 | 671 |
Follow-up from another post here: [IE7 li bullet or number shown outside of div](https://stackoverflow.com/questions/6076730/ie7-li-bullet-or-number-shown-outside-of-div)
In the previous post, the li element outside the div was fixed, but now I have another IE7 bug with the hover element. Since the hover element can not be set through the , how do I fix this one?
P.S. Obviously I've been having some trouble with the hasLayout bug in IE, so it someone was to give a nice explanation it would be appreciated.
Again everything works in firefox, etc.
The screenshots:


The code:
```
#create_request ol {
width: 339px;
}
#create_request li {
display: list-item;
line-height: 23px;
background-color: #E3E3E3;
list-style: decimal;
list-style-position: inside;
padding-left: 25px;
padding-top: 5px;
}
#create_request li.alternate {
background-color: white;
}
#create_left li:hover {
width: 356px;
background: url('/images/list_add.png') 100% 100% no-repeat;
background-color: #B0B0B0;
cursor: pointer;
}
```
|
IE7 <li> bullet/number outside of hover
|
CC BY-SA 3.0
| null |
2011-05-20T22:45:19.697
|
2012-01-05T21:25:29.307
|
2017-05-23T12:01:09.563
| -1 | 320,919 |
[
"html",
"css",
"internet-explorer"
] |
6,078,323 | 1 | 6,127,759 | null | 0 | 1,547 |
I'm working with an EF data model which is exposed through an OData service endpoint. It has Person and Group entities which are connected through a many-to-many relationship.

I would like to add a link from an existing Person with an existing Group through OData, but I have been unable to figure out how. The OData protocol as specified [here (link to odata.org)](http://www.odata.org/media/6655/%5Bmc-apdsu%5D%5B1%5D.htm#_Toc246716600) seems to specify that I need to do the following HTTP request to link Person #1 to Group #1:
- - [http://localhost:49432/MyService.svc/Persons(1)/](http://localhost:49432/MyService.svc/Persons(1)/)
With the body as follows:
```
{
__count: 1,
results: [{
uri: "http://localhost:49432/MyService.svc/Groups(1)"
}]
}
```
However, when I do that, I get the following error:
```
400 Bad Request
"Missing URI element. For link operations, URI element must be specified."
```
I have no idea what URI element is missing. I have provided that in both the request URI and in the payload...
I have also tried several other approaches, but no success so far. Any suggestions?
Thanks!
|
How to link two existing items (many-to-many) via the OData HTTP protocol?
|
CC BY-SA 3.0
| null |
2011-05-20T22:51:24.420
|
2011-05-26T17:57:32.273
|
2011-05-26T17:37:42.247
| 163,227 | 163,227 |
[
"entity-framework",
"many-to-many",
"odata",
"wcf-data-services"
] |
6,078,368 | 1 | 6,078,730 | null | 5 | 12,152 |
I am trying to write a small media player using GTK+ and GStreamer and currently using the XOverlay Interface to embed the video in a GtkDrawing Area the mainwindow.
The program was compiled using this command:
```
g++ /home/phongcao/cacao.cc -o /home/phongcao/cacao `pkg-config --cflags --libs gtk+-2.0 gstreamer-0.10 gstreamer-plugins-base-0.10 gstreamer-interfaces-0.10`
```
The problem is that the video was displayed in a window (instead of of the main window):

Here is the source code of the program:
```
#include <gst/interfaces/xoverlay.h>
#include <gtk/gtk.h>
#include <gst/gst.h>
#include <gdk/gdkx.h>
GstElement *play;
GtkAdjustment *progress;
GtkWidget *mainwindow, *drawingarea;
class TopWin
{
public:
TopWin();
~TopWin();
int Initialize(int argc, char *argv[]);
int Execute();
static void FileChooser(GtkButton *button, GtkWindow *mainwindow);
static int Play(gchar *addr);
static gboolean print_position(GstElement *element);
private:
};
TopWin::TopWin() {
}
TopWin::~TopWin() {
}
gboolean TopWin::print_position(GstElement *play) {
GstFormat fmt = GST_FORMAT_TIME;
gint64 pos, len;
if (gst_element_query_position(play, &fmt, &pos) && gst_element_query_duration(play, &fmt, &len)) {
g_print("Time: %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT "\r", GST_TIME_ARGS(pos), GST_TIME_ARGS(len));
gtk_adjustment_set_value(GTK_ADJUSTMENT(progress), (pos*100)/len);
}
return TRUE;
}
int TopWin::Play(gchar *addr) {
GMainLoop *loop;
GstBus *bus;
loop = g_main_loop_new(NULL, FALSE);
play = gst_element_factory_make("playbin", "play");
g_object_set(G_OBJECT(play), "uri", addr, NULL);
bus = gst_pipeline_get_bus(GST_PIPELINE(play));
gst_object_unref(bus);
GstElement* x_overlay = gst_element_factory_make("xvimagesink", "videosink");
g_object_set(G_OBJECT(play), "video-sink", x_overlay, NULL);
gst_x_overlay_set_window_handle(GST_X_OVERLAY(x_overlay), GDK_WINDOW_XID(drawingarea->window));
gst_element_set_state(play, GST_STATE_NULL);
g_timeout_add(1000, (GSourceFunc) print_position, play);
gtk_adjustment_set_value(GTK_ADJUSTMENT(progress), 0);
gst_element_set_state(play, GST_STATE_PLAYING);
g_main_loop_run(loop);
gst_element_set_state(play, GST_STATE_NULL);
gst_object_unref(GST_OBJECT(play));
gtk_widget_show_all(mainwindow);
gtk_widget_realize(drawingarea);
return 0;
}
void TopWin::FileChooser(GtkButton *button, GtkWindow *mainwindow) {
GtkWidget *filechooser;
gchar *uri;
filechooser = gtk_file_chooser_dialog_new("Open File...", mainwindow, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(filechooser), FALSE);
gint response = gtk_dialog_run(GTK_DIALOG(filechooser));
if (response == GTK_RESPONSE_OK) {
uri = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER(filechooser));
gtk_widget_destroy(filechooser);
Play(uri);
g_free(uri);
}
else if (response == GTK_RESPONSE_CANCEL) {
gtk_widget_destroy(filechooser);
}
}
int TopWin::Initialize(int argc, char *argv[]) {
GtkWidget *playbutton, *openbutton, *volumebutton;
GtkWidget *prefbutton, *notebook;
GtkWidget *vbox, *hbox;
GtkWidget *entry, *hscale;
gtk_init(&argc, &argv);
gst_init(&argc, &argv);
mainwindow = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_set_border_width(GTK_CONTAINER(mainwindow), 0);
g_signal_connect(G_OBJECT(mainwindow), "destroy", G_CALLBACK(gtk_main_quit), NULL);
playbutton = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(playbutton), gtk_image_new_from_stock(GTK_STOCK_MEDIA_PLAY, GTK_ICON_SIZE_SMALL_TOOLBAR));
openbutton = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(openbutton), gtk_image_new_from_stock(GTK_STOCK_OPEN, GTK_ICON_SIZE_SMALL_TOOLBAR));
g_signal_connect(G_OBJECT(openbutton), "clicked", G_CALLBACK(TopWin::FileChooser), (gpointer) mainwindow);
volumebutton = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(volumebutton), gtk_image_new_from_file("volume.png"));
prefbutton = gtk_button_new();
gtk_button_set_image(GTK_BUTTON(prefbutton), gtk_image_new_from_stock(GTK_STOCK_EXECUTE, GTK_ICON_SIZE_SMALL_TOOLBAR));
entry = gtk_entry_new();
progress = GTK_ADJUSTMENT(gtk_adjustment_new(0.00, 0.00, 100.00, 1.00, 0.00, 0.00));
hscale = gtk_hscale_new(progress);
gtk_scale_set_draw_value(GTK_SCALE(hscale), FALSE);
gtk_widget_set_size_request(hscale, 200, NULL);
hbox = gtk_hbox_new(FALSE, 0);
drawingarea = gtk_drawing_area_new();
vbox = gtk_vbox_new(FALSE, 0);
gtk_box_pack_start(GTK_BOX(hbox), openbutton, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(hbox), playbutton, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(hbox), hscale, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(hbox), volumebutton, FALSE, FALSE, 2);
gtk_box_pack_start(GTK_BOX(hbox), entry, TRUE, TRUE, 2);
gtk_box_pack_start(GTK_BOX(hbox), prefbutton, FALSE, FALSE, 2);
gtk_button_set_relief(GTK_BUTTON(playbutton), GTK_RELIEF_NONE);
gtk_button_set_relief(GTK_BUTTON(openbutton), GTK_RELIEF_NONE);
gtk_button_set_relief(GTK_BUTTON(volumebutton), GTK_RELIEF_NONE);
gtk_button_set_relief(GTK_BUTTON(prefbutton), GTK_RELIEF_NONE);
gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
gtk_box_pack_start(GTK_BOX(vbox), drawingarea, FALSE, FALSE, 0);
gtk_container_add(GTK_CONTAINER(mainwindow), vbox);
gtk_widget_show_all(mainwindow);
gtk_widget_realize(drawingarea);
return 0;
}
int TopWin::Execute() {
gtk_main();
return 0;
}
int main(int argc, char *argv[])
{
int result = 0;
TopWin* topwin = new TopWin();
if (0 == topwin->Initialize(argc, argv)) {
result = topwin->Execute();
}
delete topwin;
return result;
}
```
Thank you for helping me with this problem! I have spent almost 3 days scratching over my head for this. The XOverlay reference on GStreamer website is so confusing... :(
Please tell me if you need any additional information... Thank you!!
|
How to embed video in GTK+ application window using GStreamer & XOverlay?
|
CC BY-SA 3.0
| 0 |
2011-05-20T22:57:28.243
|
2021-07-20T22:24:43.703
|
2011-05-21T04:37:42.297
| 656,037 | 656,037 |
[
"c++",
"c",
"gtk",
"gstreamer"
] |
6,078,431 | 1 | 6,078,549 | null | 2 | 981 |
I've got a couple of Parallel Nsight compatible CUDA GPU's. The second (lower) one is connected to my monitor, and the first (upper) one is is set up as a PhysX accelerator. You can clearly see my configuration below.
Now in order to perform CUDA debugging with Nsight, I need to only run kernel code on the GPU not connected to the monitor. My computer is already setup for "headless debugging". Also below is a basic example of code I wish to execute on the other GPU:
```
// KernelCall.cu
#include <iostream>
#include "cuda.h"
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
__global__ void kernel(void){}
int main()
{
kernel<<<1,1>>>();
system("pause");
return 0;
}
```
My question is basically what do I need to put in this code so that it only executes on the other device and allow me to perform CUDA debugging?

|
Selecting a device for CUDA debugging
|
CC BY-SA 3.0
| null |
2011-05-20T23:09:46.043
|
2011-06-28T03:24:32.540
|
2011-05-21T12:59:12.370
| 134,633 | 522,665 |
[
"c++",
"debugging",
"cuda",
"gpu"
] |
6,078,449 | 1 | null | null | 2 | 1,183 |
I've been racking my brain about an easy way to generate an HTML table with rowspans with PHP that would look like this, numbers indicating each cell's rowspan:

I noticed that there is sort of a pattern in the rowspans if you go from left to right, top to bottom: 1,3,7,1,1,1,1,1,3,1,1. I'm not sure if that matters.
Also, I wonder if it's possible to use any method for the table above for a table like this:

|
Dynamically generate a table with specific rowspans in PHP?
|
CC BY-SA 3.0
| 0 |
2011-05-20T23:12:22.280
|
2016-10-26T18:28:12.657
|
2016-10-26T18:28:12.657
| 4,370,109 | 720,047 |
[
"php",
"html",
"html-table"
] |
6,078,487 | 1 | 6,078,840 | null | 5 | 575 |
I have a small application developed in ASP.NET 2.0 WebForms. For learning purpose, I am thinking to convert this application to MVC 3 + Entity Framework. Below is the simplest example to simulate my application. Nothing fancy.
(image should read "input fields" and not "files")


1. Methods in Service layer is using ADO.NET SqlCommand ExecuteReader method to execute stored procedures
2. Most of the manipulation etc. logic is done in stored procedures. Hardly any manipulation of data in Service layer
Now I want to convert this application to MVC.
1. What benefit do I get (technically) if I convert this application into MVC + Entity Framework?
2. How do I go about it?
3. I have looked at some basic MVC3 tutorials but they all talk about EF code-first, which I don't think will fit in my case since I want to use the existing stored procedures. Is that correct?
I want to use the existing stored procedures. Say I don't have control on DB structure changes.
1. There isn't a single inline query in my application. Even the smallest little query is a stored procedure. Tons of them.
2. Using SQL Server and almost nil chances of changing to any other DBS.
My webforms application is 99% complete and can go live anytime but due to some business hurdles it hasn't. In mean while I thought if I can convert (i.e. develop) this to MVC, I will learn plus if it works out can go live (my first MVC) instead of the webforms one.
|
Creating WebForms App in MVC 3 + Entity Framework
|
CC BY-SA 3.0
| 0 |
2011-05-20T23:19:11.097
|
2016-10-09T16:21:54.157
|
2016-10-09T16:21:54.157
| 13,302 | 294,176 |
[
"asp.net",
"asp.net-mvc",
"entity-framework"
] |
6,078,640 | 1 | null | null | 9 | 1,523 |
Having long sound tape with 3 speakers on it , how to get info on how there mouthes open/close? We have audio recording, with more than one speaker. Sound is clear and does not require noise reduction. We want to create some animation with speaking 3d heads. Generally we want to find out from sound data mouthes movement.
Really we have 3d heads moving somehow via some default animation. Like we have prepared animation for O sound for each person, we need some info: on which millisecond which person produced which sound?
So it is like voice to text but for sounds and for more than one person on one recording.

In general (perfect case) we want to obtain some signals on movements of D9, D6, D5 point pairs. From more than one speaker, English language of course.
Are there any papers with algorithms or opensource libraries?
So far I have found some libraries
[http://freespeech.sourceforge.net/](http://freespeech.sourceforge.net/)
[http://cmusphinx.sourceforge.net/](http://cmusphinx.sourceforge.net/)
but I had never used any of them yet...
|
Is there any signal-processing algorithm that could reverse-engineer how the sound wave was produced through the vocal system of group of humans?
|
CC BY-SA 3.0
| 0 |
2011-05-20T23:50:47.187
|
2015-01-26T04:27:17.883
|
2011-05-21T02:24:38.627
| 434,051 | 434,051 |
[
"c++",
"c",
"algorithm",
"audio",
"signal-processing"
] |
6,078,720 | 1 | 6,079,191 | null | 2 | 250 |
I'm putting an old text into HTML. Sometimes it uses Greek terms and phrases. But there's one character I've never seen before. It seems to be a combination of two other characters: small omicron (`ο`, ο) + small upsilon with perispomeni (`ῦ`, ῦ). Here is a PNG illustrating the character, and how it works:

Does anyone know how to put this character into HTML? Can it be found anywhere in Unicode? Has anyone even heard of it?
Thanks.
|
Unicode/HTML question about obscure Greek character
|
CC BY-SA 3.0
| null |
2011-05-21T00:09:23.850
|
2011-05-21T02:15:15.670
|
2011-05-21T00:24:07.880
| 317,849 | 763,544 |
[
"html",
"unicode"
] |
6,078,777 | 1 | 6,078,916 | null | 4 | 3,380 |
How can I generate Atom Feed which will contain the namespaces displayed in the image below? All the nodes of the Atom feed have to start with "a:".

Here is what I am doing right now, however it doesn't work.
```
SyndicationFeed feed = new SyndicationFeed();
XmlQualifiedName key = new XmlQualifiedName("os", "xmlns");
feed.AttributeExtensions.Add(key, "http://a9.com/-/spec/opensearch/1.1/");
```
Thanks!
|
How to create a SyndicationFeed with a custom namespace
|
CC BY-SA 3.0
| 0 |
2011-05-21T00:19:57.867
|
2011-05-22T06:31:59.947
| null | null | 42,024 |
[
"c#",
".net",
"syndication",
"syndication-feed"
] |
6,079,045 | 1 | 9,695,877 | null | 1 | 1,045 |
I am trying to reproduce the UI for the iphone/iOS SMS app in my application. I am adapting the Three20 TTTextBarController. Unfortunately, my efforts have resulted in a bar that is substantially uglier because of aliasing near the rounded corners.

(StackOverflow shrinks the above image - please view the above image in full-screen mode. At that resolution you will see the aliasing).
The Three20 style code I have used to create the text bar element is as follows:
```
- (TTStyle*)textBarTextField {
return
[TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:13] next:
[TTInsetStyle styleWithInset:UIEdgeInsetsMake(6, 0, 3, 6) next:
[TTInsetStyle styleWithInset:UIEdgeInsetsMake(1, 0, 1, 0) next:
[TTShadowStyle styleWithColor:RGBACOLOR(255,255,255,0.4) blur:0 offset:CGSizeMake(0, 1) next:
[TTSolidFillStyle styleWithColor:RGBACOLOR(255,255,255,1.0) next:
[TTInnerShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.4) blur:3 offset:CGSizeMake(0, 2) next:
[TTBevelBorderStyle styleWithHighlight:RGBACOLOR(0,0,0,0.25) shadow:RGBACOLOR(0,0,0,0.2)
width:1 lightSource:270 next:nil]]]]]]];
}
```
Can anyone advise how to improve the quality of the rounded corners? Alternatively, has anyone figured out how to pixel-for-pixel emulate the iOS SMS chat bar?
Thanks!
My original code came from TTDefaultStyles.m.
After simplifying I came to this style:
```
return
[TTShapeStyle styleWithShape:[TTRoundedRectangleShape shapeWithRadius:13] next:
[TTInsetStyle styleWithInset:UIEdgeInsetsMake(6, 0, 4, 6) next:
[TTLinearGradientBorderStyle styleWithColor1:RGBCOLOR(51,51,51)
color2:RGBCOLOR(102, 102, 102) width:1 next:
[TTSolidFillStyle styleWithColor:RGBACOLOR(255,255,255,1.0) next:
[TTInnerShadowStyle styleWithColor:RGBACOLOR(0,0,0,0.8) blur:3 offset:CGSizeMake(0, 2) next:nil
]]]]];
```
From what I can tell, the TTInnerShadowStyle is what is causing the aliasing to be visible on the top left and right. I'd love to get the code that Apple is using for their seamless UITextField shadow...
|
How can I make my iOS TTTextEditor rounded corners less aliased in Three20?
|
CC BY-SA 3.0
| 0 |
2011-05-21T01:35:04.207
|
2012-03-14T04:20:36.257
|
2011-05-21T07:44:10.437
| 61,072 | 61,072 |
[
"iphone",
"uiview",
"three20",
"antialiasing"
] |
6,079,124 | 1 | 8,981,748 | null | 4 | 4,655 |
I got this error when trying to launch my Qt-application (which was deployed with macdeployqt) on another Mac.
```
dyld: Library not loaded: kqoauth.framework/Versions/0/kqoauth
Referenced from: /MyProject.app/Contents/MacOS/MyProject
Reason: image not found
Trace/BPT trap
```
I checked the .app-bundle and copied the kqoauth.framework to a few different locations (Frameworks-folder, next to the executable file, Resources-folder) but the error remained.
This is my project-tree:

I also tried otool -L on it and everything seems to be fine. (the entry for kqoauth.framework looked the same as those for the qt-libraries)
|
dyld: Library not loaded (image not found) but it's there
|
CC BY-SA 3.0
| null |
2011-05-21T01:56:50.280
|
2016-10-21T13:20:15.807
| null | null | 446,835 |
[
"c++",
"qt",
"macos",
"deployment"
] |
6,079,224 | 1 | 6,079,428 | null | 2 | 4,888 |
I have following class which I use for radio button binding
```
public class RadioButtonSwitch : ViewModelBase
{
IDictionary<string, bool> _options;
public RadioButtonSwitch(IDictionary<string, bool> options)
{
this._options = options;
}
public bool this[string a]
{
get
{
return _options[a];
}
set
{
if (value)
{
var other = _options.Where(p => p.Key != a).Select(p => p.Key).ToArray();
foreach (string key in other)
_options[key] = false;
_options[a] = true;
RaisePropertyChanged("XXXX");
else
_options[a] = false;
}
}
}
```
XAML
```
<RadioButton Content="Day" IsChecked="{Binding RadioSwitch[radio1], Mode=TwoWay}" GroupName="Monthly" HorizontalAlignment="Left" VerticalAlignment="Center" />
```
ViewModel
```
RadioSwitch = new RadioButtonSwitch(
new Dictionary<string, bool> {{"radio1", true},{"radio2", false}}
);
```
I tried putting:
- - -
I keep getting following error:

This is so in case of any change I can handle it in my view accordingly. Please do not give me solutions for List for radio buttons etc.
|
C# - Dynamic properties and RaisePropertyChanged
|
CC BY-SA 3.0
| 0 |
2011-05-21T02:27:51.317
|
2011-05-21T07:27:46.447
|
2011-05-21T02:53:43.503
| 1,725,011 | 1,725,011 |
[
"c#",
"binding",
"dynamic-properties"
] |
6,079,292 | 1 | null | null | 6 | 5,423 |
How can I produce borders that don't stretch the whole width of a given box? E.g.:

Do I have to use a separate HTML element with a different width? Or can I achieve this entirely via CSS.
|
Partial width borders
|
CC BY-SA 3.0
| 0 |
2011-05-21T02:46:00.333
|
2011-05-22T22:06:02.597
|
2011-05-22T22:06:02.597
| 25,068 | 25,068 |
[
"html",
"css",
"border"
] |
6,079,403 | 1 | 7,139,165 | null | 12 | 3,142 |
When a UITableView of type UITableViewStyleGrouped has a background view that is a non-default color or pattern image on the iPad, the rounded corners have an ugly extra line, sort of like a bevel effect or drop shadow:

Does anyone know of any way to get rid of the extra line at the bottom of the table?
|
Remove corner shadow/offset in grouped UITableView
|
CC BY-SA 3.0
| 0 |
2011-05-21T03:22:18.093
|
2011-08-21T15:25:19.750
| null | null | 228,600 |
[
"ipad",
"uitableview"
] |
6,079,414 | 1 | 6,079,433 | null | 1 | 74 |
I have created a function `timeout_func` that will and return its output, but if the function exceeds 'secs' it will return a string 'failed'.
Basically, it's a workaround to timeout a function which could run infinitely. (python 2.7 on windows) (Why do I need a workaround, why can't I just make the function non-infinite? Because sometimes you just can't do that, it' called in known processes ie: `fd = os.open('/dev/ttyS0', os.O_RDWR)`
Anyways, my timeout_func was inspired from help I received here:
[kill a function after a certain time in windows](https://stackoverflow.com/questions/6068361/kill-a-function-after-a-certain-time-in-windows)
The problem with my code is that for some reason the `do_this` function is receiving 14 variables instead of one. I get the error msg when running it by double clicking the script or from python.exe. From IDLE you get no exception errors....

However, if I change it to:
```
def do_this(bob, jim):
return bob, jim
```
It works just fine...
What's going on here? It doesn't like the 1 variable functions...?
```
import multiprocessing
import Queue
def wrapper(queue, func, func_args_tuple):
result = func(*func_args_tuple)
queue.put(result)
queue.close()
def timeout_func(secs, func, func_args_tuple):
queue = multiprocessing.Queue(1) # Maximum size is 1
proc = multiprocessing.Process( target=wrapper, args=(queue, func, func_args_tuple) )
proc.start()
# Wait for TIMEOUT seconds
try:
result = queue.get(True, secs)
except Queue.Empty:
# Deal with lack of data somehow
result = 'FAILED'
print func_args_tuple
finally:
proc.terminate()
return result
def do_this(bob):
return bob
if __name__ == "__main__":
print timeout_func( 10, do_this, ('i was returned') )
x = raw_input('done')
```
|
Why is this sending so many variables?
|
CC BY-SA 3.0
| null |
2011-05-21T03:25:49.983
|
2011-05-21T03:31:20.620
|
2017-05-23T12:07:02.087
| -1 | 747,254 |
[
"python"
] |
6,079,446 | 1 | 6,079,475 | null | 3 | 922 |
Is there a separate library or component that renders text in Ubuntu? How to write a OpenGL program that renders text exactly the same as the system?

|
Is it possible to use Ubuntu's text rendering engine in my OpenGL program?
|
CC BY-SA 3.0
| 0 |
2011-05-21T03:39:31.163
|
2011-05-21T05:42:11.090
| null | null | 667,027 |
[
"opengl",
"ubuntu"
] |
6,079,440 | 1 | null | null | 0 | 318 |
I want to resize my toolbar when orientation changes.
But I have faced a difficult problem.
I have two view controllers.
The first view controller have a button. When this button touches, the second view will appear on display. These view controllers belong to a navigation controller.
The first view controller make navigation bar show. And second view controller make navigation bar hide.
```
- ( void ) viewWillAppear: ( BOOL )animated {
[ super viewWillAppear: animated ];
[ [ [ self navigationController ] navigationBar ] setHidden: NO ];
UIButton *nextButton;
nextButton = [ UIButton buttonWithType: UIButtonTypeRoundedRect ];
[ nextButton setFrame: CGRectMake( 50.0, 50.0, 200.0, 150.0 ) ];
[ nextButton setTag: 100 ];
[ nextButton addTarget: self action: @selector( touchedNextButton: ) forControlEvents: UIControlEventTouchUpInside ];
[ [ self view ] addSubview: nextButton ];
}
- ( BOOL ) shouldAutorotateToInterfaceOrientation: ( UIInterfaceOrientation )interfaceOrientation {
// Return YES for supported orientations
BOOL iResult;
iResult = ( ( interfaceOrientation == UIInterfaceOrientationPortrait ) || ( interfaceOrientation == UIInterfaceOrientationLandscapeLeft ) ||
( interfaceOrientation == UIInterfaceOrientationLandscapeRight ) );
return iResult;
```
}
```
- ( void ) didRotateFromInterfaceOrientation: ( UIInterfaceOrientation )fromInterfaceOrientation {
UIInterfaceOrientation orientation = [ [ UIDevice currentDevice ] orientation ];
UIButton *button = ( UIButton * )[ [ self view ] viewWithTag: 100 ];
switch ( orientation ) {
case UIInterfaceOrientationPortrait:
[ button setFrame: CGRectMake( 50.0, 50.0, 200.0, 150.0 ) ];
break;
case UIInterfaceOrientationLandscapeLeft:
case UIInterfaceOrientationLandscapeRight:
[ button setFrame: CGRectMake( 50.0, 50.0, 200.0, 150.0 ) ];
break;
default:
break;
}
}
```
```
- ( void ) viewDidLoad {
[ [ [ self navigationController ] navigationBar ] setHidden: YES ];
UIImage *imageBackArrow_iPhone = [ UIImage nonCachedImageNamed: @"backArrow_iPhone.png" ];
NSMutableArray *toolbarItems = [ [ NSMutableArray alloc ] initWithCapacity: 5 ];
[ toolbarItems addObject: [ [ [ UIBarButtonItem alloc ] initWithImage: imageBackArrow_iPhone style: UIBarButtonItemStylePlain target: self
action: @selector( touchedBackArrowButton ) ] autorelease ] ];
UIToolbar *toolbar = [ [ UIToolbar alloc ] initWithFrame: CGRectMake( 0.0, 416.0, 320.0, 44.0 ) ];
[ toolbar setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleTopMargin ];
[ toolbar setItems: toolbarItems ];
[ toolbarItems release ];
[ [ self view ] addSubview: toolbar ];
[ toolbar release ];
}
}
```
The rest methods in second view controller are similar to the first view contoller.


After starting on portrait mode in the first view controller, I touched the next button. Changing Orientations work fine.
(The first screen shot)
But starting on portrait mode in the first view controller, I changed to landscape mode.
Then I touched the next button, this made weird layout.
(The second screen shot)
I don't know what makes this problem.
Please let me know your experiences. Your advices will make me awake.
Thank you for your reading.
|
I want to resize my toolbar
|
CC BY-SA 3.0
| null |
2011-05-21T03:34:26.047
|
2011-05-21T05:33:27.670
| null | null | 619,267 |
[
"iphone",
"orientation"
] |
6,079,503 | 1 | 6,079,693 | null | 1 | 192 |
I am trying to replicate the Navigation Buttons which exist within the ASP.NET Site:
[http://forums.asp.net/user/editprofile.aspx#](http://forums.asp.net/user/editprofile.aspx#) (you have to log-in to see the tabs)

As you can see for an onClick Event the background of the Tab changes to white and the Text changes from Blue to Black. There is also a top left and right border applied to the Tab for an onClick. Also on the Hover the underline for the Button's Hyperlink appears.
I tried to replicate as much as I could with Firebug, but Im missing some things. For example in my Fiddle the Button's Hyperlink remains underlined.
Im also very unclear about the Click Event within the JQuery and how this is changing the background color from blue to white, and how the border is applied.
if anyone could improve upon this I would really appreciate it.
Here is what I have so far: [http://jsfiddle.net/NinjaSk8ter/XrQys/](http://jsfiddle.net/NinjaSk8ter/XrQys/)
|
CSS Styling Navigation Buttons
|
CC BY-SA 3.0
| null |
2011-05-21T03:54:34.903
|
2011-05-21T18:22:22.293
|
2011-05-21T05:02:14.820
| 598,931 | 598,931 |
[
"jquery",
"html",
"css"
] |
6,079,513 | 1 | 6,079,525 | null | 2 | 408 |
I am creating a database of structures that can be of different types. Each of the types has a set of unique attributes such as the materials, shape, properties related specifically to the type of structure.
For instance, a structure is a bridge which can have a span length and material type for the deck.
Another instance of a structure would be a wall which has a height and material type and thickness.
I do not want to generate a flat table that contains all possible attributes as there are many types of structures that could exist and the attributes are flexible and there are numerous attributes to store.
Basically we want to prevent records from getting too large by storing unique attribute data in a separate table for each type of structure but I can't think of a way to link the generic structure table to point to the attribute tables easily.
====================
EDIT,
Now that searched for "generalization specialization relational modeling" it appears that I want to model the data as a object oriented structure with a parent class "structure" that has child classes that inherit the common information as bridge structure, wall structure. The only issue now is that I am trying to help a engineer make a simple stand alone Access 2010 database but it appears that I am correctly generating the relationships within access with the primary key of the parent class being the primary and foreign key of the child classes. This appears to cause an issue inside Access 2010 where it wants instances of the parent to contain one of each child class which is non-sense.
Basically I have,
StructureID as the primary key on both structure, bridge, and wall tables on the bridge and wall table their primary key which is the structureID links back to the structure table. I am not too familiar with Access 2010 and don't know why it doesnt work.
From one of the IBM papers,

Basically want to make this in an Access 2010.
|
Relational Database Structure Storing Unique Attributes of SubCatagories
|
CC BY-SA 3.0
| null |
2011-05-21T03:57:03.257
|
2011-05-21T22:03:22.657
|
2011-05-21T05:18:16.993
| 249,426 | 249,426 |
[
"database-design"
] |
6,079,691 | 1 | 6,079,716 | null | 0 | 2,368 |
```
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
if ((self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]))
{
self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel
target:self
action:@selector(cancel)];
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Send to Twitter"
style:UIBarButtonItemStyleDone
target:self
action:@selector(save)];
}
return self;
}
```
Another piece of code
```
- (void)loadView
{
[super loadView];
self.navigationController.navigationBar.tintColor = [UIColor blackColor];
self.view.backgroundColor = [UIColor whiteColor];
self.textView = [[UITextView alloc] initWithFrame:self.view.bounds];
textView.delegate = self;
textView.font = [UIFont systemFontOfSize:15];
textView.contentInset = UIEdgeInsetsMake(5,5,0,0);
textView.backgroundColor = [UIColor whiteColor];
textView.autoresizesSubviews = YES;
textView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
[self.view addSubview:textView];
}
```
I'm trying to change the navigation bar color to black, however no matter what i do here, the color still stays default (Blue). How do you change the color of the bar on top of the view??

|
Changing the color of a UINavigationBar
|
CC BY-SA 3.0
| null |
2011-05-21T04:58:03.857
|
2012-03-29T07:06:10.340
|
2011-05-21T05:43:47.037
| 525,919 | 737,308 |
[
"iphone",
"objective-c",
"uinavigationcontroller",
"uinavigationbar"
] |
6,080,111 | 1 | 6,080,494 | null | 0 | 666 |
I want to create a simple textbox like in the picture in java. It displays a short text and close after a short time or we can click close button. Thanks first :)

|
Draw a simple textbox in java?
|
CC BY-SA 3.0
| null |
2011-05-21T06:41:38.347
|
2011-05-21T09:03:23.020
|
2011-05-21T07:02:12.910
| 5,772,384 | 195,727 |
[
"java",
"textbox"
] |
6,080,136 | 1 | 6,220,545 | null | 0 | 2,494 |

I want to implement a feature in my iphone app that does something similar to this. To have 2 different color fonts in 1 sentence. I read somewhere on stack overflow about three 20, but three 20 won't work on my app. I also read something about textview? but I tried to read the documentation for that, but i didn't really understand.
Anyone have some sample code or any other suggestions??
thanks!
|
Having multiple color fonts in one sentence in xcode/iphone
|
CC BY-SA 3.0
| 0 |
2011-05-21T06:48:30.887
|
2011-06-02T21:21:05.960
|
2011-05-21T08:30:02.527
| 375,300 | 737,308 |
[
"iphone",
"objective-c",
"nsstring"
] |
6,080,150 | 1 | 6,091,509 | null | 0 | 3,727 |
I had problems with resolving R several times after I added new layout XML files. I use Eclipse and API 8. Sometimes it goes away after I "clean" the project, or close and then reopen the project. I tried to add "import android.R" but it didn't help. Someone said that this is because some layout XML files have errors, but the file looks right to me.
Here is an XML file, `res/layout/status.xml`, that I had problems with:
```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">
<Button android:text="Button" android:id="@+id/button_tmp" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
</LinearLayout>
```
and here is how I use it:
```
public class StatusActivity extends Activity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.status);
}
}
```
One more thing, this XML file has a question mark in the "Package Explore" panel in Eclipse, but the `main.xml` has a different icon. I have only two layout XML files now.
Do I need to do something special in Eclipse to add a new layout XML file?
Thanks for your help!
Update a screenshot of icons in the "Package Explore" panel:

|
Cannot resolve R after adding new layout XML files
|
CC BY-SA 3.0
| null |
2011-05-21T06:51:46.313
|
2013-05-15T13:02:28.447
|
2011-05-21T16:02:17.700
| 313,294 | 313,294 |
[
"android",
"layout"
] |
6,080,192 | 1 | 6,080,415 | null | 2 | 289 |
i have Visual Studio 2010.
Recently I was using MVC2 and due to some reason I installed MVC3 in my computer. Everything was working fine, till today.
Now when I am creating new project, I am getting below error:



Please help
When I open the C# project file of the application and tried to run I am getting the below error
Also when I added a controller and tried to right click on the method to create view. I am not getting any option of "Add View"
Linked to another question [Error while running MVC3 Application after reinstalling also](https://stackoverflow.com/questions/6168185/error-while-running-mvc3-application-after-reinstalling-also)
|
Error while running MVC3 Application
|
CC BY-SA 3.0
| null |
2011-05-21T07:00:54.330
|
2011-05-29T15:04:34.123
|
2017-05-23T10:32:35.693
| -1 | 609,582 |
[
"visual-studio-2010",
"asp.net-mvc-3"
] |
6,080,179 | 1 | null | null | 2 | 352 |
I'm having some trouble with a project. To understand the problem it's useful to give a little backgroundinfo.
So, I'm creating a sleepingdiary. What I want to create is the following. When you click on day 1, the comment you added appears in the box on the left. The commentbox on the right is for the doctor who comments on your sleeping behaviour.
So far, so good. I get both comments from the database. But when I click on day 2, I should see the comments from day 2. However this doesn't work. Currently I just managed the click on day 2 with jQuery, maybe that's the problem. But how to fix it otherwise? Create a page for every day?
Please don't let the amount of code scare you away. :)

Saving on the right day works fine, printing after saving a new comment works fine as well. But it's echoing the same loop that causes the trouble I guess.
Here's my code:
```
<?php
if(mysqli_num_rows($feedbackPatient) > 0)
{
while($oUser = mysqli_fetch_assoc($allUsers))
{
echo $oUser['DiaryOpmerkingen'];
}
}
?>
```
```
<div id="book1">
<form action="" method="POST">
<input class="confirmday" name="day" value="1"/>
<?php include("phpinclude/feedbackday1.php"); ?>
</form>
</div>
<!-- einde dag 1 -->
```
```
public function getFeedback($p_iUserid) {
include("Connection.php"); //open db
/*$dayid = mysql_real_escape_string($_GET['day']);*/
$id = $_SESSION['id'];
/*DiaryId = {$dayid}*/
try
{
$sql = "select DiaryOpmerkingen, DiaryDoctorcomment from tblDiary
WHERE fk_UserId = ".$p_iUserid."
AND DiaryDay = '".$this->Day."';";
$rResult = mysqli_query($link, $sql);
return $rResult;
}
catch(Exception $e)
{
// no connection database
$feedback = $e->getMessage();
}
mysqli_close($link);
}
```
```
include("classes/User.class.php");
$oUser = new User();
if(!empty($_POST['patientfb']))
{
try
{
$oUser->Patientfb = $_POST['patientfb'];
$oUser->Day = $_POST['day'];
$oUser->saveFeedbackP($_SESSION['id']);
$feedback = "Uw commentaar werd succesvol toegevoegd.";
}
catch (Exception $e)
{
$feedback = $e->getMessage();
}
}
$allUsers = $oUser->getFeedback($_SESSION['id']);
```
Totally stuck here. I really hope someone can help me out. Hope the question is clear. If you need more code, just ask. Thanks in advance!
|
Echo the same thing on one page over and over again
|
CC BY-SA 3.0
| null |
2011-05-21T06:58:17.937
|
2011-10-14T23:01:49.380
|
2011-05-21T07:11:26.567
| null | null |
[
"php",
"oop",
"class",
"echo"
] |
6,080,235 | 1 | 6,080,273 | null | 2 | 23,024 |
I want to fill a combobox on Form1 , when the OK button on Form2 is clicked.
First, the Load Form2 button on Form1 is clicked to display Form2.
Then, Form2 appears, and if OK(Button on Form2) is pressed then the Form1 ComboBox must be filled with values from a SQL SERVER database table.
```
public partial class FORM1 : Form
{
public void LoadValue()
{
string query = "SELECT FullName FROM Studs ";
SqlCommand cmd = new SqlCommand(query, FORM1conn);
SqlDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
FORM1COMBOBOX.Items.Add(reader.GetString(0));
}
}
}
public partial class FORM2 : Form
{
private void FORM2_OK_Button_Click(object sender, EventArgs e)
{
//HERE I WANT TO CALL THE LOADVALUE() METHOD OF FORM1 ????????
}
}
```

In form2.cs :
```
public partial class FORM2 : Form
{
public FORM2(SqlConnection connfromFORM3)
{
Form2Conn = connfromFORM3;
InitializeComponent();
}
private Form1 form1;
public SELECTGROUPHEADDIALOG(FORM1 form1) : this()
{
this.form1 = form1;
}
private void FORM2_OK_Button_Click(object sender, EventArgs e)
{
//HERE I WANT TO CALL THE LOADVALUE() METHOD OF FORM1 ????????
}
}
```
|
calling method on one form from another form, fill combobox on Form1 if a button on Form2 is clicked
|
CC BY-SA 3.0
| null |
2011-05-21T07:11:52.890
|
2016-09-13T22:24:47.970
|
2011-05-21T09:02:45.457
| 613,929 | 613,929 |
[
"c#",
".net",
"winforms"
] |
6,080,307 | 1 | 6,080,478 | null | 8 | 35,781 |
I want to use a calendar in my application like the calendar in the image below.

I want this calendar UI in my activity. How can I accomplish this?
|
How to display a calendar UI in an Android application?
|
CC BY-SA 3.0
| 0 |
2011-05-21T07:30:48.683
|
2018-04-05T15:48:48.093
|
2011-05-24T03:21:22.510
| 29,995 | 630,668 |
[
"android",
"calendar"
] |
6,080,542 | 1 | 6,081,244 | null | 2 | 7,979 |
I'm doing the calculation of the critical path for the DAG of the image, according to [this algorithm](https://stackoverflow.com/questions/6007289/calculating-the-critical-path-of-a-graph) for another post.My teacher requires that aarray be implemented, I simplify the homework statement, a simple graph implemented through arrays.

This es my code in which I have 3 arrays v, u and d, representing the origin node of the edges, the end node of the edges and the distance between each pair of vertices, as shown in the picture above. in the graph of the image, the duration of the project is equal to 25 corresponding to the sum of distances from the critical path.
My code fails to make good the calculation of distances according to the pseudocode of [this link](https://stackoverflow.com/questions/6007289/calculating-the-critical-path-of-a-graph)
```
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <iostream>
#include <algorithm>
using namespace std;
int main (){
int numberVertex=6; //number of vertex
int numberActivities=9;//number of edges
int i, j;
/*vertices are of the form (v, u) */
//indegree of each vertex (that is, count the number of edges entering them)
int indegree [6]={0,0,0,0,0,0};
int v[9]={0,0,1,1,2,4,3,3,3};//array v represent the starting vertex of de edge
int u[9]={1,2,2,3,4,5,4,5,5};//array u represent the coming vertex of de edge
int d[9]={5,6,3,8,2,12,0,1,4};//array d represent the time of de activity (v,u)
int project_duration=0;//project duration
/*# Compute the indegree for each vertex v from the graph:
for each neighbor u of v: indegree[u] += 1*/
for (j=0; j<numberActivities; j++){
indegree[u[j]]++;
}
for (j=0;j<numberVertex; j++)
printf ("indegree %d= %d\n",j,indegree[j] );
queue<int> Q; //queue Q = empty queue
int distance [numberVertex];
memset(distance, 0, sizeof(int) * numberVertex);//distance = array filled with zeroes
//for each vertex v:
//if indegree[v] = 0:
//insert v on Q
for (j=0; j<numberVertex; j++)
{
if (indegree[j]==0)
Q.push(v[j]);
}
int first;
//printf ("first in the queue=%d\n", Q.front());
/*for each neighbor u of v:
d istance[u] = max(distance[u], distance[v] + time(v, u))
indegree[u] -= 1
if indegree[u] = 0:
insert u on Q
*/
while (!Q.empty()){ //while Q is not empty:
first= Q.front (); //v = get front element from Q
Q.pop(); //delete de first from queue
distance[u[first]]=std::max(distance[u[first]],
distance[v[first]]+ d[first]);
indegree[u[first]]-=1;
if (indegree[u[first]]==0){
Q.push(u[first]);
}
}
for (j=0; j<numberVertex; j++)
{
printf ("dist [%d]= %d\n", j, distance[j]);
}
/*Now, select the vertex x with the largest distance.
This is the minimum total project_duration.*/
printf ("Total Project Duration %d\n", project_duration);
return (0);
}
```
What am I doing wrong or how it could solve the code to tell me what is the duration of the project (corresponds to the sum of distances from the critical path)?. only able to calculate the distance to the first 3 vertex.
|
Calculating critical path of a DAG in C++
|
CC BY-SA 3.0
| 0 |
2011-05-21T08:25:32.237
|
2011-05-21T10:54:33.777
|
2017-05-23T11:48:23.740
| -1 | 59,468 |
[
"c++",
"path",
"graph-theory",
"dynamic-programming",
"directed-acyclic-graphs"
] |
6,080,596 | 1 | 6,080,607 | null | 64 | 42,323 |
I have the following IntegrationTest project structure ...

If i wish to use that test data `126.txt` in an `NUnit Test`, how do I load that plain txt file data?
NOTE: The file is `-linked-` and I'm using c# (as noted by the image).
cheers :)
|
How can I load this file into an NUnit Test?
|
CC BY-SA 3.0
| 0 |
2011-05-21T08:35:43.990
|
2022-02-18T14:32:45.350
| null | null | 30,674 |
[
"c#",
".net",
"testing",
"tdd",
"nunit"
] |
6,080,710 | 1 | null | null | 0 | 584 |
I need US culture. How do this?

|
How set culture for dataGrid validation (silverlight)
|
CC BY-SA 3.0
| null |
2011-05-21T08:58:11.870
|
2011-05-21T12:14:45.727
|
2011-05-21T12:14:45.727
| 17,516 | 450,466 |
[
"silverlight",
"silverlight-4.0",
"culture"
] |
6,080,866 | 1 | 6,083,287 | null | 0 | 546 |
I am new to Objective-C, can anyone tell me how to get this kind

of back button on the navigation bar, on click of that it should navigate to previous page.
|
How to get this kind of back button in iphone
|
CC BY-SA 3.0
| null |
2011-05-21T09:30:15.207
|
2011-08-12T11:29:47.473
|
2011-05-21T09:49:25.983
| 491,980 | 766,047 |
[
"iphone",
"objective-c"
] |
6,081,005 | 1 | null | null | 2 | 4,818 |
```
-(UITableViewCell*) makeLikeCell
{
// Load the top-level objects from the custom cell XIB.
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"SpotlightLikesTableViewCell" owner: self options: nil];
// Grab a pointer to the first object (presumably the custom cell, as that's all the XIB should contain).
UITableViewCell *cell = [topLevelObjects objectAtIndex:0];
NSString *likeText = [likesAndComments objectAtIndex: kLikeRow];
TTTAttributedLabel *likeLabel = [[[TTTAttributedLabel alloc] initWithFrame:CGRectZero] autorelease];
likeLabel = (TTTAttributedLabel*) [cell viewWithTag: kCaptionTag];
likeLabel.textColor = [UIColor blueColor];
likeLabel.lineBreakMode = UILineBreakModeWordWrap;
[likeLabel setFont: [UIFont fontWithName: @"Helvetica Neue" size: 10]];
[likeLabel setText: likeText afterInheritingLabelAttributesAndConfiguringWithBlock: ^NSAttributedString *(NSMutableAttributedString *mutableAttributedString) {
NSRange colorRange = [[mutableAttributedString string] rangeOfString: @" like this photo." options: NSCaseInsensitiveSearch];
[mutableAttributedString addAttribute:(NSString *) kCTForegroundColorAttributeName value:(id)[[UIColor grayColor] CGColor] range:colorRange];
return mutableAttributedString; }];
return cell;
}
```
I added the TTT attributed label to my project. I want to have 2 different font colors to display the "likes". However my project keeps crashing. A sample string to be formatted would be: "andrew, john, amos likes this photo."
any suggestions?

|
TTT attributed Label Multi- colored Font help
|
CC BY-SA 3.0
| 0 |
2011-05-21T10:00:29.657
|
2013-02-05T08:09:16.103
| null | null | 737,308 |
[
"iphone",
"objective-c",
"xcode",
"nsattributedstring"
] |
6,081,026 | 1 | 6,081,039 | null | 0 | 3,228 |
I want to bind combobox to value only and distinct name .But I get like this:

I want only value eg;
Please answer to me.My code is like this
DataTable acc= accessory.GetData();
> var query = (from t in acc.AsEnumerable()select new
{```
name = t["type"].ToString(),
color = t["color"].ToString()
}).Distinct().ToList();
```
cmbAccessoryName.DataSource = query;
|
How to bind combobox to linq result value only?
|
CC BY-SA 3.0
| null |
2011-05-21T10:05:55.903
|
2011-05-21T10:18:18.977
| null | null | 134,130 |
[
"c#",
"linq"
] |
6,081,018 | 1 | 6,081,079 | null | 1 | 1,293 |
I can't currently understand why my update method in my repository for the style entity is throwing a NullReferenceException in my Linq to SQL domain model layer. The problem seems to be that the `EntitySet<Product> Product` property on the Style object that I am updating is null following the necessary use of a Detach method. The actual exception is thrown on the attach prior to the submission of changes.
My update is only meant to target the Style table, the Product reference should not really come into it, but the relationship is mapped in the code generated by SQLMetal, which is an important part of my application design.
If I delete the foreign key relationship, recreate the mapping class and adjust code accordingly, the problem goes away. I would however like to kep the forign key relationship if possible.
I will attempt to best explain the set up:
The relationship in the SQL server database is like so, with the Product table referencing the Style table:

The entity mapping class is created with SQLMetal, as far as I know, there is nothing unusual in the way this is generated.
```
public Style Update(Style style)
{
using (var dc = new ProjectERPDataContext(Config.ConnectionStringERPDB))
{
style.Detach();
dc.Style.Attach(style);
dc.Refresh(RefreshMode.KeepCurrentValues, style);
dc.SubmitChanges();
return style;
}
}
```
The detach method exists because without, the exception is thrown: "An attempt has been made to Attach or Add an entity that is not new, perhaps having been loaded from another DataContext. This is not supported."
```
public partial class Style
{
public void DetachEntityRefs()
{
this._Product = default(EntitySet<Product>);
}
}
```
```
[Table(Name="dbo.Style")]
public partial class Style : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private int _ID;
private string _Name;
private EntitySet<Product> _Product;
```

```
System.NullReferenceException : Object reference not set to an instance of an object.
at System.Data.Linq.Mapping.EntitySetDefSourceAccessor`2.GetValue(T instance)
at System.Data.Linq.Mapping.MetaAccessor`2.GetBoxedValue(Object instance)
at System.Data.Linq.ChangeTracker.StandardChangeTracker.StandardTrackedObject.HasDeferredLoader(MetaDataMember deferredMember)
at System.Data.Linq.ChangeTracker.StandardChangeTracker.StandardTrackedObject.get_HasDeferredLoaders()
at System.Data.Linq.ChangeTracker.StandardChangeTracker.Track(MetaType mt, Object obj, Dictionary`2 visited, Boolean recurse, Int32 level)
at System.Data.Linq.ChangeTracker.StandardChangeTracker.Track(Object obj, Boolean recurse)
at System.Data.Linq.Table`1.Attach(TEntity entity, Boolean asModified)
at ProjectERP.DomainModel.Repositories.SQLStyleRepo.Update(Style style) in SQLStyleRepo.cs: line 45
at ProjectERP.UnitTests.DomainModel.SQLStyleRepoTests.Test_can_update_style() in SQLStyleRepoTests.cs: line 67
```
|
Linq to SQL Update - NullReferenceException on update following Detach
|
CC BY-SA 3.0
| null |
2011-05-21T10:04:10.150
|
2011-05-21T10:20:39.320
|
2011-05-21T10:19:54.133
| 341,062 | 341,062 |
[
"linq",
"linq-to-sql",
"linq-to-entities"
] |
6,081,189 | 1 | 6,081,395 | null | 0 | 1,623 |

Above is the screenshot of the site in development...
We have a DropdownList control and on its SelectedIndexChanged it postbacks, and we then change the site culture and it then loads the respective resources files.
```
<asp:DropDownList ID="ddlLanguage" runat="server" CssClass="select-language" AutoPostBack="true">
<asp:ListItem Value="en-US" Text="English" title="/images/Flag_USA.gif"></asp:ListItem>
<asp:ListItem Value="it-IT" Text="Italiano" title="/images/Flag_Italian.gif"></asp:ListItem>
<asp:ListItem Value="fr-FR" Text="Française" title="/images/Flag_French.gif"></asp:ListItem>
</asp:DropDownList>
```
```
using System;
using System.Web;
using System.Threading;
using System.Globalization;
public class languagebase : System.Web.UI.Page
{
protected override void InitializeCulture()
{
try
{
string LanguageCode = Request["ctl00$ucMenu$ddlLanguage"]; // Language Drop Down Control in Front End
if (!LanguageCode.IsNullOrEmpty())
{
setCulture(LanguageCode); // Set Culture language from drop down
Request.Cookies["LanguageCode"].Value = LanguageCode; // Update REQUEST Cookie language from drop down
SetCookies(LanguageCode); // Set Cookie language from drop down
}
}
catch(Exception ex)
{
setCulture("en-US"); // Set default language
Request.Cookies["LanguageCode"].Value = "en-US"; // Update REQUEST Cookie language to default
SetCookies("en-US"); // Set default language
}
base.InitializeCulture();
}
private static void setCulture(string LanguageValue)
{
Thread.CurrentThread.CurrentUICulture = new CultureInfo(LanguageValue);
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(LanguageValue);
}
public void SetCookies(string strLanguage)
{
System.Web.HttpContext.Current.Response.Cookies["LanguageCode"].Value = strLanguage;
System.Web.HttpContext.Current.Response.Cookies["LanguageCode"].Expires = DateTime.Now.AddDays(15);
}
}
```
```
public static Boolean IsNullOrEmpty(this String original)
{
return string.IsNullOrEmpty(original);
}
```
```
<li>
<img src="/images/my-listing.png" alt="" align="absmiddle" /><asp:HyperLink ID="hlnkMyProperties" runat="server" meta:resourcekey="hlnkMyProperties"></asp:HyperLink>
</li>
```
> > Here, if I reload the page from the browser's addressbar then resources are loaded correctly.
I am just imaging how it is possible that the certain controls have English resources and some have old Italian resources when switching the culture?
I hope I have explained it well.
|
Localization resources not changing on certain hyperlink controls in a page
|
CC BY-SA 3.0
| null |
2011-05-21T10:40:12.727
|
2012-11-26T19:30:46.233
|
2012-11-26T19:30:46.233
| 63,550 | 468,718 |
[
"c#",
".net",
"asp.net",
"localization",
"cultureinfo"
] |
6,081,221 | 1 | null | null | 2 | 605 |
I have created a pdf file and attached it in the email. It shows the complete PDF file as image in email composer.

I just want to show the icon of pdf file instead of complete pdf file. Like this:

Thanks.
|
show pdf icon in email instead of pdf image - iphone
|
CC BY-SA 3.0
| 0 |
2011-05-21T10:48:51.653
|
2011-05-21T17:45:07.537
| null | null | 419,894 |
[
"iphone",
"ipad",
"email"
] |
6,081,368 | 1 | 6,081,405 | null | 16 | 7,998 |
I've seen some programs showing amazing highly detailed 3d scenes with soundtracks, but what shocked me is that they are all smaller than 64kB! How do these programs work?

|
64kB demos, how do they work?
|
CC BY-SA 3.0
| 0 |
2011-05-21T11:20:34.623
|
2014-12-26T10:18:54.210
|
2011-05-21T12:48:43.747
| 445,517 | 667,027 |
[
"3d",
"demoscene"
] |
6,081,844 | 1 | 6,081,896 | null | 0 | 9,162 |
I am trying to make something look like following (don't concern color here. my concern here is the shape);

I tried something with following code but didn't succeed!
```
<html>
<head>
<style type="text/css">
#header{border:3px solid gray;padding:10px;}
#header-left-container{border:1px solid gray;float:left;width:30%;}
#header-right-container{border:1px solid gray;float:right;width:69%;}
</style>
</head>
<body>
<div id="header">
<div id="header-left-container">
pooo
</div>
<div id="header-right-container">
bla bla bla.....
</div>
</div>
</body>
</html>
```
I know this can be done with table easily but I don't wanna use table in my application where I can do the same with div elements.
any suggestion here?
|
Two div element next to each other (For page header)
|
CC BY-SA 3.0
| null |
2011-05-21T12:49:54.973
|
2011-05-21T14:13:15.410
| null | null | 463,785 |
[
"css",
"html"
] |
6,081,857 | 1 | 6,081,891 | null | 5 | 2,341 |
This is puzzling me. I'm using PetaPoco to retreive some values from a database, and then looping over them and retrieving a value to assign to one of the properties of each object.
```
public IEnumerable<RetreaveIndex> FillResults(IEnumerable<RetreaveIndex> results)
{
//add the associated users
foreach (RetreaveIndex index in results)
{
index.AssociatedUsers = _registeredUserDao.GetUsersByIndex(index).ToList();
}
return results;
}
```
When I set a breakpoint during the foreach loop, the AssociatedUsers property is being set correctly.

but then in a breakpoint at the end of the loop, it didn't save it?

I'm confused, shouldn't Index be a reference to a place in memory which is being modified? It's an object after all. What am I missing here?
|
Modifying a property of an object inside of a foreach loop doesn't work?
|
CC BY-SA 3.0
| 0 |
2011-05-21T12:53:00.817
|
2011-06-03T14:00:59.300
| null | null | 126,597 |
[
"c#",
".net",
"foreach"
] |
6,081,935 | 1 | 6,086,123 | null | 2 | 275 |
Why doesn't this work?
I have bypassed this before but i can't remember how i did it, and I never went on to figure out why this type of inputs didn't work. About time to get to know it!
For those who cant see the pic:
```
RegionPlot3D[
x^2 + 2 y^2 - 2 z^2 = 1 && -1 <= z <= 1, {x, -5, 5}, {y, -5,
5}, {z, -1, 1}]
Set::write: "Tag Plus in -2.+25.+50. is Protected"
```
And then there is just an empty cube without my surface.

|
Using Boole with MaxValue and or PlotRegion
|
CC BY-SA 3.0
| null |
2011-05-21T13:05:50.770
|
2011-05-22T05:02:14.943
| null | null | 225,360 |
[
"wolfram-mathematica"
] |
6,082,126 | 1 | 6,082,265 | null | 13 | 11,965 |
I have the following Hello World code to try out TeX rendering with matplotlib on my Mac.
```
import matplotlib.pyplot as plt
from matplotlib import rc
rc('text', usetex=True)
rc('font', family='serif')
plt.text(2,2,r"Hello World!")
plt.show()
```
With that code, I'd get the following error:
```
sh: latex: command not found
Exception in Tkinter callback
<... a long Traceback here ...>
RuntimeError: LaTeX was not able to process the following string:
'lp'
Here is the full report generated by LaTeX:
```
I don't see any kind of full report after the last line. Anyway, I think this is a path problem. Some pointers on how I could fix it? I have TeX Live 2010.
I tried adding `/Library/TeX/Root/bin/universal-darwin` to the Global Python Path of the Project Properties, but I still get the same errors.

|
TeX in matplotlib on Mac OS X and TeX Live
|
CC BY-SA 3.0
| 0 |
2011-05-21T13:46:35.523
|
2017-01-13T16:01:31.017
|
2011-05-21T14:00:08.507
| 366,309 | 366,309 |
[
"python",
"macos",
"matplotlib",
"tex"
] |
6,082,311 | 1 | 6,082,408 | null | 13 | 9,773 |
The question title is kind of vague, but I really don't know what the thing is called.

I am trying to create one of those yellow informational popup things. Anyone can tell me what they're called and how I can create them?
|
Create informational popup / tooltip in Cocoa
|
CC BY-SA 3.0
| 0 |
2011-05-21T14:19:21.520
|
2018-04-12T11:37:00.000
|
2015-09-11T05:03:56.837
| 1,832,942 | 124,257 |
[
"cocoa",
"macos",
"popup",
"tooltip"
] |
6,082,308 | 1 | 6,082,397 | null | 1 | 527 |
```
class Array
{
double *mx; int mn;
public:
Array();
~Array(){delete []mx};
Array& operator-(Array& b); //first right way
Array operator -(Array b); //wrong way, but I don't understand why
};
Array::Array ()
{
mn=10;
mx=new double[mn];
}
//first, works perfectly
Array& Array::operator -(Array& b)
{
int i=0;
for(i=0;i<mn ;i++)
this->mx[i]-=b.mx[i];
return *this;
}
// here is Error
Array Array::operator -(Array b)
{
int i=0;
for(i=0;i<mn ;i++)
this->mx[i]-=b.mx[i];
}
int main() {
Array x,b;
x=x-b;
}
```
If I use the first overload , all works right.
But if I use the second, all is compiled well, but when program is executed, i receive many errors like this:
```
"c++ ** glibc detected *** double free or corruption"
```

I can't figure out why this occurs.
As I understand, when I call `Array Array::operator-(Array b)`, the object must be copied and all must be well, but there is error.
well i've read that i've to object that are allocated at the same place in the memory. but i've tried to do this:
```
Array Array::operator +(Array b)
{ Array c;
int i=0;
for(i=0;i<mn;i++)
this->mx[i]+=b.mx[i];
cout<<&this->mx<<" "<<&b.mx<<endl;
exit(0);
return c; }
```
i 've expected to receive same addresses in memory....
answer is 0xbfb45188 0xbfb45178 why are they equal?
furhermore, when i declare here name of class(A object)
compiler must give a new memory in stack for object
where am i wrong? i dont understand....
|
c++ mystic transfer of class array
|
CC BY-SA 3.0
| null |
2011-05-21T14:18:59.067
|
2011-05-21T15:02:44.397
|
2011-05-21T15:02:44.397
| 758,158 | 758,158 |
[
"c++",
"memory",
"dynamic",
"parameters",
"transfer"
] |
6,082,440 | 1 | null | null | 7 | 9,401 |
>
[android get and parse Google Directions](https://stackoverflow.com/questions/2964982/android-get-and-parse-google-directions)
There are lat & lng between points tag ,how to parse?

|
How to parse Google Maps direction api's "overview_polyline"
|
CC BY-SA 3.0
| 0 |
2011-05-21T14:42:32.550
|
2012-01-24T16:57:36.827
|
2017-05-23T12:01:16.000
| -1 | 495,873 |
[
"google-maps"
] |
6,082,612 | 1 | 6,082,830 | null | 0 | 299 |

That will be listview row.
Orange background is btn_default_small_selected:
```
android:background="@drawable/btn_default_small_selected"
```
|
How to create layout like on the picture?
|
CC BY-SA 3.0
| null |
2011-05-21T15:10:58.680
|
2011-05-21T22:25:14.663
| null | null | 604,388 |
[
"android",
"android-layout"
] |
6,082,763 | 1 | null | null | 10 | 10,385 |
I've been searching far and wide on the seven internets, and have come to no avail. The closest to what I need seems to be [The cutting stock problem](http://en.wikipedia.org/wiki/Cutting_stock_problem), only in 2D (which is disappointing since Wikipedia doesn't provide any directions on how to solve that one). Another look-alike problem would be [UV unwrapping](http://www.polycount.com/forum/showthread.php?t=80947). There are solutions there, but only those that you get from add-ons on various 3D software.
Cutting the long talk short - what I want is this: given a rectangle of known width and height, I have to find out how many shapes (polygons) of known sizes (which may be rotated at will) may I fit inside that rectangle.
For example, I could choose a T-shaped piece and in the same rectangle I could pack it both in an efficient way, resulting in 4 shapes per rectangle

as well as tiling them based on their bounding boxes, case in which I could only fit 3

But of course, this is only an example... and I don't think it would be much use to solving on this particular case. The only approaches I can think of right now are either like backtracking in their complexity or solve only particular cases of this problem. So... any ideas?
|
Placing 2D shapes in a rectangle efficiently. How to approach it?
|
CC BY-SA 3.0
| 0 |
2011-05-21T15:41:28.890
|
2015-05-10T03:15:58.613
| null | null | 342,079 |
[
"algorithm",
"2d",
"uv-mapping",
"texture-packing"
] |
6,082,813 | 1 | 6,084,337 | null | 0 | 1,572 |
I know sometimes (here lately) I've been asking more questions than I answer and for that I apologize, but I have yet another question.
Thanks to Kev Ritchie my last issue has been resolved, but that just lead me to another error. When I try debugging ( > then I am promptly greeted with this error:
> System.TypeLoadException: Could not
load type
'GodsCreationTaxidermy.Data.GenericRepository`1'
from assembly 'GodsCreationTaxidermy,
Version=1.0.0.0, Culture=neutral,
PublicKeyToken=null'.
This is the code that the view >
```
[CanonicalUrlAttribute("Index")]
public virtual ActionResult Index()
{
var viewModel = image.Find(x => x.is_featured.Value);
return View(viewModel);
}
```
And here's a screenshot of the error (I tried several ideas from this site already and none have worked thus far) . The line it is highlighting is where I initialize StructureMap, this line
```
x.ForRequestedType(typeof(IRepository<>))
```
Here's the entire initialize code in the Gobal.asax
```
ObjectFactory.Initialize(x =>
{
x.ForRequestedType<IUnitOfWorkFactory>()
.TheDefaultIsConcreteType<EFUnitOfWorkFactory>()
.CacheBy(InstanceScope.HybridHttpSession);
x.ForRequestedType(typeof(IRepository<>))
.CacheBy(InstanceScope.HybridHttpSession)
.TheDefaultIsConcreteType(typeof(GenericRepository<>));
});
```
Anyone got any ideas, the last thing I tried was to empty everything from the bin folder, clean the solution then rebuild it as stated in [this thread](http://rlm.cc/jaWhfH) from here on SO. This project used to work (not completed but what was completed worked like a charm), all I did was move GenericRepository to GodsCreationTaxidermy.Data from GodsCreationTaxidermy.Data.Repository, not sure how that could have broke this.
|
Could not load type 'xxx`1' from assembly from assembly
|
CC BY-SA 3.0
| null |
2011-05-21T15:51:05.340
|
2011-05-21T20:40:33.470
|
2011-05-21T16:11:39.347
| 88,230 | 88,230 |
[
"asp.net-mvc-2",
"structuremap"
] |
6,082,831 | 1 | 6,082,846 | null | 0 | 188 |
I am getting the below error when i am running the ASP.Net project.
> The source was not found, but some or all event logs could not be searched. Inaccessible logs: Security.
I have tried running `regedit.exe` going to system and security folders and gave full control to all the users in my system but still no luck.....could any one tell me any other solution?
|
ASP.Net EventLog Error while running the project
|
CC BY-SA 3.0
| null |
2011-05-21T15:55:38.393
|
2011-05-21T17:28:16.450
|
2011-05-21T16:57:14.597
| 564,184 | 564,184 |
[
"asp.net"
] |
6,082,966 | 1 | 6,083,044 | null | 0 | 229 |
[See my fiddle here.](http://jsfiddle.net/6yU6N/41/)
I am trying to position the header inside the div like so:

Not having much luck. What's going on? How do position within the table row header?
``
|
Positioning table header in div
|
CC BY-SA 3.0
| null |
2011-05-21T16:22:38.357
|
2017-01-02T23:08:35.953
|
2017-01-02T23:08:35.953
| 4,370,109 | 251,257 |
[
"html",
"css",
"tabular"
] |
6,083,264 | 1 | 6,083,467 | null | 9 | 2,309 |
I am looking for / trying to develop an optimal algorithm for [rectilinear polygon](http://en.wikipedia.org/wiki/Rectilinear_polygon) intersection with rectangles. The polygons I am testing do not have holes.
Answers like those given [here](https://stackoverflow.com/questions/2272179/a-simple-algorithm-for-polygon-intersection) and [here](http://sourceforge.net/projects/polyclipping/) are for very general polygons, and the solutions are understandably quite complex.
Hoping that the [S.O.](http://stackoverflow.com) community can help me document algorithms for the special cases with just rectilinear polygons.
I am looking for the polygon filled in green in the image below:

|
rectilinear polygon intersection
|
CC BY-SA 3.0
| 0 |
2011-05-21T17:17:09.013
|
2011-05-23T11:40:12.763
|
2017-05-23T12:19:48.617
| -1 | 62,255 |
[
"algorithm",
"math",
"geometry"
] |
6,083,375 | 1 | 6,083,414 | null | 0 | 296 |
```
<input type="checkbox" ID="RecquireFacebookInvitesCB" />Require
<select>
{section name=foo start=5 loop=50 step=1}
<option value="{$smarty.section.foo.index}">{$smarty.section.foo.index}</option>
{/section}
</select>
this many Facebook invites before entering sweepstakes
```

I have the above html (with smarty-php formatting tags) that produces two form elements and some text as displayed in my screen shot. I'd like to make this display as:
```
[CHECKBOX] Require [SELECTION LIST] Facebook invites before entering sweepstakes
```
I have my own ideas on how to implement this but I'm wondering what the best approach would be. Thanks!
|
Correct CSS to display html form elements in certain order?
|
CC BY-SA 3.0
| null |
2011-05-21T17:38:25.387
|
2011-05-21T18:06:59.780
|
2011-05-21T18:06:59.780
| 673,664 | 480,807 |
[
"html",
"css",
"forms",
"smarty"
] |
6,083,372 | 1 | null | null | 2 | 1,724 |
I'm using two APIs to read EXIF data from images, which I'll call "valueForProperty:NSImageEXIFData" and "CGImageSourceCopyPropertiesAtIndex". Both provide the same EXIF data, although the second provides other data (e.g., GPS, TIFF), too.
Both give wrong values for "ApertureValue" and "MaxApertureValue", and the correct value for "FNumber". The example program that follows dumps all of the metadata returned by each method, and also invokes ExifTool. The output is summarized at the end.
(Knowing what lens I was using, ExifTool is correct when it reports MaxApertureValue as 2.8.)
Details: Xcode 4.02, OS X 10.6.7, 10.6 SDK
Anyone else notice this anomaly?
```
#import "ExifTestAppDelegate.h"
@implementation ExifTestAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
{
NSString *path = @"/Users/marc/Pictures/iPadPhotos- overflow/Portfolio/MJR_20061221_0258.jpg";
NSData *data = [NSData dataWithContentsOfFile:path];
NSImage *img = [[[NSImage alloc] initWithData:data] autorelease];
NSImageRep *rep = [img bestRepresentationForRect:NSMakeRect(0, 0, 500, 500) context:nil hints:nil];
NSDictionary *exifDict = (NSDictionary *)[(id)rep valueForProperty:NSImageEXIFData];
NSLog(@"NSImageEXIFData: %@", exifDict);
CGImageSourceRef imgSource = CGImageSourceCreateWithData((CFDataRef)data, nil);
CFDictionaryRef dictRef = CGImageSourceCopyPropertiesAtIndex(imgSource, 0, nil);
NSLog(@"CGImageSourceCopyPropertiesAtIndex: %@", dictRef);
CFRelease(imgSource);
system([[NSString stringWithFormat:@"exiftool '%@'", path] UTF8String]);
}
@end
/*
2011-05-21 11:22:58.140 ExifTest[4510:903] NSImageEXIFData: {
ApertureValue = 6;
...
FNumber = 8;
...
MaxApertureValue = 3;
...
}
2011-05-21 11:22:58.154 ExifTest[4510:903] CGImageSourceCopyPropertiesAtIndex: {
...
"{Exif}" = {
ApertureValue = 6;
...
FNumber = 8;
...
MaxApertureValue = 3;
...
ExifTool Version Number : 8.51
...
F Number : 8.0
...
Aperture Value : 8.0
...
Max Aperture Value : 2.8
*/
```
Update: It's not me. Here's the EXIF data as reported by Apple's Preview app:

|
Mac OS X 10.6 APIs report incorrect EXIF data for aperture
|
CC BY-SA 3.0
| 0 |
2011-05-21T17:38:04.873
|
2011-05-23T16:52:35.700
| null | null | 446,943 |
[
"objective-c",
"cocoa",
"macos",
"osx-snow-leopard",
"exif"
] |
6,083,513 | 1 | 6,083,587 | null | 3 | 1,365 |
Im having a problem to determine how to manipulate the Borders for some Tabs

You can see the functionality here on ASP.NET if you are logged-in [http://forums.asp.net/user/editprofile.aspx#](http://forums.asp.net/user/editprofile.aspx#)
You can see for an onClick Event the background-color of the Tab changes to white like its supposed to.
The problem that Im having has to do with the Borders for onClick:
The border-bottom should change from the grey color to white.
The border-left and the border-right should change to the grey color.
Likewise when a Tab is not selected:
The border-bottom should change to the grey color from white.
The border-left and border-right should not have a border.
In my CSS, Im using both the blue and white class for the JavaScript. However I also have: .common-heading-tabs a.selected and this is confusing me.
Here is my Fiddle- if someone could help It would be great
[http://jsfiddle.net/NinjaSk8ter/ZSeFA/](http://jsfiddle.net/NinjaSk8ter/ZSeFA/)
|
CSS Tabs Border Issue
|
CC BY-SA 3.0
| null |
2011-05-21T18:08:07.197
|
2011-05-21T18:50:38.690
| null | null | 598,931 |
[
"css"
] |
6,083,520 | 1 | 6,083,887 | null | 10 | 1,454 |
Is there a marker bar component for a C# application what i could use in my application? As marker bar i mean something like adds to Visual Studio:
Another example for something similar (the bar on the left):

: I found non-free component for java [http://www.sideofsoftware.com/marker_bar/doc/sos/marker/JMarkerBar.html](http://www.sideofsoftware.com/marker_bar/doc/sos/marker/JMarkerBar.html) what does exactly what i want to do. It doesnt suite for me but maybe it helps someone.
|
Marker bar for C# application?
|
CC BY-SA 3.0
| 0 |
2011-05-21T18:09:05.367
|
2011-05-26T12:38:51.150
|
2011-05-26T12:38:51.150
| 655,134 | 655,134 |
[
"c#"
] |
6,083,667 | 1 | 6,083,695 | null | 2 | 1,140 |
I have this code to draw an arrow:
```
const GLfloat vertices[] = {
-0.25f, -0.25f,
0.0f, 0.0f,
0.25f, -0.25f,
0.0f, 0.5f,
};
glVertexPointer(2, GL_FLOAT, 0, vertices);
glEnableClientState(GL_VERTEX_ARRAY);
glColor4f(0.0f, 0.5f, 0.0f, 1.0f);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
```
It draw similar to this:

This is the actual result (which is undesired):

I don't see what I have done wrong, the vertices seem correct to me, but it seems like OpenGL draws the polygon in a different order than I specified. Can anyone help me out? Thanks in advance. :)
|
Why is my arrow drawing the wrong way?
|
CC BY-SA 3.0
| null |
2011-05-21T18:35:04.540
|
2011-05-21T18:39:55.723
| null | null | null |
[
"c",
"opengl-es",
"2d",
"vertices"
] |
6,083,694 | 1 | 6,084,482 | null | 1 | 3,432 |
I have a jquery range-slider, but now I want to add an extra function to it.
I want the left side of the handle to be another color than the right side.
I made a little mock-up so it's clear what I mean.

I already found a way to get the minimum value:
```
$(".sleep").slider("option", "min");
```
and I found the code for getting the value from the first slider
```
$(".sleep").slider("values", 0)
```
But now I'm kinda stuck how to continue. Hope someone can help me!
Edit:
created a jsfiddle page to make it a little bit easier: [http://jsfiddle.net/BxY99/12/](http://jsfiddle.net/BxY99/12/)
|
Change jquery slider background-color on the left side of the first handle
|
CC BY-SA 3.0
| 0 |
2011-05-21T18:39:33.653
|
2011-05-21T21:13:22.057
|
2011-05-21T20:20:58.103
| null | null |
[
"jquery",
"colors",
"slider",
"handle"
] |
6,083,733 | 1 | 6,083,846 | null | 14 | 13,570 |
Most of the files I read get the right time when using the following method to convert:
```
// works great most of the time
private static DateTime convertToDateTime(System.Runtime.InteropServices.ComTypes.FILETIME time)
{
long highBits = time.dwHighDateTime;
highBits = highBits << 32;
return DateTime.FromFileTimeUtc(highBits + time.dwLowDateTime);
}
```
Here I have an example in visual studio to show how this method sometimes does not work for example I will show the actual file in my computer and the debug. So the file that happens to be in my debug is:
"A:\Users\Tono\Documents\Visual Studio 2010\Projects\WpfApplication4\WpfApplication4\obj\x86\Debug\App.g.cs"

And here is the FILETIME that I am trying to convert to DateTime "I need the LastWriteTime by the way"

Here you can see that dwHighDateTime = 30136437 and also that dwLowDateTime = -2138979250 from that file.
And when I run my method plus other techniques I get the following dates:

So so far everything seems to be working great. But why is that that when I browse and look for that specific file in windows I get a different date !? Here is the date that I get when seeing the file's properties:

Why does the dates don't match? What am I doing wrong?
|
not being able to convert from FILETIME (windows time) to dateTime ( I get a different date )
|
CC BY-SA 3.0
| 0 |
2011-05-21T18:45:15.003
|
2017-06-20T08:53:12.880
| null | null | 637,142 |
[
"c#",
"datetime",
"datetime-format",
"filetime"
] |
6,083,829 | 1 | 6,553,430 | null | 2 | 23,051 |
i think of to write primitive snake. i have window where program paints random lines.
but i can't think up how to catch pressed key to change direction of painted line.

```
class QUpdatingPathIte : public QGraphicsPathItem
{
void advance(int phase)
{
if (phase == 0)
return;
int x,y;
int w,a,s,d;
char c;
//
// HOW TO MAKE THIS HERE? (i had done early in console application)
// but i can't do this in GUI , what should i do?
scanf("%c",&c);
if (c=='w')
{ x=-20; y=0; }
else if (c=='s')
{ x=20; y=0; }
else if (c=='a')
{ x=0; y=-20; }
else if(c=='d')
{ x=0; y=20; }
QPainterPath p = path();
p.lineTo(x, y);
setPath(p);
}
};
#include <QtGui/QApplication>
#include "dialog.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QGraphicsScene s;
QGraphicsView v(&s);
QUpdatingPathIte item;
item.setPen(QPen(QColor("black")));
s.addItem(&item);
v.show();
QTimer *timer = new QTimer(&s);
timer->connect(timer, SIGNAL(timeout()), &s, SLOT(advance()));
timer->start(500);
return a.exec();
}
```
|
Qt catch pressed key
|
CC BY-SA 3.0
| 0 |
2011-05-21T19:01:24.907
|
2019-10-02T19:48:55.493
|
2011-05-21T19:03:51.207
| 636,019 | 758,158 |
[
"c++",
"qt",
"paint"
] |
6,083,984 | 1 | 6,232,944 | null | 1 | 157 |
How would you implement a feature that would show the user a warning whenever he opens a file with my application that comes from a source other than his computer?
This is a feature Visual Studio already has:

I was thinking about adding some of the user's system information as a hash code to the file, but this is not very safe as someone else could get this information if he can access any of the files the "victim" has created on his system and see the system ID hash, and then create a file and modify it to contain this system hash.
My other option would be to store a hash of the file together with the system information as a single hash and add this hash instead of the system info hash alone. This way the "hacker" could not figure out the "victim"'s system hash by opening one of his files.
nothing is 100% safe. I read it as a first comment to every single question related to security issues. But do you have any suggestion as what's a good way to implement such a functionality?
|
How to safely know if a file created with my application comes from another computer?
|
CC BY-SA 3.0
| null |
2011-05-21T19:33:19.723
|
2011-06-03T21:39:50.023
|
2011-05-21T20:05:41.510
| 1,219,414 | 1,219,414 |
[
"security",
"hash"
] |
6,084,095 | 1 | 6,084,117 | null | 13 | 2,617 |
I have these options enabled, as shown in this screenshot:

I also have the `System.Windows.Forms.dll` module selected:

Yet it steps over the code. Specifically, I have this code in a subclass of `ListBox`:
```
protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
{
return base.ProcessCmdKey(ref msg, keyData);
}
```
I tried to set a breakpoint there and then step into this with F11, but it just steps over.
What is missing to get this to work?
|
.NET framework source stepping not working despite options set
|
CC BY-SA 3.0
| 0 |
2011-05-21T19:55:30.657
|
2014-02-26T15:42:26.447
|
2012-10-07T02:44:38.113
| 33,225 | 33,225 |
[
".net",
"visual-studio-2010"
] |
6,084,113 | 1 | null | null | 0 | 743 |
This is probably a classic problem but I can't seem to figure out the solution. I have a number of divs that need to wrap in a container. That's pretty simple by adding `float: left` and a fixed width.
But, how do I get margin between them without having margin on the right-hand card. These divs are generated dynamically so I can't use a different class on the second div in order to target it.
Any ideas?

|
CSS floated divs with margin between them (example img in description)
|
CC BY-SA 3.0
| null |
2011-05-21T19:59:18.687
|
2012-07-02T15:52:04.737
|
2012-07-02T15:52:04.737
| 44,390 | 1,275,364 |
[
"html",
"css",
"css-float"
] |
6,084,215 | 1 | null | null | 3 | 4,030 |
I want to write a shell script that you can drop anywhere and when you open it, it simply creates a new file in that directory. So far I have this:
```
#!/bin/bash
BASEDIR=$(dirname $0)
touch $BASEDIR/untitled
```
Which works, except there's two things I'd like to do to it that I have no idea how to.
1. Is there a way to get Finder to focus on it after creating it? (like how Windows and most Linux distros do when you do Create New File from the right click context menu)
2. How can I make the script not open terminal each time you click on it? Would I need to make it an ".app"?
So you get an idea of where Im putting it, Im putting it here:

so that I can create a new file anywhere.
|
Shell Script to Create Blank File in Working Directory (Mac OS X)
|
CC BY-SA 3.0
| null |
2011-05-21T20:18:00.313
|
2012-03-11T23:47:34.267
| null | null | 144,833 |
[
"macos",
"shell",
"sh"
] |
6,084,305 | 1 | 6,086,386 | null | 19 | 22,639 |
I have a layout where images "float" within a certain area. The layout looks like this:

The source like this:
```
<div class="free_tile">
<a class="img_container canonical" href="/photos/10">
<img class="canonical" src="http://s3.amazonaws.com/t4e-development/photos/1/10/andrew_burleson_10_tile.jpg?1303238025" alt="Andrew_burleson_10_tile">
<!-- EDIT: I am aware that I can put the badge here. See the edit notes and image below. -->
</a>
<div class="location">Houston</div>
<div class="taxonomy"> T6 | Conduit | Infrastructure </div>
</div>
```
The CSS looks like this (in SCSS):
```
div.free_tile { width: 176px; height: 206px; float: left; margin: 0 20px 20px 0; position: relative;
&.last { margin: 0 0 20px 0; }
a.img_container { display: block; width: 176px; height: 158px; text-align: center; line-height: 156px; margin-bottom: 10px; }
img { margin: 0; border: 1px solid $dark3; display: inline-block; vertical-align: middle; @include boxShadow;
&.canonical { border: 1px solid $transect; }
}
.location, .taxonomy { width: 176px; }
.location { font-weight: 700; }
.taxonomy { line-height: 10px; font-size: 10px; text-transform: uppercase; height: 20px; overflow: hidden; }
}
div.transect_badge { height: 20px; width: 20px; background: url('/images/transect-badge.png'); }
```
So, basically the images are sitting vertically-aligned middle and text-aligned center, and they have a maximum width of 176 and max height of 158, but they're cropped to maintain the original aspect ratio so the actual top corner of each image falls differently depending on which image it is.
I have a badge that I'd like to put in the top corner of certain images (when the image is "canonical"). You see the style for this above (`div.transect_badge`).
The problem, of course, is I don't know where the top corner of the image will be so I can't hardcode the position via CSS.
I assume that I'll need to do this via jQuery or something. So, I started with a jQuery method to automatically append the badge div to any canonical images. That works fine, but I can't figure out how to position it over the top left corner.
--EDIT--
Here's the problem: The image is floating inside a container, so the corner of the image might fall anywhere inside the outer limits of the container. Here's an example of what happens if I try to use `position:absolute; top:0; left:0` inside the same container the image is bound by:

|
Position badge over corner of image automatically
|
CC BY-SA 3.0
| 0 |
2011-05-21T20:34:04.160
|
2011-06-05T19:57:32.363
|
2011-05-22T05:07:13.857
| 417,872 | 417,872 |
[
"javascript",
"jquery",
"html",
"css",
"position"
] |
6,084,336 | 1 | 6,086,012 | null | 2 | 394 |
I just tried to create my first function in octave, it looks as follows:
```
function hui(x)
if(0 <= x && x <2)
retval = (1.5 * x + 2)
elseif(2<= x && x <4)
retval = (-x + 5)
elseif(4<= x && x < 6)
retval = (0.5 * x)
elseif(6<= x && x < 8)
retval = (x - 3)
elseif(8<= x && x <=10)
retval = (2 * x - 11)
endif
endfunction
```
but if I try to plot it using: `x=0:0.1:10; plot(x, hui(x));`
It shows a plot witch seems a little bit strange.

What did I wrong?
Thanks in advance
John
|
What is wrong with my function in Octave?
|
CC BY-SA 3.0
| null |
2011-05-21T20:40:04.147
|
2011-05-22T09:16:07.013
| null | null | 110,944 |
[
"gnuplot",
"octave"
] |
6,084,519 | 1 | 6,084,571 | null | 0 | 1,080 |
How to achieve these two scenarios in android layout -


|
How to align android buttons like a triangle
|
CC BY-SA 3.0
| null |
2011-05-21T21:20:07.280
|
2019-08-10T21:13:18.590
| null | null | 418,366 |
[
"android"
] |
6,084,659 | 1 | 6,084,807 | null | 2 | 2,762 |
I made a display, that will show the sum of purchase. It's a TextView with background image. I have a designed digits too. How can I set those digit images to that TextView or do I have to create some layout instead of simple TextView? If I need to create layout, can you add some code sample, how can I do it?
Here's an example what I want to achieve.

Regards,
evilone
|
How to set numbers as images on TextView?
|
CC BY-SA 3.0
| 0 |
2011-05-21T21:46:58.530
|
2011-05-22T04:16:09.563
| null | null | 526,217 |
[
"android",
"layout",
"user-interface"
] |
6,084,882 | 1 | 6,084,980 | null | 0 | 496 |
I'm new to iPhone development and I have a trouble trying to implement UINavigationController.
I have implemented ViewController in following way:
```
@interface FirstViewController : UITableViewController <UIActionSheetDelegate> {
IBOutlet UITableView *table;
/* added later but it dont know what to do to show it first*/
IBOutlet UINavigationController *navigationController;
}
@end
```

This TableView works good. But I want to wrap around navigation controller to be able to show next view after row-click.
The problem that I don't undrstand what should I do with NIB file. I have drag-n-dropped there UIViewController - but I can't set it as view. Because I cant drag connection from file owner's view to UIViewController. What should I do to make this look like Table-in-Navigation, not plain table.
|
How to wrap UITableView with UINavigationController?
|
CC BY-SA 3.0
| null |
2011-05-21T22:37:31.603
|
2011-05-22T05:05:16.210
|
2011-05-22T05:05:16.210
| 73,488 | 71,420 |
[
"objective-c",
"cocoa-touch",
"ios"
] |
6,085,002 | 1 | null | null | 1 | 297 |
I'm trying to code a notification system. An AJAX call runs a PHP script which selects every 'message' where 'new=1'. So I return the PHP array via JSON_encode back to the JS.
This returns the follow Object:

On my original page, you can see all 'sessions'. I want to 'update' the text of a div (which has new messages) with the numbers of new messages (= numbers of records in Object).
Now the problem comes: Can someone please help me out?
Thanks a lot!
|
How to read out a JSON returned object?
|
CC BY-SA 3.0
| null |
2011-05-21T23:11:43.813
|
2011-05-21T23:27:06.527
|
2011-05-21T23:26:28.980
| 704,390 | 704,390 |
[
"php",
"javascript",
"ajax",
"json",
"jquery"
] |
6,085,157 | 1 | 6,086,962 | null | 5 | 1,566 |
I'm trying to set up a UITableView with elements layered like this:

Specifically, the table has multiple sections and each section has a different background color. To do this I would normally just modify each cell. The tough part is that I'd like the section headers to be translucent. When I do this, the background under the header is the table view's background color when there's no cell under the header. I could of course set the table view's background color, but then the color under each header would be the same.
How would I create a table view like that depicted in the diagram?
UPDATE: To make it absolutely clear, I know how to make a custom header view, and know how to make it translucent using the alpha property. The problem is with what is UNDER the view. I need what is underneath to be the section's background color, not the table view's background color.
|
UITableView w/ translucent section headers & different colored section backgrounds
|
CC BY-SA 3.0
| null |
2011-05-21T23:49:56.917
|
2013-06-05T15:51:36.953
|
2017-02-08T14:32:15.513
| -1 | 356,818 |
[
"cocoa-touch",
"ios",
"uitableview"
] |
6,085,414 | 1 | 6,131,238 | null | 3 | 1,096 |
When a user makes a post on a profile, the profile owner's user ID is saved as an integer in :poster (in the Post model). How do I find and render that user/user's information?
More information:
1. Using Slugged gem
2. Trying to generate a feed of posts, when I call feed_item.user in my view, it directs me to the user that posted the post, but not to the user who's profile the post was made on.
Feed Item View

Feed View

Pages Controller Home Function

@postee is my feeble attempt to find the user based on the user id saved for each post. Ideally I would like to be able to link to the user who's profile the post was made on and also display information about that user in my view (e.g. the user's username). I've been tinkering for a while and am stuck, any thoughts? Thank you very much for your help and please let me know if any additional information is needed!
Post Form View
```
<%= form_for @post do |f| %>
<%= f.hidden_field :name, :value => current_user.name %>
<%= f.hidden_field :poster, :value => @user.id %>
<div class="postbox">
<div class="postfield">
<%= f.text_area :content %>
</div>
<div class="postsubmit">
<%= f.submit "Submit" %>
</div>
</div>
```
User Controller Show Action
```
def show
@user = User.find_by_cached_slug(params[:id])
@posts = Post.find_all_by_poster(@user.id)
@post = Post.new
if user_signed_in?
@post = Post.new
end
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @user }
end
end
```
|
Saved user id in Posts model, how do I render that user?
|
CC BY-SA 3.0
| null |
2011-05-22T01:08:38.963
|
2012-01-28T20:15:38.897
|
2012-01-28T20:15:38.897
| 128,546 | 695,541 |
[
"ruby-on-rails",
"ruby",
"ruby-on-rails-3",
"ruby-on-rails-plugins"
] |
6,085,456 | 1 | 6,116,625 | null | 3 | 766 |
I have a bi-directional, many-to-many association between EntityA and EntityB and I’m using an association class, EntityABLink, to model this because there are other attributes about the relationship that I need to track. In addition, I also have another class that holds a reference to a specific relationship between EntityA and EntityB so I treat the association class as a full-fledged entity.
In EntityA I have a read-only property that returns a list of associated EntityB objects and, likewise, in EntityB I have a read-only property that returns a list of associated EntityA objects. Note that, for these properties, I’m hiding the fact that the association is implemented via an association class. (I also have dedicated methods for updating the relationships that hide the implementation.) Behind the scenes in both EntityA and EntityB, I have private collections of type EntityABLink.
Since a picture is worth a thousand words, here is what I have described so far:

(Note again that the public, read-only properties on EntityA and EntityB are not of the same type as the private members that back them up.)
So far, so good. Now I want to persist these objects to a database using Fluent NHibernate automapping overrides. When it comes to mapping, I like to think of the above using this functionally equivalent representation:

From this diagram, it’s clear that what I need is two bi-directional one-to-many relationships.
In mapping the above, I figure that I need something like this:
In the EntityA automapping override:
```
mapping.HasMany<EntityABLink>(Reveal.Member<EntityA>(“_AssociationList”)).Inverse().AsBag().Cascade.SaveUpdate();
mapping.IgnoreProperty(x => x.EntityBList);
```
In the EntityB automapping override:
```
mapping.HasMany<EntityABLink>(Reveal.Member<EntityB>(“_AssociationList”)).Inverse().AsBag().Cascade.SaveUpdate();
mapping.IgnoreProperty(x => x.EntityAList);
```
In the EntityABLink automapping override:
```
mapping.References<EntityA>(x => x.EntityA).Not.Nullable();
mapping.References<EntityB>(x => x.EntityB).Not.Nullable();
```
When I try this, however, I get the following error:
"Could not find a getter for property '_ AssociationList’ in class 'EntityB'."
I must have something wrong with my mappings, but I’m not sure what. Any ideas?
|
Fluent NHibernate mapping of a bi-directional, many-to-many association using an association class
|
CC BY-SA 3.0
| 0 |
2011-05-22T01:23:40.543
|
2011-05-24T20:42:32.263
| null | null | 296,059 |
[
"fluent-nhibernate",
"nhibernate-mapping"
] |
6,085,635 | 1 | null | null | 1 | 70 |
I'm trying to recreate an old text in HTML. At one point, the text does something kind of funny: it has two columns of text, and when one column reaches its end, the other column begins spanning the entire page.
Here is a mock example I've created in Paint:

Is there a way to do this with tables in HTML? Thanks.
|
HTML dogleg tables?
|
CC BY-SA 3.0
| null |
2011-05-22T02:21:03.457
|
2011-05-22T02:34:58.363
| null | null | 763,544 |
[
"html"
] |
6,085,766 | 1 | 6,086,577 | null | -1 | 307 |
I want to create a css layout:
- - - -
I also want to be able to toggle hide/show on the second column and display another column in its place. I know how to hide and show with javascript but I dont know how to place the other column in the second column's place without using absolute positioning.
Here is an example of the two different layouts, the blue area represents the window size and the green is the divs, I didnt mark the columns but you should be able to see that there are two columns. Also I am going with margin: 0 and padding: 0, I left the space inbetween the divs to clarify the layout:

[http://imageshack.us/photo/my-images/535/layout1rt.png/](http://imageshack.us/photo/my-images/535/layout1rt.png/)

[http://imageshack.us/photo/my-images/683/layout2z.png/](http://imageshack.us/photo/my-images/683/layout2z.png/)
Sorry for all the anger my question generated. I have googled and experimented with divs but havent come up with a good solution yet. The one I have doesnt really fit 100%, there are some pixel differences, I will post the code below. I made the design with framesets first and then tables and then I thought that I have to learn how divs really work sometime. Well after some days searching and reading about css float left right and so on I gave up and created this account.
It seems it would be very fast for someone who understands it to make my wanted layout and thats why I didnt post my code. I could just learn by reading and playing with the answer code, but you are right, I made a mistake.
My code works 100% in Mozilla but fails in IE.
```
<html>
<head>
<script type="text/javascript">
function toggleSheet(){
if(document.getElementById("col3").style.display == "block"){
document.getElementById("col3").style.display = "none";
} else {
document.getElementById("col3").style.display = "block";
}
}
</script>
<style type="text/css">
* {
margin: 0;
padding: 0;
overflow:hidden;
}
#wrapper {
width: 100%;
height:100%;
}
#col1 {
float:left;
width: 40%;
height:100%;
background:blue;
}
#col2 {
float:right;
width: 60%;
height:100%;
background:red;
}
#col3 {
position:absolute;
width: 60%;
right:0;
height:100%;
background:black;
display:none;
}
#col1top {
height:100%;
margin-bottom: -20px;
background:purple;
}
#col2top {
height:70%;
background:green;
}
#col1bottom {
height: 20px;
background:brown;
}
#col2bottom {
height:30%;
background:yellow;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="col1">
<div id="col1top" onClick="toggleSheet();">
</div>
<div id="col1bottom">
</div>
</div>
<div id="col2">
<div id="col2top">
</div>
<div id="col2bottom">
</div>
</div>
<div id="col3">
</div>
</div>
</body>
</html>
```
Thanks for your time.
/illion
|
Issue with div css layout
|
CC BY-SA 3.0
| 0 |
2011-05-22T02:59:49.077
|
2011-12-28T03:45:33.600
|
2011-12-28T03:45:33.600
| 234,976 | 764,443 |
[
"css",
"layout",
"html"
] |
6,085,809 | 1 | 6,085,862 | null | 6 | 17,489 |
Here is a simple opengl program by me. I'm trying to clear the screen before I draw a triangle. I've called glClear() in my init() function, however, it seemed that it failed to clear the screen.
```
#include <stdio.h>
#include <stdlib.h>
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
void myIdleFunc()
{
glBegin(GL_TRIANGLES);
{
glColor3f(1.0f, 1.0f, 1.0f);
glVertex2f(0.0f, 1.0f);
glVertex2f(-1.0f, -1.0f);
glVertex2f(1.0f, -1.0f);
}
glEnd();
glFlush();
usleep(1000000);
}
void init()
{
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT);
glFlush();
}
int main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_SINGLE);
glutCreateWindow("Hello, World!");
init();
glutIdleFunc(myIdleFunc);
glutMainLoop();
return 1;
}
```
Here is a screen-shot, the text is from the gnome terminal in the back ground.

|
Why glClear doesn't clear my screen?
|
CC BY-SA 3.0
| null |
2011-05-22T03:14:30.540
|
2018-02-13T10:27:56.783
| null | null | 667,027 |
[
"c",
"opengl"
] |
6,085,794 | 1 | 6,092,014 | null | 2 | 272 |
I'm trying to develop an Eclipse plugin that will launch specific targets as key-bindable commands.
Here's the `plugin.xml`:
```
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension point="org.eclipse.ui.commands">
<category name="Custom Launcher" id="Eclipse_Keybound_Launch_Plugin.commands.category"/>
<command
categoryId="Eclipse_Keybound_Launch_Plugin.commands.category"
defaultHandler="eclipse_keybound_launch_plugin.handlers.CustomLaunchCommandHandler"
description="Launch/terminate then relaunch a custom target in debug mode"
id="Eclipse_Keybound_Launch_Plugin.commands.terminateLaunch"
name="Launch">
<commandParameter
id="Eclipse Keybound Launch Plugin.launchTarget"
name="target"
optional="false"
/>
</command>
</extension>
<extension point="org.eclipse.ui.bindings">
<key commandId="Eclipse_Keybound_Launch_Plugin.commands.terminateLaunch"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+6">
<parameter id="Eclipse Keybound Launch Plugin.launchTarget" value="RunMe"/>
</key>
</extension>
<extension point="org.eclipse.ui.bindings">
<key commandId="Eclipse_Keybound_Launch_Plugin.commands.terminateLaunch"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+7">
<parameter id="Eclipse Keybound Launch Plugin.launchTarget" value="RunMeAlso"/>
</key>
</extension>
</plugin>
```
For completeness, here's how it looks like in the Extension view:

The plugin works when I put it to the test; the parameter value is available in the `ExecutionEvent`. However, the value is not shown in the Preferences/Keys setting:

Why is this the case? What do I need to do to have Eclipse show not just the name (`target:`) but also the values of the parameters (`RunMe` and `RunMeAlso` in this case)?
Note that I'm using Eclipse SDK Version: 3.6.1, Build id: M20100909-0800.
|
Why isn't the value of my Eclipse plugin ICommand IParameter showing up in the Preferences/Keys setting?
|
CC BY-SA 3.0
| null |
2011-05-22T03:08:46.853
|
2011-05-23T01:31:39.300
| null | null | 276,101 |
[
"java",
"eclipse",
"eclipse-plugin",
"key-bindings"
] |
6,085,930 | 1 | null | null | 7 | 17,840 |
i have a datagridview. i bound it to a list. now i want to show a column at the end of it. but that column apprear in wrong possition.
this is my code
```
grdPatientAppointment.DataSource = lst;
grdPatientAppointment.Columns["ID"].Visible = false;
//grdPatientAppointment.Columns["AdmitDate"].Visible = false;
//grdPatientAppointment.Columns["DischargeDate"].Visible = false;
grdPatientAppointment.Columns["AppointmentID"].Visible = false;
grdPatientAppointment.Columns["PatientrName"].DisplayIndex = 0;
grdPatientAppointment.Columns["Age"].DisplayIndex = 1;
grdPatientAppointment.Columns["Address"].DisplayIndex = 2;
grdPatientAppointment.Columns["ContactNo"].DisplayIndex = 3;
grdPatientAppointment.Columns["Dieseas"].DisplayIndex = 4;
grdPatientAppointment.Columns["AppointmentDate"].DisplayIndex = 5;
DataGridViewButtonColumn btnColumn = new DataGridViewButtonColumn();
btnColumn.HeaderText = "Treat";
btnColumn.Text = "Treat";
btnColumn.UseColumnTextForButtonValue = true;
grdPatientAppointment.Columns.Insert(6,btnColumn);
```
here is output:

but i want that button to the end of datagrid view
|
Add button column in a databound datagridview
|
CC BY-SA 3.0
| 0 |
2011-05-22T04:02:54.583
|
2016-08-05T17:41:47.077
| null | null | 446,211 |
[
"winforms",
"forms",
"datagridview"
] |
6,085,893 | 1 | 6,085,916 | null | 7 | 53,379 |
I have recreated this project in Eclipse as many ways as I can think of and continue to get this same error-
```
HTTP Status 404 - /SpringTest/hello
type Status report
message /SpringTest/hello
description The requested resource (/SpringTest/hello) is not available.
```
Please help me find the issue in my code below.
web.xml -
```
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>Spring3MVC</display-name>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<servlet>
<servlet-name>spring</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>spring</servlet-name>
<url-pattern>*.html</url-pattern>
</servlet-mapping>
</web-app>
```
spring-servlet.xml -
```
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd">
<context:component-scan
base-package="net.viralpatel.spring3.controller" />
<bean id="viewResolver"
class="org.springframework.web.servlet.view.UrlBasedViewResolver">
<property name="viewClass"
value="org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="/WEB-INF/jsp/" />
<property name="suffix" value=".jsp" />
</bean>
</beans>
```
Controller -
```
package net.viralpatel.spring3.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
@Controller
public class HelloWorldController {
@RequestMapping("/hello")
public ModelAndView helloWorld() {
String message = "Hello World, Spring 3.0!";
return new ModelAndView("hello", "message", message);
}
}
```
index.jsp -
```
<html>
<head>
<title>Spring 3.0 MVC Series: Index - ViralPatel.net</title>
</head>
<body>
<a href="hello">Say Hello</a>
</body>
</html>
```
hello.jsp
```
<html>
<head>
<title>Spring 3.0 MVC Series: Hello World - ViralPatel.net</title>
</head>
<body>
${message}
</body>
</html>
```
.classpath -
```
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/jdk">
<attributes>
<attribute name="owner.project.facets" value="java"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Tomcat">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
```
.project -
```
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>SpringTest</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
```
My Project -

Eclipse console output -
```
May 21, 2011 10:28:11 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\glassfish3\jdk\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:/glassfish3/jdk/bin/../jre/bin/client;C:/glassfish3/jdk/bin/../jre/bin;C:/glassfish3/jdk/bin/../jre/lib/i386;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\;C:\glassfish3\jdk\bin;C:\eclipse-jee-helios-SR2-win32\eclipse;
May 21, 2011 10:28:11 PM org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNING: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:SpringTest' did not find a matching property.
May 21, 2011 10:28:11 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
May 21, 2011 10:28:11 PM org.apache.coyote.AbstractProtocolHandler init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
May 21, 2011 10:28:11 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 425 ms
May 21, 2011 10:28:11 PM org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
May 21, 2011 10:28:11 PM org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.14
May 21, 2011 10:28:11 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring FrameworkServlet 'spring'
May 21, 2011 10:28:11 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'spring': initialization started
May 21, 2011 10:28:11 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh
INFO: Refreshing WebApplicationContext for namespace 'spring-servlet': startup date [Sat May 21 22:28:11 CDT 2011]; root of context hierarchy
May 21, 2011 10:28:11 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from ServletContext resource [/WEB-INF/spring-servlet.xml]
May 21, 2011 10:28:12 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons
INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@1e1ec86: defining beans [helloWorldController,org.springframework.context.annotation.internalConfigurationAnnotationProcessor,org.springframework.context.annotation.internalAutowiredAnnotationProcessor,org.springframework.context.annotation.internalRequiredAnnotationProcessor,org.springframework.context.annotation.internalCommonAnnotationProcessor,viewResolver]; root of factory hierarchy
May 21, 2011 10:28:12 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/hello] onto handler 'helloWorldController'
May 21, 2011 10:28:12 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/hello.*] onto handler 'helloWorldController'
May 21, 2011 10:28:12 PM org.springframework.web.servlet.handler.AbstractUrlHandlerMapping registerHandler
INFO: Mapped URL path [/hello/] onto handler 'helloWorldController'
May 21, 2011 10:28:12 PM org.springframework.web.servlet.FrameworkServlet initServletBean
INFO: FrameworkServlet 'spring': initialization completed in 545 ms
May 21, 2011 10:28:12 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["http-bio-8080"]
May 21, 2011 10:28:12 PM org.apache.coyote.AbstractProtocolHandler start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
May 21, 2011 10:28:12 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 1139 ms
```
|
Why am I getting a 404 requested resource not available error from Tomcat 7
|
CC BY-SA 3.0
| 0 |
2011-05-22T03:48:24.353
|
2017-03-28T17:37:34.043
|
2013-04-12T20:54:31.863
| 643,500 | 445,884 |
[
"java",
"spring",
"tomcat",
"tomcat7"
] |
6,086,288 | 1 | 6,096,611 | null | 7 | 7,113 |
I am doing some simple testing of adding CALayer to a UIView. In my main controller class of an iPhone 4 app, I implemented the `viewDidLoad` method as such:
```
- (void)viewDidLoad
{
[super viewDidLoad];
NSLog(@"%s", __PRETTY_FUNCTION__);
CALayer* ca = [[CALayer alloc] init];
[ca setBounds:self.view.bounds];
[ca setBackgroundColor:[[UIColor blueColor] CGColor]];
[self.view.layer addSublayer:ca];
}
```
The blue background only occupy 1/4 of the screen.

I wonder if it is because I did not take retina display into consideration? What is the best practice in this situation?
---
Added these debug messages:
```
NSLog(@"frame w:%f h:%f", self.view.frame.size.width, self.view.frame.size.height);
NSLog(@"bounds w:%f h:%f", self.view.bounds.size.width, self.view.bounds.size.height);
```
Output:
```
frame w:320.000000 h:460.000000
bounds w:320.000000 h:460.000000
```
|
iOS: self.view.bounds does not fill the whole window
|
CC BY-SA 3.0
| 0 |
2011-05-22T05:50:01.777
|
2011-05-23T11:35:31.377
|
2011-05-22T19:25:11.310
| 58,129 | 58,129 |
[
"ios",
"uiview",
"uiviewcontroller",
"calayer",
"iphone-4"
] |
6,086,405 | 1 | 6,086,887 | null | 0 | 6,891 |
Now I need to draw a new `Canvas` in an existent `Canvas` (the `Canvas`), like `Bitmap`'s works.
The logic is this:
- `Sprite``Sprite``LinkedList<Sprite> nodes`- If don't have nodes (`nodes = null`) then, will draw the `(Bitmap) Sprite.image` directly to parent canvas, received on `update` method, like ():```
public void update(Canvas canvas){
if(this.nodes == null){
canvas.drawBitmap(this.image, ...);
}
...
}
```
- If it have nodes, I need create a new `Canvas`, draw nodes bitmap on this, and draw the new `Canvas` on parent `Canvas`. This don't works, but the idea is like this:```
public void update(Canvas canvas){
...
else { // this.nodes != null
Canvas newCanvas = new Canvas();
for(Sprite node: this.nodes){
node.update(newCanvas);
}
// Canvas working like Bitmap! (?)
canvas.drawCanvas(newCanvas, this.x, this.y, this.paint);
}
}
```
: well, I have a `Sprite` called `CarSprite`. The `CarSprite` have a private class called `WheelSprite extends Sprite`. The `CarSprite` implements two nodes () of `WheelSprite`, that will be positioned in the `CarSprite` to seems the whell of car. So far, no problem.
But if `CarSprite` is affected by a devil one object in the level, this will be turn . I will do, for instance, `objectOfCarSprite.paint.setAlpha(127);`. The problem is, if I do it (), only the car bitmap will turn transparent, but not the well, because it is drawed to global `Canvas` object.
: currently, I'm getting the parent (of parentN...) `Paint` object alpha, and with some math, I get a transparent solution to wheel that works almost as well I need, but if, for instance, the `WheelSprite` object is over car bitmap, is possible to see the of car, like picture.
Exists a better way to do , or only ?

|
How I can draw an existent Canvas on another Canvas?
|
CC BY-SA 3.0
| 0 |
2011-05-22T06:24:22.870
|
2011-05-22T08:40:08.650
| null | null | 755,393 |
[
"android",
"canvas",
"bitmap",
"transparency",
"paint"
] |
6,086,422 | 1 | 6,093,203 | null | 1 | 751 |
I try to implement a good reusable color picker for my Sketcher application. Instructions and screenshots are here: [http://bit.ly/sketcherapp](http://bit.ly/sketcherapp)
The problem is I'm stuck with a good "resizable" UI which enable me to support wide range of devices with different screen sizes.

The top two widgets should be the same height and have proportional widths: 80 to 20. Also it would be nice to specify paddings in XML.
Current implementation is not good. I hardcoded some values into code and also it looks bad on Xoom devices because of inaccurate layout measurements.
Is there any way to implement this behavior? Ideally, I need some way to do it like with HTML tables (pseudocode):
```
table.width=100%, td1.width=80%, td2.padding=5px, ...
```
or something like that.
Current implementation:
- [https://github.com/wargoth/Sketcher/tree/master/src/org/sketcher/colorpicker](https://github.com/wargoth/Sketcher/tree/master/src/org/sketcher/colorpicker)- [https://github.com/wargoth/Sketcher/blob/master/res/layout/color_picker.xml](https://github.com/wargoth/Sketcher/blob/master/res/layout/color_picker.xml)
Thank you.
|
Android: custom views with proportional widths and same heights
|
CC BY-SA 3.0
| null |
2011-05-22T06:29:32.760
|
2011-05-23T05:35:24.377
| null | null | 331,212 |
[
"android",
"user-interface",
"widget",
"color-picker"
] |
6,086,718 | 1 | null | null | 20 | 22,119 |
Actually, make that a couple of amateur UML questions! When creating a UML diagram to model some domain concepts and you come across a domain concept that "holds" some information about another concept, is it better to hold a stamp/reference to that entity or hold the whole entity in the model itself? Please bear in mind that this is relating to creating a simple high-level model - I'm sure in the implementation stage things would be slightly different.
For example, which of the two models below is actually correct? The first one has a composition relationship, with FlightBooking holding the whole of Flight. In the second one, FlightBooking just has a reference to Flight.

Secondly, when creating a high level UML diagram modelling domain concepts, how much detail are you really meant to go? For example, in the diagram below, a flight could hold details about origin/destination as strings, or I could model separate classes for these concepts and create a composition relationship. Which of the two is advisable?

Also, just another thing, when modelling the above where a Flight "holds" an orig/destination as another class rather than a string, which of the two ways is the correct way of modelling this? I'm quite confused as to when to show assosciation and when to show composition.
|
UML association vs. composition and detail level
|
CC BY-SA 3.0
| 0 |
2011-05-22T07:48:24.077
|
2014-02-04T11:50:25.183
|
2011-05-22T11:15:35.867
| 1 | 764,602 |
[
"uml",
"relationship",
"composition"
] |
6,086,749 | 1 | 6,088,252 | null | 2 | 2,187 |
I have 3 vectors, `x`, `y`, `z`. Three different vectors' elements represent the position of point in space (e.g. `x(1)`, `y(1)`, `z(1)` contains info about the first point's position).
Now I need to realize a 3D representation of the entire set of points, and it should look like this:

Can someone help me? What function will be useful?
|
How to plot a 3d representation of a GPS track
|
CC BY-SA 3.0
| 0 |
2011-05-22T07:57:47.080
|
2011-05-23T19:58:12.583
|
2011-05-22T12:39:39.387
| null | 700,209 |
[
"matlab",
"gps"
] |
6,086,974 | 1 | 6,087,095 | null | 4 | 1,935 |
```
<div data-role="content">
<ul data-role="listview" data-theme="a" data-dividertheme="b">
<li data-role="list-divider" >Transition Effects</li>
<li><a href="#second">Slide</a></li>
<li><a href="TestPage1.htm"![enter image description here][1] data-transition="slideup">Slide Up</a></li>
<li><a href="TestPage1.htm" data-transition="slidedown">Slide Down</a></li>
<li data-role="list-divider">Other Effects</li>
<li><a href="TestPage.html" data-transition="pop">Pop</a></li>
<li><a href="TestPage.html" data-transition="flip">Flip</a></li>
<li><a href="TestPage.html" data-transition="fade">Fade</a></li>
</ul>
</div>
```
No right arrow get displayed. I am using JQuery Mobile 1.0a4.1
```
<link rel="stylesheet" href="jquery.mobile-1.0a4.1.css" />
<script type="text/javascript" src="jquery-1.5.2.js"></script>
<script type="text/javascript" src="jquery.mobile-1.0a4.1.js"></script>
```
What can be the cause? I copied jquery css and js in my local folder

|
No right arrow displayed
|
CC BY-SA 3.0
| 0 |
2011-05-22T09:05:30.410
|
2011-05-22T11:11:52.940
|
2011-05-22T11:11:52.940
| 602,618 | 705,414 |
[
"jquery",
"jquery-ui",
"jquery-mobile"
] |
6,086,997 | 1 | null | null | 0 | 1,050 |
how to create inline editable field. when i click on a text it turn into a inline input text type. and the same case with the paragraph it convert into inline textarea.
and the most important is that it should save it state when i click out side or focused out but don't submit the data until i pressed save button. in the last it should send data in ajax.

|
how to create inline editable field. when i click on a text it turn into a inline input text type
|
CC BY-SA 3.0
| null |
2011-05-22T09:11:15.140
|
2013-11-06T01:14:28.660
| null | null | 677,034 |
[
"jquery"
] |
6,087,131 | 1 | null | null | 2 | 1,264 |
I'm using SharedPreferences in my Android app in the standard way. On the HTC WildFire device (resolution 240x320), the EditText is squashed up when the virtual keyboard is displayed.
Has anyone else come across this is there a solution? I've been stumped for days.

My code/XML is pretty straightforward:
```
public class PrefsActivity extends PreferenceActivity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
addPreferencesFromResource(R.xml.preferences);
// don't display hidden preferences
getPreferenceScreen().removePreference(findPreference("hidden_prefs"));
}
}
```
And my preferences.xml:
```
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceCategory android:title="User Preferences">
<EditTextPreference
android:key="profile"
android:title="Profile"
android:summary="Your profile name"
android:name="Profile"/>
<EditTextPreference
android:key="password"
android:title="Password"
android:summary="Your password"
android:name="Password"
android:password="true"/>
<EditTextPreference
android:name="Server"
android:summary="The server to use"
android:title="Server"
android:key="server"/>
<EditTextPreference
android:name="Secret"
android:summary="The server secret"
android:title="Secret"
android:password="true"
android:key="secret"/>
<CheckBoxPreference
android:title="On Demand"
android:defaultValue="true"
android:summary="Check to enable On Demand"
android:key="on_demand"/>
<ListPreference
android:title="Date"
android:summary="Set the type of date used"
android:key="date"
android:defaultValue="next"
android:entries="@array/prefs_date_keys"
android:entryValues="@array/prefs_date_values" />
</PreferenceCategory>
<PreferenceCategory android:key="hidden_prefs" android:title="Hidden Preferences">
<EditTextPreference
android:name="Last Project ID"
android:summary="The last Project ID"
android:title="Last Project ID"
android:key="last_project_id"
android:inputType="number"/>
<EditTextPreference
android:name="Fast Sync"
android:summary="Use Fast Sync"
android:title="Fast Sync"
android:key="fast_sync"
android:inputType="number"/>
</PreferenceCategory>
```
|
SharedPreferences EditText dialog squashed on HTC WildFire
|
CC BY-SA 3.0
| 0 |
2011-05-22T09:41:57.897
|
2017-08-25T14:38:20.147
|
2017-08-25T14:38:20.147
| 4,032,703 | 689,681 |
[
"android",
"sharedpreferences",
"htc-android"
] |
6,087,249 | 1 | 6,087,261 | null | 3 | 1,216 |
As you know, when a user somewhere, Explorer tries to select the nearest objects (such as text, table-row etc.) like the picture below:

## User can:
-
## User can't
-
So how can I do this? Hope it's clear.
I use double-click operation to enter the item.
|
De-select when user double-click on anywhere using jQuery
|
CC BY-SA 3.0
| null |
2011-05-22T10:07:52.600
|
2011-11-16T13:55:58.947
|
2020-06-20T09:12:55.060
| -1 | 272,478 |
[
"jquery",
"checkbox"
] |
6,087,248 | 1 | null | null | 0 | 297 |
I have an iOS app which runs in landscape (always), and uses OpenGL for drawing. I have this code in my draw method:
```
GLfloat width = self.frame.size.width; // 480
GLfloat height = self.frame.size.height; // 320
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrthof(-width / 2, width / 2, -height / 2, height / 2, -1.0f, 1.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glTranslatef(160.0f, 240.0f, 0.0f);
glRotatef(-90.0f, 0.0f, 0.0f, 1.0f);
glScalef(1.0f, -1.0f, 1.0f);
glMatrixMode(GL_PROJECTION);
glTranslatef(self.player.x, self.player.y, 0.0f);
```
Where `self.player.x` and `self.player.y` are `GLfloat` variables ranging from `-3.0f` to `3.0f`.
However, all I see is a blue cross:

I use `glOrthof` to make OpenGL use the correct aspect ratio. When I comment the `glOrthof` call out, I get this result (the light blue lines should form squares, not rectangles):

---
I tried everything, from swapping the width and the height, changing the parameters of the `glOrthof` call, but nothing helped. Could someone help me out, or explain what I've done wrong? Thanks in advance. :)
|
When using glOrthof, all I see is a cross
|
CC BY-SA 3.0
| null |
2011-05-22T10:07:51.187
|
2011-05-22T11:20:45.680
|
2011-05-22T10:26:03.697
| null | null |
[
"c",
"ios",
"opengl-es",
"landscape",
"aspect-ratio"
] |
6,087,325 | 1 | 6,088,090 | null | 1 | 1,340 |
I'm trying to run [gpsfeed+](http://gpsfeed.sourceforge.net/) to test an app I'm writing, and when running , I get a
```
Error in startup script: can't find package udp
while executing
"package req udp"
(file "gpsfeed+.tcl" line 738)
```
There seem to be no instructions/help available for downloading and installing the udp package..
Does anyone have a straight-forward method for adding this package to tcl?
(I'm on osx 10.6.7, and have tcl8.5 installed in /opt/local/lib/tcl8.5/)
Thanks
---
(Thanks, Donal)
1. I downloaded ActiveTcl, and installed it (Double-click).
2. ActiveTcl installs teacup, which should be updated: sudo teacup update-self
3. sudo teacup install udp found and installed the udp package Resolving udp ... [package udp 1.0.9 macosx10.5-i386-x86_64 @ http://teapot.activestate.com] Resolving Tcl 8.4 -is package ... [package Tcl 8.5.9 _ ... Installed outside repository, probing dependencies] Retrieving package udp 1.0.9 macosx10.5-i386-x86_64 ...@ http://teapot.activestate.com ... Ok Installing into /Library/Tcl/teapot Installing package udp 1.0.9 macosx10.5-i386-x86_64
4. Now, either changing the path for the ActiveTcl tclsh version, or running it explicitly /usr/local/bin/tclsh8.5 gpsfeed+.tcl works, and the udp library is found.
Now, all I need is someone to rewrite it to be legible! ;)

|
can't install udp package for tcl on a mac
|
CC BY-SA 3.0
| 0 |
2011-05-22T10:26:50.977
|
2013-03-19T16:40:27.167
|
2013-03-19T16:40:27.167
| 1,039,608 | 130,230 |
[
"macos",
"gps",
"tcl",
"macports",
"ports"
] |
6,087,611 | 1 | 6,087,625 | null | 1 | 2,339 |
I want to find an opensource or a free control for cocoa couch, what is like WeCity invite friends page? 
Is there any ready to use component out in the market? Or I must create it? I don't want all in one component, if something missing from the list above, I don't care. But I want to find a "stater" component, what I can upgrade if needed.
|
Invite your facebook,twitter,gmail friends control for ios app?
|
CC BY-SA 3.0
| null |
2011-05-22T11:28:16.390
|
2011-05-22T11:31:20.037
| null | null | 343,202 |
[
"xcode",
"ios",
"facebook",
"gmail"
] |
6,087,852 | 1 | 6,088,526 | null | 2 | 236 |
When a user on a popular website gets a response, they are (rather embarrassingly) told that they have "1 responses" (see illustration).

I'm sure it must be easy to determine whether they have one and strip the 's' from the end of the word.
|
How can I make my web application understand the difference between singular and plural?
|
CC BY-SA 3.0
| 0 |
2011-05-22T12:15:33.503
|
2014-02-22T23:03:11.117
|
2014-02-22T23:03:11.117
| 578,411 | 78,845 |
[
"user-interface",
"web-applications",
"user-experience",
"plural"
] |
6,087,888 | 1 | 6,087,950 | null | 2 | 5,344 |
I'm currently using a writeln command to write to a text file.
Is there any way to use concatenated string using record in pascal?
This is my pascal code currently:
```
Procedure SaveTopScores (Var TopScores : TTopScores);
Var
Count : Integer;
CurrentFile : Text;
Begin
Assign(CurrentFile, 'HiScores.txt');
Rewrite(CurrentFile);
For Count := 1 To MaxSize
Do Writeln(CurrentFile, TopScores[Count].Name, ',', TopScores[Count].Score);
Close(CurrentFile);
End;
```
And this is writing to the file in VB, is there a way to do a concatenated string in pascal?

|
concatenated string in Pascal
|
CC BY-SA 3.0
| 0 |
2011-05-22T12:22:55.713
|
2011-05-22T20:06:51.047
| null | null | 540,909 |
[
"save",
"concatenation",
"pascal",
"text-files",
"string-concatenation"
] |
6,088,326 | 1 | 6,088,845 | null | 0 | 1,665 |
My goal is to make somethink like this:

There is viewport with border layout. "Container" and "center" both have "fit" layout. The "Panel" has 'vbox' layout and has three elements. The grid has one row when loaded the first time. I want all the grid to catch all the height and the button panels on top and in the bottom of it. If I don't specify the height of the grid or "container" or "Panel", I don't see anything.
How can I make it work?
|
Problem with layouts
|
CC BY-SA 3.0
| null |
2011-05-22T13:51:08.393
|
2011-05-22T23:21:30.627
| null | null | 533,861 |
[
"layout",
"extjs"
] |
6,088,380 | 1 | 6,088,967 | null | 0 | 166 |

Hi
I have some text field which, after a decoding, set some UILabel. The problem is that if the user leave some empty field , I don't like to see that space between the labels. I enclose a picture for a better understanding. thanks in advance.
|
Space between labels when user leave a text field empty
|
CC BY-SA 3.0
| null |
2011-05-22T14:00:21.850
|
2011-05-22T15:40:08.993
| null | null | 651,871 |
[
"iphone",
"objective-c"
] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.