Search Results

Search found 3397 results on 136 pages for 'poor lil rich boy'.

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

  • Poor Ruby on Rails performance when using nested :include

    - by Jeremiah Peschka
    I have three models that look something like this: class Bucket < ActiveRecord::Base has_many :entries end class Entry < ActiveRecord::Base belongs_to :submission belongs_to :bucket end class Submission < ActiveRecord::Base has_many :entries belongs_to :user end class User < ActiveRecord::Base has_many :submissions end When I retrieve a collection of entries doing something like: @entries = Entry.find(:all, :conditions => ['entries.bucket_id = ?', @bucket], :include => :submission) The performance is pretty quick although I get a large number of extra queries because the view uses the Submission.user object. However, if I add the user to the :include statement, the performance becomes terrible and it takes over a minute to return a total of 50 entries and submissions spread across 5 users. When I run the associated SQL commands, they complete in well under a second. @entries = Entry.find(:all, :conditions => ['entries.bucket_id = ?', @bucket], :include => {:submission => :user}) Why would this second command have such terrible performance compared to the first?

    Read the article

  • GTK+ (GTKSharp) poor performance in Windows

    - by nubela
    Hi, In my Mono (C#) project that is meant to be cross-platform, I am using the GTK for the UI. However one thing I noticed is, on my netbook in Archlinux, the performance is really speedy, so events such as mouse hover, and redrawing of widgets, etc, are really fast. Compared to windows (7) on dual core CPUs, the performance is really really weak. Which perplexes me. Am I doing something wrong that is warranting this difference in performance between OSes? What are some ways I can do to optimize GTK on Windows? Its really bad to take around 0.5 secs for a hover event to kick in whereas its almost immediate on a weak(er) netbook with Linux. My code is here for the GUI layer: http://code.google.com/p/subsynct/source/browse/branches/dev/subsync#subsync/GUI Thanks!

    Read the article

  • A feature rich JavaScript IDE environment?

    - by jdk
    I'm currently using Visual Studio 2008 to edit .js files with, and it has decent support but I want more... I like the VS syntax highlighting and auto-indentation features but additionally would like advanced features like: contextual info and help, collapsible JavaScript blocks, implicit symbol understanding for searching, refactoring and that kind of thing; also warnings and errors for the js code. Suggestions?

    Read the article

  • Poor execution plans when using a filter and CONTAINSTABLE in a query

    - by Paul McLoughlin
    We have an interesting problem that I was hoping someone could help to shed some light on. At a high level the problem is as below: The following query executes quickly (1 second): SELECT SA.* FROM cg.SEARCHSERVER_ACTYS AS SA JOIN CONTAINSTABLE(CG.SEARCHSERVER_ACTYS, NOTE, 'reports') AS T1 ON T1.[Key]=SA.UNIQUE_ID but if we add a filter to the query, then it takes approximately 2 minutes to return: SELECT SA.* FROM cg.SEARCHSERVER_ACTYS AS SA JOIN CONTAINSTABLE(CG.SEARCHSERVER_ACTYS, NOTE, 'reports') AS T1 ON T1.[Key]=SA.UNIQUE_ID WHERE SA.CHG_DATE'19 Feb 2010' Looking at the execution plan for the two queries, I can see that in the second case there are two places where there are huge differences between the actual and estimated number of rows, these being: 1) For the FulltextMatch table valued function where the estimate is approx 22,000 rows and the actual is 29 million rows (which are then filtered down to 1670 rows before the join) and 2) For the index seek on the full text index, where the estimate is 1 row and the actual is 13,000 rows As a result of the estimates, the optimiser is choosing to use a nested loops join (since it assumes a small number of rows) hence the plan is inefficient. We can work around the problem by either (a) parameterising the query and adding an OPTION (OPTIMIZE FOR UNKNOWN) to the query or (b) by forcing a HASH JOIN to be used. In both of these cases the query returns in sub 1 second and the estimates appear reasonable. My question really is 'why are the estimates being used in the poorly performing case so wildly inaccurate and what can be done to improve them'? Statistics are up to date on the indexes on the indexed view being used here. Any help greatly appreciated.

    Read the article

  • Poor DB4O performance - What am I doing wrong?

    - by Jon
    I read Rob Conery's post about Object databases and thought I'd give it a go. I have a class lets say Book with 15 properties mostly string, some int, one Datetime and 2 decimals. I used Rob's code to open the database file etc to test on a Winforms project not a Web project. So I did the following: for(int i = 0; i < 1000000; i++) { var Book = new Book(); //Assign variables s.Save(Book); } s.CommitChanges(); This took at least a couple of minutes. I then tried to retrieve all data to test speed: var spp = s.All<Passports>(); This one line was quick, however, then doing: sppp.Count() as well as a seperate test doing a foreach loop and incrementing a counter took a couple of minutes. This seems quite slow to me. Am I doing something wrong or am I expecting too much?

    Read the article

  • Performance of map overlay in conjunction with ItemizedOverlay is very poor

    - by oviroa
    I am trying to display one png (drawable) on a map in about 300 points. I am retrieving the coordinates from a Sqlite table, dumping them in a cursor. When I try to display them by parsing through the cursor, it takes for ever for the images to be drawn, about .5 second per image. I find that to be suspiciously slow, so some insight on how I can increase performance would help. Here is the snippet of my code that does the rendering: while (!mFlavorsCursor.isAfterLast()) { Log.d("cursor",""+(i++)); point = new GeoPoint( (int)(mFlavorsCursor.getFloat(mFlavorsCursor.getColumnIndex(DataBaseHelper.KEY_LATITUDE))*1000000), (int)(mFlavorsCursor.getFloat(mFlavorsCursor.getColumnIndex(DataBaseHelper.KEY_LONGITUDE))*1000000)); overlayitem = new OverlayItem(point, "", ""); itemizedoverlay.addOverlay(overlayitem); itemizedoverlay.doPopulate(); mFlavorsCursor.moveToNext(); } mapOverlays.add(itemizedoverlay); I tried to isolate all the steps and it looks like the slow one is this: itemizedoverlay.doPopulate(); This is a public method in my class that extends ItemizedOverlay that runs the private populate() method.

    Read the article

  • Javascript Rich Display Component/Methodology

    - by Laramie
    quick back story-- I am working on ASP.Net based template editor that lets authors create text templates using Javascript inserted placeholder tags that will be filled in with dynamic text when the templates are used to display the final results. For example the author might create a template like The word [%12#add] was generated dynamically. The application would eventually replace the tag with a dynamic word down the road (though it's not specifically relevant to this post) The word foo was generated dynmamically. Depending on the circumstances, the template may be created in a text input, textarea or a modified version of the Ajax Control Toolkit HTML Editor. There might be 40 or more of these editable elements on the page, so using lots of stripped down or modified HTML editors would probably bog the page down too much. The problem is that the tags such as [%12#add] are displayed inline with the user text and the result is confusing and aesthetically gross. The goal is parse the contens of the source element and when a tags such as [%12#add] are encountered, display something prettier and less cryptic to the user such as a stylable element or image wherever tags such as [%12#add] occur. The application still needs the template text with the tags on postback. So the user might see The word tag placeholder was generated dynamically. but the original template would still be the value of the text input box The word [%12#add] was generated dynamically. It seems HTML editors like the ACT version and FckEditor accomplish this by rendering their output in an IFrame, but rather than kill myself trying to roll a lighter specialized version myself, I thought I'd ask if anyone knows of an existing free component or approach that has already tackled this. With good reason, I don't think S.O. allows HTML formatting, but the bold "tag placeholder" above would ideally be something like tag placeholder.

    Read the article

  • creating dynamic rich:dropdownmenu

    - by santhana sankar
    MethodExpression methodExpression = application.getExpressionFactory().createMethodExpression( FacesContext.getCurrentInstance().getELContext(), "#{PrismBacking.onItemClick}", null, new Class[] { ActionEvent.class }); menuItem.setActionExpression(methodExpression); I created a dynamic drop down as above my creating action listener but the listener was not called. I included the method inside the getter of dropdown in backing bean. Do I have to configure the action listener in any of the config files. kindly help.

    Read the article

  • Excel macro send rich mail using LotusNotes

    - by CC
    Hi everybody. I'm working on a small macro to send mail from excel 2007 using my Lotus Notes session. The sending mail part is working fine. Now I need to send in the body part, a part of a stylesheet (for instance the area from A1:B20). This area has colors, bold font. To send my email here is the code: Set oSess = CreateObject("Notes.NotesSession") Set oDB = oSess.GETDATABASE("", "") Call oDB.OPENMAIL flag = True If Not (oDB.IsOpen) Then flag = oDB.Open("", "") If Not flag Then MsgBox "Can't open mail file: " & oDB.SERVER & " " & oDB.FILEPATH End If On Error GoTo err_handler 'Building Message Set oDoc = oDB.CREATEDOCUMENT Set oItem = oDoc.CREATERICHTEXTITEM("BODY") oDoc.Form = "Memo" 'mail subject oDoc.Subject = "subject" 'mail body oDoc.sendto = "[email protected]" oDoc.body = "my text" oDoc.postdate = Date oDoc.SaveMessageOnSend = True oDoc.visable = True 'Sending Message oDoc.SEND False Does anybody has an idea about how to send a stylesheet ? Thanks alot.

    Read the article

  • Javascript Rich Display WYSIWYG Component/Methodology

    - by Laramie
    quick back story-- I am working on ASP.Net based template editor that lets authors create text templates using Javascript inserted placeholder tags that will be filled in with dynamic text when the templates are used to display the final results. For example the author might create a template like The word [%12#add] was generated dynamically. The application would eventually replace the tag with a dynamic word down the road (though it's not specifically relevant to this post) The word foo was generated dynmamically. Depending on the circumstances, the template may be created in a text input, textarea or a modified version of the Ajax Control Toolkit HTML Editor. There might be 40 or more of these editable elements on the page, so using lots of stripped down or modified HTML editors would probably bog the page down too much. The problem is that the tags such as [%12#add] are displayed inline with the user text and the result is confusing and aesthetically gross. The goal is parse the contens of the source element and when a tags such as [%12#add] are encountered, display something prettier and less cryptic to the user such as a stylable element or image wherever tags such as [%12#add] occur. The application still needs the template text with the tags on postback. So the user might see The word tag placeholder was generated dynamically. but the original template would still be the value of the text input box The word [%12#add] was generated dynamically. It seems HTML editors like the ACT version and FckEditor accomplish this by rendering their output in an IFrame, but rather than kill myself trying to roll a lighter specialized version myself, I thought I'd ask if anyone knows of an existing free component or approach that has already tackled this. With good reason, I don't think S.O. allows HTML formatting, but the bold "tag placeholder" above would ideally be something like tag placeholder.

    Read the article

  • Poor performance using RMI-proxies with Swing components

    - by Patrick
    I'm having huge performance issues when I add RMI proxy references to a Java Swing JList-component. I'm retrieving a list of user Profiles with RMI from a server. The retrieval itself takes just a second or so, so that's acceptable under the circumstances. However, when I try to add these proxies to a JList, with the help of a custom ListModel and a CellRenderer, it takes between 30-60 seconds to add about 180 objects. Since it is a list of users' names, it's preferrable to present them alphabetically. The biggest performance hit is when I sort the elements as they get added to the ListModel. Since the list will always be sorted, I opted to use the built-in Collections.binarySearch() to find the correct position for the next element to be added, and the comparator uses two methods that are defined by the Profile interface, namely getFirstName() and getLastName(). Is there any way to speed this process up, or am I simply implementing it the wrong way? Or is this a "feature" of RMI? I'd really love to be able to cache some of the data of the remote objects locally, to minimize the remote method calls.

    Read the article

  • Poor man's "lexer" for C#

    - by Paul Hollingsworth
    I'm trying to write a very simple parser in C#. I need a lexer -- something that lets me associate regular expressions with tokens, so it reads in regexs and gives me back symbols. It seems like I ought to be able to use Regex to do the actual heavy lifting, but I can't see an easy way to do it. For one thing, Regex only seems to work on strings, not streams (why is that!?!?). Basically, I want an implementation of the following interface: interface ILexer : IDisposable { /// <summary> /// Return true if there are more tokens to read /// </summary> bool HasMoreTokens { get; } /// <summary> /// The actual contents that matched the token /// </summary> string TokenContents { get; } /// <summary> /// The particular token in "tokenDefinitions" that was matched (e.g. "STRING", "NUMBER", "OPEN PARENS", "CLOSE PARENS" /// </summary> object Token { get; } /// <summary> /// Move to the next token /// </summary> void Next(); } interface ILexerFactory { /// <summary> /// Create a Lexer for converting a stream of characters into tokens /// </summary> /// <param name="reader">TextReader that supplies the underlying stream</param> /// <param name="tokenDefinitions">A dictionary from regular expressions to their "token identifers"</param> /// <returns>The lexer</returns> ILexer CreateLexer(TextReader reader, IDictionary<string, object> tokenDefinitions); } So, pluz send the codz... No, seriously, I am about to start writing an implementation of the above interface yet I find it hard to believe that there isn't some simple way of doing this in .NET (2.0) already. So, any suggestions for a simple way to do the above? (Also, I don't want any "code generators". Performance is not important for this thing and I don't want to introduce any complexity into the build process.)

    Read the article

  • Create a rich text control field in VBA for Word 2010

    - by mkn
    I have a control field where I dynamically add certain text. That works well so far. The problem is that in one text I have an input field where the user can type in text. I need to hardcode the form text input field into the VBA code. How is this achieved? Or can someone point me in the right direction? In the following code snippet I need to replace the [InputField] by a VBA input field. ActiveDocument.SelectContentControlsByTitle("Bottom").Item(1).Range.Text = _ "Some Text" & vbNewLine & _ "Some Text" & vbNewLine & _ "Some Text" & vbNewLine & _ "Text [InputField] Text"

    Read the article

  • Is F# a poor choice for a functional language

    - by dagda1
    Hi, To me, I think F# is a bad choice due to the fact that it uses threads behind the scenes. To me, threads are too "heavy" due to things like context switching. I can see why Erlang is a good choice because it uses light weight processes. Am I wrong? Cheers Paul

    Read the article

  • Are Tuples a poor design decision in C#?

    - by Jason Webb
    With the addition of the Tuple class in .net 4, I have been trying to decide if using them in my design is a bad choice or not. The way I see it, a Tuple is a shortcut to writing a result class (I am sure there are other uses too). So this: public class ResultType { public string StringValue { get; set; } public int IntValue { get; set; } } public ResultType GetAClassedValue() { //..Do Some Stuff ResultType result = new ResultType { StringValue = "A String", IntValue = 2 }; return result; } Is equivalent to this: public Tuple<string, int> GetATupledValue() { //...Do Some stuff Tuple<string, int> result = new Tuple<string, int>("A String", 2); return result; } So setting aside the possibility that I am missing the point of Tuples, is the example with a Tuple a bad design choice? To me it seems like less clutter, but not as self documenting and clean. Meaning that with the type ResultType, it is very clear later on what each part of the class means but you have extra code to maintain. With the Tuple<string, int> you will need to look up and figure out what each Item represents, but you write and maintain less code. Any experience you have had with this choice would be greatly appreciated.

    Read the article

  • Poor Transparency on Images

    - by KyleStew
    I am having problems getting transparency to work well on an ImageView. The images at (http://img265.imageshack.us/img265/6233/whatn.png) were screen captured from a Droid (hdpi). The top image I made in Photoshop and left the background white. The bottom image is the same image with the background transparent and the layout's color (white) shows through. Whenever I have transparent backgrounds in images it dithers shadows like this. Also, it only happens on hdpi devices, on my G1 (mdpi) it looks just fine. What is going on? How can I make the bottom image look as good as the top one?

    Read the article

  • converting compressed Rich text (C#)

    - by Code Smack
    Hello, I have a string with CompressedRichText in it. I want to uncompressed it to standard RTF and then to plain Text. I am using VS 2008 C# Windows Application. I found references to C++ code to do it, but nothing directly in C#. here is a sample of what I am thinking... not much code though... private string _CompressedRichText = "5A46751234E1234A3214C12D34213412346F4"; private void button1_Click(object sender, EventArgs e) { //Convert to Uncompressed RTF richTextBox1.Text = //Some action //Convert to text textBox1.Text = //some action } This will at least give you an example of what I am thinking.

    Read the article

  • How to disable dragging from a Rich Edit Control

    - by John
    I use a subclass of CRichEditCtrl to provide a CEdit+ type control. One thing I want is to disable drag-drop functionality, which the base class provided by default. Disabling dropping is easy: ::RevokeDragDrop(m_hWnd); But I can't see a simple way to disable the control being a drag-source. Is there an easy way?

    Read the article

  • Rich image scroll and zooming on android

    - by F0RR
    I'm looking for a way to implement image zoom and scrolling the way it is implemented in Droid Comic Viewer. Is there any quick way to do that? If not, then could you please give some advices at least on implementing kinetic scrolling.

    Read the article

  • Poor performance / speed of regex with lookahead

    - by Hugo Zaragoza
    I have been observing extremely slow execution times with expressions with several lookaheads. I suppose that this is due to underlying data structures, but it seems pretty extreme and I wonder if I do something wrong or if there are known work-arounds. The problem is determining if a set of words are present in a string, in any order. For example we want to find out if two terms "term1" AND "term2" are somewhere in a string. I do this with the expresion: (?=.*\bterm1\b)(?=.*\bterm2\b) But what I observe is that this is an order of magnitude slower than checking first just \bterm1\b and just then \bterm2\b This seems to indicate that I should use an array of patterns instead of a single pattern with lookaheads... is this right? it seems wrong... Here is an example test code and resulting times: public static void speedLookAhead() { Matcher m, m1, m2; boolean find; int its = 1000000; // create long non-matching string char[] str = new char[2000]; for (int i = 0; i < str.length; i++) { str[i] = 'x'; } String test = str.toString(); // First method: use one expression with lookaheads m = Pattern.compile("(?=.*\\bterm1\\b)(?=.*\\bterm2\\b)").matcher(test); long time = System.currentTimeMillis(); ; for (int i = 0; i < its; i++) { m.reset(test); find = m.find(); } time = System.currentTimeMillis() - time; System.out.println(time); // Second method: use two expressions and AND the results m1 = Pattern.compile("\\bterm1\\b").matcher(test); m2 = Pattern.compile("\\bterm2\\b").matcher(test); time = System.currentTimeMillis(); ; for (int i = 0; i < its; i++) { m1.reset(test); m2.reset(test); find = m1.find() && m2.find(); } time = System.currentTimeMillis() - time; System.out.println(time); } This outputs in my computer: 1754 150

    Read the article

  • Alternatives to UIWebView for rich content?

    - by ojreadmore
    In my app, I am displaying 4 "tabs", each are local content through a UIWebView. I create HTML markup from my simple data. This is slow to load and I'm trying to speed it up. I'm using UIWebView to accomplish these: 1. hyperlinks 2. some styling - font colors 3. HTML tables Writing my own class to handle this is okay for (1.) hyperlinks - I can use a touch event to call a method. And (2.) styling - I can use UILables to do basic formatting, no biggie here. BUT what I really love about the UIWebViews is the (3.) HTML tables! I find it troublesome to line up the UILabels in a way that mimics HTML Tables, for instance, one cell's height in a row changes the height of all cells. I'm looking for another perspective or knowledge of an alternative.

    Read the article

  • android accelerometer accuracy is extremely poor

    - by user564594
    Wrote a simple program that prints out accelerometer output. mSensorManager = (SensorManager)getSystemService(SENSOR_SERVICE); mSensorManager.registerListener(this,mSensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER), SensorManager.SENSOR_DELAY_FASTEST); It turns out that: The accelerometer output is always set to "lowest" as determined by: public void onAccuracyChanged(Sensor sensor, int accuracy) { if (collectingData){ accelPrecision.setText("accelerometer accuracy: " + accuracy); } } The actual accelerometer readings are very inaccurate - about 2%-5% fluctuations even when it's resting on the table as far as I can tell it's the same problem on Nexus S, Nexus One and G1 Any idea how it could be made mode accurate / what sets a

    Read the article

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