[QUOTE=Chris220;43723634]I've tried a couple of times and all I managed to gather from it is that all the plugins for C/C++ development in Sublime are abandoned and a bit crap. It's probably easier not to try, but if you're set on it then look into SublimeClang.[/QUOTE]
Seems like it. I really want to move over to Sublime, it seems so much faster than Visual Studio. VS takes like 30 seconds to launch and freezes when I try to copy and paste. I also love the interface on Sublime
Yeah, I spent a while looking for alternatives since so many people say Visual Studio is bad and all that. As it turns out, there are basically no good alternatives so I just bought an SSD instead. Solves any performance issues I may have had and I can continue using something that just works instead of spending ages screwing around with this plugin and that extension and whatever else just so I can do a fraction of what I could do before.
[QUOTE=Nevec;43723375]Does anyone have any experience with internship in computer science institutes? I'll have a four month long internship in a year and for some crazy reason I have to choose where I want to go right now. I can choose between programming, network admin and CS. Computer science sounds interesting, but I don't really know anything about CS institutes.[/QUOTE]
Learning programming is what gives you the most value.
I am installing HOVE for Windows and I am getting this in FlashDevelop:
[img]http://gyazo.com/169f1471b2b0a701448cb9c98ed66660.png[/img]
The haxelib lines apparently cause errors. I have followed the install guide from here:
[url]http://insweater.net/introducing-hove/[/url]
I did install:
- OpenFL
- Last development build of FlashDevelop
- Haxe
- Love2d for haxe
EDIT:
Fixed it by building the project. I am an idiot.
In VB.Net how would I output an arraylist to a rich textbox line by line?
In C++11 is there a way to get the derived class from the pointer ptr so that it can be used in conjunction with decltype?
[cpp]class foo{};
class bar:public foo{};
foo * ptr = new bar();[/cpp]
[QUOTE=WTF Nuke;43728088]In C++11 is there a way to get the derived class from the pointer ptr so that it can be used in conjunction with decltype?
[cpp]class foo{};
class bar:public foo{};
foo * ptr = new bar();[/cpp][/QUOTE]
There is no way to do that. You are trying to make runtime polymorphism available to the statically evaluated decltype, which is impossible by logic.
[QUOTE=Dienes;43728247]There is no way to do that. You are trying to make runtime polymorphism available to the statically evaluated decltype, which is impossible by logic.[/QUOTE]
Yeah that makes a lot of sense, thanks!
[QUOTE=JRODISME;43727445]In VB.Net how would I output an arraylist to a rich textbox line by line?[/QUOTE]
You can use [I]StringBuilder[/I] to create your text, depending on what your ArrayList contains you'll want to either cast them to [I]string[/I], format them using [I]string.Format(...)[/I] or call [I].ToString()[/I] on them.
I also suggest you switch from ArrayList to List<>, the latter is type safe and likely much faster when working with anything more clearly defined than '[I]object[/I]'.
[QUOTE=Tamschi;43729182]You can use [I]StringBuilder[/I] to create your text, depending on what your ArrayList contains you'll want to either cast them to [I]string[/I], format them using [I]string.Format(...)[/I] or call [I].ToString()[/I] on them.
I also suggest you switch from ArrayList to List<>, the latter is type safe and likely much faster when working with anything more clearly defined than '[I]object[/I]'.[/QUOTE]
Oh sweet man, thanks for the help!
Does anyone know anything about SurfaceViews on Android? I'm on the end of my tether here.
[QUOTE=Chris220;43723847]Yeah, I spent a while looking for alternatives since so many people say Visual Studio is bad and all that. As it turns out, there are basically no good alternatives so I just bought an SSD instead. Solves any performance issues I may have had and I can continue using something that just works instead of spending ages screwing around with this plugin and that extension and whatever else just so I can do a fraction of what I could do before.[/QUOTE]
This is the only forum on the internet where people can admit that microsoft makes good products.
Unless you have a reason not too use it, Visual studio is the most friendly and easiest Compiler + IDE setup.
[QUOTE=Cold;43732021]This is the only forum on the internet where people can admit that microsoft makes good products.
Unless you have a reason not too use it, Visual studio is the most friendly and easiest Compiler + IDE setup.[/QUOTE]
I have to agree. I try to avoid bashing people for their preferences wherever I can, but personally I have to say that I just cannot see the appeal of using anything else on Windows. If you're on another OS then it's a bit of a different story, but I will say that I always end up missing Visual Studio.
[editline]31st January 2014[/editline]
Woops, I guess this is a bit off topic here. If it's annoying anyone, please say and I'll shut up. :)
I'm working on an online game, and I seem to have a really fucked up bug and I've never seen anything like it.
The client starts receiving packets incorrectly which crashes the server (because the client replies to the server with a packet the server un expecting). It only happens over a really long distance (eg. Australia to Canada). It works perfectly fine over localhost, or even over WAN from my Android (3G) to the server on my home network.
Also it only happens with large packets. I figured this might have something to do with MTU, but form my understanding MTU is lower level, and TCP will get the entire packet delivered.
I don't know why this is behaving differently over a long distance network. Any advice?
[QUOTE=Electroholic;43734198]I'm working on an online game, and I seem to have a really fucked up bug and I've never seen anything like it.
The client starts receiving packets incorrectly which crashes the server (because the client replies to the server with a packet the server un expecting). It only happens over a really long distance (eg. Australia to Canada). It works perfectly fine over localhost, or even over WAN from my Android (3G) to the server on my home network.
Also it only happens with large packets. I figured this might have something to do with MTU, but form my understanding MTU is lower level, and TCP will get the entire packet delivered.
I don't know why this is behaving differently over a long distance network. Any advice?[/QUOTE]
I'm fairly certain that TCP packets have an MTU of around 32 kB. Are your packets larger than that?
Anyone know a good Java IDE that's free and has a built in compiler? I've tried using eclipse but it just feels bloated. Also if it supports other languages that would be great.
[QUOTE=Krazy Bomb;43735382]Anyone know a good Java IDE that's free and has a built in compiler? I've tried using eclipse but it just feels bloated. Also if it supports other languages that would be great.[/QUOTE]
IntelliJ Idea
Does anyone know how to make Visual Studio 2013 look like Visual Studio 2010? I just downloaded the 2013 version and this Metro crap is hideous and it feels a lot slower.
[QUOTE=Berkin;43734658]I'm fairly certain that TCP packets have an MTU of around 32 kB. Are your packets larger than that?[/QUOTE]
I ended up finding the problem. I was sending about 3000 byte packets, and when I send them over long distances (eg. from Canada to Australia), they get fragmented into 2 smaller packets. Which is why it works on localhost, and short distances. The client was receiving/handing the two packets separately causing disastrous effects. The client should be receiving the [I]entire[/I] packet (store on a buffer until entire packet arrives) before processing it. It's a bug in the software I'm using, so I submitted a bug to the developers :v:
[QUOTE=EvacX;43738613]Does anyone know how to make Visual Studio 2013 look like Visual Studio 2010? I just downloaded the 2013 version and this Metro crap is hideous and it feels a lot slower.[/QUOTE]
Why not just use 2010 ?
[code]type Type = System.Type
type ConstructorInfo = System.Reflection.ConstructorInfo
type CanceledExn = System.OperationCanceledException
type Loaded = {
instanceType : Type
instance: obj
}
type Waiting = {
waitingOn : Type
instanceType : Type
success : obj -> unit
error: exn -> unit
cancel: CanceledExn -> unit
}
type Loader () =
// let context = System.Threading.SynchronizationContext ()
let mutable loaded : Loaded list = []
let mutable waiting = []
let await (waitFor : Type) (instanceType : Type) =
let continuationHandler (success, error, cancel) =
match loaded |> List.tryFind (fun x -> waitFor.IsAssignableFrom x.instanceType) with
| Some x -> success x.instance
| None -> waiting <- {waitingOn = waitFor; instanceType = instanceType; success = success; error = error; cancel = cancel} :: waiting
Async.FromContinuations continuationHandler
let push t instance =
loaded <- { instanceType = t; instance = instance} :: loaded
let (fulfilled, unfulfilled) = waiting |> List.partition (fun x -> x.waitingOn.IsAssignableFrom t)
waiting <- unfulfilled
fulfilled |> List.iter (fun x -> x.success instance)
member this.Load<'T>
(constructorInfo : ConstructorInfo)
: 'T option ref
=
let result = ref None
async {
// do! Async.SwitchToContext context
let resultType = constructorInfo.DeclaringType
let parameterTypes =
constructorInfo.GetParameters ()
|> Array.map (fun p -> p.ParameterType)
let parameters = Array.zeroCreate parameterTypes.Length
for i = 0 to parameters.Length - 1 do
let! parameter = await parameterTypes.[i] typeof<'T>
Array.set parameters i parameter
let instance = (constructorInfo.Invoke parameters) :?> 'T
push resultType instance
result := Some instance
} |> Async.StartImmediate
result//, a
member this.Load<'T> () =
let t = typeof<'T>
match t.GetConstructors() with
| [|c|] -> this.Load<'T> c
| [||] -> failwithf "No constructor found in %A." t
| x -> failwithf "Too many constructors found in %A, expected 1 but found %A." t x.Length
member this.Cancel () =
if List.isEmpty waiting then ()
else
let (failedMissing, rest) =
waiting
|> List.partition
(fun outer ->
waiting
|> List.exists (fun inner -> outer.waitingOn.IsAssignableFrom inner.instanceType)
|> not)
waiting <- rest
if not <| List.isEmpty failedMissing
then
for failed in failedMissing do
failed.cancel <| new System.OperationCanceledException ("Missing dependency: " + failed.waitingOn.ToString ())
this.Cancel () // fail other continuations waiting on now missing dependencies
else
match waiting with
| [] -> ()
| failed :: rest ->
waiting <- rest
failed.cancel <| new System.OperationCanceledException ("Cyclic dependency: " + failed.waitingOn.ToString ())
this.Cancel ()
type A () = class do printfn "A" end
type B (a : A) = class do printfn "B (A)" end
type C (a : A, b: B) = class do printfn "C (A, B)" end
type D (b : B) = class do printfn "D (B)" end
type X () = class do printfn "X" end
type U (x : X) = class do printfn "U (X)" end
type Z1 (z2 : Z2) = class do printfn "Z1 (Z2)" end
and Z2 (z1 : Z1) = class do printfn "Z2 (Z1)" end
let loader = new Loader ()
printfn "Starting loading..."
let z2 = loader.Load<Z2> ()
let z1 = loader.Load<Z1> ()
let u = loader.Load<U> ()
let d = loader.Load<D> ()
let c = loader.Load<C> ()
let b = loader.Load<B> ()
let a = loader.Load<A> ()
printfn "After loading."
System.Threading.Thread.Sleep 1000 // Seems to be necessary, constructors executed around here
printfn "Cancelling..."
loader.Cancel ()
printfn "After cancelling."[/code]
This is supposed to initialize the classes synchronously as soon as all dependencies are available, but for some reason it doesn't. I'm 99% sure it would work with C#'s async Tasks.
I think it's not calling the continuation directly but switches to a thread pool or something along those lines. Is there any way to keep it behaving like Tasks, so that I can immediately cancel without waiting first?
(I know that the way I run them is a bit suboptimal at the moment. I also plan to fix cancelling to return the things instead and have a .Finish() method that makes sure everything is loaded and errors otherwise.)
[QUOTE=BoowmanTech;43740430]Why not just use 2010 ?[/QUOTE]
It makes sense to search for an alternative before jumping back to an older version.
I like updated software, and I wish to keep whatever features VS 2013 brings, and so if it's possible to get the VS 2013 package in a visual theme that is more to my liking then clearly that'd be the way to go.
I don't see how that warrants the many dumb ratings my post received.
[QUOTE=EvacX;43738613]Does anyone know how to make Visual Studio 2013 look like Visual Studio 2010? I just downloaded the 2013 version and this Metro crap is hideous and it feels a lot slower.[/QUOTE]
Maybe you like the dark theme better?
[img_thumb]http://i.imgur.com/bLfDlxg.png[/img_thumb]
Personally i think its a huge improvement over the light one.
I've been using sharpdevelop for C# lately. It's not quite as good but it is fast and it still has all of the killer features that I use VS for such as intellisense and decent debugging.
I only have one small problem with it, although the intellisense is faster and more responsive it doesn't auto detect an enum so you have to manually type out the class name.
For example something like this:
[code]
//stateEnum = Active, Inactive
stateEnum.Active != //Here in VS you could type "In" and it would automatically place stateEnum.Inactive
[/code]
It's a small thing but I miss it.
[t]http://i.imgur.com/NlyTc8Q.png[/t]
It even has a few features that VS doesn't, my favourite one being that it gives you a bunch of extra options when trying to add an event handler.
-snip-
Did any of you use [URL="https://github.com/garrynewman/GWEN"]GWEN[/URL] here?
I am using a Gwen::Controls::MenuStrip, and I want to be able to know if it is hovered. The method ''IsHovered()'' always returns false.
I tried adding a handler to the member variable "onHoverEnter" IE:
[CODE]Gwen::Controls::MenuStrip menuStrip;
struct HandlerOfCrap: public Gwen::Event::Handler
{
void onHoverEnter()
{
std::cout << "Mkkay\n";
}
};
HandlerOfCrap crappyHandler;
menuStrip.onHoverEnter.Add(&crappyHandler, &HandlerOfCrap::onHoverEnter);[/CODE]
But that handler never gets called. Strangely enough, the handler [I]does[/I] work if I assign it to a menu strip item. IE:
[CODE]auto menu = menuStrip.AddItem("Crap")->GetMenu();
menu->AddItem("fabulous")->onHoverEnter.Add(&crappyHandler, &HandlerOfCrap::onHoverEnter);[/CODE]
The library appears to be abandonware, but I figured some of you have used it. ~_~
[I]* This is pseudo-code. I am managing object lifetimes in a correct fashion in my real code.[/I]
I need help from somebody who knows Trigonometry. I'm working on Pong in 2D using OpenGL, and right now I have a ball that bounces back and forth between two walls, because when it collides, I just negate the velocity. I want to figure out how to reflect the vector, but first, how would I find the normal of a wall in pong? I'm confused on how this would even be done. I have the width and height of a sprite on the screen, would this information be used?
EDIT:
Through this mess of code, which I have no clue how it functions, I have done a reflection and the ball now functions like a proper pong ball. However, it only does this correctly when hitting the top or bottom walls ( horizontal ). This is probably because of the way I am getting the normal, but I'm not sure how I would get it to function on vertical surfaces. Some help would be great :)
[CODE]
public void collide(Entity other){
Vector2f vel = velocity;
Vector2f dir = getNormal(other);
Vector2f velN = (Vector2f) dir.scale(Vector2f.dot(vel, dir));
Vector2f velT = new Vector2f();
Vector2f.sub(vel, velN, velT);
Vector2f reflectedVel = new Vector2f();
Vector2f.sub(velT, velN, reflectedVel);
velocity = reflectedVel;
}
public Vector2f getNormal(Entity ent){
Vector2f p1 = new Vector2f(ent.x - (ent.w / 2), ent.y + (ent.h / 2));
Vector2f p2 = new Vector2f(ent.x + (ent.w / 2), ent.y + (ent.h / 2));
Vector2f dir = new Vector2f(p2.x - p1.x, p2.y - p1.y);
Vector2f normal = new Vector2f(dir.y, dir.x);
return (Vector2f) normal.normalise();
}
[/CODE]
EDIT 2:
I was missing a minus.
[CODE]
Vector2f p2 = new Vector2f(ent.x + (ent.w / 2), ent.y - (ent.h / 2));
[/CODE]
I still have no idea how most of this works.
Someone know a good multi-platform C/C++ library for GUI building. Any different from Qt, GTK+ or even windows api.
Sorry, you need to Log In to post a reply to this thread.