|
the littlest prince posted:Taking them concurrently would certainly be fine, it's terribly easy to be frank, and you could probably even just skip it altogether and pick it up during algorithms. But in the long term it's probably worth the time to take it. This. You may need to occasionally look ahead in the discrete math book, but you should be fine as long as you put the work in.
|
# ? Oct 25, 2012 18:59 |
|
|
# ? May 30, 2024 02:56 |
|
Discrete Math is a very broad category of topics and in practice the class is often basically Remedial Everything since a quarter simply isn't enough time to go into depth in any of them. There's a good chance you already know half of the things that the class will cover, but it won't be the same half as any of the other students.
|
# ? Oct 25, 2012 19:33 |
|
Does sed not support {M,N} format in a regular expression? I am trying to get the first 30 characters in between curly braces. so far I have this in sed: 's/{\(.{0,30}\).*}/\1/' But it doesn't seem to understand {0,30} there as getting up to 30 characters. If I replace that with thirty dots it works fine. Am I missing some flag in sed that allows this? Is there a better way to handle this?
|
# ? Oct 25, 2012 20:34 |
|
Strong Sauce posted:Does sed not support {M,N} format in a regular expression? It's not really clear from man re_format whether bounds are basic or extended/modern RE syntax. Did you try with sed -E for extended?
|
# ? Oct 25, 2012 21:00 |
|
Carthag posted:It's not really clear from man re_format whether bounds are basic or extended/modern RE syntax. Did you try with sed -E for extended? quote:Regular expressions ("RE"s), as defined in POSIX.2, come in two forms: modern REs (roughly those of egrep; POSIX.2 calls these "extended" REs) and obsolete REs (roughly those of ed(1); POSIX.2 "basic" REs). Obsolete REs mostly exist for backward compatibility in some old programs; they will be discussed at the end. It's definitely an ERE feature. Use sed -E.
|
# ? Oct 25, 2012 21:24 |
|
Yes, sed -E worked. Thanks Carthag/ToxicFrog!
|
# ? Oct 25, 2012 22:07 |
|
Rocko Bonaparte posted:This is half a programming question but mostly a hardware question, but I figured somebody has done this before. Has anybody ever tried to poll or be asynchronously notified of a wire signal change for something connected to a PC? We test some stuff here and in some scenarios the best we can get for notification are strobing some signal pins. It's very easy to poll the serial port (if you actually have it ). Depending on frequencies you may be fine with standard Windows API for it (no idea if you're on Linux). If you need really tight timings you'd probably want a custom driver (I've done that before), but normally just iocontrol calls should be fine.
|
# ? Oct 26, 2012 00:46 |
|
OK, Visual Studio and remote debugging. I need to debug my software in a VM environment. VM is Server 2008 R2 x64. It's a domain controller and has a lot of poo poo on it that my app integrates with. Host is Win7 x64 pro (no domain). Is it possible at all to do remote debugging in such setup? I've done remote debugging many times but never on a DC. This page states that: MSDN posted:With these restrictions, remote debugging works in various scenarios, including the following: How I've done it before: on a VM create a user identical to my host one. Launch msvsmon as that user on the VM. poo poo works. But here there are problems:
Any suggestions?
|
# ? Oct 26, 2012 18:24 |
|
Hot Yellow KoolAid posted:
You'll be fine. Unless the class also requires statistics, it is likely that the only math that you are going to do is asymptotic analysis.
|
# ? Oct 27, 2012 00:28 |
|
omeg posted:OK, Visual Studio and remote debugging. Join your machine to the domain? As long as you have a valid Kerberos ticket (mapping a network drive will do it) you'll be able to access the remote debugger.
|
# ? Oct 27, 2012 04:00 |
|
I may have to screen scrape every page of a website to port the content to another platform. This is for a weekend-long charity hackathon thing. Does anyone have an easy, out of the box solution for this? A free bot or something?
|
# ? Oct 27, 2012 05:07 |
|
I've seen a number of people recommend Beautiful Soup for doing that sort of thing, though I don't think it's just a bot
|
# ? Oct 27, 2012 07:45 |
|
scrapy
|
# ? Oct 27, 2012 14:58 |
|
Hello all, I have a small question and I wonder if anyone can help me with it. Before I start, if it turns out this is the wrong thread to ask in, please accept my apologies! Ok, so I have a music collection that is encoded partly as MP3 and partly as FLAC. Now, say for example I wanted to write a batch file that would go through all the folders of my collection, find the FLAC files and replace them (deleting the FLAC files as is went) with AIFF files instead. Is this possible? I'm running Windows 7, but have some experience using the command line, so I'm not afraid to get stuck in. I'm not coming into this thread asking someone to write this for me, far from it. Rather, if it is possible, if someone could give me a few hints/pointers so I could learn how to do it for myself I'd be really grateful. Thank you in advance for your time!
|
# ? Oct 27, 2012 15:02 |
|
Do you want to convert them, or do you already have a bunch of AIFF files already made? And why would you convert from a compressed lossless format to an uncompressed lossless format?
|
# ? Oct 27, 2012 15:08 |
|
Suspicious Dish posted:Do you want to convert them, or do you already have a bunch of AIFF files already made? And why would you convert from a compressed lossless format to an uncompressed lossless format? Yes, I'd like to convert them from FLAC to AIFF. I'm changing portable MP3 player from one that supports FLAC to one that doesn't. I know I could do it all by hand by feeding the files into FormatFactory, but I though there must be an easier way of doing it.
|
# ? Oct 27, 2012 17:03 |
I'm pretty sure you can do it in a couple of steps with foobar2000 and some clever media library filtering: 1. Create a playlist with all the FLAC files (e.g. using the search expression %codec% IS FLAC). 2. Use the Convert plugin to transcode to the target format, it should be possible to tell it to output each file to the input file's folder. 3. Use the File Operations plugin to move or delete the FLAC files.
|
|
# ? Oct 27, 2012 17:09 |
|
I'm trying to get better at unit testing. How do I test a function that has results that vary depending upon which machine it's running on? In this specific instance I'm using Python and searching the system for history files for a few different common browsers. The function returns objects representing the contents of those files. I mean, I know of ways to test that, but...should the test return actual results from the system its running on, or should I somehow have fake ideal results, or what?
|
# ? Oct 27, 2012 20:45 |
Fake the system, aka. make a mock. Write something with the same interface as what you use to search the filesystem, and make it enumerate a fake filesystem, probably fed in as a list of filenames with paths. Then you can prepare a bunch of different test systems and be sure you get consistent results every time. (The point of your test is to check whether the history-file-searching function works, not whether the filesystem works, so don't make the filesystem part of the test.) The Python 3.3 standard library includes a unittest.mock package, for other versions (including 2.7) you'll have to use a third party one.
|
|
# ? Oct 27, 2012 20:57 |
|
Hope this is the right place for this question: I have a wiki that's got a ton of content hosted externally, on a former partner's server. That partner is now repurposing the server for other things, and I won't have access to the hosting. I have all the files, and have uploaded them to my own server. What is the quickest way, whether through MySQL or some other mechanism, to mass-rewrite all the references to his server, back to mine? External files might be linked as http://www.oldserver.com/files/investigation.pdf When they need to be all rewritten to http://www.ourcrap.com /files/investigation1.pdf Any ideas? I don't know much beyond absolute basic PHP, and of course HTML/CSS.
|
# ? Oct 28, 2012 17:21 |
|
Are they all in a specific folder, like files/? You can use an Apache configuration to redirect that folder over to your new server.
|
# ? Oct 28, 2012 17:47 |
|
Suspicious Dish posted:Are they all in a specific folder, like files/? You can use an Apache configuration to redirect that folder over to your new server. They've been rehosted on the same server, in a similar directory structure. ex: files/bob/1.pdf , files/steve/1.pdf I didn't think you could use .htaccess for outbound links.
|
# ? Oct 28, 2012 18:07 |
Suspicious Dish posted:Are they all in a specific folder, like files/? You can use an Apache configuration to redirect that folder over to your new server. As far as I understand, they're completely losing control of that server, and presumably also domain name, so the URLs have to change in the wiki. Assuming there is only one or very few unique prefixes to the URLs that need to change, and nothing with those prefixes should stay, it's pretty simple to write an SQL UPDATE command to search/replace them. As an example: UPDATE table SET field=REPLACE(field,'http://www.oldserver.com/files/','http://www.newserver.com/files/moved/'); That will just replace all instances of the oldserver URL to a somewhat different newserver URL, in a particular field in a particular table. You need to identify which table(s) and field(s) the URLs can occur in first, so you operate on the right ones. Note that the field name occurs twice, and you need to change both occurrences to the right name. If there's multiple old URLs that need replacing, write an update for each of them. If there's multiple tables/fields with the URLs in, run the query on all of them. Make a backup of the database before you run something like this, in case anything goes wrong.
|
|
# ? Oct 28, 2012 18:11 |
|
nielsm posted:As an example: That might be exactly what we need. Thanks. It's just external links in articles so, although not a perfect solution from a HTML purists' perspective, swapping out the domain name will fix all our problems (especially since the guy's joked about replacing the files with goatse as a means of encouraging us to get this done sooner).
|
# ? Oct 28, 2012 18:20 |
|
You guys rule, this worked great. Unrelated question, and I imagine there's some Apache wizardry necessary to make this work: If I have a cms script running on domain1.com/stuff/cms.php Is it possible/how can I present the output on domain2.com/cms.php? Both are hosted on the same physical machines (DB and file servers), and I figured it wouldn't be really hard to do.
|
# ? Oct 28, 2012 20:48 |
Make the Apache Vhost for domain2 have the stuff/ directory as its document root?
|
|
# ? Oct 28, 2012 20:58 |
|
nielsm posted:Make the Apache Vhost for domain2 have the stuff/ directory as its document root? What has two thumbs and apparently needs to spend a few weeks learning LAMP? (This guy) Thanks again.
|
# ? Oct 28, 2012 21:06 |
|
I resolved my cross-domain remote debugging problem. On the host machine I created the same Administrator user as it exists on the VM. Visual Studio running as that user can now correctly attach to remote processes on the VM even if the host isn't on the VM's domain. Slightly annoying that I lost my VS customization because it's run by another user, but I can live with that.
|
# ? Oct 29, 2012 10:40 |
|
Are there any databases best suited for dealing with linked data such as social networking maps? I'm going to be starting a personal project where I need to be able store and hopefully work with the data efficiently. Data would something like this: If it was merely the names linking to each other it would be fine, but the link between two objects has a weight to it as well and that needs to be recorded. I thought I might be able to run 2 tables in an SQLite database one for the people and their data. Then another for the links. But it seems like there would be better ways of doing this.
|
# ? Oct 29, 2012 12:14 |
|
Sounds like you want a http://en.wikipedia.org/wiki/Graph_database
|
# ? Oct 29, 2012 12:25 |
|
Carthag posted:Sounds like you want a http://en.wikipedia.org/wiki/Graph_database
|
# ? Oct 29, 2012 13:45 |
|
I've been doing some searching with zero luck... Are there any prototyping kits or anything out there for eInk displays of a decent size -- no numeral-only strips or tiny 1x3 strips or anything. Cost isn't really an issue. I mean, I've seen news about display advances for years, but I've never actually seen a kit or a hack or anything other than people doing things to a Kindle rather than with standalone displays.
|
# ? Oct 29, 2012 14:57 |
|
This is a weird question so I hope I can phrase it right. Ideally this would be in Python. I want to mess around with making a simulation. I want this simulation to be able to run and provide feedback in real time (or according to some time multiplier of my choosing). So say I want to model a tree's height and I have a program that calculates the trees height based on the growth rate. How do I add a tick rate into a program? I know game libraries often include these to limit the framerate and that is essentially what I need for command line output or something similar. This is because I imagine trying to calculate the time billions of times a second will add in all kinds of crazy errors. So say I wanted my program my loop to at most calculate something 100 times a second. What is the ideal way to do this ? I'm working with Python but a pseudo code/concept answer is probably what I need.
|
# ? Oct 30, 2012 17:22 |
|
Sylink posted:This is because I imagine trying to calculate the time billions of times a second will add in all kinds of crazy errors. You imagine wrong. Why?
|
# ? Oct 30, 2012 17:48 |
|
I think billions per second is a bit optimistic.
|
# ? Oct 30, 2012 17:50 |
|
Sylink posted:This is because I imagine trying to calculate the time billions of times a second will add in all kinds of crazy errors. What kind of crazy errors are you imagining?
|
# ? Oct 30, 2012 18:08 |
|
Would I not get floating point errors or something if I try to just calculate everything based on a dt recorded for each loop?
|
# ? Oct 30, 2012 18:12 |
|
taqueso posted:I think billions per second is a bit optimistic. I'd kill to get my render loop down to a few instructions.
|
# ? Oct 30, 2012 18:12 |
|
Sylink posted:Would I not get floating point errors or something if I try to just calculate everything based on a dt recorded for each loop? 1) what sort of floating point exceptions do you think you are going to encounter here? Subnormals don't raise anything, they're just slow as a turd. 2) How do you think you're going to get cycle-accurate timing information in the first place? Are you familiar with the time-related syscalls on your system and the limitations of rdtsc and friends?
|
# ? Oct 30, 2012 18:27 |
|
|
# ? May 30, 2024 02:56 |
|
Dear god please use the syscalls
|
# ? Oct 30, 2012 18:42 |