Search Results

Search found 15316 results on 613 pages for 'coding style'.

Page 108/613 | < Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >

  • VBA Macro On Timer style to run code every set number of seconds, i.e. 120 seconds

    - by FinancialRadDeveloper
    I have a need to run a piece of code every 120 seconds. I am looking for an easy way to do this in VBA. I know that it would be possible to get the timer value from the Auto_Open event to prevent having to use a magic number, but I can't quite get how to fire off a timer to get something to run every 120 seconds. I don't really want to use an infinite loop with a sleep if I can avoid it. EDIT: Cross-post based on an answer provided is at: http://stackoverflow.com/questions/2341762/excel-vba-application-ontime-i-think-its-a-bad-idea-to-use-this-thoughts-eit

    Read the article

  • How to call a service operation at a REST style WCF endpoint uri?

    - by Dieter Domanski
    Hi, is it possible to call a service operation at a wcf endpoint uri with a self hosted service? I want to call some default service operation when the client enters the endpoint uri of the service. In the following sample these uris correctly call the declared operations (SayHello, SayHi): - http://localhost:4711/clerk/hello - http://localhost:4711/clerk/hi But the uri - http://localhost:4711/clerk does not call the declared SayWelcome operation. Instead it leads to the well known 'Metadata publishing disabled' page. Enabling mex does not help, in this case the mex page is shown at the endpoint uri. private void StartSampleServiceHost() { ServiceHost serviceHost = new ServiceHost(typeof(Clerk), new Uri( "http://localhost:4711/clerk/")); ServiceEndpoint endpoint = serviceHost.AddServiceEndpoint(typeof(IClerk), new WebHttpBinding(), ""); endpoint.Behaviors.Add(new WebHttpBehavior()); serviceHost.Open(); } [ServiceContract] public interface IClerk { [OperationContract, WebGet(UriTemplate = "")] Stream SayWelcome(); [OperationContract, WebGet(UriTemplate = "/hello/")] Stream SayHello(); [OperationContract, WebGet(UriTemplate = "/hi/")] Stream SayHi(); } public class Clerk : IClerk { public Stream SayWelcome() { return Say("welcome"); } public Stream SayHello() { return Say("hello"); } public Stream SayHi() { return Say("hi"); } private Stream Say(string what) { string page = @"<html><body>" + what + "</body></html>"; return new MemoryStream(Encoding.UTF8.GetBytes(page)); } } Is there any way to disable the mex handling and to enable a declared operation instead? Thanks in advance, Dieter

    Read the article

  • UNIX-style RegExp Replace running extremely slowly under windows. Help? EDIT: Negative lookahead ass

    - by John Sullivan
    I'm trying to run a unix regEXP on every log file in a 1.12 GB directory, then replace the matched pattern with ''. Test run on a 4 meg file is took about 10 minutes, but worked. Obviously something is murdering performance by several orders of magnitude. Find: ^(?!.*155[0-2][0-9]{4}\s.*).*$ -- NOTE: match any line NOT starting 155[0-2]NNNN where in is a number 0-9. Replace with: ''. Is there some justifiable reason for my regExp to take this long to replace matching text, or is the program I am using (this is windows / a program called "grepWin") most likely poorly optimized? Thanks. UPDATE: I am noticing that searching for ^(155[0-2]).$ takes ~7 seconds in a 5.6 MB file with 77 matches. Adding the Negative Lookahead Assertion, ?=, so that the regExp becomes ^(?!155[0-2]).$ is causing it to take at least 5-10 minutes; granted, there will be thousands and thousands of matches. Should the negative lookahead assertion be extremely detrimental to performance, and/or a large quantity of matches?

    Read the article

  • no Jquery only Javascrip fadein function with cleartype fot text

    - by Chetan
    Sorry guys.. I am not familiar with JavaScrip anymore but I need to add clear type of some thing which can make text anti-aliased in IE7 browser. My script as follow // JavaScript Document var CurrentDivIndex=0; var TimeOutValue; var btn; var TimeToFade = 1000.0; function ShowDivSlideShow() { try { if(CurrentDivIndex == 5) CurrentDivIndex=0; CurrentDivIndex++; //alert("Banner" + CurrentDivIndex); //alert(CurrentDivIndex); var Indexer=1; while(Indexer<6) { var DivToShow=document.getElementById("Banner" + Indexer); DivToShow.style.display = "none"; btn=document.getElementById("btnb" + Indexer); btn.setAttribute("class","none"); Indexer++; } var DivToShow=document.getElementById("Banner" + CurrentDivIndex); DivToShow.style.display = "block"; btn=document.getElementById("btnb" + CurrentDivIndex); btn.setAttribute("class","activeSlide"); // btn.className="activeSlide"; fadeIn(); TimeOutValue=setTimeout("ShowDivSlideShow()",6000); } catch(err) { alert(err) } } function ShowCustomDiv(CurrentDivIndexRec) { clearTimeout(TimeOutValue) CurrentDivIndex=CurrentDivIndexRec var Indexer=1; while(Indexer<6) { if(CurrentDivIndex==Indexer) { Indexer++; continue; } var DivToShow=document.getElementById("Banner" + Indexer); DivToShow.style.display = "none"; btn=document.getElementById("btnb" + Indexer); btn.setAttribute("class","none"); Indexer++; } var DivToShow=document.getElementById("Banner" + CurrentDivIndex); DivToShow.style.display = "block"; btn=document.getElementById("btnb" + CurrentDivIndex); btn.setAttribute("class","activeSlide"); btn.className="activeSlide" fadeIn(); } function ShowDivSlideShowWithTimeOut(CurrentDivIndexRec) { clearTimeout(TimeOutValue) CurrentDivIndex=CurrentDivIndexRec; var Indexer=1; while(Indexer<6) { if(CurrentDivIndex==Indexer) { Indexer++; continue; } var DivToShow=document.getElementById("Banner" + Indexer); DivToShow.style.display = "none"; btn=document.getElementById("btnb" + Indexer); btn.setAttribute("class","none"); Indexer++; } var DivToShow=document.getElementById("Banner" + CurrentDivIndexRec); DivToShow.style.display = "block"; btn=document.getElementById("btnb" + CurrentDivIndexRec); btn.setAttribute("class","activeSlide"); TimeOutValue=setTimeout("ShowDivSlideShow()",6000); } function ShowCustomDivOnClick(CurrentDivIndexRec) { clearTimeout(TimeOutValue) CurrentDivIndex=CurrentDivIndexRec; var Indexer=1; while(Indexer<6) { if(CurrentDivIndex==Indexer) { Indexer++; continue; } var DivToShow=document.getElementById("Banner" + Indexer); DivToShow.style.display = "none"; btn=document.getElementById("btnb" + Indexer); btn.setAttribute("class","none"); Indexer++; } var DivToShow=document.getElementById("Banner" + CurrentDivIndexRec); DivToShow.style.display = "block"; btn=document.getElementById("btnb" + CurrentDivIndexRec); btn.setAttribute("class","activeSlide"); fadeIn(); TimeOutValue=setTimeout("ShowDivSlideShow()",6000); } function setOpacity(level) { element=document.getElementById("Banner" + CurrentDivIndex); element.style.opacity = level; element.style.MozOpacity = level; element.style.KhtmlOpacity = level; element.style.filter = "alpha(opacity=" + (level * 100) + ");"; } var duration = 300; /* 1000 millisecond fade = 1 sec */ var steps = 10; /* number of opacity intervals */ var delay = 6000; /* 5 sec delay before fading out */ function fadeIn(){ for (i = 0; i <= 1; i += (1 / steps)) { setTimeout("setOpacity(" + i + ")", i * duration); } // setTimeout("fadeOut()", delay); } function fadeOut() { for (i = 0; i <= 1; i += (1 / steps)) { setTimeout("setOpacity(" + (1 - i) + ")", i * duration); } setTimeout("fadeIn()", duration); } //end of script Now I am very confused where to add : $('#slideshow').cycle({ cleartype: 1 // enable cleartype corrections }); or $('#fadingElement').fadeIn(2000, function(){ $(this).css('filter',''); }); so it will work... Please Help me...

    Read the article

  • How to make Emacs sql-mode recognize MySQL #-style comments?

    - by Ken
    I'm reading a bunch of MySQL files that use # (to end-of-line) comments, but my sql-mode doesn't support them. I found the syntax-table part of sql.el that defines /**/ and -- comments, but according to this, Emacs syntax tables support only 2 comment styles. Is there a way to add support for # comments in sql.el easily?

    Read the article

  • Why won't IsChecked change on this toggle button?

    - by cjroebuck
    I have the following xaml for a toggle button: <ToggleButton Margin="0,3" Grid.Row="3" Grid.ColumnSpan="2" Command="{Binding DataContext.SelectAllCommand, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"> <ToggleButton.Style> <Style TargetType="{x:Type ToggleButton}"> <Setter Property="Content" Value="Select All"/> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="Content" Value="Select None"/> <Setter Property="Command" Value="{Binding DataContext.SelectNoneCommand, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}}"/> </Trigger> </Style.Triggers> </Style> </ToggleButton.Style> </ToggleButton> But the IsChecked property never gets updated when clicking the button. If I use snoop and force the IsChecked to True then the trigger kicks in.

    Read the article

  • Grails - How to format a value in a textfield into comma style such that it can be easily read?

    - by WaZ
    Hi there, I want to allow users enter numbers in textfield and once the textbox loses focus. The number is formatted with commas. e.g. User enters 100000 textfield looses focus value displayed: 100,000 How can I achieve this in Grails. I have looked at <g:formatNumber number="${myNumber}" format="\\$###,##0" /> But it doesnt solve my problem as the number is from a textfield. thanks Much appreciated.

    Read the article

  • etree.findall: 'OR'-lookup?

    - by piquadrat
    I want to find all stylesheet definitions in a XHTML file with lxml.etree.findall. This could be as simple as elems = tree.findall('link[@rel="stylesheet"]') + tree.findall('style') But the problem with CSS style definitions is that the order matters, e.g. <link rel="stylesheet" type="text/css" href="/media/css/first.css" /> <style>body:{font-size: 10px;}</style> <link rel="stylesheet" type="text/css" href="/media/css/second.css" /> if the contents of the style tag is applied after the rules in the two link tags, the result may be completely different from the one where the rules are applied in order of definition. So, how would I do a lookup that inlcudes both link[@rel="stylesheet"] and style?

    Read the article

  • How do I use IIS6 style metabase paths in IIS7 AppCmd tool?

    - by Mike Atlas
    I'm currently in the process of upgrading old II6 automation scripts that use the IISVdir tool to create/modify/update apps and virtual directories, and replacing them with AppCmd for IIS7. The IIS6, "IISVDir" commands reference paths in that are from the metabase, eg, "/W3SVC/1/ROOT/MyApp" - where 1 is ID of the "Default Web Site" site. The command doesn't actually require the display name of the site to make changes to it. This works well, since on a different language OS, the "Default Web Site" site name could be named, for example, "??? Web ???" or anything else for that matter. But this flexibility is lost if AppCmd can only reference "Default Web Site" via its name, and not a language-neutral identifier. So, how can I script AppCmd to refer to sites, vdirs and apps using language neutral identifiers to reference the "Default App Site"? Perhaps I need to start creating my own site instead, from the start, and name it something else specific, and stop using "Default Web Site" as the root? (Disclosure: I only have a IIS7-English machine that I am working on currently, but I have both IIS6-English and IIS6-Japanese machines for testing my old scripts - so perhaps it really is just "Default Web Site" still on Win2k8-Japanese?)

    Read the article

  • Is it possible to parse a stylesheet with Nokogiri?

    - by wbharding
    I've spent my requisite two hours Googling this, and I can not find any good answers, so let's see if humans can beat Google computers. I want to parse a stylesheet in Ruby so that I can apply those styles to elements in my document (to make the styles inlined). So, I want to take something like <style> .mystyle { color:white; } </style> And be able to extract it into a Nokogiri object of some sort. The Nokogiri class "CSS::Parser" (http://nokogiri.rubyforge.org/nokogiri/Nokogiri/CSS/Parser.html) certainly has a promising name, but I can't find any documentation on what it is or how it works, so I have no idea if it can do what I'm after here. My end goal is to be able to write code something like: a_web_page = Nokogiri::HTML(html_page_as_string) parsed_styles = Nokogiri::CSS.parse(html_page_as_string) parsed_styles.each do |style| existing_inlined_style = a_web_page.css(style.declaration) || '' a_web_page.css(style.declaration)['css'] = existing_inlined_style + style.definition end Which would extract styles from a stylesheet and add them all as inlined styles to my document.

    Read the article

  • Minify an Entire Directory While Keeping Element/Style/Script Relationships?

    - by Jonathan Sampson
    Do any solutions currnetly exist that can minify an entire project directory? More importantly, do any solutions exist that can shorten classnames, id's, and keep them consistent throughout all documents? Something that can turn this: Index.html --- <div class="fooBar"> <!-- Code --> </div> Styles.css --- .fooBar { // Comments and Messages background-color:#000000; } Index.js --- $(".fooBar").click(function(){ /* More Comments */ alert("fooBar"); }); Into This: Index.html --- <div class="a"></div> Styles.css --- .a{background-color:#000;} Index.js --- $(".a").click(function(){alert("fooBar");});

    Read the article

  • Is it possible to have yui editor change paragraph style without selecting text?

    - by user126861
    Is it possible to change the behavior of the yui text editor so that when you make markup changes (via the toolbar bar buttons), for example changing from a paragraph to say a heading or to a list, and you dont have any text selected it assumes you mean the current block that the cursor is in So to change a paragraph to a heading rather than selecting the whole line you just place the cursor somewhere in the paragraph and select heading from the styles drop down.

    Read the article

  • Retrieveing ALL head elements in document including iframe

    - by Vishal Shah
    I'm trying to add style elements to all ALL the head elements in a document, including those in an iframe. if i use var heads = document.getElementsByTagName('head'); It just returns the first head element and not the ones in the iframe. this is the complete code : var heads = document.getElementsByTagName("head"); var style = document.createElement("style"); style.type = "text/css"; style.appendChild(document.createTextNode(css)); for(var i=0;i<heads.length;i++) heads[i].appendChild(style); but this doesn't seem to work! am i doing something wrong here...?

    Read the article

  • iPad keyboard will not dismiss if navigation controller presentation style is "form sheet".

    - by Kalle
    UPDATE: This is apparently "works as intended" classed by Apple. See accepted answer below for details. Update: this question is about a behavior discovered in the iPad keyboard, where it refuses to be dismissed if shown in a modal dialog with a navigation controller. Basically, if I present the navigation controller with the following line: navigationController.modalPresentationStyle = UIModalPresentationFormSheet; The keyboard refuses to be dismissed. If I comment out this line, the keyboard goes away fine. ... I've got two textFields, username and password; username has a Next button and password has a Done button. The keyboard won't go away if I present this in a modal navigation controller. WORKS broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; [self.view addSubview:b.view]; DOES NOT WORK broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:b]; navigationController.modalPresentationStyle = UIModalPresentationFormSheet; navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; [b release]; If I remove the navigation controller part and present 'b' as a modal view controller by itself, it works. Is the navigation controller the problem? WORKS broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; b.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:b animated:YES]; [b release]; WORKS broken *b = [[broken alloc] initWithNibName:@"broken" bundle:nil]; UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:b]; [self presentModalViewController:navigationController animated:YES]; [navigationController release]; [b release];

    Read the article

  • Using empty row as default in a ComboBox with Style "DropDownList"?

    - by Pesche Helfer
    Hi board I am trying to write a method, that takes a ComboBox, a DataTable and a TextBox as arguments. The purpose of it is to filter the members displayed in the ComboBox according to the TextBox.Text. The DataTable contains the entire list of possible entries that will then be filtered. For filtering, I create a DataView of the DataTable, add a RowFilter and then bind this View to the ComboBox as DataSource. To prevent the user from typing into the ComboBox, I choose the DropDownStyle DropDownList. That’s working fine so far, except that the user should also be able to choose nothing / empty line. In fact, this should be the default member to be displayed (to prevent choosing a wrong member by accident, if the user clicks through the dialog too fast). I tried to solve this problem by adding a new Row to the view. While this works for some cases, the main issue here is that any DataTable can be passed to the method. If the DataTable contains columns that cannot be null and don’t contain a default value, I suppose I will raise an error by adding an empty row. A possibility would be to create a view that contains only the column that is defined as DisplayMember, and the one that is defined as ValueMember. Alas, this can’t be done with a view in C#. I would like to avoid creating a true copy of the DataTable at all cost, since who knows how big it will get with time. Do you have any suggestions how to get around this problem? Instead of a view, could I create an object containing two members and assign the DisplayMember and the ValueMember to these members? Would the members be passed as reference (what I hope) or would true copied be created (in which case it would not be a solution)? Thank you very much for your help! Best regards public static void ComboFilter(ComboBox cb, DataTable dtSource, TextBox filterTextBox) { cb.DropDownStyle = ComboBoxStyle.DropDownList; string displayMember = cb.DisplayMember; DataView filterView = new DataView(dtSource); filterView.AddNew(); filterView.RowFilter = displayMember + " LIKE '%" + filterTextBox.Text + "%'"; cb.DataSource = filterView; }

    Read the article

  • What is the modern eqivalent (C++) style for the older (C-like) fscanf method?

    - by Chris_45
    What is the best option if I want to "upgrade" old C-code to newer C++ when reading a file with a semicolon delimiter: /* reading in from file C-like: */ fscanf(tFile, "%d", &mypost.nr); /*delimiter ; */ fscanf(tFile, " ;%[^;];", mypost.aftername);/* delimiter ; */ fscanf(tFile, " %[^;]", mypost.forename); /*delimiter ; */ fscanf(tFile, " ;%[^;];", mypost.dept);/*delimiter ; */ fscanf(tFile, " %[^;];", mypost.position);/* delimiter ; */ fscanf(tFile, "%d", &mypost.nr2); //eqivalent best C++ method achieving the same thing?

    Read the article

  • How can I implement a "wizard" style page using JQuery?

    - by Mark Brittingham
    I am implementing a questionnaire on the web and I'd like for each block of questions to have its own "page" so the user doesn't have to scroll. However, page loads have two problems: a) they take time (and have a noticeable flicker/refresh) and b) such an approach would force me to do a data table insert plus multiple updates (or store it all in my session). How can I use JQuery to let the user page through the questionnaire on the client side, answering questions as he goes? I'll then be able to handle the data store when all the answers are submitted at the end. One other thing...is there a way to make sure that the session doesn't time out if the user takes awhile?

    Read the article

  • span height width unable to change

    - by poineer
    trying to make one horizontal box.. inside that update limits. if u see the below sample code, u can understand how i set limits. those limit classes height, i am unable to decrease. could please tel me what is reason.. i want to make it using div and span only <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en" dir="ltr"> <head> <style> .limitBlock { border-left: 1px solid black; } .limitRBlack { border-right: 1px solid black; } .horbox { background-color:#FFFFFF; height:4px; width:400px; margin-left:5px; border: 1px solid #AAAAAA; } </style> </head> <body> <div class="horbox"> <div style="margin-top:-3px"> <span style="margin-top: -4px;height: 9px;"> <span id="limit1" class="limitBlock" style="margin-left:-1px;"></span> <span id="limit2" class="limitBlock" style="margin-left:100px;"></span> <span id="limit3" class="limitBlock" style="margin-left:100px;"></span> <span id="limit4" class="limitBlock" style="margin-left:100px;"></span> </span> <span id="limit5"class="limitRBlack" style="margin-left:96px;"></span> </div> </div> </body> </html>

    Read the article

  • How do I get TextMate style quotes in Emacs?

    - by pdcawley
    In textmate, when there's a current selection, I hit the " key and the selection gets surrounded by quotes. The same thing happens with other balanced characters like (, {, [ and '. Am I missing something obvious in Emacs configuration that would enable similar behaviour when using transient mark mode, or do I need to break out elisp and write something?

    Read the article

  • Business Objects Web Intelligence-style reporting in a Winform app. Is this possible?

    - by George
    I have a WinForm app that displays results in a Gridview control. If a user right mouse clicks on a row, he can then, from a popup menu, select a command to perform on the row much like windows File Explorer. But now I want to be able to give the user the ability to construct a filter so that he can control which rows are displayed in the grid w/o effecting the functionality of the application. I would also like the user to be able to select the columns/fields that he sees in the grid. For the basis of this question, let's assume that the data displayed in grid comes from a single table. business Objects' Web Intelligence and Desktop Intelligence applications give me very flexible and powerful reporting capabilities, but I want to integrate this capability into my WinForm application. Does Business Objects, or maybe Crystal Reports provide this sort of functionality? I can construct my own query builder but I'd rather not reinvent sliced bread.

    Read the article

< Previous Page | 104 105 106 107 108 109 110 111 112 113 114 115  | Next Page >