Search Results

Search found 13 results on 1 pages for 'petrol'.

Page 1/1 | 1 

  • suggest an algorithm for the following puzzle!!

    - by garima
    There are n petrol bunks arranged in circle. Each bunk is separated from the rest by a certain distance. You choose some mode of travel which needs 1litre of petrol to cover 1km distance. You can't infinitely draw any amount of petrol from each bunk as each bunk has some limited petrol only. But you know that the sum of litres of petrol in all the bunks is equal to the distance to be covered. ie let P1, P2, ... Pn be n bunks arranged circularly. d1 is distance between p1 and p2, d2 is distance between p2 and p3. dn is distance between pn and p1.Now find out the bunk from where the travel can be started such that your mode of travel never runs out of fuel.

    Read the article

  • Java single Array best choice for accessing pixels for manipulation?

    - by Petrol
    I am just watching this tutorial https://www.youtube.com/watch?v=HwUnMy_pR6A and the guy (who seems to be pretty competent) is using a single array to store and access the pixels of his to-be-rendered image. I was wondering if this really is the best way to do this. The alternative of Multi-Array does have one pointer more, but Arrays do have an O(1) for accessing each index and calculating the index in a single array seems to take one addition and one multiplication operation per pixel. And if Multi-Arrays really are bad, can't you use something with Hashing to avoid those addition and multiplication operations? EDIT: here is his code... public class Screen { private int width, height; public int[] pixels; public Screen(int width, int height) { this.width = width; this.height = height; // creating array the size of one index/int for every pixel // single array has better performance than multi-array pixels = new int[width * height]; } public void render() { for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { pixels[x + y * width] = 0xff00ff; } } } }

    Read the article

  • How to repair Creative Inspire Speakers 2.1 Volume Control Wheel?

    - by akula
    Due to dust or so, the Volume Control Wheel does not work properly. Volume goes to one speaker, and other gets muted. Vice versa. When I carefully turn the wheel sometimes the Volume works properly or sometimes with noise or muted one side. As I write this, I've cleaned it up with Petrol drops. PCB is drying. I chose Petrol because Contact Cleaner is expensive solution. Am I correct or any other method could be used? Thank you.

    Read the article

  • contracting . . .

    - by Keith
    Here's a question for all my fellow contractors - I'm paid quite handsomely for my normal contracted hours (any overtime is billed at the same rate) but do you think it fair to bill for travel time to the other end of the country (regional office) when this takes place outside of the normal working day (or overlapping into the evening) as well as actual time holed up in a hotel room when you get there, ready for a normal working day the next day, along with the return journey? Petrol is claimed normally (nominal rate) and hotel is covered by the company I contract for.

    Read the article

  • Should I charge for travel time as a contractor?

    - by Keith
    Here's a question for all my fellow contractors - I'm paid quite handsomely for my normal contracted hours (any overtime is billed at the same rate) but do you think it fair to bill for travel time to the other end of the country (regional office) when this takes place outside of the normal working day (or overlapping into the evening) as well as actual time holed up in a hotel room when you get there, ready for a normal working day the next day, along with the return journey? Petrol is claimed normally (nominal rate) and hotel is covered by the company I contract for.

    Read the article

  • Should I charge for travel expenses as a contractor?

    - by Keith
    Here's a question for all my fellow contractors - I'm paid quite handsomely for my normal contracted hours (any overtime is billed at the same rate) but do you think it fair to bill for travel time to the other end of the country (regional office) when this takes place outside of the normal working day (or overlapping into the evening) as well as actual time holed up in a hotel room when you get there, ready for a normal working day the next day, along with the return journey? Petrol is claimed normally (nominal rate) and hotel is covered by the company I contract for.

    Read the article

  • Is 23,148,855,308,184,500 a magic number, or sheer chance?

    - by Roddy
    News reports such as this one indicate that the above number may have arisen as a programming bug. A man in the United States popped out to his local petrol station to buy a pack of cigarettes - only to find his card charged $23,148,855,308,184,500. That is $23 quadrillion (£14 quadrillion) - many times the US national debt.* In hex it's $523DC2E199EBB4 which doesn't appear terribly interesting at first sight. Anyone have any thoughts about what programming error would have caused this?

    Read the article

  • Select column value that matches a combination of other columns values on the same table

    - by Ala
    I have a table called Ads and another Table called AdDetails to store the details of each Ad in a Property / Value style, Here is a simplified example with dummy code: [AdDetailID], [AdID], [PropertyName], [PropertyValue] 2 28 Color Red 3 28 Speed 100 4 27 Color Red 5 28 Fuel Petrol 6 27 Speed 70 How to select Ads that matches many combinations of PropertyName and PropertyValue, for example : where PropertyName='Color' and PropertyValue='Red' And where PropertyName='Speed' and CAST(PropertyValue AS INT) > 60

    Read the article

  • How hard is it to create a not-so-random number generator?

    - by Duracell
    Backstory: So I was driving to band practice this evening. My car has a USB port where you can plug in a USB stick with MP3 files on it and the stereo will play them. I have about 100 MP3s on my stick so I pushed the 'Random' button. So from here to band practice, it played: Track 22 Track 45 Track 4 Track 11 Track 87 Track 66 Track 98 Then on the way home, it played Track 16 Track 27 Track 33 And then I stopped at the petrol station. I filled up, got back in the car and the stereo fired up again. It played Track 22 Track 45 Track 4 Track 11 Track 87 I thought, WTF? What's with this 'random' generator? What are they using as a seed, if not time? Is a car stereo so memory-tight that it can't even use the C stdlib? Does anyone know how this kind of thing happens?

    Read the article

  • System randomly freezes yet mouse still moves, SSD out of reallocatable sectors, should I replace it?

    - by user784446
    This problem has lasted for the past 48 hours. The first time it happened, a program I was running stopped responding, so I tried to end it from task manager. The processes at first were listed fine until hovered upon. Eventually, despite the mouse still being able to move, after a few persisting clicks the mouse finally stopped moving. The screen went blank shortly thereafter. The second time it occurred, items on the screen stopped responding - hovering over the taskbar or such wouldn't elicit a response. Sound would still play however. Eventually, the mouse became unresponsive and the system restarted itself. I suspect that it may be a problem of my SSD drive. After looking through some Google search results, I downloaded HDTunePro to determine if there's a problem with the drive. Results returned a problem of reallocated sector count. An error scan also revealed 48 bad sectors. Also, an attempt to backup the contents of the most important areas of the drive returned a few explorer "Error: cannot read source from disk" errors. Should I ditch the drive and use another drive or is there anything that can be done to repair the drive? SSD: OCZ Petrol 64gb CPU: AMD Athlon II X4 640 RAM: Generic 3GB DDR2 Motherboard: Gigabyte MA74GM-S2H OS: Windows 7 Ultimate x64 Thanks!

    Read the article

  • System randomly freezes yet mouse still moves

    - by user784446
    This problem has lasted for the past 48 hours. The first time it happened, a program I was running stopped responding, so I tried to end it from task manager. The processes at first were listed fine until hovered upon. Eventually, despite the mouse still being able to move, after a few persisting clicks the mouse finally stopped moving. The screen went blank shortly thereafter. The second time it occurred, items on the screen stopped responding - hovering over the taskbar or such wouldn't elicit a response. Sound would still play however. Eventually, the mouse became unresponsive and the system restarted itself. I suspect that it may be a problem of my SSD drive. After looking through some Google search results, I downloaded HDTunePro to determine if there's a problem with the drive. Results returned a problem of reallocated sector count. An error scan also revealed 48 bad sectors. Also, an attempt to backup the contents of the most important areas of the drive returned a few explorer "Error: cannot read source from disk" errors. Should I ditch the drive and use another drive or is there anything that can be done to repair the drive? SSD: OCZ Petrol 64gb CPU: AMD Athlon II X4 640 RAM: Generic 3GB DDR2 Motherboard: Gigabyte MA74GM-S2H OS: Windows 7 Ultimate x64 Thanks!

    Read the article

  • SQLAuthority News – Random Thoughts and Random Ideas

    - by pinaldave
    There are days when I keep on wondering about SQL, and even my life overall. Today is Saturday so I decided to write about SQL Server. Just like any other mornings, I woke up at 5 and opened my blog editor. I usually do not open Twitter or Facebook when I am planning to focus on my work, as they are little distractions for me. But today I opened my Twitter account and came across a very interesting quote from a friend: ‘Can I expect you to be different today?’ Well, I think it was very powerful quote for me to read first thing on a new day. This quote froze me for a while and made me think, “Do I really want to write about an SQL Server tip, or something different?”  After a little thinking, I’ve realized that for today I would go on and write something different. I am going to write about a few of the ideas and thoughts I had yesterday. After writing all these, I realized that if I am thinking so much in a day, and if I write a blog post of my random musing of the week or month, it can be so long (and boring). Here are some of my random thoughts I’d like to share with you: When the airplane lands, why does everybody get up and try to rush out when their luggage would be coming probably 20-30 minutes later? I really do not like this question when it was asked to me: “SQL Server is not using optimal index which I just created – how can I force it?” I am not going elaborate on this statement but you are allowed to in the comment section. Why do some people wish Good Morning even when they meet us after 4 PM? Can I optimize a query so much that it gives me a result before I execute it? Is it corruption when someone does their personal household work at office? The lane where I drive is always the slowest lane. Why waste time on correcting others when there are a lot of pending improvements for ourselves? If I have to get Tattoo, which SQL Server Execution Plan symbol should I get? Why do I reach office so early that the coffee machine is yet running its daily cleaning job? Why does every laptop have a ‘Page Up’ key at different locations on the keyboard? While I like color movies, I really appreciate black and white photographs. I do not appreciate statements like, “If I receive your books in PDF, I will spread it to many people to give you much greater exposure. So would you please send them to me ASAP?” Do not tell me, “Why does the database grow back after shrinking it every day?” I suggest you use “Search this blog” for the explanation. Petrol prices are currently at INR 74. I hope the rate remains there. Let me ask you the same question which started my day today:  “Can I expect you to be different today?” Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: About Me, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • howto distinguish composition and self-typing use-cases

    - by ayvango
    Scala has two instruments for expressing object composition: original self-type concept and well known trivial composition. I'm curios what situations I should use which in. There are obvious differences in their applicability. Self-type requires you to use traits. Object composition allows you to change extensions on run-time with var declaration. Leaving technical details behind I can figure two indicators to help with classification of use cases. If some object used as combinator for a complex structure such as tree or just have several similar typed parts (1 car to 4 wheels relation) than it should use composition. There is extreme opposite use case. Lets assume one trait become too big to clearly observe it and it got split. It is quite natural that you should use self-types for this case. That rules are not absolute. You may do extra work to convert code between this techniques. e.g. you may replace 4 wheels composition with self-typing over Product4. You may use Cake[T <: MyType] {part : MyType} instead of Cake { this : MyType => } for cake pattern dependencies. But both cases seem counterintuitive and give you extra work. There are plenty of boundary use cases although. One-to-one relations is very hard to decide with. Is there any simple rule to decide what kind of technique is preferable? self-type makes you classes abstract, composition makes your code verbose. self-type gives your problems with blending namespaces and also gives you extra typing for free (you got not just a cocktail of two elements but gasoline-motor oil cocktail known as a petrol bomb). How can I choose between them? What hints are there? Update: Let us discuss the following example: Adapter pattern. What benefits it has with both selt-typing and composition approaches?

    Read the article

1