|
I have a question about masking... Okay, let's say I have a value in hex, "1234" When I want to update that value, I can also choose to apply a mask. In this example I want the new value to be "ABCD" and the mask to be "00FF". So if I use the mask, the new value is "00CD" So, when this is applied to the old value it should be "12CD". I'm struggling with the final part of this process. Can anyone tell me a simple way to do this, using bitwise operators etc?
|
# ? Jul 2, 2009 11:38 |
|
|
# ? May 16, 2024 06:01 |
|
Assume you have old = 0x1234, replacement = 0xabcd, and mask = 0x00ff. We want to create a value, new which consists of: 1) The portion of replacement that matches mask, and 2) The portion of old that matches the complement of mask. Because these portions do not overlap (since, obviously, mask does not overlap its complement) we can combine them with an or. This leads to the operation new = (replacement & mask) | (old & ~mask).
|
# ? Jul 2, 2009 12:11 |
|
I'm working on a simple perl bot that can search a wiki. In order to find an article and not have to worry about the case of the search terms (the articles themselves are case sensitive) I'm using the following: code:
|
# ? Jul 4, 2009 03:01 |
|
clockwork automaton posted:I'm working on a simple perl bot that can search a wiki. In order to find an article and not have to worry about the case of the search terms (the articles themselves are case sensitive) I'm using the following: Check out http://en.wikipedia.org/wiki/Japanime code:
code:
|
# ? Jul 4, 2009 03:12 |
|
quadreb posted:Check out http://en.wikipedia.org/wiki/Japanime Hmm... that makes sense. Thanks!
|
# ? Jul 4, 2009 03:21 |
|
How do RSS readers work? Let's say you have a RSS reader with 100 users, and each user is subscribed to 10 different feeds. Do you need to write a job that polls each one of those feeds at regular intervals to see if they have been updated? I can see doing lazy polling, where you just pull the feed when a user requests it, but if the feed only carries the latest 10 items, then you obviously might miss a lot of information. Lets say you're Google Reader, and you have to manage subscriptions to hundreds of thousands of individual feeds - do you have a scheduled job that goes and pings all of those feeds on a regular interval?
|
# ? Jul 8, 2009 00:29 |
|
You can probably hold a big list of the feeds that your users are subscribed to and then poll those at regular intervals and store them in a cache of some sorts. Only pull it from your cache when the user requests it i.e. lazily. Actually, you don't need to poll feeds that have more than a few subscribers, because requests for popular feeds are done often enough, so you can just cache them when users request them. Also, take advantage of HTTP etags and Last-Modified + If-Modified-Since headers. No need to download what ain't new. hey mom its 420 fucked around with this message at 01:14 on Jul 8, 2009 |
# ? Jul 8, 2009 01:11 |
|
ShoulderDaemon posted:Assume you have old = 0x1234, replacement = 0xabcd, and mask = 0x00ff. We want to create a value, new which consists of: 1) The portion of replacement that matches mask, and 2) The portion of old that matches the complement of mask. Because these portions do not overlap (since, obviously, mask does not overlap its complement) we can combine them with an or. Belated thanks for that, by the way. That's actually where I was, but it was refusing to work due to a terribly stupid array-related error on my part. :~
|
# ? Jul 8, 2009 15:50 |
|
So I'm creating an email, with an unknown number of attachments (determined by client when "building" the email). Parts in the email reference different attachments. Is there any way to place a link in the email that would duplicate the same action as double-clicking the attachment in the standard attachments list? They are using Outlook only, so don't need to worry about it being a standard thing. (as much as I would hate to do it) My first suggestion was to host the files on the web server, and eliminate the attachments altogether, but that isn't a solution they like. The only reason they want this is so people don't have to scroll the list of attachments to find the one referenced, since there may be 10-20 attachments total. Silly, yes, but said I'd look into it.
|
# ? Jul 8, 2009 17:20 |
|
In GUI Outlook (like, I don't know how to do this programmatically) you can put attachments inline, so they aren't in an attachments tray, they're sort of in the body of the message. So if each attachment is only referred to once, you could put the attachments right next to where they are referred to. I think internally that's a multi part MIME message? I have no idea what I'm talking about, just guessing.
|
# ? Jul 8, 2009 17:58 |
|
Triple Tech posted:In GUI Outlook (like, I don't know how to do this programmatically) you can put attachments inline, so they aren't in an attachments tray, they're sort of in the body of the message. So if each attachment is only referred to once, you could put the attachments right next to where they are referred to.
|
# ? Jul 8, 2009 18:12 |
|
cletus42o posted:Do you know the steps you take to do it through the GUI? I couldn't find a way to do that myself. If I can do that, I can probably reverse engineer the email that gets sent to create it programmatically. Thanks! Pretty sure that in Outlook 2007 it's the default behavior when you attach something. But I haven't used Outlook for like a year (thank god*). * Not because Outlook sucks especially bad, but that job did.
|
# ? Jul 8, 2009 18:13 |
|
cletus42o posted:Do you know the steps you take to do it through the GUI? I couldn't find a way to do that myself. If I can do that, I can probably reverse engineer the email that gets sent to create it programmatically. Thanks! I think AD is right. All I have on my system now is 2007 and I can't find any way to bring back a tray of attachments. Like, I'm typing a sentence, I decide to attach something, and it's just sitting there in the middle of my words. Kind of annoying. So I guess nab your hands on a copy of 2007, type some words, insert something, notice how it's right where your cursor is, type more wards, insert again, type more words, and then dissect what gets sent out. And then check how it gets rendered.
|
# ? Jul 8, 2009 18:28 |
|
Weird, I already have Outlook 2007. I'll see if I can figure this mystery out. Thanks!
|
# ? Jul 8, 2009 21:15 |
|
Triple Tech posted:I think AD is right. All I have on my system now is 2007 and I can't find any way to bring back a tray of attachments. In OL2003, enabling HTML email inlines attachments, whereas plain text email forces the tray. This may also be the case in OL2007.
|
# ? Jul 8, 2009 22:09 |
|
kwantam posted:In OL2003, enabling HTML email inlines attachments, whereas plain text email forces the tray. This may also be the case in OL2007.
|
# ? Jul 8, 2009 22:19 |
|
Yeah I'm sorry I totally lied. I have 2003 in the office, but I have 2007 at home. I can check when I get back home.
|
# ? Jul 8, 2009 22:30 |
|
cletus42o posted:I wish I knew what the hell you guys were doing! Try "Rich Text".
|
# ? Jul 8, 2009 22:34 |
|
Avenging Dentist posted:Try "Rich Text".
|
# ? Jul 9, 2009 00:14 |
|
Avenging Dentist posted:Try "Rich Text". D'oh, you're right. Oh well, I knew it was one of those format options I always turn off; guess I misremembered which.
|
# ? Jul 9, 2009 07:15 |
|
e:blrrp
Metonymy fucked around with this message at 03:47 on May 25, 2011 |
# ? Jul 9, 2009 21:32 |
|
I'm so lost. I wrote some php that I need to work on my webserver for a form mailer. PHP is not installed. How on earth do I do this? I can not find a single link anywhere on the internet that will explain this in simple terms.
|
# ? Jul 10, 2009 03:00 |
|
SpoonsForThought posted:I can not find a single link anywhere on the internet that will explain this in simple terms. That is because, unless you are an admin, you cannot install PHP (or anything really).
|
# ? Jul 10, 2009 03:01 |
|
I've been bugging up up some of the threads here with my noobie questions and I know someone must be annoyed with me but here is my problem. I usually only work with css/html, which are very, very simple. I just upload them to the server and they work. Well here is my problem completely fleshed out. I created a form on one of my pages. This form is a request information page. I want this form to be e-mailed to a specific e-mail address upon submitting without opening up the user's mail program, because frankly that is annoying. To the best of my knowledge, HTML can not do this. I looked around and modified (with a lot of help from the php/web dev megathread) a php page that should do this. Correct? I had access to a web server through school, and once I uploaded the php page, it did not work and we(megathread guys) kind of came to the conclusion that this must be because some features of php were disabled that did not let this e-mailing work. I have access now to the server that this page should be going on (other space was just temp) and it still does not work. It is being hosted by Nuvox, which says they support PHP, yet whenever I try to access a php page, my browser acts as if it is a download. There is my problem. I might have been over-thinking this by a mile, maybe there is an easier way to do this, I don't know and would really, really love some help. **UPDATE*** In my investigation of the server, it appears that the host has not updated it in nearly a decade, which means no PHP support. I did however work an ASP alternative. Thanks for all the guys that helped with my php problem. SpoonsForThought fucked around with this message at 04:29 on Jul 10, 2009 |
# ? Jul 10, 2009 03:23 |
|
I'm not sure where else to put this, so I'll just ask here and hope for the best. If someone knows a more specific place to ask, please let me know. My question is about an Access 2007 form. Access 2007 added (I think) the ability to have forms with multiple items. I've created a form to review all the orders made in a product database, and each record has a button to record the arrival of an order: When the button is clicked, it sets Date Arrived to the current date and sets an invisible flag called IsArrived to true and runs an SQL UPDATE to add the amount ordered to the total amount in another table. What I'd like to do is have the button be disabled on only those records where IsArrived = true. Right now, I've only figured out how to do it for the whole form. What do I need to do? Here's the code I have so far: code:
|
# ? Jul 10, 2009 15:45 |
|
SpoonsForThought posted:I've been bugging up up some of the threads here with my noobie questions and I know someone must be annoyed with me but here is my problem. I usually only work with css/html, which are very, very simple. I just upload them to the server and they work. Well here is my problem completely fleshed out. Make a simple webserver on some computer with constant IP and process all POST requests coming to it from a certain URI, then do whatever your heart desires with it
|
# ? Jul 11, 2009 22:46 |
|
Any verilog people in here? I'm trying to get the sum of bits in a parameterizable-width register. So I have something along the lines of code:
|
# ? Jul 16, 2009 19:50 |
|
Management had me hobble together a scheduled task that runs overnight on systems to generate a log so we can keep track of those who aren't turning things off at night. Basically there is a network share and the each system appends to a text file bearing the system name in that share adding a line "%date% %time% %status%" (where status is the username if logged on or simply 'loggedoff' if there is no console session). Output ends up looking like this:code:
Looks like this: code:
|
# ? Jul 16, 2009 20:46 |
|
Zenaida posted:It'd be easy if there was a unary reductive sum, like the reductive boolean operations, but of course there's not. I feel like there must be some way to do this though, maybe using generate or for loops or some combination of the two... OK, first of all, if you mean the sum then presumably sumval has to be 4 bits wide, yeah? Now forget about code and think about how it will actually be implemented in hardware. The simplest way is to make a ripple-ish adder with increasing bit width, e.g. (for three bits, and bear with the pseudo code please), code:
But of course this is ugly as hell, and you have to manually compute at each stage the bit width necessary on input and output. How about we make a tree: code:
(Actually, you can optimize this tree a little bit more by summing every three bits of the input register since 1+1+1=2'b11, but after that you're stuck "wasting" a little bit of adder width at each stage.) In some cases you can cheat: do you have a bounded range of parameters? You can generate the largest possible bit-add tree and map your register into one as large as the largest input. The useless parts of it (adding a bunch of zeros together) will be optimized away when you synthesize it. Otherwise, if you're stuck using generate, you can make an appropriately sized tree by adding together pairs or triplets, then pairing outputs of your adders and adding again, et cetera. Unfortunately, generate's syntax is kind of lovely and I avoid it because it's not always supported; usually when I have to do parametrized stuff that's even remotely complex I'll generate verilog with perl. It's quite convenient to have a Makefile wrapping your project in this case (well, in all cases). A much simpler alternative for doing this for an arbitrary register width is to make a state machine that shifts bits out of the register and produces a sum, but it seems like you wanted static logic, so that won't work very well. kwantam fucked around with this message at 20:49 on Jul 16, 2009 |
# ? Jul 16, 2009 20:47 |
|
BangersInMyKnickers posted:Management had me hobble together a scheduled task that runs overnight on systems to generate a log so we can keep track of those who aren't turning things off at night. Basically there is a network share and the each system appends to a text file bearing the system name in that share adding a line "%date% %time% %status%" (where status is the username if logged on or simply 'loggedoff' if there is no console session). Output ends up looking like this: http://www.robvanderwoude.com/ntfortokens.php
|
# ? Jul 16, 2009 23:28 |
|
Jethro posted:Give For /F a shot in conjunction with FINDSTR. Great! I've only used for loops for increment counting and recursive list execution, you finally got me to sit down and figure out the delimiter functionality and this works perfectly.
|
# ? Jul 17, 2009 15:09 |
|
I have a 2D plane with ellipses that may or may not be drawn at an angle. I know the angle and axis lengths of all of the ellipses. How would I go about placing an object (say a dot) every x units in the entire area of a particular ellipse? I'm not good with this math so I have no clue where to start as far as the equations go. Any language will do as I'll just study it and then convert it into the language I'm writing for. In other words: I have an ellipse centered at [5,10], Angle: 30degrees, Axis-a: 100, Axis-b: 200. I want to place an object every 5 spaces in every direction within the ellipse. How do I get all of those positions using some mathematical equation that I could loop through?
|
# ? Jul 17, 2009 21:43 |
|
First, find the position of the foci of the ellipse. They both lie along the major axis, and their distance from the center is given by the equation F = sqrt(a^2 - b^2), where a and b are the major and minor radii. If you know some simple trig, that should be enough information to find the foci's exact position. Now that you have the foci F1 and F2, you can test whether a given point X is inside or outside the ellipse. Take the distance of X to F1, and add the distance of X to F2. If that number is larger than the major diameter, the point lies outside the ellipse. If it's smaller, it lies inside the ellipse. So, get a set of points that are in the ballpark around the ellipse (say, all the points inside a rectangle that goes around the ellipse), and do the above test to see which ones are inside the ellipse.
|
# ? Jul 18, 2009 00:37 |
|
im dum
dougdrums fucked around with this message at 17:57 on Jul 18, 2009 |
# ? Jul 18, 2009 17:39 |
|
Can someone who understands javascript closures explain why this spits out 10 in rhino instead of 8?code:
|
# ? Jul 21, 2009 07:39 |
|
Contero posted:Can someone who understands javascript closures explain why this spits out 10 in rhino instead of 8? x is a variable, not a value. The closure captures its parent's scope, so its x is the same as the parent's x. The parent sets x to 10 before the closure is ever called, so the closure will always return 10. If you want to capture the value, you have to declare a new variable for it: code:
|
# ? Jul 21, 2009 07:52 |
|
ShoulderDaemon posted:Note that the scope of y is limited to a single iteration of the for loop. No, the scope of y is limited to the whole function, but you're rebinding it at every step of the loop.
|
# ? Jul 21, 2009 17:28 |
|
I'm trying to resurrect an old VB6 application that needs a bugfix. I can run it fine in the IDE, but VB6.exe crashes with a page fault when I try to compile an EXE. Has anyone run into this before and found a fix or a way to get more information on what is going wrong? Alternatively, has anyone successfully converted a VB6 app to VB Express? How much work is involved?
|
# ? Jul 21, 2009 17:28 |
|
Avenging Dentist posted:No, the scope of y is limited to the whole function, but you're rebinding it at every step of the loop. Yeah, you're right. Javascript has crazy scoping. In this case, at least, the distinction doesn't really matter.
|
# ? Jul 21, 2009 18:28 |
|
|
# ? May 16, 2024 06:01 |
|
ShoulderDaemon posted:Yeah, you're right. Javascript has crazy scoping. In this case, at least, the distinction doesn't really matter. It matters if you want to return more than one closure. code:
|
# ? Jul 21, 2009 18:54 |