I was given this interview question recently:
An analog clock shows that the current time is HH:MM. Compute in degree, the smaller angle between the hour and minute hands. Be as precise as you can.
I'm wondering what's the simplest, most readable, most precise algorithm is. Solution in any language is welcome (but do explain it a bit if you think it's necessary).
Hi Ladies and Gents.
I'd like some help converting the following UML diagram:
UML Diagram
The diagram shows 4 classes and is related to a Loyalty card scheme for an imaginary supermarket.
I'd like to create an object relational data base schema from it for use with Oracle 10g/11g. Not sure where to begin, if somebody could give me a head start that would be great.
Looking for actually starting the schema, show abstraction, constraints, types(subtypes, supertypes) methods and functions.
Note:
I'm not looking for anyone to make any comments regarding the actual classes and whether changes should be made to the Diagram, just the schema.
Thanks
Hi,
I have following definition in ivy.xml
<dependency org="southbeach" name="ego" rev="4.3.1" conf="properties->asterik" >
<artifact name="ego" type="conf" ext="conf" conf="properties->asterik"/>
</dependency>
I have files with either extension conf or properties which i need at runtime, in ivysettings.xml, i have following:
<filesystem name="privateFSa">
<artifact pattern="${localRepositoryLocation}/[artifact].[ext]" />
</filesystem>
It always tries to look for ego.jar instead of ego.conf. can please somebody shed light on this? am i doing something wrong or ivy just supports tar,zip,gz, jar and not properties or conf files?
I did workaround for now in ivysettings.xml
<filesystem name="privateFSa">
<artifact pattern="${localRepositoryLocation}/[artifact].conf" />
</filesystem>
but this doesnt looks good to hardcode conf there.
Thanks,
Almas
I believed any kind of asynchronous execution makes a thread in invisible area. But if so,
Async codes does not offer any performance gain than threaded codes.
But I can't understand why so many developers are making many features async form.
Could you explain about difference and cost of them?
Id like to be able to create checkboxes for a list of objects. Then offer the user a number of actions to perform on the objects selected. I.e. delete, archive etc.
I know of ryan's screencasts but it doesnt explain how to create links to multiple actions for the selected objects. It just showed him create a form_tag with a url to one action and a submit button.
I understand the gist of the code, that it forms permutations; however, I was wondering if someone could explain exactly what is going on in the return statement.
def perm(l):
sz = len(l)
print (l)
if sz <= 1:
print ('sz <= 1')
return [l]
return [p[:i]+[l[0]]+p[i:] for i in range(sz) for p in perm(l[1:])]
Im working on a web site that has to be reachable from many countries under the same domain.
Id like to know how can I receive a request with nginx (or any other static file server), and send it to different web servers depending on IP's location.
I mean, what is the point on having multiple db machines on country A and B, if the server that serves you the page is chosen by round robin.
Maybe theres another solution to my problem, and I would be very happy if someone can explain it to me.
Hi,
Can somebody help me for the following.
I want to select a perticular string in the list displayed in android phone. If i take example of phone book. i want to pass a person name to the device using adb interface and that name should get highlighted in the list.
I tried all adb commands for this but could pass string and key events to the screen but not able to select the respective string. please help.
Thanks in advance.
Can some one explainme some scenarios where it is better to use WCF than Webservices .
I mean describe me some scenarios where one should stick to WebServices alone and tell me some other scenarios where one should go for WCF instead of Webservices ?
How do you know what are the top stories or hot topics just in RSS feed aggregator NewsNow for example??
Could you please explain?
I am new to Ruby on Rails. I want to build a RSS reader in Ruby on Rails. Could you suggest me some good tutorials or links??
Thanks
Gautam
I dont understand quite well about onStartInputView(), onCreateInputView(), onStartInput() and onInitializeInterface(), after i read throught inputMethodservice API.
Anyone can explain it when we use function, how we use those function. Are they like life cycle in Activity? if yes, whats the sequence of them. how can they behave?
I've been looking over various internet postings and a lot of the code I've seen looks similar to this:
def mactobinar(mac):
addr = ''
temp = mac.replace(':', '')
for i in range(0, len(temp), 2):
addr = ''.join([addr, struct.pack('B', int(temp[i: i + 2], 16)))])
return addr
Can someone explain how this code works?
i want that the number of address book item is not known in advance, i am thinking to use linked list is it the right choice??
"the user can enter new person data, or print the data for a given name, the asking data need not be a name but also an address on a telephone number, the program prints the whole information about a person, print the content of the book in alphabetical order. Store some data in a file; retrieve it and safe it after modification
Program should write a file to the disk and retrieve the file from it. Program should be called with arguments.
i will use malloc but i don't know when and how?
somebody did similar task or have an idea can help me plz
Hey all. I'm still pretty new to iPhone development, and I'm having a bit of trouble figuring out how to change the title of my Navigation Bar. On another question on this site somebody recommended using :
viewController.title = @"title text";
but that isn't working for me...Do I need to add a UINavigationController to accomplish this? Or maybe just an outlet from my UIViewController subclass? If it helps, I defined the navigation bar in IB and I'm trying to set its title in my UIViewController subclass. This is another one of those simple things that gives me a headache. Putting self.title = @"title text"; in viewDidLoad and initWithNibName didn't work either. Anybody know what's happening and how to get it happening right?
Thanks!
I'm assuming Mercurial is for having an updated website and it archiving the old stuff? Easy to test things and such?
My question is, how exactly should I get started and can somebody give me a crash course in using Mercurial and using the following techs below:
Notepad++ for coding
FTP
PHP/MySQL
Jquery & other js libraries
I use windows and would like to keep things fairly simple. I'm developing 1 website currently and want some kind of CVS system in place. Or should I just stick to my current edit file in notepad++ and upload via ftp method and make a backup copy of everything every once and a while?
Any thoughts?
EDIT: I'm doing http://bugtracker.gttools.com/public/wiki/bluehost/Mercurial right now in order to try and 'install' it.
I don't think i fully understand character sets so i was wondering if anyone would be kind enough to explain it in layman's terms with examples ( for Dummies).I know there is utf8, latin1, ascii ect
The more answers the better really.
Thank you in advance;-)
Can anybody explain why this code does not generate a compiler error?
class Foo
{
public:
int _x;
};
Foo getFoo()
{
Foo myfoo;
myfoo._x = 10;
return myfoo;
}
int _tmain()
{
// should this line of code not be a compiler error?
Foo& badfoo = getFoo();
return 0;
}
Can anyone comment on which is more scalable between RoR and PHP? I have heard that RoR is less scalable than PHP since RoR has a little more overhead with its MVC framework while PHP is more low level and lighter. This is a bit vague - can anyone explain better?
Im trying to do a 2 column layout where the left column is very long vertically, and the right column is very long horizontally.
When I scroll vertically, I want to move up and down the left column while the right one stays fixed.
When I scroll horizontally, both columns move left-right (normal behaviour)
I hope this drawing explain it more (sorry for the bad quality):
Is this possible to do using only css? If not, how can I do it with javascript?
Thanks
When I try to create a unique index on a large table, I get a unique contraint error. The unique index in this case is a composite key of 4 columns.
Is there an efficient way to identify the duplicates other than :
select col1, col2, col3, col4, count()
from Table1
group by col1, col2, col3, col4
having count() 1
The explain plan above shows full table scan with extremely high cost, and just want to find if there is another way.
Thanks !
Hi,
I have confusion regarding COBOL data types.
Like in many interviews it is asked to explain the difference between COMP-3 and COMP...
what is the exact difference?
what is the meaning of usage modes in COBOL and how is it related to data types?
Thanks and Regards,
Manasi Kulkarni