Search Results

Search found 237 results on 10 pages for 'braces'.

Page 5/10 | < Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >

  • What's Your Method of not forgetting the end brackets, parentheses

    - by JMC Creative
    disclaimer: for simplicity sake, brackets will refer to brackets, braces, quotes, and parentheses in the couse of this question. Carry on. When writing code, I usually type the beginning and end element first, and then go back and type the inner stuff. This gets to be a lot of backspacing, especially when doing something with many nested elements like: jQuery(function($){$('#element[input="file"]').hover(function(){$(this).fadeOut();})); Is there a more efficient way of remembering how many brackets you've got open ? Or a second example with quotes: <?php echo '<input value="'.$_POST['name'].'" />"; ?>

    Read the article

  • Is there a language offering LISP-like macros with a more complex syntax?

    - by blubb
    LISP's macros are extremely powerful constructs, and the inability to introspect and modify the program itself beyond the method signature level has always struck me as a limitation. Yet I favour "complex" syntax because it tends to be closer to natural language. So far I have failed to find a language which combines a powerful macro mechanism such as LISP's with a naturally looking syntax (1). Is anyone aware of such a language? Footnote: I would consider python to have a naturally looking syntax as it allows constructs like this: if 0 < a < 5 and b in list. The avoidance of braces to structure blocks is irrelevant in this case, though.

    Read the article

  • Programming in R help

    - by mary
    I needed help in converting the temperature from Farenheit to Celsius. Below are several attempts and each of these fails. I have ran the following below and need help in saying what error message is created by: a) (temp -32) Can you please let me know the error message in a comment, and what it means and how to directly relate the wording of the error message with the problem you find in the expression. likewise for: b) (temp - 32)5/9 don't know the erorr on this one c) 5/9(temp - 32) need an asterisk, but not specific enough d) [temp - 32]5/9 I know braces is off.

    Read the article

  • monodevelop code formatting

    - by Ali Shafai
    I'm using monodevelop on my mac to develop for iPhone. I was wondering if there is a way to change how MD formats C# code? by default it puts the curly braces as the same like as the if which I personally don't like....

    Read the article

  • Current Date in Silverlight XAML TextBlock

    - by user292110
    I am coming from Flex where you can do just about anything inside of curly braces. I am trying to get a TextBlock to display today's Date and Time without just coding it in C#. I have tried many different variations of the following with no luck. TextBlock Text="{Source=Date, Path=Now, StringFormat='dd/MM/yyyy'}" I know I could probably just set a property MyDate and bind to that but why can't I bind directly to the DateTime.Now property?

    Read the article

  • i want to find values between { }

    - by girish
    I m working with regular expression( Regex ) but not finding the exact output.. i want to find the values between two curly braces { Value } = value i use the following pattern but not getting the exact output...it does not remove first "{" ... string pattern = "\{*\}"; if my value is - {girish} it returns me {girish instead of this i want girish as output...

    Read the article

  • Simple C# Tokenizer Using Regex

    - by Pete
    I'm looking to tokenize really simple strings,but struggling to get the right Regex. The strings might look like this: string1 = "{[Surname]}, some text... {[FirstName]}" string2 = "{Item}foo.{Item2}bar" And I want to extract the tokens in the curly braces (so string1 gets "{[Surname]}","{[FirstName]}" and string2 gets "{Item}" and "{Item2}") this question is quite good, but I can't get the regex right: poor mans lexer for c# Thanks for the help!

    Read the article

  • .NET MVC Code Generation

    - by Josh
    Is there a way to force the MVC automatically generated code to follow the conventions you have set in your preferences? For example, I keep all curly braces on the same lines as their declaring class, method, etc, but when generating a controller, it completely disregards my settings. Is there a setting someplace to force the same code generation as other parts of project?

    Read the article

  • regular expression

    - by xyz
    I need regular expression to match braces correct e.g for every open one close one abc{abc{bc}xyz} I need it get all it from {abc{bc}xyz} not get {abc{bc} I tried this ({.*?})

    Read the article

  • Java method get the inheriting type

    - by DrDro
    I have several classes that extend C and I would need a method that accepts any argument of type C. But in this method I would like to know if I'm dealing with A or B. * public A extends C public B extends C public void goForIt(C c)() If I cast how can I retrieve the type in a clean way (I just read using getClass or instanceof is often not the best way). PS: Fell free to edit an explicit title. *Sorry but I can't type closing braces

    Read the article

  • tool to auto-format R code

    - by Keith
    Is there any tool (editor, script, whatever...) available that can automatically reformat R code? It does not need to be customizable but it must be able to recognize statements separated by either semicolons or newlines since this code has both. If it can put all statements on a separate line, consistently indent code blocks and consistently place braces I will be very happy.

    Read the article

  • Java method: retrieve the inheriting type

    - by DrDro
    I have several classes that extend C and I would need a method that accepts any argument of type C. But in this method I would like to know if I'm dealing with A or B. * public A extends C public B extends C public void goForIt(C c)() If I cast how can I retrieve the type in a clean way (I just read using getClass or instanceof is often not the best way). *Sorry but I can't type closing braces

    Read the article

  • Vim Auto Indent with newline

    - by Zen
    How do I get vim to place the cursor within the braces starting on a new line, ie with | denoting the cursor position : class { | } right now with my settings it only does this class { |} I got this in my .vimrc file set autoindent shiftwidth=2 tabstop=2 noexpandtab Basically I just want how a normal IDE would indent it. update: I found how to do this with inoremap { {<CR>}<Esc>O

    Read the article

  • How to influence linebreak in Android Textview

    - by Lord Flash
    I have an Appwidget displaying days until an event like: eventname (-231 days) If possible I want to display this String in one line. If the eventname is too long I want to display the full term in braces into a new line. So that it is like: longeventname (-231 days) instead of: longeventname (-231 days) (or anything similar) Is there a way to archive this? Can I make (-231 days) "atomic"? string.getLength won't work since the size of the widget will vary by device.

    Read the article

  • In which situation is the c++/c# namespace approach better than the Java approach?

    - by mike g
    The reason I ask this is that c# could easily have copied the java convention, or a variation of it, but opted for the more flexible approach of explicitly declaring namespaces inside files. As a Java programmer often there are things that I wish I could do differently, but namespaces is not one of them. The flexbility has a certain overhead (extra braces, extra decisions for developers, making it harder to view a projects contributions to the namespace, at least without a specialist IDE). So what practical examples are there when this flexiblity is advantageous?

    Read the article

  • Syntax highlighting Abbreviations

    - by Nimbuz
    I'm using Google prettify for syntax highlighting and I'd like to modify the colors to match my website theme, but I don't understand some of the abbreviations from these: str = string atw kwd = keyword tag = tag com = comment typ = type? atn dec = declaration? lit pun = punctuation? like colons, braces? pln prettyprint

    Read the article

  • Using Find/Replace with regular expressions inside a SSIS package

    - by jamiet
    Another one of those might-be-useful-again-one-day-so-I’ll-share-it-in-a-blog-post blog posts I am currently working on a SQL Server Integration Services (SSIS) 2012 implementation where each package contains a parameter called ETLIfcHist_ID: During normal execution this will get altered when the package is executed from the Execute Package Task however we want to make sure that at deployment-time they all have a default value of –1. Of course, they tend to get changed during development so I wanted a way of easily changing them all back to the default value. Opening up each package in turn and editing them was an option but given that we have over 40 packages and we might want to carry out this reset fairly frequently I needed a more automated method so I turned to Visual Studio’s Find/Replace… feature Of course, we don’t know what value will be in that parameter so I can’t simply search for a particular value; hence I opted to use a regular expression to identify the value to be change. In the rest of this blog post I’ll explain how to do that. For demonstration purposes I have taken the contents of a .dtsx file and stripped out everything except the element containing the parameters (<DTS:PackageParameters>), if you want to play along at home you can copy-paste the XML document below into a new XML file and open it up in Visual Studio: <?xml version="1.0"?> <DTS:Executable xmlns:DTS="www.microsoft.com/SqlServer/Dts">   <DTS:PackageParameters>     <DTS:PackageParameter       DTS:CreationName=""       DTS:DataType="3"       DTS:Description="InterfaceHistory_ID: used for Lineage"       DTS:DTSID="{635616DB-EEEE-45C8-89AA-713E25846C7E}"       DTS:ObjectName="ETLIfcHist_ID">       <DTS:Property         DTS:DataType="3"         DTS:Name="ParameterValue">VALUE_TO_BE_CHANGED</DTS:Property>     </DTS:PackageParameter>     <DTS:PackageParameter       DTS:CreationName=""       DTS:DataType="3"       DTS:Description="Some other description"       DTS:DTSID="{635616DB-EEEE-45C8-89AA-713E25845C7E}"       DTS:ObjectName="SomeOtherObjectName">       <DTS:Property         DTS:DataType="3"         DTS:Name="ParameterValue">SomeOtherValue</DTS:Property>     </DTS:PackageParameter>   </DTS:PackageParameters> </DTS:Executable> We are trying to identify the value of the parameter whose name is ETLIfcHist_ID – notice that in the XML document above that value is VALUE_TO_BE_CHANGED. The following regular expression will find the appropriate portion of the XML document: {\<DTS\:PackageParameter[\n ]*DTS\:CreationName="[A-Za-z0-9\:_\{\}- ]*"[\n ]*DTS\:DataType="[A-Za-z0-9\:_\{\}- ]*"[\n ]*DTS\:Description="[A-Za-z0-9\:_\{\}- ]*"[\n ]*DTS\:DTSID="[A-Za-z0-9\:_\{\}- ]*"[\n ]*DTS\:ObjectName="ETLIfcHist_ID"\>[\n ]*\<DTS\:Property[\n ]*DTS\:DataType="[A-Za-z0-9\:_\{\}- ]*"[\n ]*DTS\:Name="ParameterValue"\>}[A-Za-z0-9\:_\{\}- ]*{\<\/DTS\:Property\>} I have highlighted the name of the parameter that we’re looking for. I have also highlighted two portions identified by pairs of curly braces “{…}”; these are important because they pick out the two portions either side of the value I want to replace, in other words the portions highlighted here: <DTS:PackageParameters>     <DTS:PackageParameter       DTS:CreationName=""       DTS:DataType="3"       DTS:Description="InterfaceHistory_ID: used for Lineage"       DTS:DTSID="{635616DB-EEEE-45C8-89AA-713E25846C7E}"       DTS:ObjectName="ETLIfcHist_ID">       <DTS:Property         DTS:DataType="3"         DTS:Name="ParameterValue">VALUE_TO_BE_CHANGED</DTS:Property>     </DTS:PackageParameter> Those sections in the curly braces are termed tag expressions and can be identified in the replace expression using a backslash and a number identifying which tag expression you’re referring to according to its ordinal position. Hence, our replace expression is simply: \1-1\2 We’re saying the portion of our file identified by the regular expression should be replaced by the first curly brace section, then the literal –1, then the second curly brace section. Make sense? Give it a go yourself by plugging those two expressions into Visual Studio’s Find and Replace dialog. If you set it to look in “All Open Documents” then you can open up the code-behind of all your packages and change all of them at once. The Find and Replace dialog will look like this: That’s it! I realise that not everyone will be looking to change the value of a parameter but hopefully I have shown you a technique that you can modify to work for your own scenario. Given that this blog post is, y’know, on the web I have no doubt that someone is going to find a fault with my find regex expression and if that person is you….that’s OK. Let me know about it in the comments below and perhaps we can work together to come up with something better! Note that some parameters may have a different set of properties (for example some, but not all, of my parameters have a DTS:Required attribute) so your find regular expression may have to change accordingly. When researching this I found the following article to be invaluable: Visual Studio Find/Replace Regular Expression Usage @Jamiet

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10  | Next Page >