Search Results

Search found 3722 results on 149 pages for 'choice'.

Page 93/149 | < Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >

  • How do you write an idiomatic Scala Quicksort function?

    - by Don Mackenzie
    I recently answered a question with an attempt at writing a quicksort function in scala, I'd seen something like the code below written somewhere. def qsort(l: List[Int]): List[Int] = { l match { case Nil => Nil case pivot::tail => qsort(tail.filter(_ < pivot)) ::: pivot :: qsort(tail.filter(_ >= pivot)) } } My answer received some constructive criticism pointing out that List was a poor choice of collection for quicksort and secondly that the above wasn't tail recursive. I tried to re-write the above in a tail recursive manner but didn't have much luck. Is it possible to write a tail recursive quicksort? or, if not, how can it be done in a functional style? Also what can be done to maximise the efficiency of the implementation? Thanks in advance.

    Read the article

  • Has anyone used an object database with a large amount of data?

    - by Jon Kruger
    Object databases like MongoDB and db4o are getting lots of pub lately. Everyone that plays with them seems to love it. I'm guessing that they are dealing with about 640K of data in their sample apps. Has anyone tried to use an object database with a large amount of data (say, 50GB or more)? Are you able to still execute complex queries against it (like from a search screen)? How does it compare to your usual relational database of choice? I'm just curious. I want to take the object database plunge, but I need to know if it'll work on something more than a sample app.

    Read the article

  • paypal integration according to dynamic choices

    - by Pankaj Khurana
    Hi, I want to integrate paypal with my website. I have studied the documentation available on paypal website. My requirement is A user selects a category, based on category course is populated,user selects course and discount. I want the user to pay through paypal according to the course selected. Also the data should be inserted into a table after successfull payment. I have checked sample code also but i am unable to figure out how to accomplish this task ie how to make it dynamic according to the user choice. I think ipn would be used but not sure. Plese help Thanks

    Read the article

  • How to specify unique container styles for heterogenous hierarchies using SL3 and TreeView control

    - by rcecil
    Hello, Just look for strategies that have been successful in rendering hierarchies that represent inheritance structures using SL3/4 TreeViews. I need to render certain nodes differently than others, depending upon what kind of container they are (a choice between things, or simply a list of related things, etc.) So far, I've been very successful with the DataTemplate route: I've been able to use a technique described in Ted Glaza's post "Easy DataTemplateSelectors in Silverlight" (you may have retrieve a Google cache of this page). SO what I'm trying to discover is something on the order of a StyleSelector, not a DataTemplateSelector. I'm considering leveraging my current implementations of Glaza's pattern of selector objects to somehow detect the node type and set the ItemContainerStyle there, but it doesn't seem clear right now. Thanks for your thoughts.

    Read the article

  • Getting value of "System.Windows.Controls.TextBlock" when binding to Silverlight ComboBox

    - by sipwiz
    I'm attempting to use a Silverlight ComboBox with a static list of elements in a very simple binding scenario. The problem is the selected item is not returning me the Text of the TextBlock within the ComboBox and is instead returning "System.Windows.Controls.TextBlock". My XAML is: <ComboBox SelectedValue="{Binding Country, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"> <TextBlock FontSize="11" Text="Afghanistan" /> <TextBlock FontSize="11" Text="Albania" /> <TextBlock FontSize="11" Text="Algeria" /> </ComboBox> In my C# file I'm binding to the ComboBox using: Customer customer = new Customer() { Country = "Albania" }; DataContext = customer; The binding does not result in Albania as the selected country and updating the ComboBox choice results in the Country being set to "System.Windows.Controls.TextBlock". I've tried fiddling around with DisplayMemberPath and SelectedValuePath but haven't found the answer. I suspect it's something really simple I'm missing.

    Read the article

  • Can you safely rely upon Yahoo Pipes to offload ETL for your application?

    - by Daniel DiPaolo
    Yahoo Pipes are a very intriguing choice for sort of a poor-man's server-free ETL solution, but would it be a good idea to build an application around one or many Pipes? I've really only used them for toy things here and there, with the only thing I've used longer than a week or two being one amalgamated and filtered RSS feed that I've plugged into Google Reader (which has worked great, but if it goes out for a while I wouldn't notice). So, my question is, would building an application around Yahoo Pipes be reliable (available most of the time)? Ideally it'd be something I could rely on being up 99+% of the time. It looks like the Pipes Terms of Use permit building apps around it, but I am unfamiliar with anyone building anything significant using them.

    Read the article

  • Seeking recommendations on automated test framework for C

    - by Hissohathair
    I'm writing some code (some of which uses W3C's libwww) in C. It's been a while since I've touched ANSI C. Back in the day we rolled our own test framework. Does anybody here have any test frameworks that they recommend for C programming? Googling around I was inclined to go with Check. It has a page on other unit testing frameworks in C, a few of which I've taken a quick look at. GNU AutoUnit seemed like it might be a good choice since I'm using the GNU build tools (autoconf, automake) but it doesn't look that alive... Another option would be to use a C++ framework and just write my tests in C++ Anyway, any experienced opinions would be appreciated. Thanks.

    Read the article

  • sql server replication algorithm.

    - by reggie
    Anyone know how the underlying replication model in sql server works? Do they essentially depend on UTC datetime values to determine if something is new or do they keep a table of all the changes (like a table of tableID+rowid that have changed). I am building my own "replication" system and was planning on using the dates to know what to replicate. Then I started wondering what would happen if the date got off in the computer for some reason. The obvious choice is to keep a log of the changes as you go and once you replicate those changes, you remove from the log of changes. But thats a lot of extra work, instead of just checking dates. I figure if sql server replication works by just checking the dates, then that should be good enough for me. Any wisdom here? thanks

    Read the article

  • C#: Why only integral enums?

    - by JamesBrownIsDead
    I've been writing C# for seven years now, and I keep wondering, why do enums have to be of an integral type? Wouldn't it be nice to do something like: enum ErrorMessage { NotFound: "Could not find", BadRequest: "Malformed request" } Is this a language design choice, or are there fundamental incompatibilities on a compiler, CLR, or IL level? Do other languages have enums with string or complex (i.e. object) types? What languages? (I'm aware of workarounds; my question is, why are they needed?) EDIT: "workarounds" = attributes or static classes with consts :)

    Read the article

  • Can getters and setters be inlined when definition and declaration are seperated in .h and .cpp files?

    - by Nathan
    I have searched and have been unable to verify how the GCC compiler will handle inlining getters and setters when declaration is in .h file and definition is in .cpp file. Most seem to say that GCC can't see across these source file barriers and won't be able to inline these at all, while others disagree. I have looked at the documentation and I can't find the answer there either. Did I miss it? I do realize that inlining is a choice made by the compiler and is not always guaranteed, but assuming optimal situations, is it at least possible?

    Read the article

  • Should I start to use CSS 3 & HTML 5?

    - by LeonixSolutions
    I fear this may sound subjective, sorry. I am wondering how "safe" it is to use CSS3 & HTML5 in a commercial app. I really want the power that they give, but am obviously wary that they are not completely standardized. If it helps any I can probably enforce the use of Chrome as the browser; I can likely offer FireFox as an alternative. I personally do not want to let the user choose their own browser and can probably enforce my choice in a corporate environment which is already heavily biased towards Google. I suppose that if I can enforce a Chrome only policy & carefully test before release then my only worry is that some "behaviour" may change in future. Would you risk it, or would play safe (or go with an alternative, such as a Java app, forgetting the browser)?

    Read the article

  • Watir question regarding selecting a hidden dropdown.

    - by AJ
    Hi, I have two dropdowns, the second dropdown does not show until a choice is made from the first one. Using watir, i can select the first dropdown, and when i watch it, the second one becomes active, but it cannot select it. i just tried the regular select_list using name and id. Here is the code for the second drop down. <td> <input type="hidden" value="1" name="list" id="list"> <script type="text/JavaScript" language="JavaScript"></script> <select> <option value="">1</option> <option value="2">2</option> <option value="3">3</option> </select> </td> I've also notice the value for the hidden field change as i select different options. Thanks for any help

    Read the article

  • What to read as a good quick review and intro into development process methodologies?

    - by Ivan
    Being mostly self-taught freestyle developer and having no experience of working in teams of professionals in serious software companies, having only a very general idea of how the software development is should really be done, I think I've came to a point, when I begin struggling from lack of order in my work. I think I should get acquainted with professional software development technologies to optimize my own productivity and to extend my choice of work by increasing capabilities to work in teams and bigger companies. What should I begin with? Of course I am googling on this subject right now, but maybe hou have some real experience based recommendations to share?

    Read the article

  • For what programs are Objective C and Ruby ideal on the Mac?

    - by Kurt
    Hi, as a Mac outsider it seems that two popular programming languages on the Mac appear to be Objective C and Ruby. From what I understand the main API Cocoa seems to be written in and optimized for Objective C, but it is also possible to use Ruby for that. Are there different areas where each language is ideal, for example, I could imagine Objective C could be ideal for a GUI layer, or standalone desktop app, and Ruby could be good for web services etc. What about classic business logic, or data access layers? What language would be a good choice for a library of services for example? Can we write a library in one language and link to it from a main program written in the other language? If I wanted to write a layered enterprise application using domain driven design and dependency injection which languages could support each concerns? Are things like DDD and DI common amongst Mac devs? Just a curious outsider.

    Read the article

  • wxpython PyGridTableBase

    - by nozkan
    Hi, I want to use editable choice editor with PyGridTableBase. When I edit a cell it is crashing What is error in my code? My python code: import wx import wx.grid as gridlib class MyTableBase(gridlib.PyGridTableBase): def __init__(self): gridlib.PyGridTableBase.__init__(self) self.data = {0:["value 1", "value 2"], 1:["value 3", "value 4", "value 5"]} self.column_labels = [unicode(u"Label 1"), unicode(u"Label 2"), unicode(u"Label 3")] self._rows = self.GetNumberRows() self._cols = self.GetNumberCols() def GetColLabelValue(self, col): return self.column_labels[col] def GetNumberRows(self): return len(self.data.keys()) def GetNumberCols(self): return len(self.column_labels) def GetValue(self, row, col): try: if col > self.GetNumberCols(): raise IndexError return self.data[row][col] except IndexError: return None def IsEmptyCell(self, row, col): if self.data[row][col] is not None: return True else: return False def GetAttr(self, row, col, kind): attr = gridlib.GridCellAttr() editor = gridlib.GridCellChoiceEditor(["xxx", "yyy", "zzz"], allowOthers = True) attr.SetEditor(editor) attr.IncRef() return attr class MyDataGrid(gridlib.Grid): def __init__(self, parent): gridlib.Grid.__init__(self, parent, wx.NewId()) self.base_table = MyTableBase() self.SetTable(self.base_table) if __name__ == '__main__': app = wx.App(redirect = False) frame = wx.Frame(None, wx.NewId(), title = u"Test") grid_ = MyDataGrid(frame) frame.Show() app.MainLoop()

    Read the article

  • which layout engine for finding coordinates of html elements on the web page?

    - by Mexx
    I am doing some web data classification task and was thinking if I could get the co-ordinates of html elements as they would appear on a web-browser without taking into consideration any css or javascript being referred in the web page. My language of programming is c++ and the need results for a couple million of pages, so it has to be fast. I know there is a Microsoft COM component which renders the page in a web browser control and then can be queried for position of different html tags. But this is not suitable in my case as it first renders the whole page which takes up a lot of time. So as I found out, there are open-source layout engines WebKit, Gecko that can probably be used for this. But that's a huge piece of code and I need someone to direct me to the right classes or right modules to look into or any previous/similar work someone has done previously. Also, please let me know what you guys think is a good choice if I want to customize the existing code for use with multiple threads to make it faster. Thanks

    Read the article

  • Push a bookmark to a user's home screen in Android

    - by JohnTheBarber
    Android 2.1 (not sure how much that matters) My test hardware is a Motorola Droid (not sure how much that matters either) I want to push a bookmark/internet-shortcut to a user's home screen as a result of them clicking on a link - via their browser of choice. I know they can usually set the bookmark themselves and then choose to put it on their home screen. But I'd like to provide a link like "Put a shortcut to this page on your home screen" that takes care of everything kind of in the background/underneath. Is this even possible? What parts of the framework would I need access to to make it happen?

    Read the article

  • Appropriate high level language to deal with binary data

    - by fortran
    Hi, I need to write a small tool that parses a textual input and generates some binary encoded data. I would prefer to stay away from C and the like, in favour of a higher level, (optionally) safer, more expressive and faster to develop language. My language of choice for this kind of tasks usually is Python, but for this case dealing with binary raw data can be problematic if one isn't very careful with the numbers being promoted to bignums, sign extensions and such. Ideally I would like to have records with named bitfields that are portable to be serialised in a consistent manner. (I know that there's a strong point in doing it in a language I already master, although it isn't optimal, but I think this could be a good opportunity to learn something new). Thanks.

    Read the article

  • Write a network simulator for fun

    - by Jono
    I want to write my own network simulator, for fun and for personal challenge. I hope to learn both new programming techniques, and a little bit more about networking. Previous object-oriented attempts ended very quickly, but I've recently downloaded and played with Microsoft's Axum (a new version was released today) and their Concurrency and Co-ordination Runtime. As I come from a very OO dominant background, I had never heard of Actor-oriented programming before; now it seems I've had my head in the sand until Scala and F# brought the paradigm to me. My questions are: a) is actor-oriented programming a better choice than object-oriented programming for this task, and if so b) where is a good place to start learning actor-oriented design?

    Read the article

  • Registering a delegate function with an ISO C++ callback (on mono)

    - by Stick it to THE MAN
    I am thinking of wrapping ISO C++ code in C# class. The only problem so far is how to deal with the C++ callbacks. In .Net languages (C# and Vb.Net), I believe the callback equivalent. Sticking with C# for now, can anyone recommend a way that I can register the C# delegate functions with my ISO C++ code. The ISO C++ code is a notification library, and I want to be able to "push" the notifications to the mono framework (i.e. C# delegates in this case). My underlying assumption is that the mechanism/steps to implement this would be the same for the .Net languages - I'll just have to code the actual delegates in the .Net language of choice - is that assumption correct? Last but not the least, is the question of thread saftey. The underlying ISO C++ code that I am exposing to .Net (mono to be more specific), is both re-ntrant and thread safe - do I have to do anything "extra" to call .Net delegate from my ISO C++ code?

    Read the article

  • purblic or private svn repository server?

    - by ajsie
    is there a good and free svn repository i could use to store files in a central location for other programming members to access? its a private project so i dont want other to have access to it. should i use a free one or set up my own svn repository. if the latter is a better choice, how do i do that? rent a vps/dedicated server for it? cause i have to have a 24*7 online server up and running i guess...

    Read the article

  • learning and "singing" Ruby with Sinatra

    - by microspino
    Hello I'm trying to improve my ruby knowledge by reading The Ruby Programming Language book. Reading Coders at work I saw that lot of the interviewees suggest to dive into a project source code to learn best practices to be aware of bad habits and of course to take new inspirations for how to do things. I decided to pick a project as more self contained as I could find. My choice was Sinatra since It's 1000 LOC. Is It a good project to learn? Do you suggest another one more simple (i.e. less LOCs)? I've tried to see rails machinery before but I came out scared from It.

    Read the article

  • Designing a peer to peer network

    - by Varun
    I am designing a simple peer to peer network. The basic architecture will be as follows: A central server- that keeps track of all the peers. The job of this server is to keep track of all the peers that join the network. Every peer could do things: a. Download a file from it's peer b. Push a file (send a file) to it's peer. Could anybody please tell me what would be the best design for such a system? What would be the problems that i might run into and so on. I am planning to use Java as the programming language to implement. Would it be a good choice? Also, is it necessary that i would need a Linux box to develop the system? or is it fine if i use a Windows machine? Your help will be much appreciated! Thanks!

    Read the article

  • Dynamically update Font Size of application with a single trigger in WPF

    - by Sukan
    I have an application which has different font sizes for different controls say Button: 10, TextBlock : 12 etc. I want to give options to the user where he can select any one of the below say Normal , Small, Big, Bigger. Suppose one selects "small" I would want to decrease every distinct font size by 2. If "Big", I would want to increase every font size by 2. I hope we can do this using converter sending actual font size as parameter and render as per the selected choice if I am not wrong. What will be the best option. Sorry if my doubt is absurd or silly. Thank you.

    Read the article

  • SQL Server: Primary Key Schema Largely Guid but Sometimes Integer Types...

    - by Code Sherpa
    OK, this may be a silly question but... I have inherited a project and am tasked with going over the primary key relationships. The project largely uses Guids. I say "largely" because there are examples where tables use integral types to reflect enumerations. For example, dbo.MessageFolder has MessageFolderId of type int to reflect public emum MessageFolderTypes { inbox = 1, sent = 2, trash = 3, etc... } This happens a lot. There are tables with primary keys of type int which is unavoidable because of their reliance on enumerations and tables with primary keys of type Guid which reflect the primary key choice on the part of the previous programmer. Should I care that the PK schema is spotty like this? It doesn't feel right but does it really matter? If this could create a problem, how do I get around it (I really can't move all PKs to type int without serious legwork and I have never heard of enumerations that have guid values)? Thanks.

    Read the article

< Previous Page | 89 90 91 92 93 94 95 96 97 98 99 100  | Next Page >