(The available code tags are listed underneath the post box when editing, straight-forward shit and if there is a language you want me to enable just let me know. It uses GeSHi.)
Ooooh
Code sections
Hey hey hey hey
If it's not too much trouble, are multiple inline images possible?
baronfelWould you say I havea _plethora_?Registered Userregular
While we're talking useful programs, if you're working in Visual Studio you owe it to yourself to try Resharper. It's a ton of static analysis and core correction/completion/reorganization in one package. It also helps you out with improved Intellisense, WPF completion, and now supports javascript as well!
Check it out at their site. If you're familiar with IntelliJ, the major keybindings are the same, so you should be able to slip in easily to the extra features.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited February 2012
If you're writing C# and you aren't using ReSharper, you're a goose.
e: If you ever look at my source code and go "Huh, his source code is very pretty...nicely aligned, in nice regions and organized well, doesn't even have any extraneous using statements!" that's because of ReSharper.
I'm still using an ancient version of UltraEdit (v10) that we bought some licenses for 8-9 years ago... I've been using it so long I'm not sure I care to dick around with anything else.
Nintendo ID: Incindium
PSN: IncindiumX
0
Options
admanbunionize your workplaceSeattle, WARegistered Userregular
(The available code tags are listed underneath the post box when editing, straight-forward shit and if there is a language you want me to enable just let me know. It uses GeSHi.)
Ooooh
Code sections
Hey hey hey hey
If it's not too much trouble, are multiple inline images possible?
Done, and now images don't show up automatically, you need to insert them using the button.
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited February 2012
Well, it took me almost four hours, but I finally worked out all the Lua side stack imbalances in this code. You really have to be disciplined with Lua, because even nil being pushed on the stack after a simple nil check can leave you in an imbalanced state if you don't pop it. At least you don't have to clean up function arguments, prologue/epilogue style.
Also, when using metatables that override __index and __newindex in complex ways, it really behooves you to use lua_rawget/lua_rawset in almost every case, unless you know for a fact you want the metatable to trigger...had some fun to track down access violations earlier because I wasn't doing rawgets, and my __index was being triggered, and then thinking what I was looking for was something .NET side, and it got all kinds of out of whack.
If you resize an image using the width and height attributes, it will automatically render a resized version and link to the original, so MAGIC! Just upload the full deal and use the selections on the dropdown before clicking insert, or insert "original" and tweak the numbers yourself and it will make the smaller copies.
Going to sort out how I want to handle floating of the images when I get home.
0
Options
GnomeTankWhat the what?Portland, OregonRegistered Userregular
edited February 2012
Also, philosophical question. When doing a glue wrappers like this, there are sections of the code where you have to make a choice: Write them in the native side (in this case C#), or write them as actual Lua code. The __index and __newindex metatable function are clear examples of this. They don't change per-proxy, they are always the same. I could actually write them Lua side, and store that Lua as a simple resource in my code...or I could continue to write them C# side, which requires more time, effort and thought as I have to worry about things like the stack balancing out.
How would you guys go about that? On one hand, writing them Lua side is probably easier for maintenance, but on the other hand execution is likely slightly faster C# side and it keeps that kind of cruft out of the pristine scripting environment I'm trying to create.
e: Actually, there is one clear advantage to the C# side I didn't think of, and pretty much tips the scale towards keeping them C# side: I can debug them.
I can mostly confirm admanb's insane ramblings about Sublime Text 2. It's way better than Notepad++, but not as awesome overall as Vim or Emacs yet.
The first nice feature is multiple cursors. You can put in a whole bunch of cursors in random places, and they all work exactly like you'd expect. Movement, selection, text formatting operations, etc. Ctrl+D will find the next instance of the selected text and put a cursor there. It's really great if you have to work on old code that has a ton of repetition. I was saddened greatly when I learned that Vim doesn't support such dark magick.
The second nice thing is that you can script it with normal Python, and it's extremely scriptable. Someone built a package manager inside the editor. If I have to (for example) edit a Powershell script, and I realize ST2 doesn't have syntax highlighting for that, I hit Ctrl+Shift+P, and type "pac i<enter>power<enter>" (the text-based menu system has lazy autocomplete) and I've got Powershell syntax highlighting three seconds later. I'd have lost ten minutes mucking around with things in Vim.
Then there's a bunch of small things that are just nice to have, like the code navigation dropdown, good defaults for everything, live regex selection, the minimap, showing invisible characters on selection, and an incomplete Vim mode that does what I expect a decent amount of the time
But I still haven't paid the $60. Because Viiiiiiiim.
Also, philosophical question. When doing a glue wrappers like this, there are sections of the code where you have to make a choice: Write them in the native side (in this case C#), or write them as actual Lua code. The __index and __newindex metatable function are clear examples of this. They don't change per-proxy, they are always the same. I could actually write them Lua side, and store that Lua as a simple resource in my code...or I could continue to write them C# side, which requires more time, effort and thought as I have to worry about things like the stack balancing out.
How would you guys go about that? On one hand, writing them Lua side is probably easier for maintenance, but on the other hand execution is likely slightly faster C# side and it keeps that kind of cruft out of the pristine scripting environment I'm trying to create.
e: Actually, there is one clear advantage to the C# side I didn't think of, and pretty much tips the scale towards keeping them C# side: I can debug them.
C# is not always faster, if you use LuaJIT as the script engine, however the JIT compiler does break tracing on native C calls, which there are likely to be a lot of.
For Lua stack balancing I've tended to just use a simple class that on destruction auto-pops everything, not sure how easily you can do that but you can always just call lua_settop() if you've saved the top earlier
C# is not always faster, if you use LuaJIT as the script engine, however the JIT compiler does break tracing on native C calls, which there are likely to be a lot of.
For Lua stack balancing I've tended to just use a simple class that on destruction auto-pops everything, not sure how easily you can do that but you can always just call lua_settop() if you've saved the top earlier
lua_settop feels like cheating though :P Yeah, I could do that, but these are going to be extremely long running script contexts. I'd rather make sure the stack is finely balanced the way it should be, rather than just tossing in a bunch of full pops and settops all over the place. If I were doing just a very simple glue wrapper, I'd probably do exactly as you suggest and have some kind of class that pops on destruct (or some kind of method I can pass a lambda to that does an auto-pop at the end, using gettop/settop).
At any rate, most of the stack imbalance issues were just from me not having touched the Lua API in a while and having to remember what pushes, what pops and when I have to manually pop. It's coming back to me now.
Driver problem solved. I reformatted the computer. Haha.
So question. Seeing as Gnome is talking about scripting. I am writing a piece of software to do testing. Most of the testing will be automated and I was planning on using a scripting language for it. I don't need anything complex for it. The ability to bind function calls to C# calls, do some kind of looping, and some boolean logic for if then else. I was thinking of using Python however I fear that the people who will be writing the scripts will make the script do too much or would not be willing to learn the syntax and end up expecting me to take care of their work. Anyone have any thoughts? The software is for internal use only and it needs to be done quickly. I don't really have the time to write up something grand. IronPython stuck out for this reason though I have never used it. If C# 4.5 was released I would be using the C# scripting language. (Plus async, so awesome)
I'm trying to do some graphics programming, using a textbook that uses OpenGL, GLUT, and GLEW. Does anyone have any experience setting these up? GLUT in particular was apparently abandoned years ago, I can't find any 64 bit versions of it, my textbook leads to all these broken links, and files that I'm told should already exist (like gl.h) don't. Everything from my textbook leads to broken links or 404s and aaaargh. I wanna go back to Java.
Does anyone have any experience with the Clang compiler? How does it matches up to GCC? I heard a lot of nice things about its usability, but where does it stands on the optimization front?
"All men dream, but not equally. Those who dream by night in the dusty recesses of their minds wake in the day to find that it was vanity; but the dreamers of the day are dangerous men, for they may act their dream with open eyes to make it possible." - T.E. Lawrence
GnomeTankWhat the what?Portland, OregonRegistered Userregular
Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.
Okay I'm trying to figure out how to remove an icon from a JButton. If I add an Icon, and save my design everything is fine. But when I REMOVE the icon and then save it throws an IOException.
if (imageSelector.getNoImageRadio().isSelected()) {
//Remove the image, so have a blank ImageIcon..
path = "";
imageIcon = new ImageIcon(path);
return imageIcon;
}
This is a snippet of my if statement. Basically I set the path to nothing, and then create a new ImageIcon... That does nothing. So I've tried:
Wow I figured it out... I can't believe it ended up being what it was.... One of our Properties for the Control was being set as the ImageIcon("") blank path, and that didn't exist so when we tried to save it (yay, serialization!) it threw the error. So basically I set it to an empty string if the icon doesn't exist any more.
Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.
The only real problem with emacs is that it doesn't integrate well with screen. If I had to start over, I'd learn vim instead, only for that reason.
OK, two reasons. eshell can't handle redirection correctly, which annoys the hell out of me.
Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.
Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.
The only real problem with emacs is that it doesn't integrate well with screen.
Come again? I use a vertical split emacs in a screen tab for over 90% of my development.
What possible issue do you have?(PS: rebind screen escape if it's shortcuts, .screenrc is your best friend)
Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.
Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.
The only real problem with emacs is that it doesn't integrate well with screen.
Come again? I use a vertical split emacs in a screen tab for over 90% of my development.
What possible issue do you have?(PS: rebind screen escape if it's shortcuts, .screenrc is your best friend)
It's exactly the overlap in control characters that's annoying. Yeah, I know I can rebind them (and I have) but I want it to work without having to do anything. Basically screen should change it's defaults to be emacs friendly.
I'm still using an ancient version of UltraEdit (v10) that we bought some licenses for 8-9 years ago... I've been using it so long I'm not sure I care to dick around with anything else.
I use the current version of ultraedit every day. It's one of the few editors with easy to use FTP support (i'm editing/saving to an ftp directory on a unix server). It also has a wordfile for pickBASIC
Emacs is 99% hype, sorry. I've used it a couple of times, and there is very little it does so different from other editors to get the reputation it has. I get that when Emacs came out, it was revolutionary, but it's not anymore.
Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.
Yet you told someone they should whip themselves for changing away from emacs. That's the kind of hype I'm talking about. Emacs isn't that great that people should flog themselves for deciding to not use it.
So is there an option for a dialog window, in Java, that displays something for x amount of seconds, or until something opens? I'd really like to use something like that...
I never really got into vim or emacs. Can't stand vim though; I'm sure it's easy to use once you know it, but all I want to do is add a line dammit! Or change these few characters.
Posts
Ooooh
Code sections
Hey hey hey hey
If it's not too much trouble, are multiple inline images possible?
Check it out at their site. If you're familiar with IntelliJ, the major keybindings are the same, so you should be able to slip in easily to the extra features.
e: If you ever look at my source code and go "Huh, his source code is very pretty...nicely aligned, in nice regions and organized well, doesn't even have any extraneous using statements!" that's because of ReSharper.
Nintendo ID: Incindium
PSN: IncindiumX
Done, and now images don't show up automatically, you need to insert them using the button.
It will put the img tag in for you.
Awesome - thanks very much!
Also, when using metatables that override __index and __newindex in complex ways, it really behooves you to use lua_rawget/lua_rawset in almost every case, unless you know for a fact you want the metatable to trigger...had some fun to track down access violations earlier because I wasn't doing rawgets, and my __index was being triggered, and then thinking what I was looking for was something .NET side, and it got all kinds of out of whack.
Going to sort out how I want to handle floating of the images when I get home.
How would you guys go about that? On one hand, writing them Lua side is probably easier for maintenance, but on the other hand execution is likely slightly faster C# side and it keeps that kind of cruft out of the pristine scripting environment I'm trying to create.
e: Actually, there is one clear advantage to the C# side I didn't think of, and pretty much tips the scale towards keeping them C# side: I can debug them.
The first nice feature is multiple cursors. You can put in a whole bunch of cursors in random places, and they all work exactly like you'd expect. Movement, selection, text formatting operations, etc. Ctrl+D will find the next instance of the selected text and put a cursor there. It's really great if you have to work on old code that has a ton of repetition. I was saddened greatly when I learned that Vim doesn't support such dark magick.
The second nice thing is that you can script it with normal Python, and it's extremely scriptable. Someone built a package manager inside the editor. If I have to (for example) edit a Powershell script, and I realize ST2 doesn't have syntax highlighting for that, I hit Ctrl+Shift+P, and type "pac i<enter>power<enter>" (the text-based menu system has lazy autocomplete) and I've got Powershell syntax highlighting three seconds later. I'd have lost ten minutes mucking around with things in Vim.
Then there's a bunch of small things that are just nice to have, like the code navigation dropdown, good defaults for everything, live regex selection, the minimap, showing invisible characters on selection, and an incomplete Vim mode that does what I expect a decent amount of the time
But I still haven't paid the $60. Because Viiiiiiiim.
There are Lua debuggers: http://www.cushy-code.com/grld/manual.html is one I've used. Not 100% sure it will play nice with C# though.
C# is not always faster, if you use LuaJIT as the script engine, however the JIT compiler does break tracing on native C calls, which there are likely to be a lot of.
For Lua stack balancing I've tended to just use a simple class that on destruction auto-pops everything, not sure how easily you can do that but you can always just call lua_settop() if you've saved the top earlier
lua_settop feels like cheating though :P Yeah, I could do that, but these are going to be extremely long running script contexts. I'd rather make sure the stack is finely balanced the way it should be, rather than just tossing in a bunch of full pops and settops all over the place. If I were doing just a very simple glue wrapper, I'd probably do exactly as you suggest and have some kind of class that pops on destruct (or some kind of method I can pass a lambda to that does an auto-pop at the end, using gettop/settop).
At any rate, most of the stack imbalance issues were just from me not having touched the Lua API in a while and having to remember what pushes, what pops and when I have to manually pop. It's coming back to me now.
I turned that off intentionally as it mucks with things, in particular the use of the @ sign.
Use <a> tags explicitly, thanks!
So question. Seeing as Gnome is talking about scripting. I am writing a piece of software to do testing. Most of the testing will be automated and I was planning on using a scripting language for it. I don't need anything complex for it. The ability to bind function calls to C# calls, do some kind of looping, and some boolean logic for if then else. I was thinking of using Python however I fear that the people who will be writing the scripts will make the script do too much or would not be willing to learn the syntax and end up expecting me to take care of their work. Anyone have any thoughts? The software is for internal use only and it needs to be done quickly. I don't really have the time to write up something grand. IronPython stuck out for this reason though I have never used it. If C# 4.5 was released I would be using the C# scripting language. (Plus async, so awesome)
Maybe I'll pay for it when I get mo' money.
Also code sections make me happy in the pants. Now all we need is highlighting.
e: Also everyone should listen to the song in my signature. It's a great song to program to, in my opinion.
"If you're going to play tiddly winks, play it with man hole covers."
- John McCallum
I sympathize. I spent a year or so with emacs and I had a difficult time letting go. I still use the cursor shortcuts whenever I can.
I think in the end I just prefer ease of use, accessible features, and prettiness (oh the prettiness) over text editing wizardry.
This is a snippet of my if statement. Basically I set the path to nothing, and then create a new ImageIcon... That does nothing. So I've tried:
(Which Google suggested I do) But it still did nothing. What am I missing here?
You mean how it doesn't handle tabs at all and just takes whatever you had in your editor verbatim?
Yeah! It should magically space everything perfectly for me.
The only real problem with emacs is that it doesn't integrate well with screen. If I had to start over, I'd learn vim instead, only for that reason.
OK, two reasons. eshell can't handle redirection correctly, which annoys the hell out of me.
Hype? What? I don't even claim it's better than notepad. Just what I ended up using and unlikely to change.
Come again? I use a vertical split emacs in a screen tab for over 90% of my development.
What possible issue do you have?(PS: rebind screen escape if it's shortcuts, .screenrc is your best friend)
It's exactly the overlap in control characters that's annoying. Yeah, I know I can rebind them (and I have) but I want it to work without having to do anything. Basically screen should change it's defaults to be emacs friendly.
Obviously that last bit is tongue-in-cheek.
I use the current version of ultraedit every day. It's one of the few editors with easy to use FTP support (i'm editing/saving to an ftp directory on a unix server). It also has a wordfile for pickBASIC
Yet you told someone they should whip themselves for changing away from emacs. That's the kind of hype I'm talking about. Emacs isn't that great that people should flog themselves for deciding to not use it.