|
Ah thanks. I'm just doing the codeacademy stuff and don't know all the built in methods -- is there a .to_i to turn a string into an integer (if possible), the same way that .to_s converts integer into a string? Or a way to append 'gets' so that the input is accepted as an integer? Sorry, CodeAcademy is light on the syntactical stuff. e: got it, thanks all! regulargonzalez fucked around with this message at 09:21 on Aug 18, 2014 |
# ? Aug 18, 2014 09:13 |
|
|
# ? Jun 8, 2024 22:45 |
|
Not sure if this is the right place for this but seems to be the best fit. My drupal 7 site was hacked by some pro-palestine group and of course I don't have a recent backup. Contacted the host and not surprisingly they are unhelpful. Anyone have any good resources to look at for identifying what they did and removing it? I would very much prefer not having to scrap the whole thing because I find some injected code somewhere. The url is animaltree.org if it is useful at all.
|
# ? Aug 18, 2014 16:59 |
|
nesbit37 posted:Not sure if this is the right place for this but seems to be the best fit. https://www.drupal.org/project/hacked, maybe?
|
# ? Aug 18, 2014 17:14 |
|
Awesome, thanks. It looks like it might be too late for that one since I don't think I can even get to the admin interface of Drupal, just the files and database on the server, but certainly looks good.
|
# ? Aug 18, 2014 17:19 |
|
There's not a VBA thread so posting here. I inherited from a coworker the maintenance of a Word macro that parses a document for specific phrases and grammatical constructs that are no-nos in the documents we produce. It then attaches a comment to the offending phrase with revision suggestions. He doesn't know anything about programming, so he cobbled it together with random googling. Right now it is literally 1000+ blocks of code just like this: code:
Does anyone have any thoughts on where I can sniff around to try to optimize this thing? edit: Some sniffing around finds this: http://blogs.technet.com/b/heyscriptingguy/archive/2006/03/21/how-can-i-search-for-and-highlight-words-in-a-microsoft-word-document.aspx which can let me find words using a foreach loop, but wouldn't help with the loading up comments. I'm thinking I could do a hybrid solution: create a text file with a bunch of lines in the form at of "no-no:comment" and parse it at the start of the script. Put the "no-no" into the array described in the link and then stick both into a map as a key-value pair. Each time a no-no is found, go to the map to find the comment to put it in. Before I start running around coding this up, do y'all think this will be any faster? The MUMPSorceress fucked around with this message at 21:36 on Aug 20, 2014 |
# ? Aug 20, 2014 21:24 |
|
I remember the first time used Quake's console and changed some variables that were being used by the game. I was kind of amazed. I guess scriptable programs have the same thing going on underneath. What are some ways that you would bind those to the actual variables in code? Would it be language specific? Would you build some sort of table with values and just index them through there? ["varname", "val"], ["varname2", "val"] ... ?
|
# ? Aug 22, 2014 20:07 |
|
You'd probably never give direct variable access but instead keep it functions like everything else. Take source for example: If you type sv_cheats 1, it calls the binding of "sv_cheats(1)" (potentially 1 being a string). Same as "bindtoggle k +crouch" would be "bindtoggle('k', '+crouch')" and 'k' and '+crouch' would probably be resolved elsewhere inside the function. The map would have to support storing functions that can take any commands so it's best to do something like this.
|
# ? Aug 23, 2014 00:21 |
|
What's so wrong with this code that it actually crashes the compiler?Java code:
"Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_11)" Scala IDE version: "Scala IDE build of Eclipse SDK Build id: 3.0.4-2.11-20140723-2253-Typesafe" Slick version: 2.1.0 for Scala 2.11
|
# ? Aug 23, 2014 22:19 |
|
Bob Morales posted:I remember the first time used Quake's console and changed some variables that were being used by the game. I was kind of amazed. I guess scriptable programs have the same thing going on underneath. In Quake there was a special structure called a cvar and there was a manager which held a collection of those. Any part of the code could register a pointer to a cvar and when you typed into the console, if what you typed matched a cvar, it would update the structure with that value so the variable could be read directly. This was C, no fancy callback or storage or protection, so you had to remember if you wanted the string or float value. There are two reasons for direct access: 1) finding a cvar by name was a linked list search and 2) it would have been more effort to expose the pointer registration stuff to the QuakeC interpreter. So, interpreted code had to look up cvars by name. Incidentally, newly-registered cvars are put at the head of the linked list, I assume as an optimization for the interpreter. Commands were almost the same. Any part of the code could associate a callback function with a given command name. The command manager also had a linked list of commands, and if the console input matched a command, the callback would be called, and it would have to ask the command system if there was anything else on the line. Key bindings were a little more complex, there was a special command handler for those (though they were registered through the standard command manager): they would set the client's movement state, which would be sent on to the server, which would translate that into actual player movement.
|
# ? Aug 24, 2014 20:11 |
|
I am writing a little script in AutoIt where it will open an xml file in notepad, open the Replace window, find a time value (ex: 08:25:00) and then replace it with the value + 10 seconds (08:25:10). My issue is I don't know how to handle adding the 10 seconds to the original time. To go from 08:25:00 to 08:25:10. It needs to be in that format for the XML. I'll then continue to loop the script and continue to add 10 seconds to the previous time. Any ideas?
|
# ? Aug 25, 2014 15:51 |
|
Hughmoris posted:I am writing a little script in AutoIt where it will open an xml file in notepad, open the Replace window, find a time value (ex: 08:25:00) and then replace it with the value + 10 seconds (08:25:10). https://www.autoitscript.com/autoit3/docs/functions/StringRegExpReplace.htm IIRC, the Autoit help file has a decent regex tutorial. There's also plenty of them on the Internet. They'll seem daunting at first, but stuck with it, as they're insanely useful. Also, that function, combined with the FileOpen function means you don't need Notepad at all.
|
# ? Aug 25, 2014 16:13 |
Convert the time string to a single number, add your offset to that, convert back to a time string. E.g. "8:25:55" converts to 10 + 25*60 + 8*60*60 = 30355. Add 10 to that, gets you 30365. To convert that back: Divide by 60, result is 506 and a remainder of 5. The 5 is your number of seconds, the 506 is the number of total minutes. Divide the total minutes by 60, result is 8 and remainder 26. That's your hours and minutes. Concatenate those results to get the desired 8:26:05 There's also a good chance that your language of choice has some library functions that can do all of this for you.
|
|
# ? Aug 25, 2014 16:24 |
|
Thermopyle posted:https://www.autoitscript.com/autoit3/docs/functions/StringRegExpReplace.htm RegEx has kicked my butt whenever I've looked at it in the past. Not sure why I have such a hard time understanding it but I know I need to get it under my belt. nielsm posted:Convert the time string to a single number, add your offset to that, convert back to a time string. Thanks for this.
|
# ? Aug 25, 2014 17:20 |
|
Hughmoris, something to play with:code:
onionradish fucked around with this message at 18:06 on Aug 25, 2014 |
# ? Aug 25, 2014 17:51 |
|
onionradish posted:Hughmoris, something to play with: Thanks for this Onionradish. I'm still very new to AutoIt and programming in general so this will do be good to walk through some code and break it down and learn.
|
# ? Aug 25, 2014 18:03 |
|
Hughmoris posted:Thanks for this Onionradish. I'm still very new to AutoIt and programming in general so this will do be good to walk through some code and break it down and learn. Your best bet would be to split your $file_contents into an array of lines, make the "gimme a new time string" part (which should be fine) into a function, and make the changes line by line. That way you're confining the changes so things couldn't be changed twice. onionradish fucked around with this message at 18:16 on Aug 25, 2014 |
# ? Aug 25, 2014 18:10 |
|
Hughmoris posted:RegEx has kicked my butt whenever I've looked at it in the past. Not sure why I have such a hard time understanding it but I know I need to get it under my belt. If you're on windows, pick up The Regex Coach!
|
# ? Aug 25, 2014 19:34 |
|
onionradish posted:Thermopyle, I can't decide if the StringReplace() needs to be run line-by-line or can be safely run on the entire file. I *think* the _ArrayUnique() and descending _ArraySort() will prevent multiple changes to a time, but I'm not sure.... StringReplace will work on whatever string you give it. You can give it a string containing multiple @CRLF's and it doesn't care.
|
# ? Aug 25, 2014 21:26 |
|
Thermopyle posted:StringReplace will work on whatever string you give it. You can give it a string containing multiple @CRLF's and it doesn't care. Doing the string replacement on each line seems the safest approach. onionradish fucked around with this message at 01:13 on Aug 26, 2014 |
# ? Aug 26, 2014 01:10 |
|
Does anyone know anything about Nagios scripting? Assuming this is even the right place to ask. I've been tasked with implementing Windows Event Viewer log monitoring, and I know next to nothing about Nagios. I managed to get some sort of check using CheckEventLog based on what I've found via Google, but whatever it's reporting is definitely not what's in Event Viewer and I can't figure out why. It's supposed to check for a warning or critical event in System, Application, and Security, and email a succinct problem description, but instead it's just reporting back some specific failure of the antivirus' ability to scan one single file, in extremely verbose format.
|
# ? Aug 26, 2014 01:29 |
|
onionradish posted:It was the replacement of the time I was worried about. Like whether the code would find ["08:00:00", "08:00:10" ...], and on first pass replace all "08:00:00" with "08:00:10", and next pass replace all "08:00:10" with "08:00:20", etc. -- incorrectly changing the earlier values. I added a descending sort on the times, so in theory that wouldn't happen, but not sure that's a fix, and as I said, seems like a "trick" that's not intuitive to anyone trying to read the code later. Oh yeah, of course that's what you were concerned about. Don't know what I was thinking. I think you're probably right that you did it the safest way.
|
# ? Aug 26, 2014 02:52 |
|
This thread's seeing traffic again, so just asking if anyone has thoughts about my post up-page. Edit: I am Obama, killer of threads. The MUMPSorceress fucked around with this message at 05:39 on Aug 26, 2014 |
# ? Aug 26, 2014 03:12 |
|
LeftistMuslimObama posted:This thread's seeing traffic again, so just asking if anyone has thoughts about my post up-page. The link you posted doesn't deal with multi-word search targets. One way to do that involves building a state machine with each terminal state pointing to some comment text, but I don't know if either VBA or you are up to that task. You might also be able to use a trie, but again, this is possibly outside of your wheelhouse and probably outside of VBA's. (And neither of these solutions will be particularly maintainable unless you build in some initial step to convert a simple mapping list to your state machine or trie.) A simpler hybrid approach would just use the simple dictionary for single-word targets, and then repeat the approach you've already got for the multi-word ones. Your speedup will be (almost) equal to the percentage of targets that are single-word. raminasi fucked around with this message at 06:39 on Aug 26, 2014 |
# ? Aug 26, 2014 06:28 |
I wrote a little script that goes through every unresolved JIRA and checks to see if the last comment in the ticket contains a question mark (i.e. somebody is waiting for somebody else to provide more info). The results were pretty interesting...Dug up some really old tickets where people were just left hanging
|
|
# ? Aug 27, 2014 19:16 |
|
How many of those tickets were actually assigned to the person who is expected to respond to them?
|
# ? Aug 27, 2014 19:25 |
|
fletcher posted:I wrote a little script that goes through every unresolved JIRA and checks to see if the last comment in the ticket contains a question mark (i.e. somebody is waiting for somebody else to provide more info). The results were pretty interesting...Dug up some really old tickets where people were just left hanging What did you write it in?
|
# ? Aug 27, 2014 21:44 |
|
TheEffect posted:What did you write it in? This is super easy to do with the JIRA API.
|
# ? Aug 27, 2014 22:19 |
Sedro posted:How many of those tickets were actually assigned to the person who is expected to respond to them? Good question! I'm gonna go over it in more detail at the end of the week, that's definitely a good thing to check. TheEffect posted:What did you write it in? I used jira-python. It was insanely easy, only like 7 lines of python.
|
|
# ? Aug 28, 2014 01:49 |
|
Advice: don't write a script that automatically comments on a thousand JIRA issues without temporarily disabling email notifications.
|
# ? Aug 28, 2014 03:30 |
|
There doesn't seem to be a Lua thread, so I'm going to ask here. If there's a better thread for it, please direct me to it. I'm writing some code for OpenComputers, a Minecraft mod that lets you make in-game computers and program them in Lua, and I've run into an issue I can't figure out how to solve as a relative Lua newbie. The program is here; it's an implementation of Kalah, the variation of mancala that's best known in the Western world. The issue is this: when the computer player has only one move left, the program crashes thusly: So what am I doing wrong?
|
# ? Aug 28, 2014 19:49 |
Not going to trace through the entire thing (it's a rather long program), but some starting points: The complaint is that the seeds variable used at line 221 is nil, it gets initialized at line 219 by indexing into newBoard. Since the indexing succeeds, that indicates that newBoard itself is a valid table, but that the move variable used to index into it does not have a valid key for the table. A starting point for debugging would be to check what the value of move is at that point, as well as checking that the tableCopy function works as advertised. If both of those look sane, then the original board variable must be missing some major data, so begin tracing how that one gets created/filled.
|
|
# ? Aug 28, 2014 20:07 |
|
I couldn't find a programming jobs thread, so.. What's the likelihood of eventually transitioning to a Developer position when starting as a Quality Engineer? Is it a rare or not?
|
# ? Aug 28, 2014 20:17 |
|
Liam Emsa posted:I couldn't find a programming jobs thread, so.. Tada! (quick answer, though re-ask in there: it's not super rare but it's not often successful from what I've seen)
|
# ? Aug 28, 2014 20:20 |
Liam Emsa posted:I couldn't find a programming jobs thread, so.. Several people at the place I work have made this transition. I think they were QA for about a year before switching. Make it clear during your performance reviews what your goal is. It also certainly helps to go the extra mile while you are QA, for example identifying some need a the organization and writing a little program or app that solves it or improves productivity or whatever. Just make sure all of your official responsibilities are handled before doing the extra stuff. You'll probably also get to see how developers are building the features or fixing the bugs that you are reporting, so be sure to learn from that. Bonus points if you can identify creative ways to break the app by looking through the code.
|
|
# ? Aug 28, 2014 20:30 |
|
Look for positions where QA is explicitly listed as engineers who can script, code, etcetera. I know that Amazon and Google hire on this criteria. Once you get experience that way, it's usually easier to transition to pure dev.
|
# ? Aug 28, 2014 22:12 |
|
nielsm posted:Not going to trace through the entire thing (it's a rather long program), but some starting points:
|
# ? Aug 28, 2014 22:26 |
|
I am looking for any libraries that could help me plot interactive candlestick charts. If you didn't know, those are generally use for stock market data to represent open/high/low/close data for time spans. Many plotting libraries support it, but I am superimposing subregions that I found interesting. I do some transformation work so they overlay each other, but with enough plots, it looks like a giant, soupy mess. I'm at the point where I need a less rigid mechanism and was hoping there's a library out there that is easy to modify into doing something like: 1. Being able to scroll through the plots 2. Be able to click through the different plots and have their specific series highlighted 3. Fade out the various plots so that only the areas where many overlap become more bold I was just using matplotlib in Python, and I don't think I can get this kind of power from that alone. I was assuming I'd just write my own candlestick plotter and interaction code, but that's going to get tedious. I was thinking of finding some rendering engine so I'm not having to do raw drawing commands and maybe get some intersection helpers for selecting data series. That is, if there isn't something already more powerful out there. I'm writing stuff in Python write now, but I'm also comfortable with C++, Java, C#, and Perl.
|
# ? Aug 28, 2014 22:26 |
|
Can anyone recommend some a book or other online resources for learning some efficient CSG modeling algorithms? 3d boolean operations, etc. I like to use this web based scripted modeling site: http://openjscad.org/ But I wish it handled higher detail/complex objects a bit more efficiently. It just seems like a modern computer shouldn't be crunching so hard over relatively low poly stuff. Wondering if there is much room for improvement(Big-O improvements?) in the algorithms currently being used? I'm not very well versed in CSG algorithms but i like geometry and optimization problems so I thought I might take a stab at it. peepsalot fucked around with this message at 22:49 on Aug 28, 2014 |
# ? Aug 28, 2014 22:46 |
|
This seems like it would be a relatively simple problem but I can't think of a solution for it... I have an application at work that is essentially an IE page. After much hair pulling and frustration, I've figured out how to attach AutoIt controls to the application and check a box: code:
Any ideas? Hughmoris fucked around with this message at 00:14 on Aug 29, 2014 |
# ? Aug 28, 2014 22:53 |
|
|
# ? Jun 8, 2024 22:45 |
|
Rocko Bonaparte posted:I am looking for any libraries that could help me plot interactive candlestick charts. I recently made a switch from matplotlib to some web-based solutions after the former was deemed "too engineery". Both dygraph and d3 let me get prettier web-facing charts quickly. For dygraphs I just modified the python to spit out csv's over CGI and manipulated the data on the browser side. I will say I was disappointed with Dygraph's example code and pretty much dropped it once I had the bare minimum. For something complex with active data selection you might need someone with stronger javascript chops.
|
# ? Aug 29, 2014 00:12 |