Results 241 to 270 of 356
Thread: ProgrammersitP
-
2013-02-11, 02:47 PM (ISO 8601)
- Join Date
- Dec 2008
- Location
- Malsheem, Nessus
- Gender
Re: ProgrammersitP
-
2013-02-11, 04:15 PM (ISO 8601)
- Join Date
- Nov 2006
Re: ProgrammersitP
Avatar by araveugnitsuga | Play by Post (Guide) | Steam
Homebrewers' Extended Signatures
Hey Look, a Summer Reading List!
-
2013-02-13, 04:50 PM (ISO 8601)
- Join Date
- Jul 2007
- Gender
Re: ProgrammersitP
I want that everytime I`ll press the print screen key it would automatically save the generated image in some folder.
I`m assuming I can somehow accsess the code preformed by keyboard buttons, but I have no idea how to even approach the issue. Some directions would be greatly appreciated.
-
2013-02-13, 04:57 PM (ISO 8601)
- Join Date
- Feb 2007
- Location
- Manchester, UK
- Gender
Re: ProgrammersitP
If you want to capture a keypress like that then you need to write an application that implements a system-wide keyboard hook. Doing that is really getting down and dirty in the oily bits of Windows, though, not something you want to be doing unless you're really good at this sort of thing.
-
2013-02-13, 05:00 PM (ISO 8601)
- Join Date
- Nov 2006
Avatar by araveugnitsuga | Play by Post (Guide) | Steam
Homebrewers' Extended Signatures
Hey Look, a Summer Reading List!
-
2013-02-13, 05:01 PM (ISO 8601)
- Join Date
- Jan 2012
Re: ProgrammersitP
Fortunately for the rest of us, there's AutoIt.
-
2013-02-13, 05:04 PM (ISO 8601)
- Join Date
- Nov 2006
Re: ProgrammersitP
Avatar by araveugnitsuga | Play by Post (Guide) | Steam
Homebrewers' Extended Signatures
Hey Look, a Summer Reading List!
-
2013-02-13, 05:08 PM (ISO 8601)
- Join Date
- Jan 2012
-
2013-02-13, 08:21 PM (ISO 8601)
- Join Date
- Oct 2011
- Location
- The last place you look
- Gender
Re: ProgrammersitP
I'm back with another private/protected/public question:
Why is it recommended to have private variables in an abstract class then use getters and setters in subclasses? I heard this from a TA today and the logic makes no sense. I can understand no non-private variables in most classes, but not for use with subclasses. Why wouldn't you just make them protected if you want those fields to be in the subclass?Avatar by Venetian Mask. It's of an NPC from a campaign I may yet run (possibly in PbP) who became a favorite of mine while planning.
I am a 10/14/11/15/12/14 LG Clr 2
-
2013-02-14, 05:24 AM (ISO 8601)
- Join Date
- Mar 2009
- Location
- Sweden
- Gender
Re: ProgrammersitP
Clouddreamer Teddy by me, high above the world, far beyond its matters...
Spoiler: Banner by Vrythas
-
2013-02-14, 09:49 AM (ISO 8601)
- Join Date
- Feb 2010
- Location
- UK
- Gender
Re: ProgrammersitP
I know this one! I actually did exactly what you had done - some physics variable was being retrieved by many bits, including derived subclasses.
Also - in C++ at least - derived classes don't have access to the base classes private parts*but do have access to the getters and setters for precisely this reason.
* Hehe - "private parts".
-
2013-02-14, 10:02 AM (ISO 8601)
- Join Date
- Jul 2007
- Gender
Re: ProgrammersitP
Thanks. I used it, and now I have a problem.
I managed to write a code that would save the print screen image (spoilered below), but I can`t seem to find the right image format.
Will I have to append some bytes so it would fit a specific image format? Is there a format I can save print screen images directly in?
Spoiler
OnClipboardChange:
if A_EventInfo = 2
FileAppend, %ClipboardAll%, D:\print screen\screen.bmp
Madly In Science, an RPG in which you play mad scientists, you can get it for free.
Spoiler: Some other things.
-
2013-02-14, 10:32 AM (ISO 8601)
- Join Date
- Mar 2009
- Location
- Sweden
- Gender
Re: ProgrammersitP
All files have a file header detailing what types of files they represent (and probably some other meta-data too). Without this header, your files are just going to be considered complete nonsense by the operative system. I suggest you either read up on how to save data in specific file formats, or just try to find a program to do it for you.
Clouddreamer Teddy by me, high above the world, far beyond its matters...
Spoiler: Banner by Vrythas
-
2013-02-14, 11:17 AM (ISO 8601)
- Join Date
- Mar 2007
- Location
- San Diego
- Gender
Re: ProgrammersitP
Spoiler
- Where are you and what are you doing in terms of programming? Employment, education or in your spare time?
Embedded firmware is simple and frustrating, so I don't recommend it, it's so non-glorious. Say you have a button. Pressing it should be simple, right? But for firmware, debouncing is non-trivial and it depends on how the button is physically made and what the user is supposed to do with it. It's not a big deal for one button, but little things add up.
- What language or languages are you using primarily at the moment? What's your favourite, and why?
I don't know of any microcontrollers running Java or Python so I've ignored them so far. Speed counts for more than usual because of hardware timing issues. I've heard of OOP MCUs with a whole operating system but never had to use one. Maybe for fun I'd try to learn higher end languages, because learning about computer science is useful for this job.
- Where do you hope to go with your programming? Any plans for the future, or just waiting to see if anything of interest comes along?
To be honest, I liked other parts of Electrical Engineering better. Programming is neat and fun but I have lots of other talent too and I don't want to be stuck with button contraptions when I know about transistors and antennas. It doesn't help that I don't think of myself as a programmer. When computer science people talk about networks or whatever it goes over my head. Complex stuff like USB protocols are usually handled by some outside programmer who releases his code under acceptable (free) conditions.
- Any projects, personal or otherwise, you're in the middle of? Anything you're really focused on?
- What environment do you work/prefer to work in? Netbeans/Eclipse/Command line and a text editor?
- Any problems that are driving you mad? A piece of code not compiling right, or being off by one, or one little syntax error in a sea of code? Not quite grasping the logic of a particular piece of code?
Here's something I could use help with:
What really ticks me off at work at the moment is version control. We don't have a standard for it and I'm expected to think of sensible and helpful names for versions of a project to save in a server. And it's useful to save many versions with embedded code because things can break for very unexpected reasons.
What kind of free, simple version control could I sell to my boss? It's a small design firm so I think spending money is out of the question, and we're on the overworked side too.
-
2013-02-14, 11:52 AM (ISO 8601)
- Join Date
- Feb 2007
- Location
- Manchester, UK
- Gender
-
2013-02-14, 08:13 PM (ISO 8601)
- Join Date
- Oct 2009
Re: ProgrammersitP
well I consider git to be far superior to svn, though svn is more easy to learn.
Especially if you want to have many different versions then the branching feature will be invaluable.
Though it does take maybe a day to learn git (depending on level of competence)
-
2013-02-15, 03:30 AM (ISO 8601)
- Join Date
- Feb 2010
- Location
- Calgary
- Gender
Re: ProgrammersitP
I found this while listening to "Security Now" Tiobe Software It is a list of 100 programming languages popularity/use
-
2013-02-15, 07:13 PM (ISO 8601)
- Join Date
- Oct 2011
- Location
- The last place you look
- Gender
Re: ProgrammersitP
Can someone help me with some code? Long story, but I'm analyzing the correlation between two different movie rating systems. I would manually sort all the data for χē for homogeneity, but there's well over 1000 entries. I know there's an error in the output from a manual search (ctrl-F), but I can't figure out where the error would be. Instead of trying to figure it out (I seriously can't tell where it'd go wrong), I figured I'd just ask you guys for help.
(I just need help with incrementing the array. I know the file input part is working)
Rating system 1: A-I, A-II, A-III, L, O
Rating system 2: G, PG, PG-13, R, Not Rated
I have an int[5][5] named arr where I'm storing the counts. 0 is A-I/G, 4 is Not Rated/O
reader.nextLine() = [Movie title, possibly with commas in it], [rating 1] ([rating 2])Avatar by Venetian Mask. It's of an NPC from a campaign I may yet run (possibly in PbP) who became a favorite of mine while planning.
I am a 10/14/11/15/12/14 LG Clr 2
-
2013-02-15, 07:20 PM (ISO 8601)
- Join Date
- May 2009
-
2013-02-15, 07:24 PM (ISO 8601)
- Join Date
- Jan 2012
-
2013-02-15, 07:44 PM (ISO 8601)
- Join Date
- May 2009
-
2013-02-18, 05:46 AM (ISO 8601)
- Join Date
- Mar 2009
Re: ProgrammersitP
Need help again (I need to start asking in the middle of the week).
Spoiler
"Code the Add button's Click event procedure so that it adds the amounts entered by the user to an accumulator variable and then displays the variable's value in the lblSales control. Use an arithmetic assignment operator to update the acumulator. Display the total sales with a dollar sign and two decimal places."
The other one I need help with.
SpoilerPublic Class frmMain
Private Sub btnExit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub btnClickMe_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnClickMe.Click
' blinks the message in the lblMessage control
' declare counter variable
Dim intCount As Integer
' begin counting
intCount = 1
Do While intCount <= 20
If lblMessage.Visible = False Then
lblMessage.Visible = True
Else
lblMessage.Visible = False
End If
Me.Refresh()
System.Threading.Thread.Sleep(250)
' update the counter variable
intCount = intCount + 1
Loop
End Sub
End Class
"Change the pretest loop in the btnClickMe control's Click event procedure to a posttest loop that uses the Until keyword."
A step-by-step guide would be preferable, if possible.
-
2013-02-18, 08:27 AM (ISO 8601)
- Join Date
- Feb 2007
- Location
- Manchester, UK
- Gender
Re: ProgrammersitP
Are you asking us to do your homework for you? Because you won't learn anything if you just follow what we say by rote...
Just a note on the second problem: it's basically just asking you to change the Do While test...Loop construct to a Do...Loop Until test one. You just need to change the test around so it works properly (bear in mind that While keeps going while the test is TRUE, whereas Until keeps going *until* the test is true, e.g. while it's false; also note that putting the test at the end of the loop means the code in the loop will be executed before the test is carried out, so there's a potential off-by-one issue you'll need to figure out).
-
2013-02-24, 01:36 PM (ISO 8601)
- Join Date
- Oct 2009
Re: ProgrammersitP
I have a pretty tough nut to crack atm,
For an android project I have to display a route between two or more points on a mapview, in previous projects I just used a webview which worked fine.
This time however due to extra features I have to implement it into a mapactivity (sherlockmapactivity for actionbar in lower api versions)
The route calculation and displaying works all well (if a bit slow with the repsonse parsing but not really an issue).
However I noticed pretty extreme fps drops, further inspection seems to indicate that the mapview redraws every single overlay constantly.
With less complex overlays its no problem but a route is rather complex (and due to a 4.2.2 "bug" (maybe intended) I canīt use path but have to use line instead (which sucks performance wise).
the draw code in the Overlay extending subclass with some effort to reduce the number of lines displayed to enhance performace a bit.
this code is called several times even if the mapview does not change
Code:@Override public final void draw(final Canvas c, final MapView mv,final boolean shadow) { super.draw(c, mv, false); int x1 = -1; int y1 = -1; int x2 = -1; int y2 = -1; Log.d(TAG,"DRAW"); Paint paint = new Paint(); paint.setStyle(Paint.Style.STROKE); paint.setStrokeJoin(Paint.Join.ROUND); paint.setStrokeCap(Paint.Cap.ROUND); paint.setColor(colour); paint.setStrokeWidth(STROKE); for ( int i = 0; i < routePoints.size(); i++ ) { int detailInc = 8; Point point = new Point(); mv.getProjection().toPixels( routePoints.get( i ), point ); x2 = point.x; y2 = point.y; if ( i > 0 ) { if(x1+detailInc < x2 || y1+detailInc < y2 || x1-detailInc > x2 || y1-detailInc > y2){ if(y1 < mv.getHeight()+100 && y1 > -100 && x1 < mv.getWidth()+100 && x1 > -100){ c.drawLine( x1, y1, x2, y2, paint ); } x1 = x2; y1 = y2; } }else{ x1 = x2; y1 = y2; } } }
The functionality inside the mapview is pretty standard, just adding it to the overlays.
So has anyone any idea how to fix the constant redraws?Last edited by Emmerask; 2013-02-24 at 01:41 PM.
-
2013-02-24, 02:35 PM (ISO 8601)
- Join Date
- Oct 2009
Re: ProgrammersitP
Okay I think I found a solution, ItemizedOverlay draw is only called twice when nothing changes (normal + shadow).
So I think I will put the route into an itemized overlay (although google said to put complex shapes into overlay subclass).
that was a bit premature, problem is still thereLast edited by Emmerask; 2013-02-24 at 03:16 PM.
-
2013-02-25, 04:14 AM (ISO 8601)
- Join Date
- Jul 2007
- Gender
Re: ProgrammersitP
I`m looking at browser games development tools.
There is applets in Java, but I think other things (like flash) will be more suitable. My plan is to try a few tools that are supposed to be good, and from that pick my favourite.
So I know that there are applets in Java, flash, and I heard Ruby is good for web development...
What else is out there? What do you recommend?Madly In Science, an RPG in which you play mad scientists, you can get it for free.
Spoiler: Some other things.
-
2013-02-27, 07:24 AM (ISO 8601)
- Join Date
- Oct 2009
Re: ProgrammersitP
Okay for those interested I "solved" my issue, well the mapview still redraws constantly but I managed to
a) understand android 4.2.2 behaviour regarding what it draws on the map and what not
b)increase the draw performance by roughly 2000%
firstly android 4.2.2 only draws objects where either the beginning or the end are within the displayed area plus half the span (or the center point plus the span).
With this information you can once again use path instead of line (which is a ton faster to draw and has build in optimization).
the most important parts of the RouteOverlay:
the draw override:
Code:@Override public boolean draw(final Canvas c, MapView mv,final boolean shadow, long when) { super.draw(c, mv, false); if(shadow){ return false; } paint.setColor(colour); paint.setAlpha(ALPHA); paint.setAntiAlias(true); paint.setStrokeWidth(STROKE); paint.setStyle(Paint.Style.STROKE); optimize(mv); redrawPath(mv); c.drawPath(path, paint); return false; }
Code:private List<GeoPoint> optimize(MapView mv){ optimizedRoutePoints = new ArrayList<GeoPoint>(); GeoPoint leftTop = new GeoPoint(mv.getMapCenter().getLatitudeE6()-mv.getLatitudeSpan(),mv.getMapCenter().getLongitudeE6()-mv.getLongitudeSpan()); GeoPoint rightBottom = new GeoPoint(mv.getMapCenter().getLatitudeE6()+mv.getLatitudeSpan(),mv.getMapCenter().getLongitudeE6()+mv.getLongitudeSpan()); for(int i = 0; i < routePoints.size();i++){ if(routePoints.get(i).getLatitudeE6() > leftTop.getLatitudeE6() && routePoints.get(i).getLatitudeE6() < rightBottom.getLatitudeE6() && routePoints.get(i).getLongitudeE6() > leftTop.getLongitudeE6() && routePoints.get(i).getLongitudeE6() < rightBottom.getLongitudeE6() ) { optimizedRoutePoints.add(routePoints.get(i)); } } return optimizedRoutePoints; }
Code:private void redrawPath(MapView mv){ final Projection prj = mv.getProjection(); path.rewind(); final Iterator<GeoPoint> it = optimizedRoutePoints.iterator(); prj.toPixels(it.next(), p); path.moveTo(p.x, p.y); while (it.hasNext()) { prj.toPixels(it.next(), p); path.lineTo(p.x, p.y); } path.setLastPoint(p.x, p.y); }
-
2013-02-27, 09:49 PM (ISO 8601)
- Join Date
- May 2007
- Location
- Sin City
Re: ProgrammersitP
Does anyone know the best way for a mechanical engineer to learn the following:
BASH in Linux
Creating Make files using FORTRAN
To be more specific, I have already self taught myself quite a bit in BASH, but there is so much more I do not know. I have a little helpful cheat sheet with command line codes and such, but it barely scratches the basics.
I can get by moving around in directories, creating/moving/renaming them. I can get by with transferring files (via a GUI). Still having problems doing it by line based.
I can create FORTRAN files, compile them, and create an executable file which I can then run from the BASH.
My point is, is there a very good, very helpful cheat sheet which explains in depth every command along with every subcommand that you can use to define it even more?
Or is it better to learn from someone who knows BASH and have them teach me?
Same with creating Make files in FORTRAN?
-
2013-02-27, 10:02 PM (ISO 8601)
- Join Date
- Jan 2012
-
2013-02-27, 10:10 PM (ISO 8601)
- Join Date
- Dec 2008
- Location
- Malsheem, Nessus
- Gender
Re: ProgrammersitP
Ta-da! It's not completely comprehensive, but it's much better than most.