Wikipedia:Reference desk/Archives/Computing/2010 May 16

Computing desk
< May 15 << Apr | May | Jun >> May 17 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


May 16

edit

Readers/Writers problem in concurrent programming solution using busy wait?

edit

Hi. Does anyone know a solution to the readers-writers problem in concurrent programming using only busy wait? Belchman (talk) 00:03, 16 May 2010 (UTC)[reply]

You can implement a mutex without special CPU or OS support with the algorithms listed at Mutual exclusion#Software solutions. With mutexes and busy waiting you can implement semaphores, and with mutexes and semaphores you can implement the reader-writer protocol shown in that article. Is that the sort of answer you're looking for? -- BenRG (talk) 19:37, 16 May 2010 (UTC)[reply]

Help with a Programming Logic in MS-Access-Visual Basic

edit

I have a database with the following structure IDNO - Text(7), From Date - Date, To Data - Date, Year - Number, Full_Part - Logical.

what i want the program to give me the result is that i need to take out the missing date ranges for each IDNO for each particular year. ie.. i need to take out the year wise gaps for records. also, if the entire year is missing then the gap will be the entire year with the full_part field in the result showing F. so say.. in this example.. i need the program to return the result for

IDNO	 From Date	To Date	Year	FULL_PART

A247108 01-Apr-02 30-Sep-02 2002 P 
and 
A247111 01-Jul-99 30-Sep-99 1999 P
A247111 01-Jan-00 31-Mar-00 1999 P (year is 1999 because it falls in the 1999-2000 financial year)

A sample database is appended below :-

IDNO	 From Date	To Date	Year	FULL_PART
A247108	01-Apr-99	31-Mar-00	1999	F
A247108	01-Apr-00	31-Mar-01	2000	F
A247108	01-Apr-01	31-Mar-02	2001	F
A247108	01-Oct-02	31-Mar-03	2002	F
A247108	01-Apr-03	31-Mar-04	2003	F
A247111	01-Apr-00	31-Mar-01	2000	F
A247111	01-Apr-01	31-Mar-02	2001	F
A247111	01-Apr-02	31-Mar-03	2002	F
A247111	01-Apr-03	31-Mar-04	2003	F
A247111	01-Apr-99	30-Jun-99	1999	P
A247111	01-Oct-99	31-Dec-99	1999	P
A247124	01-Apr-99	31-Mar-00	1999	F
A247124	01-Apr-00	31-Mar-01	2000	F
A247124	01-Apr-01	31-Mar-02	2001	F
A247124	01-Apr-02	31-Mar-03	2002	F  

—Preceding unsigned comment added by Prasanth.moothedath (talkcontribs) 03:26, 16 May 2010 (UTC)[reply]

Formatted to make it legible. --Phil Holmes (talk) 10:44, 16 May 2010 (UTC)[reply]
I'd like to help, but I am having trouble figuring out what it is you want the program to do. Can you write it out as a series of steps? E.g., get data from row, look at this column, subtract it from this column, if the date is greater than a year, change this value to this, or something along those lines. --Mr.98 (talk) 14:14, 16 May 2010 (UTC)[reply]

--122.162.136.184 (talk) 14:56, 16 May 2010 (UTC) --talk ---[reply]

Oh Yeah sure.. i basically want the database to search for every occurance of an ID NO, to evaluate the gaps in date it has for each financial year. the program logic will be something like this only.. ie.. for every IDNO, take out the first available To_Date, add one to it and search the subset for an occurance.. if exists, ignore and move to the next. if doesnot exist, then.. put that date value in another new recorset as the start of a gap. the same thing has to be done for finding the end of the gap by subtracting 1 from the From_date of each value.


I would be grateful if you could code this logic in Visual Basic wiht a basic MS-Access database file.. —Preceding unsigned comment added by 122.162.136.184 (talk) 14:52, 16 May 2010 (UTC)[reply]

OK, I think this is doable—I should be able to find the time for it tomorrow or so. It shouldn't be too hard, I just have to look up how to handle Date/Time functions in Access VBA. --Mr.98 (talk) 18:45, 16 May 2010 (UTC)[reply]

--talk ---

Thanks a lot for your time and effort.. you can either paste the code here.. or sent it to me at (email removed)


—Preceding unsigned comment added by Prasanth.moothedath (talkcontribs) 01:22, 17 May 2010 (UTC)[reply]

I removed the OP's email per our guidelines and to reduce spam. The solution seems to be summarized into the following steps: (1) Get all the lines that share a single ID. (2) Parse the start- and end-dates for all these lines. (3) Sort these from earliest to most recent. (4) Analyze sequentially whether there are any gaps. Which of these steps do you need help with? Nimur (talk) 09:56, 17 May 2010 (UTC)[reply]
This should basically show you the logical structure of what you want to do, I think? Let me know if you have any questions. I have commented everything so it should be pretty clear what is going on.
VBA function
Public Sub searchGaps()

'declare our recordset. Note that this requires DAO.
'if you get an error on this line, go to Tools -> References, and make sure Microsoft DAO Object Library is checked.)
Dim rst As DAO.Recordset

'declare our other variables:
Dim curIDNO As String, lastToDate As Date, curFromDate As Date

'open up our recordset. making sure things are ORDERed correctly is important:
Set rst = CurrentDb.OpenRecordset("SELECT * FROM Table1 ORDER BY IDNO, [From Date]")

While Not rst.EOF 'while/wend loop until end of recordset
    If rst("IDNO") <> curIDNO Then 'are we dealing with a new IDNO or not?
        curIDNO = rst("IDNO") 'if so, then set that up as the new current
        lastToDate = rst("To Date") 'set up the most recent to date
    Else 'if not, evaluate gap between last date
        daysDifferent = DateDiff("d", lastToDate, rst("From Date"))
        If (daysDifferent) > 1 Then
            'there's a gap of more than one day!
            'could output this data to a new recordset if you wanted
            'just printing info to the Immediate window for the moment
            Debug.Print rst("IDNO"), lastToDate, rst("From Date"), daysDifferent & " day gap"
        Else
            'there is no gap! do nothing?
        End If
        lastToDate = rst("To Date") 'reset the last "two date"
    End If
    rst.MoveNext 'go to next record
Wend
rst.Close 'close recordset

Set rst = Nothing 'remove recordset from memory
End Sub
Hope that helps! (Also, I didn't know what your main table was called, so I just called it Table1 in my code. Replace it with whatever the table is named.) --Mr.98 (talk) 13:24, 17 May 2010 (UTC)[reply]

--talk --- Thanks Mr.98. ya it was helpful.

--Prasanth Menon 00:28, 18 May 2010 (UTC) —Preceding unsigned comment added by Prasanth.moothedath (talkcontribs)


122.161.210.137 (talk) 08:51, 20 May 2010 (UTC) Mr.98, well.. i tried executing the algo that you had given me.. but it is not giving me the required result.[reply]

buying songs intercontinentally

edit

At amazon.com I can buy a certain album but I can't pay to download an individual song from it. So I went to amazon.de and found the song I wanted for 99 (European) cents. I tried to buy it and got a notice that said that since my billing address is in the USA, I couldn't.

Same thing with iTunes.

Is there some way around this? Michael Hardy (talk) 03:42, 16 May 2010 (UTC)[reply]

I think it is a lot to do with preserving any the price differential in different territories. IIRC, when iTunes was first launched, tracks were US$0.99. When it launched here in the UK, tracks were initially £0.99 which at the time was considerably more than the US pricing. Even when the price fell to £0.79 it was still more than the US price (see here for more). UK customers complained about the higher prices and tried to buy from the US site but found they couldn't because they needed to use a US credit card to buy a download from the US site.
I can't say if it is the same with Amazon, but I have had no problems buying CDs (and DVDs, books, and other things) from Amazon.com using my UK credit card and had them shipped to me here in the UK.
A way round your problem? I doubt you would be able to open a foreign bank account without an address in that country. If you don't have a friend in Germany, you might be able to find a company who can buy on your behalf. I have heard of such companies, but only to allow people to buy from US suppliers who won't ship to non-US addresses, and not the other way round or with downloads. Astronaut (talk) 09:23, 16 May 2010 (UTC)[reply]
I have had similar problems before but with software. If you do not need the product to be physically delivered (such as being download-able), you may change the billing / shipping address for your credit-card to the appropriate country. For me, this is doable via online banking for my credit card without any checks. It may help to actually use an address of a friend or family there because a billing statement will be sent there. But you may not need the physical bill if you can pay online. Do not forget to change the address back after you are done. Very inconvenient, but I can tell you from experience, your options are very limited. 124.214.131.55 (talk) —Preceding undated comment added 10:02, 16 May 2010 (UTC).[reply]

Difference between Office 2000 and Office 2010

edit

Can someone tell me what is the difference between Office 2000 and Office 2010 for a grandmother who uses excel to do budgeting for organizing food and drinks for a party for 40-50 people. 122.107.207.98 (talk) 12:04, 16 May 2010 (UTC)[reply]

Office is a software package from Microsoft that contains the word processor Word, the spreadsheet Excel, the presentation software PowerPoint and a few other applications. Excel 2000 looks like this, whereas Excel 2010 looks more like this. If you want a more detailed description of the new features, have a look at Microsoft Office, or, in particular, Microsoft Excel. Personally I mostly use Microsoft Word, and one feature of Word 2007 and 2010, that is not available in Word 2000, is the new (mathematical) formula editor, which is great (although very buggy, at least in Word 2007). --Andreas Rejbrand (talk) 14:13, 16 May 2010 (UTC)[reply]
In terms of function, not a whole lot has changed. Excel still does everything you are used to it doing. What has changed is how the user interface is organized. In Excel 2000, you are used to having the menus "File - Edit - View - Insert - Format - Tools - Data - Windows - Help" across the top; most of the commonly used functions are located in one of the menus and duplicated in the icon bank directly below. Microsoft has completely changed the user interface to a "Ribbon" style beginning with Excel 2007 and continuing with Excel 2010. Here is what Excel 2010 looks like in its default state. The menus have been reorganized -- to "File - Home - Insert - Page Layout - Formulas - Data - Review - View" -- in an attempt to make functions easier to find by including them in more logical groupings. The main difference between 2000 and 2010 is that (besides the File menu, which contains most of the same functions) you will probably have to re-learn where some of your most commonly used functions are located; also, because of the re-arrangement, the procedure to do almost anything useful has changed at least a little bit.If you are happy and comfortable with Excel 2000 there is no reason to upgrade, as it continues to work fine with Windows 7. Xenon54 (talk) 14:25, 16 May 2010 (UTC)[reply]
A continual push to prevent users from using the keyboard. ARGGGGGHHHH! 14:27, 16 May 2010 (UTC) —Preceding unsigned comment added by Svanslyck (talkcontribs)
Actually keyboard navigation using the ribbon is quite good (at least in 2007, which is what I have) If you tap the alt key single character keybindings pop up over the ribbon elements - you press one key to choose which ribbon bar you want and then another key to choose the particular command. See http://office.microsoft.com/en-us/help/HA100919081033.aspx .131.111.185.69 (talk) 15:59, 16 May 2010 (UTC)[reply]
What about CTRL-SHIFT-8, ALT-O-D, CTRL-D, ALT-T-E-E, and so on . . . all the keyboard shortcuts I use hundreds of times a week and which don't work in Office 2007 or (I presume) later versions? kcylsnavS{screechharrass} 16:10, 16 May 2010 (UTC)[reply]
That's an issue of having to learn stuff again because of the UI change however. It doesn't demonstrate the new UI is inherently more keyboard unfriendly or that MS is trying to prevent you from using the keuboard as you appear to suggest. From the evidence at hand, it could be the new UI is even better for keyboard use then the old one if you're starting afresh, which is what Microsoft believes about the new UI in general AFAIK. Nil Einne (talk) 17:05, 16 May 2010 (UTC)[reply]
This isn't the place for this discussion so I'll shut up after this: it wasn't broke; they didn't need to "fix" it. kcylsnavS{screechharrass} 17:09, 16 May 2010 (UTC)[reply]
If you miss the old interface, try Office Classic Menus. I use it and it helps me quite a lot, since I was also trained to use the old interface. I took a class in college in Office XP and then graduated in 2006. I considered myself a wizard in Office by that time. But right after I graduated, they released Office 2007, and I was back at square one.--Best Dog Ever (talk) 17:15, 16 May 2010 (UTC)[reply]
IIRC, Microsoft did research and found the new ribbon interface was significantly easy to learn (or use?) for new users. So in that sense, it was broken and it made sense to fix it. This is obviously annoying for users familiar with the existing interface (I don't think anyone even Microsoft ever denied that the new interface would require some relearning from users familiar with the old) and no one can say whether the change was worth it in a general sense (and that surely isn't the place for such arguments), but the idea 'it wasn't broken' is extremely simplistic at best. As I said earlier, this could easily be the case for keyboard use too. Plenty of people have never used Office before and plenty of people may have but may not be very good at using the keyboard to navigate the UI and execute command. If the new interface makes it significantly easier for new users to use the keyboard, then it's highly questionable whether it can be said Microsoft is trying to prevent people from using the keyboard as you originally alleged. Just because it made it harder for you, Svanslyck to use the keyboard, doesn't mean it was an inherently bad move (for the record it made it harder for me to use too, although not primarily for keyboard navigation reason). The world moves forward, things change, sometimes in ways we like, some ways in ways we don't, just because we don't like them, doesn't mean that they were inherently wrong or shouldn't have been done. Note that I'm not saying I agree that MS made the right decision, simply that it's ultimately impossible to say whether they made a right want (well if their business had completely collapsed then it was a bad move from a business sense) so this really isn't the place to discuss it or suggest they made a wrong one, there are plenty of reasons to 'fix something' even if you don't think it's broken and nothing presented here demonstrates that their decision had a negative impact on keyboard use. If you don't like the new interface, that's up to you, it isn't necessary to try and argue that MS made an inherently bad decision. Nil Einne (talk) 23:31, 18 May 2010 (UTC)[reply]
There are so many differences that I'm not going to even try to list them here. It's not just the interface that is different. There are new file formats, better typography and charts, and so on. After Office 2000 came Office XP (in 2002), then Office 2003, then Office 2007, and then Office 2010. All of these (except arguably Office 2003) introduced significant new features. So, you'd first read about the new features in Office XP, here, then Office 2007: [1], [2], [3], and then Office 2010: [4].--Best Dog Ever (talk) 17:11, 16 May 2010 (UTC)[reply]
Office Classic Menus - I'm a-thankin' ya! kcylsnavS{screechharrass} —Preceding undated comment added 17:17, 16 May 2010 (UTC).[reply]
Follow-up question about a feature that seems to have disappeared. In Excel 2007 can you make a bar chart where the bars are in different patterns, suitable for black-and-white reproduction? I don't mean the fancy textures that are available. I mean ordinary patterns like hatched vertically, hatched horizontally, diagonal hatching, spots etc. Thanks. Itsmejudith (talk) 11:45, 17 May 2010 (UTC)[reply]
Quick search for 'office 2007 bar chart texture black white' came up with [5] and [6] which seem of relevance. You could probably also do it with a texture file although that would be less ideal in a number of ways (was going to try it myself but couldn't find an appropriate image file, probably should have created my own). Nil Einne (talk) 00:03, 19 May 2010 (UTC)[reply]
There is many difference between Office 2000 and 2010. First off, 2010 have a new interface called a "Ribbon". Just look at Office 2010. Before you purchase the software, you could try the beta though: http://www.microsoft.com/Office/2010/en/default.aspx --Tyw7  (☎ Contact me! • Contributions)   Changing the world one edit at a time! 05:17, 19 May 2010 (UTC)[reply]
I found this website offering a tutorial for office 2007: http://www.baycongroup.com/word2007/. 2010 and 2007 are similiar. --Tyw7  (☎ Contact me! • Contributions)   Changing the world one edit at a time! 05:24, 19 May 2010 (UTC)[reply]

International Fonts

edit
Moved from the Village Pump. ╟─TreasuryTagSpeaker─╢ 13:07, 16 May 2010 (UTC)[reply]

Using XP SP3, I see some international fonts but not all. What should I do? Is there perhaps a download package somewhere? kcylsnavS {screech} 13:05, 16 May 2010 (UTC)[reply]

First and foremost, you need a decent Unicode font, such as Arial Unicode MS or Lucida Sans Unicode (or the free DejaVu fonts). To examine how good a Unicode font is, use the charmap (Win+R, charmap) utility, select the font, and then Advanced mode, and finally sort by Unicode subintervals. Secondly, you need a browser that is good at displaying Unicode fonts. All modern browsers ought to do it, even under such an old operating system as Windows XP. --Andreas Rejbrand (talk) 14:13, 16 May 2010 (UTC)[reply]
I have Lucinda Sans Unicode and I'm using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.20) Gecko/20081217 Firefox/2.0.0.20 (.NET CLR 3.5.30729). I like XP. Because I'm not constantly pushed into taking my hands off the keyboard to use the mouse. kcylsnavS {screech} 14:29, 16 May 2010 (UTC)[reply]
Further suggestions?? kcylsnavS{screechharrass} 17:18, 16 May 2010 (UTC)[reply]

Sorting rows in OpenOffice spreadsheet

edit

I have data in rows in a spreadsheet. Let me try an example. A database of people consists of their names followed by their height and weight. I want to compare the data by sorting the rows according to height or weight. a) How can I protect the rows to ensure that sorting them always keeps the rows intact, and that people's data never gets scrambled? b) Is there a quick way to sort a set of rows by one particular column? Thanks 78.149.199.79 (talk) 15:34, 16 May 2010 (UTC)[reply]

Dunno. But in Excel you simply take care to select the entire table area to be sorted and go from there. kcylsnavS{screechharrass} 15:45, 16 May 2010 (UTC)[reply]
(A) Svanslyck is right. Just make sure you have selected all of the data you want sorted. The only way the spreadsheet program will mess up your rows of data is if you neglect to select all the data you want sorted. For example, if you mistakenly only select columns A and B, then you sort by column B, then the data in column C won't move along with the other data in the corresponding row. The easy way to make sure all the data is selected is to do a "Select All" before your sort. Experiment with some test data a bit until you're comfortable with the sorting keeping your data together. (b) Depends on your spreadsheet program, but in Microsoft Excel 2007, you hit ctrl-A to Select All, click the "Data" tab at the top, then click the "Sort" button, then there's a flexible dialog box that lets you choose what columns you want to sort by. Comet Tuttle (talk) 16:57, 16 May 2010 (UTC)[reply]
(B) CTRL-A, confirm the the selection is what you want, then ALT-O-S. kcylsnavS{screechharrass} 17:20, 16 May 2010 (UTC)[reply]
In Excel 2000, if sorting will scramble the association with adjacent data, a warning pop-up appears with the default being to expand the selection. I assume this has been retained in subsequent versions? Dbfirs 11:27, 17 May 2010 (UTC)[reply]
I just launched Excel 2007 and typed in random numbers in a 3 column by 9 row area, dragged across a 2 column by 6 row part of the area, clicked Data, then Sort, then chose my sort options and completed the sort ... and didn't see any dialog box warning me about the adjacent data. Comet Tuttle (talk) 23:51, 17 May 2010 (UTC)[reply]
Apologies, the pop-up appears only when a single row or column is selected, so it is still possible to scramble the data by deliberately selecting a subset, so the answer to the OP's question a) is "you can't". Dbfirs 00:19, 18 May 2010 (UTC)[reply]

I have checked in OpenOffice and it work in the same way as the excel users above describe for excel. Gr8xoz (talk) 05:07, 20 May 2010 (UTC)[reply]

Difficulty with password

edit

My usual, handy-dandy, always-use-it password for Wikipedia has tanked. No idea why, maybe because I haven't logged in in over a year.

I want to use my account to add more information to some articles I've authored.

I try having Wikipedia send the email to my account (to reset the password) and no email comes through -- not in the spam folder, not anything. It's the email account I've always used. Not sure if it's been the one I signed up to Wikipedia with, but it's a very high probability it is.

What do I do?

I have ways of proving this is 'me'. :)

Formerly (still?) Theoriste on Wikipedia —Preceding unsigned comment added by 98.109.75.187 (talk) 18:02, 16 May 2010 (UTC)[reply]

Hi Deanne, (if that was you) The following is from the Help:Logging in page: ''if the e-mail address is no longer accessible, you will have to create a new account. After doing this you should "move" your previous User and User talk pages to your new name as soon as possible (e.g. by making a request on the Requested moves page). This will officially link your old and new identities and reassure other editors that your new account isn't a "sockpuppet"."
I'm not an admin or an expert on this, so I can't advise any further. Dbfirs 00:01, 17 May 2010 (UTC)[reply]
When I visit User:Theoriste, there is no "E-mail this user" link in the toolbox. You probably didn't setup an email to be associated with that Wikipedia user. Sorry, but you will have to create a new user as the password for Theoriste cannot be recovered or reset. Astronaut (talk) 21:27, 18 May 2010 (UTC)[reply]