Search Results

Search found 1056 results on 43 pages for 'richard knop'.

Page 24/43 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Python most common element in a list

    - by Richard
    What is an efficient way to find the most common element in a Python list? My list items may not be hashable so can't use a dictionary. Also in case of draws the item with the lowest index should be returned. Example: >>> most_common(['duck', 'duck', 'goose']) 'duck' >>> most_common(['goose', 'duck', 'duck', 'goose']) 'goose'

    Read the article

  • How to find out where alias (in the bash sense) is defined when running Terminal in Mac OS X

    - by Richard Fuhr
    How can I find out where an alias is defined on my system? I am referring to the kind of alias that is used within a Terminal session launched from Mac OS X (10.6.3). For example, if I enter the alias command with no parameters at a Terminal command prompt, I get a list of aliases that I have set, for example, this is one of them alias mysql='/usr/local/mysql/bin/mysql' However, I have searched all over my system using Spotlight and mdfind in various startup files and so far can not find where this alias has been defined ( I did it a long time ago and didn't write down where I assigned the alias).

    Read the article

  • SQL Server, temporary tables with truncate vs table variable with delete

    - by Richard
    I have a stored procedure inside which I create a temporary table that typically contains between 1 and 10 rows. This table is truncated and filled many times during the stored procedure. It is truncated as this is faster than delete. Do I get any performance increase by replacing this temporary table with a table variable when I suffer a penalty for using delete (truncate does not work on table variables) Whilst table variables are mainly in memory and are generally faster than temp tables do I loose any benefit by having to delete rather than truncate?

    Read the article

  • Math operations in nHibernate Criteria Query

    - by Richard Tasker
    Dear All, I am having troubles with a nHibernate query. I have a db which stores vehicle info, and the user is able to search the db by make, model, type and production dates. Make, model & type search is fine, works a treat, it is the productions dates I am having issues with. So here goes... The dates are stored as ints (StartMonth, StartYear, FinishMonth, FinishYear), when the end-user selects a date it is passed to the query as an int eg 2010006 (2010 * 100 + 6). below is part of the query I am using, FYI I am using Lambda Extensions. if (_searchCriteria.ProductionStart > 0) { query.Add<Engine>(e => ((e.StartYear * 100) + e.StartMonth) >= _searchCriteria.ProductionStart); } if (_searchCriteria.ProductionEnd > 0) { query.Add<Engine>(e => ((e.FinishYear * 100) + e.FinishMonth) <= _searchCriteria.ProductionEnd); } But when the query runs I get the following message, Could not determine member from ((e.StartYear * 100) + e.StartMonth) Any help would be great, Regards Rich

    Read the article

  • CakePHP - How to use onError in Model

    - by Richard
    I've created a custom datasource which fetches data from a web api, and I'm now looking at implementing error handling. In the datasource, I'm calling $model-onError(). In the model, I've created the onError method, and I can access error details with $this-getDataSource()-error; However I can't redirect or set a flash message because that can only take place in the controller, so what should I be doing here to communicate the error to the user?

    Read the article

  • Why does a newly created EF-entity throw an ID is null exception when trying to save?

    - by Richard
    I´m trying out entity framework included in VS2010 but ´ve hit a problem with my database/model generated from the graphical interface. When I do: user = dataset.UserSet.CreateObject(); user.Id = Guid.NewGuid(); dataset.UserSet.AddObject(user); dataset.SaveChanges(); {"Cannot insert the value NULL into column 'Id', table 'BarSoc2.dbo.UserSet'; column does not allow nulls. INSERT fails.\r\nThe statement has been terminated."} The table i´m inserting into looks like so: -- Creating table 'UserSet' CREATE TABLE [dbo].[UserSet] ( [Id] uniqueidentifier NOT NULL, [Name] nvarchar(max) NOT NULL, [Username] nvarchar(max) NOT NULL, [Password] nvarchar(max) NOT NULL ); GO -- Creating primary key on [Id] in table 'UserSet' ALTER TABLE [dbo].[UserSet] ADD CONSTRAINT [PK_UserSet] PRIMARY KEY CLUSTERED ([Id] ASC); GO Am I creating the object in the wrong way or doing something else basic wrong?

    Read the article

  • What makes static initialization functions good, bad, or otherwise?

    - by Richard Levasseur
    Suppose you had code like this: _READERS = None _WRITERS = None def Init(num_readers, reader_params, num_writers, writer_params, ...args...): ...logic... _READERS = new ReaderPool(num_readers, reader_params) _WRITERS = new WriterPool(num_writers, writer_params) ...more logic... class Doer: def __init__(...args...): ... def Read(self, ...args...): c = _READERS.get() try: ...work with conn finally: _READERS.put(c) def Writer(...): ...similar to Read()... To me, this is a bad pattern to follow, some cons: Doers can be created without its preconditions being satisfied The code isn't easily testable because ConnPool can't be directly mocked out. Init has to be called right the first time. If its changed so it can be called multiple times, extra logic has to be added to check if variables are already defined, and lots of NULL values have to be passed around to skip re-initializing. In the event of threads, the above becomes more complicated by adding locking Globals aren't being used to communicate state (which isn't strictly bad, but a code smell) On the other hand, some pros: its very convenient to call Init(5, "user/pass", 2, "user/pass") It simple and "clean" Personally, I think the cons outweigh the pros, that is, testability and assured preconditions outweigh simplicity and convenience.

    Read the article

  • sort associative array in awk - help?

    - by Richard
    Hi all, I have an associative array in awk that gets populated like this... chr_count[$3]++ When I try to print my chr_counts I use this: for (i in chr_count) { print i,":",chr_count[i]; } But not surprisingly, the order of i is not sorted in any way. Is there an easy way to iterate over the sorted "keys" of chr_count?

    Read the article

  • Source Control icons have disappeared in Visual Studio 2010

    - by Richard West
    Today I installed Visual Studio 2010 Ultimate - RTM. One item that I noticed that is different is that files listed in the Solution Explorer window not longer display the source control icons beside each file (the lock, unlocked, plus sign for new files, etc.). Is there a setting that I am overlooking to display these icons? I have setup Visual Studio 2010 to use my source control client correctly (SourceGear Vault), and it does appear to be working OK -- I'm just used to seeing the little icons by each file. Anyone out there experiencing this problem? Is there something I can do to get the icons back?

    Read the article

  • ASP.NET Chart Control errors in Event Viewer

    - by Richard Reddy
    Hi, I have been using the ASP.NET chart controls for a while on win2k3 (32bit) setups without any issue but have noticed that on our new win2k8 (64bit) box I am getting a warning message showing up in the event viewer from the chart control. In my web.config file I have the following tag telling the Chart Control where I can store the Temp Files: <add key="ChartImageHandler" value="storage=file;timeout=20;dir=c:\TempImageFiles\;" /> Below is the warning message produced by the control: Event code: 3005 Event message: An unhandled exception has occurred. Event time: 10/7/2009 2:40:03 PM Event time (UTC): 10/7/2009 2:40:03 PM Event ID: 237c3b208962429e8bbc5a48ffd177f0 Event sequence: 2860 Event occurrence: 26 Event detail code: 0 Application information: Application domain: /LM/W3SVC/2/ROOT-1-128993655360497729 Trust level: Full Application Virtual Path: / Application Path: C:\data\sites\mydomain.com\ Machine name: 231692-WEB Process information: Process ID: 4068 Process name: w3wp.exe Account name: NT AUTHORITY\NETWORK SERVICE Exception information: Exception type: ArgumentException Exception message: The image is not found. Request information: Request URL: http://www.mydomain.com/ChartImg.axd?i=chart%5F0%5F3.png&g=bccc8aa11abb470980c60e8cf1e71e15 Request path: /ChartImg.axd User host address: my domain ip User: Is authenticated: False Authentication Type: Thread account name: NT AUTHORITY\NETWORK SERVICE Thread information: Thread ID: 7 Thread account name: NT AUTHORITY\NETWORK SERVICE Is impersonating: False Stack trace: at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.ProcessSavedChartImage(HttpContext context) at System.Web.UI.DataVisualization.Charting.ChartHttpHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) It's worth pointing out that ALL of the chart images are displayed correctly on the screen so I'm not sure when/where the image not found error is being caused. Is this a 64bit issue? Thanks, Rich

    Read the article

  • NUnit does not capture output of std::cerr

    - by Richard
    I have an nunit Test in C#, that calls a C# wrapper of a function in a C++ DLL. The C++ code uses std::cerr to output various messages. These messages cannot be redirected using nunit-console /out /err or /xml switch. In nunit (the GUI version) the output does not appear anywhere. I would like to be able to see this output in nunit (GUI version). Ideally I would like to be able to access this output in the Test. Thanks for any help.

    Read the article

  • What did I lose when I upgraded?

    - by Richard
    I upgraded my work box from Vista64 to Win7-64 by doing a format and reinstall. I kept backups of the project done in MS Visual Studio 2008 (Team). But now it won't compile. I am getting errors generated on lines in the MS created header files like "'_In_' not defined" etc. I know it is because I lost some compiler setting/directive. I was sure that the compiler settings would be in the project file; now I see that things like the include file directories, LIB files, etc. are not. [FYI: The project is a VB.NET GUI with VC++ DLL talking to a PIC24 micro over USB.] How do I most efficiently get my project back on the road to execution?

    Read the article

  • Looking for a reporting tool that will allow vector graphics in output file (PDF)

    - by Richard West
    I have been tasked with evaluating our current system that we use for creating and outputing reports. Currently we are using Crystal Reports ver 8, (I know that this is and old version.), which has a custom commandline app that we wrote in C# to execute the report for a given parameter passed through the command line. We like Crystal becuase it's easy to setup and design the report. It's also easy to print and create a PDF file from crystal using our custom commandline program. One of the problems/complaints that we have is that Crystal does does not appear to have a method that will allow us to create a PDF file with a vector images, such as our company logo. Crystal Reports always converts an image into a bitmap. When the PDF is printed, the results are less than flattering, and the PDF file size is increased. Does anyone have any recomendadtions for a reporting product that we should consider?

    Read the article

  • Java App Engine - ranked counter

    - by Richard
    I understand the sharded counter, here: http://code.google.com/appengine/articles/sharding_counters.html The problem is that a simple counter will not work in my application. I am sorting my entities by a particular variable so I am returned not so much a count, but more of a rank. My current method is: SELECT COUNT(this) FROM Entity.class WHERE value <= ? Result + 1 is then the rank of the parameter in relation to the value variable in the persistent Entity objects. The limitation of this is the highest rank being returned is 1001 because count() can give a maximum of 1000. The reason I cannot store the rank on the Entity object is that the ranks are updated very often, and re-setting this rank variable would be much too costly. Any ideas on the best way to accomplish this?

    Read the article

  • jQuery UI datepicker performance

    - by Richard Ev
    I have a textbox on my web page that is used to specify a date, so I'd like to use the jQuery DatePicker. However, most of my users are locked into using IE6 and the performance of the jQuery DatePicker is a little sluggish in this browser. Can anyone recommend an alternate JavaScript date picker, or any means of improving the display performance of the jQuery DatePicker?

    Read the article

  • TortoiseGit - representing branches in a tree - visual issue

    - by richard
    This is a little hard to explain with text, but I'll do my best, and you try to keep up; if something isn't clear at first, don't hesitate to ask, and I'll try to clarify. When TortoiseGit has one branch it looks approximately like this: o | o <-- a commit sign | x When I split my work into a new branch, it looks like this: o | o--o | x when I split, from the master to another new branch it looks like this: o--o | o--o | x Is there a way for every new branch that I make, and work on, to have its own "line" ... what I mean: o-----o | o--o | x so they don't "vertically overlap". So that every branch, has its own vertical line I can follow (for some reason this looks rather confusing to me, the way it's done now). Do any other Git clients for Windows do this differently ?

    Read the article

  • Using TortoiseGit deleting all after a certain commit

    - by richard
    Using TortoiseGit (I'm trying to avoid command line usage) how does one delete all commits that accended from a certain commit, and "get back in the past" (example usage: continued doing something, figured I didn't like where it was going, and decided to go "back" disregarding all in between).

    Read the article

  • Powershell advanced functions: are optional parameters supposed to get initialized?

    - by Richard Berg
    filter CountFilter($StartAt = 0) { Write-Output ($StartAt++) } function CountFunction { [CmdletBinding()] param ( [Parameter(ValueFromPipeline=$true, Mandatory=$true)] $InputObject, [Parameter(Position=0)] $StartAt = 0 ) process { Write-Output ($StartAt++) } } $fiveThings = $dir | select -first 5 # or whatever "Ok" $fiveThings | CountFilter 0 "Ok" $fiveThings | CountFilter "Ok" $fiveThings | CountFunction 0 "BUGBUG ??" $fiveThings | CountFunction I searched Connect and didn't find any known bugs that would cause this discrepancy. Anyone know if it's by design?

    Read the article

  • Inflated ImageView to put in GalleryView isn't the right size

    - by Richard
    I am trying to inflate an ImageView that scales a Drawable that I can display in a GalleryView. My code to inflate the view seems to work fine, except that the attributes of the ImageView are not applied. Specifically, the inflated ImageView does not have the width/height that I set for it via the android:layout params in XML. Can someone show me what I'm doing wrong? I want to set the width/height of the image in dp, so that it is the correct size across multiple screen dpis and support Android 1.5+. As a result I cannot use something like: i.setLayoutParams(new Gallery.LayoutParams(150, 116) My layout definition is: <?xml version="1.0" encoding="utf-8"?> <ImageView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="150dp" android:layout_height="116dp" android:background="@drawable/gallery_item_background" android:scaleType="fitXY" /> </ImageView> And the snippet I am using to inflate the ImageView is: public View getView(int position, View convertView, ViewGroup parent) { LayoutInflater inflater = getLayoutInflater(); ImageView i = (ImageView) inflater.inflate(R.layout.gallery_item, null); i.setImageResource(mImageIds.get(position)); i.setScaleType(ImageView.ScaleType.FIT_XY); return i; }

    Read the article

  • Sql Server Compact - Schema Management

    - by Richard B
    I've been searching for some time for a good solution to implement the idea of managing schema on a Sql Server Compact 3.5 db. I know of several ways of managing schema on Sql Express/std/enterprise, but Compact Edition doesn't support the necessary tools required to use the same methodology. Any suggestions/tips? I should expand this to say that it is for 100+ clients with wrapperware software. As the system changes, I need to publish update scripts alongside the new binaries to the client. I was looking for a decent method by which to publish this without having to just hand the client a script file and say "Run this in SSMSE". Most clients are not capable of doing such a beast. A buddy of mine disclosed a partial script on how to handle the SQL Server piece of my task, but never worked on Compact Edition... It looks like I'll be on my own for this. What I think that I've decided to do, and it's going to need a "geek week" to accomplish, is that I'm going to write some sort of tool much like how WiX and nAnt works, so that I can just write an overzealous Xml document to handle the work. If I think that it is worthwhile, I'll publish it on CodePlex and/or CodeProject because I've used both sites a bit to gain better understanding of concepts for jobs I've done in the past, and I think it is probably worthwhile to give back a little.

    Read the article

  • Simple ranking algorithm in Groovy

    - by Richard Paul
    I have a short groovy algorithm for assigning rankings to food based on their rating. This can be run in the groovy console. The code works perfectly, but I'm wondering if there is a more Groovy or functional way of writing the code. Thinking it would be nice to get rid of the previousItem and rank local variables if possible. def food = [ [name:'Chocolate Brownie',rating:5.5, rank:null], [name:'Pizza',rating:3.4, rank:null], [name:'Icecream', rating:2.1, rank:null], [name:'Fudge', rating:2.1, rank:null], [name:'Cabbage', rating:1.4, rank:null]] food.sort { -it.rating } def previousItem = food[0] def rank = 1 previousItem.rank = rank food.each { item -> if (item.rating == previousItem.rating) { item.rank = previousItem.rank } else { item.rank = rank } previousItem = item rank++ } assert food[0].rank == 1 assert food[1].rank == 2 assert food[2].rank == 3 assert food[3].rank == 3 // Note same rating = same rank assert food[4].rank == 5 // Note, 4 skipped as we have two at rank 3 Suggestions?

    Read the article

  • ignore firebug console when not installed

    - by Richard
    I use Firebug's console.log() for debugging my website. If I try viewing my website in browsers without Firebug then I get a console is not defined error. Is there a way to gracefully avoid this error? I found this potential solution, but it seems a bit cumbersome. And ideas?

    Read the article

  • open source alternatives to popular websites

    - by Richard
    Hello, The other day I came across Jaiku, which is a well structured microblogging system open sourced by Google. It surprised me I had never heard about this, so I was wondering what other open source alternatives exist for mainstream websites? I am not asking about forums, eCommerce, wiki's, CMS's, etc, where the market leaders are already well known open source applications (phpBB, osCommerce, Mediawiki, Drupal). But what about open source alternatives for: Social networking (Facebook)? Classified advertising (Craigslist)? Jobs (CareerBuilder)? Dating (eHarmony)? Or any other field that is defined by a commercial website, as Twitter does for microblogging.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >