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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8,454,255 | 12/10/2011 03:53:28 | 3,314 | 08/27/2008 20:05:23 | 4,360 | 54 | How can I have a full-screen canvas at full resolution in an iPhone 4? | I'm trying to create an HTML5 game, which I'd like to work in modern desktop browsers, plus as many smartphones as I can get my hands on to. For now, that means iPhone 3/4 and a couple of Androids...
This game is basically a canvas that should occupy the whole screen, which I manually resize (handling the onResize event) as follows: (this is what I found to work best, by trial and error, if you have any tips, i'd love to hear them!)
- For desktop browsers: canvas.width/height = window.innerWidth / Height
- For Android: same, but I add (outerHeight - innerHeight) to the canvas height, and I scroll down, to compensate for the top bar.
- For iPhone 3: same as for Android, but I add a hard-coded 60px instead.
In all cases I have these meta-tags:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, target-densitydpi=device-dpi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Now my big problem is iPhone 4...
The iPhone 3 setting I mentioned above works perfectly, but it displays in low-res and looks like crap. I haven't been able to successfully make it show in full Retina resolution, without scrolling and (this is key) responding to the rotation of the phone.
The closest I got was setting
<meta name="viewport" content="width=640, initial-scale=0.5 (etc)" />
And setting the canvas to the window *outer* width and height instead of the inner. This looks gorgeous initially; however, once I rotate the phone, it gets all screwed up, and if I rotate it back to portrait, it's even *more* screwed up.
Surprisingly, refreshing doesn't fix it, I need to change the "initial-scale" in the meta viewport to 1, refresh, and then back to 0.5 and refresh again.
Is there any way to do what I'm trying to do?
Thank you very much!
Daniel | javascript | canvas | fullscreen | resolution | iphone-4 | null | open | How can I have a full-screen canvas at full resolution in an iPhone 4?
===
I'm trying to create an HTML5 game, which I'd like to work in modern desktop browsers, plus as many smartphones as I can get my hands on to. For now, that means iPhone 3/4 and a couple of Androids...
This game is basically a canvas that should occupy the whole screen, which I manually resize (handling the onResize event) as follows: (this is what I found to work best, by trial and error, if you have any tips, i'd love to hear them!)
- For desktop browsers: canvas.width/height = window.innerWidth / Height
- For Android: same, but I add (outerHeight - innerHeight) to the canvas height, and I scroll down, to compensate for the top bar.
- For iPhone 3: same as for Android, but I add a hard-coded 60px instead.
In all cases I have these meta-tags:
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, target-densitydpi=device-dpi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
Now my big problem is iPhone 4...
The iPhone 3 setting I mentioned above works perfectly, but it displays in low-res and looks like crap. I haven't been able to successfully make it show in full Retina resolution, without scrolling and (this is key) responding to the rotation of the phone.
The closest I got was setting
<meta name="viewport" content="width=640, initial-scale=0.5 (etc)" />
And setting the canvas to the window *outer* width and height instead of the inner. This looks gorgeous initially; however, once I rotate the phone, it gets all screwed up, and if I rotate it back to portrait, it's even *more* screwed up.
Surprisingly, refreshing doesn't fix it, I need to change the "initial-scale" in the meta viewport to 1, refresh, and then back to 0.5 and refresh again.
Is there any way to do what I'm trying to do?
Thank you very much!
Daniel | 0 |
7,245,292 | 08/30/2011 15:02:16 | 278,064 | 02/21/2010 11:24:58 | 568 | 51 | Javascript function-level scope | This is just a curiosity. But It is something that i would like to know.
I know that Javascript 1.7 support block scoping with `let` keyword.
But Why Javascript has been initially desinged with `function-level` scope instead of `block scope`? | javascript | scope | language-design | null | null | 08/31/2011 20:17:28 | not constructive | Javascript function-level scope
===
This is just a curiosity. But It is something that i would like to know.
I know that Javascript 1.7 support block scoping with `let` keyword.
But Why Javascript has been initially desinged with `function-level` scope instead of `block scope`? | 4 |
4,682,967 | 01/13/2011 17:12:14 | 455,430 | 09/22/2010 18:54:36 | 36 | 3 | ImageMagick in C#: Get byte array from Convert call? | I am trying to use the ImageMagickObject COM component supplied with the Windows Installer for ImageMagick, imported to my C# project as a COM reference. So far, I've been able to use it to convert images from one file on disk to another file on disk. I'm trying to get it to convert the file in-memory and return it in a byte array as shown in the ArrayTest.vbs file included with the library. Has anyone successfully done this before? Documentation is severely lacking on this feature...
My code:
MagickImageClass _magic = new MagickImageClass();
object[] myarray = new object[1];
myarray[0] = "JPEG:";
object[] args = new object[] { tbFilename.Text, "-colorspace", "cmyk", "-resize", "50%", myarray };
var result = _magic.Convert(ref args);
Their sample from ArrayTest.vbs:
Dim img
Dim myarray(1)
Set img = CreateObject("ImageMagickObject.MagickImage.1")
myarray(0)="8BIM:"
msgs = img.Convert("null:","-profile","8BIMTEXT:iptctext.txt",myarray)
If you're not familiar with ImageMagick, "null:" is a built-in type specifying a null image. "-profile" and "8BIM:iptctext.txt" are command line parameters passed to the Convert call and my array is the output essentially. In their example, myarray ends up with a byte array of the newly converted image. In my code, myarray is unchanged. Help!! | c# | .net | imagemagick | null | null | null | open | ImageMagick in C#: Get byte array from Convert call?
===
I am trying to use the ImageMagickObject COM component supplied with the Windows Installer for ImageMagick, imported to my C# project as a COM reference. So far, I've been able to use it to convert images from one file on disk to another file on disk. I'm trying to get it to convert the file in-memory and return it in a byte array as shown in the ArrayTest.vbs file included with the library. Has anyone successfully done this before? Documentation is severely lacking on this feature...
My code:
MagickImageClass _magic = new MagickImageClass();
object[] myarray = new object[1];
myarray[0] = "JPEG:";
object[] args = new object[] { tbFilename.Text, "-colorspace", "cmyk", "-resize", "50%", myarray };
var result = _magic.Convert(ref args);
Their sample from ArrayTest.vbs:
Dim img
Dim myarray(1)
Set img = CreateObject("ImageMagickObject.MagickImage.1")
myarray(0)="8BIM:"
msgs = img.Convert("null:","-profile","8BIMTEXT:iptctext.txt",myarray)
If you're not familiar with ImageMagick, "null:" is a built-in type specifying a null image. "-profile" and "8BIM:iptctext.txt" are command line parameters passed to the Convert call and my array is the output essentially. In their example, myarray ends up with a byte array of the newly converted image. In my code, myarray is unchanged. Help!! | 0 |
9,913,818 | 03/28/2012 18:48:13 | 1,298,990 | 03/28/2012 18:31:43 | 1 | 0 | KMZ custom files will not open in balloon as text... in iPad ...just blank..works fine in PC windows | new 6.2 goggle earth doesn't open a kmz from email fully. The map launches and the icons are placed correctly and color and size are fine... When I tap them the balloon open as an empty text box. | ipad | google | kmz | earth | null | 06/06/2012 19:49:50 | not a real question | KMZ custom files will not open in balloon as text... in iPad ...just blank..works fine in PC windows
===
new 6.2 goggle earth doesn't open a kmz from email fully. The map launches and the icons are placed correctly and color and size are fine... When I tap them the balloon open as an empty text box. | 1 |
10,640,360 | 05/17/2012 17:16:59 | 453,851 | 09/21/2010 11:31:56 | 574 | 13 | Does a PrintWriter / PrintStream need to be flushed? | I'd like to use a PrintWriter or PrintStream to write formatted strings out to an outputstream (for which I have no control over the creation). However flushing the underlying OutputStream has a big performance hit.
Does a PrintWriter / PrintStream need to be flushed or does that only flush the underlying outputstream?
If I need to flush the PrintStream / PrintWriter; can I do so without flushing the underlying OutputStream, or will I need to create a "flush protecter" OutputStream to wrap the underlying stream? | java | printstream | null | null | null | null | open | Does a PrintWriter / PrintStream need to be flushed?
===
I'd like to use a PrintWriter or PrintStream to write formatted strings out to an outputstream (for which I have no control over the creation). However flushing the underlying OutputStream has a big performance hit.
Does a PrintWriter / PrintStream need to be flushed or does that only flush the underlying outputstream?
If I need to flush the PrintStream / PrintWriter; can I do so without flushing the underlying OutputStream, or will I need to create a "flush protecter" OutputStream to wrap the underlying stream? | 0 |
11,359,293 | 07/06/2012 09:15:27 | 519,882 | 11/25/2010 09:03:47 | 1,112 | 5 | push flow relabel algorithm | A valid labelling of the vertices in V wrt. a preflow x is a function d[.] : V -> Z satisfying:
d[s] = n ^ d[t] = 0
for all (v,w) belong to E : d[v] <= d[w] + 1
supposed we have 4 verticies including (s and t)
then we have d[s] = 4
according to valid labeling we should have d[v] <= d[w]+1, but for edges which are coming from 's', it is not
valid because 4 <= 1 is false. Is this logic is not only source?
Am I understading it right? Please correct me.
Thanks for your time and help
| algorithm | graph-algorithm | max-flow | null | null | 07/07/2012 06:23:02 | off topic | push flow relabel algorithm
===
A valid labelling of the vertices in V wrt. a preflow x is a function d[.] : V -> Z satisfying:
d[s] = n ^ d[t] = 0
for all (v,w) belong to E : d[v] <= d[w] + 1
supposed we have 4 verticies including (s and t)
then we have d[s] = 4
according to valid labeling we should have d[v] <= d[w]+1, but for edges which are coming from 's', it is not
valid because 4 <= 1 is false. Is this logic is not only source?
Am I understading it right? Please correct me.
Thanks for your time and help
| 2 |
6,683,936 | 07/13/2011 18:44:44 | 1,459,786 | 07/21/2009 21:12:40 | 172 | 7 | Serving static files from nginx with django + fastcgi debian | I'm a little rusty when it comes to the new way of static file serving with django 1.3 however I'm sure it cannot be django that is at fault here.
I'm trying to run a django app with nginx + fastcgi on a cloud server with debian installed. We only have one server at the moment (while we develop) and will be looking to run multiple servers with a load balancer to make this a little simpler however I'm having trouble actually getting nginx to serve static files.
I've followed various tutorials for setting up nginx.conf to serve the files
server {
listen 80;
server_name 127.0.0.1;
location /static {
autoindex on;
root /static;
}
The above is an extract from nginx.conf. Now no matter what I set root to, nginx throws a 404 not found error when trying to access http://127.0.0.1/static/.
The file structure is as follows:
/home/user/site/project
/home/user/site/static
/home/user/site/templates
Django settings.py has the following set up as STATIC_ROOT and STATIC_URL
STATIC_ROOT = "/home/user/site/static/"
STATIC_URL = "http://127.0.0.1/static/"
If anyone could point us in the right direction of where to do with this it would be fantastic. | python | django | nginx | fastcgi | static-files | null | open | Serving static files from nginx with django + fastcgi debian
===
I'm a little rusty when it comes to the new way of static file serving with django 1.3 however I'm sure it cannot be django that is at fault here.
I'm trying to run a django app with nginx + fastcgi on a cloud server with debian installed. We only have one server at the moment (while we develop) and will be looking to run multiple servers with a load balancer to make this a little simpler however I'm having trouble actually getting nginx to serve static files.
I've followed various tutorials for setting up nginx.conf to serve the files
server {
listen 80;
server_name 127.0.0.1;
location /static {
autoindex on;
root /static;
}
The above is an extract from nginx.conf. Now no matter what I set root to, nginx throws a 404 not found error when trying to access http://127.0.0.1/static/.
The file structure is as follows:
/home/user/site/project
/home/user/site/static
/home/user/site/templates
Django settings.py has the following set up as STATIC_ROOT and STATIC_URL
STATIC_ROOT = "/home/user/site/static/"
STATIC_URL = "http://127.0.0.1/static/"
If anyone could point us in the right direction of where to do with this it would be fantastic. | 0 |
8,215,803 | 11/21/2011 17:21:37 | 1,056,075 | 11/20/2011 06:03:27 | 6 | 1 | How does message passing encapsulate the implementation of an object? | How does the object oriented concept of message passing help to encapsulate the implementation of an object, including its data? | java | null | null | null | null | 11/22/2011 18:06:41 | not a real question | How does message passing encapsulate the implementation of an object?
===
How does the object oriented concept of message passing help to encapsulate the implementation of an object, including its data? | 1 |
3,779,540 | 09/23/2010 14:40:10 | 81,660 | 03/23/2009 21:33:47 | 693 | 27 | Are default routes broken with Rails 3 engines? | I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the `config/routes.rb` defines the following
resources :users
match '/:controller(/:action(/:id))'
When I do a `rake routes` from the application that requires this gem I get the following routes
rake routes|grep users
users GET /users(.:format) {:controller=>"users", :action=>"index"}
users POST /users(.:format) {:controller=>"users", :action=>"create"}
new_user GET /users/new(.:format) {:controller=>"users", :action=>"new"}
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"}
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"}
user PUT /users/:id(.:format) {:controller=>"users", :action=>"update"}
user DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"}
This is what I expect.
However when I try to access the following routes via a browser
/users/137
/users/137/edit
I get the following error in the logs
AbstractController::ActionNotFound (The action '137' could not be found for UsersController):
actionpack (3.0.0) lib/abstract_controller/base.rb:114:in `process'
actionpack (3.0.0) lib/abstract_controller/rendering.rb:40:in `process'
...
What is interesting is that the following paths do work
/users/show/137
/users/edit/137
Also if I add the following to the routes.rb file in the application that is requiring the gem it all works as expected.
resources :users
Is there something I am missing or is this a bug?
Note that I am also doing the following when I start my application
on the command line when I start the rails I set the following env variable
RAILS_RELATIVE_URL_ROOT="/my_app"
and in config.ru
map '/my_app' do
run MSEL::Application
end
| ruby-on-rails | ruby-on-rails-3 | routes | null | null | null | open | Are default routes broken with Rails 3 engines?
===
I have a Rails 3 engine gem that is for basic user authentication and authorization. Within that Gem the `config/routes.rb` defines the following
resources :users
match '/:controller(/:action(/:id))'
When I do a `rake routes` from the application that requires this gem I get the following routes
rake routes|grep users
users GET /users(.:format) {:controller=>"users", :action=>"index"}
users POST /users(.:format) {:controller=>"users", :action=>"create"}
new_user GET /users/new(.:format) {:controller=>"users", :action=>"new"}
edit_user GET /users/:id/edit(.:format) {:controller=>"users", :action=>"edit"}
user GET /users/:id(.:format) {:controller=>"users", :action=>"show"}
user PUT /users/:id(.:format) {:controller=>"users", :action=>"update"}
user DELETE /users/:id(.:format) {:controller=>"users", :action=>"destroy"}
This is what I expect.
However when I try to access the following routes via a browser
/users/137
/users/137/edit
I get the following error in the logs
AbstractController::ActionNotFound (The action '137' could not be found for UsersController):
actionpack (3.0.0) lib/abstract_controller/base.rb:114:in `process'
actionpack (3.0.0) lib/abstract_controller/rendering.rb:40:in `process'
...
What is interesting is that the following paths do work
/users/show/137
/users/edit/137
Also if I add the following to the routes.rb file in the application that is requiring the gem it all works as expected.
resources :users
Is there something I am missing or is this a bug?
Note that I am also doing the following when I start my application
on the command line when I start the rails I set the following env variable
RAILS_RELATIVE_URL_ROOT="/my_app"
and in config.ru
map '/my_app' do
run MSEL::Application
end
| 0 |
4,533,314 | 12/26/2010 09:12:14 | 554,213 | 12/26/2010 09:12:14 | 1 | 0 | How to backup a Windows driver using Delphi | Can someone please help me and tell me how I can backup a Windows driver problematically using Delphi?
Any code samples, links to articles are highly appreciated
Thanks for your time | delphi | delphi-7 | null | null | null | null | open | How to backup a Windows driver using Delphi
===
Can someone please help me and tell me how I can backup a Windows driver problematically using Delphi?
Any code samples, links to articles are highly appreciated
Thanks for your time | 0 |
7,491,187 | 09/20/2011 20:10:18 | 94,508 | 04/22/2009 17:30:09 | 525 | 10 | Where is the appropriate place to release a variable w/ an Objective-C switch statement? | In the following code
NSDictionary *test;
switch (xxx) {
case 1:
...
return YES;
break;
case 2:
...
return NO;
break;
case 3:
...
return YES;
break;
}
[test release];
will the "test" variable be properly released or should there be a separate release statement w/in each switch case statement? | objective-c | null | null | null | null | null | open | Where is the appropriate place to release a variable w/ an Objective-C switch statement?
===
In the following code
NSDictionary *test;
switch (xxx) {
case 1:
...
return YES;
break;
case 2:
...
return NO;
break;
case 3:
...
return YES;
break;
}
[test release];
will the "test" variable be properly released or should there be a separate release statement w/in each switch case statement? | 0 |
9,872,443 | 03/26/2012 12:50:08 | 1,293,030 | 03/26/2012 12:42:56 | 1 | 0 | Why the effective number of parameters of k-nearest neighbor algorithm is n / k? | n means the size of the dataset. I don't know why this is true!!
| artificial-intelligence | machine-learning | data-mining | null | null | 03/29/2012 06:01:08 | off topic | Why the effective number of parameters of k-nearest neighbor algorithm is n / k?
===
n means the size of the dataset. I don't know why this is true!!
| 2 |
5,879,859 | 05/04/2011 07:17:17 | 735,675 | 05/03/2011 07:39:43 | 3 | 0 | In what ways can we display a progress bar in an android application | In what ways can we display a progress bar in an android application.
ProgressDialog, ProgressBar, requestWindowFeature, ProgressView, and ProgressItem | android | null | null | null | null | 05/04/2011 16:40:00 | not a real question | In what ways can we display a progress bar in an android application
===
In what ways can we display a progress bar in an android application.
ProgressDialog, ProgressBar, requestWindowFeature, ProgressView, and ProgressItem | 1 |
8,447,387 | 12/09/2011 15:02:08 | 619,754 | 02/16/2011 13:57:48 | 8 | 0 | new, delete, Objective-C++, and leaks | I'm adding functionality to an existing Cocoa application written mostly in Objective-C. I have to use an existing c++ class in the class I'm writing, so the new class is Objective-C++. Furthermore, I've had to write a method on the c++ class that temporarily uses a buffer. So my c++ method is something like
(void) myMethod{
int8_t* bffr = new int8_t[length];
// use the buffer
delete [] bffr;
}
I instantiate the c++ class in my .mm file, and try to carry on. The problem is that the application crashes. However, if I comment out the `delete`, the app does not crash, but Instruments reports a leak associated with this method. I presume that the Objective-C memory management is getting bolluxed up. How can I resolve this catch-22? | objective-c | memory-leaks | delete | new | objective-c++ | null | open | new, delete, Objective-C++, and leaks
===
I'm adding functionality to an existing Cocoa application written mostly in Objective-C. I have to use an existing c++ class in the class I'm writing, so the new class is Objective-C++. Furthermore, I've had to write a method on the c++ class that temporarily uses a buffer. So my c++ method is something like
(void) myMethod{
int8_t* bffr = new int8_t[length];
// use the buffer
delete [] bffr;
}
I instantiate the c++ class in my .mm file, and try to carry on. The problem is that the application crashes. However, if I comment out the `delete`, the app does not crash, but Instruments reports a leak associated with this method. I presume that the Objective-C memory management is getting bolluxed up. How can I resolve this catch-22? | 0 |
8,568,776 | 12/19/2011 23:08:35 | 1,080,056 | 12/04/2011 12:54:20 | 17 | 4 | Try to install SQL Server Management Studio for SQL Server 2008 Express. FAILED! Why? | I started a dozen attempts to install the SQL Server Management Studio for the 2008 Express Version of SQL Server.
What i use:
Windows Vista 2007 SP 2
What i did:
a) I downloaded the install file SQLManagementStudio_x86_DEU.exe from [Microsofts Download Center](http://www.microsoft.com/downloads/de-de/details.aspx?FamilyID=08e52ac2-1d62-45f6-9a4a-4b76a8564a2b)
b) I started the setup, choosed "Installation"/"Adding Feature"
c) The feature selection appears, but i can chose only from SQL Client Connectivity SDK (see attachment)
![enter image description here][1]
d) This is wrong i guess; but even if i click next i get an error message like "Please chose a feature first"
What can i do?
Thanks for any advice!!!
[1]: http://i.stack.imgur.com/NPf93.jpg | sql | sql-server-2008 | sql-management-studio | null | null | 12/20/2011 17:55:38 | off topic | Try to install SQL Server Management Studio for SQL Server 2008 Express. FAILED! Why?
===
I started a dozen attempts to install the SQL Server Management Studio for the 2008 Express Version of SQL Server.
What i use:
Windows Vista 2007 SP 2
What i did:
a) I downloaded the install file SQLManagementStudio_x86_DEU.exe from [Microsofts Download Center](http://www.microsoft.com/downloads/de-de/details.aspx?FamilyID=08e52ac2-1d62-45f6-9a4a-4b76a8564a2b)
b) I started the setup, choosed "Installation"/"Adding Feature"
c) The feature selection appears, but i can chose only from SQL Client Connectivity SDK (see attachment)
![enter image description here][1]
d) This is wrong i guess; but even if i click next i get an error message like "Please chose a feature first"
What can i do?
Thanks for any advice!!!
[1]: http://i.stack.imgur.com/NPf93.jpg | 2 |
63,918 | 09/15/2008 15:25:30 | 315,650 | 09/15/2008 14:17:57 | 1 | 0 | What is the best online javascript/css/html/xhtml/dom reference? | I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been using them in combination. | javascript | html | css | ajax | xhtml | null | open | What is the best online javascript/css/html/xhtml/dom reference?
===
I'm a front-end developer and I was looking for opinions about the best all-round online documentation for javascript/css/html/xhtml/dom/browser quirks and support. I've tried Sitepoint, Quirksmode, W3Schools but all of these seem to be lacking in certain aspects and have been using them in combination. | 0 |
10,711,992 | 05/23/2012 00:37:39 | 1,342,976 | 04/19/2012 04:17:00 | 22 | 0 | Segmentation fault at the end of the program | I have a segmentation fault problem occurring at the very end of my program. Everything works as expected except for the sole error message. And the one appears only if I choose the second option form my menu (see menu.cpp below) which calls for one graph class method (see in Graf.cpp - "odszukaj_dfs"). After completing all tasks it exits then with an above mentioned error.
I would appreciate for any hint on what is wrong. Please let me know if you need more pieces of my code to solve it, I didn't post all of it in order not to make my post too bloated. Secondly, forgive for not using English in my code - the project is for my University and I had to stick to my native tongue. Thank you in advance.
As to what the program itself is to do - it is to read a graph from a file and be able to perform a depth-first search on it. The problem occurs while doing the latter.
//main.cpp
#include <iostream>
#include "wczytywanie_grafu/wczytaj_nazwe_pliku.h"
#include "wczytywanie_grafu/wczytaj_graf.h"
#include "menu/menu.h"
#include "graf_struktura/Graf.h"
int main( int argc, char *argv[] )
{
using namespace std;
const char* npliku = wczytaj_nazwe_pliku( argc, argv );
if( npliku != 0 )
{
Graf *g = poprosze_graf(npliku);
while( menu(*g) );
delete g;
}
cout << "Do widzenia.\n";
return 0;
}
Here is where the problem occurs:
//menu.cpp
#include "menu.h"
#include <iostream>
//wyswietla menu dostepnych operacji na poprawnie wczytanym grafie.
bool menu(Graf &g)
{
using namespace std;
int i;
char *token;
cout << endl;
cout << "Jaka operacje wykonac na wczytanym grafie?\n";
cout << endl;
cout << "1) Wyswietlic schemat.\n";
cout << "2) Wyszukac wierzcholek metoda DFS.\n";
cout << "3) Wczytac inny graf.\n";
cout << "4) Opuscic program.\n";
cout << endl;
cout << "Prosze o wybor jednej z powyzszych opcji. ";
while( !(cin >> i) || i < 1 || i > 4 )
{
cin.clear();
cin.ignore(1000, '\n');
cout << "\nBlad. Prosze podac desygnujaca odpowiedz liczbe z podanego zakresu. ";
}
cout << endl;
switch( i )
{
case 1 :
g.wyswietl();
break;
case 2 :
cout << "Prosze podac nazwe szukanego wierzcholka. ";
cin >> token;
cout << "Odwiedzone wierzcholki: ";
if( g.odszukaj_dfs(token) == 0 )
cout << "\nNie odnaleziono wierzcholka " << token << ".\n";
else
cout << "\nOdnaleziono wierzcholek " << token << ".\n";
break;
// case 3 :
//
// break;
case 4 :
return false;
}
return true;
}
Here are the graph definitions ("Graf" is for graph and "Wierzcholek" for its node)
//Graf.cpp
#include "Graf.h"
#include "../lifo/TabDyn.h"
#include "../lifo/Stos.h"
#include <cstring>
/*###########################################################*/
/*####################### WIERZCHOLEK #######################*/
/*###########################################################*/
/*konstruktory*/
Wierzcholek::Wierzcholek(void)
{
sasiedztwo = -1;
nastepny = poprzedni = 0;
sasiedzi = new Wierzcholek* [1*sizeof(Wierzcholek*)];
}
Wierzcholek::Wierzcholek(char* k)
{
klucz = k;
//wierzcholek izolowany grafu.
sasiedztwo = 0;
nastepny = poprzedni = 0;
sasiedzi = new Wierzcholek* [1*sizeof(Wierzcholek*)];
}
Wierzcholek::Wierzcholek(char* k, int s)
{
klucz = k; sasiedztwo = s;
nastepny = poprzedni = 0;
//przygotowanie tablicy sasiadow o stosownym rozmiarze
sasiedzi = new Wierzcholek* [s*sizeof(Wierzcholek*)];
}
Wierzcholek::Wierzcholek(char* k, int s, Wierzcholek** &n)
{
//typowy wierzcholek grafu.
klucz = k; sasiedztwo = s; sasiedzi = n;
nastepny = poprzedni = 0;
}
Wierzcholek::Wierzcholek(char* k, int s, Wierzcholek** &n, Wierzcholek* &nast , Wierzcholek* &poprz)
{
//typowy wierzcholek grafu.
klucz = k; sasiedztwo = s; sasiedzi = n;
nastepny = nast; poprzedni = poprz;
}
/*przeciazenia i metody*/
//relacja rownowaznosci obiektow oparta na identycznosci kluczy
bool Wierzcholek::operator==(Wierzcholek const &prawy) const
{
if ( klucz == prawy.klucz )
return true;
else
return false;
}
void Wierzcholek::okresl_ilosc_sasiadow(int n)
{
delete [] sasiedzi;
sasiedzi = new Wierzcholek* [n*sizeof(Wierzcholek)];
sasiedztwo = n;
}
/*###########################################################*/
/*########################### GRAF ##########################*/
/*###########################################################*/
/*konstruktor*/
Graf::Graf(void)
{
pierwszy = ostatni = 0;
rozmiar = 0;
}
/*metody*/
void Graf::dodaj(Wierzcholek* w)
{
if ( pierwszy != 0 )
{
w->poprzedni = ostatni;
ostatni = w;
ostatni->poprzedni->nastepny = ostatni;
}
else
pierwszy = ostatni = w;
ostatni->pozycja = rozmiar++;
}
void Graf::wyswietl(void)
{
using namespace std;
Wierzcholek *n = pierwszy;
for( int j=0; j < rozmiar; n = n->nastepny)
{
cout << n->klucz << " :";
for( int i=0; i < n->sasiedztwo; i++ )
cout << " " << n->sasiedzi[i]->klucz;
cout << " ;\n";
j++;
}
return;
}
int Graf::podaj_rozmiar(void)
{
return rozmiar;
}
Wierzcholek* Graf::odszukaj_dfs(char* &klucz)
{
using namespace std;
//tablica przyporzadkowujaca kazdemu kolejnemu wierzcholkowi grafu
//binarna wartosc oznaczajaca fakt odwiedzenia wierzcholka przez algorytm.
TabDyn<bool> odwiedzony;
for(int i=0; i < rozmiar; i++)
odwiedzony.dodaj(0);
//stos wierzcholkow sasiadujacych z juz odwiedzonymi wierzcholkami.
Stos< Wierzcholek* > stos;
//wierzcholek zdjety ze stosu.
Wierzcholek* biezacy = pierwszy;
//kolejny wierzcholek ciagu wierzcholkow grafu,
//uwzgledniony, aby nie pominac wierzcholkow izolowanych.
Wierzcholek* numerowany = pierwszy;
//zmienna pomocnicza stworzona dla przejrzystosci kodu
//wierzcholek sasiadujacy z biezacym
//dokladany na stos, jezeli nie zostal jeszcze odwiedzony.
Wierzcholek* sasiad = 0;
//elementow grafu jest dokladnie "rozmiar".
for( int i=0; i < rozmiar; i++, numerowany=numerowany->nastepny )
{
cout << "plus: " << numerowany->klucz << endl;
if( odwiedzony[numerowany->pozycja] )
continue;
stos.doloz( numerowany );
while( !stos.jest_pusty() )
{
biezacy = stos.zdejmij();
if ( odwiedzony[biezacy->pozycja] )
continue;
else
odwiedzony[biezacy->pozycja] = true;
if( strcmp(biezacy->klucz, klucz) == 0 )
{
cout << endl;
return biezacy;
}
//sasiadow jest dokladnie "sasiedztwo".
for( int j=0; j < biezacy->sasiedztwo; j++)
{
sasiad = biezacy->sasiedzi[j];
if( !odwiedzony[sasiad->pozycja] )
stos.doloz(sasiad);
}
}
}
cout << endl;
return 0;
}
Here are the files for Stack (here as "Stos") and Dynamically Allocated Table (here as "TabDyn")
#ifndef STOS_H
#define STOS_H
template<typename T> class TabDyn;
template<typename T>
class Stos
{
private:
/*pola*/
TabDyn<T>* pula;
public:
/*konstruktory*/
Stos(void);
Stos(int);
~Stos(void);
/*metody*/
void wyczysc(void);
bool jest_pusty(void) const;
T& top(void);
T zdejmij(void);
void doloz(const T&);
};
#include "Stos.tcc"
#endif
//Stos.tcc
#ifndef STOS_TCC
#define STOS_TCC
#include "TabDyn.h"
template<typename T>
Stos<T>::Stos(void)
{
pula = new TabDyn<T>;
}
template<typename T>
Stos<T>::Stos(int rozmiar)
{
pula = new TabDyn<T>(rozmiar);
}
template<typename T>
Stos<T>::~Stos(void)
{
delete pula;
}
template<typename T>
void Stos<T>::wyczysc(void)
{
pula->wyczysc();
}
template<typename T>
bool Stos<T>::jest_pusty(void) const
{
return pula->jest_pusty();
}
template<typename T>
T& Stos<T>::top(void)
{
return pula->koniec();
}
template<typename T>
T Stos<T>::zdejmij(void)
{
//nalezy uprzednio sprawdzic czy stos nie jest pusty!
T el = pula->koniec();
pula->usun();
return el;
}
template<typename T>
void Stos<T>::doloz(const T& el)
{
pula->dodaj( el );
}
#endif
//TabDyn.h
#ifndef TABDYN_H
#define TABDYN_H
using namespace std;
int const STD_ROZMIAR = 50;
/*###########################################################*/
template<typename T>
class TabDyn
{
private:
/*pola*/
int max_rozmiar;
int akt_rozmiar;
T *przydzial_pamieci;
public:
/*metody*/
TabDyn(int rozmiar = STD_ROZMIAR);
T& operator[](int i);
//usuwa stary przydzial pamieci i nadaje nowy
bool zarezerwuj(int);
//chyba: wyjebac stary przydzial i przydzielic nowy
void wyczysc(void);
//sprawdzic akt_rozmiar
bool jest_pusty(void);
//wskaznik na poczatek plus akt_rozmiar
T& koniec(void);
bool usun(void); //!!! pop_back
// void doloz_nkoniec( const T& ); //!!! push_back
void dodaj( const T& ); //!!! push_back
};
#include "TabDyn.tcc"
#endif
//TabDyn.tcc
#ifndef TABDYN_TPP
#define TABDYN_TPP
#include <iostream>
/*###########################################################*/
template<typename T>
TabDyn<T>::TabDyn(int rozmiar)
{
przydzial_pamieci = new T [rozmiar*sizeof(T)];
max_rozmiar = rozmiar;
akt_rozmiar = 0;
}
template<typename T>
T& TabDyn<T>::operator[](int i)
{
if( i >= 0 && i < akt_rozmiar )
{
return *(przydzial_pamieci + i);
}
cout << "Blad: Zarzadano wartosci tablicy dynamicznej spoza zakresu. Podano wartosc ostatniego elementu.\n";
return *(przydzial_pamieci + akt_rozmiar);
}
template<typename T>
bool TabDyn<T>::zarezerwuj(int wolumen)
{
if ( max_rozmiar == wolumen )
return true;
if ( wolumen < akt_rozmiar )
{
cout << "Blad: Nowy zadany rozmiar tablicy dynamicznej nie jest w stanie pomiescic elementow, ktore juz sie w niej znajduja. Odmowa wykonania operacji. " << endl;
return false;
}
T *npamiec = new T [wolumen*sizeof(T)];
if ( ! jest_pusty() )
{
for( int i=0; i < akt_rozmiar; i++ )
{
*(npamiec + i) = *(przydzial_pamieci + i);
}
}
max_rozmiar = wolumen;
delete [] przydzial_pamieci;
przydzial_pamieci = npamiec;
return true;
}
template<typename T>
void TabDyn<T>::wyczysc(void)
{
delete [] przydzial_pamieci;
przydzial_pamieci = new T [max_rozmiar*sizeof(T)];
}
template<typename T>
bool TabDyn<T>::jest_pusty(void)
{
return !akt_rozmiar;
}
//zwraca ostatni element tablicy
template<typename T>
T& TabDyn<T>::koniec(void)
{
T& ans = *(przydzial_pamieci + akt_rozmiar - 1);
if( !akt_rozmiar )
std::cout << "Blad, stos jest pusty.\n";
return ans;
}
//usuwa ostatni element tablicy
template<typename T>
bool TabDyn<T>::usun(void)
{
if ( akt_rozmiar == 0 )
{
std::cout << "Blad: Nie mam co usunac.\n";
return false;
}
akt_rozmiar--;
return true;
}
//dodaje ostatni element tablicy
template<typename T>
void TabDyn<T>::dodaj( const T& el )
{
if ( akt_rozmiar + 1 > max_rozmiar )
{
cout << "Uwaga: przekroczono rozmiar tablicy dynamicznej. Zostanie przydzielona nowa wielkosc." << endl;
zarezerwuj(max_rozmiar+1);
}
*(przydzial_pamieci + akt_rozmiar++) = el;
}
#endif
| c++ | segmentation-fault | null | null | null | 05/28/2012 08:44:45 | too localized | Segmentation fault at the end of the program
===
I have a segmentation fault problem occurring at the very end of my program. Everything works as expected except for the sole error message. And the one appears only if I choose the second option form my menu (see menu.cpp below) which calls for one graph class method (see in Graf.cpp - "odszukaj_dfs"). After completing all tasks it exits then with an above mentioned error.
I would appreciate for any hint on what is wrong. Please let me know if you need more pieces of my code to solve it, I didn't post all of it in order not to make my post too bloated. Secondly, forgive for not using English in my code - the project is for my University and I had to stick to my native tongue. Thank you in advance.
As to what the program itself is to do - it is to read a graph from a file and be able to perform a depth-first search on it. The problem occurs while doing the latter.
//main.cpp
#include <iostream>
#include "wczytywanie_grafu/wczytaj_nazwe_pliku.h"
#include "wczytywanie_grafu/wczytaj_graf.h"
#include "menu/menu.h"
#include "graf_struktura/Graf.h"
int main( int argc, char *argv[] )
{
using namespace std;
const char* npliku = wczytaj_nazwe_pliku( argc, argv );
if( npliku != 0 )
{
Graf *g = poprosze_graf(npliku);
while( menu(*g) );
delete g;
}
cout << "Do widzenia.\n";
return 0;
}
Here is where the problem occurs:
//menu.cpp
#include "menu.h"
#include <iostream>
//wyswietla menu dostepnych operacji na poprawnie wczytanym grafie.
bool menu(Graf &g)
{
using namespace std;
int i;
char *token;
cout << endl;
cout << "Jaka operacje wykonac na wczytanym grafie?\n";
cout << endl;
cout << "1) Wyswietlic schemat.\n";
cout << "2) Wyszukac wierzcholek metoda DFS.\n";
cout << "3) Wczytac inny graf.\n";
cout << "4) Opuscic program.\n";
cout << endl;
cout << "Prosze o wybor jednej z powyzszych opcji. ";
while( !(cin >> i) || i < 1 || i > 4 )
{
cin.clear();
cin.ignore(1000, '\n');
cout << "\nBlad. Prosze podac desygnujaca odpowiedz liczbe z podanego zakresu. ";
}
cout << endl;
switch( i )
{
case 1 :
g.wyswietl();
break;
case 2 :
cout << "Prosze podac nazwe szukanego wierzcholka. ";
cin >> token;
cout << "Odwiedzone wierzcholki: ";
if( g.odszukaj_dfs(token) == 0 )
cout << "\nNie odnaleziono wierzcholka " << token << ".\n";
else
cout << "\nOdnaleziono wierzcholek " << token << ".\n";
break;
// case 3 :
//
// break;
case 4 :
return false;
}
return true;
}
Here are the graph definitions ("Graf" is for graph and "Wierzcholek" for its node)
//Graf.cpp
#include "Graf.h"
#include "../lifo/TabDyn.h"
#include "../lifo/Stos.h"
#include <cstring>
/*###########################################################*/
/*####################### WIERZCHOLEK #######################*/
/*###########################################################*/
/*konstruktory*/
Wierzcholek::Wierzcholek(void)
{
sasiedztwo = -1;
nastepny = poprzedni = 0;
sasiedzi = new Wierzcholek* [1*sizeof(Wierzcholek*)];
}
Wierzcholek::Wierzcholek(char* k)
{
klucz = k;
//wierzcholek izolowany grafu.
sasiedztwo = 0;
nastepny = poprzedni = 0;
sasiedzi = new Wierzcholek* [1*sizeof(Wierzcholek*)];
}
Wierzcholek::Wierzcholek(char* k, int s)
{
klucz = k; sasiedztwo = s;
nastepny = poprzedni = 0;
//przygotowanie tablicy sasiadow o stosownym rozmiarze
sasiedzi = new Wierzcholek* [s*sizeof(Wierzcholek*)];
}
Wierzcholek::Wierzcholek(char* k, int s, Wierzcholek** &n)
{
//typowy wierzcholek grafu.
klucz = k; sasiedztwo = s; sasiedzi = n;
nastepny = poprzedni = 0;
}
Wierzcholek::Wierzcholek(char* k, int s, Wierzcholek** &n, Wierzcholek* &nast , Wierzcholek* &poprz)
{
//typowy wierzcholek grafu.
klucz = k; sasiedztwo = s; sasiedzi = n;
nastepny = nast; poprzedni = poprz;
}
/*przeciazenia i metody*/
//relacja rownowaznosci obiektow oparta na identycznosci kluczy
bool Wierzcholek::operator==(Wierzcholek const &prawy) const
{
if ( klucz == prawy.klucz )
return true;
else
return false;
}
void Wierzcholek::okresl_ilosc_sasiadow(int n)
{
delete [] sasiedzi;
sasiedzi = new Wierzcholek* [n*sizeof(Wierzcholek)];
sasiedztwo = n;
}
/*###########################################################*/
/*########################### GRAF ##########################*/
/*###########################################################*/
/*konstruktor*/
Graf::Graf(void)
{
pierwszy = ostatni = 0;
rozmiar = 0;
}
/*metody*/
void Graf::dodaj(Wierzcholek* w)
{
if ( pierwszy != 0 )
{
w->poprzedni = ostatni;
ostatni = w;
ostatni->poprzedni->nastepny = ostatni;
}
else
pierwszy = ostatni = w;
ostatni->pozycja = rozmiar++;
}
void Graf::wyswietl(void)
{
using namespace std;
Wierzcholek *n = pierwszy;
for( int j=0; j < rozmiar; n = n->nastepny)
{
cout << n->klucz << " :";
for( int i=0; i < n->sasiedztwo; i++ )
cout << " " << n->sasiedzi[i]->klucz;
cout << " ;\n";
j++;
}
return;
}
int Graf::podaj_rozmiar(void)
{
return rozmiar;
}
Wierzcholek* Graf::odszukaj_dfs(char* &klucz)
{
using namespace std;
//tablica przyporzadkowujaca kazdemu kolejnemu wierzcholkowi grafu
//binarna wartosc oznaczajaca fakt odwiedzenia wierzcholka przez algorytm.
TabDyn<bool> odwiedzony;
for(int i=0; i < rozmiar; i++)
odwiedzony.dodaj(0);
//stos wierzcholkow sasiadujacych z juz odwiedzonymi wierzcholkami.
Stos< Wierzcholek* > stos;
//wierzcholek zdjety ze stosu.
Wierzcholek* biezacy = pierwszy;
//kolejny wierzcholek ciagu wierzcholkow grafu,
//uwzgledniony, aby nie pominac wierzcholkow izolowanych.
Wierzcholek* numerowany = pierwszy;
//zmienna pomocnicza stworzona dla przejrzystosci kodu
//wierzcholek sasiadujacy z biezacym
//dokladany na stos, jezeli nie zostal jeszcze odwiedzony.
Wierzcholek* sasiad = 0;
//elementow grafu jest dokladnie "rozmiar".
for( int i=0; i < rozmiar; i++, numerowany=numerowany->nastepny )
{
cout << "plus: " << numerowany->klucz << endl;
if( odwiedzony[numerowany->pozycja] )
continue;
stos.doloz( numerowany );
while( !stos.jest_pusty() )
{
biezacy = stos.zdejmij();
if ( odwiedzony[biezacy->pozycja] )
continue;
else
odwiedzony[biezacy->pozycja] = true;
if( strcmp(biezacy->klucz, klucz) == 0 )
{
cout << endl;
return biezacy;
}
//sasiadow jest dokladnie "sasiedztwo".
for( int j=0; j < biezacy->sasiedztwo; j++)
{
sasiad = biezacy->sasiedzi[j];
if( !odwiedzony[sasiad->pozycja] )
stos.doloz(sasiad);
}
}
}
cout << endl;
return 0;
}
Here are the files for Stack (here as "Stos") and Dynamically Allocated Table (here as "TabDyn")
#ifndef STOS_H
#define STOS_H
template<typename T> class TabDyn;
template<typename T>
class Stos
{
private:
/*pola*/
TabDyn<T>* pula;
public:
/*konstruktory*/
Stos(void);
Stos(int);
~Stos(void);
/*metody*/
void wyczysc(void);
bool jest_pusty(void) const;
T& top(void);
T zdejmij(void);
void doloz(const T&);
};
#include "Stos.tcc"
#endif
//Stos.tcc
#ifndef STOS_TCC
#define STOS_TCC
#include "TabDyn.h"
template<typename T>
Stos<T>::Stos(void)
{
pula = new TabDyn<T>;
}
template<typename T>
Stos<T>::Stos(int rozmiar)
{
pula = new TabDyn<T>(rozmiar);
}
template<typename T>
Stos<T>::~Stos(void)
{
delete pula;
}
template<typename T>
void Stos<T>::wyczysc(void)
{
pula->wyczysc();
}
template<typename T>
bool Stos<T>::jest_pusty(void) const
{
return pula->jest_pusty();
}
template<typename T>
T& Stos<T>::top(void)
{
return pula->koniec();
}
template<typename T>
T Stos<T>::zdejmij(void)
{
//nalezy uprzednio sprawdzic czy stos nie jest pusty!
T el = pula->koniec();
pula->usun();
return el;
}
template<typename T>
void Stos<T>::doloz(const T& el)
{
pula->dodaj( el );
}
#endif
//TabDyn.h
#ifndef TABDYN_H
#define TABDYN_H
using namespace std;
int const STD_ROZMIAR = 50;
/*###########################################################*/
template<typename T>
class TabDyn
{
private:
/*pola*/
int max_rozmiar;
int akt_rozmiar;
T *przydzial_pamieci;
public:
/*metody*/
TabDyn(int rozmiar = STD_ROZMIAR);
T& operator[](int i);
//usuwa stary przydzial pamieci i nadaje nowy
bool zarezerwuj(int);
//chyba: wyjebac stary przydzial i przydzielic nowy
void wyczysc(void);
//sprawdzic akt_rozmiar
bool jest_pusty(void);
//wskaznik na poczatek plus akt_rozmiar
T& koniec(void);
bool usun(void); //!!! pop_back
// void doloz_nkoniec( const T& ); //!!! push_back
void dodaj( const T& ); //!!! push_back
};
#include "TabDyn.tcc"
#endif
//TabDyn.tcc
#ifndef TABDYN_TPP
#define TABDYN_TPP
#include <iostream>
/*###########################################################*/
template<typename T>
TabDyn<T>::TabDyn(int rozmiar)
{
przydzial_pamieci = new T [rozmiar*sizeof(T)];
max_rozmiar = rozmiar;
akt_rozmiar = 0;
}
template<typename T>
T& TabDyn<T>::operator[](int i)
{
if( i >= 0 && i < akt_rozmiar )
{
return *(przydzial_pamieci + i);
}
cout << "Blad: Zarzadano wartosci tablicy dynamicznej spoza zakresu. Podano wartosc ostatniego elementu.\n";
return *(przydzial_pamieci + akt_rozmiar);
}
template<typename T>
bool TabDyn<T>::zarezerwuj(int wolumen)
{
if ( max_rozmiar == wolumen )
return true;
if ( wolumen < akt_rozmiar )
{
cout << "Blad: Nowy zadany rozmiar tablicy dynamicznej nie jest w stanie pomiescic elementow, ktore juz sie w niej znajduja. Odmowa wykonania operacji. " << endl;
return false;
}
T *npamiec = new T [wolumen*sizeof(T)];
if ( ! jest_pusty() )
{
for( int i=0; i < akt_rozmiar; i++ )
{
*(npamiec + i) = *(przydzial_pamieci + i);
}
}
max_rozmiar = wolumen;
delete [] przydzial_pamieci;
przydzial_pamieci = npamiec;
return true;
}
template<typename T>
void TabDyn<T>::wyczysc(void)
{
delete [] przydzial_pamieci;
przydzial_pamieci = new T [max_rozmiar*sizeof(T)];
}
template<typename T>
bool TabDyn<T>::jest_pusty(void)
{
return !akt_rozmiar;
}
//zwraca ostatni element tablicy
template<typename T>
T& TabDyn<T>::koniec(void)
{
T& ans = *(przydzial_pamieci + akt_rozmiar - 1);
if( !akt_rozmiar )
std::cout << "Blad, stos jest pusty.\n";
return ans;
}
//usuwa ostatni element tablicy
template<typename T>
bool TabDyn<T>::usun(void)
{
if ( akt_rozmiar == 0 )
{
std::cout << "Blad: Nie mam co usunac.\n";
return false;
}
akt_rozmiar--;
return true;
}
//dodaje ostatni element tablicy
template<typename T>
void TabDyn<T>::dodaj( const T& el )
{
if ( akt_rozmiar + 1 > max_rozmiar )
{
cout << "Uwaga: przekroczono rozmiar tablicy dynamicznej. Zostanie przydzielona nowa wielkosc." << endl;
zarezerwuj(max_rozmiar+1);
}
*(przydzial_pamieci + akt_rozmiar++) = el;
}
#endif
| 3 |
6,793,599 | 07/22/2011 17:12:53 | 223,130 | 12/02/2009 18:23:07 | 1,280 | 45 | c#: why to use DLL | i'm working on a large c# project,i wonder why people use DLLs in their apps. I know that a dll file ( please correct if i'm wrong) contains some functions, but why don't we put those functions inside our main c# app?
Thanks | c# | dll | null | null | null | null | open | c#: why to use DLL
===
i'm working on a large c# project,i wonder why people use DLLs in their apps. I know that a dll file ( please correct if i'm wrong) contains some functions, but why don't we put those functions inside our main c# app?
Thanks | 0 |
7,497,611 | 09/21/2011 09:35:06 | 956,583 | 09/21/2011 09:35:06 | 1 | 0 | Abstract and Interfaces help? | I am supposed to make a program that gets the highest and lowest value of 5 input numbers. However, I need to make use of abstract, varArgs, and interfaces. How do I use abstract and interface in the program? Can anyone give me an idea? Please and thank you. | java | homework | class | null | null | 09/21/2011 16:26:36 | not a real question | Abstract and Interfaces help?
===
I am supposed to make a program that gets the highest and lowest value of 5 input numbers. However, I need to make use of abstract, varArgs, and interfaces. How do I use abstract and interface in the program? Can anyone give me an idea? Please and thank you. | 1 |
2,512,601 | 03/25/2010 01:31:12 | 301,352 | 03/25/2010 01:31:12 | 1 | 0 | Core data and @unionOfSets | Im having trouble using the @unionOfSets on my core-data objects.
NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement"]);
Prints the set of listElements as expected
2010-03-24 18:11:15.844 Pirouette[7459:80f] Relationship objects for {(
<PRPlaylistElement: 0x10484c0> (entity: PRPlaylistElement; id: 0x10a71b0 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p108> ; data: <fault>),
<PRPlaylistElement: 0x1048a10> (entity: PRPlaylistElement; id: 0x10ac7d0 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p153> ; data: <fault>),
<PRPlaylistElement: 0x1048460> (entity: PRPlaylistElement; id: 0x10acf60 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p157> ; data: <fault>),
<PRPlaylistElement: 0x1047c60> (entity: PRPlaylistElement; id: 0x10a6850 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p105> ; data: <fault>)
However when I try to get the set of file objects for each of the list elements.
NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement.@unionOfArrays.file"]);
I get the following error
2010-03-24 18:16:45.843 Pirouette[7505:80f] An uncaught exception was raised
2010-03-24 18:16:45.844 Pirouette[7505:80f] [<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.
2010-03-24 18:16:45.847 Pirouette[7505:80f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.'
Confused because I thought to-many relationships in core-data were NSSets. | core-data | cocoa | null | null | null | null | open | Core data and @unionOfSets
===
Im having trouble using the @unionOfSets on my core-data objects.
NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement"]);
Prints the set of listElements as expected
2010-03-24 18:11:15.844 Pirouette[7459:80f] Relationship objects for {(
<PRPlaylistElement: 0x10484c0> (entity: PRPlaylistElement; id: 0x10a71b0 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p108> ; data: <fault>),
<PRPlaylistElement: 0x1048a10> (entity: PRPlaylistElement; id: 0x10ac7d0 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p153> ; data: <fault>),
<PRPlaylistElement: 0x1048460> (entity: PRPlaylistElement; id: 0x10acf60 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p157> ; data: <fault>),
<PRPlaylistElement: 0x1047c60> (entity: PRPlaylistElement; id: 0x10a6850 <x-coredata://1EE9CEAD-E006-4487-8AA7-47764B87A91C/PRPlaylistElement/p105> ; data: <fault>)
However when I try to get the set of file objects for each of the list elements.
NSLog(@"%@", [NSApp valueForKeyPath:@"delegate.mainWindowController.sidebarViewController.arrayController.selection.list.listElement.@unionOfArrays.file"]);
I get the following error
2010-03-24 18:16:45.843 Pirouette[7505:80f] An uncaught exception was raised
2010-03-24 18:16:45.844 Pirouette[7505:80f] [<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.
2010-03-24 18:16:45.847 Pirouette[7505:80f] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<NSCFSet 0x10415e0> valueForKeyPath:]: this class does not implement the unionOfArrays operation.'
Confused because I thought to-many relationships in core-data were NSSets. | 0 |
7,810,550 | 10/18/2011 16:25:18 | 509,600 | 11/16/2010 14:03:23 | 1,029 | 33 | Specify generics class where T should be subclass of other type | Here is what I'm trying to do, not even sure if possible..
I'm creating `BaseViewModel<T>` and I want it to accept types inherited from `Entity`
Consider this code:
public abstract class BaseViewModel<T> : NotificationObject, INavigationAware
{
public T MyEntity;
public SomeMethod()
{
MyEntity.SomeEntityProperty = SomeValue;
}
}
So, I want to say that my `T` inherited from `Entity` and therefore I KNOW that it will have SomeEntityProperty.
Is this possible? | c# | generics | null | null | null | null | open | Specify generics class where T should be subclass of other type
===
Here is what I'm trying to do, not even sure if possible..
I'm creating `BaseViewModel<T>` and I want it to accept types inherited from `Entity`
Consider this code:
public abstract class BaseViewModel<T> : NotificationObject, INavigationAware
{
public T MyEntity;
public SomeMethod()
{
MyEntity.SomeEntityProperty = SomeValue;
}
}
So, I want to say that my `T` inherited from `Entity` and therefore I KNOW that it will have SomeEntityProperty.
Is this possible? | 0 |
10,329,088 | 04/26/2012 07:35:54 | 1,185,798 | 02/02/2012 17:47:09 | 1 | 0 | Wakoopa tracker does not see a running IDE | Wakoopa tracker does not see a running IDE Eclipse and NetBeanse. I use the Eclipse for at least ten hours a day. OS Windows XP SP3.
P.S.: Screenshot ([link][1]).
[1]: https://d37wxxhohlp07s.cloudfront.net/s3_images/727236/wakoopa.JPG?1334681409 | eclipse | null | null | null | null | 04/26/2012 13:13:39 | not a real question | Wakoopa tracker does not see a running IDE
===
Wakoopa tracker does not see a running IDE Eclipse and NetBeanse. I use the Eclipse for at least ten hours a day. OS Windows XP SP3.
P.S.: Screenshot ([link][1]).
[1]: https://d37wxxhohlp07s.cloudfront.net/s3_images/727236/wakoopa.JPG?1334681409 | 1 |
1,077,358 | 07/03/2009 00:30:33 | 126,680 | 06/22/2009 04:25:12 | 11 | 0 | What's the best way to setup a java application? | I'm starting an open source Java project and I need a few bits of advice.
1. Should I use an IDE such as Netbeans to create the UI (swing) or should I do it by hand. Is there an easy way to do GUI using the Eclipse IDE?
2. What's a good way to do the file structure? workspace/PROJECT/? Like where should I place the main class? | java | setup | open-source | null | null | null | open | What's the best way to setup a java application?
===
I'm starting an open source Java project and I need a few bits of advice.
1. Should I use an IDE such as Netbeans to create the UI (swing) or should I do it by hand. Is there an easy way to do GUI using the Eclipse IDE?
2. What's a good way to do the file structure? workspace/PROJECT/? Like where should I place the main class? | 0 |
11,163,321 | 06/22/2012 20:03:44 | 1,473,061 | 06/21/2012 18:44:21 | 31 | 7 | How to hire for small php mod? | Hey guys I'm looking for a little help sorting products in Opencart differently. I think the question and code is too long to put on Stack Overflow so I'm looking for someone to do that small chunk for me for a fee.
1) Where's the best place to hire for a small mod?
2) Are any of you up for it? | php | sorting | payment | product | opencart | 06/23/2012 00:46:03 | off topic | How to hire for small php mod?
===
Hey guys I'm looking for a little help sorting products in Opencart differently. I think the question and code is too long to put on Stack Overflow so I'm looking for someone to do that small chunk for me for a fee.
1) Where's the best place to hire for a small mod?
2) Are any of you up for it? | 2 |
9,866,264 | 03/26/2012 03:27:56 | 1,290,668 | 03/25/2012 00:13:08 | 1 | 0 | WARNING: Cucumber-rails required outside of env.rb |
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.17
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.3.0]
- INSTALLATION DIRECTORY: /Users/user1/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /Users/user1/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/user1/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/user1/.rvm/gems/ruby-1.9.2-p290
- /Users/user1/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
After I ran the rake db:migrate command it gives me this message:
rake --trace db:migrate
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant User
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `constantize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:293:in `get'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:77:in `to'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:72:in `modules'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:89:in `routes'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:156:in `default_used_route'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:66:in `initialize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:327:in `new'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:327:in `add_mapping'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:206:in `block in devise_for'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:205:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:205:in `devise_for'
/Users/user1/pachamama/config/routes.rb:4:in `block in <top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:272:in `instance_exec'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:272:in `eval_block'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:249:in `draw'
/Users/user1/pachamama/config/routes.rb:1:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/file_update_checker.rb:78:in `call'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/file_update_checker.rb:78:in `execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:27:in `updater'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/user1/pachamama/config/environment.rb:5:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment
| ruby | cucumber | null | null | null | null | open | WARNING: Cucumber-rails required outside of env.rb
===
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.17
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-darwin11.3.0]
- INSTALLATION DIRECTORY: /Users/user1/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /Users/user1/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /Users/user1/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-11
- GEM PATHS:
- /Users/user1/.rvm/gems/ruby-1.9.2-p290
- /Users/user1/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
After I ran the rake db:migrate command it gives me this message:
rake --trace db:migrate
WARNING: Cucumber-rails required outside of env.rb. The rest of loading is being defered until env.rb is called.
To avoid this warning, move 'gem cucumber-rails' under only group :test in your Gemfile
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
uninitialized constant User
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:226:in `block in constantize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/inflector/methods.rb:225:in `constantize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:293:in `get'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:77:in `to'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:72:in `modules'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:89:in `routes'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:156:in `default_used_route'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/mapping.rb:66:in `initialize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:327:in `new'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise.rb:327:in `add_mapping'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:206:in `block in devise_for'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:205:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/devise-2.0.4/lib/devise/rails/routes.rb:205:in `devise_for'
/Users/user1/pachamama/config/routes.rb:4:in `block in <top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:272:in `instance_exec'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:272:in `eval_block'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:249:in `draw'
/Users/user1/pachamama/config/routes.rb:1:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `block in load_paths'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:40:in `load_paths'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:16:in `reload!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:26:in `block in updater'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/file_update_checker.rb:78:in `call'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.2.0/lib/active_support/file_update_checker.rb:78:in `execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:27:in `updater'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/routes_reloader.rb:7:in `execute_if_updated'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application/finisher.rb:67:in `block in <module:Finisher>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `instance_exec'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `block in run_initializers'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
/Users/user1/pachamama/config/environment.rb:5:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/railties-3.2.0/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/Users/user1/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `load'
/Users/user1/.rvm/gems/ruby-1.9.2-p290/bin/rake:19:in `<main>'
Tasks: TOP => db:migrate => environment
| 0 |
8,582,556 | 12/20/2011 22:02:06 | 1,099,531 | 12/15/2011 09:29:57 | 15 | 0 | Searching for unread posts in a database | Everytime a user reads a post, it assigns a cookie, eg.
set_cookies($id,'read',60*60*24);
But the problem is how do i select all the posts that hasn't been read by the user?
SELECT * from posts where (post is unread)
It doesn't require a login. | php | mysql | cookies | null | null | null | open | Searching for unread posts in a database
===
Everytime a user reads a post, it assigns a cookie, eg.
set_cookies($id,'read',60*60*24);
But the problem is how do i select all the posts that hasn't been read by the user?
SELECT * from posts where (post is unread)
It doesn't require a login. | 0 |
41,056 | 09/03/2008 02:18:15 | 4,343 | 09/02/2008 23:19:17 | 1 | 1 | Best java tools for emacs | I'm a long-time emacs user, and I'm now working about 1/2 time in Java.
What are the best emacs libraries for
1. Debugging Java
2. Code Completion/Intellisense
3. Javadoc browsing
? | java | ide | debugging | emacs | javadoc | 09/03/2011 23:18:27 | not constructive | Best java tools for emacs
===
I'm a long-time emacs user, and I'm now working about 1/2 time in Java.
What are the best emacs libraries for
1. Debugging Java
2. Code Completion/Intellisense
3. Javadoc browsing
? | 4 |
3,544,965 | 08/23/2010 05:34:43 | 466,534 | 04/21/2010 12:03:08 | 1,311 | 10 | usage of tellp in c++ | i have some misunderstanding about tellp, seekg ... functions for example when i run following code
#include <iostream>
#include <ostream>
#include <fstream>
using namespace std;
int main(){
string s("in georgia we are friend to each other");
ofstream out("output.txt");
for (int i=0;i<s.length();i++){
cout<<"file pointer"<<out.tellp();
out.put(s[i]);
cout<<" " <<s[i]<<endl;
}
out.close();
return 0;
}
the result is following
pointer 0
pointer 1 i
pointer2 n
pointer 3
pointer 4 -g
........
and so on . as i understand first pointer 0 it is pointer just file then points to first character in string and so on
now consider following code
#include <fstream>
using namespace std;
int main () {
long pos;
ofstream outfile;
outfile.open ("test.txt");
outfile.write ("This is an apple",16);
pos=outfile.tellp();
outfile.seekp (pos-7);
outfile.write (" sam",4);
outfile.close();
return 0;
}
it's result is
This is a sample
this line
pos=outfile.tellp(); i think gets pos to zero as in first example and this fragment what means `outfile.seekp (pos-7)?; pointer to -7 or?
please help
thanks`
| c++ | null | null | null | null | null | open | usage of tellp in c++
===
i have some misunderstanding about tellp, seekg ... functions for example when i run following code
#include <iostream>
#include <ostream>
#include <fstream>
using namespace std;
int main(){
string s("in georgia we are friend to each other");
ofstream out("output.txt");
for (int i=0;i<s.length();i++){
cout<<"file pointer"<<out.tellp();
out.put(s[i]);
cout<<" " <<s[i]<<endl;
}
out.close();
return 0;
}
the result is following
pointer 0
pointer 1 i
pointer2 n
pointer 3
pointer 4 -g
........
and so on . as i understand first pointer 0 it is pointer just file then points to first character in string and so on
now consider following code
#include <fstream>
using namespace std;
int main () {
long pos;
ofstream outfile;
outfile.open ("test.txt");
outfile.write ("This is an apple",16);
pos=outfile.tellp();
outfile.seekp (pos-7);
outfile.write (" sam",4);
outfile.close();
return 0;
}
it's result is
This is a sample
this line
pos=outfile.tellp(); i think gets pos to zero as in first example and this fragment what means `outfile.seekp (pos-7)?; pointer to -7 or?
please help
thanks`
| 0 |
9,166,170 | 02/06/2012 19:42:01 | 1,088,245 | 12/08/2011 17:31:28 | 6 | 0 | flash builder 4.6 (flex mobile): I need to get the absolute coordinates of some elements within ViewNavigator views | There may be something missing, but I'm having some real trouble with this.
I am inside a view, and I want to know the absolute (global?) coordinates of a certain element/component. I always get 0,0. In this example the view is under the actionbar so Y should be more than 0.
I need this because both stageWebView and stageVideo work with absolute coordinates, and I want to position them properly within a component.
Here's a code snippet. Please guide me where I'm wrong. And thanks a lot for any help!
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="test" added="view1_addedHandler(event)">
<fx:Script>
<![CDATA[
protected function view1_addedHandler(event:Event):void
{
// returns always 0 0. This object is under the action bar, Y should be greater than 0
var punto:Point = trozzo.contentToGlobal(new Point());
trace("global coordinates"+punto.x+"y:"+punto.y);
}
]]>
</fx:Script>
<s:BorderContainer width="100%" height="100%" id="trozzo">
</s:BorderContainer>
</s:View>
| flash | flex | mobile | builder | null | null | open | flash builder 4.6 (flex mobile): I need to get the absolute coordinates of some elements within ViewNavigator views
===
There may be something missing, but I'm having some real trouble with this.
I am inside a view, and I want to know the absolute (global?) coordinates of a certain element/component. I always get 0,0. In this example the view is under the actionbar so Y should be more than 0.
I need this because both stageWebView and stageVideo work with absolute coordinates, and I want to position them properly within a component.
Here's a code snippet. Please guide me where I'm wrong. And thanks a lot for any help!
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="test" added="view1_addedHandler(event)">
<fx:Script>
<![CDATA[
protected function view1_addedHandler(event:Event):void
{
// returns always 0 0. This object is under the action bar, Y should be greater than 0
var punto:Point = trozzo.contentToGlobal(new Point());
trace("global coordinates"+punto.x+"y:"+punto.y);
}
]]>
</fx:Script>
<s:BorderContainer width="100%" height="100%" id="trozzo">
</s:BorderContainer>
</s:View>
| 0 |
908,299 | 05/25/2009 22:44:07 | 62,958 | 02/05/2009 16:55:30 | 65 | 4 | Average instruction time | Lets say we have an average of one page fault every 20,000,000 instructions, a normal instruction takes 2 nanoseconds, and a page fault causes the instruction to take an additional 10 milliseconds. What is the average instruction time, taking page faults into account???????????/ | operating-system | null | null | null | null | null | open | Average instruction time
===
Lets say we have an average of one page fault every 20,000,000 instructions, a normal instruction takes 2 nanoseconds, and a page fault causes the instruction to take an additional 10 milliseconds. What is the average instruction time, taking page faults into account???????????/ | 0 |
7,432,678 | 09/15/2011 14:38:43 | 319,297 | 04/17/2010 16:04:06 | 33 | 0 | Rails3 Why is my HTTP_COOKIE getting escaped? | Some time when i try to read HTTP_COOKIES e.g. env["HTTP_COOKIE"] this string is encoded. Can anyone explain me what could be the possible reasons?
Thanks | ruby-on-rails-3 | null | null | null | null | null | open | Rails3 Why is my HTTP_COOKIE getting escaped?
===
Some time when i try to read HTTP_COOKIES e.g. env["HTTP_COOKIE"] this string is encoded. Can anyone explain me what could be the possible reasons?
Thanks | 0 |
11,740,423 | 07/31/2012 12:47:04 | 1,530,972 | 07/17/2012 07:22:58 | 1 | 0 | Prefferable PHP Framework to develop quiz system | I want to develop online quiz system.
my requirement is to display random question in quiz and the question must also contain pictures and videos as well. at the end of the completion it should send mail to user of overall result. and i also want to integrate payment gateway.
i want a help to figure out that which PHP module will be preferable to develop this .
I think joomla would be the good to prefer but, still not sure that which should choose.
Any kind suggestions are welcomes. | php | mysql | null | null | null | 07/31/2012 12:50:36 | not constructive | Prefferable PHP Framework to develop quiz system
===
I want to develop online quiz system.
my requirement is to display random question in quiz and the question must also contain pictures and videos as well. at the end of the completion it should send mail to user of overall result. and i also want to integrate payment gateway.
i want a help to figure out that which PHP module will be preferable to develop this .
I think joomla would be the good to prefer but, still not sure that which should choose.
Any kind suggestions are welcomes. | 4 |
2,145,846 | 01/27/2010 09:54:31 | 169,992 | 09/08/2009 06:08:26 | 886 | 34 | Who Creates Custom ActionMailer Layouts in Rails, You or the Client? | When projects get large, I imagine you might start having 100s of mailer templates:
- user_signup_confirmation.html.erb
- user_signup_failure.html.erb
- user_account_activation.html.erb
- user_account_cancelation.html.erb
...
What is your workflow for handling this? Do you have them email you what they want and then you mold it into a method and a template? Or have you devised some sort of builder, or know of one, you'd like to share? Or do you just have the client edit the ERB templates?
| actionmailer | ruby-on-rails | erb | templates | workflow | null | open | Who Creates Custom ActionMailer Layouts in Rails, You or the Client?
===
When projects get large, I imagine you might start having 100s of mailer templates:
- user_signup_confirmation.html.erb
- user_signup_failure.html.erb
- user_account_activation.html.erb
- user_account_cancelation.html.erb
...
What is your workflow for handling this? Do you have them email you what they want and then you mold it into a method and a template? Or have you devised some sort of builder, or know of one, you'd like to share? Or do you just have the client edit the ERB templates?
| 0 |
8,340,980 | 12/01/2011 11:57:46 | 1,075,359 | 12/01/2011 11:45:30 | 1 | 0 | Android : How to make ScrollBar To Drag from one point to another if List is Large ,Like in browser we used to do | Android : How to make ScrollBar To Drag from one point to another if List is Large ,Like in browser we used to do
what attributes to add to make the scrollbar draggable by using touch | android | null | null | null | null | 12/01/2011 20:21:41 | not a real question | Android : How to make ScrollBar To Drag from one point to another if List is Large ,Like in browser we used to do
===
Android : How to make ScrollBar To Drag from one point to another if List is Large ,Like in browser we used to do
what attributes to add to make the scrollbar draggable by using touch | 1 |
2,380,346 | 03/04/2010 15:16:53 | 195,456 | 10/23/2009 16:47:27 | 108 | 11 | Is there a way to create a custom HTML validation schema for Visual Studio? | <p> Is there a way to add custom HTML validation schemes to Visual Studio? </p>
<p> If so, is there a resource to download schemes? </p>
<img src="http://kennethdjones.com/public/htmlvsdd.png">
<p><i>Note IE6 validation is there as a painful reminder</i><p/> | visual-studio | html-validation | xml-schema | html | html5 | null | open | Is there a way to create a custom HTML validation schema for Visual Studio?
===
<p> Is there a way to add custom HTML validation schemes to Visual Studio? </p>
<p> If so, is there a resource to download schemes? </p>
<img src="http://kennethdjones.com/public/htmlvsdd.png">
<p><i>Note IE6 validation is there as a painful reminder</i><p/> | 0 |
7,878,550 | 10/24/2011 16:07:02 | 199,111 | 10/29/2009 17:43:22 | 423 | 29 | How do you create an EditorTemplate in a Plugin for nopCommerce v2.20 | I'm trying to create a plugin for nopCommerce v2.20 that allows the user to request a quote for goods and services by describing the requirements and attaching any relevant documents.
I have started by using http://blog.csharpwebdeveloper.com/2011/09/10/writing-a-plugin-for-nopcommerce-2-x/ as a guide, this has been very good so far. My project is almost identical to the one in the blog post so I'll only add code snippets as I think they are required, so please ask me to expand and provide details if I have left anything important out.
Now I want to add a facility to upload multiple files using uploadify and have decided based on the existing code that I should create an EditorTemplate for attachments.
My problem is I can't work out how to setup my template in a way that can be located by the MVC framework when I use the following line of code to get the template.
<pre><code>@Html.EditorFor(m => m.Attachment)</code></pre>
In my model I’m using the UIHintAttribute("Attachments") on the Attachment property to identify the template with no noticeable effect.
I have created a folder below the "Views" folder called "EditorTemplates" and added a file called "Attachments.cshtml" with the build action set to "Embedded Resource", contents below:
<pre><code>@model int
@using Nop.Core;
@{
var randomNumber = CommonHelper.GenerateRandomInteger();
var clientId = "download" + randomNumber;
var downloadService = EngineContext.Current.Resolve<Nop.Services.Media.IDownloadService>();
var download = downloadService.GetDownloadById(Model);
}
<div>This is a download control @string.Format("randomNumber = {0}, clientId = {1}, download = {2}", randomNumber, clientId, download);</div></code></pre>
I intent to implement the template once I can get the MVC framework to resolve its location.
So is it possible to have an editor template in a plugin (a separate class library from the main project) and if so what do I need to do to enable the MVC framework to resolve my template location?
I'd also like to add I'm quite new to MVC, Razor, and nopCommerce, sorry in advance if I missed something obvious.
As a side, could you suggest a better title for my question as stackoverflow tells me that it appears subjective?
thanks | asp.net-mvc | asp.net-mvc-3 | razor | nopcommerce | null | null | open | How do you create an EditorTemplate in a Plugin for nopCommerce v2.20
===
I'm trying to create a plugin for nopCommerce v2.20 that allows the user to request a quote for goods and services by describing the requirements and attaching any relevant documents.
I have started by using http://blog.csharpwebdeveloper.com/2011/09/10/writing-a-plugin-for-nopcommerce-2-x/ as a guide, this has been very good so far. My project is almost identical to the one in the blog post so I'll only add code snippets as I think they are required, so please ask me to expand and provide details if I have left anything important out.
Now I want to add a facility to upload multiple files using uploadify and have decided based on the existing code that I should create an EditorTemplate for attachments.
My problem is I can't work out how to setup my template in a way that can be located by the MVC framework when I use the following line of code to get the template.
<pre><code>@Html.EditorFor(m => m.Attachment)</code></pre>
In my model I’m using the UIHintAttribute("Attachments") on the Attachment property to identify the template with no noticeable effect.
I have created a folder below the "Views" folder called "EditorTemplates" and added a file called "Attachments.cshtml" with the build action set to "Embedded Resource", contents below:
<pre><code>@model int
@using Nop.Core;
@{
var randomNumber = CommonHelper.GenerateRandomInteger();
var clientId = "download" + randomNumber;
var downloadService = EngineContext.Current.Resolve<Nop.Services.Media.IDownloadService>();
var download = downloadService.GetDownloadById(Model);
}
<div>This is a download control @string.Format("randomNumber = {0}, clientId = {1}, download = {2}", randomNumber, clientId, download);</div></code></pre>
I intent to implement the template once I can get the MVC framework to resolve its location.
So is it possible to have an editor template in a plugin (a separate class library from the main project) and if so what do I need to do to enable the MVC framework to resolve my template location?
I'd also like to add I'm quite new to MVC, Razor, and nopCommerce, sorry in advance if I missed something obvious.
As a side, could you suggest a better title for my question as stackoverflow tells me that it appears subjective?
thanks | 0 |
9,863,918 | 03/25/2012 20:49:05 | 93,647 | 04/21/2009 08:11:02 | 1,364 | 15 | How to "rethrow" event of private field? | I need to attach to event of the private field of the class like that:
MyClass myInstance = ...
...
myInstance.checkbook.RangeMissing += new EventHandler<RangeMissingEventArgs>(RangeMissing);
To do that I have to do `checkbook public`. However I want to keep `checkbook private`, I only want to catch "RangeMissing" event.
So I need kind of "rethrow" in MyClass class of event RangeMissing?
Of course I can do that "explicitly" (attach MyClass to checkbook, catch RangeMissing event, throw new RangeMissing event), but I think it's too complicated.
Do I have design problem? Should I make `checkbook` public? Should I just write 10 lines of extra code and just rethrow event explicitly in `MyClass` class? | c# | events | null | null | null | null | open | How to "rethrow" event of private field?
===
I need to attach to event of the private field of the class like that:
MyClass myInstance = ...
...
myInstance.checkbook.RangeMissing += new EventHandler<RangeMissingEventArgs>(RangeMissing);
To do that I have to do `checkbook public`. However I want to keep `checkbook private`, I only want to catch "RangeMissing" event.
So I need kind of "rethrow" in MyClass class of event RangeMissing?
Of course I can do that "explicitly" (attach MyClass to checkbook, catch RangeMissing event, throw new RangeMissing event), but I think it's too complicated.
Do I have design problem? Should I make `checkbook` public? Should I just write 10 lines of extra code and just rethrow event explicitly in `MyClass` class? | 0 |
5,309,319 | 03/15/2011 08:45:48 | 611,154 | 02/10/2011 10:07:30 | 3 | 2 | Skipping a command when app is freezing | How can I handle the problem when in my app somebody set a wrong IP address to socket communication?
The app is freezing at line, where the socket is waiting for answer from the server. (i'm using SmallSockets)
Is it posible to make a timer for this command, and after the timer count down skip this command? | iphone | objective-c | cocoa | cocoa-touch | null | null | open | Skipping a command when app is freezing
===
How can I handle the problem when in my app somebody set a wrong IP address to socket communication?
The app is freezing at line, where the socket is waiting for answer from the server. (i'm using SmallSockets)
Is it posible to make a timer for this command, and after the timer count down skip this command? | 0 |
2,107,069 | 01/21/2010 05:10:08 | 237,388 | 12/23/2009 06:02:16 | 36 | 1 | Performance TestCase Interface in Android | Has anybody implemented the ***PerformanceTestCase*** provided by *android* and got some results...If you have done it please provide some *source code*,it will be really helpful...
Here is the android link:
[http://developer.android.com/reference/android/test/PerformanceTestCase.html][1]
[1]: http://developer.android.com/reference/android/test/PerformanceTestCase.html
I have used the ***traceview*** tool but I need results like *CPU cycles* used,*memory* used by the app either in real-time or after its execution.. | android | performance | testing | null | null | null | open | Performance TestCase Interface in Android
===
Has anybody implemented the ***PerformanceTestCase*** provided by *android* and got some results...If you have done it please provide some *source code*,it will be really helpful...
Here is the android link:
[http://developer.android.com/reference/android/test/PerformanceTestCase.html][1]
[1]: http://developer.android.com/reference/android/test/PerformanceTestCase.html
I have used the ***traceview*** tool but I need results like *CPU cycles* used,*memory* used by the app either in real-time or after its execution.. | 0 |
3,283,562 | 07/19/2010 17:46:26 | 360,844 | 06/07/2010 21:36:34 | 441 | 16 | Where on internet can we learn Secure Programming in c/c++ | I am starting to learn everything about security and secure programming.
I have always heard about things like buffer overflow vulnerability.
But I don't know yet how such vulnerabilities are exploited.
And how can we program securely enough to make sure that our code is robust.
When I say all this, my programming languages of interest are c and c++.
1. I am looking for free tutorials, and resources on internet where I can learn every ins-n-out of secure programming.
2. Platform specific tips are also welcome. For example, I know that in Windows programming we can use functions like "memmove_s" to have secure code. But what are the equivalents in Linux/Unix? Or is it the same there?
3. Should a c/c++ programmer worry about specially crafted formatted stings (like the very popular old PHP formatted strings vulverability)?
A lot of questions here, but general idea is that I mean to learn Secure Programming.
Thanks for every bit of help.
| c++ | c | security | null | null | 07/19/2010 20:49:32 | not a real question | Where on internet can we learn Secure Programming in c/c++
===
I am starting to learn everything about security and secure programming.
I have always heard about things like buffer overflow vulnerability.
But I don't know yet how such vulnerabilities are exploited.
And how can we program securely enough to make sure that our code is robust.
When I say all this, my programming languages of interest are c and c++.
1. I am looking for free tutorials, and resources on internet where I can learn every ins-n-out of secure programming.
2. Platform specific tips are also welcome. For example, I know that in Windows programming we can use functions like "memmove_s" to have secure code. But what are the equivalents in Linux/Unix? Or is it the same there?
3. Should a c/c++ programmer worry about specially crafted formatted stings (like the very popular old PHP formatted strings vulverability)?
A lot of questions here, but general idea is that I mean to learn Secure Programming.
Thanks for every bit of help.
| 1 |
6,799,002 | 07/23/2011 07:36:11 | 859,078 | 07/23/2011 07:36:11 | 1 | 0 | Animations control in a pivot app (WP7) | I created a pivot in Xaml. The pivot has 4 items.
On every pivot there is a storyboard animation created by following code:
void OnLoaded(object sender, RoutedEventArgs e)
{
var myStoryBoard = new Storyboard();
var animation = new ObjectAnimationUsingKeyFrames();
Storyboard.SetTarget(animation, myAnim1);
Storyboard.SetTargetProperty(animation, new PropertyPath("Source"));
myStoryBoard.Children.Add(animation);
// try to catch my images autmatically
for (int i = 1; i <= 12; i++)
{
var keyframe = new DiscreteObjectKeyFrame
{
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(750 * i)),
Value = String.Format("/Images/img_{0:D2}.jpg", i)
};
animation.KeyFrames.Add(keyframe);
}
Resources.Add("myAnimation", storyboard);
myStoryBoard.Begin();
}
How can I set the Begin of the Storyboard to start only if the pivot item is selected, while all other Storyboards are not playing?
I tried to set it with Pivot_SelectionChanged(); but without success. | windows-phone-7 | pivot | storyboard | windows-phone | null | null | open | Animations control in a pivot app (WP7)
===
I created a pivot in Xaml. The pivot has 4 items.
On every pivot there is a storyboard animation created by following code:
void OnLoaded(object sender, RoutedEventArgs e)
{
var myStoryBoard = new Storyboard();
var animation = new ObjectAnimationUsingKeyFrames();
Storyboard.SetTarget(animation, myAnim1);
Storyboard.SetTargetProperty(animation, new PropertyPath("Source"));
myStoryBoard.Children.Add(animation);
// try to catch my images autmatically
for (int i = 1; i <= 12; i++)
{
var keyframe = new DiscreteObjectKeyFrame
{
KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromMilliseconds(750 * i)),
Value = String.Format("/Images/img_{0:D2}.jpg", i)
};
animation.KeyFrames.Add(keyframe);
}
Resources.Add("myAnimation", storyboard);
myStoryBoard.Begin();
}
How can I set the Begin of the Storyboard to start only if the pivot item is selected, while all other Storyboards are not playing?
I tried to set it with Pivot_SelectionChanged(); but without success. | 0 |
2,062,670 | 01/14/2010 07:04:16 | 182,289 | 10/01/2009 06:16:33 | 75 | 16 | JavaScript Execution Order Problem | The following works correctly:
alert("start");
loadData(); // takes a while
alert("finished");
loadData() is a method that inserts large amounts of data into a table in the DOM and takes a few seconds.
This, however, does not work as expected:
document.getElementById("mydiv").style.display = "block";
loadData(); // takes a while
document.getElementById("mydiv").style.display = "none";
The data is loaded into the table without displaying mydiv until the loading is completed and then mydiv is quickly displayed and gone.
But this works like it's supposed to:
document.getElementById("mydiv").style.display = "block";
alert("start");
loadData(); // takes a while
alert("finish");
document.getElementById("mydiv").style.display = "none";
mydiv is displayed, the alert dialog is shown, the data is loaded into the table, and then mydiv disappears, as expected.
Anyone know why the second code section above does not work properly?
| javascript | null | null | null | null | null | open | JavaScript Execution Order Problem
===
The following works correctly:
alert("start");
loadData(); // takes a while
alert("finished");
loadData() is a method that inserts large amounts of data into a table in the DOM and takes a few seconds.
This, however, does not work as expected:
document.getElementById("mydiv").style.display = "block";
loadData(); // takes a while
document.getElementById("mydiv").style.display = "none";
The data is loaded into the table without displaying mydiv until the loading is completed and then mydiv is quickly displayed and gone.
But this works like it's supposed to:
document.getElementById("mydiv").style.display = "block";
alert("start");
loadData(); // takes a while
alert("finish");
document.getElementById("mydiv").style.display = "none";
mydiv is displayed, the alert dialog is shown, the data is loaded into the table, and then mydiv disappears, as expected.
Anyone know why the second code section above does not work properly?
| 0 |
9,522,954 | 03/01/2012 19:50:17 | 1,105,080 | 12/19/2011 00:44:34 | 18 | 0 | LINQ Comparison error | I am getting a comparison error message when trying to update a record using LINQ.
var tools = from tl in MVCWebsite.MvcApplication.DataContext.tblTools
where tl.pk_fk_Environment == model.Environment
&& tl.pk_fk_Classification == model.Classification
&& tl.pk_ToolNumber == model.ToolNumber
select tl;
Models.Database.tblTool updatingTool = tools.First();
//try
//{
if (createPerson(model.ToolEngineer, true) != null)
updatingTool.fk_Engineer = model.ToolEngineer;
else
updatingTool.fk_Engineer = null;
updatingTool.fk_BuiltBy = model.ToolBuiltBy;
if (createPerson(model.ToolBuiltBy, true) != null)
updatingTool.fk_BuiltBy = model.ToolBuiltBy;
else
updatingTool.fk_BuiltBy = null;
if (createPerson(model.ToolDesignedBy, true) != null)
updatingTool.fk_Designer = model.ToolDesignedBy;
else
updatingTool.fk_Designer = null;
updatingTool.DateOfBuild = model.DateOfBuild;
updatingTool.Machine_Name_Primary = model.ToolPrimaryMachineName;
updatingTool.Machine_Description_Primary = model.ToolPrimaryMachineDescription;
updatingTool.Machine_Name_Secondary = model.ToolSecondaryMachineName;
updatingTool.Machine_Description_Secondary = model.ToolSecondaryMachineDescription;
updatingTool.MERNumber = model.MERNumber;
updatingTool.AssetNumber = model.AssetNumber;
updatingTool.Additional_Cavities = model.AdditionalFields.Cavities;
updatingTool.Additional_Gate = model.AdditionalFields.TypeOfGate;
updatingTool.Additional_Shrinkage = model.AdditionalFields.Shrinkage;
updatingTool.Additional_DieClearance = model.AdditionalFields.DieClearance;
updatingTool.Additional_Field1 = model.AdditionalFields.Additional1;
updatingTool.Additional_Field2 = model.AdditionalFields.Additional2;
updatingTool.Additional_Field3 = model.AdditionalFields.Additional3;
updatingTool.Additional_Field4 = model.AdditionalFields.Additional4;
updatingTool.Additional_OtherInformation = model.AdditionalFields.OtherInformation;
(Below is the create user function)
private Models.Database.tblPerson createPerson(string user)
{
if (user == null || user == "")
return null;
var people = from p in MVCWebsite.MvcApplication.DataContext.tblPersons
where p.pk_PersonID == user
select p;
if (people.Count() == 1)
{
return people.First();
}
else
{
Models.UserInformation ui;
ui = MVCWebsite.MvcApplication.DisplayUser(user);
if (!ui.Exists)
return null;
tblPerson person = new tblPerson()
{
pk_PersonID = user,
FirstName = ui.GivenName,
LastName = ui.Surname,
Email = ui.EmailAddress
};
return person;
}
}
I am not bothered about if my code is clean or not at the moment, I am just getting this error and it is starting to annoy me.
Here is the Main Table Scripted as a Create (So you can see the field settings:
CREATE TABLE [dbo].[tblTool](
[pk_fk_Environment] [varchar](2) COLLATE Latin1_General_CI_AS NOT NULL,
[pk_fk_Classification] [varchar](3) COLLATE Latin1_General_CI_AS NOT NULL,
[pk_fk_Style] [varchar](4) COLLATE Latin1_General_CI_AS NULL,
[pk_ToolNumber] [int] NOT NULL,
[DateOfBuild] [datetime] NULL,
[fk_Engineer] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_Designer] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_BuiltBy] [varchar](20) COLLATE Latin1_General_CI_AS NULL,
[MERNumber] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[AssetNumber] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_Material] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_LocationCompany] [varchar](20) COLLATE Latin1_General_CI_AS NULL,
[fk_LocationCountry] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_LocationRegion] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_Status] [varchar](10) COLLATE Latin1_General_CI_AS NULL,
[Machine_Name_Primary] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Machine_Description_Primary] [text] COLLATE Latin1_General_CI_AS NULL,
[Machine_Name_Secondary] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Machine_Description_Secondary] [text] COLLATE Latin1_General_CI_AS NULL,
[OldToolID] [varchar](100) COLLATE Latin1_General_CI_AS NULL,
[Additional_Cavities] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Gate] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Shrinkage] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_DieClearance] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field1] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field2] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field3] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field4] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_OtherInformation] [text] COLLATE Latin1_General_CI_AS NULL,
CONSTRAINT [PK_tblTool] PRIMARY KEY CLUSTERED
(
[pk_fk_Environment] ASC,
[pk_fk_Classification] ASC,
[pk_ToolNumber] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
When updating the field with the same information that is already in it I get the Error:
SQL Server does not handle comparison of NText, Text, Xml, or Image data types.
Does anybody know why this might be happening?
Thanks,
Oliver | c# | .net | linq | null | null | null | open | LINQ Comparison error
===
I am getting a comparison error message when trying to update a record using LINQ.
var tools = from tl in MVCWebsite.MvcApplication.DataContext.tblTools
where tl.pk_fk_Environment == model.Environment
&& tl.pk_fk_Classification == model.Classification
&& tl.pk_ToolNumber == model.ToolNumber
select tl;
Models.Database.tblTool updatingTool = tools.First();
//try
//{
if (createPerson(model.ToolEngineer, true) != null)
updatingTool.fk_Engineer = model.ToolEngineer;
else
updatingTool.fk_Engineer = null;
updatingTool.fk_BuiltBy = model.ToolBuiltBy;
if (createPerson(model.ToolBuiltBy, true) != null)
updatingTool.fk_BuiltBy = model.ToolBuiltBy;
else
updatingTool.fk_BuiltBy = null;
if (createPerson(model.ToolDesignedBy, true) != null)
updatingTool.fk_Designer = model.ToolDesignedBy;
else
updatingTool.fk_Designer = null;
updatingTool.DateOfBuild = model.DateOfBuild;
updatingTool.Machine_Name_Primary = model.ToolPrimaryMachineName;
updatingTool.Machine_Description_Primary = model.ToolPrimaryMachineDescription;
updatingTool.Machine_Name_Secondary = model.ToolSecondaryMachineName;
updatingTool.Machine_Description_Secondary = model.ToolSecondaryMachineDescription;
updatingTool.MERNumber = model.MERNumber;
updatingTool.AssetNumber = model.AssetNumber;
updatingTool.Additional_Cavities = model.AdditionalFields.Cavities;
updatingTool.Additional_Gate = model.AdditionalFields.TypeOfGate;
updatingTool.Additional_Shrinkage = model.AdditionalFields.Shrinkage;
updatingTool.Additional_DieClearance = model.AdditionalFields.DieClearance;
updatingTool.Additional_Field1 = model.AdditionalFields.Additional1;
updatingTool.Additional_Field2 = model.AdditionalFields.Additional2;
updatingTool.Additional_Field3 = model.AdditionalFields.Additional3;
updatingTool.Additional_Field4 = model.AdditionalFields.Additional4;
updatingTool.Additional_OtherInformation = model.AdditionalFields.OtherInformation;
(Below is the create user function)
private Models.Database.tblPerson createPerson(string user)
{
if (user == null || user == "")
return null;
var people = from p in MVCWebsite.MvcApplication.DataContext.tblPersons
where p.pk_PersonID == user
select p;
if (people.Count() == 1)
{
return people.First();
}
else
{
Models.UserInformation ui;
ui = MVCWebsite.MvcApplication.DisplayUser(user);
if (!ui.Exists)
return null;
tblPerson person = new tblPerson()
{
pk_PersonID = user,
FirstName = ui.GivenName,
LastName = ui.Surname,
Email = ui.EmailAddress
};
return person;
}
}
I am not bothered about if my code is clean or not at the moment, I am just getting this error and it is starting to annoy me.
Here is the Main Table Scripted as a Create (So you can see the field settings:
CREATE TABLE [dbo].[tblTool](
[pk_fk_Environment] [varchar](2) COLLATE Latin1_General_CI_AS NOT NULL,
[pk_fk_Classification] [varchar](3) COLLATE Latin1_General_CI_AS NOT NULL,
[pk_fk_Style] [varchar](4) COLLATE Latin1_General_CI_AS NULL,
[pk_ToolNumber] [int] NOT NULL,
[DateOfBuild] [datetime] NULL,
[fk_Engineer] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_Designer] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_BuiltBy] [varchar](20) COLLATE Latin1_General_CI_AS NULL,
[MERNumber] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[AssetNumber] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_Material] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_LocationCompany] [varchar](20) COLLATE Latin1_General_CI_AS NULL,
[fk_LocationCountry] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_LocationRegion] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[fk_Status] [varchar](10) COLLATE Latin1_General_CI_AS NULL,
[Machine_Name_Primary] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Machine_Description_Primary] [text] COLLATE Latin1_General_CI_AS NULL,
[Machine_Name_Secondary] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Machine_Description_Secondary] [text] COLLATE Latin1_General_CI_AS NULL,
[OldToolID] [varchar](100) COLLATE Latin1_General_CI_AS NULL,
[Additional_Cavities] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Gate] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Shrinkage] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_DieClearance] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field1] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field2] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field3] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_Field4] [varchar](50) COLLATE Latin1_General_CI_AS NULL,
[Additional_OtherInformation] [text] COLLATE Latin1_General_CI_AS NULL,
CONSTRAINT [PK_tblTool] PRIMARY KEY CLUSTERED
(
[pk_fk_Environment] ASC,
[pk_fk_Classification] ASC,
[pk_ToolNumber] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
When updating the field with the same information that is already in it I get the Error:
SQL Server does not handle comparison of NText, Text, Xml, or Image data types.
Does anybody know why this might be happening?
Thanks,
Oliver | 0 |
5,133,354 | 02/27/2011 13:05:33 | 636,452 | 02/27/2011 13:05:33 | 1 | 0 | sound meter, db meter | im interesting in getting any kind of help to make a simple sound meter, so i saw that you bloged about that in 2009 but just for styling, so my question is, do you have any algorithm usefull for me or any kind of additional help.
its for my class project and i'll be very grateful
thx,
Nikola Sever (and yes that's my real surname :P) | c# | null | null | null | null | 02/27/2011 13:35:58 | not a real question | sound meter, db meter
===
im interesting in getting any kind of help to make a simple sound meter, so i saw that you bloged about that in 2009 but just for styling, so my question is, do you have any algorithm usefull for me or any kind of additional help.
its for my class project and i'll be very grateful
thx,
Nikola Sever (and yes that's my real surname :P) | 1 |
9,903,013 | 03/28/2012 07:33:37 | 903,471 | 08/20/2011 05:58:02 | 95 | 1 | Left padding a string to sort accordingly | I have to get the database with the max space free in a exchange 2010 however as this gonna be launched from a pipeline in c#, I'm trying to sort the results and then pick the first row.
If I try using the field AvailableNewMailboxSpace, it is sorted using the string values instead the double values:
Get-MailboxDatabase -Status | Select Name,AvailableNewMailboxSpace | Sort-Object DatabaseSize
Name AvailableNewMailboxSpace
---- ------------------------
DBMB03 123.1 MB (129,073,152 bytes)
DBMB04 114.1 MB (119,635,968 bytes)
DBMB02 115.6 MB (121,176,064 bytes)
DBMB10 224.4 MB (235,307,008 bytes)
DBMB01 81.47 MB (85,426,176 bytes)
I guess I must left pad zeros in the string to get the right order but I don't know how.
I have to achieve it in a single line because this gonna be launched using a pipeline command in c#.
This is my attempt:
Get-MailboxDatabase -Status |`
Sort (("0" * (10 - {$_.AvailableNewMailboxSpace.Substring(0, $_.AvailableNewMailboxSpace.IndexOf("MB") - 1)}.length)) + `
{$_.AvailableNewMailboxSpace.Substring(0, $_.AvailableNewMailboxSpace.IndexOf("MB") - 1)}) | Select Name,AvailableNewMailboxSpace
Thanks,
| powershell | exchange2010 | null | null | null | null | open | Left padding a string to sort accordingly
===
I have to get the database with the max space free in a exchange 2010 however as this gonna be launched from a pipeline in c#, I'm trying to sort the results and then pick the first row.
If I try using the field AvailableNewMailboxSpace, it is sorted using the string values instead the double values:
Get-MailboxDatabase -Status | Select Name,AvailableNewMailboxSpace | Sort-Object DatabaseSize
Name AvailableNewMailboxSpace
---- ------------------------
DBMB03 123.1 MB (129,073,152 bytes)
DBMB04 114.1 MB (119,635,968 bytes)
DBMB02 115.6 MB (121,176,064 bytes)
DBMB10 224.4 MB (235,307,008 bytes)
DBMB01 81.47 MB (85,426,176 bytes)
I guess I must left pad zeros in the string to get the right order but I don't know how.
I have to achieve it in a single line because this gonna be launched using a pipeline command in c#.
This is my attempt:
Get-MailboxDatabase -Status |`
Sort (("0" * (10 - {$_.AvailableNewMailboxSpace.Substring(0, $_.AvailableNewMailboxSpace.IndexOf("MB") - 1)}.length)) + `
{$_.AvailableNewMailboxSpace.Substring(0, $_.AvailableNewMailboxSpace.IndexOf("MB") - 1)}) | Select Name,AvailableNewMailboxSpace
Thanks,
| 0 |
8,104,916 | 11/12/2011 14:04:22 | 1,038,219 | 11/09/2011 17:51:13 | 1 | 0 | Babel example language | Why are the language examples of babel always about Danish? I am from Denmark, and i have been wondering.
See for example http://www.tex.ac.uk/cgi-bin/texfaq2html?label=latexwords | latex | babel | null | null | null | 11/12/2011 18:08:35 | off topic | Babel example language
===
Why are the language examples of babel always about Danish? I am from Denmark, and i have been wondering.
See for example http://www.tex.ac.uk/cgi-bin/texfaq2html?label=latexwords | 2 |
6,805,196 | 07/24/2011 05:55:28 | 461,807 | 09/29/2010 14:02:30 | 207 | 0 | Replace frames with div | I have some pages with frameset and frame based layouts. Now I want to change those pages to div base layout.Need suggestions about how to go about it ? Is it possible to target a particular div like in frames? Let me know if there are any tutorials available for the same. | javascript | jquery | html | css | null | 07/24/2011 11:44:27 | not a real question | Replace frames with div
===
I have some pages with frameset and frame based layouts. Now I want to change those pages to div base layout.Need suggestions about how to go about it ? Is it possible to target a particular div like in frames? Let me know if there are any tutorials available for the same. | 1 |
8,743,959 | 01/05/2012 14:17:26 | 349,045 | 05/21/2010 21:18:32 | 696 | 10 | c++ void* to parameter to a function | I have this function in some library:
class myConsole
{
void addCommand( std::string command, void* fn );
...
}
and in my class I have this function:
void myApp::TestFn( const std::vector<std::string> & args )
{
// do something
}
in the same class I call this:
void myApp::initApp( )
{
myConsole::getSingleton( ).addCommand( "FirstTest", &myApp::TestFn );
}
but this gives me this error:
> error c2664 cannot convert parameter 2 from 'void(__thiscall
> myApp::*)(const std::vector<_Ty>&)' to 'void *'
how can I solve this?
thanks in advance! | c++ | visual-c++ | function-pointers | void-pointers | null | null | open | c++ void* to parameter to a function
===
I have this function in some library:
class myConsole
{
void addCommand( std::string command, void* fn );
...
}
and in my class I have this function:
void myApp::TestFn( const std::vector<std::string> & args )
{
// do something
}
in the same class I call this:
void myApp::initApp( )
{
myConsole::getSingleton( ).addCommand( "FirstTest", &myApp::TestFn );
}
but this gives me this error:
> error c2664 cannot convert parameter 2 from 'void(__thiscall
> myApp::*)(const std::vector<_Ty>&)' to 'void *'
how can I solve this?
thanks in advance! | 0 |
7,810,886 | 10/18/2011 16:53:43 | 160,074 | 08/20/2009 14:12:20 | 111 | 7 | Pow and VMware Fusion | I am using Pow to serve a Rack application on Mac OS X. http://myapp.dev correctly displays the application. On the same machine I am using VMware Fusion to run Windows 7 while sharing the Mac's network connection. I would like to test the Rack application using Internet Explorer within the VM. http://vmnet8.adapter.ip.address correctly displays the "Pow is installed screen". However, htttp://myapp.dev no longer works.
I understand that Pow creates a DNS resolver and uses it's own DNS server to intercept domains ending in ".dev" and redirect them to localhost. Is it possible to get this to work within the VM also? | pow | vmware-fusion | null | null | null | null | open | Pow and VMware Fusion
===
I am using Pow to serve a Rack application on Mac OS X. http://myapp.dev correctly displays the application. On the same machine I am using VMware Fusion to run Windows 7 while sharing the Mac's network connection. I would like to test the Rack application using Internet Explorer within the VM. http://vmnet8.adapter.ip.address correctly displays the "Pow is installed screen". However, htttp://myapp.dev no longer works.
I understand that Pow creates a DNS resolver and uses it's own DNS server to intercept domains ending in ".dev" and redirect them to localhost. Is it possible to get this to work within the VM also? | 0 |
3,349,782 | 07/28/2010 03:48:12 | 446,377 | 07/28/2010 03:33:18 | 1 | 0 | Ruby on Rails jQuery Visual Effect | I am working on a search function on RoR that basically just has a cool visual effect when a user clicks the search button.
Here is the code in my view for search.rhtml
<html>
<head>
<title>Tutor</title>
<%= javascript_include_tag :defaults %>
</head>
<body>
<h1></h1>
<%= form_remote_tag :url =>{ :action => :search_results }, :update => "results" %>
<fieldset>
<legend>Tutor Search.</legend>
<label for="searchItField">Keyword Search.</label>
<input class="tfield" type="text" value="FIND YOUR TUTOR HERE" name="searchItField" id="searchItField" />
<span id="Submit_search">
<span id="Submit_search_hover"><input type="submit" id="Submit" value="Search" /></span>
</span>
</fieldset>
</form>
<div id="results">
</div>
</body>
</html>
Here is the search_results.rhtml which is what gets displayed in the results div in search.rhtml
<% for tutors in @tutors %>
<%= tutors.first_name %> <br/>
<% end %>
And finally here is my controller and actions.
class TutorsController < ApplicationController
def search
end
def search_results
@tutors = Tutors.find_by_sql('SELECT * FROM tutors')
end
end
What I want to do is basically create an effect that when the search results are loaded because of the ajax call that it would slide up. I am using jrails. Exactly how this site does it. http://keyonary.com/#/paste
| ruby-on-rails | ajax | jrails | null | null | null | open | Ruby on Rails jQuery Visual Effect
===
I am working on a search function on RoR that basically just has a cool visual effect when a user clicks the search button.
Here is the code in my view for search.rhtml
<html>
<head>
<title>Tutor</title>
<%= javascript_include_tag :defaults %>
</head>
<body>
<h1></h1>
<%= form_remote_tag :url =>{ :action => :search_results }, :update => "results" %>
<fieldset>
<legend>Tutor Search.</legend>
<label for="searchItField">Keyword Search.</label>
<input class="tfield" type="text" value="FIND YOUR TUTOR HERE" name="searchItField" id="searchItField" />
<span id="Submit_search">
<span id="Submit_search_hover"><input type="submit" id="Submit" value="Search" /></span>
</span>
</fieldset>
</form>
<div id="results">
</div>
</body>
</html>
Here is the search_results.rhtml which is what gets displayed in the results div in search.rhtml
<% for tutors in @tutors %>
<%= tutors.first_name %> <br/>
<% end %>
And finally here is my controller and actions.
class TutorsController < ApplicationController
def search
end
def search_results
@tutors = Tutors.find_by_sql('SELECT * FROM tutors')
end
end
What I want to do is basically create an effect that when the search results are loaded because of the ajax call that it would slide up. I am using jrails. Exactly how this site does it. http://keyonary.com/#/paste
| 0 |
11,152,453 | 06/22/2012 08:12:01 | 1,056,284 | 11/20/2011 11:10:07 | 122 | 7 | Connecting CCSprites in Cocos2D | I'm currently working on the interesting example in cocos2d. I have a sprite, that is a line, that just moving(with the help of CCAction) on my background. But the line is 4000 pixels wide. iOS 4.x is supporting not more then 2048 pixels by 2048 pixels. So I decided to cut the line in to two pieces. So, now I have two images, 1920 x 1920. Now I want to do the same thing that I did previously. This is really simple code:
CCSprite *abstractFigureLine = [CCSprite spriteWithFile:@"Abstract Figures Line.png"];
abstractFigureLine.position = CGPointMake(960.0f, 160.0f);
[self addChild:abstractFigureLine z:1];
CCAction *moveAbstractFigureLineAction = [CCMoveTo actionWithDuration:10.0f position:CGPointMake(-900.0f, 160.0f)];
[abstractFigureLine runAction:moveAbstractFigureLineAction];
Now I need to insert the image of another sprite, as well really simple, but is there any way to connect this two sprites in to one single sprite?
| objective-c | ios | xcode | cocos2d-iphone | null | null | open | Connecting CCSprites in Cocos2D
===
I'm currently working on the interesting example in cocos2d. I have a sprite, that is a line, that just moving(with the help of CCAction) on my background. But the line is 4000 pixels wide. iOS 4.x is supporting not more then 2048 pixels by 2048 pixels. So I decided to cut the line in to two pieces. So, now I have two images, 1920 x 1920. Now I want to do the same thing that I did previously. This is really simple code:
CCSprite *abstractFigureLine = [CCSprite spriteWithFile:@"Abstract Figures Line.png"];
abstractFigureLine.position = CGPointMake(960.0f, 160.0f);
[self addChild:abstractFigureLine z:1];
CCAction *moveAbstractFigureLineAction = [CCMoveTo actionWithDuration:10.0f position:CGPointMake(-900.0f, 160.0f)];
[abstractFigureLine runAction:moveAbstractFigureLineAction];
Now I need to insert the image of another sprite, as well really simple, but is there any way to connect this two sprites in to one single sprite?
| 0 |
9,615,019 | 03/08/2012 08:59:07 | 1,239,189 | 02/29/2012 01:39:46 | 26 | 0 | How to edit my existing JS script to upload form when submit is clicked? | Here is the code. What I want is to be able to upload the file and then also, the form is returning its url which is being added in the database for the particular user uploading the file. Actually its his profile picture so it's obvious it has to be connected, if you know what I mean.
<script>
$(document).ready(function() {
$("#writer_reg").submit(function(){
$("#writer_reg button").button('loading');
$("#success").hide();
$("#error").hide();
var faction = "<?php echo site_url('writer/create')?>";
var fdata = $("#writer_reg").serialize();
$.post(faction, fdata, function(rdata){
var json = jQuery.parseJSON(rdata);
if(json.isSuccessful){
$("#successMessage").html(json.message);
$("#success").show();
}else{
$("#errorMessage").html(json.message);
$("#error").show();
}
$("#writer_reg button").button('reset');
$("#writer_reg input[name='name']").select();
});
return false;
});
});
</script> | javascript | ajax | forms | codeigniter | null | 03/08/2012 11:28:41 | too localized | How to edit my existing JS script to upload form when submit is clicked?
===
Here is the code. What I want is to be able to upload the file and then also, the form is returning its url which is being added in the database for the particular user uploading the file. Actually its his profile picture so it's obvious it has to be connected, if you know what I mean.
<script>
$(document).ready(function() {
$("#writer_reg").submit(function(){
$("#writer_reg button").button('loading');
$("#success").hide();
$("#error").hide();
var faction = "<?php echo site_url('writer/create')?>";
var fdata = $("#writer_reg").serialize();
$.post(faction, fdata, function(rdata){
var json = jQuery.parseJSON(rdata);
if(json.isSuccessful){
$("#successMessage").html(json.message);
$("#success").show();
}else{
$("#errorMessage").html(json.message);
$("#error").show();
}
$("#writer_reg button").button('reset');
$("#writer_reg input[name='name']").select();
});
return false;
});
});
</script> | 3 |
4,156,235 | 11/11/2010 15:46:26 | 432,281 | 08/26/2010 19:46:06 | 46 | 1 | Sending existing NSStrings to StringByEvaluatingJavaScriptFromString | Here's my Code:
NSString *js =[NSString stringWithFormat:@"document.getElementsByTagName('body')[0].innerHTML = '<h1>%@</h1>';",s];
[pageView stringByEvaluatingJavaScriptFromString:js];
pageView is a UIWebView already loaded with an html document. I want it to show the NSString s. However, when this function is called, the visible html stays the same. I know s has a value because it is printing properly to the console one line above this. If I replace "%@" with say, "poot", "poot" appears in the h1 tag of the html as it should.
Shouldn't I be able to send s to the html like this?
Thanks.
| objective-c | ios | uiwebview | nsstring | null | null | open | Sending existing NSStrings to StringByEvaluatingJavaScriptFromString
===
Here's my Code:
NSString *js =[NSString stringWithFormat:@"document.getElementsByTagName('body')[0].innerHTML = '<h1>%@</h1>';",s];
[pageView stringByEvaluatingJavaScriptFromString:js];
pageView is a UIWebView already loaded with an html document. I want it to show the NSString s. However, when this function is called, the visible html stays the same. I know s has a value because it is printing properly to the console one line above this. If I replace "%@" with say, "poot", "poot" appears in the h1 tag of the html as it should.
Shouldn't I be able to send s to the html like this?
Thanks.
| 0 |
6,034,629 | 05/17/2011 17:19:44 | 372,237 | 06/21/2010 14:23:12 | 43 | 11 | Deleting Users with Rails Console | I want to delete some users and duplicate tags that are in my db. Is there a way I can use rails console to list all of these objects so I can pinpoint each one to delete them. They are not necessarily the last entries?
| ruby-on-rails-3 | null | null | null | null | null | open | Deleting Users with Rails Console
===
I want to delete some users and duplicate tags that are in my db. Is there a way I can use rails console to list all of these objects so I can pinpoint each one to delete them. They are not necessarily the last entries?
| 0 |
6,929,026 | 08/03/2011 15:28:02 | 876,938 | 08/03/2011 15:28:02 | 1 | 0 | Tutorial or guide? | Can anyone tell me how can I do something like this: [http://www.kosovoguide.com/?cid=2,236][1] ?<br />
I mean.. any tutorial or guide would help me...
[1]: http://www.kosovoguide.com/?cid=2,236 | openlayers | osm | null | null | null | 08/04/2011 04:42:28 | not a real question | Tutorial or guide?
===
Can anyone tell me how can I do something like this: [http://www.kosovoguide.com/?cid=2,236][1] ?<br />
I mean.. any tutorial or guide would help me...
[1]: http://www.kosovoguide.com/?cid=2,236 | 1 |
2,747,480 | 04/30/2010 20:28:45 | 187,484 | 10/09/2009 23:13:20 | 6 | 0 | Flash AS3 - Dispatching Events from Parent Class to Child Class | I think this is a pretty simply problem but I do not seem to be able to pull it off. Basically I have a parent class A, and a child class B. Class A instantiates class B with addChild. There is a shared object which is being updated from a java server (red5) that has an event listener attached to it in class A. I have a function in class A which will pass certain, specific updates from this shared object to class B. The problem occurs is that when class B is instantiated, the event listener from class A doesn't work anymore. I have not removed the event listener from A. Any thoughts? | actionscript-3 | red5 | shared-objects | addchild | null | null | open | Flash AS3 - Dispatching Events from Parent Class to Child Class
===
I think this is a pretty simply problem but I do not seem to be able to pull it off. Basically I have a parent class A, and a child class B. Class A instantiates class B with addChild. There is a shared object which is being updated from a java server (red5) that has an event listener attached to it in class A. I have a function in class A which will pass certain, specific updates from this shared object to class B. The problem occurs is that when class B is instantiated, the event listener from class A doesn't work anymore. I have not removed the event listener from A. Any thoughts? | 0 |
6,705,480 | 07/15/2011 10:09:16 | 846,205 | 07/15/2011 09:56:51 | 1 | 0 | what's a virtual dedicated hosting? | I understand what's a VPS, and what's a dedicated host.
But what's a virtual dedicated hosting? | javascript | html5 | hosting | null | null | 11/09/2011 00:05:18 | off topic | what's a virtual dedicated hosting?
===
I understand what's a VPS, and what's a dedicated host.
But what's a virtual dedicated hosting? | 2 |
9,036,088 | 01/27/2012 15:51:50 | 1,134,487 | 01/06/2012 14:31:20 | 13 | 0 | Application Settings in C# | I am having problem with something else. Is there any way to update Application Properties Settings of C# Project during Installation Setup. That means, I am trying to modify Application Settings while I install the project? | c# | null | null | null | null | 01/27/2012 17:19:54 | not a real question | Application Settings in C#
===
I am having problem with something else. Is there any way to update Application Properties Settings of C# Project during Installation Setup. That means, I am trying to modify Application Settings while I install the project? | 1 |
11,015,151 | 06/13/2012 12:47:27 | 733,332 | 05/01/2011 13:59:18 | 361 | 9 | Firing UILocalNotification on specific days only | I have an application where I need to fire a notification on certain days of the week only (defined by the user). I've used local notifications before but its always been fairly straight-forward, everyday, week etc at the same time. However I've never had to fire the same notification, at the same time, on specific days only. Has anyone done this before and can shed some light on it? | iphone | objective-c | ios | uilocalnotification | null | null | open | Firing UILocalNotification on specific days only
===
I have an application where I need to fire a notification on certain days of the week only (defined by the user). I've used local notifications before but its always been fairly straight-forward, everyday, week etc at the same time. However I've never had to fire the same notification, at the same time, on specific days only. Has anyone done this before and can shed some light on it? | 0 |
8,392,194 | 12/05/2011 21:34:29 | 1,082,394 | 12/05/2011 21:33:37 | 1 | 0 | Iphone views flow | I am new to iphone development and I want to create some middle-complex app. The most problematic for me is to understand how to design and build views flow. I have above scenerio:
- user launches the app, and sees tabbar with tabs to sign in, sign out and some pages with text.
- if he signs in or signs up the tabbar should be closed and view with vertical menu should be opened. Next, after choosing any of option from menu, another view should be opened in scroll mode (like it is when you select something from table with connected navigation controller)
- if user clicks on some profile of another user, second tabbar should be opened with some tabs about this user (profile, photos etc.). Ofcourse user can close this tabbar and get back to view from which he opened tabbar.
How I said before, most problematic for me is to switch between this views. I have created tabbar application and create appropriate tabs. If user sign in, now I am changing self.window.rootviewcontroller to viewcontroller with menu options.
- How should I implement choosing options from menu?
- Should I open second tabbar in the same way like with menu?
If possible please paste some links to tutorials or articles.
Problem which I noticed now is when I changing rootviewcontroller to tabbarcontroller, input fields don't want to show keyboard.
Please help me
Regards R. | iphone | ios | application | views | development | 12/06/2011 02:48:48 | not a real question | Iphone views flow
===
I am new to iphone development and I want to create some middle-complex app. The most problematic for me is to understand how to design and build views flow. I have above scenerio:
- user launches the app, and sees tabbar with tabs to sign in, sign out and some pages with text.
- if he signs in or signs up the tabbar should be closed and view with vertical menu should be opened. Next, after choosing any of option from menu, another view should be opened in scroll mode (like it is when you select something from table with connected navigation controller)
- if user clicks on some profile of another user, second tabbar should be opened with some tabs about this user (profile, photos etc.). Ofcourse user can close this tabbar and get back to view from which he opened tabbar.
How I said before, most problematic for me is to switch between this views. I have created tabbar application and create appropriate tabs. If user sign in, now I am changing self.window.rootviewcontroller to viewcontroller with menu options.
- How should I implement choosing options from menu?
- Should I open second tabbar in the same way like with menu?
If possible please paste some links to tutorials or articles.
Problem which I noticed now is when I changing rootviewcontroller to tabbarcontroller, input fields don't want to show keyboard.
Please help me
Regards R. | 1 |
2,571,614 | 04/03/2010 15:10:04 | 276,168 | 02/18/2010 14:51:11 | 1 | 0 | Copy method optimization in compilers | I have the following code:
void Stack::operator =(Stack &rhs)
{
//do the actual copying
}
Stack::Stack(Stack &rhs) //copy-constructor
{
top=NULL; //initialize this as an empty stack (which it is)
*this=rhs; //invoke assignment operator
}
Stack& Stack::CopyStack()
{
return *this; //this statement will invoke copy contructor
}
It is being used like this:
unsigned Stack::count()
{
unsigned c=0;
Stack copy=CopyStack();
while (!copy.empty())
{
copy.pop();
c++;
}
return c;
}
Removing reference symbol from declaration of CopyStack (returning a copy instead of reference) makes no difference in visual studio 2008 (with respect to number of times copying is invoked). I guess it gets optimized away - normally it should first make a copy for the return value, then call assignment operator once more to assign it to variable sc.
What is your experience with this sort of optimization in different compilers?
Regards,
Dženan | c++ | containers | copy | compiler-optimization | null | null | open | Copy method optimization in compilers
===
I have the following code:
void Stack::operator =(Stack &rhs)
{
//do the actual copying
}
Stack::Stack(Stack &rhs) //copy-constructor
{
top=NULL; //initialize this as an empty stack (which it is)
*this=rhs; //invoke assignment operator
}
Stack& Stack::CopyStack()
{
return *this; //this statement will invoke copy contructor
}
It is being used like this:
unsigned Stack::count()
{
unsigned c=0;
Stack copy=CopyStack();
while (!copy.empty())
{
copy.pop();
c++;
}
return c;
}
Removing reference symbol from declaration of CopyStack (returning a copy instead of reference) makes no difference in visual studio 2008 (with respect to number of times copying is invoked). I guess it gets optimized away - normally it should first make a copy for the return value, then call assignment operator once more to assign it to variable sc.
What is your experience with this sort of optimization in different compilers?
Regards,
Dženan | 0 |
11,014,707 | 06/13/2012 12:20:50 | 14,442 | 09/17/2008 00:01:59 | 96 | 5 | Uploadify finishing after one upload when more are queued | This has me stumped. I have uploadify in place and working fine. When I modify the server side code from simply saving the uploaded images on the server to creating four cropped and resized, differently named, files on the server it completes after one upload. The cropping and resizing is working and the newly created files show up on the server, but only for the first file in the queue. Using the debugger you can see the process sends a 'Cycle complete' after one file, even though it knows there are two files in the queue:
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg; *.Jpg; *.JPG; *.jpeg; *.Jpeg; &.JPEG
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_1
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 2. Files Queued: 2
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /uploadify/uploadify.php for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 32768. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 98304. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 131072. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 163840. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 196608. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 229376. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 262144. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 294912. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 327680. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 348488. Total: 348488
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: 1
SWF DEBUG: Event: uploadComplete : Upload cycle complete. | php | jquery | uploadify | null | null | null | open | Uploadify finishing after one upload when more are queued
===
This has me stumped. I have uploadify in place and working fine. When I modify the server side code from simply saving the uploaded images on the server to creating four cropped and resized, differently named, files on the server it completes after one upload. The cropping and resizing is working and the newly created files show up on the server, but only for the first file in the queue. Using the debugger you can see the process sends a 'Cycle complete' after one file, even though it knows there are two files in the queue:
SWF DEBUG: Event: fileDialogStart : Browsing files. Multi Select. Allowed file types: *.jpg; *.Jpg; *.JPG; *.jpeg; *.Jpeg; &.JPEG
SWF DEBUG: Select Handler: Received the files selected from the dialog. Processing the file list...
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_0
SWF DEBUG: Event: fileQueued : File ID: SWFUpload_0_1
SWF DEBUG: Event: fileDialogComplete : Finished processing selected files. Files selected: 2. Files Queued: 2
SWF DEBUG: StartUpload: First file in queue
SWF DEBUG: Event: uploadStart : File ID: SWFUpload_0_0
SWF DEBUG: ReturnUploadStart(): File accepted by startUpload event and readied for upload. Starting upload to /uploadify/uploadify.php for File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress (OPEN): File ID: SWFUpload_0_0
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 32768. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 98304. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 131072. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 163840. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 196608. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 229376. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 262144. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 294912. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 327680. Total: 348488
SWF DEBUG: Event: uploadProgress: File ID: SWFUpload_0_0. Bytes: 348488. Total: 348488
SWF DEBUG: Event: uploadSuccess: File ID: SWFUpload_0_0 Response Received: true Data: 1
SWF DEBUG: Event: uploadComplete : Upload cycle complete. | 0 |
1,686,570 | 11/06/2009 09:59:18 | 204,662 | 11/06/2009 09:45:05 | 1 | 0 | Problem with python soap library suds. Wsdl was not understood | The code below throw a SAXParseException: "mismatched tag":
from suds.client import Client <br>
url = 'https://xml.192.com/IDSearch.cfc?wsdl'<br>
client = Client(url, cache=None)
print client
Is it problem with suds, or there is some errors in wsdl?
| python | suds | soap | wsdl | null | null | open | Problem with python soap library suds. Wsdl was not understood
===
The code below throw a SAXParseException: "mismatched tag":
from suds.client import Client <br>
url = 'https://xml.192.com/IDSearch.cfc?wsdl'<br>
client = Client(url, cache=None)
print client
Is it problem with suds, or there is some errors in wsdl?
| 0 |
6,502,492 | 06/28/2011 06:34:51 | 615,740 | 01/25/2011 21:03:15 | 571 | 32 | Where can I find resources and code samples for making use of the signal from an Accelerometer? | I would like to be able to write code that takes the signal from an accelerometer to do these things:
* Measure acceleration
* Detect bumps
* Detect impact
* Detect sitting/standing
* and anything else it can possibly do...
I'm specifically interested in the accelerometers in Android phones, but I'm open to general information of all kinds about reading the signal from an accelerometer and making it useful.
I have heard of a few good reads on DSP, but, I would really like a resource that is code-centric. Regardless of what programming language the examples are in, I just like to see things in code.
Can anyone suggest something that fits the bill? I'm interested in exploiting other sensors on Android phones too, but, I'm mainly asking about accelerometers.
| android | accelerometer | sensor | electronics | android-sensors | 06/04/2012 02:00:00 | not constructive | Where can I find resources and code samples for making use of the signal from an Accelerometer?
===
I would like to be able to write code that takes the signal from an accelerometer to do these things:
* Measure acceleration
* Detect bumps
* Detect impact
* Detect sitting/standing
* and anything else it can possibly do...
I'm specifically interested in the accelerometers in Android phones, but I'm open to general information of all kinds about reading the signal from an accelerometer and making it useful.
I have heard of a few good reads on DSP, but, I would really like a resource that is code-centric. Regardless of what programming language the examples are in, I just like to see things in code.
Can anyone suggest something that fits the bill? I'm interested in exploiting other sensors on Android phones too, but, I'm mainly asking about accelerometers.
| 4 |
2,261,866 | 02/14/2010 16:48:50 | 48,465 | 12/22/2008 20:24:42 | 3,951 | 128 | How to install Python ssl module on Windows? | The Google App Engine Launcher tells me:
> WARNING appengine_rpc.py:399 ssl module not found.
Without the ssl module, the identity of the remote host cannot be verified, and
connections may NOT be secure. To fix this, please install the ssl module from
http://pypi.python.org/pypi/ssl .
I downloaded the package and it contained a `setup.py` file. I ran:
python setup.py install
and then:
Python was built with Visual Studio 2003; blablabla use MinGW32
Then I installed MinGW32 and now the compilation doesn't work. The end of the compilation errors contains:
>ssl/_ssl2.c:1561: error: `CRYPTO_LOCK' undeclared (first use in this function)
> error: command 'gcc' failed with exit status 1
What should I do? | python | ssl | python-2.5 | google-app-engine | installation | null | open | How to install Python ssl module on Windows?
===
The Google App Engine Launcher tells me:
> WARNING appengine_rpc.py:399 ssl module not found.
Without the ssl module, the identity of the remote host cannot be verified, and
connections may NOT be secure. To fix this, please install the ssl module from
http://pypi.python.org/pypi/ssl .
I downloaded the package and it contained a `setup.py` file. I ran:
python setup.py install
and then:
Python was built with Visual Studio 2003; blablabla use MinGW32
Then I installed MinGW32 and now the compilation doesn't work. The end of the compilation errors contains:
>ssl/_ssl2.c:1561: error: `CRYPTO_LOCK' undeclared (first use in this function)
> error: command 'gcc' failed with exit status 1
What should I do? | 0 |
10,479,689 | 05/07/2012 09:29:14 | 1,269,086 | 03/14/2012 13:18:58 | 604 | 73 | Excel file doesn't read in C sharp | I am already to Read excel file to working perfectly in C#. but,user when copy the text from word to paste excel column doesn't read in c sharp because copy data didn't work.how to solve this error?
any,one help with me greatly appreciated!
Thanks! | c# | .net | excel | null | null | 05/07/2012 22:08:27 | not a real question | Excel file doesn't read in C sharp
===
I am already to Read excel file to working perfectly in C#. but,user when copy the text from word to paste excel column doesn't read in c sharp because copy data didn't work.how to solve this error?
any,one help with me greatly appreciated!
Thanks! | 1 |
11,117,745 | 06/20/2012 10:35:13 | 1,095,480 | 12/13/2011 10:04:02 | 153 | 6 | Facebook : How to show the Facebook page likes count and Like button to like the Facebook page? | I have created a page "Education For All" in facebook. In my website i want to provide a like button to like this **page** not the **url** and also want to show the count of the Likes received for that page in website along with Like button. I have used "Add this", but it is showing the count of number of likes for the url. Can you suggest me any plugin ?
Any help will be appreciated... | facebook | null | null | null | null | null | open | Facebook : How to show the Facebook page likes count and Like button to like the Facebook page?
===
I have created a page "Education For All" in facebook. In my website i want to provide a like button to like this **page** not the **url** and also want to show the count of the Likes received for that page in website along with Like button. I have used "Add this", but it is showing the count of number of likes for the url. Can you suggest me any plugin ?
Any help will be appreciated... | 0 |
6,627,834 | 07/08/2011 17:00:30 | 718,148 | 04/21/2011 01:35:02 | 1 | 0 | Error in making the build | I have prepared the build for the iPhone app that I have recently built.
The built had been successfully created but it is not being installed on my device.
I am not able to figure out the problem.
Can anyone please suggest me what might be the problem.
Thanks. | iphone | null | null | null | null | 07/13/2011 03:44:06 | not a real question | Error in making the build
===
I have prepared the build for the iPhone app that I have recently built.
The built had been successfully created but it is not being installed on my device.
I am not able to figure out the problem.
Can anyone please suggest me what might be the problem.
Thanks. | 1 |
5,185,690 | 03/03/2011 19:45:59 | 262,471 | 01/30/2010 13:18:09 | 13 | 0 | Use RegEx to wrap lines of text with string | If I have:
bob\nwas\nhere
I would like RegEx to output:
*bob**was**here*
Where an asterisk was placed at the start and end of each line, and the new line character was removed.
I'm using JavaScript/jQuery. | regex | replace | newline | characters | null | null | open | Use RegEx to wrap lines of text with string
===
If I have:
bob\nwas\nhere
I would like RegEx to output:
*bob**was**here*
Where an asterisk was placed at the start and end of each line, and the new line character was removed.
I'm using JavaScript/jQuery. | 0 |
7,255,850 | 08/31/2011 10:46:56 | 354,091 | 05/30/2010 17:41:34 | 109 | 1 | Choosing an SSL certificate | We are looking to get a wildcard SSL certificate for the company websites, and we are shocked to discover how messy the certificate market is.
Our sites will mainly be accessed in computer browsers. It isn't super important that the certificate is supported by mobile browsers, but it wouldn't hurt for it to be supported by at least newer smartphone browsers.
However, it is important that the certificate will work with mobile apps that we create (currently an Android app, but eventually iPhone and Windows Phone 7). These apps will access a REST web service using the wildcard certificate.
The cheapest wildcard certificate available on the Danish market is RapidSSL for about $100/yr. Will this fit our needs or do we need to go more expensive?
Thanks. | rest | service | ssl | certificate | web | 09/01/2011 01:18:30 | off topic | Choosing an SSL certificate
===
We are looking to get a wildcard SSL certificate for the company websites, and we are shocked to discover how messy the certificate market is.
Our sites will mainly be accessed in computer browsers. It isn't super important that the certificate is supported by mobile browsers, but it wouldn't hurt for it to be supported by at least newer smartphone browsers.
However, it is important that the certificate will work with mobile apps that we create (currently an Android app, but eventually iPhone and Windows Phone 7). These apps will access a REST web service using the wildcard certificate.
The cheapest wildcard certificate available on the Danish market is RapidSSL for about $100/yr. Will this fit our needs or do we need to go more expensive?
Thanks. | 2 |
8,453,340 | 12/10/2011 00:21:04 | 759,196 | 05/18/2011 12:42:17 | 64 | 8 | Project not appearing as a DLL when I rebuild | When I do a clean and build in VS, one of my projects isn't appearing as a DLL in the bin folder. All the others are. Can anyone tell me what setting I'm missing please, as I'm sure it's an easy fix but I can't for the life of me figure it out...
Thanks | c# | visual-studio-2010 | null | null | null | null | open | Project not appearing as a DLL when I rebuild
===
When I do a clean and build in VS, one of my projects isn't appearing as a DLL in the bin folder. All the others are. Can anyone tell me what setting I'm missing please, as I'm sure it's an easy fix but I can't for the life of me figure it out...
Thanks | 0 |
7,023,166 | 08/11/2011 08:48:31 | 539,598 | 12/12/2010 14:31:54 | 6 | 1 | Does anyone use ASPMaker? | Would you recommend using asp maker to create a website from a SQL database or is Visual Studio a better option? | sql | asp | null | null | null | 08/11/2011 12:25:41 | not constructive | Does anyone use ASPMaker?
===
Would you recommend using asp maker to create a website from a SQL database or is Visual Studio a better option? | 4 |
9,282,880 | 02/14/2012 19:21:02 | 1,209,814 | 02/14/2012 19:11:57 | 1 | 0 | FTP server behind a router | On my local PC I'm running an Apache FtpServer which I can access as long as I'm in the same network. I want to be able to access this server from anywhere over the internet (as long as I know the IP adress).
Unfortunately, I'm not authorized to change the router configuration (e.g. port forwarding).
Is there any other way to make this FTP server accessible over the internet? | networking | ftp | router | ftp-server | null | null | open | FTP server behind a router
===
On my local PC I'm running an Apache FtpServer which I can access as long as I'm in the same network. I want to be able to access this server from anywhere over the internet (as long as I know the IP adress).
Unfortunately, I'm not authorized to change the router configuration (e.g. port forwarding).
Is there any other way to make this FTP server accessible over the internet? | 0 |
11,015,280 | 06/13/2012 12:53:35 | 480,817 | 10/19/2010 17:49:20 | 81 | 3 | define element width with blueprint, is it OK? | is it wrong if I use span-x to define element width?
<div class="search span-7 prepend-17 last">
<fieldset>
<form action="index.php" method="get">
<input type="hidden" name="page" value="found"/>
<input class="span-4" type="text" MAXLENGTH="25" placeholder="Enter text to search" name="search"/>
<input class="span-3 last" type="submit" value="search" />
</form>
</fieldset>
</div> | css | blueprint-css | null | null | null | null | open | define element width with blueprint, is it OK?
===
is it wrong if I use span-x to define element width?
<div class="search span-7 prepend-17 last">
<fieldset>
<form action="index.php" method="get">
<input type="hidden" name="page" value="found"/>
<input class="span-4" type="text" MAXLENGTH="25" placeholder="Enter text to search" name="search"/>
<input class="span-3 last" type="submit" value="search" />
</form>
</fieldset>
</div> | 0 |
8,395,482 | 12/06/2011 04:50:24 | 182,228 | 10/01/2009 02:43:59 | 57 | 0 | SharePoint Foundation Setup in 32bit | I have Windows 7 Professional Version OS and i want to Setup SharePoint Foundation in my pc but Sharepoint so can anybody help me to do this ? I need to setup Sharepoint in 32 bit windows7 professional edition. | sharepoint | null | null | null | null | 12/06/2011 05:10:51 | off topic | SharePoint Foundation Setup in 32bit
===
I have Windows 7 Professional Version OS and i want to Setup SharePoint Foundation in my pc but Sharepoint so can anybody help me to do this ? I need to setup Sharepoint in 32 bit windows7 professional edition. | 2 |
5,806,784 | 04/27/2011 15:42:49 | 727,619 | 04/27/2011 15:42:49 | 1 | 0 | help!! y my echo not printing anything? :"( | my is the code in php ok?
i try bugging to see value is null ok?
so I rite this
echo if (isset($_Post[porduct]));
is not.
why?
| php | echo | null | null | null | 04/29/2011 04:12:33 | not a real question | help!! y my echo not printing anything? :"(
===
my is the code in php ok?
i try bugging to see value is null ok?
so I rite this
echo if (isset($_Post[porduct]));
is not.
why?
| 1 |
4,513,005 | 12/22/2010 19:38:17 | 551,623 | 12/22/2010 19:38:17 | 1 | 0 | simple rails code optimisation | <% if defined?(@club.name) && !(@club.name).nil? %>
<%= @club.name %>
<% else %>
clubs:
<% end %>
first line looks ugly. any help is appreciated. | ruby-on-rails | ruby | null | null | null | null | open | simple rails code optimisation
===
<% if defined?(@club.name) && !(@club.name).nil? %>
<%= @club.name %>
<% else %>
clubs:
<% end %>
first line looks ugly. any help is appreciated. | 0 |
5,964,539 | 05/11/2011 12:52:06 | 369,210 | 06/17/2010 10:28:43 | 1 | 0 | Good paid/free xmpp servers for chat + voice call capable android app | Plan to develop Android app with chat + voice call capabilities that will use the xmpp protocol.
Want the server to be linux supported and be able to access the database informations (like: history, user information...)
I'm more interested for the voice-call capabilities, is it server dependable? Does all the servers support that? If not is it easy to implement?
does both smack and asmack libraries support voice too?
Thanks. | android | xmpp | chat | smack | null | 08/20/2011 21:07:05 | off topic | Good paid/free xmpp servers for chat + voice call capable android app
===
Plan to develop Android app with chat + voice call capabilities that will use the xmpp protocol.
Want the server to be linux supported and be able to access the database informations (like: history, user information...)
I'm more interested for the voice-call capabilities, is it server dependable? Does all the servers support that? If not is it easy to implement?
does both smack and asmack libraries support voice too?
Thanks. | 2 |
7,937,861 | 10/29/2011 08:49:05 | 979,349 | 10/04/2011 21:29:05 | 1 | 1 | Thermal printer delay | I am trying to print on **thermal printer** via PrinterJob in Java on **Windows XP**, but after i have run program ,there is a big **delay before printing**. Someone ,please, help me. What can be the reason of this problem. | java | printing | windows-xp | delay | thermal-printer | 10/29/2011 17:34:41 | off topic | Thermal printer delay
===
I am trying to print on **thermal printer** via PrinterJob in Java on **Windows XP**, but after i have run program ,there is a big **delay before printing**. Someone ,please, help me. What can be the reason of this problem. | 2 |
2,543,024 | 03/30/2010 05:24:41 | 253,048 | 01/18/2010 09:04:54 | 6 | 0 | Novell EDirectory | How can it help in career | I am into microsoft technology and getting a project which is Implementation of IAM (Novell Edirectory). Does it makes sense to move from .Net as i have experience of 4 years now on it.
Since i dont have any knowledge as to how this tech is and how it can help me, so any suggestion or advice will help.
Thanks for your advice in advance. | novell | null | null | null | null | 01/30/2012 14:44:03 | not constructive | Novell EDirectory | How can it help in career
===
I am into microsoft technology and getting a project which is Implementation of IAM (Novell Edirectory). Does it makes sense to move from .Net as i have experience of 4 years now on it.
Since i dont have any knowledge as to how this tech is and how it can help me, so any suggestion or advice will help.
Thanks for your advice in advance. | 4 |
9,661,506 | 03/12/2012 03:46:43 | 468,904 | 10/07/2010 09:46:59 | 815 | 9 | Mapping a 2D space of 3D volumes to 1D space (a file) | I have a two dimensional array of three dimensional volumes. This two dimensional array represents a top-down view of all of the three dimensional volumes.
I want to save this data to a file in such a way that I can retrieve it very quickly. My problem is that the two dimensional array may change size and shape; it's not always nice and square. This tends to leave unused sections and quite a lot of them.
My method of retrieval is currently using the volume-level 2D view to locate volumes that need to be loaded, but I am having difficulty coming up with a good data structure and storage technique. Most of the methods I have come across require the 2D view to be of the same length and width or depend on the length or the width.
It may be worthy to note that I want to avoid unused space in the file and that I also want good locality for the mapped points. When mapping points, it is pretty common to come up with a solution which works but produces odd relationships; {0, 0} must not map to anything but {0} and {1, 0} should be pretty close to {0} and not something like {34}.
How would you go about doing this in a space and time efficient manner? | math | language-agnostic | data-structures | map | mapping | null | open | Mapping a 2D space of 3D volumes to 1D space (a file)
===
I have a two dimensional array of three dimensional volumes. This two dimensional array represents a top-down view of all of the three dimensional volumes.
I want to save this data to a file in such a way that I can retrieve it very quickly. My problem is that the two dimensional array may change size and shape; it's not always nice and square. This tends to leave unused sections and quite a lot of them.
My method of retrieval is currently using the volume-level 2D view to locate volumes that need to be loaded, but I am having difficulty coming up with a good data structure and storage technique. Most of the methods I have come across require the 2D view to be of the same length and width or depend on the length or the width.
It may be worthy to note that I want to avoid unused space in the file and that I also want good locality for the mapped points. When mapping points, it is pretty common to come up with a solution which works but produces odd relationships; {0, 0} must not map to anything but {0} and {1, 0} should be pretty close to {0} and not something like {34}.
How would you go about doing this in a space and time efficient manner? | 0 |
1,238,112 | 08/06/2009 10:30:45 | 135,877 | 07/09/2009 19:37:55 | 153 | 18 | How to get all available culture names in ASP.NET application | My ASP.NET application is localized ([by using resources][1]) to many cultures. What I need is to find all these cultures (in runtime) and for example fill a DropDownList.
I have code which does that in windows applications - buids collection of available cultures by seeking satellite assemblies.
But what about web apps? It's possibe to find satellite assemblies? Or this can be done some other way?
Any suggestions?
Thanks
[1]: http://msdn.microsoft.com/en-us/library/ms228208.aspx | asp.net | asp.net-2.0 | localization | null | null | null | open | How to get all available culture names in ASP.NET application
===
My ASP.NET application is localized ([by using resources][1]) to many cultures. What I need is to find all these cultures (in runtime) and for example fill a DropDownList.
I have code which does that in windows applications - buids collection of available cultures by seeking satellite assemblies.
But what about web apps? It's possibe to find satellite assemblies? Or this can be done some other way?
Any suggestions?
Thanks
[1]: http://msdn.microsoft.com/en-us/library/ms228208.aspx | 0 |
7,971,369 | 11/01/2011 18:50:02 | 1,023,866 | 11/01/2011 14:16:18 | 11 | 0 | Retrieve Values from http://m.facebook.com/ajax/dtsg.php | I need Retrieve Values from http://m.facebook.com/ajax/dtsg.php
page source of it contains
for (;;);"":"","token":"AQDUdkLT","expire":1320259533,"":"<body onload=document.body.innerHTML=42>"
token":"AQDUdkLT" is unique for each users,so i cant use php
i need some client side method to retrieve those values | jquery | ajax | facebook | null | null | 11/02/2011 18:44:56 | too localized | Retrieve Values from http://m.facebook.com/ajax/dtsg.php
===
I need Retrieve Values from http://m.facebook.com/ajax/dtsg.php
page source of it contains
for (;;);"":"","token":"AQDUdkLT","expire":1320259533,"":"<body onload=document.body.innerHTML=42>"
token":"AQDUdkLT" is unique for each users,so i cant use php
i need some client side method to retrieve those values | 3 |
10,049,609 | 04/06/2012 21:44:49 | 1,296,537 | 03/27/2012 20:19:04 | 6 | 0 | Does Anyone Know Of A Basic Java Socket Upload Script For Images? | I'm SOO close to finishing a pet project, this is the last part I need before I'm off to the races and can do without assistance at all. I feel so excited and muzzled at the same time because my needs to interact with the client side have slowed me down for weeks.
Is there a way to upload images without forwarding them to a script or putting my ftp details in my class? The last bit is just plain frightening to me when the host I'm on won't allow me to keep any sensitive files above root. So can a direct client -> server socket connect do the job I want?
Oh,I'm in noviceville when it comes to adding anything to jdk so a native approach on how I could go about this would be most helpful ^_^ Thanks. | java | image | sockets | upload | null | 04/09/2012 08:51:05 | too localized | Does Anyone Know Of A Basic Java Socket Upload Script For Images?
===
I'm SOO close to finishing a pet project, this is the last part I need before I'm off to the races and can do without assistance at all. I feel so excited and muzzled at the same time because my needs to interact with the client side have slowed me down for weeks.
Is there a way to upload images without forwarding them to a script or putting my ftp details in my class? The last bit is just plain frightening to me when the host I'm on won't allow me to keep any sensitive files above root. So can a direct client -> server socket connect do the job I want?
Oh,I'm in noviceville when it comes to adding anything to jdk so a native approach on how I could go about this would be most helpful ^_^ Thanks. | 3 |
7,798,318 | 10/17/2011 19:08:21 | 996,554 | 10/15/2011 06:20:09 | 1 | 0 | how to get common data based on two other field | I have a table with two name. NAME1 and NAME2 as author of a book
how can I get their common author names ?
For example
I have
John Marry
John Paul
John Nancy
John Alex
Paul Marry
Nancy Marry
I'm looking to get John Marry 2
| sql | null | null | null | null | 10/19/2011 15:46:19 | not a real question | how to get common data based on two other field
===
I have a table with two name. NAME1 and NAME2 as author of a book
how can I get their common author names ?
For example
I have
John Marry
John Paul
John Nancy
John Alex
Paul Marry
Nancy Marry
I'm looking to get John Marry 2
| 1 |
6,340,701 | 06/14/2011 08:02:21 | 649,216 | 03/08/2011 04:15:28 | 31 | 0 | How to integrate Google Map? | I'm trying to integrate google map api into my application(ASP.NET, C#), which allow me to show map in different pages in the application, please help...
thank you in advanced. | asp.net | google-maps | google | null | null | 06/16/2011 00:04:44 | not a real question | How to integrate Google Map?
===
I'm trying to integrate google map api into my application(ASP.NET, C#), which allow me to show map in different pages in the application, please help...
thank you in advanced. | 1 |
9,036,190 | 01/27/2012 15:57:03 | 965,138 | 09/26/2011 13:22:49 | 1 | 0 | Horizontal content slider with previous and next arrows on top right using jQuery | Hi All i want to build a simple custom horizontal content slider with just two links on top as Previous and Next to slide the content using jQuery,html and css. I want it to place in the sidebar in a small area of just 300 X 300 size which contains some information divided into different sections means in different content divs which needs to be slided. I searched a lot on it but i am getting lot of plugins for this. I dont want a plugin for this I want to achieve this using clean code using jquery. Because the content in the sliding divs may be loaded with ajax content. So I want a script which is more customizable. Please help me I want it in one of my current project. | jquery | html | css | null | null | 01/28/2012 21:23:57 | not a real question | Horizontal content slider with previous and next arrows on top right using jQuery
===
Hi All i want to build a simple custom horizontal content slider with just two links on top as Previous and Next to slide the content using jQuery,html and css. I want it to place in the sidebar in a small area of just 300 X 300 size which contains some information divided into different sections means in different content divs which needs to be slided. I searched a lot on it but i am getting lot of plugins for this. I dont want a plugin for this I want to achieve this using clean code using jquery. Because the content in the sliding divs may be loaded with ajax content. So I want a script which is more customizable. Please help me I want it in one of my current project. | 1 |
6,056,936 | 05/19/2011 10:01:53 | 395,676 | 07/19/2010 09:37:17 | 66 | 2 | To use Facebook Javascript or not | I'm planning to start a web app that uses the Facebook Python SDK. I found two examples in the sdk, newsfeed and oauth. Since im going to deploy the app at google appengine I'm confused to choose which one to base my project. The oauth example uses OAuth 2.0 directly and the newsfeed example rely on the cookie saved by the Facebook Javascript SDK to get the user id of active user. Which one of the two examples will you prefer if you want your app to be less cpu intensive? | python | facebook | oauth | null | null | 05/21/2011 23:04:59 | not constructive | To use Facebook Javascript or not
===
I'm planning to start a web app that uses the Facebook Python SDK. I found two examples in the sdk, newsfeed and oauth. Since im going to deploy the app at google appengine I'm confused to choose which one to base my project. The oauth example uses OAuth 2.0 directly and the newsfeed example rely on the cookie saved by the Facebook Javascript SDK to get the user id of active user. Which one of the two examples will you prefer if you want your app to be less cpu intensive? | 4 |
8,857,395 | 01/13/2012 21:20:33 | 241,060 | 12/30/2009 17:35:18 | 405 | 28 | Process Signals & Slots Using a Thread | I need to be able make a request GET request, which requires the use of signals to process the replies, and return the reply back in a a processed form. I've structured the code as described in [Threading Wihtout the Headache][1], but when I run the reply is never received or processed.
// Set-up request
QNetworkAccessManager* pConnection(new QNetworkAccessManager());
connect(pConnection,
SIGNAL(finished(QNetworkReply*)),
this,
SLOT(process(QNetworkReply*)));
QUrl url;
url.setUrl(HOST);
url.addQueryItem("P1", "Hi");
url.addQueryItem("P2", "Bob");
// Send request
QNetworkRequest request(url);
pConnection->get(request);
// Wait for reply
QThread* pResponce(new QThread(this));
connect(this,
SIGNAL(processingFinished()),
pResponce,
SLOT(quit()));
pConnection->moveToThread(pResponce);
pResponce->start();
pResponce->wait();
pConnection->deleteLater();
pResponce->deleteLater();
return this->processedReply;
Obviously I'm missing something, but what? It works when I'm not using the threads (and the deletes), so it's not the URL or server.
[1]: http://labs.qt.nokia.com/2006/12/04/threading-without-the-headache/ "Qt Threading Example" | c++ | multithreading | qt | null | null | null | open | Process Signals & Slots Using a Thread
===
I need to be able make a request GET request, which requires the use of signals to process the replies, and return the reply back in a a processed form. I've structured the code as described in [Threading Wihtout the Headache][1], but when I run the reply is never received or processed.
// Set-up request
QNetworkAccessManager* pConnection(new QNetworkAccessManager());
connect(pConnection,
SIGNAL(finished(QNetworkReply*)),
this,
SLOT(process(QNetworkReply*)));
QUrl url;
url.setUrl(HOST);
url.addQueryItem("P1", "Hi");
url.addQueryItem("P2", "Bob");
// Send request
QNetworkRequest request(url);
pConnection->get(request);
// Wait for reply
QThread* pResponce(new QThread(this));
connect(this,
SIGNAL(processingFinished()),
pResponce,
SLOT(quit()));
pConnection->moveToThread(pResponce);
pResponce->start();
pResponce->wait();
pConnection->deleteLater();
pResponce->deleteLater();
return this->processedReply;
Obviously I'm missing something, but what? It works when I'm not using the threads (and the deletes), so it's not the URL or server.
[1]: http://labs.qt.nokia.com/2006/12/04/threading-without-the-headache/ "Qt Threading Example" | 0 |
4,079,387 | 11/02/2010 15:44:57 | 346,804 | 05/21/2010 06:11:16 | 430 | 15 | VS2010 Add-in cpp/h automatic tab groups | Is there any Visual Studio 2010 add-in that will automatically group cpp and header files in different tab-groups, and also maybe automatically open/close corresponding cpp/header files when opening a certain file? | c++ | visual-studio-2010 | add-in | null | null | null | open | VS2010 Add-in cpp/h automatic tab groups
===
Is there any Visual Studio 2010 add-in that will automatically group cpp and header files in different tab-groups, and also maybe automatically open/close corresponding cpp/header files when opening a certain file? | 0 |
11,532,788 | 07/18/2012 00:38:46 | 1,228,044 | 02/23/2012 10:07:42 | 1 | 1 | SQL to work with ASP.net | I am trying to query a familiar database "Northwind". I have made a dbml for Products. class1.vb will not take the ***
> Me.Products
*** The error code says: "Expression of type 'Object' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider."
The second thing is in Default.aspx.vb. The ***
> db.Products
*** must have a "Private" tag. Error code: "'Northwind.NorthwindDataContext.Products' is not accessible in this context because it is 'Private'
***class1.vb***
Imports System.Linq
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Public Class NorthwindDataContext
Dim Products As Object
Public Function GetProductsByCategory(ByVal id1 As Integer) As IEnumerable(Of Product)
Return From p In Me.Products _
Where p.ProductID = id1 _
Select p
End Function
End Class
***Default.aspx.vb***
Imports System.Linq
Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class _Default
Inherits System.Web.UI.Page
Private Products, Product As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As New NorthwindDataContext
Dim product = From p In db.Products _
Select p
GridView1.DataSource = product
GridView1.DataBind()
End Sub
End Class | asp.net | sql | database | dbml | null | 07/18/2012 14:14:49 | not a real question | SQL to work with ASP.net
===
I am trying to query a familiar database "Northwind". I have made a dbml for Products. class1.vb will not take the ***
> Me.Products
*** The error code says: "Expression of type 'Object' is not queryable. Make sure you are not missing an assembly reference and/or namespace import for the LINQ provider."
The second thing is in Default.aspx.vb. The ***
> db.Products
*** must have a "Private" tag. Error code: "'Northwind.NorthwindDataContext.Products' is not accessible in this context because it is 'Private'
***class1.vb***
Imports System.Linq
Imports System.Web.UI
Imports System.Web.UI.WebControls
Partial Public Class NorthwindDataContext
Dim Products As Object
Public Function GetProductsByCategory(ByVal id1 As Integer) As IEnumerable(Of Product)
Return From p In Me.Products _
Where p.ProductID = id1 _
Select p
End Function
End Class
***Default.aspx.vb***
Imports System.Linq
Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class _Default
Inherits System.Web.UI.Page
Private Products, Product As String
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim db As New NorthwindDataContext
Dim product = From p In db.Products _
Select p
GridView1.DataSource = product
GridView1.DataBind()
End Sub
End Class | 1 |
5,022,902 | 02/16/2011 22:27:10 | 567,435 | 01/07/2011 20:20:53 | 34 | 0 | Problem With AND condition | Code Below:
if(var != "" && var.startswith("somestring"))
{ do something }
This code is troubling; as far as my understanding var != "" will be evaluated first and then if true then the other part will be evaluated but this concept is not working seems :)
If var is having a value null then I am getting an "nullreferrence" exception; which means
var != null is not getting evaluated.
Please Help.
Thanks,
Rahul | c#-2.0 | null | null | null | null | 01/16/2012 05:25:28 | too localized | Problem With AND condition
===
Code Below:
if(var != "" && var.startswith("somestring"))
{ do something }
This code is troubling; as far as my understanding var != "" will be evaluated first and then if true then the other part will be evaluated but this concept is not working seems :)
If var is having a value null then I am getting an "nullreferrence" exception; which means
var != null is not getting evaluated.
Please Help.
Thanks,
Rahul | 3 |
5,142,030 | 02/28/2011 12:33:38 | 364,957 | 06/11/2010 21:52:20 | 5 | 0 | Why does the resolved IP of youtube.com direct to google.com? | This might be a really stupid question, but I'm curious.
A ping of youtube.com showed the resolved IP to be 74.125.127.93. Now, if you access this IP in a browser http://74.125.127.93/ you would expect the youtube page to show up. Instead the search engine shows up.
Can someone explain what's going on behind the curtain?
Thanks. | google-maps | ping | null | null | null | 02/28/2011 20:28:54 | off topic | Why does the resolved IP of youtube.com direct to google.com?
===
This might be a really stupid question, but I'm curious.
A ping of youtube.com showed the resolved IP to be 74.125.127.93. Now, if you access this IP in a browser http://74.125.127.93/ you would expect the youtube page to show up. Instead the search engine shows up.
Can someone explain what's going on behind the curtain?
Thanks. | 2 |
8,088,665 | 11/11/2011 01:32:48 | 151,178 | 08/05/2009 16:28:53 | 26 | 1 | What is the consequence to customers of removing an iPhone app from the store | If we remove one of our apps from the iPhone app store what is the effect on all the people who have previously purchased the app. In other words if they change devices, or lose their phone and sign in with the same account used to buy our app, will they still be able to download it from the store? Or is it completely eliminated from Apple's servers?
| iphone | app-store | null | null | null | 12/06/2011 04:25:35 | off topic | What is the consequence to customers of removing an iPhone app from the store
===
If we remove one of our apps from the iPhone app store what is the effect on all the people who have previously purchased the app. In other words if they change devices, or lose their phone and sign in with the same account used to buy our app, will they still be able to download it from the store? Or is it completely eliminated from Apple's servers?
| 2 |
7,169,577 | 08/24/2011 01:47:41 | 903,471 | 08/20/2011 05:58:02 | 15 | 0 | why does c# have more books about LINQ than vb | I'm starting a new project to handle info from some text files, a kind of sorting module so I'd like to give it a try using LINQ but looking for a book I realized that there are more c# books than vb, so I wonder if c# have better support or if it is more suitable than vb.
You think there is some advance on use c# or vb.
thanks. | c# | vb.net | linq | null | null | 08/24/2011 02:07:17 | not constructive | why does c# have more books about LINQ than vb
===
I'm starting a new project to handle info from some text files, a kind of sorting module so I'd like to give it a try using LINQ but looking for a book I realized that there are more c# books than vb, so I wonder if c# have better support or if it is more suitable than vb.
You think there is some advance on use c# or vb.
thanks. | 4 |
4,075,852 | 11/02/2010 08:05:19 | 125,713 | 06/19/2009 12:36:57 | 450 | 24 | Best free XSLT editor for eclipse? | Which is the best free solution for XSLT editing in Eclipse? | xml | eclipse | xslt | plugins | null | 06/09/2012 16:53:52 | not constructive | Best free XSLT editor for eclipse?
===
Which is the best free solution for XSLT editing in Eclipse? | 4 |
3,556,391 | 08/24/2010 12:30:07 | 141,835 | 07/21/2009 07:53:45 | 612 | 33 | Multiple web forms vs jquery selectors | I'm reading Steven Sanderson's book *Pro ASP.NET MVC 2 Framework*.
In his book, he use multiple web forms on a single web page to list products from database and provide *Add to cart* functionality.
When should I take this approach vs having single web form and using jquery selectors to add certain products to shopping cart?<br />
Thank you for your help! | jquery | asp.net-mvc | null | null | null | null | open | Multiple web forms vs jquery selectors
===
I'm reading Steven Sanderson's book *Pro ASP.NET MVC 2 Framework*.
In his book, he use multiple web forms on a single web page to list products from database and provide *Add to cart* functionality.
When should I take this approach vs having single web form and using jquery selectors to add certain products to shopping cart?<br />
Thank you for your help! | 0 |
4,509,165 | 12/22/2010 12:30:01 | 460,139 | 09/28/2010 03:21:23 | 9 | 2 | Page not viewable in normal browser | How to make a page that is not viewable in a normal browser. I seen it in a hacking challenge. I have to use telnet command to view that page. I want to create that kind of page. | security | null | null | null | null | 12/22/2010 15:50:34 | not a real question | Page not viewable in normal browser
===
How to make a page that is not viewable in a normal browser. I seen it in a hacking challenge. I have to use telnet command to view that page. I want to create that kind of page. | 1 |
272,233 | 11/07/2008 14:31:30 | 11,677 | 09/16/2008 10:09:26 | 353 | 13 | "File -X: does not exist" message from ipy.exe in Windows PowerShell | If I type this line in an MS-DOS command prompt window:
ipy -X:ColorfulConsole
IronPython starts up as expected with the colorful console option enabled. However, if I type the same line in Windows PowerShell I get the message:
File -X: does not exist
Can someone explain what I'm doing wrong? | ironpython | powershell | python | null | null | null | open | "File -X: does not exist" message from ipy.exe in Windows PowerShell
===
If I type this line in an MS-DOS command prompt window:
ipy -X:ColorfulConsole
IronPython starts up as expected with the colorful console option enabled. However, if I type the same line in Windows PowerShell I get the message:
File -X: does not exist
Can someone explain what I'm doing wrong? | 0 |
7,535,430 | 09/23/2011 22:23:09 | 373,428 | 06/22/2010 17:06:15 | 118 | 10 | Ruby and a Math Problem | Lets say I have to have a cart with a subtotal of 1836.36. I must achieve this exact amount by adding up several products from a list with a range of prices. Say, I have a few products at 9.99, 29.99, 59.99 and I can add several of each to meet the desired subtotal. How would one approach this problem using Ruby? I've thought of feeding the list of prices into a script and somehow getting the script to add until it reaches the subtotal and then spit out the prices required to reach the subtotal... just not sure how to approach it.
Any suggestions are welcome and thanks in advance. Looking forward to ideas. | ruby | math | e-commerce | subtotal | null | null | open | Ruby and a Math Problem
===
Lets say I have to have a cart with a subtotal of 1836.36. I must achieve this exact amount by adding up several products from a list with a range of prices. Say, I have a few products at 9.99, 29.99, 59.99 and I can add several of each to meet the desired subtotal. How would one approach this problem using Ruby? I've thought of feeding the list of prices into a script and somehow getting the script to add until it reaches the subtotal and then spit out the prices required to reach the subtotal... just not sure how to approach it.
Any suggestions are welcome and thanks in advance. Looking forward to ideas. | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.