Ive just come up with an issue in my ogl program,
VS2010 gives this in the output when closing, the program crashes when closing
First-chance exception at 0x779fe3be in StandAlone.exe: 0xC0000005: Access violation reading location 0xef25486c.
Using breakpoints the program reaches the
return 0;
line without any issues, and seems to fail after. Using gDEBugger I found some errors:
[code]
OpenGL Render Context 3 Created
Thread Terminated: 1444
Thread Created: 3060
OpenGL Render Context 3 Deleted
Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteShader) from one render context, but called this function pointer in another render context (context #2)
Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteProgram) from one render context, but called this function pointer in another render context (context #2)
Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteBuffers) from one render context, but called this function pointer in another render context (context #2)
OpenGL Render Context 1 Deleted
Checking for memory leaks - Context 2 deleted
No memory leaks were found
OpenGL Render Context 2 Deleted
Thread Terminated: 168
Thread Terminated: 3060
Checking for memory leaks - Application exit
No memory leaks were found
API Connection Ended: gDEBugger OpenGL Server
API Connection Ended: gDEBugger Servers Manager
Thread Terminated: 968
Process Exit
[/code]
Im using SFML and context 3 is the actual context I created.
The actual errors are:
[QUOTE]Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteShader) from one render context, but called this function pointer in another render context (context #2)
[/QUOTE]
[QUOTE]Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteProgram) from one render context, but called this function pointer in another render context (context #2)
[/QUOTE]
[QUOTE]Debug String: Detected error: The debugged process asked for an extension function pointer (glDeleteBuffers) from one render context, but called this function pointer in another render context (context #2)
[/QUOTE]
Which match my shader destructor
[code]Shader::~Shader()
{
glDeleteShader( mVertexID );
glDeleteShader( mFragmentID );
glDeleteProgram( mShaderID );
}
[/code]
However I put a breakpoint on that line and it all seemed to work fine
Why are there no good matlab pages anywhere
I just want to plot a fucking function from 0.5 to 3.
[code]x = 0.5:1/100:3;
y=(2*x^3+5) / (3*x^2);
plot(y)
[/code]
It gives me some error about x not being a matrix or something
I think I found the issue, I called window.Close() before killing the shaders... Duhh
[QUOTE=twoski;42533810]Why are there no good matlab pages anywhere
I just want to plot a fucking function from 0.5 to 3.
[code]x = 0.5:1/100:3;
y=(2*x^3+5) / (3*x^2);
plot(y)
[/code]
It gives me some error about x not being a matrix or something[/QUOTE]
You need to use the element-wise power, ".^".
Im looking for a good WPF Guide with this content.
Binding in a WPF Grid a Database Object and a live view.
Someone have literature for that?
About the depth issue's I was having, I was using a different version of glfw then overv in which I had to specify if I wanted a depth buffer in the window creation, changed window creation and solved :)
I am having some issues with memory management, probably because of copying over stuff. I reverted back to my last git version, anyone got some time to look at a bit of code and answer some general questions about memory management over your voice client of choice (skype/TS/steam etc.) ?
[QUOTE=twoski;42533810]Why are there no good matlab pages anywhere
I just want to plot a fucking function from 0.5 to 3.
[code]x = 0.5:1/100:3;
y=(2*x^3+5) / (3*x^2);
plot(y)
[/code]
It gives me some error about x not being a matrix or something[/QUOTE]
[url]http://www.wolframalpha.com/input/?i=y%3D%282*x%5E3%2B5%29+%2F+%283*x%5E2%29%2C+x+from+0.5+to+3[/url]
do pictureboxes in c# not support transparency? I literally could've sworn they did but I'm having no luck.
By transparency I do not mean copying the forms color, I need it that when it overlays controls it doesn't show the white form color, but the control behind it
[QUOTE=JazZ5109AI;42547766]do pictureboxes in c# not support transparency? I literally could've sworn they did but I'm having no luck.
By transparency I do not mean copying the forms color, I need it that when it overlays controls it doesn't show the white form color, but the control behind it[/QUOTE]
Set the background to transparent, that should work.
Not really a programming question, more like a Java Swing look and feel question.
Anyone knows a good L&F? So far the ones Google showed me are either offline or look... Rather old.
Just a quick question.
Does anybody know if the Kinect can detect if a player is moving?
Like I could use the Kinect to see if I am running on the spot, and if I am, I would move the player forward, using the Unity engine
[QUOTE=Over-Run;42550888]Just a quick question.
Does anybody know if the Kinect can detect if a player is moving?
Like I could use the Kinect to see if I am running on the spot, and if I am, I would move the player forward, using the Unity engine[/QUOTE]
It's possible, but really bad from a UX perspective. [URL="http://www.kickstarter.com/projects/1944625487/omni-move-naturally-in-your-favorite-game"]There's this one thing that lets you run forward while staying in place[/URL] using a Kinect iirc, but I don't see how it would work without some "peripheral".
You probably have to define the gestures you want to use yourself though, if there's no pre-built package.
So you can't really do it without another device such as the Omni?
I really don't know what I could do for this project
[QUOTE=Over-Run;42551433]So you can't really do it without another device such as the Omni?
I really don't know what I could do for this project[/QUOTE]
Well, you can recognize someone running in place because you can get the current pose at any moment, but I really doubt that adds to the gameplay.
Kinect also has a very significant lag.
Im trying to write a logging class to behave like cout but that prints to both cout and a file, what is the best way to overload << in order for it to accept any kind of class as well as endl?
Derive it from ostream
is there a way to pull data from an excel file and export each box into an array value without using a separate library in C#?
in c programming class, we got an assignment to calculate the harmonic sum of a number recursively. i'm very confident in this program working, but whenever i print the result i get an appcrash
code:
[code]#include <stdio.h>
float harmonicSum(int num);
int main()
{
int num;
printf("%s", "Enter in a number and I will find the harmonicSum of it:");
scanf("%d", num);
float result = harmonicSum(num);
printf("The harmonicSum of %d is %7f", num, result);
}
float harmonicSum(int num)
{
if(num == 1)
return 1.0;
else
return ((1/(float)num) + harmonicSum(num - 1));
}
[/code]
scanf("%d", num); should be scanf("%d", &num);
Because scanf takes a pointer to where the result is stored, otherwise you're passing an uninitialized int and it's going to try and use that as a memory exist, hence the segfault.
[QUOTE=Jookia;42557321]scanf("%d", num); should be scanf("%d", &num);
Because scanf takes a pointer to where the result is stored, otherwise you're passing an uninitialized int and it's going to try and use that as a memory exist, hence the segfault.[/QUOTE]
I would like to add to this by saying that when passing variables in C to functions, prefixing it with & allows the function to modify that variable. A good practice, as defined by id Software for Doom 3, was to use const for all immutable variables passed to a function. So any "read-only" variables should be passed as const.
[QUOTE=Jookia;42557321]scanf("%d", num); should be scanf("%d", &num);
Because scanf takes a pointer to where the result is stored, otherwise you're passing an uninitialized int and it's going to try and use that as a memory exist, hence the segfault.[/QUOTE]
annd of course i forget the ampersand, i knew it was going to happen one day
thanks for da help
[QUOTE=JazZ5109AI;42556480]is there a way to pull data from an excel file and export each box into an array value without using a separate library in C#?[/QUOTE]
Export the Excel table as .csv, then read it by splitting strings.
Either choose a separator that never appears in the table or handle escaped ones while loading.
There's also a managed Office SDK, but I don't know whether that qualifies/is installed with .NET. Probably not though.
Messing around with the tinythread lib which provides a constuctor that accepts a function pointer : (void*)(*aFunction)(void*)
I did some tests fine but with wrapping it in a class I can't get a member function to bind and get this error :
[code]
Error 2 error C2664: 'tthread::thread::thread(void (__cdecl *)(void *),void *)' : cannot convert parameter 1 from 'void (__thiscall TCPListener::* )(void *)' to 'void (__cdecl *)(void *)' c:\users\quincy\documents\projects\project puppeteer\project puppeteer\tcplistener.cpp 70
[/code]
I know its because its a class member but is there any way to work this out ?
[cpp]class TCPListener
{
//...
void MyFun();
//...
private:
static void TTMyFunCallback(void *const me) { reinterpret_cast<TCPListener*>(me)->MyFun(); }
};[/cpp]
And pass `this` as user-data (the void* parameter).
How the hell would I go about parsing JSON like this in C#?
[url]http://store.steampowered.com/api/appdetails/?appids=730[/url]
I've been trying to use JSON.NET and some other methods but I just can't seem to wrap my head around it.
Thanks in advance.
[QUOTE=benbb;42563358]How the hell would I go about parsing JSON like this in C#?
[url]http://store.steampowered.com/api/appdetails/?appids=730[/url]
I've been trying to use JSON.NET and some other methods but I just can't seem to wrap my head around it.
Thanks in advance.[/QUOTE]
What I did with the steamapi is deserialize the json into a JObject. Then I would deserialize the data field into an actual class object. Also using a C# class generator you don't have to do that much work.
[code] var obj = JsonConvert.DeserializeObject<JObject>(data);
var resp = JsonConvert.DeserializeObject<AppDetailsDto>(obj["730"]["response"].ToString());[/code]
Not great(parses the string twice), but works.
[code]// Generated by Xamasoft JSON Class Generator
// http://www.xamasoft.com/json-class-generator
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Steam
{
public class PcRequirements
{
[JsonProperty("minimum")]
public string Minimum { get; set; }
}
public class MacRequirements
{
[JsonProperty("minimum")]
public string Minimum { get; set; }
}
public class PriceOverview
{
[JsonProperty("currency")]
public string Currency { get; set; }
[JsonProperty("initial")]
public int Initial { get; set; }
[JsonProperty("final")]
public int Final { get; set; }
[JsonProperty("discount_percent")]
public int DiscountPercent { get; set; }
}
public class Sub
{
[JsonProperty("packageid")]
public string Packageid { get; set; }
[JsonProperty("percent_savings_text")]
public string PercentSavingsText { get; set; }
[JsonProperty("percent_savings")]
public int PercentSavings { get; set; }
[JsonProperty("option_text")]
public string OptionText { get; set; }
[JsonProperty("option_description")]
public string OptionDescription { get; set; }
}
public class PackageGroup
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("title")]
public string Title { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
[JsonProperty("selection_text")]
public string SelectionText { get; set; }
[JsonProperty("save_text")]
public string SaveText { get; set; }
[JsonProperty("display_type")]
public string DisplayType { get; set; }
[JsonProperty("is_recurring_subscription")]
public string IsRecurringSubscription { get; set; }
[JsonProperty("subs")]
public Sub[] Subs { get; set; }
}
public class Platforms
{
[JsonProperty("windows")]
public bool Windows { get; set; }
[JsonProperty("mac")]
public bool Mac { get; set; }
[JsonProperty("linux")]
public bool Linux { get; set; }
}
public class Metacritic
{
[JsonProperty("score")]
public int Score { get; set; }
[JsonProperty("url")]
public string Url { get; set; }
}
public class Category
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
}
public class Genre
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("description")]
public string Description { get; set; }
}
public class Screenshot
{
[JsonProperty("id")]
public int Id { get; set; }
[JsonProperty("path_thumbnail")]
public string PathThumbnail { get; set; }
[JsonProperty("path_full")]
public string PathFull { get; set; }
}
public class Webm
{
[JsonProperty("480")]
public string 480 { get; set; }
[JsonProperty("max")]
public string Max { get; set; }
}
public class Movy
{
[JsonProperty("id")]
public string Id { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("thumbnail")]
public string Thumbnail { get; set; }
[JsonProperty("webm")]
public Webm Webm { get; set; }
[JsonProperty("highlight")]
public bool Highlight { get; set; }
}
public class Recommendations
{
[JsonProperty("total")]
public int Total { get; set; }
}
public class Highlighted
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("path")]
public string Path { get; set; }
}
public class Achievements
{
[JsonProperty("total")]
public int Total { get; set; }
[JsonProperty("highlighted")]
public Highlighted[] Highlighted { get; set; }
}
public class ReleaseDate
{
[JsonProperty("coming_soon")]
public bool ComingSoon { get; set; }
[JsonProperty("date")]
public string Date { get; set; }
}
public class SupportInfo
{
[JsonProperty("url")]
public string Url { get; set; }
[JsonProperty("email")]
public string Email { get; set; }
}
public class AppDetailsDto
{
[JsonProperty("type")]
public string Type { get; set; }
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("steam_appid")]
public string SteamAppid { get; set; }
[JsonProperty("required_age")]
public int RequiredAge { get; set; }
[JsonProperty("controller_support")]
public string ControllerSupport { get; set; }
[JsonProperty("detailed_description")]
public string DetailedDescription { get; set; }
[JsonProperty("about_the_game")]
public string AboutTheGame { get; set; }
[JsonProperty("supported_languages")]
public string SupportedLanguages { get; set; }
[JsonProperty("header_image")]
public string HeaderImage { get; set; }
[JsonProperty("website")]
public string Website { get; set; }
[JsonProperty("pc_requirements")]
public PcRequirements PcRequirements { get; set; }
[JsonProperty("mac_requirements")]
public MacRequirements MacRequirements { get; set; }
[JsonProperty("linux_requirements")]
public object[] LinuxRequirements { get; set; }
[JsonProperty("developers")]
public string[] Developers { get; set; }
[JsonProperty("publishers")]
public string[] Publishers { get; set; }
[JsonProperty("price_overview")]
public PriceOverview PriceOverview { get; set; }
[JsonProperty("packages")]
public string[] Packages { get; set; }
[JsonProperty("package_groups")]
public PackageGroup[] PackageGroups { get; set; }
[JsonProperty("platforms")]
public Platforms Platforms { get; set; }
[JsonProperty("metacritic")]
public Metacritic Metacritic { get; set; }
[JsonProperty("categories")]
public Category[] Categories { get; set; }
[JsonProperty("genres")]
public Genre[] Genres { get; set; }
[JsonProperty("screenshots")]
public Screenshot[] Screenshots { get; set; }
[JsonProperty("movies")]
public Movy[] Movies { get; set; }
[JsonProperty("recommendations")]
public Recommendations Recommendations { get; set; }
[JsonProperty("achievements")]
public Achievements Achievements { get; set; }
[JsonProperty("release_date")]
public ReleaseDate ReleaseDate { get; set; }
[JsonProperty("support_info")]
public SupportInfo SupportInfo { get; set; }
}
}
[/code]
I found that generation website but didn't know how to go about it. Thanks! I'll post back if it works.
[editline]18th October 2013[/editline]
Fuck yeah! I created this class using json2csharp.com (I stripped out the 'data' part of the Steam JSON).
[code]
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Game_Launchpad
{
class steam
{
public class PcRequirements
{
public string minimum { get; set; }
}
public class MacRequirements
{
public string minimum { get; set; }
}
public class PriceOverview
{
public string currency { get; set; }
public int initial { get; set; }
public int final { get; set; }
public int discount_percent { get; set; }
}
public class Sub
{
public object packageid { get; set; }
public string percent_savings_text { get; set; }
public int percent_savings { get; set; }
public string option_text { get; set; }
public string option_description { get; set; }
}
public class PackageGroup
{
public string name { get; set; }
public string title { get; set; }
public string description { get; set; }
public string selection_text { get; set; }
public string save_text { get; set; }
public string display_type { get; set; }
public string is_recurring_subscription { get; set; }
public List<Sub> subs { get; set; }
}
public class Platforms
{
public bool windows { get; set; }
public bool mac { get; set; }
public bool linux { get; set; }
}
public class Metacritic
{
public int score { get; set; }
public string url { get; set; }
}
public class Category
{
public string id { get; set; }
public string description { get; set; }
}
public class Genre
{
public string id { get; set; }
public string description { get; set; }
}
public class Screenshot
{
public int id { get; set; }
public string path_thumbnail { get; set; }
public string path_full { get; set; }
}
public class Webm
{
public string __invalid_name__480 { get; set; }
public string max { get; set; }
}
public class Movie
{
public object id { get; set; }
public string name { get; set; }
public string thumbnail { get; set; }
public Webm webm { get; set; }
public bool highlight { get; set; }
}
public class Recommendations
{
public int total { get; set; }
}
public class Highlighted
{
public string name { get; set; }
public string path { get; set; }
}
public class Achievements
{
public int total { get; set; }
public List<Highlighted> highlighted { get; set; }
}
public class ReleaseDate
{
public bool coming_soon { get; set; }
public string date { get; set; }
}
public class SupportInfo
{
public string url { get; set; }
public string email { get; set; }
}
public class RootObject
{
public string type { get; set; }
public string name { get; set; }
public string steam_appid { get; set; }
public int required_age { get; set; }
public string controller_support { get; set; }
public string detailed_description { get; set; }
public string about_the_game { get; set; }
public string supported_languages { get; set; }
public string header_image { get; set; }
public string website { get; set; }
public PcRequirements pc_requirements { get; set; }
public MacRequirements mac_requirements { get; set; }
public List<object> linux_requirements { get; set; }
public List<string> developers { get; set; }
public List<string> publishers { get; set; }
public PriceOverview price_overview { get; set; }
public List<object> packages { get; set; }
public List<PackageGroup> package_groups { get; set; }
public Platforms platforms { get; set; }
public Metacritic metacritic { get; set; }
public List<Category> categories { get; set; }
public List<Genre> genres { get; set; }
public List<Screenshot> screenshots { get; set; }
public List<Movie> movies { get; set; }
public Recommendations recommendations { get; set; }
public Achievements achievements { get; set; }
public ReleaseDate release_date { get; set; }
public SupportInfo support_info { get; set; }
}
}
}
[/code]
Then using NewtonSoft's JSON.NET library I just used this code:
[code]
//Download JSON
string json = wc.DownloadString("http://store.steampowered.com/api/appdetails/?appids=" + steamid.ToString());
//Do something with it here.
var obj = JsonConvert.DeserializeObject<JObject>(json);
var resp = JsonConvert.DeserializeObject<steam.RootObject>(obj[steamid]["data"].ToString());
[/code]
Then you can just use the resp object to get whatever info you need. Hell yeah! I wish it was as simple as it is in PHP but I guess it'll have to do.
I keep my uni work under git on a usb, but its becoming really slow to compile and suck due to usb speed. I dont want to keep my ssh key on the uni computer as it could fall into the wrong hands so I was wonderng if git allows you to have a setup such as:
BitBucket Repo <- Master
USB Repo <- USB
UniPC Repo <- UniPC
Edit stuff on UniPC or USB
UniPC push<->pull to USB
Only USB can push<->pull Master
I know the hole purpose of git is to allow each local repo to act as a server, but I wasnt sure if this kind of thing would be allowed
Yeah, that should be possible.
But I think you can also specify a path to the private key on your USB stick for ssh to use. Look at ssh-add.
I think you can just add a local path as remote and push/pull that way.
At least it works like this with Hg.
Keeping the USB-repo up to date isn't a bad idea even if you push directly to Github, you never know if/when you're without Internet.
Sorry, you need to Log In to post a reply to this thread.