Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411489 Posts in 69377 Topics- by 58433 Members - Latest Member: graysonsolis

April 29, 2024, 11:07:46 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)The grumpy old programmer room
Pages: 1 ... 186 187 [188] 189 190 ... 295
Print
Author Topic: The grumpy old programmer room  (Read 739022 times)
s_l_m
Level 8
***


Open to collabs


View Profile
« Reply #3740 on: November 15, 2012, 04:56:29 PM »

That's Eclipse for you :D I have a lot of issues too (some executed by the core developers and some bei plug-ins [the most famous the poor XML-display from the android plug-in]).
Every week eclipse fucks up my source by not display all methods and only a close and a reopen will display it correctly again.
But well, still better then [insert your hate IDE here] :D
better then using command line
Logged

Think happy thoughts.
Muz
Level 10
*****


View Profile
« Reply #3741 on: November 15, 2012, 07:12:16 PM »

Ugh, spent 3 hours on a bug, which was caused by making a typo of 'uses-permission' as 'user-permission'. XML's attitude of 'ignore it if you don't know it' made null pointers pop up everywhere.

Are you talking about typos in the XML file or in the code that was reading the XML content?

If you use XML schemas (like XSD or RELAX NG) you will at least be protected from typos in the XML file. If you use an editor with XML schema support (like Eclipse with the XML plugin) you'll get warnings for XML elements that don't comply with the schema. But be warned, writing schemas can be a pain.

edit: if your parser has schema support then you should also be protected when you try to read invalid content.

Code reading XML content, that ignores typo. Yeah, using it in Eclipse, but only around 50 lines of code or something, so didn't really bother to look for checkers. Normally the Android Dev Kit warns me if I make a typo, or even if I do something that's not best practice, but it didn't with one particular XML file.

Probably should look into it, but there are other higher priority "look into if have time" kind of things.
Logged
Muz
Level 10
*****


View Profile
« Reply #3742 on: November 19, 2012, 09:52:53 PM »

So Android has multiple entry points. With a PC app, the first page is the only entry point, and it doesn't delete stuff afterwards. With Android, every time someone does an 'alt-tab' equivalent, the thing exits and reenters, sometimes deleting and recreating stuff.

Now that's still fine and all, but when people are expecting smartphones and PCs to operate in the same way, it gets really annoying. Hell, nobody really knows that when an app is open in the background, it practically consumes no resources, so a lot of dumb power users put in all kinds of optimizations in like task closers, which only slow it down.

And when clients expect graphics to be a certain fixed size and tries to save the exact state of the thing when re-entering the app, No No NO
Logged
moi
Level 10
*****


DILF SANTA


View Profile WWW
« Reply #3743 on: November 19, 2012, 10:36:37 PM »

I was under the impression that most paged apps didn't actually consume anything in the background, also the app's behaviour actually seems a little more logical to me than the Windows behaviour .

[EDIT]Okay I didn't read the previous post well enough apparently
« Last Edit: November 20, 2012, 12:12:15 AM by moi » Logged

subsystems   subsystems   subsystems
Ludophonic
Level 2
**


View Profile
« Reply #3744 on: November 21, 2012, 03:09:56 PM »

Visual studio 2012 breaks find and replace in column selections. aaarrgggh.
Logged
Geti
Level 10
*****



View Profile WWW
« Reply #3745 on: November 21, 2012, 06:41:26 PM »

This is kinda a mixed happy and angry post:

installed visualVM to have a look at how my java framework's bottlenecks are looking so far (unoptimised "just get it working" kinda code) and found something interesting.

Rendering is of course a fair bottleneck but not too major until I put the alpha blended debug overlay on with a shitload of small objects doing their thing, haha.

The main one is Vec2f.Angle(). A single atan2 call. Its something like 60% of CPU time.
Whelp.

Oh well, example stuff first, then optimisation I guess.

Can only really work on it in the off hours of the day though with the amount of KAG work we're doing. So much rework, but it'll be worth it in the end, right? Right..? Droop
Logged

Sergi
Level 1
*



View Profile WWW
« Reply #3746 on: November 22, 2012, 04:04:53 AM »

I just spent an hour tracking a bug that ended up being caused by the C preprocessor.

I did this
Code:
#define PT(x,y) (x * height + y)
adding the outer parens because I know the preprocessor is tricky. But doing
Code:
PT(x+1,y)
doesn't do what I expected because it translates to
Code:
(x+1 * height + y)
which, because of operator precedence, is doing the same as
Code:
(x + height + y)

So the define is now
Code:
#define PT(x,y) ((x) * height + (y))

Mental note: stay away from the C preprocessor as much as possible. And if I have to use it, put parentheses EVERYWHERE.  Hand Shake LeftAngryHand Shake Right
Logged

Sergi
Level 1
*



View Profile WWW
« Reply #3747 on: November 22, 2012, 04:09:22 AM »

The main one is Vec2f.Angle(). A single atan2 call. Its something like 60% of CPU time.
Whelp.

Is the program just a test scene that does almost nothing? Because if the rendering of the scene is fast, bottlenecks (in percentage) might not be relevant. I remember in my old c++ engine some math functions had big percentages like that, but it didn't really matter because everything was crazy fast, since it was doing almost nothing, so it didn't make sense to optimize. Bigger scenes are more relevant, since they're more real-world examples.
Logged

rivon
Level 10
*****



View Profile
« Reply #3748 on: November 22, 2012, 04:23:16 AM »

I just spent an hour tracking a bug that ended up being caused by the C preprocessor.
Why aren't you using an inline function instead?
Logged
Sergi
Level 1
*



View Profile WWW
« Reply #3749 on: November 22, 2012, 04:30:36 AM »

I just spent an hour tracking a bug that ended up being caused by the C preprocessor.
Why aren't you using an inline function instead?

Well, I naively thought it was simple enough to do with a #define. Of course, it ended up being a bad experience, as it seems to always be when using the preprocessor.

I usually try to use C++ instead of the preprocessor (inline functions and const local variables), but this time it made sense for some reason. Never again Lips Sealed
Logged

Muz
Level 10
*****


View Profile
« Reply #3750 on: November 27, 2012, 02:53:40 AM »

Golden rule of network design: Be selfish.

Ask for maximum priority whenever you can.
Open multiple TCP connections at once.
Request a little more resources than you need.

Anything else and people will consider your system slow. Everyone else does it. Greed is good.
Logged
QuadrupleA
Level 2
**



View Profile WWW
« Reply #3751 on: November 29, 2012, 02:36:51 PM »

Grr, transitioning from XNA/C# to C++.

Hey C/C++ naming convention authorities, BIG_FUCKINGCONSTANTSWITHALLCAPSANDNOSPACESAREFUCKINGUNREADABLEANDRETARDED. So are library function names like "wcsrchr", "strxfrm", etc. The language has been fucking case-sensitive since the 1970's, use it already.

I'm looking at you too DirectX! And your D3DBLEND_INVSRCALPHA bullshit. Got better things to do with my time than guess where to put the spaces.
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #3752 on: November 29, 2012, 02:55:06 PM »

Hey C/C++ naming convention authorities,

Do those exist?

It's kind of funny, though... When I first learned C, the ~6-character abbreviated function names didn't really bother me. It was only when I tried to explain the stdlib API to someone else that I realized just how insane they really are. Naming is super important, but once you learn a system you might find yourself not noticing problems with it as much anymore.
Logged

QuadrupleA
Level 2
**



View Profile WWW
« Reply #3753 on: November 29, 2012, 03:08:00 PM »

Hey C/C++ naming convention authorities,
Do those exist?

Had to invent someone to rant at Smiley

I can see the shorthand being useful if all you've got is a text editor with no autocomplete etc., like in the early days - or nowadays if you're a masochist.
Logged

Weapon Hacker - roguelite metroidvania;
Battleship Solitaire - mindless podcast companion
epcc
Level 1
*


View Profile
« Reply #3754 on: November 30, 2012, 04:49:49 AM »

I haven't tried it, but it should work :D

#define stringLength strlen
#define stringTransform strxfrm

etc.
Logged

RalenHlaalo
Level 0
***



View Profile WWW
« Reply #3755 on: November 30, 2012, 04:51:39 AM »

LOL I do all my coding in gedit. I guess I'm a masochist Tongue

However you'll notice if you look at my code that I use quite descriptive names for things. Despite that though I still have to open the odd header file every now and again to check the interface of something.. I really should get with the times.
Logged

makerimages
Level 2
**


Makerimages Studios


View Profile WWW
« Reply #3756 on: December 02, 2012, 08:11:49 AM »

I cant get GM healthbars to show up above the unit, maybe i should change how i deal with them a bit.
Logged

Makerimages-Its in the pixel
Muz
Level 10
*****


View Profile
« Reply #3757 on: December 03, 2012, 08:53:47 PM »

If any of you gets a project where you have to design a layout in a mobile phone, reject it. You'll never get layouts to look exactly the same as it does in design. Ask them to provide content, create a draft layout, absolutely fucking insist that the final product does not look like the draft layout in the same manner that a burger will not look like the burger in the ad. Sometimes draft layouts are bad design too; too small to click/see which is a common mistake if you design for something at double its resolution.
Logged
epcc
Level 1
*


View Profile
« Reply #3758 on: December 04, 2012, 10:02:23 AM »

I find providing both 32 and 64 bit linux builds really annoying. Can't get cross-compiling to work (Seems that I also have to cross-compile all the dependencies that I could otherwise get from the package repository)
I've finally decided to install another linux inside virtualbox. Is it really that hard or am I missing something?
I guess the easiest option would be to just provide the sources, but the code is too ugly and would be embarrasing.
Logged

ThemsAllTook
Administrator
Level 10
******



View Profile WWW
« Reply #3759 on: December 04, 2012, 10:10:08 AM »

I find providing both 32 and 64 bit linux builds really annoying. Can't get cross-compiling to work (Seems that I also have to cross-compile all the dependencies that I could otherwise get from the package repository)
I've finally decided to install another linux inside virtualbox. Is it really that hard or am I missing something?
I guess the easiest option would be to just provide the sources, but the code is too ugly and would be embarrasing.

I've been struggling with the same thing recently. Can't get a 32-bit Ubuntu installation to actually boot in VirtualBox. Sad

Please let us know if you get it all figured it out!
Logged

Pages: 1 ... 186 187 [188] 189 190 ... 295
Print
Jump to:  

Theme orange-lt created by panic