Daily Archives

Articles indexed Monday March 29 2010

Page 17/123 | < Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >

  • WMD editor freezes IE7 for 3 seconds on load

    - by dhruvbird
    Hello all, I am using the WMD editor's original code(not the stackoverflow version) since I need multiple of 'em on the same page and stackoverflow's version makes heavy use of element IDs internally since they aren't going to be having more than one editor instance per page. The code runs fin in FF 3.5, etc.. However, when I run it in IE8 (in IE7 compatibility mode), it freezes the whole browser for about 3 sec. before a new instance shows up. I tried profiling it with IE's dev. tools, and it seems that the getWidth() function on line 520 of the minified version of the code is taking up all the time. However, when I tried to hard-code the return (since it was always returning the same thing), the bottleneck shifted to the getHeight() function. I am attaching the code I am using to convert it to a jQuery plugin. jQuery.fn.wmd = function(params) { function createInstance(container, params) { /* Make sure WMD has finished loading */ if (!Attacklab || !Attacklab.wmd) { alert("WMD hasn't finished loading!"); return; } var defaultParams = { width : "600px", rows : 6, autogrow : false, preview : false, previewDivClassName: "wmd-preview-div" }; if (typeof(params) == "undefined") { var params = defaultParams; } else { var params = jQuery.extend({}, defaultParams, params); } /* Build the DOM elements */ var textarea = document.createElement("textarea"); textarea.style.width = params.width; textarea.rows = params.rows; jQuery(container).append(textarea); var previewDiv = document.createElement("div"); if (params.preview) { jQuery(previewDiv).addClass(params.previewDivClassName); jQuery(container).append(previewDiv); } /* Build the preview manager */ var panes = {input:textarea, preview:previewDiv, output:null}; var previewManager = new Attacklab.wmd.previewManager(panes); /* Build the editor and tell it to refresh the preview after commands */ var editor = new Attacklab.wmd.editor(textarea,previewManager.refresh); /* Save everything so we can destroy it all later */ var wmdInstance = {ta:textarea, div:previewDiv, ed:editor, pm:previewManager}; var wmdInstanceId = $(container).attr('postID'); wmdInstanceProcs.add(wmdInstanceId, wmdInstance); if (params.autogrow) { // $(textarea).autogrow(); } }; if (jQuery(this).html().length > 0) { var wmdInstanceId = jQuery(this).attr('postID'); var inst = wmdInstanceProcs.get(wmdInstanceId); jQuery(inst.ta).show(); } else { createInstance(this, params); } } jQuery.fn.unwmd = function(params) { var wmdInstanceId = $(this).attr('postID'); var inst = wmdInstanceProcs.get(wmdInstanceId); if (inst != null) { jQuery(inst.ta).hide(); } } wmdInstanceProcs = function() { var wmdInstances = { }; var getProc = function(wmdInstanceId) { var inst = wmdInstances[wmdInstanceId]; if (typeof(inst) != "undefined") { return inst; } else { return null; } }; var addProc = function(wmdInstanceId, wmdInstance) { wmdInstances[wmdInstanceId] = wmdInstance; }; return { add: addProc, get: getProc }; }(); Any help would be much appreciated.

    Read the article

  • Update website with a single command (git push) instead of FTP drag and dropping

    - by Wolfr
    Situation: I have a local copy of a website I have a server that I have SSH access to What do I want to do? Commit locally until I'm happy with my code Make branches locally Have one master branch that is the one that should be pushed to the server Update the website using a single command (git push origin master) If I set up a git repo locally using git init, and then push to a folder on the server, it doesn't work. When I FTP to the server to check the files, they're actually there. When I SSH into the server and do git status, it's not clean, even though it should be since I just pushed to the server. Steps I'm doing: Make a new folder on my computer (mkdir folder_x) Go into that folder (cd folder_x) Set up a new git repository there (git init) (git repository sets up successfully) Push the repository to the server using git push origin master (where origin is set up as user:[email protected])

    Read the article

  • Fixing VB6 inaccurate mathmetical results due to rounding

    - by jay
    Try running this in a .VBS file MsgBox(545.14-544.94) You get a neat little answer of 0.199999999999932! This rounding issue also occurs unfortunately in Sin(2 * pi) since VB can only ever see the (user defined) variable pi as accurate as 3.14159265358979. Is rounding it manually (and loosing accuracy) the only way to improve the result? What is the most effective way of dealing with this kind of problem?

    Read the article

  • Existing web-site CSS replacement (re-skinning) best-practices without changing the HTML

    - by Enigmativity
    I can see a number of other good answers to questions relating to CSS best-practices on stack overflow: How to Manage CSS Explosion CSS Conventions / Code Layout Models Are there any CSS standards that I should follow while writing my first stylesheet? What is the best method for tidying CSS? Best Practices - CSS Stylesheet Formatting But I think I have a different problem. I'm trying to "re-skin" an existing site that has been nicely built using div's and ul's, etc, and it has a good existing CSS file, but when I start making changes to the CSS I quickly find that I break the layout. My feeling is that it is very hard to get a feel for how all the CSS will work together and indeed what CSS is affecting parent and sibling elements in the HTML. So, my question is "what are the best-practices around re-skinning an existing web-site by replacing the CSS only and not modifying the existing HTML?" I can't change the classes, ids, node hierarchy, etc. An example of the particular site that I am trying to re-skin is http://demo.nopcommerce.com/. The existing CSS can be as complicated/detailed as this extract from the main CSS file: .header-selectors-wrapper { text-align: right; float: right; width: 500px; } .header-currencyselector { float: right; } .header-languageselector { float: left; } .header-taxDisplayTypeSelector { float: right; } .header-links-wrapper { float: right; text-align: right; width: 570px; } .header-links { border: solid 1px #9a9a9a; padding: 5px 5px 5px 5px; margin-bottom: 5px; display: inline-table; } .order-summary-content .cart .cart-item-row td, .wishlist-content .cart .cart-item-row td { border-bottom: 1px solid #c5c5c5; vertical-align: middle; line-height: 30px; } .order-summary-content .cart .cart-item-row td.product, .wishlist-content .cart .cart-item-row td.product { text-align: left; padding: 0px 10px 0px 10px; } .order-summary-content .cart .cart-item-row td.product a, .wishlist-content .cart .cart-item-row td.product a { font-weight: bold; } Any help would be appreciated.

    Read the article

  • Avoiding seasonality assumption for stl() or decompose() in R

    - by user303922
    Hello everybody, I have high frequency commodity price data that I need to analyze. My objective is to not assume any seasonal component and just identify a trend. Here is where I run into problems with R. There are two main functions that I know of to analyze this time series: decompose() and stl(). The problem is that they both take a ts object type with a frequency parameter greater than or equal to 2. Is there some way I can assume a frequency of 1 per unit time and still analyze this time series using R? I'm afraid that if I assume frequency greater than 1 per unit time, and seasonality is calculated using the frequency parameter, then my forecasts are going to depend on that assumption. names(crude.data)=c('Date','Time','Price') names(crude.data) freq = 2 win.graph() plot(crude.data$Time,crude.data$Price, type="l") crude.data$Price = ts(crude.data$Price,frequency=freq) I want frequency to be 1 per unit time but then decompose() and stl() don't work! dim(crude.data$Price) decom = decompose(crude.data$Price) win.graph() plot(decom$random[2:200],type="line") acf(decom$random[freq:length(decom$random-freq)]) Thank you.

    Read the article

  • Codeplex + SVN. How good is SVN bridge?

    - by aleemb
    I avoided CodePlex because of it's lack of support for proper SVN and was dissuaded by complaints about short comings. Recently, I have been wanting to port my project from beanstalk over to codeplex because the latter is more social. What problems have you encountered and how good is the support for SVN. How good is the SVN bridge?

    Read the article

  • "Pretty" Continuous Integration for Python

    - by dbr
    This is a slightly.. vain question, but BuildBot's output isn't particularly nice to look at.. For example, compared to.. phpUnderControl Hudson CruiseControl.rb ..and others, BuildBot looks rather.. archaic I'm currently playing with Hudson, but it is very Java-centric (although with this guide, I found it easier to setup than BuildBot, and produced more info) Basically: is there any Continuous Integration systems aimed at python, that produce lots of shiney graphs and the likes? Update: After trying a few alternatives, I think I'll stick with Hudson. Integrity was nice and simple, but quite limited. I think Buildbot is better suited to having numerous build-slaves, rather than everything running on a single machine like I was using it. Setting Hudson up for a Python project was pretty simple: Download Hudson from https://hudson.dev.java.net/ Run it with java -jar hudson.war Open the web interface on the default address of http://localhost:8080 Go to Manage Hudson, Plugins, click "Update" or similar Install the Git plugin (I had to set the git path in the Hudson global preferences) Create a new project, enter the repository, SCM polling intervals and so on Install nosetests via easy_install if it's not already In the a build step, add nosetests --with-xunit --verbose Check "Publish JUnit test result report" and set "Test report XMLs" to **/nosetests.xml That's all that's required. You can setup email notifications, and the plugins are worth a look. A few I'm currently using for Python projects: SLOCCount plugin to count lines of code (and graph it!) - you need to install sloccount separately Violations to parse the PyLint output (you can setup warning thresholds, graph the number of violations over each build) Cobertura can parse the coverage.py output. Nosetest can gather coverage while running your tests, using nosetests --with-coverage (this writes the output to **/coverage.xml)

    Read the article

  • Java - Error Message Help

    - by Brian
    In the Code, mem is a of Class Memory and getMDR and getMAR ruturn ints. When I try to compile the code I get the following errors.....how can I fix this? Computer.java:25: write(int,int) in Memory cannot be applied to (int) Input.getInt(mem.write(cpu.getMDR())); ^ Computer.java:28: write(int,int) in Memory cannot be applied to (int) mem.write(cpu.getMAR()); Here is the code for Computer: class Computer{ private Cpu cpu; private Input in; private OutPut out; private Memory mem; public Computer() { Memory mem = new Memory(100); Input in = new Input(); OutPut out = new OutPut(); Cpu cpu = new Cpu(); System.out.println(in.getInt()); } public void run() { cpu.reset(); cpu.setMDR(mem.read(cpu.getMAR())); cpu.fetch2(); while (!cpu.stop()) { cpu.decode(); if (cpu.OutFlag()) OutPut.display(mem.read(cpu.getMAR())); if (cpu.InFlag()) Input.getInt(mem.write(cpu.getMDR())); if (cpu.StoreFlag()) { mem.write(cpu.getMAR()); cpu.getMDR(); } else { cpu.setMDR(mem.read(cpu.getMAR())); cpu.execute(); cpu.fetch(); cpu.setMDR(mem.read(cpu.getMAR())); cpu.fetch2(); } } } Here is the code for Memory: class Memory{ private MemEl[] memArray; private int size; public Memory(int s) {size = s; memArray = new MemEl[s]; for(int i = 0; i < s; i++) memArray[i] = new MemEl(); } public void write (int loc, int val) {if (loc >=0 && loc < size) memArray[loc].write(val); else System.out.println("Index Not in Domain"); } public int read (int loc) {return memArray[loc].read(); } public void dump() { for(int i = 0; i < size; i++) if(i%1 == 0) System.out.println(memArray[i].read()); else System.out.print(memArray[i].read()); } } Here is the code for getMAR and getMDR: public int getMAR() { return ir.getOpcode(); } public int getMDR() { return mdr.read(); }

    Read the article

  • Silverlight Cream for March 28, 2010 -- #823

    - by Dave Campbell
    In this Issue: Michael Washington, Andy Beaulieu, Bill Reiss, jocelyn, Shawn Wildermuth, Cameron Albert, Shawn Oster, Alex Yakhnin, ondrejsv, Giorgetti Alessandro, Jeff Handley, SilverLaw, deepm, and Kyle McClellan. Shoutouts: If I've listed this before, it's worth another... Introduction to Prototyping with SketchFlow (twelve video series) and on the same page is Creating a Beehive Game with Behaviors in Blend 3 (ten video series) Shawn Oster announced his Slides + Code + Video from ‘An Introduction to Developing Applications for Microsoft Silverlight’ from MIX10 Tim Heuer announced earlier this week: Silverlight Client for Facebook updated for Silverlight 4 RC Nikhil Kothari announced the availability of his MIX10 Talk - Slides and Code András Velvárt backed up his great MIX09 effort with MIX10.Zoomery.com... everything in one DZ effort... thanks András! Andy Beaulieu posted his material for his Code Camp 13 in Waltham: Windows Phone: Silverlight for Casual Games From SilverlightCream.com: Silverlight MVVM - The Revolution Has Begun Michael Washington did an awesome tutorial on MVVM and Silverlight creating a simple Silverlight File Manager. The post has a link to the tutorial at CodeProject... great tutorial. Windows Phone 7 + Silverlight Performance Andy Beaulieu has a post up we should all bookmark... getting a handle on the graphics performance of our app on WP7. Great examples, and external links. Space Rocks game step 6: Keyboard handling Bill Reiss has a post up about keyboard input for the WP7 game he's building ... this is Episode 6 ... you're working along with him, right? Panoramic Navigation on Windows Phone 7 with No Code! jocelyn at InnovativeSingapore (I found this by way of Shawn's post), has a Panoramic Navigation template out there for WP7 for all of us to grab... great post about it too. My First WP7 Application Shawn Wildermuth has been playing with WP7 development and has his XBOX Game library app up on the emulator... all with source of course Silverlight and Windows Phone 7 Game Cameron Albert built a web-based game called 'Shape Attack' and also did it for WP7 to compare the performance... check it out for yourself, but hey, it's game source for the phone... cool :) Changing the Onscreen Keyboard layout in Silverlight for Windows Phone using InputScope Shawn Oster has a cool post on changing the keyboard on WP7 to go along with what you're expecting the user to type... how cool is that?? Deep Zoom on WP7 Check out the quick work Alex Yakhnin made of putting DeepZoom on WP7... all source included. How to: Create a sketchy Siverlight GroupBox in Blend/SketchFlow ondrejsv has the xaml up to take Tim Greenfield's GroupBox control and insert it into SketchFlow. Silverlight / Castle Windsor – implementing a simple logging framework Giorgetti Alessandro posted about CastleWindsor for Silverlight, and a logging system inherited from LevelFilteredLogger in the absence of Log4Net. DomainDataSource in a ViewModel Jeff Handley responds to a common forum post about using DomainDataSource in a ViewModel. Read his comments on AutoLoad and ElementName Bindins. Digital Jugendstil TextEffect (Art Nouveau) - Silverlight 3 SilverLaw has a cool TagCloud demo and a UserControl he calls Art Nouveau up at the Expression Gallery... not for a business app, I don't think :) Configuring your DomainService for a Windows Phone 7 application deepm discusses RIA Services for WP7 and how to enable a WP7 app to communicate with a DomainService. Writing a Custom Filter or Parameter for DomainDataSource Kyle McClellan by way of Jeff Handley's blog, is discussing how to leverage the custom parameter types you defined in the previous version of RIA Services. Stay in the 'Light! Twitter SilverlightNews | Twitter WynApse | WynApse.com | Tagged Posts | SilverlightCream Join me @ SilverlightCream | Phoenix Silverlight User Group Technorati Tags: Silverlight    Silverlight 3    Silverlight 4    Windows Phone MIX10

    Read the article

  • Snow Leopard Servers built in Wiki vs Mediawiki?

    - by semi
    I recently installed Snow Leopard Server and am trying to get the most out of the services it offers, but one thing that currently seems pretty barebones is the Wiki it provides. Can Snow Leopard Servers wiki be modified with plugins the way MediaWiki can? Are there any good plugins to allow you to include templates like MediaWiki? Is there any way to include embeded syntax highlighted example code? Is there even a good name to refer to it as when searching for it? "Snow Leopard Wiki" just turns up a bunch of wikis about SL. Alternatively, how hard is it to install MediaWiki(or some other more advanced wiki engine) on SL Server? Could you plug it in to the same authentication mechanism?

    Read the article

  • MS Vista taking too long to identify Wi-Fi connection [closed]

    - by I_M_SUPER_USER
    I with few of my flat-mates share internet connection by using ASL cable into one laptop and then making Adhoc private network so that we all can enjoy internet connectivity. It all worked wonderful few initial days, but now my MS vista is taking much time to identify that adhoc network and it though I am connected to my friend, it takes 5-10 minutes untill I use internet.

    Read the article

  • Internet Connection Sharing, can't Share Wireless

    - by GuyNoir
    I'm using Windows XP, and I've been trying to setup my laptop so that I can connect to the internet connection that I get on the laptop through my mobile on an ad-hoc network. I've set up an ad-hoc network, but when I try to select "allow other users to connect through this computers internet connection", the only options I have are the Local Area Connections. The tutorial I've been using says that Wireless Connection should be in that pull down menu. Any help?

    Read the article

  • How do I branch an individual file in SVN?

    - by Michael Carman
    The subversion concept of branching appears to be focused on creating an [un]stable fork of the entire repository on which to do development. Is there a mechanism for creating branches of individual files? For a use case, think of a common header (*.h) file that has multiple platform-specific source (*.c) implementations. This type of branch is a permanent one. All of these branches would see ongoing development with occasional cross-branch merging. This is in sharp contrast to unstable development/stable release branches which generally have a finite lifespan. I do not want to branch the entire repository (cheap or not) as it would create an unreasonable amount of maintenance to continuously merge between the trunk and all the branches. At present I'm using ClearCase, which has a different concept of branching that makes this easy. I've been asked to consider transitioning to SVN but this paradigm difference is important. I'm much more concerned about being able to easily create alternate versions for individual files than about things like cutting a stable release branch.

    Read the article

  • Git tool to remove lines from staging if they consist only of changes in whitespace

    - by Max Howell
    The point in removing trailing whitespace is that if everyone does it always then you end up with a diff that is minimal, ie. it consists only of code changes and not whitespace changes. However when working with other people who do not practice this, removing all trailing whitespace with your editor or a pre-commit hook results in an even worse diff. You are doing the opposite of your intention. So I am asking here if there is a tool that I can run manually before I commit that unstages lines from staging that are only changes in whitespace. Also a bonus would be to change the staged line to have trailing whitespace removed for lines that have code changes. Also a bonus would be to not do this to Markdown files (as trailing space has meaning in Markdown). I am asking here as I fully intend to write this tool if it doesn't already exist.

    Read the article

  • Python try...except comma vs 'as' in except

    - by peter
    What is the difference between ',' and 'as' in except statements, eg: try: pass except Exception, exception: pass and: try: pass except Exception as exception: pass Is the second syntax legal in 2.6? It works in CPython 2.6 on Windows but the 2.5 interpreter in cygwin complains that it is invalid. If they are both valid in 2.6 which should I use?

    Read the article

  • jQuery: How to find and change multiply th classes between n & n

    - by Ravex
    Hi everyone. I have some table structure: <tr class="row-2"><tr> <tr class="row-3">..<tr> <tr class="row-4">..<tr> <tr class="row-5">..<tr> <tr class="row-6">..<tr> <tr class="row-7"><tr> <tr class="row-8">..<tr> <tr class="row-9">..<tr> <tr class="row-10">..<tr> <tr class="row-11">..<tr> ...etc for this example TR with classes "row-2" and "row-7" is parrent product link wich expand child rows. <script> $(function() { $('tr.parent') .css("cursor","pointer") .css("color","red") .attr("title","Click to expand/collapse") .click(function(){ $(this).siblings('.child-'+this.id).toggle(); }); $('tr[@class^=child-]').hide().children('td'); }); </script> Rows -3...-6 is child of row-2 and Rows -8...-11 is child of row-7 How i can find row-2, row-7, etc then add second class "parrent" and ID similar class (id="row-2", id="row-7", etc)? Also i need add in each TR between row-2 and row-7 class equal previous parrent row. In bottom line i need something like this: <tr class="row-2 parrent" id="row-2"><tr> <tr class="row-3 child-row2">..<tr> <tr class="row-4 child-row2">..<tr> <tr class="row-5 child-row2">..<tr> <tr class="row-6 child-row2">..<tr> <tr class="row-7 parrent" id="row-7"><tr> <tr class="row-8 child-row7">..<tr> <tr class="row-9 child-row7">..<tr> <tr class="row-10 child-row7">..<tr> <tr class="row-11 child-row7">..<tr> ..etc Thanks for any Help.

    Read the article

  • Simulink: type consistency errors

    - by stanigator
    Using this Simulink model file as a reference, I'm trying to figure out the two following errors: I have no idea what has gone wrong with the data type consistency/conversion problems. Do you know what the error messages mean exactly in the context of a model? It would be great to get an interpretation of the problem to solve it. Thanks in advance.

    Read the article

  • What is the best practice for accessing Model using MVVM pattern

    - by Dzenand
    I have a database that communicates with webservices with my Model (own thread) and exposes Data Objects. My UI application consists of different Views and ViewModels and Custom Controls. I'm using ServiceProvider (IServiceProvider) to access the Model and route the events to the UI thread. Communication between the ViewModels is handeled by a Messenger. Is this way to go? I was also wondering what is the best way to strucutre the DataObjects At the moment i have the DataObjects that have a hierarchy structure but does not support INotifyProperty though the children list are of type of ObservableCollection. I have no possiblity to implement notifypropertychange on the properties. I was wondering the best way of making them MVVM friendly. Implementing a partial class and adding all the properties or commands that are necessary or wrapping all the DataObjects and keep the Model list and MVVM list in sync. All thoughts and ideas are appreciated.

    Read the article

< Previous Page | 13 14 15 16 17 18 19 20 21 22 23 24  | Next Page >