Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


Mussi

Member Since 12 Oct 2004
Offline Last Active Today, 08:31 AM

Topics I've Started

Ad reloads on window size change

02 December 2014 - 03:04 PM

I'm not sure if this is a bug or a feature, but the banner ad reloads and changes into a new ad whenever the window resizes. I'm using Firefox 33.1 and I frequently press the alt button for voice communication, this opens up the menu bar and resizes the window, causing the ad to reload, which can be somewhat annoying if you're looking at or want to click the ad. This also happens if you simply resize the window.


Previewing journal post removes tags and entry catagories.

29 September 2014 - 03:22 PM

Hi,

 

After writing some journals for the Week of Awesome I noticed a few bugs with posting Journals. When previewing the post all the tags are removed and the selected categories are reset as well. An easy way to circumvent this is by simply saving a draft instead of previewing it, so a short term solution might be to just disable the preview button if it's not easily fixable.

 

Also, I'm not sure about this, attachments and entry images might be removed as well.


Promise and Future with shared_ptr safety

27 August 2013 - 11:31 AM

Hey everyone,

 

I've implemented sort of future and promise classes for my network code using a shared_ptr that holds a boolean and a value variable. These variables are set by the promise class, which is non-copyable. The future class only reads from these variables. I thought that it'd be safe to set the boolean from within the promise in thread A and concurrently read the boolean value from within the future in thread B, but apparently it's not. What happens is that sometimes the value is not set when repeatedly reading the boolean value, even though the code is called and the address of booleans match. My question is, why is this not safe and what's happening?

 

The code:

class Future
	{
		friend class Promise;

	private:
		struct FutureData
		{
			NetworkResult value;
			bool ready;

			FutureData() : ready(false) {}
		};

		std::shared_ptr<FutureData> data;

	public:
		Future()
		{
			data = std::make_shared<FutureData>();
		}

		Future(const Future& future) : data(future.data)
		{
		}

		Future& operator =(const Future& future)
		{
			data = future.data;
		}

		Future(Future&& future) : data(std::move(future.data))
		{
		}

		Future& operator =(const Future&& future)
		{
			data = std::move(future.data);
			return *this;
		}

		bool IsReady() const
		{
			return data->ready;
		}

		NetworkResult GetValue() const
		{
			return data->value;
		}
	};

	class Promise
	{
	private:
		Future future;

		Promise(const Promise&);
		Promise& operator =(const Promise&);

	public:
		Promise()
		{	
		}

		Promise(Promise&& promise) : future(std::move(promise.future))
		{
		}

		Promise& operator =(Promise&& promise)
		{
			future = std::move(promise.future);
			return *this;
		}

		Future GetFuture() const
		{
			return future;
		}

		void SetValue(NetworkResult result)
		{
			future.data->value = result;
			future.data->ready = true;
		}
	};

Any help is very much appreciated.


Daily Newsletter

19 June 2013 - 12:22 PM

What's with this daily newsletter thing? I got three of them now and they mostly contain duplicate info. Even if every newsletter would contain completely new information, I wouldn't want to receive them on a daily basis.

 

What's the reasoning behind this and what do the rest of you think about this?


IOTD not as popular?

04 December 2012 - 10:58 PM

Hey guys and galls,

Is it just me or is the IOTD section less commented on since the big site revamp? It feels like there used to be a lot more participants in the comment sections. Any of you feel the same? If this is actually the case, what happened?

Also, the IOTD is not accessible from the menu :(

PARTNERS