PostId int64 13 11.8M | PostCreationDate stringlengths 19 19 | OwnerUserId int64 3 1.57M | OwnerCreationDate stringlengths 10 19 | ReputationAtPostCreation int64 -33 210k | OwnerUndeletedAnswerCountAtPostTime int64 0 5.77k | Title stringlengths 10 250 | BodyMarkdown stringlengths 12 30k | Tag1 stringlengths 1 25 ⌀ | Tag2 stringlengths 1 25 ⌀ | Tag3 stringlengths 1 25 ⌀ | Tag4 stringlengths 1 25 ⌀ | Tag5 stringlengths 1 25 ⌀ | PostClosedDate stringlengths 19 19 ⌀ | OpenStatus stringclasses 5 values | unified_texts stringlengths 47 30.1k | OpenStatus_id int64 0 4 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7,632,251 | 10/03/2011 07:40:45 | 406,659 | 07/30/2010 11:15:29 | 978 | 28 | Free & Private Version Control | Any good Git or Subversion for non-public/non-open project. I have narrowed it down to these three. Now which of the 3 would you recommend. I am looking for secure, with a good up-time, private, support for 3-4 users and 1 repository and a space of about >200-300 MB
1. **assembla** - http://offers.assembla.com/free-subversion-hosting/
2. **unfuddle** - http://unfuddle.com/about/tour/plans
3. **xp-dev** - http://xp-dev.com/pricing
I know GitHub is awesome for but it's free for public/open projects only and Google Code is only for open project. Am i right over here and what about SoundForge is it also for public projects. | php | git | svn | version-control | null | 10/03/2011 07:51:48 | off topic | Free & Private Version Control
===
Any good Git or Subversion for non-public/non-open project. I have narrowed it down to these three. Now which of the 3 would you recommend. I am looking for secure, with a good up-time, private, support for 3-4 users and 1 repository and a space of about >200-300 MB
1. **assembla** - http://offers.assembla.com/free-subversion-hosting/
2. **unfuddle** - http://unfuddle.com/about/tour/plans
3. **xp-dev** - http://xp-dev.com/pricing
I know GitHub is awesome for but it's free for public/open projects only and Google Code is only for open project. Am i right over here and what about SoundForge is it also for public projects. | 2 |
1,304,113 | 08/20/2009 05:26:48 | 159,005 | 08/19/2009 06:18:13 | 1 | 2 | How do I speed up my Ruby application? | I am making a data intensive web application that I am trying to optimize. I've heard of forking and threading, but I have no idea whether they are applicable to what I am trying to do and if so how to implement them. My code looks like this:
def search
@amazon_data=Hash.from_xml(item.retrieve_amazon(params[:sku]))
unless @amazon_data['results'] == nil
@amazon_data['results']['item'].size.times do |i|
@all_books << { :vendor => 'Amazon.com',
:price => @amazon_data['results']['item'][i]['price'].to_f,
:shipping => @amazon_data['results']['item'][i]['ship'].to_f,
:condition => @amazon_data['results']['item'][i]['condition'],
:total => @amazon_data['results']['item'][i]['price'].to_f + @amazon_data['results']['item'][i]['ship'].to_f,
:availability => 'In Stock',
:link_text => 'Go to Amazon.com',
:link_url => "http://www.amazon.com/gp/offer-listing/#{params[:isbn]}"
}
end
end
@ebay_data=Hash.from_xml(Book.retrieve_ebay(params[:sku]))
unless @ebay_data['results'] == nil
@ebay_data['results']['item'].size.times do |i|
@all_books << { :vendor => 'eBay',
:price => @ebay_data['results']['item'][i]['price'].to_f,
:shipping => @ebay_data['results']['item'][i]['ship'].to_f,
:condition => 'Used',
:total => @ebay_data['results']['item'][i]['price'].to_f + @ebay_data['results']['item'][i]['ship'].to_f,
:availability => 'In Stock',
:link_text => 'Go to eBay',
:link_url => "http://www.amazon.com/gp/offer-listing/#{params[:sku]}"
}
end
end
end
So, basically what I have are two actions that retrieve data from eBay and Amazon and parse it here. How might I make both of these actions run at once? Do fork or thread have anything to do with what I am trying to accomplish? | ruby-on-rails | performance | fork | multithreading | null | null | open | How do I speed up my Ruby application?
===
I am making a data intensive web application that I am trying to optimize. I've heard of forking and threading, but I have no idea whether they are applicable to what I am trying to do and if so how to implement them. My code looks like this:
def search
@amazon_data=Hash.from_xml(item.retrieve_amazon(params[:sku]))
unless @amazon_data['results'] == nil
@amazon_data['results']['item'].size.times do |i|
@all_books << { :vendor => 'Amazon.com',
:price => @amazon_data['results']['item'][i]['price'].to_f,
:shipping => @amazon_data['results']['item'][i]['ship'].to_f,
:condition => @amazon_data['results']['item'][i]['condition'],
:total => @amazon_data['results']['item'][i]['price'].to_f + @amazon_data['results']['item'][i]['ship'].to_f,
:availability => 'In Stock',
:link_text => 'Go to Amazon.com',
:link_url => "http://www.amazon.com/gp/offer-listing/#{params[:isbn]}"
}
end
end
@ebay_data=Hash.from_xml(Book.retrieve_ebay(params[:sku]))
unless @ebay_data['results'] == nil
@ebay_data['results']['item'].size.times do |i|
@all_books << { :vendor => 'eBay',
:price => @ebay_data['results']['item'][i]['price'].to_f,
:shipping => @ebay_data['results']['item'][i]['ship'].to_f,
:condition => 'Used',
:total => @ebay_data['results']['item'][i]['price'].to_f + @ebay_data['results']['item'][i]['ship'].to_f,
:availability => 'In Stock',
:link_text => 'Go to eBay',
:link_url => "http://www.amazon.com/gp/offer-listing/#{params[:sku]}"
}
end
end
end
So, basically what I have are two actions that retrieve data from eBay and Amazon and parse it here. How might I make both of these actions run at once? Do fork or thread have anything to do with what I am trying to accomplish? | 0 |
3,914,165 | 10/12/2010 11:33:10 | 373,179 | 06/22/2010 12:55:16 | 3 | 0 | PHPPowerPoint generating Tables and Graphs within the PPT | I am using PHPPowerPoint to generate PPT files from PHP and it visually does the job very well, I am looking for a way of generating tables and graphs that are editable within the powerpoint program.
I anyone can help or lead me towards a linux/php binary/class that can accomplish this i would be most grateful.
Best regards
Daniel | php | graph | table | powerpoint | generating | null | open | PHPPowerPoint generating Tables and Graphs within the PPT
===
I am using PHPPowerPoint to generate PPT files from PHP and it visually does the job very well, I am looking for a way of generating tables and graphs that are editable within the powerpoint program.
I anyone can help or lead me towards a linux/php binary/class that can accomplish this i would be most grateful.
Best regards
Daniel | 0 |
2,831,350 | 05/14/2010 01:38:15 | 318,133 | 04/16/2010 01:34:44 | 8 | 2 | GtkTextView size | How do I set the size of GtKTextView? I think I can't use gtk_widget_set_usize. | gtktextview | null | null | null | null | null | open | GtkTextView size
===
How do I set the size of GtKTextView? I think I can't use gtk_widget_set_usize. | 0 |
9,860,630 | 03/25/2012 13:47:39 | 388,086 | 07/09/2010 19:52:39 | 443 | 34 | Javascript smooth scroll iPad | i use this code,
to scroll overflow div (hidden) in ipad , and works expect its not smooth , is there any way i can make it smooth scroll ?
function initMobileScroll(ele) {
var mobileScrollArea = document.getElementById(ele);
mobileScrollArea.addEventListener('touchstart', function(event){
touchstart (event);
});
mobileScrollArea.addEventListener('touchmove', function(event){
touchmove (event);
});
// let’s set the starting point when someone first touches
function touchstart (e) {
startY = e.touches[0].pageY;
startX = e.touches[0].pageX;
}
// calls repeatedly while the user’s finger is moving
function touchmove(e) {
var touches = e.touches[0];
// override the touch event’s normal functionality
e.preventDefault();
// y-axis
var touchMovedY = startY - touches.pageY;
startY = touches.pageY; // reset startY for the next call
mobileScrollArea.scrollTop = mobileScrollArea.scrollTop + touchMovedY;
// x-axis
var touchMovedX = startX - touches.pageX;
startX = touches.pageX; // reset startX for the next call
mobileScrollArea.scrollLeft = mobileScrollArea.scrollLeft + touchMovedX;
}
}
code source : http://www.flexmls.com/developers/2011/04/13/ipad-and-single-finger-scrolling-in-flexmls/ | javascript | ipad | safari | null | null | null | open | Javascript smooth scroll iPad
===
i use this code,
to scroll overflow div (hidden) in ipad , and works expect its not smooth , is there any way i can make it smooth scroll ?
function initMobileScroll(ele) {
var mobileScrollArea = document.getElementById(ele);
mobileScrollArea.addEventListener('touchstart', function(event){
touchstart (event);
});
mobileScrollArea.addEventListener('touchmove', function(event){
touchmove (event);
});
// let’s set the starting point when someone first touches
function touchstart (e) {
startY = e.touches[0].pageY;
startX = e.touches[0].pageX;
}
// calls repeatedly while the user’s finger is moving
function touchmove(e) {
var touches = e.touches[0];
// override the touch event’s normal functionality
e.preventDefault();
// y-axis
var touchMovedY = startY - touches.pageY;
startY = touches.pageY; // reset startY for the next call
mobileScrollArea.scrollTop = mobileScrollArea.scrollTop + touchMovedY;
// x-axis
var touchMovedX = startX - touches.pageX;
startX = touches.pageX; // reset startX for the next call
mobileScrollArea.scrollLeft = mobileScrollArea.scrollLeft + touchMovedX;
}
}
code source : http://www.flexmls.com/developers/2011/04/13/ipad-and-single-finger-scrolling-in-flexmls/ | 0 |
7,437,522 | 09/15/2011 21:14:55 | 701,632 | 04/11/2011 05:57:32 | 75 | 3 | allow someone to see private github repo w/o ability to affect the repo | Hi I'm trying to let someone see private repo code but dont want to make my repo public and dont want them to have the ability to change stuff. Is this possible? I looked in the "admin" section of the site and didn't find anything suitable. Thanks guys. | github | null | null | null | null | null | open | allow someone to see private github repo w/o ability to affect the repo
===
Hi I'm trying to let someone see private repo code but dont want to make my repo public and dont want them to have the ability to change stuff. Is this possible? I looked in the "admin" section of the site and didn't find anything suitable. Thanks guys. | 0 |
11,430,570 | 07/11/2012 10:23:30 | 316,300 | 04/14/2010 08:36:49 | 2,594 | 105 | Why is OfType<> faster than Cast<>? | In answer to the following question:
http://stackoverflow.com/questions/11416191/how-to-convert-matchcollection-to-string-array/11416739#comment15078364_11416739
Given The two Linq expressions:
var arr = Regex.Matches(strText, @"\b[A-Za-z-']+\b")
.OfType<Match>() //OfType
.Select(m => m.Groups[0].Value)
.ToArray();
and
var arr = Regex.Matches(strText, @"\b[A-Za-z-']+\b")
.Cast<Match>() //Cast
.Select(m => m.Groups[0].Value)
.ToArray();
OfType<> was benchmarked by user [Alex][1] to be slightly faster (and confirmed by myself).
This seems counterintuitive to me, as I'd have thought OfType<> would have to do both an 'is' comparison, *and* a cast (T).
Any enlightenment would be appreciated as to why this is the case :)
[1]: http://stackoverflow.com/users/999042/alex | c# | linq | null | null | null | 07/14/2012 04:24:11 | not constructive | Why is OfType<> faster than Cast<>?
===
In answer to the following question:
http://stackoverflow.com/questions/11416191/how-to-convert-matchcollection-to-string-array/11416739#comment15078364_11416739
Given The two Linq expressions:
var arr = Regex.Matches(strText, @"\b[A-Za-z-']+\b")
.OfType<Match>() //OfType
.Select(m => m.Groups[0].Value)
.ToArray();
and
var arr = Regex.Matches(strText, @"\b[A-Za-z-']+\b")
.Cast<Match>() //Cast
.Select(m => m.Groups[0].Value)
.ToArray();
OfType<> was benchmarked by user [Alex][1] to be slightly faster (and confirmed by myself).
This seems counterintuitive to me, as I'd have thought OfType<> would have to do both an 'is' comparison, *and* a cast (T).
Any enlightenment would be appreciated as to why this is the case :)
[1]: http://stackoverflow.com/users/999042/alex | 4 |
2,783,786 | 05/06/2010 19:18:23 | 240,337 | 12/29/2009 17:17:16 | 169 | 3 | C++: Everytime I read in by fstream I got 1 extra character at the end | Everytime I read in by fstream I got 1 extra character at the end, How can I avoid this? | c++ | fstream | null | null | null | null | open | C++: Everytime I read in by fstream I got 1 extra character at the end
===
Everytime I read in by fstream I got 1 extra character at the end, How can I avoid this? | 0 |
10,271,836 | 04/22/2012 20:27:53 | 1,275,087 | 03/16/2012 22:50:14 | 16 | 0 | Load an external div or ul into a own webpage - from google/yahoo/facebook |
<br/>
Hey
Is it possible to get the content from a div or ul from another / external page (e.g. google facebook yahoo ...) if you know the page and the id from the div or ul?
if you use php - include, you'll include the whole page ... (too much)
with jquery .load(), i guess it is possible. Only i think it is slow and it will only work for webpages from the same domainname (not yahoo. bbc ....)
Can someone help me? or has someone more experience with it?
<br/>
Kind regards | php | jquery | include | null | null | 04/23/2012 02:46:24 | not a real question | Load an external div or ul into a own webpage - from google/yahoo/facebook
===
<br/>
Hey
Is it possible to get the content from a div or ul from another / external page (e.g. google facebook yahoo ...) if you know the page and the id from the div or ul?
if you use php - include, you'll include the whole page ... (too much)
with jquery .load(), i guess it is possible. Only i think it is slow and it will only work for webpages from the same domainname (not yahoo. bbc ....)
Can someone help me? or has someone more experience with it?
<br/>
Kind regards | 1 |
10,114,681 | 04/11/2012 22:09:04 | 630,413 | 02/23/2011 15:07:03 | 399 | 6 | Merge arrays from a function that calls it self | So I'm playing with Googles YouTube API and I want to return all subscriptions from a user.
I have built this function that gets the subscriptions (max 50) and calls it self to get more if the user has over 50 subscriptions.
But I can't figure out how to merge the arrays from each function call. (see the while loop in the end).
As it works now the new arrays will just overwrite the old ones but I have tried adding the arrays to a main array and returning it but that will just place the arrays in them self.
The foreach loop returns an array that looks like this:
Array
(
[0] => Array
(
[channelName] => break
[channelLink] => https://www.youtube.com/channel/UClmmbesFjIzJAp8NQCtt8dQ
)
[1] => Array
(
[channelName] => kn0thing
[channelLink] => https://www.youtube.com/channel/UClmmbesFjIzJAp8NQCtt8dQ
)
[2] => Array
(
[channelName] => EpicMealTime
[channelLink] => https://www.youtube.com/channel/UClmmbesFjIzJAp8NQCtt8dQ
)
)
So the problem is the while loop. Got any ideas?
// Get an array with videos from a certain user
function getUserSubscriptions($username = false, $startIndex = 1, $maxResults = 50) {
// if username is not set
if(!$username) return false;
// get users 50 first subscriptions
// Use start-index to get the rest
$ch = curl_init('https://gdata.youtube.com/feeds/api/users/'.$username.'/subscriptions?v=2&max-results='.$maxResults.'&start-index='.$startIndex);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$subscriptionsXML = curl_exec($ch);
curl_close($ch);
// convert xml to array
$subscriptionsArray = XMLtoArray($subscriptionsXML);
// Ge total number of subscriptions
$totalNumberOfSubscriptions = $subscriptionsArray['FEED']['OPENSEARCH:TOTALRESULTS'];
// Parse array and clean it up
// $s = 0;
$l = 0;
foreach($subscriptionsArray['FEED']['ENTRY'] as $subscriptionArray) {
// get link
foreach($subscriptionArray['LINK'] as $channelLinks) {
$channelLinkArray[$l] = $channelLinks;
$l++;
}
// save all into a more beautiful array and return it
$subscription[$s]['channelName'] = $subscriptionArray['YT:USERNAME']['DISPLAY'];
$subscription[$s]['channelLink'] = $channelLinkArray[1]['HREF'];
$s++;
}
// if we did not get all subscriptions, call the function again
// but this time increase the startIndex
while($totalNumberOfSubscriptions >= $startIndex) {
$startIndex = $startIndex+$maxResults;
$subscription = getUserSubscriptions($username, $startIndex);
}
return $subscription;
} | php | google | youtube-api | null | null | null | open | Merge arrays from a function that calls it self
===
So I'm playing with Googles YouTube API and I want to return all subscriptions from a user.
I have built this function that gets the subscriptions (max 50) and calls it self to get more if the user has over 50 subscriptions.
But I can't figure out how to merge the arrays from each function call. (see the while loop in the end).
As it works now the new arrays will just overwrite the old ones but I have tried adding the arrays to a main array and returning it but that will just place the arrays in them self.
The foreach loop returns an array that looks like this:
Array
(
[0] => Array
(
[channelName] => break
[channelLink] => https://www.youtube.com/channel/UClmmbesFjIzJAp8NQCtt8dQ
)
[1] => Array
(
[channelName] => kn0thing
[channelLink] => https://www.youtube.com/channel/UClmmbesFjIzJAp8NQCtt8dQ
)
[2] => Array
(
[channelName] => EpicMealTime
[channelLink] => https://www.youtube.com/channel/UClmmbesFjIzJAp8NQCtt8dQ
)
)
So the problem is the while loop. Got any ideas?
// Get an array with videos from a certain user
function getUserSubscriptions($username = false, $startIndex = 1, $maxResults = 50) {
// if username is not set
if(!$username) return false;
// get users 50 first subscriptions
// Use start-index to get the rest
$ch = curl_init('https://gdata.youtube.com/feeds/api/users/'.$username.'/subscriptions?v=2&max-results='.$maxResults.'&start-index='.$startIndex);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$subscriptionsXML = curl_exec($ch);
curl_close($ch);
// convert xml to array
$subscriptionsArray = XMLtoArray($subscriptionsXML);
// Ge total number of subscriptions
$totalNumberOfSubscriptions = $subscriptionsArray['FEED']['OPENSEARCH:TOTALRESULTS'];
// Parse array and clean it up
// $s = 0;
$l = 0;
foreach($subscriptionsArray['FEED']['ENTRY'] as $subscriptionArray) {
// get link
foreach($subscriptionArray['LINK'] as $channelLinks) {
$channelLinkArray[$l] = $channelLinks;
$l++;
}
// save all into a more beautiful array and return it
$subscription[$s]['channelName'] = $subscriptionArray['YT:USERNAME']['DISPLAY'];
$subscription[$s]['channelLink'] = $channelLinkArray[1]['HREF'];
$s++;
}
// if we did not get all subscriptions, call the function again
// but this time increase the startIndex
while($totalNumberOfSubscriptions >= $startIndex) {
$startIndex = $startIndex+$maxResults;
$subscription = getUserSubscriptions($username, $startIndex);
}
return $subscription;
} | 0 |
7,387,651 | 09/12/2011 12:12:42 | 918,064 | 09/28/2010 16:46:41 | 6 | 0 | Linq Grouping Question | I'm working on a simple reservation system for meeting room. Each meeting room is assigned a room type depending on it's size etc. I'm looking to shape the count of booked rooms from the following:
01/01/2011 1 Room A 2
01/01/2011 2 Room B 5
01/01/2011 3 Room C 3
01/01/2011 4 Room D 2
01/01/2011 5 Room E 1
01/01/2011 6 Room F 5
02/01/2011 1 Room A 3
02/01/2011 2 Room B 5
02/01/2011 3 Room C 2
02/01/2011 4 Room D 5
02/01/2011 5 Room E 2
02/01/2011 6 Room F 2
03/01/2011 1 Room A 2
03/01/2011 2 Room B 5
03/01/2011 3 Room C 2
Into grouped data such as:
Date Room A Room B Room C Room D Room E Room F
01/01/2011 2 5 3 2 1 5
02/01/2011 3 5 2 5 2 2
03/01/2011 2 5 2 4 5 8
04/01/2011 4 7 3 5 2 2
I've managed to do this previously using Datasets, but I need to be able to do this in Linq for this project using Linq to entites
Can somebody advise the best way to do this?
Thanks
| linq | entity-framework | linq-to-entities | null | null | null | open | Linq Grouping Question
===
I'm working on a simple reservation system for meeting room. Each meeting room is assigned a room type depending on it's size etc. I'm looking to shape the count of booked rooms from the following:
01/01/2011 1 Room A 2
01/01/2011 2 Room B 5
01/01/2011 3 Room C 3
01/01/2011 4 Room D 2
01/01/2011 5 Room E 1
01/01/2011 6 Room F 5
02/01/2011 1 Room A 3
02/01/2011 2 Room B 5
02/01/2011 3 Room C 2
02/01/2011 4 Room D 5
02/01/2011 5 Room E 2
02/01/2011 6 Room F 2
03/01/2011 1 Room A 2
03/01/2011 2 Room B 5
03/01/2011 3 Room C 2
Into grouped data such as:
Date Room A Room B Room C Room D Room E Room F
01/01/2011 2 5 3 2 1 5
02/01/2011 3 5 2 5 2 2
03/01/2011 2 5 2 4 5 8
04/01/2011 4 7 3 5 2 2
I've managed to do this previously using Datasets, but I need to be able to do this in Linq for this project using Linq to entites
Can somebody advise the best way to do this?
Thanks
| 0 |
5,419,132 | 03/24/2011 12:32:18 | 56 | 08/01/2008 13:53:45 | 1,971 | 33 | Is there a way to ensure no implicit culture settings are used? | I have some classes which can't make assumptions about de used culture. These classes should always use `CultureInfo.InvariantCulture`. However, I can't set the thread's current culture to `CultureInfo.InvariantCulture`, because other classes rely on `<globalization culture="auto"`.
Is there a way to ensure some classes always use explicit culture method calls (like: `Convert.ToDecimal(value, CultureInfo.InvariantCulture)`) instead of assumed culture (like: `Convert.ToDecimal(value)`). | c# | .net | asp.net | null | null | null | open | Is there a way to ensure no implicit culture settings are used?
===
I have some classes which can't make assumptions about de used culture. These classes should always use `CultureInfo.InvariantCulture`. However, I can't set the thread's current culture to `CultureInfo.InvariantCulture`, because other classes rely on `<globalization culture="auto"`.
Is there a way to ensure some classes always use explicit culture method calls (like: `Convert.ToDecimal(value, CultureInfo.InvariantCulture)`) instead of assumed culture (like: `Convert.ToDecimal(value)`). | 0 |
11,557,015 | 07/19/2012 08:41:08 | 1,537,295 | 07/19/2012 08:37:40 | 1 | 0 | Post a Image to the Wall and set as Highlight | I POst a Photo to the wall via another website, my question are ist how i can set it as Highlight, so the image will uses the fullsite of the timeline,
thanks
marco | image | post | facebook-wall | null | null | 07/20/2012 12:23:44 | not a real question | Post a Image to the Wall and set as Highlight
===
I POst a Photo to the wall via another website, my question are ist how i can set it as Highlight, so the image will uses the fullsite of the timeline,
thanks
marco | 1 |
7,452,061 | 09/17/2011 02:32:56 | 941,915 | 09/13/2011 06:24:56 | 8 | 0 | Dynamic Casts or Function Overloads? | Consider the following abstract class:
class Abstract {
public:
// ...
virtual bool operator==(const Abstract& rhs) const = 0;
// ...
};
Now suppose I'm creating multiple derived classes from this abstract class. However, each one uses a different algorithm when comparing with its own type, and a generic algorithm when comparing with any of the other derived classes. Between the following two options, which would be the better, more efficient option?
Option A:
class Derived : public Abstract {
public:
// ...
bool operator==(const Abstract& rhs) const {
// Code for comparing to any of the other derived classes
}
bool operator==(const Derived& rhs) const {
// Code for comparing to myself
}
// ...
};
Option B:
class Derived : public Abstract {
public:
// ...
bool operator==(const Abstract& rhs) const {
const Derived* tmp = dynamic_cast<const Derived*>(&rhs);
if (tmp) {
// Code for comparing to myself
}
else {
// Code for comparing to any of the other derived class
}
}
I'm really curious as to what advantages and disadvantages these options would have, as C++ typecasting is a relatively mysterious topic to me. Furthermore, which solution is more "standard", and does the second solution have any impacts on performance?
Is there possibly a third solution? Especially if there were many derived classes, each needing its own special comparison algorithm against different derived classes? | c++ | inheritance | casting | overloading | dynamic-cast | null | open | Dynamic Casts or Function Overloads?
===
Consider the following abstract class:
class Abstract {
public:
// ...
virtual bool operator==(const Abstract& rhs) const = 0;
// ...
};
Now suppose I'm creating multiple derived classes from this abstract class. However, each one uses a different algorithm when comparing with its own type, and a generic algorithm when comparing with any of the other derived classes. Between the following two options, which would be the better, more efficient option?
Option A:
class Derived : public Abstract {
public:
// ...
bool operator==(const Abstract& rhs) const {
// Code for comparing to any of the other derived classes
}
bool operator==(const Derived& rhs) const {
// Code for comparing to myself
}
// ...
};
Option B:
class Derived : public Abstract {
public:
// ...
bool operator==(const Abstract& rhs) const {
const Derived* tmp = dynamic_cast<const Derived*>(&rhs);
if (tmp) {
// Code for comparing to myself
}
else {
// Code for comparing to any of the other derived class
}
}
I'm really curious as to what advantages and disadvantages these options would have, as C++ typecasting is a relatively mysterious topic to me. Furthermore, which solution is more "standard", and does the second solution have any impacts on performance?
Is there possibly a third solution? Especially if there were many derived classes, each needing its own special comparison algorithm against different derived classes? | 0 |
5,707,660 | 04/18/2011 19:10:39 | 714,007 | 04/18/2011 19:10:39 | 1 | 0 | My script is renaming uploads randomly | The script I have should upload the file, resize and rename with the appropriate size. It is doing that, but instead of renaming the with only the last part it renames it with a temp name only. Here is the script, any help would be greatly appreciated. I have uploaded the script here: [enter link description here][1]
[1]: http://www.filefactory.com/file/cbc8a99/n/class-form.php | php | null | null | null | null | 04/19/2011 03:54:23 | not a real question | My script is renaming uploads randomly
===
The script I have should upload the file, resize and rename with the appropriate size. It is doing that, but instead of renaming the with only the last part it renames it with a temp name only. Here is the script, any help would be greatly appreciated. I have uploaded the script here: [enter link description here][1]
[1]: http://www.filefactory.com/file/cbc8a99/n/class-form.php | 1 |
6,786,941 | 07/22/2011 07:30:31 | 857,462 | 07/22/2011 07:30:31 | 1 | 0 | store data from live webpages & create database | i want to write a program that get data from some live web pages and create a database in sql to show the information in a table.can anybody help me and give me some useful codes? | sql | database | create | null | null | 07/27/2011 03:05:44 | not constructive | store data from live webpages & create database
===
i want to write a program that get data from some live web pages and create a database in sql to show the information in a table.can anybody help me and give me some useful codes? | 4 |
7,769,157 | 10/14/2011 14:30:21 | 352,130 | 05/27/2010 15:46:57 | 184 | 15 | EF+ASP .NET MVC3. The way to realise data access | There are a several articles about true data access in MVC. I tried to make the best one according to the architecture flexibility. My way is following:
1. ADO .NET Entity Data Model (*.edmx from Entity Framework) with default code generation.
2. Common repository interface
public interface IGenericRepository<T> where T : class
{
T Get(int id);
void Create(T entityToCreate);
void Edit(T entityToEdit);
void Delete(T entityToDelete);
}
3. Interface (with particular methods of the current class), class with real implementation of methods. For example
public interface ITestingRepository: IGenericRepository<Testing>
{
List<dynamic> GetTestingUser(int id);
List<dynamic> GetNotTestingUser(int idTesting, Guid idCompany);
List<Testing> List(Guid CompanyId);
}
public class TestingRepository : ITestingRepository
{
private TestEverybody _entities = new TestEverybody();
public List<Testing> List(Guid CompanyId)
{
return _entities.Testing.Where(t => t.idCompany == CompanyId).ToList();
}
public void Edit(Testing productToEdit)
{
var originalProduct = Get(productToEdit.id);
_entities.ApplyCurrentValues(originalProduct.EntityKey.EntitySetName, productToEdit);
_entities.SaveChanges();
}
public void Create(Testing productToCreate)
{
_entities.Testing.AddObject(productToCreate);
_entities.SaveChanges();
}
//other methods
}
4. The following data access method in the controller
public class TestingController : Controller
{
//
// GET: /Testing/
private ITestingRepository _repository;
public TestingController() : this(new TestingRepository()) { }
public TestingController(ITestingRepository repository)
{
_repository = repository;
}
[HttpPost]
public ActionResult Create(Testing newobject)
{
_repository.Create(newobject);
return RedirectToAction("Index");
}
[HttpPost]
public ActionResult Edit(Testing item)
{
_repository.Edit(item);
return RedirectToAction("Index");
}
}
Is it a good one? Have I any mistakes there? | asp.net-mvc | entity-framework | model | data-access-layer | null | 10/14/2011 21:16:15 | not a real question | EF+ASP .NET MVC3. The way to realise data access
===
There are a several articles about true data access in MVC. I tried to make the best one according to the architecture flexibility. My way is following:
1. ADO .NET Entity Data Model (*.edmx from Entity Framework) with default code generation.
2. Common repository interface
public interface IGenericRepository<T> where T : class
{
T Get(int id);
void Create(T entityToCreate);
void Edit(T entityToEdit);
void Delete(T entityToDelete);
}
3. Interface (with particular methods of the current class), class with real implementation of methods. For example
public interface ITestingRepository: IGenericRepository<Testing>
{
List<dynamic> GetTestingUser(int id);
List<dynamic> GetNotTestingUser(int idTesting, Guid idCompany);
List<Testing> List(Guid CompanyId);
}
public class TestingRepository : ITestingRepository
{
private TestEverybody _entities = new TestEverybody();
public List<Testing> List(Guid CompanyId)
{
return _entities.Testing.Where(t => t.idCompany == CompanyId).ToList();
}
public void Edit(Testing productToEdit)
{
var originalProduct = Get(productToEdit.id);
_entities.ApplyCurrentValues(originalProduct.EntityKey.EntitySetName, productToEdit);
_entities.SaveChanges();
}
public void Create(Testing productToCreate)
{
_entities.Testing.AddObject(productToCreate);
_entities.SaveChanges();
}
//other methods
}
4. The following data access method in the controller
public class TestingController : Controller
{
//
// GET: /Testing/
private ITestingRepository _repository;
public TestingController() : this(new TestingRepository()) { }
public TestingController(ITestingRepository repository)
{
_repository = repository;
}
[HttpPost]
public ActionResult Create(Testing newobject)
{
_repository.Create(newobject);
return RedirectToAction("Index");
}
[HttpPost]
public ActionResult Edit(Testing item)
{
_repository.Edit(item);
return RedirectToAction("Index");
}
}
Is it a good one? Have I any mistakes there? | 1 |
10,380,180 | 04/30/2012 07:45:49 | 1,365,283 | 02/08/2011 06:52:52 | 1 | 0 | GUI , GWT design | Thanks for reading !!
I am collecting some requirements for a web site that i am designing.
The issue I am having is to decide which scenario would be more [economic, buggy, functional].
It is a real estate web site, that has ability "by admin" to dynamically build characteristics (both functionally and GUI) for real estate types (Villas, Buildings , ...).
Lets talk about Integer case, as it is the most straight forward one,
a- number of bedrooms in apartments , expected values (1-7).
b- number of levels in skyscrapers , expected values (20-200).
c- area in meter squares in lands , expected values (100-5000).
Web site Admin should be able to generate all the three cases (a,b,c) , so that the user can fill data as:
1- radio button
2- drop down menu
3- text field
I have two scenarios to design that "please tell me if you have a third one" :
**Scenario 1:**
tie number of options to GUI. i.e.
- Radio buttons (#expected values < 8 ) , e.g. "a"
- Drop down ( 8 =< #expected values < 200)
- Text Field ( 200 =< #expected values )
**Scenario 2:**
Simply, let Admin decides what GUI (1, 2, or 3) is corresponding to what case (a, b, or c).
Which scenario is cheaper? less buggy ? more functional "from business point of view" ?
Sorry for rambling !!! It is a design issue
regards
m.shafie | java | design | gwt | code-generation | smartgwt | 05/01/2012 12:11:30 | not constructive | GUI , GWT design
===
Thanks for reading !!
I am collecting some requirements for a web site that i am designing.
The issue I am having is to decide which scenario would be more [economic, buggy, functional].
It is a real estate web site, that has ability "by admin" to dynamically build characteristics (both functionally and GUI) for real estate types (Villas, Buildings , ...).
Lets talk about Integer case, as it is the most straight forward one,
a- number of bedrooms in apartments , expected values (1-7).
b- number of levels in skyscrapers , expected values (20-200).
c- area in meter squares in lands , expected values (100-5000).
Web site Admin should be able to generate all the three cases (a,b,c) , so that the user can fill data as:
1- radio button
2- drop down menu
3- text field
I have two scenarios to design that "please tell me if you have a third one" :
**Scenario 1:**
tie number of options to GUI. i.e.
- Radio buttons (#expected values < 8 ) , e.g. "a"
- Drop down ( 8 =< #expected values < 200)
- Text Field ( 200 =< #expected values )
**Scenario 2:**
Simply, let Admin decides what GUI (1, 2, or 3) is corresponding to what case (a, b, or c).
Which scenario is cheaper? less buggy ? more functional "from business point of view" ?
Sorry for rambling !!! It is a design issue
regards
m.shafie | 4 |
2,028,824 | 01/08/2010 16:02:09 | 68,183 | 02/19/2009 03:16:03 | 2,825 | 0 | How to get a distinct result, but return another column in the select? | I want to get a distinct result based on a property, but return the id in the select because I will be using it in a subquery.
e.g.
(List<Article>) session.createQuery("from Article a where a.id in (select distinct a2.title from article a2 where a2.body = :body");
setString("body", "")
.list();
The key section is the subquery, **I want to return the id, not the a2.title property**.
Can this be done?
(the table Article has duplicates, so I just want to return any one of them it doesn't matter as long as the body = ""). | hibernate | java | hql | subquery | null | null | open | How to get a distinct result, but return another column in the select?
===
I want to get a distinct result based on a property, but return the id in the select because I will be using it in a subquery.
e.g.
(List<Article>) session.createQuery("from Article a where a.id in (select distinct a2.title from article a2 where a2.body = :body");
setString("body", "")
.list();
The key section is the subquery, **I want to return the id, not the a2.title property**.
Can this be done?
(the table Article has duplicates, so I just want to return any one of them it doesn't matter as long as the body = ""). | 0 |
10,572,149 | 05/13/2012 13:30:20 | 1,215,218 | 08/08/2011 06:04:21 | 99 | 11 | Embed an auto-downloading app into an image? | Is it possible to embed an application into an image that upon viewing, it is automatically downloaded to a temp folder or the desktop?
If this is possible, how might one go about achieving this?
The application I am planning on embedding is written in c++, don't know if this makes things easier? | c++ | embed | null | null | null | 05/14/2012 13:39:59 | not a real question | Embed an auto-downloading app into an image?
===
Is it possible to embed an application into an image that upon viewing, it is automatically downloaded to a temp folder or the desktop?
If this is possible, how might one go about achieving this?
The application I am planning on embedding is written in c++, don't know if this makes things easier? | 1 |
5,228,882 | 03/08/2011 05:54:03 | 504,351 | 11/11/2010 10:14:32 | 27 | 2 | ASP.Net Session State Issue | I make use of Session Variable in a if statement.
if(SessionVariable == "AString")
{
Do Something;
}
Problem is the comparison in If works fine if I maintain the session in InState, but doesn't if I use the SQLServer Mode.
The mistake I make is not convert the session variable to string.
Why does it work with InState Sessions and doesn't with SQLServer Sessions? | asp.net | session-state | null | null | null | null | open | ASP.Net Session State Issue
===
I make use of Session Variable in a if statement.
if(SessionVariable == "AString")
{
Do Something;
}
Problem is the comparison in If works fine if I maintain the session in InState, but doesn't if I use the SQLServer Mode.
The mistake I make is not convert the session variable to string.
Why does it work with InState Sessions and doesn't with SQLServer Sessions? | 0 |
3,980,103 | 10/20/2010 16:25:20 | 481,990 | 10/20/2010 16:25:20 | 1 | 0 | Traversing anchor, unsorted list, and sublist elements with Jquery | I'm learning JQuery and I'm trying to understand how to parse an unsorted list.
My script works and it can highlight in yellow sublist (click on "level 2C" and 2d anchor), but i'm unable to highlight only level 3 or only level 4.
Any clue on how to do that ? Thanks.
Here is my code :
<script type="text/javascript" language="JavaScript">
$(document).ready(function (){
$(".level2").click(function(){
$(this).next("ul").css("background", "yellow");
});
});
</script>
<div >
<ul>
<li ><a class="level1">Level 1</a>
<ul>
<li><a class="level2" href="#">Level 2a</a></li>
<li><a class="level2" href="#">Level 2b</a></li>
<li><a class="level2">Level 2c</a>
<ul>
<li><a class="level3" href="#">Level 3a</a></li>
<li><a class="level3">Level 3b</a>
<ul>
<li><a class="level4">Level 4a</a></li>
<li><a class="level4">Level 4b</a></li>
</ul>
</li>
<li><a class="level3">Level 3c</a>
<ul>
<li><a class="level4">Level 4c</a></li>
<li><a class="level4">Level 4d</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="level2">Level 2d</a>
<ul>
<li><a class="level3" href="#">Level 3c</a></li>
<li><a class="level3">Level 3d</a>
<ul>
<li><a class="level4" href="#">Level 4e</a></li>
<li><a class="level4" href="#">Level 4f</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
Sorry, I'm French ! | jquery | null | null | null | null | null | open | Traversing anchor, unsorted list, and sublist elements with Jquery
===
I'm learning JQuery and I'm trying to understand how to parse an unsorted list.
My script works and it can highlight in yellow sublist (click on "level 2C" and 2d anchor), but i'm unable to highlight only level 3 or only level 4.
Any clue on how to do that ? Thanks.
Here is my code :
<script type="text/javascript" language="JavaScript">
$(document).ready(function (){
$(".level2").click(function(){
$(this).next("ul").css("background", "yellow");
});
});
</script>
<div >
<ul>
<li ><a class="level1">Level 1</a>
<ul>
<li><a class="level2" href="#">Level 2a</a></li>
<li><a class="level2" href="#">Level 2b</a></li>
<li><a class="level2">Level 2c</a>
<ul>
<li><a class="level3" href="#">Level 3a</a></li>
<li><a class="level3">Level 3b</a>
<ul>
<li><a class="level4">Level 4a</a></li>
<li><a class="level4">Level 4b</a></li>
</ul>
</li>
<li><a class="level3">Level 3c</a>
<ul>
<li><a class="level4">Level 4c</a></li>
<li><a class="level4">Level 4d</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="level2">Level 2d</a>
<ul>
<li><a class="level3" href="#">Level 3c</a></li>
<li><a class="level3">Level 3d</a>
<ul>
<li><a class="level4" href="#">Level 4e</a></li>
<li><a class="level4" href="#">Level 4f</a></li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
Sorry, I'm French ! | 0 |
5,218,245 | 03/07/2011 10:02:15 | 647,929 | 03/07/2011 10:02:15 | 1 | 0 | Facebook C# SDK Upload Photos with Tagging | How to Tagging a photos using facebook c# sdk.
This is my code (Upload image):
var fbApp = new FacebookClient(Session["xAccessToken"].ToString());
string xfilename = MergedCombinedImage.ImageUrl;
xfilename = xfilename.Replace("images/temp/", "");
var fbUpl = new Facebook.FacebookMediaObject
{
FileName = xfilename,
ContentType = "image/jpg"
};
var bytes = System.IO.File.ReadAllBytes(Server.MapPath(MergedCombinedImage.ImageUrl));
fbUpl.SetValue(bytes);
var photoDetails = new Dictionary<string, object>();
photoDetails.Add("message", "test");
photoDetails.Add("image", fbUpl);
var fbResult = fbApp.Post(@"/" + albumID + @"/photos", photoDetails);
var result = (IDictionary<string, object>)fbResult;
var photoID = result["id"];
Thanks
pongpang | facebook | null | null | null | null | null | open | Facebook C# SDK Upload Photos with Tagging
===
How to Tagging a photos using facebook c# sdk.
This is my code (Upload image):
var fbApp = new FacebookClient(Session["xAccessToken"].ToString());
string xfilename = MergedCombinedImage.ImageUrl;
xfilename = xfilename.Replace("images/temp/", "");
var fbUpl = new Facebook.FacebookMediaObject
{
FileName = xfilename,
ContentType = "image/jpg"
};
var bytes = System.IO.File.ReadAllBytes(Server.MapPath(MergedCombinedImage.ImageUrl));
fbUpl.SetValue(bytes);
var photoDetails = new Dictionary<string, object>();
photoDetails.Add("message", "test");
photoDetails.Add("image", fbUpl);
var fbResult = fbApp.Post(@"/" + albumID + @"/photos", photoDetails);
var result = (IDictionary<string, object>)fbResult;
var photoID = result["id"];
Thanks
pongpang | 0 |
11,071,139 | 06/17/2012 12:02:31 | 1,303,265 | 03/30/2012 12:41:56 | 17 | 0 | .htaccess > 4 urls with same page (will google index all?) | I have now 4 url's with from the same file:
- http://domain.com/picture.php?name=kim kardashian
- http://domain.com/picture.php?name=kim-kardashian
- http://domain.com/picture/kim kardashian
- http://domain.com/picture/kim-kardashian
All of these links works..
My htaccess:
RewriteEngine On
RewriteRule ^picture/([^/]*)$ /picture.php?name=$1 [L]
In top of my php file (to replace space by -)
$name = str_replace('-', ' ', $_GET['name']);
$name = mysql_escape_string($name);
$pic = mysql_query("SELECT * FROM pics WHERE name = '$name'") or die(mysql_error());
But I want to use only: http://domain.com/picture/kim-kardashian, how can I redirect all the other urls to this one using htaccess or php?
And will google index all of these urls or just http://domain.com/picture/kim-kardashian ?
| php | .htaccess | redirect | url-rewriting | null | null | open | .htaccess > 4 urls with same page (will google index all?)
===
I have now 4 url's with from the same file:
- http://domain.com/picture.php?name=kim kardashian
- http://domain.com/picture.php?name=kim-kardashian
- http://domain.com/picture/kim kardashian
- http://domain.com/picture/kim-kardashian
All of these links works..
My htaccess:
RewriteEngine On
RewriteRule ^picture/([^/]*)$ /picture.php?name=$1 [L]
In top of my php file (to replace space by -)
$name = str_replace('-', ' ', $_GET['name']);
$name = mysql_escape_string($name);
$pic = mysql_query("SELECT * FROM pics WHERE name = '$name'") or die(mysql_error());
But I want to use only: http://domain.com/picture/kim-kardashian, how can I redirect all the other urls to this one using htaccess or php?
And will google index all of these urls or just http://domain.com/picture/kim-kardashian ?
| 0 |
2,107,194 | 01/21/2010 05:43:34 | 461,450 | 05/20/2009 09:20:38 | 183 | 4 | how to parse a page that is going on 302 header?? | i have to parse a page in php,the url of the page is going on 302 Moved temporarily header and is moved to a not found page.Its data can be retrieved manually through console option of firebug add on of mozilla.But if i try to parse it using php it gives me that not found page in return.How can i parse that page please suggest?? | php | parsing | http-status-code-302 | null | null | null | open | how to parse a page that is going on 302 header??
===
i have to parse a page in php,the url of the page is going on 302 Moved temporarily header and is moved to a not found page.Its data can be retrieved manually through console option of firebug add on of mozilla.But if i try to parse it using php it gives me that not found page in return.How can i parse that page please suggest?? | 0 |
8,006,453 | 11/04/2011 08:12:28 | 297,907 | 03/20/2010 07:10:00 | 218 | 21 | GWT celltable How to create selectioncell in edittextcell? | I want to create editable cell with datatype boolean.
I don't want to use selectioncell for boolean data type
My testBooleanColumn column's cell contains string with value true,false..........
when I will click on cell present in testBooleanColumn then that cell should be editable and In that editable cell I want to show selection cell with value(true,false).
when user changes value from selectioncell either true or false that value set to editable cell in testBooleanColumn
How to do this? any hint ? or sample code for this use case ? | java | gwt | cell | gwt-2.2-celltable | null | null | open | GWT celltable How to create selectioncell in edittextcell?
===
I want to create editable cell with datatype boolean.
I don't want to use selectioncell for boolean data type
My testBooleanColumn column's cell contains string with value true,false..........
when I will click on cell present in testBooleanColumn then that cell should be editable and In that editable cell I want to show selection cell with value(true,false).
when user changes value from selectioncell either true or false that value set to editable cell in testBooleanColumn
How to do this? any hint ? or sample code for this use case ? | 0 |
2,587,076 | 04/06/2010 17:50:25 | 186,338 | 10/08/2009 12:29:36 | 1,085 | 54 | Eclipse warning: "<methodName> has non-API return type <parameterizedType>" | My co-worker and I have come across this warning message a couple times recently. For the below code:
package com.mycompany.product.data;
import com.mycompany.product.dao.GenericDAO;
public abstract class EntityBean {
public abstract GenericDAO<Object, Long> getDAO();
// ^^^^^^ <-- WARNING OCCURS HERE
}
the warning appears in the listed spot as
EntityBean.getDAO() has non-API return type GenericDAO<T, ID>
A Google search for "has non-API return type" only shows instances where this message appears in problem lists. I.e., there's no public explanation for it.
What does this mean? We can create a usage problem filter in Eclipse to make the message go away, but we don't want to do this if our usage is a legitimate problem.
Thanks! | eclipse | eclipse-rcp | java | warnings | null | null | open | Eclipse warning: "<methodName> has non-API return type <parameterizedType>"
===
My co-worker and I have come across this warning message a couple times recently. For the below code:
package com.mycompany.product.data;
import com.mycompany.product.dao.GenericDAO;
public abstract class EntityBean {
public abstract GenericDAO<Object, Long> getDAO();
// ^^^^^^ <-- WARNING OCCURS HERE
}
the warning appears in the listed spot as
EntityBean.getDAO() has non-API return type GenericDAO<T, ID>
A Google search for "has non-API return type" only shows instances where this message appears in problem lists. I.e., there's no public explanation for it.
What does this mean? We can create a usage problem filter in Eclipse to make the message go away, but we don't want to do this if our usage is a legitimate problem.
Thanks! | 0 |
8,070,668 | 11/09/2011 19:45:24 | 1,009,541 | 10/23/2011 13:14:58 | 1 | 0 | Android app, how would i do this? | I have tried doing some research on this but to no avail. Someone give me the link to this site and said someone here might be bale to offer some help.
So here we go.
What I want to do is have a a 3d office, with a desk.
I would be using sticky notes to write notes and stick them to wall or desk.
It will only have two options to send it to your email address or change the font.
This is basically writing notes on a sticky note, the only diffference is that the background, which is a 3d office.
And also sticking it on the wall or desk.
By a 3D view as Ted has mentioned i mean the perspective view.
Any help would be greatly appreciated | android | null | null | null | null | 11/10/2011 16:28:13 | not a real question | Android app, how would i do this?
===
I have tried doing some research on this but to no avail. Someone give me the link to this site and said someone here might be bale to offer some help.
So here we go.
What I want to do is have a a 3d office, with a desk.
I would be using sticky notes to write notes and stick them to wall or desk.
It will only have two options to send it to your email address or change the font.
This is basically writing notes on a sticky note, the only diffference is that the background, which is a 3d office.
And also sticking it on the wall or desk.
By a 3D view as Ted has mentioned i mean the perspective view.
Any help would be greatly appreciated | 1 |
11,080,265 | 06/18/2012 09:38:55 | 1,455,610 | 06/14/2012 07:40:29 | 11 | 0 | Making a projectile shoot using a button | So I created a button using this tutorial <http://www.youtube.com/watch?v=2yqKZlfhz0A?> now I want to make it where it shoots a projectile. I have no idea how to do do this and I have been trying to look up tutorials on what to do ,but no cigar. I want to shoot projectiles from the sprite and shoot in a straight line. Any help will be nice. | iphone | ios | xcode | cocos2d-iphone | sprite | 06/21/2012 10:02:32 | too localized | Making a projectile shoot using a button
===
So I created a button using this tutorial <http://www.youtube.com/watch?v=2yqKZlfhz0A?> now I want to make it where it shoots a projectile. I have no idea how to do do this and I have been trying to look up tutorials on what to do ,but no cigar. I want to shoot projectiles from the sprite and shoot in a straight line. Any help will be nice. | 3 |
9,668,921 | 03/12/2012 14:25:58 | 981,213 | 10/05/2011 21:03:11 | 1 | 0 | Dispose of an object referenced via pointer in C# | I am using a C# wrapper to an API which is providing image data from a camera.
I have a class which contains data for each frame received, and I would like to implement a dispose method to run once the frame data has been processed. The problem is the primary object I wish to dispose of (an image buffer) is only accessible via a pointer.
I don't know if this is even necessary in C#. I know that in C++ I would have to do something with it to prevent a memory leak, however I don't know much about how pointers work in C# in terms of garbage collection. As it is, the program works okay, but the memory usage does jump around a lot more than I'd like it to. I've found that proper disposal of certain objects has given much more consistent memory usage compared to relying on what I assume to be finalizers being automatically run, such as when disposing of an existing image on an image box before setting a new one. I'd like to try something similar here if possible.
Potentially important: the data the pointer points to is processed by unsafe code, which creates two new pointers to the object (one as UInt16* and another as byte*). Both of these pointers only exist within the scope of the unsafe routine but I'm not sure if this interferes with GC in some way.
Any advice, recommendations appreciated. Thanks | c# | pointers | garbage-collection | null | null | null | open | Dispose of an object referenced via pointer in C#
===
I am using a C# wrapper to an API which is providing image data from a camera.
I have a class which contains data for each frame received, and I would like to implement a dispose method to run once the frame data has been processed. The problem is the primary object I wish to dispose of (an image buffer) is only accessible via a pointer.
I don't know if this is even necessary in C#. I know that in C++ I would have to do something with it to prevent a memory leak, however I don't know much about how pointers work in C# in terms of garbage collection. As it is, the program works okay, but the memory usage does jump around a lot more than I'd like it to. I've found that proper disposal of certain objects has given much more consistent memory usage compared to relying on what I assume to be finalizers being automatically run, such as when disposing of an existing image on an image box before setting a new one. I'd like to try something similar here if possible.
Potentially important: the data the pointer points to is processed by unsafe code, which creates two new pointers to the object (one as UInt16* and another as byte*). Both of these pointers only exist within the scope of the unsafe routine but I'm not sure if this interferes with GC in some way.
Any advice, recommendations appreciated. Thanks | 0 |
5,211,898 | 03/06/2011 16:55:36 | 646,317 | 03/05/2011 19:46:04 | 8 | 0 | random.Next(x); ? | lets say my code is random.Next(2);
will values be 0-1-2
or
1-2 (0 doesnt count)
or
0-1(last value doesnt count)
or
just 1 ? (0 and last doesnt count) | c# | random | null | null | null | 03/06/2011 22:47:08 | too localized | random.Next(x); ?
===
lets say my code is random.Next(2);
will values be 0-1-2
or
1-2 (0 doesnt count)
or
0-1(last value doesnt count)
or
just 1 ? (0 and last doesnt count) | 3 |
9,083,211 | 01/31/2012 16:33:34 | 1,180,801 | 01/31/2012 16:29:01 | 1 | 0 | Trying to convert the a webkit gradient to moz: wrong format | I'm trying to import the gradient below in this [page][1] ("Import from CSS"):
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.25, #ACACAC, color-stop(4, #dfdfdf));
but I'm gettin this error:
> Couldn't parse gradient CSS. Please check the format and try again.
Any idea?
Javier
[1]: http://www.colorzilla.com/gradient-editor/ | css | webkit | null | null | null | 01/31/2012 18:06:53 | too localized | Trying to convert the a webkit gradient to moz: wrong format
===
I'm trying to import the gradient below in this [page][1] ("Import from CSS"):
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.25, #ACACAC, color-stop(4, #dfdfdf));
but I'm gettin this error:
> Couldn't parse gradient CSS. Please check the format and try again.
Any idea?
Javier
[1]: http://www.colorzilla.com/gradient-editor/ | 3 |
7,727,366 | 10/11/2011 14:07:23 | 183,524 | 10/03/2009 08:01:39 | 424 | 6 | Custom ListActivity with dynamic views for each row | I want to create custom row for ListActivity, each row contains `Title` and `List Of SubTitles` .
**My question is** : what is the best way to create these `SubTitles`? I cannot add these subTitles in row.xml since they should be dynamic depending on each row.
I'm trying to write this :
class Research{
public String title;
public ArrayList<String> subTitles;
}
private class MyAdapter extends ArrayAdapter<Research> {
public MyAdapter(Context context, int textViewResourceId,ArrayList<Research> items) {
super(context, textViewResourceId, items);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.row, null);
}
Research o = items.get(position);
if (o != null) {
TextView tt = (TextView) v.findViewById(R.id.textView1);
if (tt != null) {
tt.setText(o.title);
}
}
/// THE PROBLEM STARTS HERE
for(String subTitle: o.subTitles){
TextView subTextView = new TextView(ResearchListActivity.this);
subTextView.setText(subTitle);
// where to add this view ? I don't see Layout here !
parent.addView(subTextView);
}
//
return v;
}
}
the row layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<!-- Title -->
<TextView android:id="@+id/textView1" android:layout_width="fill_parent"
android:text="" android:layout_height="wrap_content"
android:textColor="#ddd" android:gravity="center" android:background="#7DB5C9"></TextView>
</LinearLayout>
Is it clear ?
Thanks . | android | listactivity | null | null | null | null | open | Custom ListActivity with dynamic views for each row
===
I want to create custom row for ListActivity, each row contains `Title` and `List Of SubTitles` .
**My question is** : what is the best way to create these `SubTitles`? I cannot add these subTitles in row.xml since they should be dynamic depending on each row.
I'm trying to write this :
class Research{
public String title;
public ArrayList<String> subTitles;
}
private class MyAdapter extends ArrayAdapter<Research> {
public MyAdapter(Context context, int textViewResourceId,ArrayList<Research> items) {
super(context, textViewResourceId, items);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null) {
LayoutInflater vi = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(R.layout.row, null);
}
Research o = items.get(position);
if (o != null) {
TextView tt = (TextView) v.findViewById(R.id.textView1);
if (tt != null) {
tt.setText(o.title);
}
}
/// THE PROBLEM STARTS HERE
for(String subTitle: o.subTitles){
TextView subTextView = new TextView(ResearchListActivity.this);
subTextView.setText(subTitle);
// where to add this view ? I don't see Layout here !
parent.addView(subTextView);
}
//
return v;
}
}
the row layout :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<!-- Title -->
<TextView android:id="@+id/textView1" android:layout_width="fill_parent"
android:text="" android:layout_height="wrap_content"
android:textColor="#ddd" android:gravity="center" android:background="#7DB5C9"></TextView>
</LinearLayout>
Is it clear ?
Thanks . | 0 |
728,698 | 04/08/2009 05:59:59 | 1,599 | 08/17/2008 13:39:55 | 2,524 | 112 | What makes programmers misunderstood by non-technical persons and what to do about them? | I am **always** misunderstood by my non-technical boss.
Its frustrating that they would think that a programmer isn't working when he's not in front of the computer typing code.... or even when in front of the computer and has his browser on, reading about new programming stuff. It got to the point where I was told I was unproductive even though I solved the challenging and unconventional problems.
I think I'm not the only one who has to deal with this problem and I think its common amongst programmers with non-technical bosses.
How would you deal with this problem?
Possibly related question: Should I just shrug off that I'm misuderstood and accept that [programmers have prickly personalities][1] (if so, how would I explain that)?
[1]: http://stackoverflow.com/questions/363591/why-do-programmers-have-such-ridiculously-prickly-personalities | working-conditions | work-environment | management | null | null | 03/01/2012 06:10:11 | not constructive | What makes programmers misunderstood by non-technical persons and what to do about them?
===
I am **always** misunderstood by my non-technical boss.
Its frustrating that they would think that a programmer isn't working when he's not in front of the computer typing code.... or even when in front of the computer and has his browser on, reading about new programming stuff. It got to the point where I was told I was unproductive even though I solved the challenging and unconventional problems.
I think I'm not the only one who has to deal with this problem and I think its common amongst programmers with non-technical bosses.
How would you deal with this problem?
Possibly related question: Should I just shrug off that I'm misuderstood and accept that [programmers have prickly personalities][1] (if so, how would I explain that)?
[1]: http://stackoverflow.com/questions/363591/why-do-programmers-have-such-ridiculously-prickly-personalities | 4 |
9,631,176 | 03/09/2012 08:48:18 | 1,215,913 | 02/17/2012 09:58:43 | 21 | 0 | Saving Surface to Bitmap and optimizing DirectX screen capture in C# | after a whole day of testing I came up with this code, which captures current screen using DirectX (SlimDX) and saves it into a file:
Device d;
public DxScreenCapture()
{
PresentParameters present_params = new PresentParameters();
present_params.Windowed = true;
present_params.SwapEffect = SwapEffect.Discard;
d = new Device(new Direct3D(), 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);
}
public Surface CaptureScreen()
{
Surface s = Surface.CreateOffscreenPlain(d, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.Scratch);
d.GetFrontBufferData(0, s);
return s;
}
Then I do the following:
DxScreenCapture sc = new DxScreenCapture();
..code here
private void button1_Click(object sender, EventArgs e)
{
Stopwatch stopwatch = new Stopwatch();
// Begin timing
stopwatch.Start();
Surface s = sc.CaptureScreen();
Surface.ToFile(s, @"c:\temp\test.png", ImageFileFormat.Png);
s.Dispose();
stopwatch.Stop();
textBox1.Text = ("Elapsed:" + stopwatch.Elapsed.TotalMilliseconds);
}
**The results are:**
**0. when I don't save surface:** avg. elapsed time: 80-90ms
**1. when I also save Surface to BMP file:** format: ImageFileFormat.Bmp , avg. elapsed time: 120ms, file size: 7mb
**2. when I also save Surface to PNG file:** format: ImageFileFormat.Png , avg. elapsed time: 800ms, file size: 300kb
**The questions are:**
**1.** Is it possible to optimise current image capture? According to this article - Directx screen capture should be faster than GDI. For me, GDI usually takes 20ms to get a "Bitmap", whereas it takes 80ms to get "Surfare" using DX (both without saving).
http://www.codeproject.com/Articles/274461/Very-fast-screen-capture-using-DirectX-in-Csharp
**2a.** How to save Surface to PNG image format faster? When I save surface to 7mb BMP file it takes almost 6 times less time, than when I save the same surface to 300kb PNG file..
**2b.** How is it possible to save Surface directly to Bitmap so I don't have to create temporary files?
So I don't have to do following: **Surface -> image file; image file open -> bitmap;**, but instead: **Surface -> bitmap**
that's all for now. I'll gladly accept any tips, thanks! | c# | image | optimization | save | slimdx | null | open | Saving Surface to Bitmap and optimizing DirectX screen capture in C#
===
after a whole day of testing I came up with this code, which captures current screen using DirectX (SlimDX) and saves it into a file:
Device d;
public DxScreenCapture()
{
PresentParameters present_params = new PresentParameters();
present_params.Windowed = true;
present_params.SwapEffect = SwapEffect.Discard;
d = new Device(new Direct3D(), 0, DeviceType.Hardware, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);
}
public Surface CaptureScreen()
{
Surface s = Surface.CreateOffscreenPlain(d, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, Format.A8R8G8B8, Pool.Scratch);
d.GetFrontBufferData(0, s);
return s;
}
Then I do the following:
DxScreenCapture sc = new DxScreenCapture();
..code here
private void button1_Click(object sender, EventArgs e)
{
Stopwatch stopwatch = new Stopwatch();
// Begin timing
stopwatch.Start();
Surface s = sc.CaptureScreen();
Surface.ToFile(s, @"c:\temp\test.png", ImageFileFormat.Png);
s.Dispose();
stopwatch.Stop();
textBox1.Text = ("Elapsed:" + stopwatch.Elapsed.TotalMilliseconds);
}
**The results are:**
**0. when I don't save surface:** avg. elapsed time: 80-90ms
**1. when I also save Surface to BMP file:** format: ImageFileFormat.Bmp , avg. elapsed time: 120ms, file size: 7mb
**2. when I also save Surface to PNG file:** format: ImageFileFormat.Png , avg. elapsed time: 800ms, file size: 300kb
**The questions are:**
**1.** Is it possible to optimise current image capture? According to this article - Directx screen capture should be faster than GDI. For me, GDI usually takes 20ms to get a "Bitmap", whereas it takes 80ms to get "Surfare" using DX (both without saving).
http://www.codeproject.com/Articles/274461/Very-fast-screen-capture-using-DirectX-in-Csharp
**2a.** How to save Surface to PNG image format faster? When I save surface to 7mb BMP file it takes almost 6 times less time, than when I save the same surface to 300kb PNG file..
**2b.** How is it possible to save Surface directly to Bitmap so I don't have to create temporary files?
So I don't have to do following: **Surface -> image file; image file open -> bitmap;**, but instead: **Surface -> bitmap**
that's all for now. I'll gladly accept any tips, thanks! | 0 |
2,869,620 | 05/19/2010 21:38:43 | 345,529 | 05/19/2010 21:38:43 | 1 | 0 | Qt QListView - context menus? | I'm trying to add a context (right click) menu to a Qt QListView. I see in Qt 3.3 there is "contextMenuRequested" (which I could use) - http://doc.trolltech.com/3.3/qlistview.html#contextMenuRequested. However, I can't see such a method in Qt4. Does anyone know how to add a context menu to a QListView? | qt | qlistview | null | null | null | null | open | Qt QListView - context menus?
===
I'm trying to add a context (right click) menu to a Qt QListView. I see in Qt 3.3 there is "contextMenuRequested" (which I could use) - http://doc.trolltech.com/3.3/qlistview.html#contextMenuRequested. However, I can't see such a method in Qt4. Does anyone know how to add a context menu to a QListView? | 0 |
9,178,639 | 02/07/2012 15:08:59 | 454,099 | 09/21/2010 15:04:29 | 70 | 1 | how can i to implement fileChooser on php? | I need to implement a file chooser os php, but i don't know, somebody can me some link with documentation about this.
Thanks you very much. | php | filechooser | null | null | null | null | open | how can i to implement fileChooser on php?
===
I need to implement a file chooser os php, but i don't know, somebody can me some link with documentation about this.
Thanks you very much. | 0 |
11,719,689 | 07/30/2012 10:31:33 | 1,434,869 | 06/04/2012 10:00:12 | 38 | 0 | Metro styles live tiles for my php web site | How can I create a metro style live tile for my webpage using css and javascript? | php | jquery | css | null | null | 07/30/2012 13:56:24 | not a real question | Metro styles live tiles for my php web site
===
How can I create a metro style live tile for my webpage using css and javascript? | 1 |
9,444,275 | 02/25/2012 13:08:55 | 82,099 | 03/24/2009 16:18:12 | 468 | 4 | Books on NHibernate 3 | Could you please recommend a book on nhibernate? A few years ago I read 'NHibernate in Action'. I wasn't working with nhibernate for a long time, and since then it changed to 3.x version. What books should I read now? What's your opinion on 'Working with NHibernate 3.0'? | nhibernate | null | null | null | null | 02/27/2012 03:33:08 | not constructive | Books on NHibernate 3
===
Could you please recommend a book on nhibernate? A few years ago I read 'NHibernate in Action'. I wasn't working with nhibernate for a long time, and since then it changed to 3.x version. What books should I read now? What's your opinion on 'Working with NHibernate 3.0'? | 4 |
10,261,444 | 04/21/2012 17:43:21 | 277,884 | 02/20/2010 23:57:44 | 74 | 1 | First Virtual Machine Langague ? - Java? | Is Java the fist virtual machine based programming language ? | java | virtual-machine | vm | null | null | 04/21/2012 17:47:30 | off topic | First Virtual Machine Langague ? - Java?
===
Is Java the fist virtual machine based programming language ? | 2 |
4,145,032 | 11/10/2010 13:39:12 | 503,267 | 11/10/2010 13:34:38 | 1 | 0 | Where to get simple Android programs to illustrate the lifecycle? | I was following "hello-android-introducing-googles-mobil… by Ed Burnette.. which was very useful for the basics. Morover using the basics I was able to create a small calculator application.
But when I wanted to work with activities(life cycle) I couldnt follow the book clearly..
So please suggest a book or site which explains the life cycle of android applications with simple
easy to read (and workout) programs | cycle | life | code-samples | null | null | null | open | Where to get simple Android programs to illustrate the lifecycle?
===
I was following "hello-android-introducing-googles-mobil… by Ed Burnette.. which was very useful for the basics. Morover using the basics I was able to create a small calculator application.
But when I wanted to work with activities(life cycle) I couldnt follow the book clearly..
So please suggest a book or site which explains the life cycle of android applications with simple
easy to read (and workout) programs | 0 |
9,753,571 | 03/17/2012 20:45:44 | 878,519 | 08/04/2011 11:51:23 | 20 | 1 | Creating an API (with PHP) | I been having this idea spooking around in my head for 2 weeks now. I’ve finally created some cases and plans on where I want to go with this project. I will have to create both a web application (ASP.NET) and a desktop application (Java). Both these applications will need to have sync’d databases.
I’ve been thinking about creating a public API over my database so my front-end and 3rd parties could communicate to the database. But I’ve never really attempted something like this before. I’ve spend my weekend so far on reading up on how I could approach this and I’ve gotten a pretty good idea. I’m having some questions/doubts currently and was hoping perhaps someone could help me.
1) I’m currently still in university and I don’t have a job so my pockets don’t go very deep. I’ve been thinking of writing the API in PHP, I already have possession of an unmetered hosting account and else I would be forced to buy .NET hosting which can turn out to be quite expensive. However my PHP knowledge is quite limited towards parsing user input/security. Would it be wise to search for an (e)book around this topic or would I be fine with online tutorials, do you have any suggestions on where to look? Should I put my time in writing a possible vulnerable PHP API or should I look at other options?
2) So far I’ve never really had the need to look into PHP libraries. I was wondering if I should look into some of these (for example cakePHP) to help me develop the API.
3) I’ve experience with implementing Twitter/Linkedin their API’s so I’ve been thinking to use OAuth (v2) to allow people to use my API. Is implementing OAuth to your API a lot of work? Is it well documented enough for someone with only basic PHP knowledge? If you ever used it on your API, what was your experience with it?
4) If this project would ever kick off, it would be wise to look into hosting It in the cloud. Do I currently need to think about something so future cloud integration is possible?
5) For the web application, would there be a (big) performance difference between using the API or directly connecting to the database?
6) Any recommended lecture or tips are welcome. It’s the first time I will be attempting something this big (both in functionalities & required knowledge).
| php | api | cloud | oauth-2.0 | startup | 03/17/2012 23:56:14 | not a real question | Creating an API (with PHP)
===
I been having this idea spooking around in my head for 2 weeks now. I’ve finally created some cases and plans on where I want to go with this project. I will have to create both a web application (ASP.NET) and a desktop application (Java). Both these applications will need to have sync’d databases.
I’ve been thinking about creating a public API over my database so my front-end and 3rd parties could communicate to the database. But I’ve never really attempted something like this before. I’ve spend my weekend so far on reading up on how I could approach this and I’ve gotten a pretty good idea. I’m having some questions/doubts currently and was hoping perhaps someone could help me.
1) I’m currently still in university and I don’t have a job so my pockets don’t go very deep. I’ve been thinking of writing the API in PHP, I already have possession of an unmetered hosting account and else I would be forced to buy .NET hosting which can turn out to be quite expensive. However my PHP knowledge is quite limited towards parsing user input/security. Would it be wise to search for an (e)book around this topic or would I be fine with online tutorials, do you have any suggestions on where to look? Should I put my time in writing a possible vulnerable PHP API or should I look at other options?
2) So far I’ve never really had the need to look into PHP libraries. I was wondering if I should look into some of these (for example cakePHP) to help me develop the API.
3) I’ve experience with implementing Twitter/Linkedin their API’s so I’ve been thinking to use OAuth (v2) to allow people to use my API. Is implementing OAuth to your API a lot of work? Is it well documented enough for someone with only basic PHP knowledge? If you ever used it on your API, what was your experience with it?
4) If this project would ever kick off, it would be wise to look into hosting It in the cloud. Do I currently need to think about something so future cloud integration is possible?
5) For the web application, would there be a (big) performance difference between using the API or directly connecting to the database?
6) Any recommended lecture or tips are welcome. It’s the first time I will be attempting something this big (both in functionalities & required knowledge).
| 1 |
7,373,183 | 09/10/2011 16:56:44 | 938,397 | 09/10/2011 16:50:26 | 1 | 0 | Regex for Only Accept Letters Space and 'ñ' Values | I could say someone Regex to validate a String in Javascript, containing spaces, letters, and ñ With case sensitive.
Excuse my Ignoring, Thanks. | javascript | regex | null | null | null | 09/11/2011 13:38:21 | too localized | Regex for Only Accept Letters Space and 'ñ' Values
===
I could say someone Regex to validate a String in Javascript, containing spaces, letters, and ñ With case sensitive.
Excuse my Ignoring, Thanks. | 3 |
9,870,024 | 03/26/2012 09:54:26 | 1,213,934 | 02/16/2012 13:31:10 | 1 | 2 | downcasting from derived to templated base in C++ | Given this:
template<class Something> class Base
{
virtual void method() = 0;
};
class Derived: public Base<std::string>
{
void method() { ... };
};
I want to downcast a pointer of Derived to a pointer of Base. I tried to use dynamic_cast with no success:
...
Derived* d = new Derived();
Base* b = dynamic_cast<Base*>(d);
...
I always got errors during execution.
I don't know if I need downcasting,. I have this situation:
template<class Something> class TemplatedClass
{
void method(Base<Something>* base) { ... };
};
class SomeClass : public TemplatedClass<std::string> { ... };
And I want to call:
Derived* d = new Derived();
SomeClass sc();
sc.method(d);
But it gives me an conversion error.
What does I need? Downcasting or what? | c++ | casting | null | null | null | 03/26/2012 17:13:03 | too localized | downcasting from derived to templated base in C++
===
Given this:
template<class Something> class Base
{
virtual void method() = 0;
};
class Derived: public Base<std::string>
{
void method() { ... };
};
I want to downcast a pointer of Derived to a pointer of Base. I tried to use dynamic_cast with no success:
...
Derived* d = new Derived();
Base* b = dynamic_cast<Base*>(d);
...
I always got errors during execution.
I don't know if I need downcasting,. I have this situation:
template<class Something> class TemplatedClass
{
void method(Base<Something>* base) { ... };
};
class SomeClass : public TemplatedClass<std::string> { ... };
And I want to call:
Derived* d = new Derived();
SomeClass sc();
sc.method(d);
But it gives me an conversion error.
What does I need? Downcasting or what? | 3 |
11,046,292 | 06/15/2012 07:23:12 | 157,224 | 08/16/2009 09:40:53 | 3,915 | 154 | VB.Net coding guidelines | We develop small applications for various customers. I now got a task to set up some coding guidelines for in-house and external programmers.
(Management know nothing about development and only see the problem in transferring projects from one developer to another. Customers pay by the hour and development is a small part of total project so code quality is a non-issue)
My first step is to set up guidelines for C# and VB.Net (SQL will probably come later).
(Most code here is created with <kbd>CTRL-C</kbd><kbd>CTRL-V</kbd> and testing is done with <kbd>F5</kbd>.
I have tried to introduce unit testing / code review but that is not going to happen. Static analysis is the only way forward at the moment)
I am most comfortable in C#/C++ (but sometimes work with existing VB6/VBA/VB.Net code) so setting up C# guidelines is pretty easy:
* Warning Level 4
* StyleCop
* FxCop
* Code metrics (e.g. Cyclomatic complexity < 15, Maintainability > 50)
For VB.Net I need to replace StyleCop with some written guidelines but how do I set up the VB.Net compiler.
Personally I never code without `Option Explicit` / `Option Strict` etc but if I do that on our VB.Net projects I get hundreds of warnings/errors (implicit conversions, default return type/value etc).
The VB developers does not seem to have a problem working without help from compiler warnings. I do not think their productivity generally differs from C# developers (it is more a personal thing).
I do not want to enforce my own preference for static checking so my questions is:
**What warning levels are reasonable/best practice for VB.Net development?**
(English is not my first language so I hope this does not sound like I think VB.Net or VB Developers are inferior to C# in any way. I just don't have much experience in VB.Net projects)
| .net | vb.net | coding-style | compiler-warnings | null | 06/15/2012 08:51:46 | off topic | VB.Net coding guidelines
===
We develop small applications for various customers. I now got a task to set up some coding guidelines for in-house and external programmers.
(Management know nothing about development and only see the problem in transferring projects from one developer to another. Customers pay by the hour and development is a small part of total project so code quality is a non-issue)
My first step is to set up guidelines for C# and VB.Net (SQL will probably come later).
(Most code here is created with <kbd>CTRL-C</kbd><kbd>CTRL-V</kbd> and testing is done with <kbd>F5</kbd>.
I have tried to introduce unit testing / code review but that is not going to happen. Static analysis is the only way forward at the moment)
I am most comfortable in C#/C++ (but sometimes work with existing VB6/VBA/VB.Net code) so setting up C# guidelines is pretty easy:
* Warning Level 4
* StyleCop
* FxCop
* Code metrics (e.g. Cyclomatic complexity < 15, Maintainability > 50)
For VB.Net I need to replace StyleCop with some written guidelines but how do I set up the VB.Net compiler.
Personally I never code without `Option Explicit` / `Option Strict` etc but if I do that on our VB.Net projects I get hundreds of warnings/errors (implicit conversions, default return type/value etc).
The VB developers does not seem to have a problem working without help from compiler warnings. I do not think their productivity generally differs from C# developers (it is more a personal thing).
I do not want to enforce my own preference for static checking so my questions is:
**What warning levels are reasonable/best practice for VB.Net development?**
(English is not my first language so I hope this does not sound like I think VB.Net or VB Developers are inferior to C# in any way. I just don't have much experience in VB.Net projects)
| 2 |
7,263,021 | 08/31/2011 20:33:09 | 482,591 | 10/21/2010 05:48:52 | 476 | 18 | Making properties observable in array with Knockout.js Mapping Plugin | Where I call `ko.mapping.fromJS(model)` it creates a blank array. I am trying to create an observable array with observable properties. The initial model variable object as a string looks like this `"[{"Key":"test","Speeches":[{"Text":"test"}]}]"`. Why is the fromJS method returning an empty list? | mapping | knockout.js | null | null | null | null | open | Making properties observable in array with Knockout.js Mapping Plugin
===
Where I call `ko.mapping.fromJS(model)` it creates a blank array. I am trying to create an observable array with observable properties. The initial model variable object as a string looks like this `"[{"Key":"test","Speeches":[{"Text":"test"}]}]"`. Why is the fromJS method returning an empty list? | 0 |
11,020,671 | 06/13/2012 18:01:10 | 1,454,348 | 06/13/2012 17:29:45 | 1 | 0 | Excel Macro conditional formatting indirect cell | I'm a little inexperienced with excel, but i'll try to best explain what i'm trying to do:
I'm trying to have a macro do an addition based in the number in a column.
For example, I want to have the macro add a value based on the name in the B column and the number in the C column. For the name "02 Gloves-DISC" in the B column, i wanted to add the following based in the value in the C column: if it's <5, +8.83. if it's <10, +7. if it's <20, +5. if it's <30, +3. if it's <40, +1. if it's <56, +.50.
I had something similar to this, but i cannot get it to do the search and calculation for each row:
Selection.Replace What:="02 Gloves-DISC", Replacement:="=IF(C2<5, C2+8.83, IF(C2<10, C2+7, IF(C2<20, C2+5, IF(C2<30, C2+3, IF(C2<40, C2+1, C2+.5)))))", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
I hops this info helps. Thank you ahead for any help.
Here is an example of the data i'm working with:
SKU ClassName TakeItPrice
HJC10569002 02 Gloves-DISC 38.93
HJC1222066 02 Gloves-DISC 49.491
HJC1224011 02 Gloves-DISC 40.491
HJC1228062 02 Gloves-DISC 36.991
HJC152100 01 First Class-DISC 13.191
HJC152200 01 First Class-DISC 26.99
HJC152202 01 First Class-DISC 31.491
HJC180000 01 First Class-DISC 11.891
HJC190005 01 First Class-DISC 11.891
HJC350005 01 First Class-DISC 11.891 | excel | macros | conditional-formatting | null | null | null | open | Excel Macro conditional formatting indirect cell
===
I'm a little inexperienced with excel, but i'll try to best explain what i'm trying to do:
I'm trying to have a macro do an addition based in the number in a column.
For example, I want to have the macro add a value based on the name in the B column and the number in the C column. For the name "02 Gloves-DISC" in the B column, i wanted to add the following based in the value in the C column: if it's <5, +8.83. if it's <10, +7. if it's <20, +5. if it's <30, +3. if it's <40, +1. if it's <56, +.50.
I had something similar to this, but i cannot get it to do the search and calculation for each row:
Selection.Replace What:="02 Gloves-DISC", Replacement:="=IF(C2<5, C2+8.83, IF(C2<10, C2+7, IF(C2<20, C2+5, IF(C2<30, C2+3, IF(C2<40, C2+1, C2+.5)))))", LookAt:=xlPart, _
SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _
ReplaceFormat:=False
I hops this info helps. Thank you ahead for any help.
Here is an example of the data i'm working with:
SKU ClassName TakeItPrice
HJC10569002 02 Gloves-DISC 38.93
HJC1222066 02 Gloves-DISC 49.491
HJC1224011 02 Gloves-DISC 40.491
HJC1228062 02 Gloves-DISC 36.991
HJC152100 01 First Class-DISC 13.191
HJC152200 01 First Class-DISC 26.99
HJC152202 01 First Class-DISC 31.491
HJC180000 01 First Class-DISC 11.891
HJC190005 01 First Class-DISC 11.891
HJC350005 01 First Class-DISC 11.891 | 0 |
7,396,883 | 09/13/2011 04:39:32 | 906,042 | 08/22/2011 14:22:42 | 120 | 13 | Setting converter value to null | I have a general function for binding with a converter parameter. When I don't need a converter I want to pass in null but it doesn't let me it says:
Cannot set MultiBinding because MultiValueConverter must be specified.
Before assigning it in the function i check if the converter was null, but I guess the issue is that `IMultiValueConverter` doesn't accept null as value.
Is there anyway to achieve this, without creating a Converter that just returns the input, or an overloaded method?
protected MultiBinding CreateBinding(object source, IMultiValueConverter converter, object parameter, object [] dps)
{
MultiBinding multiBinding = new MultiBinding();
if ( converter != null )
multiBinding.Converter = converter;
multiBinding.ConverterParameter = parameter;
.....
| wpf | parameters | null | converter | null | null | open | Setting converter value to null
===
I have a general function for binding with a converter parameter. When I don't need a converter I want to pass in null but it doesn't let me it says:
Cannot set MultiBinding because MultiValueConverter must be specified.
Before assigning it in the function i check if the converter was null, but I guess the issue is that `IMultiValueConverter` doesn't accept null as value.
Is there anyway to achieve this, without creating a Converter that just returns the input, or an overloaded method?
protected MultiBinding CreateBinding(object source, IMultiValueConverter converter, object parameter, object [] dps)
{
MultiBinding multiBinding = new MultiBinding();
if ( converter != null )
multiBinding.Converter = converter;
multiBinding.ConverterParameter = parameter;
.....
| 0 |
8,405,386 | 12/06/2011 19:08:58 | 1,084,165 | 12/06/2011 18:54:06 | 1 | 0 | adding text (just text!) to form in Drupal7 | OK, I finally figured out how to add (or edit) FORM CONTROLS through the FORM API in Drupal.
But now, I would like to add text to a form. Not a textarea, and not a textfield; both of which can be editted by the user.
I would like to add static text, written by me, to be read by the user.
How would one do that? | forms | api | drupal | null | null | 12/07/2011 13:58:51 | off topic | adding text (just text!) to form in Drupal7
===
OK, I finally figured out how to add (or edit) FORM CONTROLS through the FORM API in Drupal.
But now, I would like to add text to a form. Not a textarea, and not a textfield; both of which can be editted by the user.
I would like to add static text, written by me, to be read by the user.
How would one do that? | 2 |
8,841,200 | 01/12/2012 19:37:14 | 1,139,919 | 01/10/2012 01:20:45 | 1 | 0 | Backup software Ubuntu server | I would like to know which backup software to use with my ubuntu server 11.10.
Currently my server uses raid 1 in order to don't have data loss, but I would like to have a restore iso because I'm starting to do some configuration that could ruin my current installation.
I tried Clonezilla with nodmraid option activated but after language selection it loops on usb devices found and disconnect without any possibility to go forward.
Thanks | ubuntu | backup | ubuntu-11.10 | null | null | 01/12/2012 20:03:42 | off topic | Backup software Ubuntu server
===
I would like to know which backup software to use with my ubuntu server 11.10.
Currently my server uses raid 1 in order to don't have data loss, but I would like to have a restore iso because I'm starting to do some configuration that could ruin my current installation.
I tried Clonezilla with nodmraid option activated but after language selection it loops on usb devices found and disconnect without any possibility to go forward.
Thanks | 2 |
9,182,827 | 02/07/2012 19:49:23 | 1,195,549 | 02/07/2012 19:30:12 | 1 | 0 | ANDROID How to design custom menu | I was asking myself how could I design a "menu" in my application, to be more specific, I have in mind a game, and I would like to "pop-up" a menu, lets say a square, from the left corner, so that I can still see the activity under. My question is if I have to full-redesign a dialog, or there is a way to create a new activity and style it to not take the full screen.
| android | android-layout | null | null | null | null | open | ANDROID How to design custom menu
===
I was asking myself how could I design a "menu" in my application, to be more specific, I have in mind a game, and I would like to "pop-up" a menu, lets say a square, from the left corner, so that I can still see the activity under. My question is if I have to full-redesign a dialog, or there is a way to create a new activity and style it to not take the full screen.
| 0 |
11,210,591 | 06/26/2012 15:20:36 | 367,068 | 06/15/2010 09:12:02 | 23 | 0 | Best way to test web application from different URL's in Visual Studio | I would like some suggestions regarding testing a web application (ASP.Net MVC 3 in my case) from multiple URL's.
The site will behave differently based on which domain name the request is coming from. Nothing fancy, just loading different layouts with a few other simple bits and bobs.
Currently, the web.config contains the valid domains the code acts upon and everything seems to be working fine so far.
Whenever I hit Run in Visual Studio, it fires up the developer server instances with the usual _localhos:xxxx_ address.
If I want to test each layout in VS, I need to configure _localhost_ to be associated with the layout I wish to load.
I could manage to live with how it is right now, but everything is on TFS, so if someone checks out the file (for testing) and forgets to check back in, it can cause some headaches.
So I was wondering if anyone had some decoupled way to fire up a site with a specific address while maintaining the ability to easily debug (preferably not by deploying to IIS)
Thanks. | asp.net-mvc-3 | visual-studio | debugging | iis | null | null | open | Best way to test web application from different URL's in Visual Studio
===
I would like some suggestions regarding testing a web application (ASP.Net MVC 3 in my case) from multiple URL's.
The site will behave differently based on which domain name the request is coming from. Nothing fancy, just loading different layouts with a few other simple bits and bobs.
Currently, the web.config contains the valid domains the code acts upon and everything seems to be working fine so far.
Whenever I hit Run in Visual Studio, it fires up the developer server instances with the usual _localhos:xxxx_ address.
If I want to test each layout in VS, I need to configure _localhost_ to be associated with the layout I wish to load.
I could manage to live with how it is right now, but everything is on TFS, so if someone checks out the file (for testing) and forgets to check back in, it can cause some headaches.
So I was wondering if anyone had some decoupled way to fire up a site with a specific address while maintaining the ability to easily debug (preferably not by deploying to IIS)
Thanks. | 0 |
10,327,288 | 04/26/2012 04:33:49 | 619,734 | 02/16/2011 13:40:40 | 149 | 2 | perform operation on SQL results with same reference | Im building a kinda search engine thing.
My query breaks apart a query string and then SELECT's for each word from the string all of the reference id's associated with that word.
I have a method of giving a relevance score to each id for each query word. However I am looking for a way of keeping track if my query returns the id multiple times. Could anyone point me in the right directions. I am using PHP and mySQL?? | php | mysql | value | search-engine | null | 04/26/2012 11:11:44 | too localized | perform operation on SQL results with same reference
===
Im building a kinda search engine thing.
My query breaks apart a query string and then SELECT's for each word from the string all of the reference id's associated with that word.
I have a method of giving a relevance score to each id for each query word. However I am looking for a way of keeping track if my query returns the id multiple times. Could anyone point me in the right directions. I am using PHP and mySQL?? | 3 |
10,012,535 | 04/04/2012 13:53:02 | 1,187,342 | 03/31/2011 08:26:44 | 1 | 13 | How to download APK from android market | I am developing an application which requires another application to be installed on device.
if application is not already installed on device **I want to download it(.apk file) from android market through my application and make it installed on device**.
how can I achieve it. | android-market | android-apk | null | null | null | null | open | How to download APK from android market
===
I am developing an application which requires another application to be installed on device.
if application is not already installed on device **I want to download it(.apk file) from android market through my application and make it installed on device**.
how can I achieve it. | 0 |
7,463,465 | 09/18/2011 18:27:00 | 951,526 | 09/18/2011 18:27:00 | 1 | 0 | how the value of the nodes are returned ?? i don't understand the implicit stack maintained during recursion | void inorder(struct node *p)
{
if(p!=NULL)
{
inorder(p->lc);
printf("%d\t",p->data);/*how does this call works with the implicit stack*/
inorder(p->rc);
}
else
return;
}
void preorder(struct node *p)
{
if(p!=NULL)
{
printf("%d\t",p->data);
preorder(p->lc);
preorder(p->rc);
}
else
return;
}
void postorder(struct node *p)
{
if(p!=NULL)
{
postorder(p->lc);
postorder(p->rc);
printf("%d\t",p->data);
}
else
return;
}
| c | null | null | null | null | 09/19/2011 07:15:25 | not a real question | how the value of the nodes are returned ?? i don't understand the implicit stack maintained during recursion
===
void inorder(struct node *p)
{
if(p!=NULL)
{
inorder(p->lc);
printf("%d\t",p->data);/*how does this call works with the implicit stack*/
inorder(p->rc);
}
else
return;
}
void preorder(struct node *p)
{
if(p!=NULL)
{
printf("%d\t",p->data);
preorder(p->lc);
preorder(p->rc);
}
else
return;
}
void postorder(struct node *p)
{
if(p!=NULL)
{
postorder(p->lc);
postorder(p->rc);
printf("%d\t",p->data);
}
else
return;
}
| 1 |
794,598 | 04/27/2009 18:09:04 | 85,185 | 01/14/2009 16:55:48 | 158 | 3 | Why is it bad to make events global variables in Javascript? | I've heard that it's no good idea to make events global in JS. I didn't understand why. Is it something IE can't handle? | javascript | events | global | variables | internet-explorer | null | open | Why is it bad to make events global variables in Javascript?
===
I've heard that it's no good idea to make events global in JS. I didn't understand why. Is it something IE can't handle? | 0 |
5,349,524 | 03/18/2011 08:18:50 | 665,695 | 03/18/2011 08:08:22 | 1 | 0 | Call MessageBox from async thread with Form1 as parent | I'm a newbie in C#.
After clicking button1 placed on form1, program is checking if the new version is available (via internet), but doing this in the new thread (to not to freeze the form during check).
When the new version is found or not the appropriate MessageBox is shown, but it has no parent (because it was called from the thread, not directly from the form1).
How to make the MessageBox display with form1 as a parent? | c# | windows | winforms | null | null | null | open | Call MessageBox from async thread with Form1 as parent
===
I'm a newbie in C#.
After clicking button1 placed on form1, program is checking if the new version is available (via internet), but doing this in the new thread (to not to freeze the form during check).
When the new version is found or not the appropriate MessageBox is shown, but it has no parent (because it was called from the thread, not directly from the form1).
How to make the MessageBox display with form1 as a parent? | 0 |
3,921,093 | 10/13/2010 05:47:25 | 474,088 | 10/13/2010 05:20:32 | 1 | 0 | accurate running time of each line and total running time | Show the accurate running time of each line and total running time for the following function:
int f1(int n, int A[ ], int B[ ])
{
if ( (n>=5) || (n<0) )
return 0;
for (int i=0; i<=n; ++i)
{
A[I] = 0;
for (int j=0; j<i; ++j)
B[I] = A[I] + I;
}
return 0;
}
I do this:
4a (t(fetch)+t(cmp)) n>=5
4b (t(fetch)+t(cmp)) n < 0
6a (t(fetch)+t(store)) i = 0
6b (2t(fetch)+t(cmp)) * (n+1) i<= n
6c (2t(fetch)+t(+) +t(store)) *n ++i
8 (3t(fetch)+t([])+t(store)) A[I] = 0;
9a (t(fetch)+t(store)) j = 0
9b (3t(fetch)+t(cmp)) j < i
9c (2t(fetch)+t(+) +t(store)) *n ++j
10 (7t(fetch)+2t([])+t(store) B[I] = A[I] + I;
12 t(return)
23t(fetch)+4t(cmp)+6t(store)+2t(+)+3t([])*3n*(n+1)+t(return)
I do that right? | c++ | performance | null | null | null | 10/16/2010 03:42:54 | not a real question | accurate running time of each line and total running time
===
Show the accurate running time of each line and total running time for the following function:
int f1(int n, int A[ ], int B[ ])
{
if ( (n>=5) || (n<0) )
return 0;
for (int i=0; i<=n; ++i)
{
A[I] = 0;
for (int j=0; j<i; ++j)
B[I] = A[I] + I;
}
return 0;
}
I do this:
4a (t(fetch)+t(cmp)) n>=5
4b (t(fetch)+t(cmp)) n < 0
6a (t(fetch)+t(store)) i = 0
6b (2t(fetch)+t(cmp)) * (n+1) i<= n
6c (2t(fetch)+t(+) +t(store)) *n ++i
8 (3t(fetch)+t([])+t(store)) A[I] = 0;
9a (t(fetch)+t(store)) j = 0
9b (3t(fetch)+t(cmp)) j < i
9c (2t(fetch)+t(+) +t(store)) *n ++j
10 (7t(fetch)+2t([])+t(store) B[I] = A[I] + I;
12 t(return)
23t(fetch)+4t(cmp)+6t(store)+2t(+)+3t([])*3n*(n+1)+t(return)
I do that right? | 1 |
11,508,237 | 07/16/2012 16:10:02 | 691,548 | 04/04/2011 17:39:34 | 3 | 0 | C# implementation of Bron-Kerbosch algorithm | I am attempting to write a C# implementation of the Bron-Kerbosch algorithm (http://en.wikipedia.org/wiki/Bron-Kerbosch_algorithm) in graph theory, which is used to find cliques of maximal size in graphs.
Ideally, this algorithm would produce a list of graphs, where each of those graphs would represent a maximal clique from the initial input graph. My code is not producing the expected result, and I would appreciate some guidance to writing better code that achieves this implementation.
The graph class used in this instance is a custom class based on an adjacency-list representation of a graph.
public class BronKerbosch
{
public List<Graph<Person>> Run(Graph<Person> R, Graph<Person> P, Graph<Person> X, List<Graph<Person>> maximalCliques)
{
// if P and X are both empty, and the size of R is greater than 1 (implies clique):
if (!P.Nodes.Any() && !X.Nodes.Any() && R.Nodes.Count() > 1)
// report R as a maximal clique
maximalCliques.Add(R);
else
{
// Copy P's nodes for traversal
List<GraphNode<Person>> nodesCopy = P.Nodes.ToList();
// For each node v in P:
foreach (GraphNode<Person> v in nodesCopy)
{
// Make graph with just v
Graph<Person> vGraph = new Graph<Person>(new NodeList<Person>());
vGraph.AddNode(v);
Console.WriteLine(v.Value.FirstName + " " + v.Value.LastName);
// Make graph with just v's neighbors
Graph<Person> neighborGraph = new Graph<Person>(v.Neighbors);
// Move v to X
P.Remove(v.Value);
// BronKerbosch(R U {v}, P INTERSECT N(v), X INTERSECT N(v)))
maximalCliques = Run(R.Union(vGraph), P.Intersect(neighborGraph), X.Intersect(neighborGraph), maximalCliques);
X.Union(vGraph);
}
}
return maximalCliques;
}
}
Any help provided would be greatly appreciated - let me know if I can provide any additional information. | c# | .net | algorithm | graph | graph-algorithm | null | open | C# implementation of Bron-Kerbosch algorithm
===
I am attempting to write a C# implementation of the Bron-Kerbosch algorithm (http://en.wikipedia.org/wiki/Bron-Kerbosch_algorithm) in graph theory, which is used to find cliques of maximal size in graphs.
Ideally, this algorithm would produce a list of graphs, where each of those graphs would represent a maximal clique from the initial input graph. My code is not producing the expected result, and I would appreciate some guidance to writing better code that achieves this implementation.
The graph class used in this instance is a custom class based on an adjacency-list representation of a graph.
public class BronKerbosch
{
public List<Graph<Person>> Run(Graph<Person> R, Graph<Person> P, Graph<Person> X, List<Graph<Person>> maximalCliques)
{
// if P and X are both empty, and the size of R is greater than 1 (implies clique):
if (!P.Nodes.Any() && !X.Nodes.Any() && R.Nodes.Count() > 1)
// report R as a maximal clique
maximalCliques.Add(R);
else
{
// Copy P's nodes for traversal
List<GraphNode<Person>> nodesCopy = P.Nodes.ToList();
// For each node v in P:
foreach (GraphNode<Person> v in nodesCopy)
{
// Make graph with just v
Graph<Person> vGraph = new Graph<Person>(new NodeList<Person>());
vGraph.AddNode(v);
Console.WriteLine(v.Value.FirstName + " " + v.Value.LastName);
// Make graph with just v's neighbors
Graph<Person> neighborGraph = new Graph<Person>(v.Neighbors);
// Move v to X
P.Remove(v.Value);
// BronKerbosch(R U {v}, P INTERSECT N(v), X INTERSECT N(v)))
maximalCliques = Run(R.Union(vGraph), P.Intersect(neighborGraph), X.Intersect(neighborGraph), maximalCliques);
X.Union(vGraph);
}
}
return maximalCliques;
}
}
Any help provided would be greatly appreciated - let me know if I can provide any additional information. | 0 |
7,690,355 | 10/07/2011 16:49:41 | 757,853 | 05/17/2011 17:28:27 | 5 | 0 | How do I put two spaces after every period in our HTML? | I need there to be two spaces after every period in every sentence in our entire site (don't ask).
One way to do it is to embark on manually adding a nbsp;nbsp; after every sigle period. This will take several hours.
We can't just find and replace every period, because we have concatinated PHP and other cases where there is a period and then a space, but it's not in a sentence.
Is there a way to do this...and everything still work in ie6? | html | spaces | null | null | null | null | open | How do I put two spaces after every period in our HTML?
===
I need there to be two spaces after every period in every sentence in our entire site (don't ask).
One way to do it is to embark on manually adding a nbsp;nbsp; after every sigle period. This will take several hours.
We can't just find and replace every period, because we have concatinated PHP and other cases where there is a period and then a space, but it's not in a sentence.
Is there a way to do this...and everything still work in ie6? | 0 |
11,041,353 | 06/14/2012 21:06:40 | 1,061,193 | 11/23/2011 05:04:08 | 33 | 3 | One Project - Multiple Programs | I am using Java to write a mid scale product that has multiple programs.
You can think of this project as a MMOG, with server-side, client-side, and other programs.
Since Java has this notion of Projects and Packages, can I put everything in one single Project but separated by Packages? Or do I have to resort to a Project for each individual program?
If there is a way to put all together, that'll be great, because right now I am getting a "Could not find Main" error.
Thank you | java | eclipse | project | packages | main | 06/15/2012 00:30:36 | not constructive | One Project - Multiple Programs
===
I am using Java to write a mid scale product that has multiple programs.
You can think of this project as a MMOG, with server-side, client-side, and other programs.
Since Java has this notion of Projects and Packages, can I put everything in one single Project but separated by Packages? Or do I have to resort to a Project for each individual program?
If there is a way to put all together, that'll be great, because right now I am getting a "Could not find Main" error.
Thank you | 4 |
7,660,370 | 10/05/2011 11:09:47 | 297,891 | 03/20/2010 06:05:15 | 338 | 18 | best ajax options .net 4.0 | Please suggest some of best options (best in terms of overall developers productivity, seamless integration with ASP.NET/MVC, ready to use controls and community support).
I know best is quite subjective, but if you can share your experiences, it would be great. Idea is, if I'm starting on a new application which framework/patters and AJAX library can be thought of in architecture design so that screens are developed quicker?
In some video it was mentioned that MS won't be supporting ASP.AJAX in near future and will rather come up with something different which would be JQuery driven.
references:
http://ajaxpatterns.org/DotNet_Ajax_Frameworks
| .net | ajax | .net-4.0 | null | null | 10/07/2011 09:38:32 | not constructive | best ajax options .net 4.0
===
Please suggest some of best options (best in terms of overall developers productivity, seamless integration with ASP.NET/MVC, ready to use controls and community support).
I know best is quite subjective, but if you can share your experiences, it would be great. Idea is, if I'm starting on a new application which framework/patters and AJAX library can be thought of in architecture design so that screens are developed quicker?
In some video it was mentioned that MS won't be supporting ASP.AJAX in near future and will rather come up with something different which would be JQuery driven.
references:
http://ajaxpatterns.org/DotNet_Ajax_Frameworks
| 4 |
2,556,102 | 03/31/2010 20:06:23 | 231,822 | 12/15/2009 04:42:53 | 313 | 0 | Are there any good alternatives for Visio/PowerPoint? | Are there any good alternatives for Visio/PowerPoint for drawing architectural diagrams. Both Visio and PowerPoint are annoying to use even for some of the simplest tasks. wondering if someone out there has a better suggestion. | powerpoint | visio | null | null | null | 12/26/2011 23:18:42 | off topic | Are there any good alternatives for Visio/PowerPoint?
===
Are there any good alternatives for Visio/PowerPoint for drawing architectural diagrams. Both Visio and PowerPoint are annoying to use even for some of the simplest tasks. wondering if someone out there has a better suggestion. | 2 |
1,175,752 | 07/24/2009 04:29:13 | 96,262 | 04/26/2009 18:19:27 | 51 | 0 | Open source tool to detect Qt controls - Automation | Is there any open source tool for detecting Qt controls?
It can be used as part of automation the testing | testing | automation | null | null | null | null | open | Open source tool to detect Qt controls - Automation
===
Is there any open source tool for detecting Qt controls?
It can be used as part of automation the testing | 0 |
7,919,588 | 10/27/2011 17:01:38 | 676,828 | 03/25/2011 13:44:32 | 65 | 4 | Change Date on a Remote (Virtual Machine) Running Windows Terminal Service | I need to take my virtual machine and change the date back six months in order to do some testing for a report. Unfortunately, every time I change the date back, the system reverts to the current date.
I’ve turned off the WinLock protections, but I have been unsuccessful. I’ve double clicked on the time on the taskbar, changed the date and clicked on Apply. The date will change for a moment, but then it resets back to today’s date. I’ve unchecked the automatical adjustment for daylight savings time, as well as the synchronization with an Internet time server. | date | virtual-machine | null | null | null | null | open | Change Date on a Remote (Virtual Machine) Running Windows Terminal Service
===
I need to take my virtual machine and change the date back six months in order to do some testing for a report. Unfortunately, every time I change the date back, the system reverts to the current date.
I’ve turned off the WinLock protections, but I have been unsuccessful. I’ve double clicked on the time on the taskbar, changed the date and clicked on Apply. The date will change for a moment, but then it resets back to today’s date. I’ve unchecked the automatical adjustment for daylight savings time, as well as the synchronization with an Internet time server. | 0 |
10,847,243 | 06/01/2012 08:54:16 | 1,035,393 | 11/08/2011 10:22:34 | 38 | 0 | requestLocationUpdates() and removeUpdates() , Unable to handle in Seperate Thread | I am using Timer and TimerTask in my Service and i am scheduling GPS to check periodically using this method @ Service - onCreate()
scheduleAllGPST.scheduleAtFixedRate(new AllGPSTimer(), 0,
everyInterval);
code Snippet From my Service Class
//class inside service class
class AllGPSTimer extends TimerTask {
public void run() {
if (!canGetLocation) stopLocationRequest();
else requestLocation();
}
}
// Service class method
public void requestLocation() {
try {
locListener = new mylocationlistener();
locationManager.requestLocationUpdates(provider, 0, 0, locListener);// Error happens at this line
}
catch (Exception e) {
e.printStackTrace();
}
}
public void stopLocationRequest() {
try {
locationManager.removeUpdates(locListener);// And also it happens at this line
}
catch (Exception e) {
e.printStackTrace();
}
}
I am getting this Error
Error :
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:121)
at android.location.LocationManager$ListenerTransport$1.<init>(LocationManager.java:139)
at android.location.LocationManager$ListenerTransport.<init>(LocationManager.java:137)
at android.location.LocationManager._requestLocationUpdates(LocationManager.java:708)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:630)
at com.mobile.sales.GPSService.requestLocation(GPSService.java:146)
at com.mobile.sales.GPSService$AllGPSTimer.run(GPSService.java:140)
at java.util.Timer$TimerImpl.run(Timer.java:289)
From the Error , I am guessing this requestLocationUpdates( ) &
removeUpdates() can only be used from the Main thread of the Service class not from the spawned thread of the main thread .. Am i guessing it in a right Way ??
So is there any Method like runOnUiThread(runnable) in Activity class for the Service class.. ???
Kindly any one help us how i should handle location api methods and the spawned thread of timer task ?? Also let me know if i am guessing it wrong
Thank you !!
the reque
| android | multithreading | thread-safety | android-service | android-location | null | open | requestLocationUpdates() and removeUpdates() , Unable to handle in Seperate Thread
===
I am using Timer and TimerTask in my Service and i am scheduling GPS to check periodically using this method @ Service - onCreate()
scheduleAllGPST.scheduleAtFixedRate(new AllGPSTimer(), 0,
everyInterval);
code Snippet From my Service Class
//class inside service class
class AllGPSTimer extends TimerTask {
public void run() {
if (!canGetLocation) stopLocationRequest();
else requestLocation();
}
}
// Service class method
public void requestLocation() {
try {
locListener = new mylocationlistener();
locationManager.requestLocationUpdates(provider, 0, 0, locListener);// Error happens at this line
}
catch (Exception e) {
e.printStackTrace();
}
}
public void stopLocationRequest() {
try {
locationManager.removeUpdates(locListener);// And also it happens at this line
}
catch (Exception e) {
e.printStackTrace();
}
}
I am getting this Error
Error :
java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
at android.os.Handler.<init>(Handler.java:121)
at android.location.LocationManager$ListenerTransport$1.<init>(LocationManager.java:139)
at android.location.LocationManager$ListenerTransport.<init>(LocationManager.java:137)
at android.location.LocationManager._requestLocationUpdates(LocationManager.java:708)
at android.location.LocationManager.requestLocationUpdates(LocationManager.java:630)
at com.mobile.sales.GPSService.requestLocation(GPSService.java:146)
at com.mobile.sales.GPSService$AllGPSTimer.run(GPSService.java:140)
at java.util.Timer$TimerImpl.run(Timer.java:289)
From the Error , I am guessing this requestLocationUpdates( ) &
removeUpdates() can only be used from the Main thread of the Service class not from the spawned thread of the main thread .. Am i guessing it in a right Way ??
So is there any Method like runOnUiThread(runnable) in Activity class for the Service class.. ???
Kindly any one help us how i should handle location api methods and the spawned thread of timer task ?? Also let me know if i am guessing it wrong
Thank you !!
the reque
| 0 |
11,409,599 | 07/10/2012 08:41:17 | 296,635 | 03/18/2010 15:08:29 | 392 | 0 | Written to a log file managed by java from a procedure Oracle | Can be written to a log file managed by java from a procedure Oracle PL / SQL
Thx. | java | oracle | logging | null | null | 07/10/2012 10:43:44 | not a real question | Written to a log file managed by java from a procedure Oracle
===
Can be written to a log file managed by java from a procedure Oracle PL / SQL
Thx. | 1 |
9,952,980 | 03/31/2012 04:17:21 | 1,205,914 | 02/13/2012 02:16:32 | 28 | 0 | Weka Snowball Stemmer giving errors | I have a program like this -
import weka.core.stemmers.SnowballStemmer;
public class TestProject{
public static void main(String[] args) {
String testString = "shortly";
SnowballStemmer stem = new SnowballStemmer();
String text = stem.stem(testString);
System.out.println(text);
}
}
This program executes and I get the following output -
---Registering Weka Editors---
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
shortli
My question is how to remove those 5 lines of errors that are printed when the program executes?
I am not using any database.
Thank You, | java | error-message | weka | null | null | null | open | Weka Snowball Stemmer giving errors
===
I have a program like this -
import weka.core.stemmers.SnowballStemmer;
public class TestProject{
public static void main(String[] args) {
String testString = "shortly";
SnowballStemmer stem = new SnowballStemmer();
String text = stem.stem(testString);
System.out.println(text);
}
}
This program executes and I get the following output -
---Registering Weka Editors---
Trying to add database driver (JDBC): RmiJdbc.RJDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): jdbc.idbDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.gjt.mm.mysql.Driver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): com.mckoi.JDBCDriver - Error, not in CLASSPATH?
Trying to add database driver (JDBC): org.hsqldb.jdbcDriver - Error, not in CLASSPATH?
shortli
My question is how to remove those 5 lines of errors that are printed when the program executes?
I am not using any database.
Thank You, | 0 |
9,460,866 | 02/27/2012 06:24:51 | 1,234,942 | 02/27/2012 06:18:45 | 1 | 0 | c# Application Without SQL Server | I Want to Create a C# application which get data from some text or xml files.
Then Create Table and Database in memory. to execute SQL Queries.
And then finally want to save data in files again.
I don't want to use SQL Server for this application.
Please anyone tell me to how to create Database and Tables In C# Without using SQL Server
And Save Data fetched from text files into these Tables.
Thanks,
Asif Ayub | c# | sql | null | null | null | 03/25/2012 17:16:01 | not a real question | c# Application Without SQL Server
===
I Want to Create a C# application which get data from some text or xml files.
Then Create Table and Database in memory. to execute SQL Queries.
And then finally want to save data in files again.
I don't want to use SQL Server for this application.
Please anyone tell me to how to create Database and Tables In C# Without using SQL Server
And Save Data fetched from text files into these Tables.
Thanks,
Asif Ayub | 1 |
9,619,451 | 03/08/2012 14:46:37 | 1,178,313 | 01/30/2012 14:54:17 | 43 | 0 | PHP Last log in script | I wanted to know a good and effeicent way to be able to tell how long ago my users last logged in.
On the users profile i want it for say how long ago their last log in was.
Eg:
User 1
Last login: 2 hours ago
User 2
Last login: 3 minutes ago
User 3
Last login: 2 months ago
-------------
I will keep thier last login information in a MySQL database but want to know how to do the script.
Thanks in advanced.
I just realised that StackFlow uses this feature, so that can help you understand what I want.
--------
mysql_query("UPDATE users SET lastactivity = ".time()." WHERE id = ".$userID);
This is how I will update the DB. | php | null | null | null | null | 03/10/2012 00:47:42 | not a real question | PHP Last log in script
===
I wanted to know a good and effeicent way to be able to tell how long ago my users last logged in.
On the users profile i want it for say how long ago their last log in was.
Eg:
User 1
Last login: 2 hours ago
User 2
Last login: 3 minutes ago
User 3
Last login: 2 months ago
-------------
I will keep thier last login information in a MySQL database but want to know how to do the script.
Thanks in advanced.
I just realised that StackFlow uses this feature, so that can help you understand what I want.
--------
mysql_query("UPDATE users SET lastactivity = ".time()." WHERE id = ".$userID);
This is how I will update the DB. | 1 |
11,189,000 | 06/25/2012 12:03:11 | 934,618 | 09/08/2011 10:47:20 | 91 | 6 | TFS "Copy Outputs to Drop Folder" parameter in build process template | I want do some job in my build process template only if parameter "Copy Outputs to Drop Folder" is set to true. Is there any variable that is associated with this parameter? | tfs | tfs2010 | build-process | null | null | null | open | TFS "Copy Outputs to Drop Folder" parameter in build process template
===
I want do some job in my build process template only if parameter "Copy Outputs to Drop Folder" is set to true. Is there any variable that is associated with this parameter? | 0 |
6,814,488 | 07/25/2011 10:05:33 | 738,851 | 05/04/2011 21:39:22 | 179 | 19 | How do I allow (remote) IISReset through the firewall on Win Server 2008 | I'm trying to run the following, to reset IIS on a remote machine.
`IISReset <remoteMachine>`
If I disable the domain firewall, everything works fine. With the firewall enabled, I get
`The RPC server is unavailable.`
Initially I tried enabling `Remote Administration (RPC-EPMAP)` and any other rules that looked even tenuously related. Then I tried enabling all the predefined rules, but with no success.
| iis | firewall | iisreset | null | null | 07/25/2011 15:49:23 | off topic | How do I allow (remote) IISReset through the firewall on Win Server 2008
===
I'm trying to run the following, to reset IIS on a remote machine.
`IISReset <remoteMachine>`
If I disable the domain firewall, everything works fine. With the firewall enabled, I get
`The RPC server is unavailable.`
Initially I tried enabling `Remote Administration (RPC-EPMAP)` and any other rules that looked even tenuously related. Then I tried enabling all the predefined rules, but with no success.
| 2 |
11,535,401 | 07/18/2012 06:23:37 | 1,268,331 | 03/14/2012 07:17:13 | 13 | 2 | Count multiple columns joining multiple tables | In my tournament application I am attempting to get a count of medals for each participant.
I have a results table which has GoldID, SilverID, and BronzeID. I have done it this way because the ID may be for an individual or a team (DivisionGroup = "Team" or something else). The results could also be for type A or type B (DivisionType = "A" or "B").
public int GoldID { get; set; }
public int SilverID { get; set; }
public int BronzeID { get; set; }
public string DivisionGroup { get; set; }
public string DivisionType { get; set; }
I'm pretty sure the following will get me results for individuals but I'd rather do it in one query if there is a way.
var GoldIndividual = from r in context.Result
where r.DivisionGroup != "Team" &&
r.TournamentsID == TournamentID &&
r.GoldID == ParticipantsID
select r;
var SilverIndividual = from r in context.Result
where r.DivisionGroup != "Team" &&
r.TournamentsID == TournamentID &&
r.SilverID == ParticipantsID
select r;
var BronzeIndividual = from r in context.DivisionGradeResult
where r.DivisionGroup != "Team" &&
r.TournamentsID == TournamentID &&
r.BronzeID == .ParticipantsID
select r;
The teams thing is messing me up completely. The GoldID, SilverID, and BronzeID is the ID of the Teams table. The teams table has a collection of participants. Joining the participants table has nothing to join on because the team.participants is a collection.
The following SQL works (this is in SQL Compact 4.0) but I don't know how to make it into LINQ because "TeamsA_TeamsAID" doesn't exist in the entity object. Participants do but as a collection I can't go "Participants.ParticipantsID"
SELECT COUNT(GoldID)
FROM Results
INNER JOIN TeamsA ON Results.GoldID = TeamsAID
INNER JOIN Participants ON TeamsA_TeamsAID = TeamsAID
WHERE ParticipantsID = 1
AND DivisionGroup = 'Team'
AND DivisionType = 'A'
This one will also need to do it for gold, silver, and bronze. Again, in one query would be nice. Especially considering I have to do it all again against TeamsB on DivisionType "B".
| winforms | c#-4.0 | entity-framework-4 | null | null | null | open | Count multiple columns joining multiple tables
===
In my tournament application I am attempting to get a count of medals for each participant.
I have a results table which has GoldID, SilverID, and BronzeID. I have done it this way because the ID may be for an individual or a team (DivisionGroup = "Team" or something else). The results could also be for type A or type B (DivisionType = "A" or "B").
public int GoldID { get; set; }
public int SilverID { get; set; }
public int BronzeID { get; set; }
public string DivisionGroup { get; set; }
public string DivisionType { get; set; }
I'm pretty sure the following will get me results for individuals but I'd rather do it in one query if there is a way.
var GoldIndividual = from r in context.Result
where r.DivisionGroup != "Team" &&
r.TournamentsID == TournamentID &&
r.GoldID == ParticipantsID
select r;
var SilverIndividual = from r in context.Result
where r.DivisionGroup != "Team" &&
r.TournamentsID == TournamentID &&
r.SilverID == ParticipantsID
select r;
var BronzeIndividual = from r in context.DivisionGradeResult
where r.DivisionGroup != "Team" &&
r.TournamentsID == TournamentID &&
r.BronzeID == .ParticipantsID
select r;
The teams thing is messing me up completely. The GoldID, SilverID, and BronzeID is the ID of the Teams table. The teams table has a collection of participants. Joining the participants table has nothing to join on because the team.participants is a collection.
The following SQL works (this is in SQL Compact 4.0) but I don't know how to make it into LINQ because "TeamsA_TeamsAID" doesn't exist in the entity object. Participants do but as a collection I can't go "Participants.ParticipantsID"
SELECT COUNT(GoldID)
FROM Results
INNER JOIN TeamsA ON Results.GoldID = TeamsAID
INNER JOIN Participants ON TeamsA_TeamsAID = TeamsAID
WHERE ParticipantsID = 1
AND DivisionGroup = 'Team'
AND DivisionType = 'A'
This one will also need to do it for gold, silver, and bronze. Again, in one query would be nice. Especially considering I have to do it all again against TeamsB on DivisionType "B".
| 0 |
9,141,172 | 02/04/2012 13:19:11 | 1,189,352 | 02/04/2012 12:54:51 | 1 | 0 | An example of Best Case Scenario for Quick Sort (Need someone to check if my answer is correct) | Using a list of 15 numbers, I need to give a list representing the best and worst case scenario. It says "q.s. uses the first item in the list as the pivot item". I'm not sure if I pick the first item as pivot everytime, but that's what I'm assuming....
For best case scenario.. I came up with (bold for pivot, italic for bigger and smaller than markers):
**8** 1 3 2 6 5 7 *4* *12* 9 11 10 14 13 15
**4** 1 3 *2* *6* 5 7--8--**12** 9 11 *10* *14* 13 15
**2** *1 3* --4--**6** *5* *7*........8........**10** 9 11--12--14 13 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
^ sorry kinda hard to read but, I tried to make it legible. Hope someone can here can verify my work and if it's wrong, point out to me how and why.
ps - my first post here! | algorithm | sorting | array-sorting | sorting-algorithm | null | null | open | An example of Best Case Scenario for Quick Sort (Need someone to check if my answer is correct)
===
Using a list of 15 numbers, I need to give a list representing the best and worst case scenario. It says "q.s. uses the first item in the list as the pivot item". I'm not sure if I pick the first item as pivot everytime, but that's what I'm assuming....
For best case scenario.. I came up with (bold for pivot, italic for bigger and smaller than markers):
**8** 1 3 2 6 5 7 *4* *12* 9 11 10 14 13 15
**4** 1 3 *2* *6* 5 7--8--**12** 9 11 *10* *14* 13 15
**2** *1 3* --4--**6** *5* *7*........8........**10** 9 11--12--14 13 15
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
^ sorry kinda hard to read but, I tried to make it legible. Hope someone can here can verify my work and if it's wrong, point out to me how and why.
ps - my first post here! | 0 |
7,452,646 | 09/17/2011 05:26:21 | 949,896 | 09/17/2011 05:26:21 | 1 | 0 | php software for tracking employe leaves and payslips? | My cousin started a small firm recently, he would like to have a software installed on his server so he can administer leaves/payslips for his workers. Is there any opensource code project available for this? | php | open-source | payscale | null | null | 09/17/2011 07:54:46 | off topic | php software for tracking employe leaves and payslips?
===
My cousin started a small firm recently, he would like to have a software installed on his server so he can administer leaves/payslips for his workers. Is there any opensource code project available for this? | 2 |
7,868,622 | 10/23/2011 19:34:57 | 323,578 | 04/22/2010 00:59:07 | 210 | 6 | What does Command+R do in textmate and how to I disable it? | I am constantly always accidentally hitting "COMMAND + R" on my osx in textmate because I am trying to do a refresh in Chrome. When I do command + R in textmate, the file in my project turn RED and it stops working for a minute. Why is this happening and how do I stop it from happening?
| python | textmate | null | null | null | 10/23/2011 19:39:06 | off topic | What does Command+R do in textmate and how to I disable it?
===
I am constantly always accidentally hitting "COMMAND + R" on my osx in textmate because I am trying to do a refresh in Chrome. When I do command + R in textmate, the file in my project turn RED and it stops working for a minute. Why is this happening and how do I stop it from happening?
| 2 |
7,206,901 | 08/26/2011 15:17:05 | 850,868 | 07/18/2011 21:29:23 | 1 | 2 | How to design a file system for unlimited storage | This is an interview question in a media company. I was asked to design a file system with unlimited storage. I thought about it a little, some sources suggest to implement a distributed file system.
For now I am trying to design just read method(again pseudo-code) of text file which will be unlimited. The code has a little mix of pseudo-code. Your criticisms are invited in terms of if it should have any feature for unlimited file storage I am missing.
class UnlimitedTextFile {
UnlimitedTextFile (int partitionSize, name){
this.partitionSize=partitionSize;
this.name=name;
}
int num_partitions;
int partitionSize;
String name;
Map<String, String> partitionMap; // key = name+"_"+paritionNum(it will be 0 based index) , value = URL path on system where file is stored.
Iterator<String> readIterator(int index, int len){
//reads Strings of length = len from the character at index till the end of file.
if (len > partitionSize) throw new IllegalArgumentException("Can't read such huge data");
int partitionNum1, partitionNum2;
//this method has to make sure to read at most two partitions.
//partitionNum1 will be determined by looking at index and partitionSize.
//If index = 345 and partitionSize = 100. partitionNum1 = 3.
// it may have to read next partitioned file as well since len <= partitionSize.
return newPIter(index, len, partitionNum1, partitionNum2);
}
void append(ByteArrayInputStream in){
}
private class PIter implements iterator<String>{
int cursor=0;
int length = 10;
int partitionNum1 = 0;
int partitionNum2 = -1;
PIter(int index, int len, int partitionNum1, int partitionNum2){
cursor = index;
length = len;
this.partitionNum1 = partitionNum1;
this.partitionNum2 = partitionNum2;
}
PIter(){
cursor = 0;
length = 10
}
public boolean hasNext() {
return cursor != size();
}
public String next() {
//read, store cursor in current partition. If end of partition then move to next partition (only if partitionNum != -1)
}
}
}
| design | interview-questions | filesystems | null | null | 07/16/2012 20:30:45 | not constructive | How to design a file system for unlimited storage
===
This is an interview question in a media company. I was asked to design a file system with unlimited storage. I thought about it a little, some sources suggest to implement a distributed file system.
For now I am trying to design just read method(again pseudo-code) of text file which will be unlimited. The code has a little mix of pseudo-code. Your criticisms are invited in terms of if it should have any feature for unlimited file storage I am missing.
class UnlimitedTextFile {
UnlimitedTextFile (int partitionSize, name){
this.partitionSize=partitionSize;
this.name=name;
}
int num_partitions;
int partitionSize;
String name;
Map<String, String> partitionMap; // key = name+"_"+paritionNum(it will be 0 based index) , value = URL path on system where file is stored.
Iterator<String> readIterator(int index, int len){
//reads Strings of length = len from the character at index till the end of file.
if (len > partitionSize) throw new IllegalArgumentException("Can't read such huge data");
int partitionNum1, partitionNum2;
//this method has to make sure to read at most two partitions.
//partitionNum1 will be determined by looking at index and partitionSize.
//If index = 345 and partitionSize = 100. partitionNum1 = 3.
// it may have to read next partitioned file as well since len <= partitionSize.
return newPIter(index, len, partitionNum1, partitionNum2);
}
void append(ByteArrayInputStream in){
}
private class PIter implements iterator<String>{
int cursor=0;
int length = 10;
int partitionNum1 = 0;
int partitionNum2 = -1;
PIter(int index, int len, int partitionNum1, int partitionNum2){
cursor = index;
length = len;
this.partitionNum1 = partitionNum1;
this.partitionNum2 = partitionNum2;
}
PIter(){
cursor = 0;
length = 10
}
public boolean hasNext() {
return cursor != size();
}
public String next() {
//read, store cursor in current partition. If end of partition then move to next partition (only if partitionNum != -1)
}
}
}
| 4 |
11,019,557 | 06/13/2012 16:47:15 | 645,647 | 03/05/2011 01:38:20 | 112 | 5 | Create an array in a function in C | Why isn't it possible to create an array in a function in C similar to what I have below?
int ** image;
int height;//initialized in a method not shown
void generateMatrices()
{
image = (int **)malloc(sizeof(int*) * height);//other stuff
}
int main(int argc, char* argv[])
{
generateMatrices();
//other stuff
return 0;
} | c | arrays | null | null | null | 06/14/2012 17:40:24 | not a real question | Create an array in a function in C
===
Why isn't it possible to create an array in a function in C similar to what I have below?
int ** image;
int height;//initialized in a method not shown
void generateMatrices()
{
image = (int **)malloc(sizeof(int*) * height);//other stuff
}
int main(int argc, char* argv[])
{
generateMatrices();
//other stuff
return 0;
} | 1 |
8,548,710 | 12/17/2011 23:29:16 | 1,030,608 | 11/05/2011 00:03:46 | 40 | 0 | Regular expression in Flex | I want to check if the string is not empty (having whitespaces only also counts as empty). How to compose the regular expression in actionscript? | regex | flex4.5 | null | null | null | null | open | Regular expression in Flex
===
I want to check if the string is not empty (having whitespaces only also counts as empty). How to compose the regular expression in actionscript? | 0 |
11,116,581 | 06/20/2012 09:29:20 | 1,468,728 | 06/20/2012 09:24:02 | 1 | 0 | Android Login Example | I am new to Android, I want to create sample application in which when user open my application first user has to login into my application in mysql which on server.
After successful login I want to display menu or other pages.
But I want to know how user can see other pages of my application only and only after login successfully?
So Any one can help me for this? | android | example | null | null | null | 06/20/2012 09:44:32 | not a real question | Android Login Example
===
I am new to Android, I want to create sample application in which when user open my application first user has to login into my application in mysql which on server.
After successful login I want to display menu or other pages.
But I want to know how user can see other pages of my application only and only after login successfully?
So Any one can help me for this? | 1 |
836,769 | 05/07/2009 20:08:38 | 103,119 | 05/07/2009 19:57:08 | 1 | 2 | Is there a Java Open source Library for parsing Excel 2007 Files? | Is there a Java Open source Library for parsing Excel 2007 Files? | java | opensource | excel | 2007 | null | null | open | Is there a Java Open source Library for parsing Excel 2007 Files?
===
Is there a Java Open source Library for parsing Excel 2007 Files? | 0 |
11,484,560 | 07/14/2012 14:33:28 | 1,525,436 | 07/14/2012 10:39:20 | 3 | 0 | How do I replicate my .htaccess functionility in NGINX | I have the below `.htaccess` file in apache that redirects all request to `app/index.php` with or without a `GET` parameter. I just installed NGINX and my application won't run.
Can anyone assist in replicating same functionality in NGINX? Thanks.
RewriteEngine on
Options -Indexes
RewriteRule ^$ app/ [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ app/index.php?url=$1 [QSA,L] | apache | .htaccess | nginx | null | null | 07/16/2012 07:27:12 | off topic | How do I replicate my .htaccess functionility in NGINX
===
I have the below `.htaccess` file in apache that redirects all request to `app/index.php` with or without a `GET` parameter. I just installed NGINX and my application won't run.
Can anyone assist in replicating same functionality in NGINX? Thanks.
RewriteEngine on
Options -Indexes
RewriteRule ^$ app/ [L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ app/index.php?url=$1 [QSA,L] | 2 |
11,595,524 | 07/21/2012 20:11:13 | 1,397,472 | 05/16/2012 01:06:25 | 5 | 0 | Editing css within generated iframe | I have a site build in joomla, which is using a calendar component (jevents) which generates an iframe in which users can edit an event on their calendar. I need apply css to the body of this iframe, however it linksthe css to the main template style sheet, so if I apply changes changes to that, it effects my whole site.
I've tried numerous edits in firebug, but the only one that seems to work is styling the iframe in-line - however, I can't locate the proper file/line of code where that is.
Here's a screenshot. Any suggestions?
http://virgoscript.com/images/sample.jpg | css | joomla | null | null | null | 07/21/2012 21:26:12 | not a real question | Editing css within generated iframe
===
I have a site build in joomla, which is using a calendar component (jevents) which generates an iframe in which users can edit an event on their calendar. I need apply css to the body of this iframe, however it linksthe css to the main template style sheet, so if I apply changes changes to that, it effects my whole site.
I've tried numerous edits in firebug, but the only one that seems to work is styling the iframe in-line - however, I can't locate the proper file/line of code where that is.
Here's a screenshot. Any suggestions?
http://virgoscript.com/images/sample.jpg | 1 |
7,433,192 | 09/15/2011 15:12:34 | 926,961 | 09/03/2011 19:50:32 | 1 | 0 | Django admin - importing images to the text | I've pasted below small part of my models class. It's a class for publishing entries (articles, blog posts etc.). On most websites news images are pasted below the text of message.
Is it possible to add images directly inside the text while writing the entry/article?
Example:
Quisque aliquam magna pulvinar libero tincidunt auctor. Praesent nisi lacus, porta vel mattis sed, rhoncus ultrices risus.
**<<< Image 1 >>>**
Ut lobortis interdum nulla eget eleifend. Integer tincidunt accumsan vehicula. Nunc quis justo sit amet neque dapibus suscipit nec vitae felis. Proin pulvinar blandit enim, vel porta metus convallis non.
**<<< Image 2 >>>**
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
class Publisher(models.Model):
text = models.TextField()
images = models.ManyToManyField('Images', blank=True)
| django | image | django-admin | admin | django-imagefield | null | open | Django admin - importing images to the text
===
I've pasted below small part of my models class. It's a class for publishing entries (articles, blog posts etc.). On most websites news images are pasted below the text of message.
Is it possible to add images directly inside the text while writing the entry/article?
Example:
Quisque aliquam magna pulvinar libero tincidunt auctor. Praesent nisi lacus, porta vel mattis sed, rhoncus ultrices risus.
**<<< Image 1 >>>**
Ut lobortis interdum nulla eget eleifend. Integer tincidunt accumsan vehicula. Nunc quis justo sit amet neque dapibus suscipit nec vitae felis. Proin pulvinar blandit enim, vel porta metus convallis non.
**<<< Image 2 >>>**
Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.
class Publisher(models.Model):
text = models.TextField()
images = models.ManyToManyField('Images', blank=True)
| 0 |
9,998,470 | 04/03/2012 17:37:33 | 1,159,524 | 01/19/2012 21:36:18 | 8 | 0 | ssh cannot find cygcrypto-0.9.8.dll | I am trying to ssh to a machine using cygwin but I get the following error:
/usr/bin/ssh.exe: error while loading shared libraries: cygcrypto-0.9.8.dll: cannot open shared object file: No such file or directory
So I tried to find this dll but instead of cygcrypto-0.9.8.dll there is cygcrypto-1.0.0.dll. So how do I tell cygwin/ssh to look for this new version? | ssh | cygwin | null | null | null | 07/24/2012 23:53:50 | off topic | ssh cannot find cygcrypto-0.9.8.dll
===
I am trying to ssh to a machine using cygwin but I get the following error:
/usr/bin/ssh.exe: error while loading shared libraries: cygcrypto-0.9.8.dll: cannot open shared object file: No such file or directory
So I tried to find this dll but instead of cygcrypto-0.9.8.dll there is cygcrypto-1.0.0.dll. So how do I tell cygwin/ssh to look for this new version? | 2 |
5,509,106 | 04/01/2011 04:17:47 | 173,520 | 09/15/2009 05:18:28 | 2,644 | 29 | why would I need to use a primitive accessor methods in a core data project? | Why would I need to use a primitive accessor methods in a core data project?
I'm reading about Core Data and note the below:
> By default, Core Data dynamically
> creates efficient public and primitive
> get and set accessor methods for
> modeled properties (attributes and
> relationships) of managed object
> classes...
>
> For example, given an entity with an
> attribute firstName, Core Data
> automatically generates firstName,
> setFirstName:, primitiveFirstName, and
> setPrimitiveFirstName:.
I'm still not sure what the primitive accessor methods are? How do they work? When & why would I need to use them over the normal accessor methods?
thanks | iphone | core-data | null | null | null | null | open | why would I need to use a primitive accessor methods in a core data project?
===
Why would I need to use a primitive accessor methods in a core data project?
I'm reading about Core Data and note the below:
> By default, Core Data dynamically
> creates efficient public and primitive
> get and set accessor methods for
> modeled properties (attributes and
> relationships) of managed object
> classes...
>
> For example, given an entity with an
> attribute firstName, Core Data
> automatically generates firstName,
> setFirstName:, primitiveFirstName, and
> setPrimitiveFirstName:.
I'm still not sure what the primitive accessor methods are? How do they work? When & why would I need to use them over the normal accessor methods?
thanks | 0 |
5,388,894 | 03/22/2011 09:07:22 | 670,882 | 03/22/2011 09:07:22 | 1 | 0 | runhaskell error on ghc7.02 | I created a yesod application on ghc7.0.2.
when i use the command ”runhaskell devel-server.hs“ to run the app, errors Occurred:
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
ghczm7zi0zi2_AsmCodeGen_zdfMonadCmmOptM2_closure
whilst processing object file
/usr/local/lib/ghc-7.0.2/ghc-7.0.2/libHSghc-7.0.2.a
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
who can help me? thanks! | haskell | null | null | null | null | null | open | runhaskell error on ghc7.02
===
I created a yesod application on ghc7.0.2.
when i use the command ”runhaskell devel-server.hs“ to run the app, errors Occurred:
GHCi runtime linker: fatal error: I found a duplicate definition for symbol
ghczm7zi0zi2_AsmCodeGen_zdfMonadCmmOptM2_closure
whilst processing object file
/usr/local/lib/ghc-7.0.2/ghc-7.0.2/libHSghc-7.0.2.a
This could be caused by:
* Loading two different object files which export the same symbol
* Specifying the same object file twice on the GHCi command line
* An incorrect `package.conf' entry, causing some object to be
loaded twice.
GHCi cannot safely continue in this situation. Exiting now. Sorry.
who can help me? thanks! | 0 |
8,412,415 | 12/07/2011 08:41:58 | 1,017,667 | 03/31/2011 15:08:34 | 212 | 12 | NSMutableDictionary doubts in iphone sdk | Ha ii,everybody ,i am doing a reader application ,in my app there is a note syncing option to googledoc,so the user write the note in a note-view and saved ,the saved note is displayed or saved in another view controller in UItableview .My requirement is when the user tapped the gDoc button it automatically wants to sync all the notes from the UiTableView to GDoc.I just saved the notes by this code when the save button pressed
-(IBAction)savedNote
{
[delegate.indexArray addObject:[NSString stringWithFormat:@"%@ %@:%@",delegate.selectedBook,delegate.selectedChapter,delegate.selectedIndex]];
[delegate.notesArray addObject:textVieww.text];
[notes setValue:textVieww.text forKey:[NSString stringWithFormat:@"%@ %@:%@",delegate.selectedBook,delegate.selectedChapter,delegate.selectedIndex]];
NSString *DataPath = [Malayalam_BibleAppDelegate getPath];
[delegate.data writeToFile:DataPath atomically:YES];
proAlertView *alert = [[proAlertView alloc]initWithTitle:@"NOTES" message:@"Notes Saved" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert setBackgroundColor:[UIColor colorWithRed:0.255 green:0.218 blue:0.185 alpha:1.0] withStrokeColor:[UIColor colorWithHue:0.625 saturation:0.0 brightness:0.8 alpha:0.8]];
[alert show];
[alert release];
}
-(IBAction)_clickbtngoogledocsync:(id)sender
{
Googledocmainpage *detailViewController = [[Googledocmainpage alloc] initWithNibName:@"Googledocmainpage" bundle:nil];
// Pass the selected object to the new view controller.
detailViewController.localStringtextnote = localStringtextnote;//i want to pass these note to googledocmainpage as localstring
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
UIView *langview = (UIView *)[self.view viewWithTag:120];
//ViewWithTag Number should be same as used while allocating
[langview removeFromSuperview];
/* [self.view addSubview:syncView];
UIView *popView = (UIView *)[self.view viewWithTag:106];
//ViewWithTag Number should be same as used while allocating
[popView removeFromSuperview];*/
}
How to do this.Thanks in advance. | iphone | null | null | null | null | null | open | NSMutableDictionary doubts in iphone sdk
===
Ha ii,everybody ,i am doing a reader application ,in my app there is a note syncing option to googledoc,so the user write the note in a note-view and saved ,the saved note is displayed or saved in another view controller in UItableview .My requirement is when the user tapped the gDoc button it automatically wants to sync all the notes from the UiTableView to GDoc.I just saved the notes by this code when the save button pressed
-(IBAction)savedNote
{
[delegate.indexArray addObject:[NSString stringWithFormat:@"%@ %@:%@",delegate.selectedBook,delegate.selectedChapter,delegate.selectedIndex]];
[delegate.notesArray addObject:textVieww.text];
[notes setValue:textVieww.text forKey:[NSString stringWithFormat:@"%@ %@:%@",delegate.selectedBook,delegate.selectedChapter,delegate.selectedIndex]];
NSString *DataPath = [Malayalam_BibleAppDelegate getPath];
[delegate.data writeToFile:DataPath atomically:YES];
proAlertView *alert = [[proAlertView alloc]initWithTitle:@"NOTES" message:@"Notes Saved" delegate:self cancelButtonTitle:@"ok" otherButtonTitles:nil];
[alert setBackgroundColor:[UIColor colorWithRed:0.255 green:0.218 blue:0.185 alpha:1.0] withStrokeColor:[UIColor colorWithHue:0.625 saturation:0.0 brightness:0.8 alpha:0.8]];
[alert show];
[alert release];
}
-(IBAction)_clickbtngoogledocsync:(id)sender
{
Googledocmainpage *detailViewController = [[Googledocmainpage alloc] initWithNibName:@"Googledocmainpage" bundle:nil];
// Pass the selected object to the new view controller.
detailViewController.localStringtextnote = localStringtextnote;//i want to pass these note to googledocmainpage as localstring
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
UIView *langview = (UIView *)[self.view viewWithTag:120];
//ViewWithTag Number should be same as used while allocating
[langview removeFromSuperview];
/* [self.view addSubview:syncView];
UIView *popView = (UIView *)[self.view viewWithTag:106];
//ViewWithTag Number should be same as used while allocating
[popView removeFromSuperview];*/
}
How to do this.Thanks in advance. | 0 |
3,804,797 | 09/27/2010 14:28:53 | 417,081 | 08/11/2010 09:51:55 | 10 | 0 | Someone managed to write a line of code in my javascript file, how? | How can someone physically change a javascript file? It's completely locked down and i've no idea how someone would be able to do this through a web browser.
Rob | javascript | null | null | null | null | 09/28/2010 03:31:50 | off topic | Someone managed to write a line of code in my javascript file, how?
===
How can someone physically change a javascript file? It's completely locked down and i've no idea how someone would be able to do this through a web browser.
Rob | 2 |
2,575,476 | 04/04/2010 18:38:07 | 290,129 | 03/10/2010 01:21:46 | 1 | 0 | How should my main web application (A) securely retrieve data from my content storage web application (B)? | I have two web applications (A) and (B).
(A) is my primary web application.
(B) is purely for content storage, such as file uploads by users of (A).
What's best way to securely retrieve data from (B) into (A) but in a way that does not expose the data in (B) to potential discovery by third-parties over the public internet or nosy users of (A)?
For example, if I use a HTML form POST from (A) to (B) to retrieve user data, and have a hidden form field called `user_id=1`, then someone could simply change this to `user_id=2` and see the content owned by another user of the application. That would be a problem. | security | web-applications | null | null | null | null | open | How should my main web application (A) securely retrieve data from my content storage web application (B)?
===
I have two web applications (A) and (B).
(A) is my primary web application.
(B) is purely for content storage, such as file uploads by users of (A).
What's best way to securely retrieve data from (B) into (A) but in a way that does not expose the data in (B) to potential discovery by third-parties over the public internet or nosy users of (A)?
For example, if I use a HTML form POST from (A) to (B) to retrieve user data, and have a hidden form field called `user_id=1`, then someone could simply change this to `user_id=2` and see the content owned by another user of the application. That would be a problem. | 0 |
9,910,131 | 03/28/2012 14:54:20 | 166,452 | 09/01/2009 08:02:20 | 3,106 | 157 | Creating UserControls with ViewModels in WPF | do you think is a good practise to create a UserControl already with a ViewModel and deploy both together? This way the UserControl will be binded to the ViewModel from stock.
Looks as a good idea to me but I never saw such a thing.
Thanks. | c# | wpf | binding | usercontrols | wpf-controls | null | open | Creating UserControls with ViewModels in WPF
===
do you think is a good practise to create a UserControl already with a ViewModel and deploy both together? This way the UserControl will be binded to the ViewModel from stock.
Looks as a good idea to me but I never saw such a thing.
Thanks. | 0 |
11,718,171 | 07/30/2012 08:54:34 | 788,842 | 06/08/2011 08:46:05 | 1,021 | 77 | Why Toast.makeText and not new Toast | This is may be a noob question, but I was wondering why do we have to use a static method (makeText) to create a Toast and not a constructor.
Why do we have to use this:
makeText(Context context, CharSequence text, int duration)
instead of this:
new Toast(Context context, CharSequence text, int duration)
This is the makeText method:
public static Toast makeText(Context context, CharSequence text, int duration) {
Toast result = new Toast(context);
LayoutInflater inflate = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
TextView tv = (TextView)v.findViewById(com.android.internal.R.id.message);
tv.setText(text);
result.mNextView = v;
result.mDuration = duration;
return result;
}
Why don't we have the following:
public Toast (Context context, CharSequence text, int duration) {
this(context);
LayoutInflater inflate = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
TextView tv = (TextView)v.findViewById(com.android.internal.R.id.message);
tv.setText(text);
this.mNextView = v;
this.mDuration = duration;
}
I searched the web and source code for any reason but I didn't find.
Please if you have an idea, don't hesitate. | android | toast | android-source | null | null | null | open | Why Toast.makeText and not new Toast
===
This is may be a noob question, but I was wondering why do we have to use a static method (makeText) to create a Toast and not a constructor.
Why do we have to use this:
makeText(Context context, CharSequence text, int duration)
instead of this:
new Toast(Context context, CharSequence text, int duration)
This is the makeText method:
public static Toast makeText(Context context, CharSequence text, int duration) {
Toast result = new Toast(context);
LayoutInflater inflate = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
TextView tv = (TextView)v.findViewById(com.android.internal.R.id.message);
tv.setText(text);
result.mNextView = v;
result.mDuration = duration;
return result;
}
Why don't we have the following:
public Toast (Context context, CharSequence text, int duration) {
this(context);
LayoutInflater inflate = (LayoutInflater)
context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View v = inflate.inflate(com.android.internal.R.layout.transient_notification, null);
TextView tv = (TextView)v.findViewById(com.android.internal.R.id.message);
tv.setText(text);
this.mNextView = v;
this.mDuration = duration;
}
I searched the web and source code for any reason but I didn't find.
Please if you have an idea, don't hesitate. | 0 |
10,363,456 | 04/28/2012 12:24:23 | 464,012 | 10/01/2010 15:23:52 | 29 | 2 | Data visualization with R igraph package | I'm doing a homework on data mining. Now I have a data set which stands for acquaintance network in social network. I want to visualize this network. In this network, vertex stands for user and edge stands for acquaintance relationship. Now I use igraph package for R to achieve my goal. However, my data set is too large with more than 100,000 vertexes and more than 1000,000 edges, which causes the generated graph not clear. In fact, the graph is totally unrecognized. How can I get a clear graph using igraph package? Or, which software can complete this task?
Thank you in advance! | homework | r | data-mining | data-visualization | null | 04/29/2012 03:21:49 | not a real question | Data visualization with R igraph package
===
I'm doing a homework on data mining. Now I have a data set which stands for acquaintance network in social network. I want to visualize this network. In this network, vertex stands for user and edge stands for acquaintance relationship. Now I use igraph package for R to achieve my goal. However, my data set is too large with more than 100,000 vertexes and more than 1000,000 edges, which causes the generated graph not clear. In fact, the graph is totally unrecognized. How can I get a clear graph using igraph package? Or, which software can complete this task?
Thank you in advance! | 1 |
10,983,589 | 06/11/2012 15:57:00 | 279,112 | 02/23/2010 00:11:13 | 244 | 9 | In ActionScript 3.0, when using Ookla's Speedtest in an SWFLoader, how do you allow it to load and run more than once? | Got another weird/specific question for y'all: I'm able to do with this with other .swfs just fine, but Ookla's Speedtest is something of a problem. Basically we have a part of our website that runs Speedtest to determine somebody's bandwidth and use its results in some if statements. But when the person tries to change panels and come back in, Speedtest just sort of disappears. It's supposed to go back to the beginning and start again, but it's like it just keeps running and turns invisible.
When I tried loading another .swf in the SWFLoader, I could get it to reset just fine without disappearing. There's something specifically about Ookla's Speedtest that's causing a problem. If I do nothing to reset the Speedtest .swf when the user starts moving around panels, it won't disappear at least. Putting in code to make it reset is a completely different story though.
What's the trick for this program? Did Ookla design the .swf specifically so it wouldn't work like that or something? Thanks! | actionscript-3 | swf | swfloader | speed-test | null | null | open | In ActionScript 3.0, when using Ookla's Speedtest in an SWFLoader, how do you allow it to load and run more than once?
===
Got another weird/specific question for y'all: I'm able to do with this with other .swfs just fine, but Ookla's Speedtest is something of a problem. Basically we have a part of our website that runs Speedtest to determine somebody's bandwidth and use its results in some if statements. But when the person tries to change panels and come back in, Speedtest just sort of disappears. It's supposed to go back to the beginning and start again, but it's like it just keeps running and turns invisible.
When I tried loading another .swf in the SWFLoader, I could get it to reset just fine without disappearing. There's something specifically about Ookla's Speedtest that's causing a problem. If I do nothing to reset the Speedtest .swf when the user starts moving around panels, it won't disappear at least. Putting in code to make it reset is a completely different story though.
What's the trick for this program? Did Ookla design the .swf specifically so it wouldn't work like that or something? Thanks! | 0 |
6,251,306 | 06/06/2011 11:24:42 | 785,801 | 06/06/2011 11:24:42 | 1 | 0 | Just got my first job in industry - what do I need to know? | Tomorrow, I will be taking up my first job as a software engineer. I am doing an internship as a Software Test Engineer doing black box and white box testing. I have never done either of these before. Any advice? I will be using Java and JUnit testing.
Also, what should I know before going in? What should I bring? What is the best advice you could give someone in my position?
Thanks a lot :) | java | junit | industry | white-box-testing | black-box-testing | 06/06/2011 11:28:33 | not constructive | Just got my first job in industry - what do I need to know?
===
Tomorrow, I will be taking up my first job as a software engineer. I am doing an internship as a Software Test Engineer doing black box and white box testing. I have never done either of these before. Any advice? I will be using Java and JUnit testing.
Also, what should I know before going in? What should I bring? What is the best advice you could give someone in my position?
Thanks a lot :) | 4 |
9,360,251 | 02/20/2012 11:17:59 | 1,220,873 | 02/20/2012 11:10:20 | 1 | 0 | PHP page is not getting displayed properly | I have a search page which loads its drop down boxes from Database tables like zip and country.
when i run this page on local machine using WAMP. the entire page is not getting displayed. it is not even displaying the submit button at the end of the page.
This page works perfectly fine on the server. Pl help. As i need to do coding on the local machine. i am unable to do so.
Thanks in advance. | php | wampserver | null | null | null | 02/20/2012 11:34:00 | not a real question | PHP page is not getting displayed properly
===
I have a search page which loads its drop down boxes from Database tables like zip and country.
when i run this page on local machine using WAMP. the entire page is not getting displayed. it is not even displaying the submit button at the end of the page.
This page works perfectly fine on the server. Pl help. As i need to do coding on the local machine. i am unable to do so.
Thanks in advance. | 1 |
10,428,227 | 05/03/2012 09:05:13 | 299,635 | 03/23/2010 05:49:25 | 35 | 0 | orchard cms shape tracer is not selecting my shape | The shape tracer shows Part_Product [Empty] . I could see the shape renderes, but my shape is not selectable by shape tracer. Any idea?
Regards
George | orchardcms | null | null | null | null | null | open | orchard cms shape tracer is not selecting my shape
===
The shape tracer shows Part_Product [Empty] . I could see the shape renderes, but my shape is not selectable by shape tracer. Any idea?
Regards
George | 0 |
8,573,874 | 12/20/2011 10:16:18 | 1,107,561 | 12/20/2011 10:05:10 | 1 | 0 | Display dates of a month or year having the day name only as "**FRIDAY**" in java or javascript? | Display dates of a month or year having the day name only as "**FRIDAY**" in java or javascript? Like for the month of December, 2011 we have:-
2/12/2011
9/12/2011
16/12/2011
23/12/2011
30/12/2011 | java | javascript | null | null | null | 12/21/2011 09:34:43 | not a real question | Display dates of a month or year having the day name only as "**FRIDAY**" in java or javascript?
===
Display dates of a month or year having the day name only as "**FRIDAY**" in java or javascript? Like for the month of December, 2011 we have:-
2/12/2011
9/12/2011
16/12/2011
23/12/2011
30/12/2011 | 1 |
4,192,911 | 11/16/2010 09:58:36 | 474,042 | 10/13/2010 03:58:44 | 23 | 0 | ipad databinding | Is there a way to data bind some data to a view's controls in an ipad app?
Thanks | iphone | data-binding | ipad | usercontrols | null | null | open | ipad databinding
===
Is there a way to data bind some data to a view's controls in an ipad app?
Thanks | 0 |
8,983,271 | 01/24/2012 07:19:44 | 713,840 | 04/18/2011 17:20:22 | 92 | 8 | Efficiently using data in multiple classes | I'm pulling in JSON from an external URL. I then want to use that data in two different classes. Here's how I think it should be setup.
// gets data
class get_data {
}
// creates a widget that uses the data
class widget_class {
}
// some other widget that uses the data
class page_class {
}
How do I get the data from get_data into both widget_class and page_class? I could just insert something like `$data = new get_data();` in each class, but that's not the most efficient way of doing things since it would pull the external data twice, right?
My knowledge of OOP is limited, so any help would be great.
| php | oop | null | null | null | null | open | Efficiently using data in multiple classes
===
I'm pulling in JSON from an external URL. I then want to use that data in two different classes. Here's how I think it should be setup.
// gets data
class get_data {
}
// creates a widget that uses the data
class widget_class {
}
// some other widget that uses the data
class page_class {
}
How do I get the data from get_data into both widget_class and page_class? I could just insert something like `$data = new get_data();` in each class, but that's not the most efficient way of doing things since it would pull the external data twice, right?
My knowledge of OOP is limited, so any help would be great.
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.