PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,850,900 | 10/21/2011 14:28:13 | 329,712 | 04/30/2010 11:31:21 | 14 | 0 | How to load all embedded fonts from pdf file using fontforge script | I am trying to load fonts from pdf file using following fontforge script
Open("file.pdf")
file = $firstfont
while ( file != "" )
Open(file)
Print($fontname)
file = $nextfont
endloop
This only loads one font but if I open same pdf file using fontforge gui it shows 7 fonts. Can I get some help. | script | embedded-fonts | fontforge | null | null | null | open | How to load all embedded fonts from pdf file using fontforge script
===
I am trying to load fonts from pdf file using following fontforge script
Open("file.pdf")
file = $firstfont
while ( file != "" )
Open(file)
Print($fontname)
file = $nextfont
endloop
This only loads one font but if I open same pdf file using fontforge gui it shows 7 fonts. Can I get some help. | 0 |
5,196,585 | 03/04/2011 16:33:54 | 645,103 | 03/04/2011 16:33:54 | 1 | 0 | plz ans how to parse this . in i-phone... here s one xml file plz tell me the code to parse it. | <start>
<user>
<id=1>
<name>vandana</name>
<section><value>abc</value></section>
</user>
</start> | iphone | objective-c | cocoa-touch | null | null | 03/04/2011 16:39:30 | not a real question | plz ans how to parse this . in i-phone... here s one xml file plz tell me the code to parse it.
===
<start>
<user>
<id=1>
<name>vandana</name>
<section><value>abc</value></section>
</user>
</start> | 1 |
11,632,388 | 07/24/2012 13:52:50 | 649,230 | 03/08/2011 04:33:12 | 184 | 9 | GTK ComboBox set_active_text: assertion `GTK_IS_COMBO_BOX (combo_box)' failed | I am adding a MS Word-esque Combo Box to my application to allow the user to change the font size. Here is the setup code:
sizeBox = gtk.combo_box_new_text()
for size in xrange(MIN_FONT_SIZE, MAX_FONT_SIZE+1):
sizeBox.append_text(str(size))
def UpdateFontSize(c, box):
newSize = box.get_active_text()
if newSize:
self.textViewer.SetFontSize(int(newSize))
print sizeBox.get_active_text()
sizeBox.connect("changed", UpdateFontSize, sizeBox)
Running my program and trying to change the selected entry in the combo box gives me this:
None
OutNav.py:876: GtkWarning: gtk_combo_box_get_active_text: assertion `GTK_IS_COMBO_BOX (combo_box)' failed
newSize = box.get_active_text()
So get_active_text works fine in the enclosing scope, but when I supply the ComboBox as an argument to the callback, it suddenly stops working. Can anyone tell me what is going on here? (I wanted to use a ComboBoxText as apparently gtk.combo_box_new_text is deprecated, but for some reason it isn't in my distribution of PyGTK 2.24) | python | gtk | pygtk | null | null | null | open | GTK ComboBox set_active_text: assertion `GTK_IS_COMBO_BOX (combo_box)' failed
===
I am adding a MS Word-esque Combo Box to my application to allow the user to change the font size. Here is the setup code:
sizeBox = gtk.combo_box_new_text()
for size in xrange(MIN_FONT_SIZE, MAX_FONT_SIZE+1):
sizeBox.append_text(str(size))
def UpdateFontSize(c, box):
newSize = box.get_active_text()
if newSize:
self.textViewer.SetFontSize(int(newSize))
print sizeBox.get_active_text()
sizeBox.connect("changed", UpdateFontSize, sizeBox)
Running my program and trying to change the selected entry in the combo box gives me this:
None
OutNav.py:876: GtkWarning: gtk_combo_box_get_active_text: assertion `GTK_IS_COMBO_BOX (combo_box)' failed
newSize = box.get_active_text()
So get_active_text works fine in the enclosing scope, but when I supply the ComboBox as an argument to the callback, it suddenly stops working. Can anyone tell me what is going on here? (I wanted to use a ComboBoxText as apparently gtk.combo_box_new_text is deprecated, but for some reason it isn't in my distribution of PyGTK 2.24) | 0 |
1,721,675 | 11/12/2009 11:50:18 | 200,862 | 11/02/2009 10:12:00 | 112 | 13 | Web content presentation | Any one have an ideas how to present a website content very impressive? Is there any reference that guides me? | html | contents | presentations | null | null | 05/05/2012 13:55:02 | not constructive | Web content presentation
===
Any one have an ideas how to present a website content very impressive? Is there any reference that guides me? | 4 |
7,682,320 | 10/07/2011 01:50:10 | 719,385 | 04/21/2011 17:11:04 | 16 | 0 | Finding missing integers - Prolog | I want to take a list of integers and create a list of the integers which are between the integers in the former list. For example, I'd like ?- findmissing([1,3,4,5,6],X). to result in X = [2]. I'm extremely green when it comes to logic programming, and would greatly appreciate any example of how to implement such a function. | list | prolog | integer | null | null | null | open | Finding missing integers - Prolog
===
I want to take a list of integers and create a list of the integers which are between the integers in the former list. For example, I'd like ?- findmissing([1,3,4,5,6],X). to result in X = [2]. I'm extremely green when it comes to logic programming, and would greatly appreciate any example of how to implement such a function. | 0 |
11,187,997 | 06/25/2012 10:56:34 | 1,234,163 | 02/26/2012 18:03:52 | 1 | 0 | Where do i start my MVC website? pls suggest me the steps to build my new website in MVC? | I am new to MVC. I need to know where to start with my website and the way i have to build in MVC? Tell me the steps to build an MVC website from the scratch? | asp.net-mvc-3 | null | null | null | null | 06/25/2012 12:32:34 | not a real question | Where do i start my MVC website? pls suggest me the steps to build my new website in MVC?
===
I am new to MVC. I need to know where to start with my website and the way i have to build in MVC? Tell me the steps to build an MVC website from the scratch? | 1 |
12,268 | 08/15/2008 14:01:15 | 1,228 | 08/13/2008 13:58:55 | 233 | 27 | Have you ever reflected Reflector? | Lutz Roeder's Reflector, that is.
Its obfuscated.
![alt text][1]
I still don't understand this. Can somebody please explain?
[1]: http://i37.tinypic.com/2lsd4dk.jpg | reflector | lutz | roeder | null | null | 01/03/2012 20:19:35 | not constructive | Have you ever reflected Reflector?
===
Lutz Roeder's Reflector, that is.
Its obfuscated.
![alt text][1]
I still don't understand this. Can somebody please explain?
[1]: http://i37.tinypic.com/2lsd4dk.jpg | 4 |
6,799,554 | 07/23/2011 09:38:57 | 859,165 | 07/23/2011 09:33:51 | 1 | 0 | Internet Explorer Crashes My Site | Hi anyone have the issue that I get with the dreaded IE family:
IE 9 :
Webpage error:
Line: 916
Error: unable to get value of the property ‘split’: object is null or undefined
What the hell does all that mean, when I debug using IE it shows me to disqus script, I have messed with this but it does nothing to sort the issue after emptying cache etc.
www.mobileinquirer.com
Many thanks in advance | php | html | css | wordpress | null | 07/23/2011 22:20:49 | not a real question | Internet Explorer Crashes My Site
===
Hi anyone have the issue that I get with the dreaded IE family:
IE 9 :
Webpage error:
Line: 916
Error: unable to get value of the property ‘split’: object is null or undefined
What the hell does all that mean, when I debug using IE it shows me to disqus script, I have messed with this but it does nothing to sort the issue after emptying cache etc.
www.mobileinquirer.com
Many thanks in advance | 1 |
6,608,535 | 07/07/2011 09:35:28 | 735,664 | 05/03/2011 07:32:42 | 1 | 0 | Mandatory Tags for Dicom Image | iam trying send a dicom from application to server .
But It is not Happening.
its showing some tags were missed..
so please give list mandatory tags which are required for dicom to send server... | dicom | null | null | null | null | null | open | Mandatory Tags for Dicom Image
===
iam trying send a dicom from application to server .
But It is not Happening.
its showing some tags were missed..
so please give list mandatory tags which are required for dicom to send server... | 0 |
9,895,346 | 03/27/2012 18:25:31 | 438,958 | 09/03/2010 12:40:28 | 466 | 5 | xsl: passing variable into xsl file path | Is there a way pass a attribute, variable combinations directly into the path of the url with xsl?
Example:
http://something.xsl?asdf=12&attribute2=1234
I would like to use these attributes and values to enable certain flags inside the xsl file.
| xslt | null | null | null | null | null | open | xsl: passing variable into xsl file path
===
Is there a way pass a attribute, variable combinations directly into the path of the url with xsl?
Example:
http://something.xsl?asdf=12&attribute2=1234
I would like to use these attributes and values to enable certain flags inside the xsl file.
| 0 |
11,058,332 | 06/15/2012 21:20:18 | 24,563 | 10/02/2008 16:44:42 | 90 | 2 | Positioning Images inside that are inside a div around text | I have an array of div tags that hold images (and captions):
array
1 <div style="padding:5px;border:solid black 1px;width:320"><img src="http://local/photos/3645/thumb/320/tj3645_070206_134731_160020_tn320.JPG" id="tnImg160020_320"></div>
2 <div style="padding:5px;border:solid black 1px;width:490"><img src="http://local/photos/3645/thumb/490/tj3645_060406_025416_151917_tn490.JPG" id="tnImg151917_490"></div>
3 <div style="padding:5px;border:solid black 1px;width:170"><img src="http://local/photos/3645/thumb/170/tj3645_061006_042104_153889_tn170.JPG" id="tnImg153889_170"></div>
Then I have a variable that contains the text of an article. The array of images is generated on the fly from settings in a database. The plan is to allow the users to decide where they'd like to position the images (top, right, left, bottom, middle, etc.)
My questions is, what's the best way to wrap the text around the these images? The whole content is currently wrapped inside a main container div:
<div id="mainDiv"><div>Images1<div><div>Images2<div><div>Images3<div> Text</div>
Thanks!
| css | styles | textwrapping | null | null | 06/18/2012 16:14:47 | not a real question | Positioning Images inside that are inside a div around text
===
I have an array of div tags that hold images (and captions):
array
1 <div style="padding:5px;border:solid black 1px;width:320"><img src="http://local/photos/3645/thumb/320/tj3645_070206_134731_160020_tn320.JPG" id="tnImg160020_320"></div>
2 <div style="padding:5px;border:solid black 1px;width:490"><img src="http://local/photos/3645/thumb/490/tj3645_060406_025416_151917_tn490.JPG" id="tnImg151917_490"></div>
3 <div style="padding:5px;border:solid black 1px;width:170"><img src="http://local/photos/3645/thumb/170/tj3645_061006_042104_153889_tn170.JPG" id="tnImg153889_170"></div>
Then I have a variable that contains the text of an article. The array of images is generated on the fly from settings in a database. The plan is to allow the users to decide where they'd like to position the images (top, right, left, bottom, middle, etc.)
My questions is, what's the best way to wrap the text around the these images? The whole content is currently wrapped inside a main container div:
<div id="mainDiv"><div>Images1<div><div>Images2<div><div>Images3<div> Text</div>
Thanks!
| 1 |
9,543,482 | 03/03/2012 04:35:49 | 1,246,391 | 03/03/2012 04:29:51 | 1 | 0 | Knockout.js observableArray | I am attempting to create an array of contract line items (CLINs) that will be displayed as individual DIVs below a header of general contract information. I am able to get the normal observables to work, but it appears that the passing of the array via the constructor for the view model is not creating any part of the clins observable array. I have a jsFiddle (http://jsfiddle.net/TuRrs/3/) that illustrates my problem. What is strange to me is that the data-bind="text: clins.length() on the HTML span tag does not even return zero, but instead renders nothing. Is there anyway to enable debugging within a jsFiddle or should I see a warning/error? | knockout.js | null | null | null | null | null | open | Knockout.js observableArray
===
I am attempting to create an array of contract line items (CLINs) that will be displayed as individual DIVs below a header of general contract information. I am able to get the normal observables to work, but it appears that the passing of the array via the constructor for the view model is not creating any part of the clins observable array. I have a jsFiddle (http://jsfiddle.net/TuRrs/3/) that illustrates my problem. What is strange to me is that the data-bind="text: clins.length() on the HTML span tag does not even return zero, but instead renders nothing. Is there anyway to enable debugging within a jsFiddle or should I see a warning/error? | 0 |
7,454,201 | 09/17/2011 10:48:57 | 68,438 | 02/19/2009 15:09:23 | 858 | 30 | Releasing the cache of a WPF Image Control | I have a timer and on every tick I want to take an image file from memory and change the image that is being displayed in the `Image` with this piece of code
Application.Current.Dispatcher.BeginInvoke(
DispatcherPriority.Render,
new Action(() =>
{
ms.Seek(0, SeekOrigin.Begin);
e.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
bitmapImage.BeginInit();
bitmapImage.StreamSource = ms;
bitmapImage.CacheOption = BitmapCacheOption.None;
bitmapImage.EndInit();
CameraImageBox.BeginInit();
CameraImageBox.Source = bitmapImage;
CameraImageBox.EndInit();
bitmapImage = null;
ms.Flush();
}));
The Image control turns pitch black after a couple of dozen of images and the whole ui turns quite unresponsive. The memory use jumps to a whopping 1gig, I'm assuming the image controls render cache doesn't get released as `e.Image` is a static resource that gets redrawn every time.
Is there a better way to do this, like rendering the image in a `Rectangle` or manually releasing the cache? | c# | wpf | imaging | null | null | null | open | Releasing the cache of a WPF Image Control
===
I have a timer and on every tick I want to take an image file from memory and change the image that is being displayed in the `Image` with this piece of code
Application.Current.Dispatcher.BeginInvoke(
DispatcherPriority.Render,
new Action(() =>
{
ms.Seek(0, SeekOrigin.Begin);
e.Image.Save(ms, System.Drawing.Imaging.ImageFormat.Bmp);
BitmapImage bitmapImage = new BitmapImage();
bitmapImage.CreateOptions = BitmapCreateOptions.IgnoreImageCache;
bitmapImage.BeginInit();
bitmapImage.StreamSource = ms;
bitmapImage.CacheOption = BitmapCacheOption.None;
bitmapImage.EndInit();
CameraImageBox.BeginInit();
CameraImageBox.Source = bitmapImage;
CameraImageBox.EndInit();
bitmapImage = null;
ms.Flush();
}));
The Image control turns pitch black after a couple of dozen of images and the whole ui turns quite unresponsive. The memory use jumps to a whopping 1gig, I'm assuming the image controls render cache doesn't get released as `e.Image` is a static resource that gets redrawn every time.
Is there a better way to do this, like rendering the image in a `Rectangle` or manually releasing the cache? | 0 |
8,789,564 | 01/09/2012 14:01:00 | 1,126,525 | 01/02/2012 16:34:45 | 1 | 0 | Traversal of trees | What is the post-order traversal of a tree whose pre-order and in-order are:
PRE: ABDEHICFGJK
IN : DBHEIAFCJGK.
Can anyone draw the tree and explain it | tree | null | null | null | null | 01/09/2012 20:10:50 | not a real question | Traversal of trees
===
What is the post-order traversal of a tree whose pre-order and in-order are:
PRE: ABDEHICFGJK
IN : DBHEIAFCJGK.
Can anyone draw the tree and explain it | 1 |
11,115,398 | 06/20/2012 08:15:02 | 1,450,272 | 06/12/2012 03:31:51 | 1 | 0 | Linux Permissions to deny SSH users from accessing other user folders | I am currently running Fedora on a network computer, acting as a host to other users who will SSH into my terminal to do their work.
However i realised that they are also able to access my /home folder. How do i go about setting the permissions such that they are not able to access it?
Thanks. | linux | permissions | access-control | null | null | 06/20/2012 08:17:51 | off topic | Linux Permissions to deny SSH users from accessing other user folders
===
I am currently running Fedora on a network computer, acting as a host to other users who will SSH into my terminal to do their work.
However i realised that they are also able to access my /home folder. How do i go about setting the permissions such that they are not able to access it?
Thanks. | 2 |
9,910,971 | 03/28/2012 15:37:22 | 1,298,589 | 03/28/2012 15:25:30 | 1 | 0 | Need Javascript for loading images into scaling div background | I am designing a site that is using a scaling background image for each page.
On one page "showrooms" I want 4 ap divs with thumbnail images, I want a user to to click one of these thumb nails and have the larger/full size image (scaling background) replaced.
I have tried various snippets but can't figure this one out.
Someone help please. Here is the page i am talking about (however, without the four selectable divs, the html lay out is no problem, I just need java to click function from the thumbnail id, and load into the large scaling image) : http://www.kenianimports.com/showrooms.html | java | null | null | null | null | 03/28/2012 15:42:01 | not a real question | Need Javascript for loading images into scaling div background
===
I am designing a site that is using a scaling background image for each page.
On one page "showrooms" I want 4 ap divs with thumbnail images, I want a user to to click one of these thumb nails and have the larger/full size image (scaling background) replaced.
I have tried various snippets but can't figure this one out.
Someone help please. Here is the page i am talking about (however, without the four selectable divs, the html lay out is no problem, I just need java to click function from the thumbnail id, and load into the large scaling image) : http://www.kenianimports.com/showrooms.html | 1 |
10,597,390 | 05/15/2012 09:01:23 | 409,521 | 08/03/2010 10:03:12 | 421 | 11 | How to execute a .pm file on web page | I was given two .pm files that I need to trace... problem is I haven't encountered one before and I don't know how I can run it on web page for tracing.
Do I just need to upload those .pm files on my web server, go to url pointing to its location?
I'm clueless. | perl | null | null | null | null | 05/15/2012 13:58:17 | not a real question | How to execute a .pm file on web page
===
I was given two .pm files that I need to trace... problem is I haven't encountered one before and I don't know how I can run it on web page for tracing.
Do I just need to upload those .pm files on my web server, go to url pointing to its location?
I'm clueless. | 1 |
11,654,661 | 07/25/2012 16:46:31 | 1,319,343 | 04/07/2012 16:41:02 | 15 | 0 | Un-normalize a table | I have a normalized table (table a) and a non-normalized table (table b), like this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/51orV.png
Basically, for each row in table a for the same student ID, I want to read all the parents with the same studentId and put the data into one row in table B.
So if I have 3 rows in table A, then there would be one row in table B with 3 of the 4 parent fields filled in. Any help for an SQl query for this would be appreciated. | sql | sql-server | query | tsql | null | 07/26/2012 07:39:18 | not constructive | Un-normalize a table
===
I have a normalized table (table a) and a non-normalized table (table b), like this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/51orV.png
Basically, for each row in table a for the same student ID, I want to read all the parents with the same studentId and put the data into one row in table B.
So if I have 3 rows in table A, then there would be one row in table B with 3 of the 4 parent fields filled in. Any help for an SQl query for this would be appreciated. | 4 |
4,969,018 | 02/11/2011 12:32:30 | 482,925 | 10/21/2010 11:27:55 | 73 | 0 | mysql benchmark ? | I wan`t to make some benchmark tests, so how to generate long time taking query (20 seconds will be enough) ? | mysql | null | null | null | null | 02/11/2011 12:50:29 | not a real question | mysql benchmark ?
===
I wan`t to make some benchmark tests, so how to generate long time taking query (20 seconds will be enough) ? | 1 |
647,723 | 03/15/2009 12:21:35 | 18,626 | 09/19/2008 07:50:08 | 1 | 0 | How to fix garbled text with using WriteFile on a pipe? | I have a Win32 application that I'm making, and it sends a string from one process to another via a named pipe. However, the process that calls ReadFile on the pipe gets the string with some garbled data in it. It returns the number of bytes written correctly, but the last 8 characters or so of the string are garbled.
Here is the code for creating the pipe, and writing to it:
myPipe = CreateNamedPipe(L"\\\\.\\pipe\\testpipe", PIPE_ACCESS_OUTBOUND, PIPE_NOWAIT, 10, 512, 512, 10, NULL);
TCHAR title[128];
GetWindowText(foundHwnd, title, 128);
wstring windowTitle(title);
vector<wstring> splitVec;
boost::split(splitVec, windowTitle, boost::algorithm::is_any_of(wstring(L"|")));
WriteFile(myPipe, splitVec[0].c_str(), splitVec[0].size(), &wrote, NULL);
And here is the code that reads it:
if (WaitNamedPipe(L"\\\\.\\pipe\\testpipe", 5000) == 0) {
MessageBox(NULL, L"Unable to wait for pipe", L"Error", MB_OK);
return false;
}
myPipe = CreateFile(L"\\\\.\\pipe\\testpipe", GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (myPipe == INVALID_HANDLE_VALUE) {
MessageBox(NULL, L"Unable to open pipe", L"Error", MB_OK);
return false;
}
// Other code here...
TCHAR buf[512];
DWORD read;
success = ReadFile(myPipe, buf, 512, &read, NULL);
if (read > 0)
MessageBox(NULL, buf, L"Got Data", MB_OK);
When MessageBox is shown, the end of the string is garbled and I have no idea why. Any ideas?
Thanks! | winapi | named-pipes | null | null | null | null | open | How to fix garbled text with using WriteFile on a pipe?
===
I have a Win32 application that I'm making, and it sends a string from one process to another via a named pipe. However, the process that calls ReadFile on the pipe gets the string with some garbled data in it. It returns the number of bytes written correctly, but the last 8 characters or so of the string are garbled.
Here is the code for creating the pipe, and writing to it:
myPipe = CreateNamedPipe(L"\\\\.\\pipe\\testpipe", PIPE_ACCESS_OUTBOUND, PIPE_NOWAIT, 10, 512, 512, 10, NULL);
TCHAR title[128];
GetWindowText(foundHwnd, title, 128);
wstring windowTitle(title);
vector<wstring> splitVec;
boost::split(splitVec, windowTitle, boost::algorithm::is_any_of(wstring(L"|")));
WriteFile(myPipe, splitVec[0].c_str(), splitVec[0].size(), &wrote, NULL);
And here is the code that reads it:
if (WaitNamedPipe(L"\\\\.\\pipe\\testpipe", 5000) == 0) {
MessageBox(NULL, L"Unable to wait for pipe", L"Error", MB_OK);
return false;
}
myPipe = CreateFile(L"\\\\.\\pipe\\testpipe", GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (myPipe == INVALID_HANDLE_VALUE) {
MessageBox(NULL, L"Unable to open pipe", L"Error", MB_OK);
return false;
}
// Other code here...
TCHAR buf[512];
DWORD read;
success = ReadFile(myPipe, buf, 512, &read, NULL);
if (read > 0)
MessageBox(NULL, buf, L"Got Data", MB_OK);
When MessageBox is shown, the end of the string is garbled and I have no idea why. Any ideas?
Thanks! | 0 |
9,680,955 | 03/13/2012 09:01:20 | 1,151,377 | 01/16/2012 07:21:59 | 1 | 0 | Nested MySQL Queries | I have been trying to write a query for a public transportation system which will output a list of routes when I input the origin and destination stop numbers.
Here is my MySQL Table :
mysql> desc route_timings;
+----------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| route_number | int(11) | NO | | NULL | |
| stop_number | int(11) | NO | | NULL | |
| arrival_time | time | YES | | NULL | |
| departure_time | time | YES | | NULL | |
+----------------+---------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
Here are sample values :
mysql> select * from route_timings;
+----+--------------+-------------+--------------+----------------+
| ID | route_number | stop_number | arrival_time | departure_time |
+----+--------------+-------------+--------------+----------------+
| 1 | 54 | 1 | 10:00:00 | 10:05:00 |
| 2 | 54 | 2 | 11:00:00 | 11:05:00 |
| 3 | 54 | 3 | 12:00:00 | 12:05:00 |
| 4 | 55 | 3 | 13:00:00 | 13:05:00 |
| 5 | 55 | 4 | 14:00:00 | 14:05:00 |
| 6 | 55 | 5 | 15:00:00 | 15:05:00 |
| 7 | 60 | 3 | 10:00:00 | 10:05:00 |
| 8 | 60 | 2 | 11:00:00 | 11:05:00 |
| 9 | 60 | 1 | 12:00:00 | 12:05:00 |
+----+--------------+-------------+--------------+----------------+
9 rows in set (0.01 sec)
My question is: if I want to list the route_number's that would contain stop_number 1 and stop_number 3, I would write a query similar to this :
SELECT DISTINCT `route_number` FROM `route_timings` WHERE `route_number` IN (
SELECT `route_number` FROM `route_timings` WHERE `stop_number`=1
) AND `route_number` IN (
SELECT `route_number` FROM `route_timings` WHERE `stop_number`=3
);
However, the above query would only return the route_numbers containing the two stops and not the routes where the source stop (1) would arrive before the destination stop(3).
The query would return the following:
+--------------+
| route_number |
+--------------+
| 54 |
| 60 |
+--------------+
The route_number 60 does not start from 1 and go to 3 but instead starts from 3 and goes to 1. Can someone please help me add that bit to the query so that the query outputs only the route_numbers where the arrival_time for the stop_number 1 is less than the arrival_time for the stop_number 3.
Thanks in advance.
-Shain
| mysql | sql | nested-queries | null | null | null | open | Nested MySQL Queries
===
I have been trying to write a query for a public transportation system which will output a list of routes when I input the origin and destination stop numbers.
Here is my MySQL Table :
mysql> desc route_timings;
+----------------+---------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+----------------+---------+------+-----+---------+----------------+
| ID | int(11) | NO | PRI | NULL | auto_increment |
| route_number | int(11) | NO | | NULL | |
| stop_number | int(11) | NO | | NULL | |
| arrival_time | time | YES | | NULL | |
| departure_time | time | YES | | NULL | |
+----------------+---------+------+-----+---------+----------------+
5 rows in set (0.00 sec)
Here are sample values :
mysql> select * from route_timings;
+----+--------------+-------------+--------------+----------------+
| ID | route_number | stop_number | arrival_time | departure_time |
+----+--------------+-------------+--------------+----------------+
| 1 | 54 | 1 | 10:00:00 | 10:05:00 |
| 2 | 54 | 2 | 11:00:00 | 11:05:00 |
| 3 | 54 | 3 | 12:00:00 | 12:05:00 |
| 4 | 55 | 3 | 13:00:00 | 13:05:00 |
| 5 | 55 | 4 | 14:00:00 | 14:05:00 |
| 6 | 55 | 5 | 15:00:00 | 15:05:00 |
| 7 | 60 | 3 | 10:00:00 | 10:05:00 |
| 8 | 60 | 2 | 11:00:00 | 11:05:00 |
| 9 | 60 | 1 | 12:00:00 | 12:05:00 |
+----+--------------+-------------+--------------+----------------+
9 rows in set (0.01 sec)
My question is: if I want to list the route_number's that would contain stop_number 1 and stop_number 3, I would write a query similar to this :
SELECT DISTINCT `route_number` FROM `route_timings` WHERE `route_number` IN (
SELECT `route_number` FROM `route_timings` WHERE `stop_number`=1
) AND `route_number` IN (
SELECT `route_number` FROM `route_timings` WHERE `stop_number`=3
);
However, the above query would only return the route_numbers containing the two stops and not the routes where the source stop (1) would arrive before the destination stop(3).
The query would return the following:
+--------------+
| route_number |
+--------------+
| 54 |
| 60 |
+--------------+
The route_number 60 does not start from 1 and go to 3 but instead starts from 3 and goes to 1. Can someone please help me add that bit to the query so that the query outputs only the route_numbers where the arrival_time for the stop_number 1 is less than the arrival_time for the stop_number 3.
Thanks in advance.
-Shain
| 0 |
9,458,034 | 02/26/2012 22:50:45 | 1,181,261 | 01/31/2012 20:12:13 | 359 | 11 | Why is "Set()" function better than modifying public variable? | This one is bothering me for a while now :)
Suppose we have a variable - why is writing a Set function better practice than simply modifying variable's data (and setting the variable to be public instead of private)?
It's less coding that way and I can't see any "security" issues. | private | public | null | null | null | null | open | Why is "Set()" function better than modifying public variable?
===
This one is bothering me for a while now :)
Suppose we have a variable - why is writing a Set function better practice than simply modifying variable's data (and setting the variable to be public instead of private)?
It's less coding that way and I can't see any "security" issues. | 0 |
6,050,570 | 05/18/2011 20:22:04 | 759,895 | 05/18/2011 20:08:40 | 1 | 0 | String or Object | I am trying to send data different data (Security keys, encrypted message )in distributed system that use Java NIO. my question is what is the best way to send data? . I am currently sending data using base64 encoding and append different data in to a single string. Is this good or it will be good to send data using java serializable object.
please help
Thanx | java | null | null | null | null | 05/19/2011 03:33:35 | not a real question | String or Object
===
I am trying to send data different data (Security keys, encrypted message )in distributed system that use Java NIO. my question is what is the best way to send data? . I am currently sending data using base64 encoding and append different data in to a single string. Is this good or it will be good to send data using java serializable object.
please help
Thanx | 1 |
7,795,558 | 10/17/2011 14:52:31 | 999,363 | 10/17/2011 14:33:08 | 1 | 0 | stdbuf usage: increasing buffer size | I've got an awk script sending out long strings (>10K chars) to stdout.
I would like to increase the buffer size so that larger chunks of those long strings are written at once. I've timed both pipes below with different -o sizes but there's no significant changes
time stdbuf -o 100MB awk -f processing.awk infile.txt | sort -k1,1 > outfile.txt
time stdbuf -o 100MB awk -f processing.awk infile.txt > outfile.txt
real/user/sys timings are all very similar to oneanother (+- 10% on each metric).
My question is whether I'm using stdbuf the right way? Thank you.
FZ.
| unix | pipes | null | null | null | null | open | stdbuf usage: increasing buffer size
===
I've got an awk script sending out long strings (>10K chars) to stdout.
I would like to increase the buffer size so that larger chunks of those long strings are written at once. I've timed both pipes below with different -o sizes but there's no significant changes
time stdbuf -o 100MB awk -f processing.awk infile.txt | sort -k1,1 > outfile.txt
time stdbuf -o 100MB awk -f processing.awk infile.txt > outfile.txt
real/user/sys timings are all very similar to oneanother (+- 10% on each metric).
My question is whether I'm using stdbuf the right way? Thank you.
FZ.
| 0 |
11,172,050 | 06/23/2012 18:44:32 | 1,477,213 | 06/23/2012 18:39:52 | 1 | 0 | Why source spoofed packets , cant transmitted in internet? | i use raw socket to spoof source ip of packets but i cant recieve , spoofed packets in target...
if my ip is :
44.44.44.44
i cant recieve packets with source ip : 44.44.44.45 | sockets | raw | null | null | null | 06/24/2012 02:53:14 | not a real question | Why source spoofed packets , cant transmitted in internet?
===
i use raw socket to spoof source ip of packets but i cant recieve , spoofed packets in target...
if my ip is :
44.44.44.44
i cant recieve packets with source ip : 44.44.44.45 | 1 |
3,380,459 | 08/01/2010 02:02:35 | 407,741 | 08/01/2010 02:02:35 | 1 | 0 | auto-resize images in posts with link to image URL? | This will be used in my community website (forum, articles) where some users post very large image.
I can auto-resize the images using below codes
#post img {
max-height: 1000px;
max-width: 700px;
}
But one more, I want (on every resized image) a link created to that image URL. So when visitor click the link, they can see the image actual size. | javascript | css | image | null | null | null | open | auto-resize images in posts with link to image URL?
===
This will be used in my community website (forum, articles) where some users post very large image.
I can auto-resize the images using below codes
#post img {
max-height: 1000px;
max-width: 700px;
}
But one more, I want (on every resized image) a link created to that image URL. So when visitor click the link, they can see the image actual size. | 0 |
7,145,920 | 08/22/2011 10:13:56 | 746,379 | 05/10/2011 07:47:18 | 128 | 2 | magento {{store url}} does not redirect to secure base url | After having set up SSL i wanted magento to always use this.
It has been set up to use the secure base url on the frontend and nearly all urls got modified for this purpose.
However the urls from all CMS static blocks that where built with {{store url}} keep generating urls with the unsecure base url.
Does anyone know what might be the problem? | magento | ssl | https | magento-1.5 | null | 08/23/2011 16:32:33 | off topic | magento {{store url}} does not redirect to secure base url
===
After having set up SSL i wanted magento to always use this.
It has been set up to use the secure base url on the frontend and nearly all urls got modified for this purpose.
However the urls from all CMS static blocks that where built with {{store url}} keep generating urls with the unsecure base url.
Does anyone know what might be the problem? | 2 |
1,154,347 | 07/20/2009 15:48:56 | 32,173 | 10/28/2008 19:30:18 | 2,227 | 168 | Cannot modify member which defines object identity in Linq To Sql | I'm getting the following exception when I try to update a table using Linq To Sql:
> El valor de miembro 'IdSeccionNovedad'
> de un objeto de tipo 'Novedad' ha
> cambiado. No se puede modificar un
> miembro que define la identidad del
> objeto. Agregue un nuevo objeto con
> una nueva identidad y elimine el
> existente.
wich first sentence can be translated to something like:
> Cannot modify member which defines
> object identity
The table is this:
CREATE TABLE [dbo].[Novedades](
[IdNovedad] [int] NOT NULL,
[IdSeccionNovedad] [int] NOT NULL,
[Antetitulo] [varchar](250) NULL,
[Titulo] [varchar](250) NOT NULL,
[Sumario] [varchar](max) NULL,
[Cuerpo] [varchar](max) NULL,
[FechaPublicacion] [smalldatetime] NOT NULL,
[Activo] [bit] NOT NULL,
CONSTRAINT [PK_Novedades] PRIMARY KEY CLUSTERED
(
[IdNovedad] ASC,
[IdSeccionNovedad] ASC
)
I know I can solve this using an stored procedure, but how can I solve this using Linq To Sql? | linq-to-sql | c# | null | null | null | null | open | Cannot modify member which defines object identity in Linq To Sql
===
I'm getting the following exception when I try to update a table using Linq To Sql:
> El valor de miembro 'IdSeccionNovedad'
> de un objeto de tipo 'Novedad' ha
> cambiado. No se puede modificar un
> miembro que define la identidad del
> objeto. Agregue un nuevo objeto con
> una nueva identidad y elimine el
> existente.
wich first sentence can be translated to something like:
> Cannot modify member which defines
> object identity
The table is this:
CREATE TABLE [dbo].[Novedades](
[IdNovedad] [int] NOT NULL,
[IdSeccionNovedad] [int] NOT NULL,
[Antetitulo] [varchar](250) NULL,
[Titulo] [varchar](250) NOT NULL,
[Sumario] [varchar](max) NULL,
[Cuerpo] [varchar](max) NULL,
[FechaPublicacion] [smalldatetime] NOT NULL,
[Activo] [bit] NOT NULL,
CONSTRAINT [PK_Novedades] PRIMARY KEY CLUSTERED
(
[IdNovedad] ASC,
[IdSeccionNovedad] ASC
)
I know I can solve this using an stored procedure, but how can I solve this using Linq To Sql? | 0 |
7,667,392 | 10/05/2011 20:34:13 | 516,534 | 11/22/2010 18:58:54 | 246 | 11 | Silverlight: FrameworkElement.FindName() not finding the control when it's not "visible" in the browser window | I'm having an issue where by I'm using the "FindName()" method of the FrameworkElement object to search for a child control of that element.
There's some interesting behavior that I've noticed and can't seem to figure out.
If the user scrolls the browser window so that the control itself visibly is not shown anymore within the context of the window frame, then the "FindName()" does not return the element.
However, if that control is visible within the window frame, it finds it fine.
Is this a known issue? Has anyone else run into this before?
I'm not talking about the Visibility property of the control either. The Visibility property is set to Visible. | wpf | silverlight | usercontrols | visibility | null | null | open | Silverlight: FrameworkElement.FindName() not finding the control when it's not "visible" in the browser window
===
I'm having an issue where by I'm using the "FindName()" method of the FrameworkElement object to search for a child control of that element.
There's some interesting behavior that I've noticed and can't seem to figure out.
If the user scrolls the browser window so that the control itself visibly is not shown anymore within the context of the window frame, then the "FindName()" does not return the element.
However, if that control is visible within the window frame, it finds it fine.
Is this a known issue? Has anyone else run into this before?
I'm not talking about the Visibility property of the control either. The Visibility property is set to Visible. | 0 |
8,466,681 | 12/11/2011 19:15:15 | 417,307 | 08/11/2010 13:54:22 | 26 | 1 | Debugging Webkit in Visual Studio | I am able to build webkit on windows7 under Visual Studio 2008..But for the purpose of debugging when I am putting breakpoints in source code, any of the breakpoints are not hitting. I am able to download symbols for every module required for the project. After running the project it is just launching the Safari without firing the breakpoints. Does anybody have any ideas about it or some links to refer regrading debugging webkit with visual Studio debugger. I have already looked the information provided on WebKit website and followed all steps but still unable to debug..
| visual-studio-2008 | webkit | null | null | null | null | open | Debugging Webkit in Visual Studio
===
I am able to build webkit on windows7 under Visual Studio 2008..But for the purpose of debugging when I am putting breakpoints in source code, any of the breakpoints are not hitting. I am able to download symbols for every module required for the project. After running the project it is just launching the Safari without firing the breakpoints. Does anybody have any ideas about it or some links to refer regrading debugging webkit with visual Studio debugger. I have already looked the information provided on WebKit website and followed all steps but still unable to debug..
| 0 |
6,521,014 | 06/29/2011 12:59:34 | 733,329 | 05/01/2011 13:53:19 | 3 | 0 | Replay on BG Music | I made a service that play background music ,but when music finished i want to replay it again , which method can i use in my service?
public class BackgroundSoundService extends Service {
private static final String TAG = null;
MediaPlayer player;
public IBinder onBind(Intent arg0) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
player = MediaPlayer.create(this, R.raw.idil);
player.setLooping(true); // Set looping
player.setVolume(100,100);
}
public int onStartCommand(Intent intent, int flags, int startId) {
player.start();
return 1;
}
public void onStart(Intent intent, int startId) {
// TODO
}
public IBinder onUnBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
public void onStop() {
}
public void onPause() {
}
@Override
public void onDestroy() {
player.stop();
player.release();
}
@Override
public void onLowMemory() {
}
}
Thank you
| java | android | null | null | null | null | open | Replay on BG Music
===
I made a service that play background music ,but when music finished i want to replay it again , which method can i use in my service?
public class BackgroundSoundService extends Service {
private static final String TAG = null;
MediaPlayer player;
public IBinder onBind(Intent arg0) {
return null;
}
@Override
public void onCreate() {
super.onCreate();
player = MediaPlayer.create(this, R.raw.idil);
player.setLooping(true); // Set looping
player.setVolume(100,100);
}
public int onStartCommand(Intent intent, int flags, int startId) {
player.start();
return 1;
}
public void onStart(Intent intent, int startId) {
// TODO
}
public IBinder onUnBind(Intent arg0) {
// TODO Auto-generated method stub
return null;
}
public void onStop() {
}
public void onPause() {
}
@Override
public void onDestroy() {
player.stop();
player.release();
}
@Override
public void onLowMemory() {
}
}
Thank you
| 0 |
11,546,931 | 07/18/2012 17:23:35 | 1,535,625 | 07/18/2012 17:19:29 | 1 | 0 | should I learn oracle 10g or 11g ?Is oracle 10g outdated now? | I am engineering student.Should I learn oracle 10g or oracle 11g now for getting a certification after 1 year?
Is oracle 10g outdated now? | oracle | null | null | null | null | 07/19/2012 14:19:12 | not constructive | should I learn oracle 10g or 11g ?Is oracle 10g outdated now?
===
I am engineering student.Should I learn oracle 10g or oracle 11g now for getting a certification after 1 year?
Is oracle 10g outdated now? | 4 |
3,782,157 | 09/23/2010 20:08:13 | 331,747 | 05/03/2010 19:59:20 | 371 | 14 | Ant Tasks for Amazon EC2/S3? | Does anyone know of a good library providing Ant tasks for performing operations against Amazon EC2/S3? I'd like to leverage S3 for deployment of new WAR files for my applications, and figured Ant would be a good way to keep simplify the process and keep everything consistent. Any recommendations? | java | ant | amazon-s3 | amazon-ec2 | task | null | open | Ant Tasks for Amazon EC2/S3?
===
Does anyone know of a good library providing Ant tasks for performing operations against Amazon EC2/S3? I'd like to leverage S3 for deployment of new WAR files for my applications, and figured Ant would be a good way to keep simplify the process and keep everything consistent. Any recommendations? | 0 |
11,441,806 | 07/11/2012 21:30:55 | 846,844 | 07/15/2011 16:45:29 | 146 | 1 | What browsers support the favicon link tag? | Does anyone what browsers support using the link tag for the favicon, as **opposed to** at the root of the site? I am considering doing that as an alternative to hosting the files at the root of each site because of an issue I'm having an issue in doing so.
The doctype on my two sites are:
First site:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
Second site:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
| html | favicon | null | null | null | null | open | What browsers support the favicon link tag?
===
Does anyone what browsers support using the link tag for the favicon, as **opposed to** at the root of the site? I am considering doing that as an alternative to hosting the files at the root of each site because of an issue I'm having an issue in doing so.
The doctype on my two sites are:
First site:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
Second site:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" >
| 0 |
4,101,739 | 11/04/2010 21:49:42 | 379,284 | 06/29/2010 17:53:49 | 18 | 0 | MSSQL Select into existing table. | I am trying to select some fields from one table and insert them into an existing table from a stored procedure. Here is what I am trying:
SELECT col1, col2
INTO dbo.TableTwo
FROM dbo.TableOne
WHERE col3 LIKE @search_key
I think select into is for tempory tables which is why I get an error that dbo.TableTwo already exists.
How can I insert multiple rows from dbo.TableOne into dbo.TableTwo?
| sql | sql-server | stored-procedures | null | null | null | open | MSSQL Select into existing table.
===
I am trying to select some fields from one table and insert them into an existing table from a stored procedure. Here is what I am trying:
SELECT col1, col2
INTO dbo.TableTwo
FROM dbo.TableOne
WHERE col3 LIKE @search_key
I think select into is for tempory tables which is why I get an error that dbo.TableTwo already exists.
How can I insert multiple rows from dbo.TableOne into dbo.TableTwo?
| 0 |
8,834,386 | 01/12/2012 11:33:45 | 632,951 | 02/24/2011 19:10:47 | 4,130 | 21 | What's the name of the 3-Byte variable-width Unicode Encoding Scheme? |
Hi all I was wondering what's the name of the Unicode Encoding Scheme whereby:
Code Points U+1 to U+7F is represented using one byte:
Byte 1: 0xxxxxxx
Code Points U+80 to U+3FFF is represented using two bytes:
Byte 1: 0xxxxxxx
Byte 2: 1xxxxxxx
Code Points U+4000 to U+10FFFF is represented using three bytes:
Byte 1: 0xxxxxxx
Byte 2: 1xxxxxxx
Byte 3: 1xxxxxxx
From what I can see, this scheme beats UTF-8 because only one to three bytes is required to represent each CodePoint (UTF-8 requires 1 to 4 bytes to represent a single CodePoint), and I was wondering if there's an official name for this encoding.
| unicode | encoding | null | null | null | null | open | What's the name of the 3-Byte variable-width Unicode Encoding Scheme?
===
Hi all I was wondering what's the name of the Unicode Encoding Scheme whereby:
Code Points U+1 to U+7F is represented using one byte:
Byte 1: 0xxxxxxx
Code Points U+80 to U+3FFF is represented using two bytes:
Byte 1: 0xxxxxxx
Byte 2: 1xxxxxxx
Code Points U+4000 to U+10FFFF is represented using three bytes:
Byte 1: 0xxxxxxx
Byte 2: 1xxxxxxx
Byte 3: 1xxxxxxx
From what I can see, this scheme beats UTF-8 because only one to three bytes is required to represent each CodePoint (UTF-8 requires 1 to 4 bytes to represent a single CodePoint), and I was wondering if there's an official name for this encoding.
| 0 |
9,489,659 | 02/28/2012 21:01:50 | 1,235,502 | 02/27/2012 11:49:57 | 1 | 0 | Godaddy wildcard certificate not working fin on AppHarbor | would you please help me with the following problem.
I bought a wildcard certificate from GoDaddy, I loged into AppHarbor and created the certificate, i also uploaded the intermediate certificate. Everything worked fine, but the whenever I go to my site (https://edificio.bo.administratuvivienda.com) I receive the following error on IE.
---
This Connection is Untrusted
You have asked Firefox to connect securely to edificio.bo.administratuvivienda.com, but we can't confirm that your connection is secure.
Normally, when you try to connect securely, sites will present trusted identification to prove that you are going to the right place. However, this site's identity can't be verified.
What Should I Do?
If you usually connect to this site without problems, this error could mean that someone is
trying to impersonate the site, and you shouldn't continue.
Technical Details
edificio.bo.administratuvivienda.com uses an invalid security certificate.
The certificate is only valid for the following names:
*.administratuvivienda.com , administratuvivienda.com
(Error code: ssl_error_bad_cert_domain)
---
Would you please help me, I'm getting crazy trying to solve this issue.
Thanks a lot in advance
Guillermo
| ssl | certificate | invalid | appharbor | null | 03/01/2012 04:31:24 | off topic | Godaddy wildcard certificate not working fin on AppHarbor
===
would you please help me with the following problem.
I bought a wildcard certificate from GoDaddy, I loged into AppHarbor and created the certificate, i also uploaded the intermediate certificate. Everything worked fine, but the whenever I go to my site (https://edificio.bo.administratuvivienda.com) I receive the following error on IE.
---
This Connection is Untrusted
You have asked Firefox to connect securely to edificio.bo.administratuvivienda.com, but we can't confirm that your connection is secure.
Normally, when you try to connect securely, sites will present trusted identification to prove that you are going to the right place. However, this site's identity can't be verified.
What Should I Do?
If you usually connect to this site without problems, this error could mean that someone is
trying to impersonate the site, and you shouldn't continue.
Technical Details
edificio.bo.administratuvivienda.com uses an invalid security certificate.
The certificate is only valid for the following names:
*.administratuvivienda.com , administratuvivienda.com
(Error code: ssl_error_bad_cert_domain)
---
Would you please help me, I'm getting crazy trying to solve this issue.
Thanks a lot in advance
Guillermo
| 2 |
3,277,904 | 07/19/2010 01:14:35 | 310,292 | 04/06/2010 18:29:03 | 53 | 5 | Looking for a jQuery plugin that is like jQuery Highlighter, jQuery Tools Expose and js_tutorial | I am trying to create a tutorial for a form and I have found many great plugins that almost do what I want. If all else fails, I will hack it together, but I first want to see if there is anything out there which is similar to what I am looking for.
I like jQuery Tools Expose
http://flowplayer.org/tools/toolbox/expose.html
I like jQuery Highlighter
http://www.dailymarkup.com/
I like js_tutorial
http://hackd.thrivesmarthq.com/jstutorial-the-inline-tutorial-framework-powered-by-jquery-javascript
But what I really need is something with Highlighter's step by step, with Expose's actual exposing (Highlighter's expose leaves much to be desired). And add in a little js_tutorial's modal dialog next to the currently exposed form element.
Like I said, I'm being a little lazy at first and just trying to find out if there is anything premade. If I cannot find anything, I'll be attempting to roll up my own mish-mash. | jquery | jquery-plugins | null | null | null | null | open | Looking for a jQuery plugin that is like jQuery Highlighter, jQuery Tools Expose and js_tutorial
===
I am trying to create a tutorial for a form and I have found many great plugins that almost do what I want. If all else fails, I will hack it together, but I first want to see if there is anything out there which is similar to what I am looking for.
I like jQuery Tools Expose
http://flowplayer.org/tools/toolbox/expose.html
I like jQuery Highlighter
http://www.dailymarkup.com/
I like js_tutorial
http://hackd.thrivesmarthq.com/jstutorial-the-inline-tutorial-framework-powered-by-jquery-javascript
But what I really need is something with Highlighter's step by step, with Expose's actual exposing (Highlighter's expose leaves much to be desired). And add in a little js_tutorial's modal dialog next to the currently exposed form element.
Like I said, I'm being a little lazy at first and just trying to find out if there is anything premade. If I cannot find anything, I'll be attempting to roll up my own mish-mash. | 0 |
11,478,758 | 07/13/2012 21:41:38 | 1,460,747 | 06/16/2012 14:25:52 | 27 | 0 | Which distro to use for learning linux(job perspective)? | Which distro to use for learning linux(from job perspective). Which distro is used by most software companies? I was wondering about whether to go for RHEL or Ubuntu or any other. What would be the best choice? | linux | ubuntu | rhel | distro | null | 07/14/2012 02:27:43 | off topic | Which distro to use for learning linux(job perspective)?
===
Which distro to use for learning linux(from job perspective). Which distro is used by most software companies? I was wondering about whether to go for RHEL or Ubuntu or any other. What would be the best choice? | 2 |
3,557,398 | 08/24/2010 14:17:39 | 429,623 | 08/24/2010 14:17:39 | 1 | 0 | Using C/C++ DLL in Delphi 2010 | I want to use dll from ssdeep (http://ssdeep.sourceforge.net/). The API is:
int fuzzy_hash_buf(unsigned char *buf, uint32_t buf_len, char *result);
then in Delphi, i write it like this:
function fuzzy_hash_buf(buf : Pbyte; buf_len : Cardinal; result : PAnsiChar): integer; stdcall; external 'fuzzy.dll' name 'fuzzy_hash_buf';
How to use that function in Delphi?
Thanks! | c++ | c | delphi | api | dll | null | open | Using C/C++ DLL in Delphi 2010
===
I want to use dll from ssdeep (http://ssdeep.sourceforge.net/). The API is:
int fuzzy_hash_buf(unsigned char *buf, uint32_t buf_len, char *result);
then in Delphi, i write it like this:
function fuzzy_hash_buf(buf : Pbyte; buf_len : Cardinal; result : PAnsiChar): integer; stdcall; external 'fuzzy.dll' name 'fuzzy_hash_buf';
How to use that function in Delphi?
Thanks! | 0 |
9,594,512 | 03/07/2012 01:23:01 | 220,180 | 11/27/2009 17:56:06 | 1,205 | 32 | Sharing Symfony2 validation rules with backbone.js or javascript in general? | Whould be possible to expose **Symfony2** validation rules (for a given Entity)? I can't find nothing like this. I'm trying to do client-side validation (using **backbone.js**) with a DRY approach. Something like a bundle or any tip would help.
[Here is][1] the component validator. One possibility would be:
**Define server-side validation** rules using Symfony2 standard way. Example (YAML, taken from their website):
# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
name:
- NotBlank: ~
Make `/author/rules` return a **JSON object which maps fields from the entity to a "compiled" regular expression**. I'm not so sure about this but i think that internally Symfony2 compiles `validation.yml` rules into regular expressions.
Assuming an author entity made of `name` field with `NotBlank` (note i'm not a master in regex, this is a copy and paste from another question):
{ 'name' : '^\s*\S' }
Finally retrieve that JSON object and do **client-side validation with backbone.js** system. **Possibly do caching**. For example (warning! pseudo-code-like code inside `validate()`):
<script>
$(function () {
window.MyApp = window.MyApp || { Models : {}, Views : {}, Router : {} };
window.MyApp.Models.Author = Backbone.Models.extend({
initialize : function() { _.bindAll(this, 'validate') },
validator : $.get('/author/rules');
validate: function(attrs) {
// Loop each property of this model
_.each(attrs, function(field, value) {
// Get the regex from the validatior
var rule = this.validator[field];
var regex = new RegExp(rule);
if(!regex.test(value)) return "Model not valid.";
}
}
});
});
</script>
Am i asking for the moon?
[1]: http://api.symfony.com/2.0/Symfony/Component/Validator.html | javascript | validation | symfony-2.0 | backbone.js | null | null | open | Sharing Symfony2 validation rules with backbone.js or javascript in general?
===
Whould be possible to expose **Symfony2** validation rules (for a given Entity)? I can't find nothing like this. I'm trying to do client-side validation (using **backbone.js**) with a DRY approach. Something like a bundle or any tip would help.
[Here is][1] the component validator. One possibility would be:
**Define server-side validation** rules using Symfony2 standard way. Example (YAML, taken from their website):
# src/Acme/BlogBundle/Resources/config/validation.yml
Acme\BlogBundle\Entity\Author:
properties:
name:
- NotBlank: ~
Make `/author/rules` return a **JSON object which maps fields from the entity to a "compiled" regular expression**. I'm not so sure about this but i think that internally Symfony2 compiles `validation.yml` rules into regular expressions.
Assuming an author entity made of `name` field with `NotBlank` (note i'm not a master in regex, this is a copy and paste from another question):
{ 'name' : '^\s*\S' }
Finally retrieve that JSON object and do **client-side validation with backbone.js** system. **Possibly do caching**. For example (warning! pseudo-code-like code inside `validate()`):
<script>
$(function () {
window.MyApp = window.MyApp || { Models : {}, Views : {}, Router : {} };
window.MyApp.Models.Author = Backbone.Models.extend({
initialize : function() { _.bindAll(this, 'validate') },
validator : $.get('/author/rules');
validate: function(attrs) {
// Loop each property of this model
_.each(attrs, function(field, value) {
// Get the regex from the validatior
var rule = this.validator[field];
var regex = new RegExp(rule);
if(!regex.test(value)) return "Model not valid.";
}
}
});
});
</script>
Am i asking for the moon?
[1]: http://api.symfony.com/2.0/Symfony/Component/Validator.html | 0 |
11,275,164 | 06/30/2012 15:06:32 | 836,885 | 07/09/2011 16:41:41 | 27 | 1 | Embedded Java Databases for Large Data Sets | I would like to port a PHP/MySQL-based client/server application to be a standalone desktop application written in Java. The database has grown to be fairly large, with several tables with hundreds of thousands of rows. I expect these could grow to over a million entries for certain tables.
What embedded database would best handle this? HSQLDB and Sqlite seem to be the obvious choices, though I'm guessing there are others out there as well. My main priorities are the ability to perform queries on large amounts of data efficiently ([this thread][1] seems to confirm Sqlite can handle this) and the ease with which I can import old data from MySQL (I remember HSQLDB being kind of a pain for that).
Note: I am aware that similar questions comparing embedded databases have been posted before (for example [here][2] and [here][3]) but as my priorities differ somewhat from most applications considering the large data migration I thought it justified a new question.
[1]: http://stackoverflow.com/questions/1033309/sqlite-for-large-data-sets
[2]: http://stackoverflow.com/questions/462923/java-embedded-databases-comparison
[3]: http://stackoverflow.com/questions/57102/embedded-java-databases | java | sql | sqlite | hsqldb | h2 | null | open | Embedded Java Databases for Large Data Sets
===
I would like to port a PHP/MySQL-based client/server application to be a standalone desktop application written in Java. The database has grown to be fairly large, with several tables with hundreds of thousands of rows. I expect these could grow to over a million entries for certain tables.
What embedded database would best handle this? HSQLDB and Sqlite seem to be the obvious choices, though I'm guessing there are others out there as well. My main priorities are the ability to perform queries on large amounts of data efficiently ([this thread][1] seems to confirm Sqlite can handle this) and the ease with which I can import old data from MySQL (I remember HSQLDB being kind of a pain for that).
Note: I am aware that similar questions comparing embedded databases have been posted before (for example [here][2] and [here][3]) but as my priorities differ somewhat from most applications considering the large data migration I thought it justified a new question.
[1]: http://stackoverflow.com/questions/1033309/sqlite-for-large-data-sets
[2]: http://stackoverflow.com/questions/462923/java-embedded-databases-comparison
[3]: http://stackoverflow.com/questions/57102/embedded-java-databases | 0 |
6,398,595 | 06/18/2011 20:06:49 | 571,722 | 01/11/2011 18:44:17 | 214 | 4 | How do I run firefox browser headless with my ruby script? | I need to be able to run my ruby scripts with my hudson builds but don't want a browser window attempting to open.<br/>
I tried:
batman:ETW cmiller$ ./createAccount.rb -b
But this did not work.<br/>
How can I run my ruby scripts using firewatir headless? | ruby | firefox | firewatir | headless-browser | null | null | open | How do I run firefox browser headless with my ruby script?
===
I need to be able to run my ruby scripts with my hudson builds but don't want a browser window attempting to open.<br/>
I tried:
batman:ETW cmiller$ ./createAccount.rb -b
But this did not work.<br/>
How can I run my ruby scripts using firewatir headless? | 0 |
6,617,920 | 07/07/2011 22:31:24 | 811,351 | 06/23/2011 00:17:12 | 10 | 1 | Can't override margin-right styling | I'm modding an image slider and can not figure out how to override the 10px right margin. You'll see the gap on the left edge of slide 2. Thanks for any help.
[http://robtaylor.frmboy.com/][1]
Jason
[1]: http://robtaylor.frmboy.com/ | css | override | null | null | null | 07/08/2011 01:34:14 | too localized | Can't override margin-right styling
===
I'm modding an image slider and can not figure out how to override the 10px right margin. You'll see the gap on the left edge of slide 2. Thanks for any help.
[http://robtaylor.frmboy.com/][1]
Jason
[1]: http://robtaylor.frmboy.com/ | 3 |
3,762,534 | 09/21/2010 16:47:15 | 181,771 | 09/30/2009 11:50:25 | 2,240 | 57 | Why is ie7-js requesting CSS files from my application? | I'm trying to use the ie7-js library to make my browsers less than ie9 think they're ie9. The library is hosted here:
http://code.google.com/p/ie7-js/
and I'm referencing it as follows in my master page:
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
Since I've introduced this file, my StructureMap controller factory - defined here:
public class StructureMapControllerFactory : DefaultControllerFactory
{
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
try
{
if (controllerType == null) return base.GetControllerInstance(requestContext, controllerType);
return ObjectFactory.GetInstance(controllerType) as IController;
}
catch (System.Exception xpt)
{
// The controller for path '/WSOD-layout-page.css' was not found or does not implement IController.
// The controller for path '/layout-header.css' was not found or does not implement IController.
// The controller for path '/layout-content.css' was not found or does not implement IController.
// The controller for path '/component-leaderboard.css' was not found or does not implement IController.
// etc...
}
}
}
is catching the following error:
System.Web.HttpException: The controller for path '/component-page-title.css' was not found or does not implement IController.
but it's not just this - I'm getting a similar error for every css file I'm referencing. Why would this be the case?
To clarify, these CSS files are hosted on a different domain than the one I'm working on. Would this be the problem?
Why are CSS requests getting routed to my application? I'm wondering if this is something i can prevent/work around?
| c# | asp.net-mvc | ie7.js | null | null | null | open | Why is ie7-js requesting CSS files from my application?
===
I'm trying to use the ie7-js library to make my browsers less than ie9 think they're ie9. The library is hosted here:
http://code.google.com/p/ie7-js/
and I'm referencing it as follows in my master page:
<!--[if lt IE 9]>
<script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE9.js"></script>
<![endif]-->
Since I've introduced this file, my StructureMap controller factory - defined here:
public class StructureMapControllerFactory : DefaultControllerFactory
{
protected override IController GetControllerInstance(RequestContext requestContext, Type controllerType)
{
try
{
if (controllerType == null) return base.GetControllerInstance(requestContext, controllerType);
return ObjectFactory.GetInstance(controllerType) as IController;
}
catch (System.Exception xpt)
{
// The controller for path '/WSOD-layout-page.css' was not found or does not implement IController.
// The controller for path '/layout-header.css' was not found or does not implement IController.
// The controller for path '/layout-content.css' was not found or does not implement IController.
// The controller for path '/component-leaderboard.css' was not found or does not implement IController.
// etc...
}
}
}
is catching the following error:
System.Web.HttpException: The controller for path '/component-page-title.css' was not found or does not implement IController.
but it's not just this - I'm getting a similar error for every css file I'm referencing. Why would this be the case?
To clarify, these CSS files are hosted on a different domain than the one I'm working on. Would this be the problem?
Why are CSS requests getting routed to my application? I'm wondering if this is something i can prevent/work around?
| 0 |
4,081,533 | 11/02/2010 19:48:59 | 490,642 | 10/28/2010 21:22:25 | 3 | 0 | How to remove Android preferences from the screen | I'm trying to remove a preference from the screen so it isn't visible if the user is using an SDK greater than 2.2. I've found several answers saying that getPreferenceScreen().removePreference(thePreference) will work, but I'm getting FALSE returned every time I try it. Am I using it in the wrong place? Any clue from my code?
public class Preferences extends PreferenceActivity implements OnSharedPreferenceChangeListener {
private static final String POLLING_PREFERENCE = "update_frequency_list";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
// Get a reference to the preferences
mPollPref = getPreferenceScreen().findPreference(POLLING_PREFERENCE);
//If the SDK is 2.2 or greater do not display polling preferences (using C2DM instead)
if(Build.VERSION.SDK_INT > 7) {
getPreferenceScreen().removePreference(mPollPref);
}
}
....
} | android | android-preferences | null | null | null | null | open | How to remove Android preferences from the screen
===
I'm trying to remove a preference from the screen so it isn't visible if the user is using an SDK greater than 2.2. I've found several answers saying that getPreferenceScreen().removePreference(thePreference) will work, but I'm getting FALSE returned every time I try it. Am I using it in the wrong place? Any clue from my code?
public class Preferences extends PreferenceActivity implements OnSharedPreferenceChangeListener {
private static final String POLLING_PREFERENCE = "update_frequency_list";
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Load the preferences from an XML resource
addPreferencesFromResource(R.xml.preferences);
// Get a reference to the preferences
mPollPref = getPreferenceScreen().findPreference(POLLING_PREFERENCE);
//If the SDK is 2.2 or greater do not display polling preferences (using C2DM instead)
if(Build.VERSION.SDK_INT > 7) {
getPreferenceScreen().removePreference(mPollPref);
}
}
....
} | 0 |
5,427,829 | 03/25/2011 02:12:37 | 674,939 | 03/24/2011 13:09:07 | 10 | 0 | C# Problem with treenode double click | Hey! i got this code, but when I double click a node at the treeview, it says error, Object reference not set to an instance of an object. at the line > fieldArray[i].txtBox.Text = parts[i];
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private Field[] fieldArray = new Field[10];
public Form1()
{
InitializeComponent();
}
private void populateTree(string path, TreeNode tv1)
{
string[] dir = Directory.GetDirectories(path);
foreach (string d in dir)
{
string entry = Path.GetFileName(d);
TreeNode t = tv1.Nodes.Add("Folder", entry, 0);
populateTree(d, t);
}
string[] files = Directory.GetFiles(path);
foreach (string f in files)
{
string entry = Path.GetFileName(f);
tv1.Nodes.Add(f, entry, 1);
}
}
private void Form1_Load(object sender, EventArgs e)
{
//populate the tree
TreeNode t = treeView1.Nodes.Add("Units");
populateTree(@"..\units\", t);
for (int i = 0; i < 10; i++)
{
fieldArray[i] = new Field();
}
fieldArray[0].label = new Label();
fieldArray[0].label.AutoSize = true;
fieldArray[0].label.Location = new System.Drawing.Point(323, 9);
fieldArray[0].label.Name = "Programtittle";
fieldArray[0].label.Text = "UAI UnitDef Editor";
this.Controls.Add(fieldArray[0].label);
int clabel = 36;
fieldArray[1].varName = new string[] { "unitName", "name", "description" }; //define labels
//popluate label
for (int i = 0; i < fieldArray[i].varName.Length; i++)
{
fieldArray[1].label = new Label();
fieldArray[1].label.AutoSize = true;
fieldArray[1].label.Location = new System.Drawing.Point(323, clabel);
fieldArray[1].label.Name = "label";
this.Controls.Add(fieldArray[1].label);
fieldArray[1].label.Text = fieldArray[1].varName[i];
clabel = clabel + 26;
}
//populate textbox
int cbox = 33;
for (int i = 0; i < fieldArray[i].varName.Length; i++)
{
fieldArray[i].txtBox = new TextBox();
fieldArray[i].txtBox.Location = new System.Drawing.Point(380, cbox);
fieldArray[i].txtBox.Name = "txtBox";
fieldArray[i].txtBox.Size = new System.Drawing.Size(100, 50);
this.Controls.Add(fieldArray[i].txtBox);
cbox = cbox + 26;
}
}
private void populateLabelTxtBox(string path)
{
//f.txtBox.Multiline = true; //added for testing purpose;
//read,split file
string text = System.IO.File.ReadAllText(path);
char[] delimiters = new char[] { '{', '=', ';', '}' };
string[] parts = text.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parts.Length; i++)
{
fieldArray[i].txtBox.Text = parts[i];
}
}
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (treeView1.SelectedNode.Name != "Folder")
{
string text = System.IO.File.ReadAllText(treeView1.SelectedNode.Name);
//f.txtBox.Text = text;
populateLabelTxtBox(treeView1.SelectedNode.Name);
}
}
}
}
| c# | treeview | null | null | null | 03/25/2011 03:55:26 | too localized | C# Problem with treenode double click
===
Hey! i got this code, but when I double click a node at the treeview, it says error, Object reference not set to an instance of an object. at the line > fieldArray[i].txtBox.Text = parts[i];
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private Field[] fieldArray = new Field[10];
public Form1()
{
InitializeComponent();
}
private void populateTree(string path, TreeNode tv1)
{
string[] dir = Directory.GetDirectories(path);
foreach (string d in dir)
{
string entry = Path.GetFileName(d);
TreeNode t = tv1.Nodes.Add("Folder", entry, 0);
populateTree(d, t);
}
string[] files = Directory.GetFiles(path);
foreach (string f in files)
{
string entry = Path.GetFileName(f);
tv1.Nodes.Add(f, entry, 1);
}
}
private void Form1_Load(object sender, EventArgs e)
{
//populate the tree
TreeNode t = treeView1.Nodes.Add("Units");
populateTree(@"..\units\", t);
for (int i = 0; i < 10; i++)
{
fieldArray[i] = new Field();
}
fieldArray[0].label = new Label();
fieldArray[0].label.AutoSize = true;
fieldArray[0].label.Location = new System.Drawing.Point(323, 9);
fieldArray[0].label.Name = "Programtittle";
fieldArray[0].label.Text = "UAI UnitDef Editor";
this.Controls.Add(fieldArray[0].label);
int clabel = 36;
fieldArray[1].varName = new string[] { "unitName", "name", "description" }; //define labels
//popluate label
for (int i = 0; i < fieldArray[i].varName.Length; i++)
{
fieldArray[1].label = new Label();
fieldArray[1].label.AutoSize = true;
fieldArray[1].label.Location = new System.Drawing.Point(323, clabel);
fieldArray[1].label.Name = "label";
this.Controls.Add(fieldArray[1].label);
fieldArray[1].label.Text = fieldArray[1].varName[i];
clabel = clabel + 26;
}
//populate textbox
int cbox = 33;
for (int i = 0; i < fieldArray[i].varName.Length; i++)
{
fieldArray[i].txtBox = new TextBox();
fieldArray[i].txtBox.Location = new System.Drawing.Point(380, cbox);
fieldArray[i].txtBox.Name = "txtBox";
fieldArray[i].txtBox.Size = new System.Drawing.Size(100, 50);
this.Controls.Add(fieldArray[i].txtBox);
cbox = cbox + 26;
}
}
private void populateLabelTxtBox(string path)
{
//f.txtBox.Multiline = true; //added for testing purpose;
//read,split file
string text = System.IO.File.ReadAllText(path);
char[] delimiters = new char[] { '{', '=', ';', '}' };
string[] parts = text.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
for (int i = 0; i < parts.Length; i++)
{
fieldArray[i].txtBox.Text = parts[i];
}
}
private void treeView1_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
{
if (treeView1.SelectedNode.Name != "Folder")
{
string text = System.IO.File.ReadAllText(treeView1.SelectedNode.Name);
//f.txtBox.Text = text;
populateLabelTxtBox(treeView1.SelectedNode.Name);
}
}
}
}
| 3 |
3,506,179 | 08/17/2010 19:27:22 | 415,083 | 08/09/2010 12:47:19 | 1 | 0 | GridView Inital Editing mode? | I am writing a web application that is used for tracking and entering some everyday user data... Every day I need to enter some data for multiple users manually...
I will choose the date with the calendar, and for that date I will get DB values assigned for all users on chosen date...If there are some entries in database for that date i will display it in gridview...
Here is the look of gridview for chosen date...
USERS DATA
------------
User1 Data1
User2 Data2
User3 Data3
But, if I choose the date for which there are no entries in DB, I would like to display the gridview containg User names in each row, but I want the second column (DATA field) to be initially editable for ALL rows (the whole second column should contain textboxes for inserting values, not only selected row as in standard editable gridview mode) allowing inserting of wanted values...
I want it to look something like this
USERS DATA
----------------
User1 TextBox
User2 TextBox
User3 TextBox
My idea is to get Users list from DB and create a datatable with first column containg returned user names, and second column empty... This datatable will be datasource for gridview in which I am going to disable editing mode, and in normal (displaying) mode I am going to have TemplateField containg of textboxes bound to that datatable in second column, and labels displaying usernames in first column... When entering all values there will be SAVE button who is calling a method that will read entered values from datatable and save it to database...
Is there a better way to implement this functionality? If Templatefield textboxes are bound to datatable (as gridview datasource) does textboxes entered values are going to be accessible from datable object on postback caused by SAVE button click? Is there a better way to get wanted gridview with whole second column availibe for inserting new values?
Thank you in advance for your help & time!
| asp.net | null | null | null | null | null | open | GridView Inital Editing mode?
===
I am writing a web application that is used for tracking and entering some everyday user data... Every day I need to enter some data for multiple users manually...
I will choose the date with the calendar, and for that date I will get DB values assigned for all users on chosen date...If there are some entries in database for that date i will display it in gridview...
Here is the look of gridview for chosen date...
USERS DATA
------------
User1 Data1
User2 Data2
User3 Data3
But, if I choose the date for which there are no entries in DB, I would like to display the gridview containg User names in each row, but I want the second column (DATA field) to be initially editable for ALL rows (the whole second column should contain textboxes for inserting values, not only selected row as in standard editable gridview mode) allowing inserting of wanted values...
I want it to look something like this
USERS DATA
----------------
User1 TextBox
User2 TextBox
User3 TextBox
My idea is to get Users list from DB and create a datatable with first column containg returned user names, and second column empty... This datatable will be datasource for gridview in which I am going to disable editing mode, and in normal (displaying) mode I am going to have TemplateField containg of textboxes bound to that datatable in second column, and labels displaying usernames in first column... When entering all values there will be SAVE button who is calling a method that will read entered values from datatable and save it to database...
Is there a better way to implement this functionality? If Templatefield textboxes are bound to datatable (as gridview datasource) does textboxes entered values are going to be accessible from datable object on postback caused by SAVE button click? Is there a better way to get wanted gridview with whole second column availibe for inserting new values?
Thank you in advance for your help & time!
| 0 |
7,763,756 | 10/14/2011 06:16:02 | 976,358 | 03/18/2011 04:05:13 | 1 | 0 | android : control installation process | I want to Create one simple app witch is display a dialog box with 2 buttons YES and No witch ask to user that they want to install new application ? when user install a new application in android device.if user press YES button then application have permission to install and if user press NO button then new application installation is going cancel.
Thanks to all | android | service | packagemaker | installation-package | null | null | open | android : control installation process
===
I want to Create one simple app witch is display a dialog box with 2 buttons YES and No witch ask to user that they want to install new application ? when user install a new application in android device.if user press YES button then application have permission to install and if user press NO button then new application installation is going cancel.
Thanks to all | 0 |
4,864,039 | 02/01/2011 14:55:21 | 478,144 | 10/16/2010 20:24:18 | 2,822 | 186 | jQuery Hover flickers if trigger div and targeted div overlap | I have set up a very simple jQuery hover function, but the thing is when you hover over the trigger div, it works but if you move your mouse over the targeted div whilst still on the trigger div (the overlap) it flickers!? Any ideas?
I have this jQuery code:
$("#tag").hover(
function () {
$("#homeHover").show();
},
function () {
$("#homeHover").hide();
}
);
With this HTML structure:
<div id="homeHover"></div>
<div id="tag">
</div>
And this CSS:
#homeHover {
width: 150px;
height: 150px;
position: absolute;
background: url("../img/arrow.png") no-repeat scroll 0 0 transparent;
top: 145px;
left: 0px;
display: none;
}
#tag {
float: left;
}
| jquery | jquery-hover | null | null | null | null | open | jQuery Hover flickers if trigger div and targeted div overlap
===
I have set up a very simple jQuery hover function, but the thing is when you hover over the trigger div, it works but if you move your mouse over the targeted div whilst still on the trigger div (the overlap) it flickers!? Any ideas?
I have this jQuery code:
$("#tag").hover(
function () {
$("#homeHover").show();
},
function () {
$("#homeHover").hide();
}
);
With this HTML structure:
<div id="homeHover"></div>
<div id="tag">
</div>
And this CSS:
#homeHover {
width: 150px;
height: 150px;
position: absolute;
background: url("../img/arrow.png") no-repeat scroll 0 0 transparent;
top: 145px;
left: 0px;
display: none;
}
#tag {
float: left;
}
| 0 |
6,978,993 | 08/08/2011 07:31:37 | 677,998 | 03/26/2011 12:15:41 | 1 | 0 | Need to build a beautiful web application | Now this is the scenario.
We have a desktop based (client-server based) application developed in .NET 4 (WPF) running in a school. This software helps managing all the data (student - staff - parent).
Now I wish to extend this program onto the web.
For this I've made some preparations.
I have placed the database managed by that desktop application on a Static IP (dedicated database server).
Now I want to develop a very interactive website with rich and interactive UI which can present the data to the parents in a very lively manner. I've explored into many technologies, including Silverlight, JSP, PHP and .NET with javascript and CSS, but i'm not able to finalize on anything.
Please help me on this telling me on which technology I must start and how to get the "How to begin" lessons. | php | mysql | silverlight | web-applications | website | 08/08/2011 08:23:12 | off topic | Need to build a beautiful web application
===
Now this is the scenario.
We have a desktop based (client-server based) application developed in .NET 4 (WPF) running in a school. This software helps managing all the data (student - staff - parent).
Now I wish to extend this program onto the web.
For this I've made some preparations.
I have placed the database managed by that desktop application on a Static IP (dedicated database server).
Now I want to develop a very interactive website with rich and interactive UI which can present the data to the parents in a very lively manner. I've explored into many technologies, including Silverlight, JSP, PHP and .NET with javascript and CSS, but i'm not able to finalize on anything.
Please help me on this telling me on which technology I must start and how to get the "How to begin" lessons. | 2 |
8,936,783 | 01/20/2012 04:36:26 | 1,005,346 | 10/20/2011 13:55:53 | 146 | 3 | How to develop my first app for Mac? | Now am working for iPhone/iPad applications. Am interesting to develop apps for Mac OS X also. I searched some tutorials for developing app for Mac in Google and i need to learn something about Mac apps. Can anyone please suggest me any tutorials, links, blocks to create a simple mac apps? Thanks in advance. | ios | osx | application | null | null | 01/20/2012 04:54:56 | not constructive | How to develop my first app for Mac?
===
Now am working for iPhone/iPad applications. Am interesting to develop apps for Mac OS X also. I searched some tutorials for developing app for Mac in Google and i need to learn something about Mac apps. Can anyone please suggest me any tutorials, links, blocks to create a simple mac apps? Thanks in advance. | 4 |
7,924,624 | 10/28/2011 02:50:20 | 805,779 | 06/19/2011 22:10:44 | 67 | 0 | 2d Maze from a text file? | So I have this Text
# # # # # # # # # # # #
# . . . # . . . . . . #
. . # . # . # # # # . #
# # # . # . . . . # . #
# . . . . # # # . # . #
# # # # . # F # . # . #
# . . # . # . # . # . #
# # . # . # . # . # . #
# . . . . . . . . # . #
# # # # # # . # # # . #
# . . . . . . # . . . #
# # # # # # # # # # # #
And I have to convert it into a 2d array, but the way i did it made it only a 1d array, so like when i print it out its all just one line, and my array is only 1d, it needs to be a 12x12 but right now its only 12 having some issues on the logic any help or examples would rock! | java | arrays | file-io | multidimensional-array | null | 10/31/2011 02:46:36 | not a real question | 2d Maze from a text file?
===
So I have this Text
# # # # # # # # # # # #
# . . . # . . . . . . #
. . # . # . # # # # . #
# # # . # . . . . # . #
# . . . . # # # . # . #
# # # # . # F # . # . #
# . . # . # . # . # . #
# # . # . # . # . # . #
# . . . . . . . . # . #
# # # # # # . # # # . #
# . . . . . . # . . . #
# # # # # # # # # # # #
And I have to convert it into a 2d array, but the way i did it made it only a 1d array, so like when i print it out its all just one line, and my array is only 1d, it needs to be a 12x12 but right now its only 12 having some issues on the logic any help or examples would rock! | 1 |
5,069,868 | 02/21/2011 18:40:53 | 400,749 | 07/23/2010 23:08:47 | 19 | 0 | .net where to start | I have a .net project and I am not a .net developer but I want to learn as I go through the process. I have been given a folder with some C# files and folders like bin etc. I heard that the project was developed in .net 2005. I try to open it in .net 2010 and it asks me to convert it. I converted it but I am not sure what to do next. The syntax doesnt have any colors or anything. Any help will be appreciated. thanks! | c# | .net | null | null | null | 02/21/2011 18:46:08 | not a real question | .net where to start
===
I have a .net project and I am not a .net developer but I want to learn as I go through the process. I have been given a folder with some C# files and folders like bin etc. I heard that the project was developed in .net 2005. I try to open it in .net 2010 and it asks me to convert it. I converted it but I am not sure what to do next. The syntax doesnt have any colors or anything. Any help will be appreciated. thanks! | 1 |
2,523,569 | 03/26/2010 13:32:20 | 105,179 | 05/12/2009 06:27:29 | 66 | 4 | Handling % character in web applications | Is there an elegant wasy of handling % character in web applications where the user is allowed to enter data? | untagged | null | null | null | null | 07/22/2012 18:05:36 | not a real question | Handling % character in web applications
===
Is there an elegant wasy of handling % character in web applications where the user is allowed to enter data? | 1 |
2,683,434 | 04/21/2010 13:46:27 | 322,342 | 04/21/2010 13:46:26 | 1 | 0 | T-SQL Hierarchy to duplicate Dependent Objects tree view in SQL Server 2005 | Id like to map the calling stack from one master stored procedure through its hundreds of siblings. i can see it in the dialog, but cannot copy or print it, but couldnt trap anythiing worthwhile in proflier.
do you know what sproc fills that treeview? i must be a recursive CTE that reads syscomments or information_schema.routines, but its beyond my chops, though i *can* imagine it <g>
thanks in advance
drew | t-sql | hierarchy | treeview | null | null | null | open | T-SQL Hierarchy to duplicate Dependent Objects tree view in SQL Server 2005
===
Id like to map the calling stack from one master stored procedure through its hundreds of siblings. i can see it in the dialog, but cannot copy or print it, but couldnt trap anythiing worthwhile in proflier.
do you know what sproc fills that treeview? i must be a recursive CTE that reads syscomments or information_schema.routines, but its beyond my chops, though i *can* imagine it <g>
thanks in advance
drew | 0 |
1,013,405 | 06/18/2009 15:34:26 | 112,842 | 05/27/2009 01:02:06 | 11 | 1 | validation asp.net MVC | We are starting a new ASP.NET 3.5 MVC application. Following are the requirements for validation:
* Both client and server side validation.
* Validation rules in one place.
* Common scenarios like 'Password' & 'Confirm Password' are addressed.
**Options:**
- DataAnnotation (ONLY does server side validation)
- EL 4.1 Validation Application Block (ONLY does server side validation)
- [xVal][1] Framework
- [Validation Library][2] framework
- [Validator Toolkit][3] Framework
- **OTHERS ?**
xVal and 'Validation Library' both can use DataAnnotation and jQuery validation plugin.
Please advise which will be the best choice for MVC Client & Server validation ?
Thank You.
[1]: http://xval.codeplex.com
[2]: http://www.codeplex.com/aspmvcvalidation
[3]: http://mvcvalidatortoolkit.codeplex.com | asp.net-mvc | validation | null | null | null | null | open | validation asp.net MVC
===
We are starting a new ASP.NET 3.5 MVC application. Following are the requirements for validation:
* Both client and server side validation.
* Validation rules in one place.
* Common scenarios like 'Password' & 'Confirm Password' are addressed.
**Options:**
- DataAnnotation (ONLY does server side validation)
- EL 4.1 Validation Application Block (ONLY does server side validation)
- [xVal][1] Framework
- [Validation Library][2] framework
- [Validator Toolkit][3] Framework
- **OTHERS ?**
xVal and 'Validation Library' both can use DataAnnotation and jQuery validation plugin.
Please advise which will be the best choice for MVC Client & Server validation ?
Thank You.
[1]: http://xval.codeplex.com
[2]: http://www.codeplex.com/aspmvcvalidation
[3]: http://mvcvalidatortoolkit.codeplex.com | 0 |
4,341,047 | 12/02/2010 23:24:12 | 47,589 | 12/18/2008 23:16:01 | 1,417 | 55 | Restricting .Net CLR memory usage | Ok, so here's the problem. In our production environment (ASP.Net) our servers have a massive amount of memory as well as a massive number of users / sessions. My computer has 8 gigs, and I'm the only user. In production, we're (rarely) getting a <code>System.OutOfMemoryException</code>.
With that background information, here is the question: is it possible to make the CLR think I only have a gig of memory or less? IIRC, there's a command-line option to do this for Java.
Another option is to make some really big objects to fill up memory to simulate low memory conditions. But that requires modifying the assemblies and the huge objects might be cached to disk.
Recommendations? Or other options? | .net | clr | memory-allocation | memory-management | null | null | open | Restricting .Net CLR memory usage
===
Ok, so here's the problem. In our production environment (ASP.Net) our servers have a massive amount of memory as well as a massive number of users / sessions. My computer has 8 gigs, and I'm the only user. In production, we're (rarely) getting a <code>System.OutOfMemoryException</code>.
With that background information, here is the question: is it possible to make the CLR think I only have a gig of memory or less? IIRC, there's a command-line option to do this for Java.
Another option is to make some really big objects to fill up memory to simulate low memory conditions. But that requires modifying the assemblies and the huge objects might be cached to disk.
Recommendations? Or other options? | 0 |
9,800,695 | 03/21/2012 08:04:00 | 1,208,641 | 02/14/2012 08:38:20 | 100 | 1 | "Next" Button disabled until values are selected and typed in DropDownLists and Textboxes in MVC? | I am using MVC-Viewmodel, EF model first on my project.
I have 3 DropDonLista and a few TextBoxes in my View, User can select Values in the DropDownLists and Type inside the TextBoxes. I want that my "Next" button is disabled until values are selected and textboxes are filled then it gets enabled.
How can I easiest way accomplish this?
I've done this kind of things with C# Winforms and its pretty easy but in MVC I have no clue how I can do this.
Thanks in Advance!
| asp.net-mvc | asp.net-mvc-3 | button | null | null | null | open | "Next" Button disabled until values are selected and typed in DropDownLists and Textboxes in MVC?
===
I am using MVC-Viewmodel, EF model first on my project.
I have 3 DropDonLista and a few TextBoxes in my View, User can select Values in the DropDownLists and Type inside the TextBoxes. I want that my "Next" button is disabled until values are selected and textboxes are filled then it gets enabled.
How can I easiest way accomplish this?
I've done this kind of things with C# Winforms and its pretty easy but in MVC I have no clue how I can do this.
Thanks in Advance!
| 0 |
417,814 | 01/06/2009 19:40:11 | 51,338 | 01/04/2009 07:45:19 | 13 | 0 | Need an exercise suggestions to help me learn and exercise .NET | Do you have any idea for a complex exercise that touches and covers most important and major concepts of .NET? (so I can learn while coding and implementation)
The exercise should NOT be for begginers, but for someone who already familiar with .net, but enough complex to teach new features of .NET 2 for example.
Thanks! | .net | .net-2.0 | .net-1.1 | null | null | null | open | Need an exercise suggestions to help me learn and exercise .NET
===
Do you have any idea for a complex exercise that touches and covers most important and major concepts of .NET? (so I can learn while coding and implementation)
The exercise should NOT be for begginers, but for someone who already familiar with .net, but enough complex to teach new features of .NET 2 for example.
Thanks! | 0 |
8,526,777 | 12/15/2011 21:21:41 | 294,120 | 03/15/2010 16:45:18 | 198 | 1 | Should I be using Backbone and client-side templates, like Mustache? | I've been getting a similar feeling lately. I felt this way several years ago when I had been using Apache, Django and MySQL exclusively. I felt like the web stack that I was using had began to show its age. So, back then, I switched to Nginx, Flask and MongoDB. I'm starting to feel like this stack is showing its age again, because I'm hearing about tons of new cool things that sound easier in newer stacks.
For example, I'm hearing a ton about Backbone.js as well as client-side templates, like Mustache. These seem to be able to make use of URL hash bangs and produce pretty awesome sounding applications.
I've been toying with Node.js, Express.js and Mustache.js for templates (I do not like Jade). This setup feels like something that I can get familiar with, because it reminds me of Jinja, which is what I used with Flask. This still does not include Backbone or client-side templates. But, how do I know what a good scenario to be using those when I see it? Is Backbone and Mustache on the client something I should be investing time into? How do I know when I should use them and when I shouldn't?
If I switch to this newer stack, I think I'd still be generating my HTML on the server just like I am with my current stack. How do I make the switch to client-side templates, and why, I guess? | backbone.js | mustache | null | null | null | 07/22/2012 22:01:11 | not constructive | Should I be using Backbone and client-side templates, like Mustache?
===
I've been getting a similar feeling lately. I felt this way several years ago when I had been using Apache, Django and MySQL exclusively. I felt like the web stack that I was using had began to show its age. So, back then, I switched to Nginx, Flask and MongoDB. I'm starting to feel like this stack is showing its age again, because I'm hearing about tons of new cool things that sound easier in newer stacks.
For example, I'm hearing a ton about Backbone.js as well as client-side templates, like Mustache. These seem to be able to make use of URL hash bangs and produce pretty awesome sounding applications.
I've been toying with Node.js, Express.js and Mustache.js for templates (I do not like Jade). This setup feels like something that I can get familiar with, because it reminds me of Jinja, which is what I used with Flask. This still does not include Backbone or client-side templates. But, how do I know what a good scenario to be using those when I see it? Is Backbone and Mustache on the client something I should be investing time into? How do I know when I should use them and when I shouldn't?
If I switch to this newer stack, I think I'd still be generating my HTML on the server just like I am with my current stack. How do I make the switch to client-side templates, and why, I guess? | 4 |
6,702,060 | 07/15/2011 02:24:47 | 20,951 | 09/23/2008 07:48:08 | 607 | 3 | Use Camera to capture Text. Android? | I want to do something like a Google Googles but use only the Camera to text feature in it. I want to use the camera to take picture of a text image, and convert it into text for use with in a edit text. Is this possible. How to do this?
Any kind of Idea you have related to this would be helpful. Please let me know your ideas. Thank you very much for your time and help. | android | android-camera | google-gears | google-gadget | google-goggles | 07/17/2011 11:47:31 | not a real question | Use Camera to capture Text. Android?
===
I want to do something like a Google Googles but use only the Camera to text feature in it. I want to use the camera to take picture of a text image, and convert it into text for use with in a edit text. Is this possible. How to do this?
Any kind of Idea you have related to this would be helpful. Please let me know your ideas. Thank you very much for your time and help. | 1 |
947,098 | 06/03/2009 20:39:07 | 5,480 | 09/09/2008 22:34:37 | 707 | 22 | .NET WinForms HTML editor component | We're looking for a .NET component for HTML editing in WinForms. I've seen [this][1] post, and that's kind of what we're using now, but it's pretty old and crufty, I'm looking for a cleaner solution. I don't really have the time (or right now, the inclination) to write our own from scratch...and am hoping there's a commercial/free solution out there. I've looked at the Netrix Component and am not overly impressed initially...is there anything else out there?
[1]: http://stackoverflow.com/questions/214124/winforms-html-editor | .net | html | null | null | null | null | open | .NET WinForms HTML editor component
===
We're looking for a .NET component for HTML editing in WinForms. I've seen [this][1] post, and that's kind of what we're using now, but it's pretty old and crufty, I'm looking for a cleaner solution. I don't really have the time (or right now, the inclination) to write our own from scratch...and am hoping there's a commercial/free solution out there. I've looked at the Netrix Component and am not overly impressed initially...is there anything else out there?
[1]: http://stackoverflow.com/questions/214124/winforms-html-editor | 0 |
10,713,402 | 05/23/2012 04:23:12 | 1,365,799 | 04/30/2012 12:18:22 | 27 | 0 | Webservice with Hibernate+MySql performance | I have Java (Axis2) webservice with Hibernate as DAL.
Using InnoDB as the MySql engine.
I have few questions ergarding the performance:
1. usually the fetching is fast, but the time takes may vary, sometimes it takes too much time to query?
What usually takes time to query is the following query:
1 Webservice request to get user info - we do it on users table, doing search - "where name like <name>.
1 Webservice request to get user recipes (query recipe, where r.user.userId == userId, userId is given in the webservice)
2. How to configure c3p0 connection pool to get best performance?
This taken from hibernate.cfg
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<property name="hibernate.connection.zeroDateTimeBehavior">convertToNull</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.min_size">3</property>
<property name="hibernate.c3p0.max_size">50</property>
<property name="hibernate.c3p0.timeout">280</property>
<property name="hibernate.c3p0.max_statements">50</property>
<!-- this property forces the revalidation of a connection after the given amount of time (in secs) -->
<!-- it must be set to LESS than the wait_timout setting for the mysql server (this setting defaults to 28800 secs (8 hours)) -->
<property name="hibernate.c3p0.idle_test_period">300</property>
Following are the hbm.xml files used when calling the 2 methods...
This is user.hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.User" table="user" catalog="yoavDB">
<id name="userid" type="java.lang.Integer">
<column name="userid" />
<generator class="identity" />
</id>
<property name="birthdate" type="string">
<column name="birthdate" length="50" not-null="true" />
</property>
<property name="password" type="string">
<column name="password" length="100" not-null="true" />
</property>
<property name="firstname" type="string">
<column name="firstname" length="50" not-null="true" />
</property>
<property name="lastname" type="string">
<column name="lastname" length="50" not-null="true" />
</property>
<property name="country" type="string">
<column name="country" length="100" not-null="true" />
</property>
<property name="email" type="string">
<column name="email" length="100" not-null="true" />
</property>
<property name="numOfRecipes" type="int">
<column name="numOfRecipes" not-null="true" />
</property>
<property name="picUrl" type="string">
<column name="picUrl" length="200" />
</property>
<property name="rate" type="float">
<column name="rate" precision="12" scale="0" not-null="true" />
</property>
<property name="fewWords" type="string">
<column name="fewWords" length="200" not-null="true" />
</property>
<property name="whatscooking" type="string">
<column name="whatscooking" length="45" not-null="true" />
</property>
<set name="usermessagesesForSenderUserId" table="usermessages" inverse="true" lazy="true" fetch="select">
<key>
<column name="senderUserId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Usermessages" />
</set>
<set name="usermessagesesForUserId" table="usermessages" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Usermessages" />
</set>
<set name="timelines" table="timeline" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Timeline" />
</set>
<set name="generaltipses" table="generaltips" inverse="true" lazy="true" fetch="select">
<key>
<column name="authorid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Generaltips" />
</set>
<set name="userlastvisitsForVisitedUserId" table="userlastvisit" inverse="true" lazy="true" fetch="select">
<key>
<column name="visitedUserId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlastvisit" />
</set>
<set name="recipes" table="recipe" inverse="true" lazy="true" fetch="select">
<key>
<column name="ownerid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipe" />
</set>
<set name="userlikeses" table="userlikes" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlikes" />
</set>
<set name="friendshiptablesForUserBId" table="friendshiptable" inverse="true" lazy="true" fetch="select">
<key>
<column name="userB_Id" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Friendshiptable" />
</set>
<set name="usersForFavUserId" table="userfavchefsync" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<many-to-many entity-name="com.icdb.data.User">
<column name="favUserId" not-null="true" />
</many-to-many>
</set>
<set name="friendshiptablesForUserAId" table="friendshiptable" inverse="true" lazy="true" fetch="select">
<key>
<column name="userA_Id" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Friendshiptable" />
</set>
<set name="usersForUserId" table="userfavchefsync" inverse="true" lazy="true" fetch="select">
<key>
<column name="favUserId" not-null="true" />
</key>
<many-to-many entity-name="com.icdb.data.User">
<column name="userId" not-null="true" />
</many-to-many>
</set>
<set name="activitylogsForObjectUserId" table="activitylog" inverse="true" lazy="true" fetch="select">
<key>
<column name="objectUserId" />
</key>
<one-to-many class="com.icdb.data.Activitylog" />
</set>
<set name="userlastvisitsForGuestUserId" table="userlastvisit" inverse="true" lazy="true" fetch="select">
<key>
<column name="guestUserId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlastvisit" />
</set>
<set name="userrecipessyncs" table="userrecipessync" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userrecipessync" />
</set>
<set name="activitylogsForUserId" table="activitylog" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Activitylog" />
</set>
<set name="recipereviews" table="recipereview" inverse="true" lazy="true" fetch="select">
<key>
<column name="reviewerid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipereview" />
</set>
</class>
</hibernate-mapping>
This is recipe.hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.Recipe" table="recipe" catalog="yoavDB">
<id name="recipeid" type="java.lang.Integer">
<column name="recipeid" />
<generator class="identity" />
</id>
<many-to-one name="user" class="com.icdb.data.User" fetch="select">
<column name="ownerid" not-null="true" />
</many-to-one>
<property name="releasedate" type="timestamp">
<column name="releasedate" length="19" not-null="true" />
</property>
<property name="preparationtime" type="int">
<column name="preparationtime" not-null="true" />
</property>
<property name="recipedifficulty" type="int">
<column name="recipedifficulty" not-null="true" />
</property>
<property name="name" type="string">
<column name="name" length="50" not-null="true" unique="true" />
</property>
<property name="description" type="string">
<column name="description" length="200" />
</property>
<property name="lastupdated" type="timestamp">
<column name="lastupdated" length="19" not-null="true" />
</property>
<property name="servecount" type="java.lang.Integer">
<column name="servecount" />
</property>
<property name="complete" type="boolean">
<column name="complete" not-null="true" />
</property>
<property name="category" type="int">
<column name="category" not-null="true" />
</property>
<property name="numOfViews" type="int">
<column name="numOfViews" not-null="true" />
</property>
<property name="indexOfRecipeOfUser" type="int">
<column name="indexOfRecipeOfUser" not-null="true" />
</property>
<property name="picUrl" type="string">
<column name="picUrl" length="200" />
</property>
<property name="numOfLikes" type="int">
<column name="numOfLikes" not-null="true" />
</property>
<property name="calculatedRate" type="float">
<column name="calculatedRate" precision="12" scale="0" not-null="true" />
</property>
<set name="userlastvisits" table="userlastvisit" inverse="true" lazy="true" fetch="select">
<key>
<column name="lastViewedRecipeId" />
</key>
<one-to-many class="com.icdb.data.Userlastvisit" />
</set>
<set name="recipeingredients" table="recipeingredient" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipeingredient" />
</set>
<set name="recipereviews" table="recipereview" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipereview" />
</set>
<set name="userlikeses" table="userlikes" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlikes" />
</set>
<set name="activitylogs" table="activitylog" inverse="true" lazy="true" fetch="select">
<key>
<column name="objectRecipeId" />
</key>
<one-to-many class="com.icdb.data.Activitylog" />
</set>
<set name="userrecipessyncs" table="userrecipessync" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userrecipessync" />
</set>
<set name="recipeinstructions" table="recipeinstruction" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipeinstruction" />
</set>
</class>
</hibernate-mapping>
friendship table:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.Friendshiptable" table="friendshiptable" catalog="yoavDB">
<composite-id name="id" class="com.icdb.data.FriendshiptableId">
<key-property name="userAId" type="int">
<column name="userA_Id" />
</key-property>
<key-property name="userBId" type="int">
<column name="userB_Id" />
</key-property>
</composite-id>
<many-to-one name="userByUserAId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="userA_Id" not-null="true" />
</many-to-one>
<many-to-one name="userByUserBId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="userB_Id" not-null="true" />
</many-to-one>
<property name="status" type="short">
<column name="status" not-null="true" />
</property>
<property name="statusLastChangedDate" type="date">
<column name="statusLastChangedDate" length="10" not-null="true" />
</property>
</class>
</hibernate-mapping>
LastVisit:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.Userlastvisit" table="userlastvisit" catalog="yoavDB">
<composite-id name="id" class="com.icdb.data.UserlastvisitId">
<key-property name="guestUserId" type="int">
<column name="guestUserId" />
</key-property>
<key-property name="visitedUserId" type="int">
<column name="visitedUserId" />
</key-property>
</composite-id>
<many-to-one name="userByVisitedUserId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="visitedUserId" not-null="true" />
</many-to-one>
<many-to-one name="userByGuestUserId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="guestUserId" not-null="true" />
</many-to-one>
<many-to-one name="recipe" class="com.icdb.data.Recipe" fetch="select">
<column name="lastViewedRecipeId" />
</many-to-one>
<property name="lastVisitTimeStamp" type="timestamp">
<column name="lastVisitTimeStamp" length="19" not-null="true" />
</property>
</class>
</hibernate-mapping>
Java code to fetch userInfo:
public String[] getUserInfo( int visitingUserId,
int visitedUserId )
{
Session session = ICDBHibernateUtil.getSessionFactory().getCurrentSession();
try
{
session.beginTransaction();
User user = (User) session.get(User.class, visitedUserId);
ArrayList<String> ret = new ArrayList<String>();
// Username
ret.add( user.getFirstname() + " " + user.getLastname() );
// Few words
ret.add( user.getFewWords() );
// Num of recipes
ret.add( Integer.toString( user.getNumOfRecipes() ) );
// Calculated Rank
ret.add( Float.toString( user.getRate() ) );
// Pic url
ret.add( user.getPicUrl() );
FriendshiptableId id = new FriendshiptableId( visitingUserId, visitedUserId );
Friendshiptable ft = (Friendshiptable)session.get( Friendshiptable.class, id );
if( ft == null )
{
id = new FriendshiptableId( visitedUserId, visitingUserId );
ft = (Friendshiptable)session.get( Friendshiptable.class, id );
if( ft == null )
{
ret.add( "none" );
}
else
{
FriendshipRequestStatusEnum status = FriendshipRequestStatusEnum.values()[ ft.getStatus() ];
switch( status )
{
case PENDING:
ret.add( "pending" );
break;
case ACCEPTED:
ret.add( "accepted" );
break;
case DECLINED:
ret.add( "declined" );
break;
}
}
}
else
{
FriendshipRequestStatusEnum status = FriendshipRequestStatusEnum.values()[ ft.getStatus() ];
switch( status )
{
case PENDING:
ret.add( "pending" );
break;
case ACCEPTED:
ret.add( "accepted" );
break;
case DECLINED:
ret.add( "declined" );
break;
}
}
if( visitingUserId != -1 )
{
// Has new stuff....
UserlastvisitId ulvId = new UserlastvisitId( visitingUserId, visitedUserId );
Userlastvisit ulv = (Userlastvisit) session.get( Userlastvisit.class, ulvId );
if( ulv == null )
{
// Lets add a new entry
User visitingUser = (User) session.load( User.class, visitingUserId );
User visitedUser = (User) session.load( User.class, visitedUserId );
ulv = new Userlastvisit( ulvId,
visitingUser,
visitedUser,
new Date() );
session.save( ulv );
ret.add( "true" );
}
else
{
List<?> loginResult= session.createQuery("from Recipe r where r.lastupdated >= :lastVisited" )
.setDate( "lastVisited", ulv.getLastVisitTimeStamp() )
.list();
if( loginResult.size() > 0 )
{
ret.add( "true" );
}
else
{
ret.add( "false" );
}
// We need to update the last visit time...
ulv.setLastVisitTimeStamp( new Date() );
session.save( ulv );
}
}
session.getTransaction().commit();
String[] retStr = new String[ret.size()];
ret.toArray( retStr );
return retStr;
}
catch( RuntimeException e )
{
ICDBHibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();
throw e;
}
}
getuserRecipes method:
public String[] getUserRecipesNew( int visitingUserId,
int userId,
int pageNumber )
{
final int PAGE_SIZE = 20;
Session session = ICDBHibernateUtil.getSessionFactory().getCurrentSession();
try
{
session.beginTransaction();
String hql = "from Recipe r where r.user.userid= :userid";
Query query = session.createQuery( hql )
.setInteger( "userid", userId );
query = query.setFirstResult( PAGE_SIZE * (pageNumber - 1) );
query.setMaxResults( PAGE_SIZE );
List<?> recipes = query.list();
ArrayList<String> ret = new ArrayList<String>();
if( recipes.size() == PAGE_SIZE )
{
// Indicates that might be more results
ret.add( "true" );
}
else
{
// No more results
ret.add( "false" );
}
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
// Format the Recipes into string
for( int i = 0; i < recipes.size(); i++ )
{
UserlikesId userLikeId = new UserlikesId( userId, ((Recipe)recipes.get(i)).getRecipeid() );
Userlikes userLike = (Userlikes) session.get( Userlikes.class, userLikeId );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getRecipeid() ) );
ret.add( ((Recipe)recipes.get(i)).getName() );
ret.add( ((Recipe)recipes.get(i)).getDescription() );
ret.add( ((Recipe)recipes.get(i)).getUser().getFirstname() + ((Recipe)recipes.get(i)).getUser().getLastname() );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getRecipedifficulty() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getServecount() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getPreparationtime() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getUser().getUserid() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getNumOfViews() ) );
ret.add( df.format( ((Recipe)recipes.get(i)).getReleasedate() ) );
ret.add( (((Recipe)recipes.get(i)).getPicUrl() == null) ? "" : ((Recipe)recipes.get(i)).getPicUrl() );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getCategory() ) );
ret.add( (userLike==null)?"0":(userLike.isIsLike()?"1":"0") );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getNumOfLikes() ) );
}
session.getTransaction().commit();
String[] retStr = new String[ret.size()];
ret.toArray( retStr );
return retStr;
}
catch( RuntimeException e )
{
ICDBHibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();
throw e;
}
}
Is everything written OK?
How should tune it to better performance? | mysql | performance | web-services | hibernate | null | 05/23/2012 08:29:29 | not a real question | Webservice with Hibernate+MySql performance
===
I have Java (Axis2) webservice with Hibernate as DAL.
Using InnoDB as the MySql engine.
I have few questions ergarding the performance:
1. usually the fetching is fast, but the time takes may vary, sometimes it takes too much time to query?
What usually takes time to query is the following query:
1 Webservice request to get user info - we do it on users table, doing search - "where name like <name>.
1 Webservice request to get user recipes (query recipe, where r.user.userId == userId, userId is given in the webservice)
2. How to configure c3p0 connection pool to get best performance?
This taken from hibernate.cfg
<property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property>
<property name="connection.is-connection-validation-required">true</property>
<property name="hibernate.connection.zeroDateTimeBehavior">convertToNull</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
<property name="hibernate.show_sql">false</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
<property name="hibernate.c3p0.min_size">3</property>
<property name="hibernate.c3p0.max_size">50</property>
<property name="hibernate.c3p0.timeout">280</property>
<property name="hibernate.c3p0.max_statements">50</property>
<!-- this property forces the revalidation of a connection after the given amount of time (in secs) -->
<!-- it must be set to LESS than the wait_timout setting for the mysql server (this setting defaults to 28800 secs (8 hours)) -->
<property name="hibernate.c3p0.idle_test_period">300</property>
Following are the hbm.xml files used when calling the 2 methods...
This is user.hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.User" table="user" catalog="yoavDB">
<id name="userid" type="java.lang.Integer">
<column name="userid" />
<generator class="identity" />
</id>
<property name="birthdate" type="string">
<column name="birthdate" length="50" not-null="true" />
</property>
<property name="password" type="string">
<column name="password" length="100" not-null="true" />
</property>
<property name="firstname" type="string">
<column name="firstname" length="50" not-null="true" />
</property>
<property name="lastname" type="string">
<column name="lastname" length="50" not-null="true" />
</property>
<property name="country" type="string">
<column name="country" length="100" not-null="true" />
</property>
<property name="email" type="string">
<column name="email" length="100" not-null="true" />
</property>
<property name="numOfRecipes" type="int">
<column name="numOfRecipes" not-null="true" />
</property>
<property name="picUrl" type="string">
<column name="picUrl" length="200" />
</property>
<property name="rate" type="float">
<column name="rate" precision="12" scale="0" not-null="true" />
</property>
<property name="fewWords" type="string">
<column name="fewWords" length="200" not-null="true" />
</property>
<property name="whatscooking" type="string">
<column name="whatscooking" length="45" not-null="true" />
</property>
<set name="usermessagesesForSenderUserId" table="usermessages" inverse="true" lazy="true" fetch="select">
<key>
<column name="senderUserId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Usermessages" />
</set>
<set name="usermessagesesForUserId" table="usermessages" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Usermessages" />
</set>
<set name="timelines" table="timeline" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Timeline" />
</set>
<set name="generaltipses" table="generaltips" inverse="true" lazy="true" fetch="select">
<key>
<column name="authorid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Generaltips" />
</set>
<set name="userlastvisitsForVisitedUserId" table="userlastvisit" inverse="true" lazy="true" fetch="select">
<key>
<column name="visitedUserId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlastvisit" />
</set>
<set name="recipes" table="recipe" inverse="true" lazy="true" fetch="select">
<key>
<column name="ownerid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipe" />
</set>
<set name="userlikeses" table="userlikes" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlikes" />
</set>
<set name="friendshiptablesForUserBId" table="friendshiptable" inverse="true" lazy="true" fetch="select">
<key>
<column name="userB_Id" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Friendshiptable" />
</set>
<set name="usersForFavUserId" table="userfavchefsync" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<many-to-many entity-name="com.icdb.data.User">
<column name="favUserId" not-null="true" />
</many-to-many>
</set>
<set name="friendshiptablesForUserAId" table="friendshiptable" inverse="true" lazy="true" fetch="select">
<key>
<column name="userA_Id" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Friendshiptable" />
</set>
<set name="usersForUserId" table="userfavchefsync" inverse="true" lazy="true" fetch="select">
<key>
<column name="favUserId" not-null="true" />
</key>
<many-to-many entity-name="com.icdb.data.User">
<column name="userId" not-null="true" />
</many-to-many>
</set>
<set name="activitylogsForObjectUserId" table="activitylog" inverse="true" lazy="true" fetch="select">
<key>
<column name="objectUserId" />
</key>
<one-to-many class="com.icdb.data.Activitylog" />
</set>
<set name="userlastvisitsForGuestUserId" table="userlastvisit" inverse="true" lazy="true" fetch="select">
<key>
<column name="guestUserId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlastvisit" />
</set>
<set name="userrecipessyncs" table="userrecipessync" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userrecipessync" />
</set>
<set name="activitylogsForUserId" table="activitylog" inverse="true" lazy="true" fetch="select">
<key>
<column name="userId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Activitylog" />
</set>
<set name="recipereviews" table="recipereview" inverse="true" lazy="true" fetch="select">
<key>
<column name="reviewerid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipereview" />
</set>
</class>
</hibernate-mapping>
This is recipe.hbm.xml:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.Recipe" table="recipe" catalog="yoavDB">
<id name="recipeid" type="java.lang.Integer">
<column name="recipeid" />
<generator class="identity" />
</id>
<many-to-one name="user" class="com.icdb.data.User" fetch="select">
<column name="ownerid" not-null="true" />
</many-to-one>
<property name="releasedate" type="timestamp">
<column name="releasedate" length="19" not-null="true" />
</property>
<property name="preparationtime" type="int">
<column name="preparationtime" not-null="true" />
</property>
<property name="recipedifficulty" type="int">
<column name="recipedifficulty" not-null="true" />
</property>
<property name="name" type="string">
<column name="name" length="50" not-null="true" unique="true" />
</property>
<property name="description" type="string">
<column name="description" length="200" />
</property>
<property name="lastupdated" type="timestamp">
<column name="lastupdated" length="19" not-null="true" />
</property>
<property name="servecount" type="java.lang.Integer">
<column name="servecount" />
</property>
<property name="complete" type="boolean">
<column name="complete" not-null="true" />
</property>
<property name="category" type="int">
<column name="category" not-null="true" />
</property>
<property name="numOfViews" type="int">
<column name="numOfViews" not-null="true" />
</property>
<property name="indexOfRecipeOfUser" type="int">
<column name="indexOfRecipeOfUser" not-null="true" />
</property>
<property name="picUrl" type="string">
<column name="picUrl" length="200" />
</property>
<property name="numOfLikes" type="int">
<column name="numOfLikes" not-null="true" />
</property>
<property name="calculatedRate" type="float">
<column name="calculatedRate" precision="12" scale="0" not-null="true" />
</property>
<set name="userlastvisits" table="userlastvisit" inverse="true" lazy="true" fetch="select">
<key>
<column name="lastViewedRecipeId" />
</key>
<one-to-many class="com.icdb.data.Userlastvisit" />
</set>
<set name="recipeingredients" table="recipeingredient" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipeingredient" />
</set>
<set name="recipereviews" table="recipereview" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipereview" />
</set>
<set name="userlikeses" table="userlikes" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userlikes" />
</set>
<set name="activitylogs" table="activitylog" inverse="true" lazy="true" fetch="select">
<key>
<column name="objectRecipeId" />
</key>
<one-to-many class="com.icdb.data.Activitylog" />
</set>
<set name="userrecipessyncs" table="userrecipessync" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeId" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Userrecipessync" />
</set>
<set name="recipeinstructions" table="recipeinstruction" inverse="true" lazy="true" fetch="select">
<key>
<column name="recipeid" not-null="true" />
</key>
<one-to-many class="com.icdb.data.Recipeinstruction" />
</set>
</class>
</hibernate-mapping>
friendship table:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.Friendshiptable" table="friendshiptable" catalog="yoavDB">
<composite-id name="id" class="com.icdb.data.FriendshiptableId">
<key-property name="userAId" type="int">
<column name="userA_Id" />
</key-property>
<key-property name="userBId" type="int">
<column name="userB_Id" />
</key-property>
</composite-id>
<many-to-one name="userByUserAId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="userA_Id" not-null="true" />
</many-to-one>
<many-to-one name="userByUserBId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="userB_Id" not-null="true" />
</many-to-one>
<property name="status" type="short">
<column name="status" not-null="true" />
</property>
<property name="statusLastChangedDate" type="date">
<column name="statusLastChangedDate" length="10" not-null="true" />
</property>
</class>
</hibernate-mapping>
LastVisit:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 21:48:14 27/03/2012 by Hibernate Tools 3.4.0.CR1 -->
<hibernate-mapping>
<class name="com.icdb.data.Userlastvisit" table="userlastvisit" catalog="yoavDB">
<composite-id name="id" class="com.icdb.data.UserlastvisitId">
<key-property name="guestUserId" type="int">
<column name="guestUserId" />
</key-property>
<key-property name="visitedUserId" type="int">
<column name="visitedUserId" />
</key-property>
</composite-id>
<many-to-one name="userByVisitedUserId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="visitedUserId" not-null="true" />
</many-to-one>
<many-to-one name="userByGuestUserId" class="com.icdb.data.User" update="false" insert="false" fetch="select">
<column name="guestUserId" not-null="true" />
</many-to-one>
<many-to-one name="recipe" class="com.icdb.data.Recipe" fetch="select">
<column name="lastViewedRecipeId" />
</many-to-one>
<property name="lastVisitTimeStamp" type="timestamp">
<column name="lastVisitTimeStamp" length="19" not-null="true" />
</property>
</class>
</hibernate-mapping>
Java code to fetch userInfo:
public String[] getUserInfo( int visitingUserId,
int visitedUserId )
{
Session session = ICDBHibernateUtil.getSessionFactory().getCurrentSession();
try
{
session.beginTransaction();
User user = (User) session.get(User.class, visitedUserId);
ArrayList<String> ret = new ArrayList<String>();
// Username
ret.add( user.getFirstname() + " " + user.getLastname() );
// Few words
ret.add( user.getFewWords() );
// Num of recipes
ret.add( Integer.toString( user.getNumOfRecipes() ) );
// Calculated Rank
ret.add( Float.toString( user.getRate() ) );
// Pic url
ret.add( user.getPicUrl() );
FriendshiptableId id = new FriendshiptableId( visitingUserId, visitedUserId );
Friendshiptable ft = (Friendshiptable)session.get( Friendshiptable.class, id );
if( ft == null )
{
id = new FriendshiptableId( visitedUserId, visitingUserId );
ft = (Friendshiptable)session.get( Friendshiptable.class, id );
if( ft == null )
{
ret.add( "none" );
}
else
{
FriendshipRequestStatusEnum status = FriendshipRequestStatusEnum.values()[ ft.getStatus() ];
switch( status )
{
case PENDING:
ret.add( "pending" );
break;
case ACCEPTED:
ret.add( "accepted" );
break;
case DECLINED:
ret.add( "declined" );
break;
}
}
}
else
{
FriendshipRequestStatusEnum status = FriendshipRequestStatusEnum.values()[ ft.getStatus() ];
switch( status )
{
case PENDING:
ret.add( "pending" );
break;
case ACCEPTED:
ret.add( "accepted" );
break;
case DECLINED:
ret.add( "declined" );
break;
}
}
if( visitingUserId != -1 )
{
// Has new stuff....
UserlastvisitId ulvId = new UserlastvisitId( visitingUserId, visitedUserId );
Userlastvisit ulv = (Userlastvisit) session.get( Userlastvisit.class, ulvId );
if( ulv == null )
{
// Lets add a new entry
User visitingUser = (User) session.load( User.class, visitingUserId );
User visitedUser = (User) session.load( User.class, visitedUserId );
ulv = new Userlastvisit( ulvId,
visitingUser,
visitedUser,
new Date() );
session.save( ulv );
ret.add( "true" );
}
else
{
List<?> loginResult= session.createQuery("from Recipe r where r.lastupdated >= :lastVisited" )
.setDate( "lastVisited", ulv.getLastVisitTimeStamp() )
.list();
if( loginResult.size() > 0 )
{
ret.add( "true" );
}
else
{
ret.add( "false" );
}
// We need to update the last visit time...
ulv.setLastVisitTimeStamp( new Date() );
session.save( ulv );
}
}
session.getTransaction().commit();
String[] retStr = new String[ret.size()];
ret.toArray( retStr );
return retStr;
}
catch( RuntimeException e )
{
ICDBHibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();
throw e;
}
}
getuserRecipes method:
public String[] getUserRecipesNew( int visitingUserId,
int userId,
int pageNumber )
{
final int PAGE_SIZE = 20;
Session session = ICDBHibernateUtil.getSessionFactory().getCurrentSession();
try
{
session.beginTransaction();
String hql = "from Recipe r where r.user.userid= :userid";
Query query = session.createQuery( hql )
.setInteger( "userid", userId );
query = query.setFirstResult( PAGE_SIZE * (pageNumber - 1) );
query.setMaxResults( PAGE_SIZE );
List<?> recipes = query.list();
ArrayList<String> ret = new ArrayList<String>();
if( recipes.size() == PAGE_SIZE )
{
// Indicates that might be more results
ret.add( "true" );
}
else
{
// No more results
ret.add( "false" );
}
DateFormat df = new SimpleDateFormat("MM/dd/yyyy");
// Format the Recipes into string
for( int i = 0; i < recipes.size(); i++ )
{
UserlikesId userLikeId = new UserlikesId( userId, ((Recipe)recipes.get(i)).getRecipeid() );
Userlikes userLike = (Userlikes) session.get( Userlikes.class, userLikeId );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getRecipeid() ) );
ret.add( ((Recipe)recipes.get(i)).getName() );
ret.add( ((Recipe)recipes.get(i)).getDescription() );
ret.add( ((Recipe)recipes.get(i)).getUser().getFirstname() + ((Recipe)recipes.get(i)).getUser().getLastname() );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getRecipedifficulty() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getServecount() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getPreparationtime() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getUser().getUserid() ) );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getNumOfViews() ) );
ret.add( df.format( ((Recipe)recipes.get(i)).getReleasedate() ) );
ret.add( (((Recipe)recipes.get(i)).getPicUrl() == null) ? "" : ((Recipe)recipes.get(i)).getPicUrl() );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getCategory() ) );
ret.add( (userLike==null)?"0":(userLike.isIsLike()?"1":"0") );
ret.add( Integer.toString( ((Recipe)recipes.get(i)).getNumOfLikes() ) );
}
session.getTransaction().commit();
String[] retStr = new String[ret.size()];
ret.toArray( retStr );
return retStr;
}
catch( RuntimeException e )
{
ICDBHibernateUtil.getSessionFactory().getCurrentSession().getTransaction().rollback();
throw e;
}
}
Is everything written OK?
How should tune it to better performance? | 1 |
2,417,796 | 03/10/2010 14:53:30 | 284,960 | 03/03/2010 03:49:34 | 29 | 0 | makefile using custom directory and library | I wrote a makefile:
all: server client
server: server.o des.o sha1.o
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -o server server.o des.o sha1.o -I /usr/local/include/ -lgmp
client: client.o des.o sha1.o
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -o -lgmp client client.o des.o sha1.o -I /usr/local/include/
server.o: server.c
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp server.c -I /usr/local/include/
client.o: client.c
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp client.c -I /usr/local/include/
des.o: des.c des.h
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp des.c -I /usr/local/include/
sha1.o: sha1.c sha1.h /usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp sha1.c -I /usr/local/include/
clean: -rm *.o server client
then gcc told me that cannot find -lgmp. I tried to put it in other places, there were other different errors...
In plus, I want to know if it's possible to put 2 elements in the target.
Thanx a lot | c | gcc | linux | null | null | null | open | makefile using custom directory and library
===
I wrote a makefile:
all: server client
server: server.o des.o sha1.o
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -o server server.o des.o sha1.o -I /usr/local/include/ -lgmp
client: client.o des.o sha1.o
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -o -lgmp client client.o des.o sha1.o -I /usr/local/include/
server.o: server.c
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp server.c -I /usr/local/include/
client.o: client.c
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp client.c -I /usr/local/include/
des.o: des.c des.h
/usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp des.c -I /usr/local/include/
sha1.o: sha1.c sha1.h /usr/local/arm-2009q1/bin/arm-none-linux-gnueabi-gcc -c -lgmp sha1.c -I /usr/local/include/
clean: -rm *.o server client
then gcc told me that cannot find -lgmp. I tried to put it in other places, there were other different errors...
In plus, I want to know if it's possible to put 2 elements in the target.
Thanx a lot | 0 |
8,740,699 | 01/05/2012 10:09:14 | 1,131,814 | 01/05/2012 10:00:28 | 1 | 0 | how to calculation for hours and minutes in sql | declare @stdt as datetime='5-jan-2012 9:30:00'
declare @enddt as datetime='10-jan-2012 12:00:00'
declare @Timediff int
select @Timediff=datediff(mi,@stdt,@enddt)
select @Timediff
select CAST(@Timediff / 1440 AS VARCHAR(12)) + ' day(s) ' + CONVERT(CHAR(8), DATEADD(MINUTE, @Timediff % 1440, '00:00'), 108)AS Timediff
I think this will hell to all.
| sql-server-2008 | null | null | null | null | 01/05/2012 13:16:43 | not a real question | how to calculation for hours and minutes in sql
===
declare @stdt as datetime='5-jan-2012 9:30:00'
declare @enddt as datetime='10-jan-2012 12:00:00'
declare @Timediff int
select @Timediff=datediff(mi,@stdt,@enddt)
select @Timediff
select CAST(@Timediff / 1440 AS VARCHAR(12)) + ' day(s) ' + CONVERT(CHAR(8), DATEADD(MINUTE, @Timediff % 1440, '00:00'), 108)AS Timediff
I think this will hell to all.
| 1 |
4,388,360 | 12/08/2010 14:07:24 | 535,072 | 12/08/2010 14:07:24 | 1 | 0 | Should I write equals() methods in JPA entities? | I want to check if entity is in Set (@OneToMany or @ManyToMany) another entity:
if (entity2.getEntities1().contains(entity1)) { }
| java | jpa | set | contains | null | null | open | Should I write equals() methods in JPA entities?
===
I want to check if entity is in Set (@OneToMany or @ManyToMany) another entity:
if (entity2.getEntities1().contains(entity1)) { }
| 0 |
7,192,992 | 08/25/2011 15:23:27 | 912,444 | 08/25/2011 15:23:27 | 1 | 0 | Android Device chooser does not offer real Galaxy tab 10.1 device | Running eclipse + android sdk on Windows XP
Have got "hello Android" application running in emulator OK.
Want it to run on Samsung Galaxy tab 10.1.
Android Device chooser does not see real device.
Have install usb drivers on XP from Samsung.
XP device manager shows: Samsung Mobile USB Modem, Samsung Android ADB Interface. Samsung Mobile USB Composite Device.
On Tab have enabled USB debuging.
Have run 'adb devices' and it shows no devices.
Any help greatly appreciated in progressing this next step of my learning the android environment.
| android | null | null | null | null | 08/26/2011 02:17:32 | off topic | Android Device chooser does not offer real Galaxy tab 10.1 device
===
Running eclipse + android sdk on Windows XP
Have got "hello Android" application running in emulator OK.
Want it to run on Samsung Galaxy tab 10.1.
Android Device chooser does not see real device.
Have install usb drivers on XP from Samsung.
XP device manager shows: Samsung Mobile USB Modem, Samsung Android ADB Interface. Samsung Mobile USB Composite Device.
On Tab have enabled USB debuging.
Have run 'adb devices' and it shows no devices.
Any help greatly appreciated in progressing this next step of my learning the android environment.
| 2 |
8,849,253 | 01/13/2012 10:42:05 | 778,076 | 03/25/2011 16:01:20 | 737 | 6 | mean shift segmentation of images | Does anyone know any available code for "mean-shift segmentation of images" available in C++, java or matlab?On the net there is some source code in C++ but it doesn't seem to work prperly.
After compiling I get this error:
1>e:\terebes\gui\bgimagpgm.cpp(24) : fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory
1>BgImagPNM.cpp
1>e:\terebes\gui\bgimagpnm.cpp(24) : fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory
1>bgimsystem.cpp
1>e:\terebes\gui\bgimsystem.cpp(19) : fatal error C1083: Cannot open include file: 'wx/wx.h': No such file or directory
the code is here: http://dl.transfer.ro/edison_matlab_interface.tar-transfer_RO-13jan-97dbad.gz
And is taken from here:
http://www.shawnlankton.com/2007/11/mean-shift-segmentation-in-matlab/
Anyone can give me a code that really works....cause I compiled this in Visual C++ and something is not right.Thank you!
| c++ | shift | mean | image-segmentation | null | 01/13/2012 11:35:05 | not constructive | mean shift segmentation of images
===
Does anyone know any available code for "mean-shift segmentation of images" available in C++, java or matlab?On the net there is some source code in C++ but it doesn't seem to work prperly.
After compiling I get this error:
1>e:\terebes\gui\bgimagpgm.cpp(24) : fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory
1>BgImagPNM.cpp
1>e:\terebes\gui\bgimagpnm.cpp(24) : fatal error C1083: Cannot open include file: 'wx/setup.h': No such file or directory
1>bgimsystem.cpp
1>e:\terebes\gui\bgimsystem.cpp(19) : fatal error C1083: Cannot open include file: 'wx/wx.h': No such file or directory
the code is here: http://dl.transfer.ro/edison_matlab_interface.tar-transfer_RO-13jan-97dbad.gz
And is taken from here:
http://www.shawnlankton.com/2007/11/mean-shift-segmentation-in-matlab/
Anyone can give me a code that really works....cause I compiled this in Visual C++ and something is not right.Thank you!
| 4 |
7,122,642 | 08/19/2011 13:55:12 | 892,029 | 08/12/2011 15:08:13 | 121 | 1 | Spring/Camel Garbage Collection with Dependency Injections | I have configured a Spring app (using Camel for integration with an ActiveMQ broker) such that two particular classes, say, `Person` and `Personality`, get wired-up and injected with all of their dependencies automatically through the Spring container. For the sake of this example, `Person` objects *have* `Personality` objects as members/properties. So the Spring config file wires up `Personality` instance, and those beans are referenced in the wired `People` beans:
<bean id="personality" class="com.me.someProgram.Personality" singleton="false">
<!-- blah... -->
</bean>
<bean id="person" class="com.me.someProgram.Person" singleton="false">
<!-- People have Personalities -->
<property name="personality" ref="personality"/>
<!-- blah... -->
</bean>
Both beans are specified as *prototypes* in scope because this makes sense for my application. Basically, I need to grab a new instance of `Personality` every time I get a new `Person`.
**My question:**
This is my first application using Spring, and IoC/dependency injection in general. I am worried about garbage collection and memory leaks. When beans are prototypes, and you have prototypes nested inside of prototypes (via *has-a* relationship), do you have to worry about GC/memory leaks? Or does the Spring container alleviate all of those concerns for you? Are there best practices with regards to Spring/IoC memory management? Any anti-patterns to steer clear of?
My actual business objects are quite large, and I will produce many of them, so if I start heading down a road that is riddled with bad memory management, it's going to be a very, very bumpy ride.
Thanks! | spring | memory-management | dependency-injection | garbage-collection | null | null | open | Spring/Camel Garbage Collection with Dependency Injections
===
I have configured a Spring app (using Camel for integration with an ActiveMQ broker) such that two particular classes, say, `Person` and `Personality`, get wired-up and injected with all of their dependencies automatically through the Spring container. For the sake of this example, `Person` objects *have* `Personality` objects as members/properties. So the Spring config file wires up `Personality` instance, and those beans are referenced in the wired `People` beans:
<bean id="personality" class="com.me.someProgram.Personality" singleton="false">
<!-- blah... -->
</bean>
<bean id="person" class="com.me.someProgram.Person" singleton="false">
<!-- People have Personalities -->
<property name="personality" ref="personality"/>
<!-- blah... -->
</bean>
Both beans are specified as *prototypes* in scope because this makes sense for my application. Basically, I need to grab a new instance of `Personality` every time I get a new `Person`.
**My question:**
This is my first application using Spring, and IoC/dependency injection in general. I am worried about garbage collection and memory leaks. When beans are prototypes, and you have prototypes nested inside of prototypes (via *has-a* relationship), do you have to worry about GC/memory leaks? Or does the Spring container alleviate all of those concerns for you? Are there best practices with regards to Spring/IoC memory management? Any anti-patterns to steer clear of?
My actual business objects are quite large, and I will produce many of them, so if I start heading down a road that is riddled with bad memory management, it's going to be a very, very bumpy ride.
Thanks! | 0 |
5,125,343 | 02/26/2011 05:52:56 | 482,591 | 10/21/2010 05:48:52 | 110 | 6 | Android MapView Changing in Another View | I have two activity groups that contain a list that go to a detail view. The detail activty extends a mapactivity. Once I set the lat/long and add the point and center it everything works great. If I go to the other activity to do the same thing, both maps are changing with each lat/long change. The code and view xml are seperate, so why are both maps changing to the same lat/long?
| android | android-mapview | null | null | null | null | open | Android MapView Changing in Another View
===
I have two activity groups that contain a list that go to a detail view. The detail activty extends a mapactivity. Once I set the lat/long and add the point and center it everything works great. If I go to the other activity to do the same thing, both maps are changing with each lat/long change. The code and view xml are seperate, so why are both maps changing to the same lat/long?
| 0 |
10,574,873 | 05/13/2012 20:14:57 | 1,392,582 | 05/13/2012 20:07:41 | 1 | 0 | Facebook comment count views field? | How can I display the number of Facebook comments in a views field or tpl.php? I'm using the fbsocial module to display my facebook comments, it doesnt seem to have views integration. Node:comment count doesn't reflect the facebook comment count. | facebook | drupal | drupal-6 | drupal-views | null | null | open | Facebook comment count views field?
===
How can I display the number of Facebook comments in a views field or tpl.php? I'm using the fbsocial module to display my facebook comments, it doesnt seem to have views integration. Node:comment count doesn't reflect the facebook comment count. | 0 |
3,665,343 | 09/08/2010 07:04:16 | 410,871 | 08/04/2010 14:10:09 | 12 | 0 | Shared preference | I developed one app in that i want to sen URI from Class1 editText to another class containing editText can anyone tell me how to do that
| android | null | null | null | null | null | open | Shared preference
===
I developed one app in that i want to sen URI from Class1 editText to another class containing editText can anyone tell me how to do that
| 0 |
9,572,243 | 03/05/2012 18:54:37 | 684,602 | 03/30/2011 19:41:48 | 135 | 16 | C# - What causes user.config to empty? And how do I restore without restarting? | I have noticed on a few machines in which my application's user.config file is somehow becoming corrupted and is empty when opening. I can't seem to figure out why this is happened. Is there a common thing that would cause this? Any way to safely prevent this?
My second question is how to do I restore the state? I catch the exception and delete the user.config file, but I cannot find a way to restore the configuration without restarting the application. Everything I do on the Properties object causes the following error:
"Configuration system failed to initialize"
Reset, Reload, and Upgrade all do nothing to solve the problem.
Here is my code for deleting after exception:
catch (System.Configuration.ConfigurationErrorsException ex)
{
string fileName = "";
if (!string.IsNullOrEmpty(ex.Filename))
fileName = ex.Filename;
else
{
System.Configuration.ConfigurationErrorsException innerException = ex.InnerException as System.Configuration.ConfigurationErrorsException;
if (innerException != null && !string.IsNullOrEmpty(innerException.Filename))
fileName = innerException.Filename;
}
if (System.IO.File.Exists(fileName))
System.IO.File.Delete(fileName);
} | c# | app-config | null | null | null | null | open | C# - What causes user.config to empty? And how do I restore without restarting?
===
I have noticed on a few machines in which my application's user.config file is somehow becoming corrupted and is empty when opening. I can't seem to figure out why this is happened. Is there a common thing that would cause this? Any way to safely prevent this?
My second question is how to do I restore the state? I catch the exception and delete the user.config file, but I cannot find a way to restore the configuration without restarting the application. Everything I do on the Properties object causes the following error:
"Configuration system failed to initialize"
Reset, Reload, and Upgrade all do nothing to solve the problem.
Here is my code for deleting after exception:
catch (System.Configuration.ConfigurationErrorsException ex)
{
string fileName = "";
if (!string.IsNullOrEmpty(ex.Filename))
fileName = ex.Filename;
else
{
System.Configuration.ConfigurationErrorsException innerException = ex.InnerException as System.Configuration.ConfigurationErrorsException;
if (innerException != null && !string.IsNullOrEmpty(innerException.Filename))
fileName = innerException.Filename;
}
if (System.IO.File.Exists(fileName))
System.IO.File.Delete(fileName);
} | 0 |
10,033,383 | 04/05/2012 17:46:50 | 1,157,070 | 01/18/2012 20:06:46 | 74 | 0 | other benefits of Spring DI | This is the question asked in one of the interview given by my friend and we are confused
What Spring DI does can be done pro-grammatically using factory design pattern and polymorphism.
So why we need to import n number of jars to implement this functionality.
one point i can think of : segregating the stuff so that we did not need to change the code and if required just do the changes in configuration file
Is I am correct?
What can be other benefits of using spring DI | spring | null | null | null | null | 04/05/2012 18:09:37 | not constructive | other benefits of Spring DI
===
This is the question asked in one of the interview given by my friend and we are confused
What Spring DI does can be done pro-grammatically using factory design pattern and polymorphism.
So why we need to import n number of jars to implement this functionality.
one point i can think of : segregating the stuff so that we did not need to change the code and if required just do the changes in configuration file
Is I am correct?
What can be other benefits of using spring DI | 4 |
3,446,929 | 08/10/2010 07:34:45 | 218,484 | 11/25/2009 10:39:15 | 275 | 17 | git still untracked after add | Everytime I do git status there is this folder that appears as untracked.
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# src/error/
nothing added to commit but untracked files present (use "git add" to track)
Even after doing git add . git commit -a the folder at src/error keeps showing up as untracked. Other unstaged files get commited everytime only this folder keeps giving problems. Also git doesnt report any errors. What could be the problem here ? | git | version-control | commit | add | null | null | open | git still untracked after add
===
Everytime I do git status there is this folder that appears as untracked.
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# src/error/
nothing added to commit but untracked files present (use "git add" to track)
Even after doing git add . git commit -a the folder at src/error keeps showing up as untracked. Other unstaged files get commited everytime only this folder keeps giving problems. Also git doesnt report any errors. What could be the problem here ? | 0 |
9,486,268 | 02/28/2012 16:56:54 | 1,111,875 | 12/22/2011 14:21:00 | 13 | 0 | White Automation | So my question is about White Automation. I'm looking to use White to perform a test.
When I'm using a custom in- house built UI program the application seems to 'time out' consistently. I would like to develop a test that will run continuously waiting for this error to happen and then alert the user.
Is White a good Automation program for this kind of test?
Anyone have any experience or routes to go with this in order to develop it? | c# | user-interface | white | null | null | 02/28/2012 17:47:59 | not constructive | White Automation
===
So my question is about White Automation. I'm looking to use White to perform a test.
When I'm using a custom in- house built UI program the application seems to 'time out' consistently. I would like to develop a test that will run continuously waiting for this error to happen and then alert the user.
Is White a good Automation program for this kind of test?
Anyone have any experience or routes to go with this in order to develop it? | 4 |
6,509,588 | 06/28/2011 16:11:35 | 819,443 | 06/28/2011 15:21:08 | 1 | 0 | EGL vs GLES 2.0 on Android (e.g. Java) | (experienced c programmer, pre-shader, fixed function open gl. competent Java programmer)
I have been working with GLES on Android and have gotten the examples to run (both native and Java). In particular, the textured triangle example. What is completely confusing me is the "relationship" of Khronos EGL and the android GLES interfaces.
Are these parallel, independent interfaces (API)?
Is EGL supposed to be a platform independent (neutral) interface?
EGL appears to fully support GLES 1.0 and 1.1 but does not support ES 2.0 (on Android)?
So, it appears to me that EGL is **supposed** to be a platform neutral, parallel interface, **BUT** it does not fully support **GLES 2.0** (on Android); So if you're writing GLES 2.0 code (on Android), you are better off just using the GLxxx API rather than the EGLxxx API (and having to resort to the GLxxx API anyway). As far as I can tell, you don't >**HAVE**< to use EGL for anything since it only supports a subset of the ES 2.0 API.
(Every example/book/reference either mixes the two, uses the native interface or uses only EGL 1.1 features; Am I missing something fundamental here?)
| android | opengl-es-2.0 | null | null | null | null | open | EGL vs GLES 2.0 on Android (e.g. Java)
===
(experienced c programmer, pre-shader, fixed function open gl. competent Java programmer)
I have been working with GLES on Android and have gotten the examples to run (both native and Java). In particular, the textured triangle example. What is completely confusing me is the "relationship" of Khronos EGL and the android GLES interfaces.
Are these parallel, independent interfaces (API)?
Is EGL supposed to be a platform independent (neutral) interface?
EGL appears to fully support GLES 1.0 and 1.1 but does not support ES 2.0 (on Android)?
So, it appears to me that EGL is **supposed** to be a platform neutral, parallel interface, **BUT** it does not fully support **GLES 2.0** (on Android); So if you're writing GLES 2.0 code (on Android), you are better off just using the GLxxx API rather than the EGLxxx API (and having to resort to the GLxxx API anyway). As far as I can tell, you don't >**HAVE**< to use EGL for anything since it only supports a subset of the ES 2.0 API.
(Every example/book/reference either mixes the two, uses the native interface or uses only EGL 1.1 features; Am I missing something fundamental here?)
| 0 |
6,736,195 | 07/18/2011 16:34:01 | 472,647 | 10/11/2010 20:02:08 | 584 | 27 | Change an object's properties at run time? | I have a project in Python 2.7 and wxPython. I have both IDLE and Boa Constructor available as IDEs.
I need to change one or more properties of a GUI object, such as a button, at run time - especially size, location, and text (the latter in buttons and labels).
How do I change these properties at run time? Mind you, I'll be using absolute position with most GUI objects. | python | properties | wxpython | runtime | wxwidgets | 07/20/2011 03:12:59 | not a real question | Change an object's properties at run time?
===
I have a project in Python 2.7 and wxPython. I have both IDLE and Boa Constructor available as IDEs.
I need to change one or more properties of a GUI object, such as a button, at run time - especially size, location, and text (the latter in buttons and labels).
How do I change these properties at run time? Mind you, I'll be using absolute position with most GUI objects. | 1 |
5,468,698 | 03/29/2011 06:24:23 | 641,899 | 03/02/2011 20:31:38 | 36 | 1 | android copy file from sd to assets | Is is possible to copy a file from sd to assets ???
I don't think so...
But you all a lot more brainier than I am ;)
Thanks | android | assets | android-assets | null | null | 04/04/2012 08:08:27 | not a real question | android copy file from sd to assets
===
Is is possible to copy a file from sd to assets ???
I don't think so...
But you all a lot more brainier than I am ;)
Thanks | 1 |
10,398,202 | 05/01/2012 13:17:24 | 1,137,306 | 01/08/2012 16:46:28 | 11 | 0 | Downloadable product versioning in Magento | When offering downloadable products in Magento, buyers will always get the downloadable product that they bought. Even when updating to newer versions ,they still will get the old version. How to prevent that? | magento | null | null | null | null | null | open | Downloadable product versioning in Magento
===
When offering downloadable products in Magento, buyers will always get the downloadable product that they bought. Even when updating to newer versions ,they still will get the old version. How to prevent that? | 0 |
287,236 | 11/13/2008 15:26:04 | 12,601 | 09/16/2008 14:54:44 | 283 | 20 | Examples of professional & useful error pages | What real-life error web pages have you seen that have really impressed you AND would be genuinely useful to all types of users (savvy,novice,laid-back,frustrated,etc). Why were you impressed by the error? | untagged | null | null | null | null | 07/12/2011 13:21:43 | not constructive | Examples of professional & useful error pages
===
What real-life error web pages have you seen that have really impressed you AND would be genuinely useful to all types of users (savvy,novice,laid-back,frustrated,etc). Why were you impressed by the error? | 4 |
9,522,849 | 03/01/2012 19:43:14 | 1,243,570 | 03/01/2012 19:37:45 | 1 | 0 | Advantages of jQuery Mobile? | I recently was tasked with developing a mobile version of a client website. I immediately looked at jQuery Mobile and I started playing around with it, but was quickly disappointed by how locked down it seems to be.
I realize I could heavily override or modify many styles that are already in place, but that somewhat defeats the purpose of using this framework, doesn't it?
I'd just like some points of view from more experienced users of the framework.
| jquery | jquery-mobile | null | null | null | 03/03/2012 01:51:25 | not constructive | Advantages of jQuery Mobile?
===
I recently was tasked with developing a mobile version of a client website. I immediately looked at jQuery Mobile and I started playing around with it, but was quickly disappointed by how locked down it seems to be.
I realize I could heavily override or modify many styles that are already in place, but that somewhat defeats the purpose of using this framework, doesn't it?
I'd just like some points of view from more experienced users of the framework.
| 4 |
9,857,954 | 03/25/2012 04:37:21 | 505,999 | 11/12/2010 16:30:20 | 277 | 6 | Can I place PHP config files securely in a publicly accessible folder? | The hosting company that currently hosts the website I'm building (GoDaddy) does not a give FTP root access to my account. Aka I can only access the 'public_html' folder and not the 'includes' folder also.
Is there any way I can include the config files in that public folder but somehow so only the server can access them in a secure way? How does Wordpress do it? | php | .htaccess | null | null | null | null | open | Can I place PHP config files securely in a publicly accessible folder?
===
The hosting company that currently hosts the website I'm building (GoDaddy) does not a give FTP root access to my account. Aka I can only access the 'public_html' folder and not the 'includes' folder also.
Is there any way I can include the config files in that public folder but somehow so only the server can access them in a secure way? How does Wordpress do it? | 0 |
8,417,288 | 12/07/2011 14:52:33 | 1,085,866 | 12/07/2011 14:46:20 | 1 | 0 | Algorithms for board games and card games (A.I.) | do you know board games(tic-tac-toe, game of the generals etc. preferably played 1on1 and has only 3 end results which are win, lose or draw) that still has room for the optimization of the algorithm of its A.I? Thanks, I need this for my thesis.
hmm we already saw
chess- but i don't think there will be enough time for us to optimize one
games of the general
bantumi
Hmm we're also planning to make different AI difficulty levels for a card game called Big Two by using Alpha-beta pruning(?) and using cheating techniques for the AI like giving them knowledge about their opponent's hand or the top card of the deck. dunno if it's a significant study though.
As much as possible, i want to improve an AI algorithm that's what i'm interested with. | algorithm | artificial-intelligence | board-games | null | null | 12/07/2011 16:03:57 | not constructive | Algorithms for board games and card games (A.I.)
===
do you know board games(tic-tac-toe, game of the generals etc. preferably played 1on1 and has only 3 end results which are win, lose or draw) that still has room for the optimization of the algorithm of its A.I? Thanks, I need this for my thesis.
hmm we already saw
chess- but i don't think there will be enough time for us to optimize one
games of the general
bantumi
Hmm we're also planning to make different AI difficulty levels for a card game called Big Two by using Alpha-beta pruning(?) and using cheating techniques for the AI like giving them knowledge about their opponent's hand or the top card of the deck. dunno if it's a significant study though.
As much as possible, i want to improve an AI algorithm that's what i'm interested with. | 4 |
3,956,283 | 10/18/2010 02:35:24 | 432,540 | 08/27/2010 04:07:11 | 23 | 3 | Add number of days to a date formatted in MySQL Date in PHP | Is there a way to add a certain number of days to a date formatted like 2010-10-17 without converting it to a unix timestamp like using the function strtotime in php? | php | null | null | null | null | null | open | Add number of days to a date formatted in MySQL Date in PHP
===
Is there a way to add a certain number of days to a date formatted like 2010-10-17 without converting it to a unix timestamp like using the function strtotime in php? | 0 |
2,936,790 | 05/29/2010 22:24:43 | 39,110 | 11/19/2008 21:07:59 | 266 | 6 | What's the requests/second standard for scraping websites? | This was the closest question to my question and it wasn't really answered very well imo:
http://stackoverflow.com/questions/2022030/web-scraping-etiquette
I'm looking for the answer to #1:
How many requests/second should you be doing to scrape?
Right now I pull from a queue of links. Every site that gets scraped has it's own thread and sleeps for 1 second in between requests. I ask for gzip compression to save bandwidth.
Are there standards for this? Surely all the big search engines have some set of guidelines they follow in regards to this. | screen-scraping | etiquette | null | null | null | null | open | What's the requests/second standard for scraping websites?
===
This was the closest question to my question and it wasn't really answered very well imo:
http://stackoverflow.com/questions/2022030/web-scraping-etiquette
I'm looking for the answer to #1:
How many requests/second should you be doing to scrape?
Right now I pull from a queue of links. Every site that gets scraped has it's own thread and sleeps for 1 second in between requests. I ask for gzip compression to save bandwidth.
Are there standards for this? Surely all the big search engines have some set of guidelines they follow in regards to this. | 0 |
7,157,758 | 08/23/2011 07:46:32 | 794,434 | 06/12/2011 02:33:14 | 40 | 17 | where the TCP/IP protocol suite ll be located ? if v hve to add some functionality to it then where to implement? | hey i just wanted to know where the TCP/IP protocol suite ll be located...is tat in NIc?
if v have to add some functionality to it then where to implement?
| tcp | protocols | network-protocols | null | null | 07/08/2012 01:17:32 | not a real question | where the TCP/IP protocol suite ll be located ? if v hve to add some functionality to it then where to implement?
===
hey i just wanted to know where the TCP/IP protocol suite ll be located...is tat in NIc?
if v have to add some functionality to it then where to implement?
| 1 |
5,749,382 | 04/21/2011 20:21:41 | 693,820 | 11/14/2010 21:38:57 | 115 | 17 | How do I correctly load the char array of a grayscale BMP using CImage? | I have the following code:
cout<<"Please enter the name of your BMP image file: "<<endl;
cin>>fname;
nP = fname.c_str();
CImage input = CImage();
input.Load(nP);
// allocate space for host source image
unsigned char *pHI, *pCI;
width = input.GetWidth();
height = input.GetHeight();
pCI = (unsigned char *)input.GetBits();
pHI = (unsigned char *)malloc(sizeof(unsigned char) * width * height);
// fill array with CImage array content
srand (time(NULL));
for (int cnt = 0; cnt < sizeof(unsigned char) * width * height; cnt++){
pHI[cnt] = pCI[cnt];
}
But the program gives me an error when I try to get the width and height.
"Debug Assertion Failed! ... Expression: m_hBitmap !=0"
If you have any ideas as to what could be causing this / what I should change, I'd appreciate the help!
: ) | c++ | c | image | visual-c++ | bmp | null | open | How do I correctly load the char array of a grayscale BMP using CImage?
===
I have the following code:
cout<<"Please enter the name of your BMP image file: "<<endl;
cin>>fname;
nP = fname.c_str();
CImage input = CImage();
input.Load(nP);
// allocate space for host source image
unsigned char *pHI, *pCI;
width = input.GetWidth();
height = input.GetHeight();
pCI = (unsigned char *)input.GetBits();
pHI = (unsigned char *)malloc(sizeof(unsigned char) * width * height);
// fill array with CImage array content
srand (time(NULL));
for (int cnt = 0; cnt < sizeof(unsigned char) * width * height; cnt++){
pHI[cnt] = pCI[cnt];
}
But the program gives me an error when I try to get the width and height.
"Debug Assertion Failed! ... Expression: m_hBitmap !=0"
If you have any ideas as to what could be causing this / what I should change, I'd appreciate the help!
: ) | 0 |
7,660,409 | 10/05/2011 11:14:15 | 954,724 | 09/20/2011 12:13:27 | 13 | 0 | ID generator for the Objects created | I need a class which creates Objects assigning an ID to each Object created. This ID is as usual an int attribute to the class. I want this value (ID) to be increased each time an Object is created and then to be assigned to that Object starting with 1. It strikes me that I need a static int attribute.
How can I initialize this static attribute?
Should I create a separate method to do the increment of the ID (as an ID generator) which is invoked inside the constructor?
What is in general the most effective and well-designed manner to implement that?
| java | object | constructor | null | null | null | open | ID generator for the Objects created
===
I need a class which creates Objects assigning an ID to each Object created. This ID is as usual an int attribute to the class. I want this value (ID) to be increased each time an Object is created and then to be assigned to that Object starting with 1. It strikes me that I need a static int attribute.
How can I initialize this static attribute?
Should I create a separate method to do the increment of the ID (as an ID generator) which is invoked inside the constructor?
What is in general the most effective and well-designed manner to implement that?
| 0 |
7,137,040 | 08/21/2011 07:40:45 | 11,236 | 09/16/2008 06:29:28 | 9,503 | 119 | Why was XPath dropped from jQuery? | I didn't find any documentation as to why [XPath support was dropped from jQuery][1].
[1]: http://stackoverflow.com/questions/3782912/jquery-xpath-selection-not-working/3782949#3782949 | javascript | jquery | xpath | null | null | 08/21/2011 17:55:07 | off topic | Why was XPath dropped from jQuery?
===
I didn't find any documentation as to why [XPath support was dropped from jQuery][1].
[1]: http://stackoverflow.com/questions/3782912/jquery-xpath-selection-not-working/3782949#3782949 | 2 |
11,560,686 | 07/19/2012 12:15:45 | 1,001,726 | 10/18/2011 17:53:23 | 32 | 0 | Download app icon Play Store | Do you know if is it possible to download the icons of the apps directly from Google Play? Is there a better way?
Tank you! | android | application | google-play | null | null | 07/19/2012 13:12:37 | off topic | Download app icon Play Store
===
Do you know if is it possible to download the icons of the apps directly from Google Play? Is there a better way?
Tank you! | 2 |
5,902,055 | 05/05/2011 17:50:28 | 507,134 | 11/14/2010 02:57:08 | 16 | 3 | String alphanumeric Characters | Suppose there is a alphanumeric string "ghyt123lkj234l5lk453" , I need to provide the sum of all the numbers present in the string . Also this String is Unique .
| string | null | null | null | null | 05/05/2011 18:34:26 | not a real question | String alphanumeric Characters
===
Suppose there is a alphanumeric string "ghyt123lkj234l5lk453" , I need to provide the sum of all the numbers present in the string . Also this String is Unique .
| 1 |
8,272,420 | 11/25/2011 17:26:05 | 957,267 | 09/21/2011 15:11:51 | 122 | 1 | how can I modify a gmail account to forward an email that comes in with additional parameters? | Say my gmail account gets an email, how can I make it so that any email that comes to my gmail account automatically forwards to another email "bob@gmail.com" with ADDITIONAL parameters in the body of the email? Do I have to use a php script with IMAP or can I do this with gmail alone? | php | gmail | gmail-imap | null | null | 11/25/2011 20:53:43 | off topic | how can I modify a gmail account to forward an email that comes in with additional parameters?
===
Say my gmail account gets an email, how can I make it so that any email that comes to my gmail account automatically forwards to another email "bob@gmail.com" with ADDITIONAL parameters in the body of the email? Do I have to use a php script with IMAP or can I do this with gmail alone? | 2 |
9,113,256 | 02/02/2012 13:35:03 | 1,185,249 | 02/02/2012 13:28:39 | 1 | 0 | How do i update database by checkedchanged events of the checkbox | How do i update database with out page refresh through checkedchanged events of the checkbox present in the itemtemplate of the gridview.
Please any help.. | c# | asp.net | null | null | null | 03/23/2012 23:31:59 | not a real question | How do i update database by checkedchanged events of the checkbox
===
How do i update database with out page refresh through checkedchanged events of the checkbox present in the itemtemplate of the gridview.
Please any help.. | 1 |
2,660,972 | 04/18/2010 03:10:50 | 311,653 | 04/08/2010 06:42:56 | 1 | 0 | PHP and Objective C Communication | Hii, I have PHP script link,which responds YES or NO when we set post userName and emailID.I have used ASI framework. But it is not working....Here is my code....Thanks in advance...
NSURL *url = [NSURL URLWithString:@"https://abc.com/abctest/registration.php"];
ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url];
[request setPostValue:@"xyz@xyz.com" forKey:@"email"];
[request setPostValue:@"pqr" forKey:@"userName"];
[request start];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
printf("\n\n\n Responce %s",[response UTF8String]);
response = [response stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([response isEqualToString:@"YES"])
{
printf("\n\n YES");
}
}
| iphone | objective-c | iphone-sdk | iphone-sdk-3.0 | null | 04/20/2010 02:10:38 | not a real question | PHP and Objective C Communication
===
Hii, I have PHP script link,which responds YES or NO when we set post userName and emailID.I have used ASI framework. But it is not working....Here is my code....Thanks in advance...
NSURL *url = [NSURL URLWithString:@"https://abc.com/abctest/registration.php"];
ASIFormDataRequest *request = [[ASIFormDataRequest alloc] initWithURL:url];
[request setPostValue:@"xyz@xyz.com" forKey:@"email"];
[request setPostValue:@"pqr" forKey:@"userName"];
[request start];
NSError *error = [request error];
if (!error) {
NSString *response = [request responseString];
printf("\n\n\n Responce %s",[response UTF8String]);
response = [response stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
if ([response isEqualToString:@"YES"])
{
printf("\n\n YES");
}
}
| 1 |
9,002,662 | 01/25/2012 12:24:53 | 1,133,770 | 01/06/2012 06:34:55 | 20 | 1 | strange error in php array with dom object | hi I am using dom in php
$a1=array('url1','url2);
foreach ($a1 as $color)
{
$dom = new DOMDocument();
print $color;
$html = @$dom->loadHTMLFile($color);
$dom->preserveWhiteSpace = false;
$tables = $dom->getElementsByTagName('body');
$rows = $tables->item(0)->getElementsByTagName('tr');
above works like charm.
but when I capture that urls values from a html form and store it into an array & using its value in dom objects .. it does not process neither gives any error.
$bro = ($_POST['urls']);
$a1=explode("\n",$bro);
I want to capture urls from external source. | arrays | dom | null | null | null | null | open | strange error in php array with dom object
===
hi I am using dom in php
$a1=array('url1','url2);
foreach ($a1 as $color)
{
$dom = new DOMDocument();
print $color;
$html = @$dom->loadHTMLFile($color);
$dom->preserveWhiteSpace = false;
$tables = $dom->getElementsByTagName('body');
$rows = $tables->item(0)->getElementsByTagName('tr');
above works like charm.
but when I capture that urls values from a html form and store it into an array & using its value in dom objects .. it does not process neither gives any error.
$bro = ($_POST['urls']);
$a1=explode("\n",$bro);
I want to capture urls from external source. | 0 |
9,211,360 | 02/09/2012 13:04:05 | 1,017,550 | 10/28/2011 00:40:30 | 136 | 12 | Apache rewrite to 404 except for matched query | I'm trying to handle logically simple operation, but apache rewrite does not handle my website's query strings requests. I heard it's does not do it eventually. Still cannot understand it's regex syntax.
RewriteEngine on
RewriteBase /
#RewriteCond %{QUERY_STRING} ^\?category=([a-z])$ // WHY DO I NEED THIS?
RewriteRule ^!(?category=[a-z]+|?do=[a-z]+)$ [R=404,L,NC]
Goal is to send client to 404 for any query NOT matching /?category=[a-z]+ and /?do=[a-z]+. It would be much better if it's possible to load patterns from the text file.
Apache documentation is poor and Google does not help too.
Please help. Thanks.
| apache | mod-rewrite | null | null | null | 02/10/2012 16:20:11 | off topic | Apache rewrite to 404 except for matched query
===
I'm trying to handle logically simple operation, but apache rewrite does not handle my website's query strings requests. I heard it's does not do it eventually. Still cannot understand it's regex syntax.
RewriteEngine on
RewriteBase /
#RewriteCond %{QUERY_STRING} ^\?category=([a-z])$ // WHY DO I NEED THIS?
RewriteRule ^!(?category=[a-z]+|?do=[a-z]+)$ [R=404,L,NC]
Goal is to send client to 404 for any query NOT matching /?category=[a-z]+ and /?do=[a-z]+. It would be much better if it's possible to load patterns from the text file.
Apache documentation is poor and Google does not help too.
Please help. Thanks.
| 2 |
9,491,968 | 02/29/2012 00:32:01 | 1,239,113 | 02/29/2012 00:27:02 | 1 | 0 | jQuery UI Slider reset | Trying to create a slider that will **slide back to the beginning** if it isn't dragged all the way across... here is what doesn't work:
$("#slider").slider({
animate: true,
change: function(event, ui) {
if ($(this).slider('value') < 100) {
$(this).slider('value', 0);
}
}
});
The slider moves back, but instantly, no animation. | jquery | user-interface | slider | jquery-animation | null | null | open | jQuery UI Slider reset
===
Trying to create a slider that will **slide back to the beginning** if it isn't dragged all the way across... here is what doesn't work:
$("#slider").slider({
animate: true,
change: function(event, ui) {
if ($(this).slider('value') < 100) {
$(this).slider('value', 0);
}
}
});
The slider moves back, but instantly, no animation. | 0 |
7,436,584 | 09/15/2011 19:44:13 | 504,898 | 11/11/2010 18:29:29 | 74 | 1 | How to avoid caching effects in read benchmarks | I have a read benchmark and between consecutive runs, I have to make sure that the data does not reside in memory to avoid effects seen due to caching. So far what I used to do is: run a program that writes a large file between consecutive runs of the read benchmark. Something like
./read_benchmark
./write --size 64G --path /tmp/test.out
./read_benchmark
The write program simply writes an array of size 1G 64 times to file. Since the size of the main memory is 64G, I write a file that is approx. the same size. The problem is that writing takes a long time and I was wondering if there are better ways to do this, i.e. avoid effects seen when data is cached.
Also, what happens if I write data to /dev/null?
./write --size 64G --path /dev/null
This way, the write program exits very fast, no I/O is actually performed, but I am not sure if it overwrites 64G of main memory, which is what I ultimately want.
Your input is greatly appreciated. | c | linux | caching | memory-management | io | null | open | How to avoid caching effects in read benchmarks
===
I have a read benchmark and between consecutive runs, I have to make sure that the data does not reside in memory to avoid effects seen due to caching. So far what I used to do is: run a program that writes a large file between consecutive runs of the read benchmark. Something like
./read_benchmark
./write --size 64G --path /tmp/test.out
./read_benchmark
The write program simply writes an array of size 1G 64 times to file. Since the size of the main memory is 64G, I write a file that is approx. the same size. The problem is that writing takes a long time and I was wondering if there are better ways to do this, i.e. avoid effects seen when data is cached.
Also, what happens if I write data to /dev/null?
./write --size 64G --path /dev/null
This way, the write program exits very fast, no I/O is actually performed, but I am not sure if it overwrites 64G of main memory, which is what I ultimately want.
Your input is greatly appreciated. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.