w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
While Sending Html Mails from my web application Recieved Mails contains Symbols like &ldquo,&rdquo, ‘
Check with another constructor for htmlView: ContentType mimeType = new System.Net.Mime.ContentType("text/html"); var htmlView = AlternateView.CreateAlternateViewFromString(bodyMessage, mimeType);

Categories : Asp Net Mvc

PHP str_replace replace space with dash, but too many dash
You can use the more powerful preg_replace, instructing it to replace runs of dashes and/or spaces with a single dash: $name = preg_replace('/[s-]+/', '-', $name); [s-]+ is a regular expression that matches "one or more of: whitespace and dashes".

Categories : PHP

Get string between last dash and last dot
Demo here: var test = "http://foo.com/bar/image/abc.jpg"; var i = test.lastIndexOf("/"); var j = test.lastIndexOf("."); var str = test.substring(i + 1, j); document.body.innerHTML += "<p>" + str + "</p>";

Categories : Javascript

variable variables in sh or dash
I don't think that you have any option but to use eval. The following: sms="SMSFile" email="EmailSubj" for x in sms email; do eval val=$$x; echo variable $$x=$val; done; should result in: variable $sms=SMSFile variable $email=EmailSubj in both sh and dash.

Categories : Unix

Redirect with a dash / hyphen
Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^[^-]+-for-([^/]+)/?$ /article/$1 [R=301,NC,L]

Categories : Apache

RewriteRule: problems with dash
Well you're getting 404 because w in your regex matches only alphanumerics and underscore so it won't match hyphen. Replace your RewriteRule with this: RewriteRule ^colection/([^/]+)/?$ collection.php?title=$1 [L,QSA,NC]

Categories : Htaccess

Extract Text after first "-" Dash
So you want everything from the beginning of the string through the 6th character after the first hyphen? This should work. If it's possible to have a string with no hyphen, you'd need to make it more complex, but your examples imply there will always be at least one. SUBSTR( string, 1, INSTR( string, '-') + 6 )

Categories : Oracle

How to change shell to dash from bash
SHELL environment variable picks up the value from /etc/passwd. (It denotes the path to user's preferred command language interpreter.) This value wouldn't change if you change the shell in your session or your script.

Categories : Bash

Android MPEG DASH Client
Did you look at the documentation: http://www.bitmovin.net/files/bitmovin/content/documentation/libdash/3_0/index.html You may also contact the developers via: https://github.com/bitmovin/libdash

Categories : Android

MPEG-DASH Encoder error
The problem is that DASHEncoder assumes you want to encode a video and an audio file concurrently. So if you just want to encode a video file you should comment some parts of DASHEncoder code that relates to processing audio files.

Categories : Misc

Getting an object from _.pluck with lo-dash/underscore
I know it's fun to use Lo-Dash/Underscore, but if you have to use 2 functions instead of just using a regular loop, you're better off using 'old_school' coding style: var data = { first_item: {important_number: 4}, second_item: {important_number: 6}, }; var obj = {}; for (var i in data) { if (data.hasOwnProperty(i)) obj[i] = data[i].important_number; } Just to prove my point, I updated your JsPerf to include the regular for loop, and watch the magic: http://jsperf.com/getting-an-object-from-pluck/2 Regular For Loop is at least 2x faster than any other method you guys posted here. And that's mainly because it only traverses the object once.

Categories : Javascript

Regular expression remove dash from tax id
Well, I'm unsure what language you're using to replace it. But this Regex - would match the dash. But I have to say, if you're in C# you should just do this: var val = taxId.Replace("-", ""); If you're in VB.NET: Dim val As String val = taxId.Replace("-", "") If you're in PHP: var $val = str_replace("-", "", $taxId); If you're in perl: $val =~ s/-//g; If you're in JavaScript: var val = taxId.replace("-", ""); I mean, you could of course complicate the Regex and do something like this: d{2}(-)d{7} and the - would be in the group. But again, this isn't really a job for Regex.

Categories : Regex

Java Remove dash from string
You want all spaces around the dash, whereas the regexes you've tried will remove all whitespace, dashes, and parentheses from your string. A regex to remove hyphens and the spaces around them would be: "[ ]?-[ ]?" If you want to remove any whitespace, you could use s: "\s?-\s?" This will only remove the nearest whitespace before and after any hyphens (so, if you have two spaces before, it will only remove one).

Categories : Android

How to get locale within JSTL with dash as separator?
The Locale class has a toLanguageTag() method that does what you want: http://docs.oracle.com/javase/7/docs/api/java/util/Locale.html#toLanguageTag()

Categories : Java

SQL Query to show string before a dash
You can use substr: SQL> WITH DATA AS (SELECT 'AB-123' txt FROM dual) 2 SELECT substr(txt, 1, instr(txt, '-') - 1) 3 FROM DATA; SUBSTR(TXT,1,INSTR(TXT,'-')-1) ------------------------------ AB or regexp_substr (10g+): SQL> WITH DATA AS (SELECT 'AB-123' txt FROM dual) 2 SELECT regexp_substr(txt, '^[^-]*') 3 FROM DATA; REGEXP_SUBSTR(TXT,'^[^-]*') --------------------------- AB

Categories : SQL

Git Flag Syntax: why do some flags have -one dash and some have --two?
My understanding is that git follows the 'standard' Linux convention for flags. That is: one dash for 'short' flags: generally one character flags, but sometimes flags with a single character, then further characters which represent a parameter to the flag (e.g. git log -SFoo, in which Foo is a parameter to the -S flag). These flags may or may not be abbreviated forms of other, longer flags. Two dashes for 'long' flags: multi-character flags which are usually an English word. If these flags receive parameters, it is separated from the flag by an = sign (e.g. git log --author=Peter). This is the 'why': it is a convention which is embedded in the Linux world. Git comes from this world, so it follows the convention. The 'two dashes for a long flag, one for a short flag' rule should guide

Categories : GIT

How to create a "dot-dash" border with css or javascript?
It'll probably be supported by all browsers in the future, but as of now, I don't think it's a supported border type. Here's a test page someone made with the different border types: http://www.aaronsw.com/2002/testcss You'll probably have to use a border image like Kyle suggested. http://www.w3schools.com/cssref/css3_pr_border-image.asp Although it looks like Internet Explorer doesn't even support that yet. Surprise! Here's a workaround for IE: border-image: workaround for IE

Categories : CSS

git difference on parameter one dash and two dashes
That's not really git specific. Many programs use the following convention: single-letter parameter: one dash multi-letter parameter: two dashes This is handy, because it allows you to specify many single-letter parmeters at once with a single dash and all letters of the parameters you need: ls -al is equivalent to ls -a -l. Often, one-letter parameters are the most used ones and can have a longer equivalent with two dashes: for example git add -v and git add --verbose mean the same.

Categories : GIT

Simple select issue with -(dash) in where clause
The existing expression is implicitly converting the string expression to a number - you need to explicitly convert the number to a character strng, like so: SELECT tval FROM words WHERE convert(tval,char(20))='1223-1ABCDE'; SQLFiddle here.

Categories : Mysql

How do I send a value that starts with a dash to Getopt::Long?
You've specified s% - defining an option that specifies hash entries. That implies a form key=value for each argument to the option. But you've only specified -E. The error message is about the missing =value part, not the leading -. Perhaps use s@ instead to ingest a set of simple options? Or give an empty value using "-E=" if you need to separate the keys and values before passing them to ftp.

Categories : Perl

Adding a Dash in the editText automatically in Android
Try this @Override public void afterTextChanged(Editable text) { if (text.length() == 3 || text.length() == 7) { text.append('-'); } } or all of this private boolean isFormatting; private boolean deletingHyphen; private int hyphenStart; private boolean deletingBackward; @Override public void afterTextChanged(Editable text) { if (isFormatting) return; isFormatting = true; // If deleting hyphen, also delete character before or after it if (deletingHyphen && hyphenStart > 0) { if (deletingBackward) { if (hyphenStart - 1 < text.length()) { text.delete(hyphenStart - 1, hyphenStart); } } else if (hyphenStart < text.length()) { text.delete(hyphenStart, hyph

Categories : Android

How to make movieClip dash by pressing the key double with AS3?
This is the logic, you'll have to tweak it to for your project though. This works for multiple keys btw. var thresholdTime = 250; var delaysUntilKeyUp = []; public function onKeyDown(e):void { delaysUntilKeyUp[e.keyCode] = getTimer(); switch (event.keyCode) { case 65 : //do something break; } } public function onKeyUp(e):void { delaysUntilKeyUp[e.keyCode] = getTimer() - delaysUntilKeyUp[e.keyCode]; switch (event.keyCode) { case 65 : if( delaysUntilKeyUp[e.keyCode] <= thresholdTime ){ // do something when the key was released quickly } else { // do something else, or maybe do nothing } break; } }

Categories : Actionscript

Function to insert dash after three characters in a string?
The general-purpose string manipulation functions, namely substr, are more than enough to handle this: $value = substr($value, 0, 3).'-'.substr($value, 3); Adding a special function for each possible use case would not really be sane.

Categories : PHP

How to properly pass dash parameters to subprocessPopen
I think you want something like this: subprocess.Popen(["-c", "kill -USR2 %s" % master], stdout=subprocess.PIPE, shell=True).wait() However, SIGUSR2 is not a valid sigspec. Perhaps Brian Cain is correct, but I see examples including the SIG.

Categories : Python

how to adjust dash line with width of screen
I tried to create doted lines but not sure its perfectly with your requirement. drawable/dotted.xml: <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="line"> <stroke android:color="#C7B299" android:dashWidth="10px" android:dashGap="10px" /> </shape> view.xml: <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/dotted" /> For more understanding also refer this answer. Hope it helps.

Categories : Android

how to setup mpeg dash server using apache?
Just put the MPD and the dash segments into the apache htdocs folder. If you MPD has a BaseURL, modify it to the public domain/directury, that's all. You can see the structure at this Dataset (FTP and HTTP access): http://www-itec.uni-klu.ac.at/dash/?page_id=207

Categories : Apache

sql search records where field2 like( field1 with a dash somewhere)
To get bad rows Select field1, field2 from table where replace(field2, '-', '') = field1 To get good rows Select field1, field2 from table where field1 not like '%-%'

Categories : Mysql

Find parameters beginning with a dash in a string
$ str="-v foo -d --print bar-foo ba-z" $ for i in $str; do test ${i::1} = - && echo $i; done -v -d --print Note this is an instance where you must not quote the variable, since you want word splitting to occur. (That is, do not write for i in "$str")

Categories : Regex

How to make my character dash - Double Key Press
So I made a little test and came up with this. It seems to be working pretty well right now. I haven't tested it in extreme lengths, but it could get you started. I'll leave it up to you to implement into your own code. Just copy/paste into a new AS3 document and watch the console import flash.events.KeyboardEvent; stage.addEventListener(KeyboardEvent.KEY_UP, keyPressed); var pressed :Boolean = false; var lastKeyPressed :Number = -1; var doubleTapDelay :Number = 260; //-- delay in milliseconds function keyPressed(e:KeyboardEvent):void { if (lastKeyPressed == e.keyCode && pressed) trace("double tapped " + e.keyCode); lastKeyPressed = e.keyCode; pressed = true; setTimeout(function(){pressed = false},doubleTapDelay); } EDITED TO WORK WITH KEY_DOWN Thi

Categories : Actionscript

How to control length of the dash to the border without using image with css only?
Without any images it's impossible. But it can be done without loading any images — with CSS gradients (which are basically generated images): background: linear-gradient(to right, currentColor 0%, currentColor 50%, transparent 50%, transparent 100%) repeat-x left bottom; background-size: 60px 1px;

Categories : CSS

How to underline a sentence (with a dash ) in a text file using VBA
Try below code Sub LogInformation() Const LogFileName As String = "D:TEXTFILE.LOG" Dim LogMessage As String Dim FileNum As Integer LogMessage = "This is a test run" FileNum = FreeFile ' next file number Open LogFileName For Append As #FileNum ' creates the file if it doesn't exist Print #FileNum, LogMessage ' write information at the end of the text file Print #FileNum, Application.Rept("-", 65) Close #FileNum ' close the file End Sub OUTPUT

Categories : Vba

Should I use the Underscore-compatible build of Lo-Dash when using it with BackboneJS?
I personally use require.js to load underscore/lodash. Therefore, in my app backbone doesn't know if it is underscore or lodash as long as I am passing "_" using AMD. I started to use lodash just because, I read lodash has better performance. I am sure, you will find that if you google underscore vs lodash performance. So far, I haven't seen any missing functionality in lodash. Anyways, I have the luxury to change it back to use Underscore with one line of code change in the "Require" config file ...

Categories : Javascript

PHP - Codeigniter removing dash and brackets while inserting to DB
Codeigniter active record insert set() function will also accept an optional third parameter ($escape), that will prevent data from being escaped if set to FALSE. To illustrate the difference, here is set() used both with and without the escape parameter. Try this : $this->db->set('part_no', $product['part_no'], FALSE);

Categories : PHP

Returning a numeric value on either side of a dash in a string?
You can do this many different ways with VBA. Using the Split() function to convert into an array, first using the commas as a delimiter and then using the dash would probably be a way to go. That said, if you want a quick and dirty way to do this with excel ( from which you could record a macro ) here is what you can do. Paste your target string into a cell. Run Text to Columns on it, using the comma as your deliminator. Copy the row your now have and Paste-Transpose onto a new sheet. Run Text to Columns again on your transposed column, this time with the dash as your deliminator. You now have side by side columns of your numbers, which you can compare to your target values as needed. You may need to use the Trim() functions in there somewhere to remove whitespace, but hopefully the t

Categories : String

Update collection object using Underscore / Lo-dash
Give this a try: var exerciseIds = _(queryItems).pluck('ExerciseId').uniq().valueOf(); var item = { Exercise: null, ExerciseCategories: [] }; var exerciseAndCategories = []; //this part works fine _.forEach(exerciseIds, function (id) { var temp = _.findWhere(queryItems, { 'ExerciseId': id }); var newItem = _.clone(item); newItem.Exercise = temp.ExerciseId; exerciseAndCategories.push(newItem); }); //this is problem _.forEach(queryItems, function (i) { _(exerciseAndCategories).where({ 'Exercise': i.ExerciseId }).tap(function (x) { return _.forEach(x, function(item) { item.ExerciseCategories.push(i.ExerciseCategory); }); }).valueOf(); }); // exerciseAndCategories = [{"Exercise":1,"ExerciseCategories":["bik

Categories : Javascript

how to show dash linebelow text view
Try this <TextView android:id="@+id/total" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="right" android:text="TextView" android:drawableBottom="@drawable/dividerline"/> Make one xml as below <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" > <size android:height="1dp" android:width="70dp" /> <solid android:color="@android:color/black" /> </shape>

Categories : Android

Fill in gaps in an array where a dash appears?
This can be done without the using a regular expression. Get the user input, explode with , as the delimiter, and you'll get an array of all numbers. Now use an if statement to check if the string contains a dash. If it does, explode it again with the delimiter -. Now you'll get two numbers Use range() to create an array of numbers within that range Use implode() to join them by a comma. As a useful function: Code: function fill_string_gaps($input) { $parts = explode(',', $input); $resultArray = array(); foreach ($parts as $part) { if(strpos(trim($part), '-')) { list($num1, $num2) = explode('-', $part); $expanded_num_array = range($num1, $num2); $resultArray = array_merge($resultArray, $expanded_num_array); } else {

Categories : PHP

data-bind text with dash in property name
You can use the following format: <span data-bind="text: $data['customer-name']"></span> Here is working fiddle: http://jsfiddle.net/kqntA/

Categories : Javascript

Replace spaces with dash and copy into new column
You should be able to do this via the following query: UPDATE city SET slugs=LOWER(REPLACE(city_name, " ", "-")) Breaking this down, we're using REPLACE to swap all instances of " " with "-" in the existing city_name column, and then passing the result of this to the LOWER function (to convert the data to lower case) before setting the slugs field with this value. Depending on how "clean" your data is, you might also want to TRIM the data (to remove any leading or trailing spaces in the city_name field) before you apply the REPLACE as such: UPDATE city SET slugs=LOWER(REPLACE(TRIM(city_name), " ", "-")) Incidentally, if you've not used (My)SQL much I'd recommend a read of the String Functions manual page - the time you spend on this now will more than repay itself in the future.

Categories : Mysql

How can I have Akamai cache pages with domains that contain a hyphen/dash?
Although caching at Akamai (especially caching an entire page) involves lot of other factors , by default Akamai should be able to handle domains with Hyphens/Dashes in them. It would be great if you can give me a sample URL to a page you are trying to cache.

Categories : Caching



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.