Search Results

Search found 11224 results on 449 pages for 'suggestions'.

Page 9/449 | < Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >

  • Classes, methods, and polymorphism in Python

    - by Morlock
    I made a module prototype for building complex timer schedules in python. The classe prototypes permit to have Timer objects, each with their waiting times, Repeat objects that group Timer and other Repeat objects, and a Schedule class, just for holding a whole construction or Timers and Repeat instances. The construction can be as complex as needed and needs to be flexible. Each of these three classes has a .run() method, permitting to go through the whole schedule. Whatever the Class, the .run() method either runs a timer, a repeat group for a certain number of iterations, or a schedule. Is this polymorphism-oriented approach sound or silly? What are other appropriate approaches I should consider to build such a versatile utility that permits to put all building blocks together in as complex a way as desired with simplicity? Thanks! Here is the module code: ##################### ## Importing modules from time import time, sleep ##################### ## Class definitions class Timer: """ Timer object with duration. """ def __init__(self, duration): self.duration = duration def run(self): print "Waiting for %i seconds" % self.duration wait(self.duration) chime() class Repeat: """ Repeat grouped objects for a certain number of repetitions. """ def __init__(self, objects=[], rep=1): self.rep = rep self.objects = objects def run(self): print "Repeating group for %i times" % self.rep for i in xrange(self.rep): for group in self.objects: group.run() class Schedule: """ Groups of timers and repetitions. Maybe redundant with class Repeat. """ def __init__(self, schedule=[]): self.schedule = schedule def run(self): for group in self.schedule: group.run() ######################## ## Function definitions def wait(duration): """ Wait a certain number of seconds. """ time_end = time() + float(duration) #uncoment for minutes# * 60 time_diff = time_end - time() while time_diff > 0: sleep(1) time_diff = time_end - time() def chime(): print "Ding!"

    Read the article

  • Javascript :(….. Oh!! So its jquery? Now what?? I’m a C# Guy

    - by Shekhar_Pro
    Hi guys I want you to Guide me here. This other day I was working out some AJAX for my ASP.Net website and handling client side code in Java was taking the hell out of me. Then I got my hands on this Book jQuery In Action 2nd Edition and solved my problem with the help of Example code in the book. Now as I checked the contents I got an overview that whatever I had ever thought of doing can be done by this jQuery so easily and quite cleanly. I am actually pretty new to web development (say abt 4months ) and from C# world where we have cool libraries and Simple and Elegant coding style. (yeah including those generic, Ienumerable, lambadas, chained statements.. you got it…) and you know what you’re doing when writing some code. And we have so great IntelliSense to care., and above all we have everything Strongly Typed. But in Javascript everything is so messy.. . (and I don’t know why they are not properly indented.. see page source ) Now tell me what should I do, go straight with jQuery or should I first learn Javascript (like a disciplined boy…I even have a book for that too… got in gift :) …. ) I have seen Is it a good idea to learn JavaScript before learning jQuery? but remember I have already got a project on my hand…

    Read the article

  • C# Projects for study

    - by Chandra
    I need to learn C# for my Internship. I would not like to start programming top down reading a Ebook. I would like to set a Goal for myself and then try to achieve it Programmatically. So, I am here to ask your help, if you could suggest me some interesting projects which will help me in Learning C# efficiently and quickly. I have previous programming experience, programming in C,C++ and Matlab. Thanks for your time Chandra

    Read the article

  • what are good blogs to read relating java, spring, hibernate, maven?

    - by c0mrade
    To continue to question further I'm more interested in blogs, websites who once in a while release a tutorial, tip or best-practice on the topics I mentioned. For ex : http://net.tutsplus.com/ is very good website to follow if you wanna learn about or upgrade your knowledge about CSS, HTML, Javascript, PHP .. Is there a website like this for Java and related technologies?

    Read the article

  • Windows Network Programming

    - by bdhar
    I am planning to get some good book for Windows Socket Programming in VC++. I have 2+ years of experience in working with VC++/ATL/COM/MFC; but not in the networking domain. I have been doing some search in Google for "Windows network programming" books. There are few but they have both good and bad comments scattered all over; and I am not able to decide anything. Please recommend some good book with Pros and Cons. The books I found are below. Windows Sockets Network programming Network Programming for Microsoft Windows Thanks.

    Read the article

  • Save data in bulk.

    - by Muhammad Kashif Nadeem
    I have a window having multiple tabs. Each tab having different grids. I want to save all changes on any tab on any grid in bulk. I mean I have one save button which will save all changes in any grid on any tab. I think DataTables will work fine here. Can you suggest me that it is good to use DataTables to ADD/Edit data and save data in bulk using these DataTables OR is there any better way to achieve this. My DAL is generated from LLBLGen Pro (ORM) but you are open to suggest me a solution. Thanks. Edit: I am using Telerik controls so I can get all data in DataTable like DataTable dtProducts = this.radGridView1.DataSource as DataTable;

    Read the article

  • Suggest books/learning path for writing smartphone apps

    - by chibineku
    I have been writing a lot of HTML, CSS, PHP, MySQL and JavaScript lately working on a website, and I would like to move on to 'proper' OOP with an eye to making smartphone apps. I would like to at least cover iPhone and BlackBerry, which means learning Objective C, Cocoa and Java, before learning the specifics of interacting with the devices themselves, such as native bluetooth/GPS/internet API/methods. I would appreciate pointers to books or resources that will get me from a procedural web developer to object oriented app-maker. Most of the reviews of books on Objective C and Java have been mixed. I am about to start working my way through Beginning Java Objects (APress) which I have borrowed from my brother, so even if it's not a good intro at least it was free!

    Read the article

  • Should I use fork or threads?

    - by shadyabhi
    In my script, I have a function foo which basically uses pynotify to notify user about something repeatedly after a time interval say 15 minutes. def foo: while True: """Does something""" time.sleep(900) My main script has to interact with user & does all other things so I just cant call the foo() function. directly. Whats the better way of doing it and why? Using fork or threads?

    Read the article

  • How to test my application on older version of IE?

    - by Rakesh Juyal
    I have installed IE8 on my system. I usually test my application on this browser, but the problem arises when i got to know that the client is using IE7. Now how can i test my application on IE7? One possible solution is to have dual booting on my system. So on version of Windows i can have IE7 and on another i can have IE8. But i really don't want to use this solution. Another possible solution is to use PC Emulator [ Don't know what is this, just heard about these ]. Using which i can have multiple IE version simultaneously. Have you ever tried this solution? Please name any good FREE emulator. Please let me know if there is any other better solution.

    Read the article

  • gcc optimization? bug? and its practial implication to project

    - by kumar_m_kiran
    Hi All, My questions are divided into three parts Question 1 Consider the below code, #include <iostream> using namespace std; int main( int argc, char *argv[]) { const int v = 50; int i = 0X7FFFFFFF; cout<<(i + v)<<endl; if ( i + v < i ) { cout<<"Number is negative"<<endl; } else { cout<<"Number is positive"<<endl; } return 0; } No specific compiler optimisation options are used or the O's flag is used. It is basic compilation command g++ -o test main.cpp is used to form the executable. The seemingly very simple code, has odd behaviour in SUSE 64 bit OS, gcc version 4.1.2. The expected output is "Number is negative", instead only in SUSE 64 bit OS, the output would be "Number is positive". After some amount of analysis and doing a 'disass' of the code, I find that the compiler optimises in the below format - Since i is same on both sides of comparison, it cannot be changed in the same expression, remove 'i' from the equation. Now, the comparison leads to if ( v < 0 ), where v is a constant positive, So during compilation itself, the else part cout function address is added to the register. No cmp/jmp instructions can be found. I see that the behaviour is only in gcc 4.1.2 SUSE 10. When tried in AIX 5.1/5.3 and HP IA64, the result is as expected. Is the above optimisation valid? Or, is using the overflow mechanism for int not a valid use case? Question 2 Now when I change the conditional statement from if (i + v < i) to if ( (i + v) < i ) even then, the behaviour is same, this atleast I would personally disagree, since additional braces are provided, I expect the compiler to create a temporary built-in type variable and them compare, thus nullify the optimisation. Question 3 Suppose I have a huge code base, an I migrate my compiler version, such bug/optimisation can cause havoc in my system behaviour. Ofcourse from business perspective, it is very ineffective to test all lines of code again just because of compiler upgradation. I think for all practical purpose, these kinds of error are very difficult to catch (during upgradation) and invariably will be leaked to production site. Can anyone suggest any possible way to ensure to ensure that these kind of bug/optimization does not have any impact on my existing system/code base? PS : When the const for v is removed from the code, then optimization is not done by the compiler. I believe, it is perfectly fine to use overflow mechanism to find if the variable is from MAX - 50 value (in my case).

    Read the article

  • What are the advantages of learning Go?

    - by Pangea
    What is so unique about Go? Over the 11 years of my career I've learnt Pascal, C, C++, COBOL and then Java. I always felt that going from C to C++ to Java was a incremental and value added progression. Now I see a proliferation of functional programming languages and I understand the benefit of learning few of them (like actors in scala etc). Now I was going through the Go programming language and was wondering why would I want to learn this? Is this going to simplify how I have been writing the code? What are its use cases? How can I make a case to promote it in my team? What is the next programming language that a Java team that builds business applications like us can benefit from? Appreciate your comments on this.

    Read the article

  • Serializable object in intent returning as String

    - by B_
    In my application, I am trying to pass a serializable object through an intent to another activity. The intent is not entirely created by me, it is created and passed through a search suggestion. In the content provider for the search suggestion, the object is created and placed in the SUGGEST_COLUMN_INTENT_EXTRA_DATA column of the MatrixCursor. However, when in the receiving activity I call getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY), the returned object is of type String and I cannot cast it into the original object class. I tried making a parcelable wrapper for my object that calls out.writeSerializable(...) and use that instead but the same thing happened. The string that is returned is like a generic Object toString(), i.e. com.foo.yak.MyAwesomeClass@4350058, so I'm assuming that toString() is being called somewhere where I have no control. Hopefully I'm just missing something simple. Thanks for the help! Edit: Some of my code This is in the content provider that acts as the search authority: //These are the search suggestion columns private static final String[] COLUMNS = { "_id", // mandatory column SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_INTENT_EXTRA_DATA }; //This places the serializable or parcelable object (and other info) into the search suggestion private Cursor getSuggestions(String query, String[] projection) { List<Widget> widgets = WidgetLoader.getMatches(query); MatrixCursor cursor = new MatrixCursor(COLUMNS); for (Widget w : widgets) { cursor.addRow(new Object[] { w.id w.name w.data //This is the MyAwesomeClass object I'm trying to pass }); } return cursor; } This is in the activity that receives the search suggestion: public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Object extra = getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY); //extra.getClass() returns String, when it should return MyAwesomeClass, so this next line throws a ClassCastException and causes a crash MyAwesomeClass mac = (MyAwesomeClass)extra; ... }

    Read the article

  • Tag Suggestion system, approaches and ideas

    - by Galois
    Hi guys! -- I am working on a (auto) tag suggestion system (NOT tag autocomplete). Lets say I want to suggest tags for a given question like here on SO (although SO's tagging system is auto-complete). My main idea is to get the intersection between the tags_set and the given question.split()_set. (In python the set_intersection is efficient enough). Also, in order to make it a little bit more accurate I might use words-distance to count as 'the same' very close words i.e movie == movies. For now I am not thinking about using any Collaborative Filtering technique looking for the tags to similar questions and so on, because I believe since the question text is pretty short (comparing with a blog article or a paper) it is not worth the effort. So I was wondering if you have any other (more) efficient approaches to suggest. Any ideas, specially from people who they have done something like that before, are more than welcome.

    Read the article

  • What are the best settings of the H2 database for high concurrency?

    - by dexter
    There are a lot of settings that can be used in H2 database. AUTO_SERVER, MVCC, LOCK_MODE, FILE_LOCK and MULTI_THREADED. I wonder what combination works best for high concurrency setup e.g. one thread is doing INSERTs and another connection does some UPDATEs and SELECTs? I tried MVCC=TRUE;LOCK_MODE=3lFILE_LOCK=NO but whenever I do some UPDATEs in one connection, the other connection does not see it even though I commit it. By the way the connections are from different processes e.g. separate program.

    Read the article

  • sample/good rails projects to learn from

    - by learningrails
    I am just starting with Rails. I've read through the AWDR book and am currently working on a side project in rails. I want to get an idea of what a good rails project should look like in order to learn what the best practices are. Can you guys point me to some good rails projects on github that not only work well but are well written? Or am I better off reading Rails best practices? if so, any good ones?

    Read the article

  • Need some advice on a language to use for a 'presentation display board'

    - by joe90
    As part of the project i am working on I am looking to produce some software that works on a LCD display (think call center info boards) and displays various graphs (the bars grow etc in realtime, so incoming call stats etc etc) and flicks between various 'plug-ins'. The problem is deciding what language to use.. I am thinking about using the XNA framework, as this will allow me to do some nice 3d effects, add a nice glow effect, play videos etc. I can have for example the company logo defused spinning slowly behind the current data display. I know however, the XNA framework is a bit left field for this. Or is there a better alternative? Thanks..

    Read the article

  • Serialized object in intent returning as String

    - by B_
    In my application, I am trying to pass a serializable object through an intent to another activity. The intent is not entirely created by me, it is created and passed through a search suggestion. In the content provider for the search suggestion, the object is created and placed in the SUGGEST_COLUMN_INTENT_EXTRA_DATA column of the MatrixCursor. However, when in the receiving activity I call getIntent().getSerializableExtra(SearchManager.EXTRA_DATA_KEY), the returned object is of type String and I cannot cast it into the original object class. I tried making a parcelable wrapper for my object that calls out.writeSerializable(...) and use that instead but the same thing happened. The string that is returned is like a generic Object toString(), i.e. com.foo.yak.MyAwesomeClass@4350058, so I'm assuming that toString() is being called somewhere where I have no control. Hopefully I'm just missing something simple. Thanks for the help!

    Read the article

  • What is the need of JavaScript while developing a page?

    - by nepc
    I have been developing websites for some time now and I hardly use any Javascript in my pages. Whatever I can want to do with JavaScript, it is possible through PHP. Just like ajax itself. We can send a regular request instead of a ajax request, can't we? We can use "include" to include sub part of pages. So am i missing something about javascript, that I dont know of?

    Read the article

< Previous Page | 5 6 7 8 9 10 11 12 13 14 15 16  | Next Page >