|
Thank you! These are great, just the kind of thing I was looking for. Any other suggestions are appreciated too.
|
# ? Apr 18, 2013 07:15 |
|
|
# ? Jun 9, 2024 15:23 |
|
I'm looking for some good fundamental approaches towards a problem I'm making for myself in my free time. I have been playing with OpenCL, which has a notion of kernels, which are just little programs to run on your OpenCL-capable GPU or CPU. These can take an arbitrary amount of arguments, of which there are a few most common to what I'm doing--mostly arrays of floats to specific types of data. There can be cases where output from one kernel would be used by another. So I could have something like: kernel2(SPECIFIC_FLOATS1, SPECIFIC_FLOATS2, 3, kernel1(SPECIFIC_FLOATS2)[0]) This would mean I run kernel 1, injecting my SPECIFIC_FLOATS2 array as it's only argument first. Then I would run kernel 2 with: Argument 1 is my SPECIFIC_FLOATS1 array Argument 2 is my SPECIFIC_FLOATS2 array Argument 3 is just a scalar integer 3 Argument 4 is the first output argument from kernel1 I see myself very quickly coming up with something like those little calculator programs you see come up when talking about trees or parsing. So I was wondering if I could take an existing system and adapt it here without reinventing the wheel. If you're curious, I'm writing the control code in C++, with Boost 1.53, currently on Windows. Edit: For what it's worth, I've been looking at Boost.Spirit for awhile and wondering if I should just take the plunge on that one. Rocko Bonaparte fucked around with this message at 07:23 on Apr 18, 2013 |
# ? Apr 18, 2013 07:20 |
|
heap posted:Thank you! These are great, just the kind of thing I was looking for. Any other suggestions are appreciated too. http://www.99-bottles-of-beer.net/
|
# ? Apr 18, 2013 09:11 |
|
Carthag posted:For example their page on Levenshtein distance has it in 31 languages. But not R/S+; what the hell quote:
See that .C("levenshtein", ...) call? That's calling a function written in C that's part of the RecordLinkage package. Calling another implementation of an algorithm doesn't count as implementing that algorithm!
|
# ? Apr 18, 2013 13:54 |
|
Haha, that's pretty weak. It was just a site I remembered and figured I'd throw out there v v
|
# ? Apr 18, 2013 14:05 |
|
http://www.99-bottles-of-beer.net/ The song 99 bottles of beer, in over 600 different languages. Many with different implementations. I dont know if this'll do you over, but I've had fun looking at it.
|
# ? Apr 18, 2013 14:53 |
|
nielsm posted:You should be able to use the "find" command to search your text file for the entered data, then check the errorlevel returned to see if it was found or not. FINDSTR is working great for this. However, I'm having a super weird problem I can't wrap my head around. When run under normal user privileges it works fine. When run with admin privileges, however, it returns FINDSTR: Cannot open list.txt Why wouldn't it be able to open it when run as admin?
|
# ? Apr 18, 2013 15:30 |
|
Different working directory?
|
# ? Apr 18, 2013 17:43 |
|
Plorkyeran posted:Different working directory? The scripts are sitting on a thumb drive. I found turning off UAC will let FINDSTR work, but then it prevents XCOPY from working. I can post the text of the script if you're interested.
|
# ? Apr 18, 2013 18:33 |
|
I'm trying to come up with a simple steganography scheme. I'm trying to think of files or datasets an average Windows or Mac user would have on their computers that satisfy the following criteria: a) Is a sequential (or generally sequencable in some way, like a SQL database) collection of items that could plausibly be arranged in an arbitrary order b) There has to be a fairly high number of unique items, especially if repetition is implausible c) Repeated items are allowed only if they could plausibly be there. For example, a playlist file with more than a few repetitions of a single song would look out of place d) It would be nice if more than one copy of such a file could plausibly exist--many copies of browser history files might not work, while multiple playlists is plausible My basic idea goes like this: 1) A very small text file, say 256 bytes, is somehow encrypted. AES-256 and GPG with a 2048-bit key yield binary files of about 288 and 429 bytes each. 2) The encrypted file is encoded with base16 encoding (in the example, the sizes go up to 576 and 858 bytes) 3) A set of strings supplied from somewhere. Each list item is hashed/summed modulo 16 to yield a hexdigit 4) A file is constructed where each hexdigit in the encoded file corresponds to an entry whose sum equals that hexdigit. Depending on the nature of the ouput file, repetitions may or may not be allowed, or they may be allowed up to a certain limit. So let's say you had a list of credit card numbers to start with. As your data source, you decide to use the computer's iTunes library to generate what looks like an ordinary playlist file. In this case, there would have to be enough items in the iTunes databasae, preferably unique because one song is not that likely to reappear many times in a normal playlist, to account for the size of the input. Of course, the playlist would be a lot shorter if the input were not base16 encoded. But to create a sufficient pool of strings to cover each symbol in the alphabet, the modulus has to be on the low side, right? I'm super tired right now so I might be off, but to account for a pathological case where each hexdigit is somehow the same, you would need (length in base16)*16 items if they had to be unique. In the example this is over 9000 for AES-256... My 30GB iTunes library has about 5000 items in it. I guess you could split it into multiple playlists in this case but it's hardly ideal. So far the ideas I have for the output files are:
Anyway, I know very little about cryptography or steganography, and I haven't programmed anything more than a few scripts in like five years. This is purely for fun; there are better ways to steganography but I just want to see what I can put together to inconspicuously store small amounts of data in plain text. I welcome suggestions and/or guidance.
|
# ? Apr 18, 2013 22:25 |
|
I'm not really sure if they went into your specific questions, but the Hydan paper was geared to hide information in x86 binaries and might cover some shared ground. I have a perl script. I want to distribute similar code to non-CS folks. Are C# regex/data structures the easiest path to translate perl into for easy distribution? e: done a couple hours later without burning hard on it, so "yes" JawnV6 fucked around with this message at 23:09 on Apr 19, 2013 |
# ? Apr 19, 2013 21:14 |
|
Hmm, that seems like it could be a useful start; thanks. The functional equivalency approach seems pretty interesting. It could apply just as easily to shader code and bytecodes, presumably (though I suppose the likes of hotspot could mutilate the output. Most of the freely available information I found is geared toward LSB-based steg in images and gibberish text files in "English." Since I'm already designing it in a pretty decoupled, semi-OO way with functional aspects (yeah, I'm using Python), having several output modules would be a sound goal, especially as part of the reason I'm doing this is to get back into programming and I really don't want to write something like a Rails program to record and produce reports about the freelance work I do. And I don't really like GUI programming of any kind.
cancelope fucked around with this message at 11:31 on Apr 20, 2013 |
# ? Apr 20, 2013 11:28 |
|
Is there a way to get Windows 8 and Chrome not to flag my programs as viruses without spending $1000 a year on a signing service?
Dominoes fucked around with this message at 16:14 on Apr 21, 2013 |
# ? Apr 21, 2013 16:00 |
|
Are there any ML and/or functional programming guru's in the house? I'm having trouble conceptualizing/visualizing code from a functional paradigm standpoint, that and the syntax of ML is so crazy to me that it's blowing my mind.
|
# ? Apr 22, 2013 03:42 |
|
Anyone have good online resources for meshfree integration methods? With source would be ideal. I have a book or two, read a ton of papers, and searched a lot. I'm just looking for practical reinforcement. Seeing things in action helps me understand things significantly better. The specific problem, language*, or method doesn't matter much.
Khorne fucked around with this message at 06:12 on Apr 22, 2013 |
# ? Apr 22, 2013 04:29 |
|
pliable posted:Are there any ML and/or functional programming guru's in the house? I'm having trouble conceptualizing/visualizing code from a functional paradigm standpoint, that and the syntax of ML is so crazy to me that it's blowing my mind. do you have a specific question?
|
# ? Apr 22, 2013 05:13 |
|
the talent deficit posted:do you have a specific question? Not at the moment; I'm looking for school help, basically. We're writing an interpreter for a subset of JavaScript using ML, and this initial step is writing the lexer. I have a fair idea of how to implement the lexer, but barely knowing ML/functional paradigms has been kind of a damper .
|
# ? Apr 22, 2013 05:36 |
|
Dominoes posted:Is there a way to get Windows 8 and Chrome not to flag my programs as viruses without spending $1000 a year on a signing service? You can get Authenticode certificates for $180 per year, does that count?
|
# ? Apr 22, 2013 05:57 |
pliable posted:Not at the moment; I'm looking for school help, basically. We're writing an interpreter for a subset of JavaScript using ML, and this initial step is writing the lexer. I have a fair idea of how to implement the lexer, but barely knowing ML/functional paradigms has been kind of a damper . I haven't actually written ML for about 8-9 years, but the basic idea is to represent your input data as a native list structure and use the pattern matching functionality of the language to consume it. Have that produce a list of tokens which you can then pass through another pattern matching function (the parser) which would then produce a syntax tree from it. Then you're free to either execute the syntax tree as-is or to compile it further into some other form. Keep in mind that ML has a very expressive type system, I recall it having subset-types among other things, which would allow you to define the type of "characters which are a letter valid in identifiers" and use that in the patterns matched against the input text stream.
|
|
# ? Apr 22, 2013 09:34 |
I asked this in the Mac programming thread but wasn't sure if this was monitored more often: If this is the wrong thread please point me in the right direction. I don't know the correct terminology so I will use Windows terms to describe my problem... I need to create a .bat type file that continuously pings an IP address of my choice for two hours. After the two hours I need it to save that ping info to a text document and save it to the desktop title "PingResults.txt" or something similar. Is that something that is possible? Easy?
|
|
# ? Apr 22, 2013 23:12 |
|
I don't have access to a Mac, but this works on my Linux machines:code:
quote:Specify a timeout, in seconds, before ping exits regardless of how many packets have been sent or received. In this case ping does not stop after count packet are sent, it waits either for deadline expire or until count probes are answered or for some error notification from network. Assuming that ping has the -w option in Mac OS, save the above code to a file with extension .sh, make it executable in a terminal with chmod 0755 script.sh and you can then run it with ./script.sh or hopefully by double-clicking it in Finder.
|
# ? Apr 23, 2013 00:07 |
Lysidas posted:I don't have access to a Mac, but this works on my Linux machines: Thanks! When I try to compile that it says "Expected end of line, etc. but founder number." and highlights "7200"
|
|
# ? Apr 23, 2013 00:09 |
Lysidas posted:Assuming that ping has the -w option in Mac OS, save the above code to a file with extension .sh, make it executable in a terminal with chmod 0755 script.sh and you can then run it with ./script.sh or hopefully by double-clicking it in Finder. According to the man page it has nothing like that. You can specify -c 720 -i 10 (interval 10 seconds, count 720) but the way I read the page, the count is number of packets received, not sent, meaning it will run indefinitely if the target is down. In fact I can't find anything to limit the run time based on number of sent packets at all. So you will probably have to do something weird like spawning it as a background process, redirecting(maybe tee'ing) the output, sleep in the foreground, then kill the ping process when the sleep finishes. My shell-fu isn't good enough to write something like that though. (It might be more robust to write it not as a single long 2 hour sleep, but maybe cut it into 1 minute segments or so.)
|
|
# ? Apr 23, 2013 00:14 |
Red Robin Hood posted:Thanks! When I try to compile that it says "Expected end of line, etc. but founder number." and highlights "7200" What exactly are you doing? First of all, it's a shell script, it's not supposed to be "compiled". It should be a plain text file, with the execute-permission bit set, which can then be executed in a terminal as-is. If you are double-clicking the file in Finder to open it, what program does it launch that gives you that message?
|
|
# ? Apr 23, 2013 00:16 |
nielsm posted:What exactly are you doing? First of all, it's a shell script, it's not supposed to be "compiled". It should be a plain text file, with the execute-permission bit set, which can then be executed in a terminal as-is. I just opened AppleScript editor and have been working in there.
|
|
# ? Apr 23, 2013 00:19 |
Red Robin Hood posted:I just opened AppleScript editor and have been working in there. Well this is a shell script, not an AppleScript. Shell scripts are run in the terminal, interpreted by the Unix shell, and are completely unrelated to AppleScript. You should be using TextEdit (or another editor capable of plain text file editing) to write them, and if you do use TextEdit, make sure the file is saved as a plain text file and not as a rich text file. But before you do any of that, try out the command in the Terminal. The line starting with the #! sequence is a special header used for shell scripts, which indicates the interpreter used for the script, and you shouldn't enter that one when trying it out like that.
|
|
# ? Apr 23, 2013 00:28 |
nielsm posted:Well this is a shell script, not an AppleScript. Ahhh, thank you for the clarification! So when I run it in a terminal it works as expected but when I try to save the file and I select File Format there is no plain text option. I'll try a few other things. e: figured out how to edit it in plaintext as well as save it in plaintext with .sh but I need to be able to double click it and have it run. e2: I guess I may not have been very clear in my initial request. I need to be able to send this to Mac users and have them just be able to double click, let it run in the background while they work, and send me their results in a .txt file. Red Robin Hood fucked around with this message at 00:38 on Apr 23, 2013 |
|
# ? Apr 23, 2013 00:32 |
|
Red Robin Hood posted:e2: I guess I may not have been very clear in my initial request. I need to be able to send this to Mac users and have them just be able to double click, let it run in the background while they work, and send me their results in a .txt file. Rename your file with the .command extension and it'll run in Terminal on double-click.
|
# ? Apr 23, 2013 00:54 |
|
nielsm posted:According to the man page it has nothing like that. You can specify -c 720 -i 10 (interval 10 seconds, count 720) but the way I read the page, the count is number of packets received, not sent, meaning it will run indefinitely if the target is down. The man page is misleading; the -c flag will send that number of pings, and if there is no response, will wait for them to time out then exit.
|
# ? Apr 23, 2013 01:29 |
|
Red Robin Hood posted:Ahhh, thank you for the clarification! So when I run it in a terminal it works as expected but when I try to save the file and I select File Format there is no plain text option. I'll try a few other things. The flag you want is -t not -w. For OSX Mountain Lion -t is "Specify a timeout, in seconds, before ping exits regardless of how many packets have been received." Apparently this isn't the case on earlier versions because it took them until 10.8 to upgrade their basic BSD system utilities or something.
|
# ? Apr 23, 2013 02:26 |
OnceIWasAnOstrich posted:The flag you want is -t not -w. For OSX Mountain Lion -t is "Specify a timeout, in seconds, before ping exits regardless of how many packets have been received." Apparently this isn't the case on earlier versions because it took them until 10.8 to upgrade their basic BSD system utilities or something. I need this to run on multiple versions of OS X so I guess I will need to make different scripts for different versions? That's very useful information, I really appreciate it!
|
|
# ? Apr 23, 2013 04:05 |
|
Red Robin Hood posted:I need this to run on multiple versions of OS X so I guess I will need to make different scripts for different versions? That's very useful information, I really appreciate it! No need to complicate things with two scripts, you can detect the OS version and use the corresponding flags like this: Bash code:
Modern Pragmatist fucked around with this message at 13:38 on Apr 23, 2013 |
# ? Apr 23, 2013 13:25 |
Modern Pragmatist posted:No need to complicate things with two scripts, you can detect the OS version and use the corresponding flags like this: So I've done this with host 8.8.8.8 and saved it as a .command file but double clicking only opens the terminal it does not execute anything. pokeyman posted:Rename your file with the .command extension and it'll run in Terminal on double-click.
|
|
# ? Apr 23, 2013 16:31 |
|
Red Robin Hood posted:So I've done this with host 8.8.8.8 and saved it as a .command file but double clicking only opens the terminal it does not execute anything. Can you elaborate on "it does not execute anything"? I just copy/pasted it into updog.command and double-clicked it, but I got an annoying dialog box posted:The file “updog.command” could not be executed because you do not have appropriate access privileges. While annoying, you could distribute your .command file in a .zip, and after unzipping it'll run just fine on a double-click.
|
# ? Apr 23, 2013 16:50 |
pokeyman posted:Can you elaborate on "it does not execute anything"? Well this is curious.. I tried renaming it back to a .sh and then back to .command. Normally when I made it .command it changed the icon to blank. This time is kept the "SHELL" icon and when I double-clicked it, it gave me the do not have appropriate access privileges response. How does zipping the file make it work when extracted? The users I will be sending this to are not good with technology so I need this as simple as possible. Unzipping is fine because we will be on the phone to help them with that but they won't know how to open a terminal and chmod +x it. It does execute if extracted from a zip file but it leaves me with: code:
Red Robin Hood fucked around with this message at 17:02 on Apr 23, 2013 |
|
# ? Apr 23, 2013 16:56 |
|
Red Robin Hood posted:Well this is curious.. I tried renaming it back to a .sh and then back to .command. Normally when I made it .command it changed the icon to blank. This time is kept the "SHELL" icon and when I double-clicked it, it gave me the do not have appropriate access privileges response. When you rename files in the finder, sometimes it hides the extension. I have yet to figure out why or when it does that. It's possible you didn't actually rename it to .command For your error, it sounds like you might have the shebang wrong (the first line - #!/bin/bash ) If you need to package it up for end users, something like this might make your life easier: http://sveinbjorn.org/platypus Gounads fucked around with this message at 17:22 on Apr 23, 2013 |
# ? Apr 23, 2013 17:19 |
Gounads posted:When you rename files in the finder, sometimes it hides the extension. I have yet to figure out why or when it does that. It's possible you didn't actually rename it to .command Thanks for the input! I thought that as well but I don't know what else to put. I have: #!/bin/bash code:
|
|
# ? Apr 23, 2013 17:20 |
|
Red Robin Hood posted:Thanks for the input! I thought that as well but I don't know what else to put. I have: Weird. Try doing a which bash that should tell you where it is.
|
# ? Apr 23, 2013 17:27 |
Gounads posted:Weird. The rabbit hole gets deeper: code:
|
|
# ? Apr 23, 2013 17:31 |
|
|
# ? Jun 9, 2024 15:23 |
|
Red Robin Hood posted:The rabbit hole gets deeper: Was that last slash a typo? Here's mine: quote:Marc-MacBook:student-client mhughes$ which bash If it's not a typo, you've got something weird going on.
|
# ? Apr 23, 2013 18:19 |