[Solved] How can I edit a file in Linux and add line breaks? [closed]

Assuming your data is in file named “file”: sed -i ‘s/^\(.\{27\}\)\(.\{26\}\)\(.*\)/\1\n\2\n\3/g’ file sed is a very powerful tool for text processing, although not the easiest to use (but very easy when you want to make an example like this). Here is the magic: “-i” is a flag for “do this stuff for me” in single … Read more

[Solved] why we use bool here? [closed]

isPrime is being used to exit from the for loop & do while loop by conditionally. 1. in For Loop Our goal is to find out the next greater prime number of candidate. If we have the 25 as candidate, we are going to execute the for loop upto 3 to 5(sqrt of 25). if … Read more

[Solved] c# Regular Expression for the text below? [closed]

This Regex should do it. The year is currently set to 4 digits, if you only want it to match 2005, replace the \d{4} bit. ^\[Date\]\.\[Hierarchy\]\.\[Year\]\.&\[\d{4}\]\.&\[Q1\]\.&\[[A-Z-a-z]{3}\]$ Here’s the result: [Date].[Hierarchy].[Year].&[2005].&[Q1].&[Jan] // matches [Date].[Hierarchy].[Year].&[2013].&[Q3].&[Jul] // no match [Date].[Hierarchy].[Year].&[2005].&[Q1].&[Jan].&[20] // no match Edit to your comment: Make sure you put an @ before the string declaration. var … Read more

[Solved] Check which ASP.NET was clicked

You must split the code in 2 different parts: one that executes and after is done pops up a confirmation dialog, and a second part where you submit the form to execute the remaining piece. You can’t do this in one shot because you can’t have server-side code execute, pop up a confirm dialog on … Read more

[Solved] validation for two select box using array [closed]

one way using jQuery function validate(){ var key = $(“#select-key”).val(), val = $(“#select-value”).val(); return key in a && a[key] == val; } Assuming a is your array and your select boxes have the IDs select-key and select-value respectively. Hope this helps. solved validation for two select box using array [closed]

[Solved] Change the color of the stars in the rating bar where the rating bar is created dynamically in android [closed]

Option 1: Step #1: Create your own style, by cloning one of the existing styles (from $ANDROID_HOME/platforms/$SDK/data/res/values/styles.xml), putting it in your own project’s styles.xml, and referencing it when you add the widget to a layout. Step #2: Create your own LayerDrawable XML resources for the RatingBar, pointing to appropriate images to use for the bar. … Read more

[Solved] When source_address of python socket.create_connection is used? [closed]

My question is clear enough. Now, I know the answer. I know how to inspect source code, I read the source code of method socket.create_connection(address[, timeout[, source_address]]), I asked for source_address, it’s all about binding. I have this question because I am a beginner, I have no background knowledge of socket programming, so I find … Read more

[Solved] How to replace tabs with?

A tab string is represent by \t. So if you want to replace tab by question mark: url.Replace(“\t”,”?”); Should do the job. Edit: Right, as explain by Zaheer Ahmed, you need also to reaffect the result of the Replace function… 3 solved How to replace tabs with?

[Solved] How to hide a panel? [closed]

i don’t have VS, so it should be something like this <Button x:Name=”ToggleButton” Click=”ToggleButton_Click”></Button> private void ToggleButton_Click(object sender, RoutedEventArgs e) { if (Panel1.Visibility == System.Windows.Visibility.Visible) { Panel2.Visibility = System.Windows.Visibility.Visible; Panel1.Visibility = System.Windows.Visibility.Collapsed; } else { Panel2.Visibility = System.Windows.Visibility.Collapsed; Panel1.Visibility = System.Windows.Visibility.Visible; } } 5 solved How to hide a panel? [closed]