Search Results

Search found 6089 results on 244 pages for 'double'.

Page 20/244 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • regex jquery remove all double spaces

    - by michael
    Hi I have this code, I want it to remove all the double spaces from a text area, but it will only remove the first occurrence each time. $(document).ready(function(){ $("#article").blur(function(){ ///alert($(this).val()); $(this).val($(this).val().replace(/\s\s+/, ' ')); }); }); I've also tried removeAll(), but it won't work at all. any help would be great, thanks. I have a live example online at http://jsbin.com/ogasu/2/edit

    Read the article

  • [Single|Double|Or no] Quotes when using grep?

    - by Hamy
    Grep acts differently depending on what kind of quotes I surround the regex with. I can't seem to get a clear understanding of why this is. Here is an example of the problem: hamiltont$ grep -e show\( test.txt variable.show(); variable.show(a); variable.show(abc, 132); variableshow(); hamiltont$ grep -e "show\(" test.txt grep: Unmatched ( or \( hamiltont$ grep -e 'show\(' test.txt grep: Unmatched ( or \( I am just assuming there is some proper way to enclose the regex with single/double quotes. Any help? FWIW, grep --version returns grep (GNU grep) 2.5.1

    Read the article

  • What can cause a double page request?

    - by johnnietheblack
    I am currently investigating a double request problem on my site. Not all the time, but sometimes, a requested page will in fact load twice...which is not a problem really until it is on a page with PHP that inserts stuff into my db on request (my tracking script). I have read that an empty src in an image tag, and an empty url() in a css background could potentially cause the page to be requested twice. However, I can't find any problems with those. Is there anything else that could be causing something like this?

    Read the article

  • double slash apache configuration

    - by VP
    Hi, i'm deploying a ror application and now i have to rewrite the url (in apache) to add a prefix www to the url add / to the end of the url So i took the following approach: RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$ RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L] RewriteCond %{HTTP_HOST} ^foo\.com RewriteRule ^(.*)$ http://www.foo.com/$1 [R=301,L] The problem is that it is appending two trailing slash to my url So for example a resource /question/ask are becoming: http://foo.com//question/ask I tried to add the following Rule before all my Rewrite rules to try to remove the double //: RewriteCond %{REQUEST_URI} ^// RewriteRule ([^/]*)/+(.*) http://www.foo.com/$1/$2 [R=301,L] but it didnt work.. any idea to rip off all extras "//" added to the url?

    Read the article

  • Splitting a double vector into equal parts

    - by Cosmin
    Greetings, Any input on a way to divide a std::vector into two equal parts ? I need to find the smallest possible difference between |part1 - part2|. This is how I'm doing it now, but from what you can probably tell it will yield a non-optimal split in some cases. auto mid = std::find_if(prim, ultim, [&](double temp) -> bool { if(tempsum >= sum) return true; tempsum += temp; sum -= temp; return false; }); The vector is sorted, highest to lowest, values can indeed appear twice. I'm not expecting part1 and part2 to have the same numbers of elements, but sum(part1) should be as close as possible to sum(part2) For example if we would have { 2.4, 0.12, 1.26, 0.51, 0.70 }, the best split would be { 2.4, 0.12 } and { 1.26, 0.51, 0.70 }. If it helps, I'm trying to achieve the splitting algorithm for the Shannon Fano encoding. Any input is appreciated, thanks!

    Read the article

  • double fork using vfork

    - by Oren S
    HI I am writing a part of a server which should dispatch some other child processes. Because I want to wait on some of the processes, and dispatch others without waiting for completion, I use double fork for the second kind of processes (thus avoiding the zombie processes). Problem is, my server holds a lot of memory, so forking takes a long time (even the copy-on-write fork used in Linux which copies only the paging tables) I want to replace the fork() with vfork(), and it's easy for the second fork (as it only calls execve() in the child), but I couldn't find any way I can replace the first one. Does anyone know how I can do that? Thanks! The server is a linux (RH5U4), written in C++.

    Read the article

  • What is Ruby's double-colon (::) all about?

    - by Meltemi
    I'd probably be able to answer this for myself if "::" wasn't so hard to Google. Didn't see anything on SO so thought I'd try my luck. What is this double-colon :: all about? I see it everywhere in Rails: class User < ActiveRecord::Base or… ActionController::Routing::Routes.draw do |map| I found a definition from this guy: The :: is a unary operator that allows: constants, instance methods and class methods defined within a class or module, to be accessed from anywhere outside the class or module. but that just leads to more questions. What good is scope (private, protected) if you can just use :: to expose anything?

    Read the article

  • Making a Mac double-clickable application in NetBeans

    - by skiaddict1
    I have recently moved to a MacBook Pro, which has meant leaving my beloved JBuilder 2005 behind. Since there is no such thing any more (AFAIK) as a free JBuilder, I'm having to choose a new IDE. I can't live with the code-formatting of Eclipse (yes, I know, it can be customised up the wazoo, but the fact that it will NOT respect my inserted returns means I can't live with it) so I'm seriously considering NetBeans. However, I can't find any way of getting it to build a double-clickable Mac application! (I used to use XCode for this step, but it seems that XCode no longer wants to know about Java...) I cannot be the first person who's wanted to do this...can anyone help me with advice as to how to go about it? Grateful thanks in advance

    Read the article

  • C++ -malign-double compiler flag

    - by Martin
    I need some help on compiler flags in c++. I'm using a library that is a port to linux from windows, that has to be compiled with the -malign-double flag, "for Win32 compatibility". It's my understanding that this mean I absolutely have to compile my own code with this flag as well? How about other .so shared libraries, do they have be recompiled with this flag as well? If so, is there any way around this? I'm a linux newbie (and c++), so even though I tried to recompile all the libraries I'm using for my project, it was just too complicated to recursively find the source for all the libraries and the libraries they're dependent on, and recompile everything.

    Read the article

  • Building and rendering a bitmap from a double array

    - by Ami
    I'm new to c# and I'm sure I'm missing something simple here. I'm trying to build a bitmap from integer values (0-255) in a double array and then render it in a PictureBox. I think my Bitmap is getting generated but it isn't displaying in my PictureBox. Bitmap bmp = new Bitmap(image_width, image_height); Color pxl_color = new Color(); for (int i = 0; i < image_width; i++) { for (int j = 0; j < image_height; j++) { pxl_color = Color.FromArgb(array_bitmap[i][j]); bmp.SetPixel(i, j, pxl_color); } } PictureBox1.Image = bmp; Thanks in advance.

    Read the article

  • IIS Active Directory double handshake hickup

    - by AngryHacker
    I have a .net 2.0 click-once application that connects to IIS web services on Windows 2003 R2 64-bits. The IIS is setup with Integrated Windows Authentication. So whenever a web service call is made to IIS web services, there is a double handshake taking place: Client Request #1 GetEmployeeList Server Response #1 <- 401 HTTP/1.1 401 Unauthorized WWW-Authenticate: Negotiate WWW-Authenticate: NTLM Client Request #2 REQUEST Header... Server Response #2 <- 200 Data Received Lately, however, Server Response #1 will sometimes (a good 20 percent of the calls) take a massive amount of time (like 25 to 30 seconds). How do I debug this problem? Is this a Active Directory problem or a Domain Controller problem?

    Read the article

  • Error debugging - Conversion from String to Double

    - by Jamie Taylor
    I'm doing some error debugging trying to get the errors on our website down to a minimum and there seems to be an error that is popping up quite a lot Conversion from string "" to type 'Double' is not valid. I'm unable to replicate this problem but I can see that it is happening. I've been looking through the code in one of the pages and strolled across this Dim varWeek As String If varWeek < 10 Then 'Do something' End If Could this be causing the problem as it is trying to see if a String is less than 10 which is an Integer? As I said before as I am unable to see this error in the first place so changing this to an Integer doesn't change anything on my system. Thanks.

    Read the article

  • relace double quotes to parse JSON in PHP

    - by hunt
    hi, i have following json format { "status": "ACTIVE", "result": false, "isworking": false, "margin": 1, "employee": { "111": { "val1": 5.7000000000000002, "val2": "9/2", "val3": 5.7000000000000002 }, "222": { "val1": 31.550000000000001, "val2": "29/1", "val3": 31.550000000000001 } } } how the problem is when i am trying to decode above json response in php using json_decode($res,true) { true param for associative array } i am getting following result as few fields like "result":false is not "result":"false" i.e. at many of the places doubles quotes are missing in values of json. see in val1 and val3 fields resultant data after decoding in php (associative array) Array ( [status] = ACTIVE [result] = [isworking] = [margin] = 1 [employee] = Array ( [111] = Array ( [val1] = 5.7 [val2] = 9/2 [val3] = 5.7 ) [222] = Array ( [val1] = 31.55 [val2] = 29/1 [val3] = 31.55 ) ) ) please help me on how would i insert double quotes in values ? Thanks

    Read the article

  • Escaping and unescaping a string with single and double quotes in Javascript

    - by Reina
    I have a search box that a user can search for any string including single AND double quotes, once they have searched, the backend is passing the keyword back to me so I can put it back in the box. I don't know what the string is so I can't escape quotes myself, below is an example: var keyword = "hello"; $("#selectionkeywords").val(); The issue I am having is that if the user enters "hello" the keyword becomes ""hello"" and I get this error: missing ) after argument list [Break On This Error] jQuery("#selectionkeywords").val(""hello""); The user could also enter single quotes so that rules it out as well. I tried using escape unescape but I still have the same issue e.g. escape(""hello"") I could get the value in an unescaped format e.g. "hello" but I don't know what to do with it, escape doesn't work on it I end up with this %26%23034%3Bhello%26%23034%3B So I'm pretty much stuck at the moment as I can't do anything to the string, any ideas?

    Read the article

  • Baffled by PHP escaping of double-quotes in HTML forms

    - by rjray
    I have a simple PHP script I use to front-end an SQLite database. It's nothing fancy or complex. But I have noticed from looking at the records in the database that anything I enter in a form-field with double-quotes comes across in the form-processing as though I'd escaped the quotes with a backslash. So when I entered a record with the title: British Light Utility Car 10HP "Tilly" what shows up in the database is: British Light Utility Car 10HP \"Tilly\" I don't know where these are coming from, and what's worse, even using the following preg_replace doesn't seem to remove them: $name = preg_replace('/\\"/', '"', $_REQUEST['kits_name']); If I dump out $name, it still bears the unwanted \ characters.

    Read the article

  • Propor usage of double and single quotes?

    - by Phox
    I'm talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so: <?php echo "You are $yourAge years old"; ?> But single quotes will just return You are $yourAge years old. But what about performance differences? I've always gone by the rule that single quotes are faster because the PHP interpreter doesn't have to search through the string for variables. But I'm seeing more and more blog and forum posts on the web saying differently. Does anyone actually have any information on this subject? Perhaps benchmark tests or something? Cheers.

    Read the article

  • Proper usage of double and single quotes?

    - by Phox
    I'm talking about the performance increase here. From all I know you can echo variables in double quotes ("), like so: <?php echo "You are $yourAge years old"; ?> But single quotes will just return You are $yourAge years old. But what about performance differences? I've always gone by the rule that single quotes are faster because the PHP interpreter doesn't have to search through the string for variables. But I'm seeing more and more blog and forum posts on the web saying differently. Does anyone actually have any information on this subject? Perhaps benchmark tests or something?

    Read the article

  • Why does AddMilliseconds round the double paramater?

    - by fearofawhackplanet
    DateTime.Now.AddMilliseconds(1.5); // adds 2 milliseconds What on earth were they thinking here? It strikes me as horrendously bad practice to create a method that takes a double if it doesn't handle fractional values. Why didn't they implement this with a call to AddTicks and handle the fraction properly? Or at least take an int, so it's transparent to callers? I'm guessing there must be a good reason why they implemented it this way, but I can't think of what it could be. Can anyone offer any insight?

    Read the article

  • how to truncate an double datatype value variable

    - by prince23
    hi, i have an class public class Score { public double marks { get; set; } } now in my code List<Level1> Obj= new List<Level1>(); Score Object= new Score(); l1.marks=94.345454; Obj.Add(Object) // now whiling adding the object to list i need to trunacte the value to 94.34 and store in the list obj. so that i need to get output has 94.34 how can i do it. thanks in advance prince

    Read the article

  • Add a DoubleClickHandler to a FixedWidthGrid

    - by MArio
    Hello so I got a FixedWidthGrid table which is made from a pagingtable FixedWidthGrid dataTable = x.getDataTable(); I could add alot of handlers to the dataTables rows like selected or sort policies. but I cant add a double click handler ... anyway idea's ?! thank you I do have a class which I made to try to add a double click hander but it didn't work. class: public class DoubleClickTable extends FixedWidthGrid implements HasDoubleClickHandlers { public DoubleClickTable() { super(); } public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) { return addDomHandler(handler, DoubleClickEvent.getType()); } } Thank you so much for your help.

    Read the article

  • Reading a Windows 'binary' float into a ASP jscript variable

    - by user89691
    I need to read files produced by a legacy Windows app that stores real numbers (the 8-byte "double" type) in binary - i.e. as a packed array of 8 bytes. I can read the 8 byte group OK but how can I present it to my ASP JScript code such I can get the real number back again. Or to put it another way: Say a file was produced by a Windows (Delphi) program: Assign (f, 'test.bin') ; rewrite (f, 1) ; r := 1234.56E78 ; BlockWrite (f, r, SizeOf (Double)) ; Close (f) ; Inspection of the file will show it contains 8 bytes, being: 94 0E 4C CA C2 97 AD 53 which is the real number in IEEE format. Assuming I can read these 8 bytes back in ASP, is there a simple way of getting the real number back again?

    Read the article

  • addDoubleClickHandler to a FixedWidthGrid !!

    - by MArio
    Hello so I got a FixedWidthGrid table which is made from a pagingtable FixedWidthGrid dataTable = x.getDataTable(); I could add alot of handlers to the dataTables rows like selected or sort policies. but I cant add a double click handler ... anyway idea's ?! thank you I do have a class which I made to try to add a double click hander but it didn't work. class: public class DoubleClickTable extends FixedWidthGrid implements HasDoubleClickHandlers { public DoubleClickTable() { super(); } public HandlerRegistration addDoubleClickHandler(DoubleClickHandler handler) { return addDomHandler(handler, DoubleClickEvent.getType()); } } Thank you so much for your help.

    Read the article

  • Implementing the double-click event on Silverlight 4 Datagrid

    - by Mohammed Mudassir Azeemi
    Any good soul have an example of implementing the "Command Pattern" introduced by Prism on "Double-click event" of Silverlight 4.0 DataGrid. I did try the following: <data:DataGrid x:Name="dgUserRoles" AutoGenerateColumns="False" Margin="0" Grid.Row="0" ItemsSource="{Binding Path=SelectedUser.UserRoles}" IsReadOnly="False" > <data:DataGrid.Columns> <data:DataGridTemplateColumn Header=" "> <data:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Button Width="20" Height="20" Click="Button_Click" Command="{Binding EditRoleClickedCommand}" CommandParameter="{Binding SelectedRole}" > </Button> </DataTemplate> </data:DataGridTemplateColumn.CellTemplate> </data:DataGridTemplateColumn> <data:DataGridTextColumn Header="Role Name" Binding="{Binding RoleName}" /> <data:DataGridTextColumn Header="Role Code" Binding="{Binding UserroleCode}" IsReadOnly="True"/> <data:DataGridCheckBoxColumn Header="UDFM Managed" Binding="{Binding RoleIsManaged}" IsReadOnly="True" /> <data:DataGridCheckBoxColumn Header="UDFM Role Assigned" Binding="{Binding UserroleIsUdfmRoleAssignment}" IsReadOnly="True" /> <data:DataGridTextColumn Header="Source User" Binding="{Binding SourceUser}" IsReadOnly="True" /> </data:DataGrid.Columns> </data:DataGrid> As you see I did try to hook up the Command there and it is not firing the event in my View Model. Looking for a good alternative.

    Read the article

  • replace double quotes to parse JSON in PHP

    - by hunt
    hi, i have following json format { "status": "ACTIVE", "result": false, "isworking": false, "margin": 1, "employee": { "111": { "val1": 5.7000000000000002, "val2": "9/2", "val3": 5.7000000000000002 }, "222": { "val1": 31.550000000000001, "val2": "29/1", "val3": 31.550000000000001 } } } how the problem is when i am trying to decode above json response in php using json_decode($res,true) { true param for associative array } i am getting following result as few fields like "result":false is not "result":"false" i.e. at many of the places doubles quotes are missing in values of json. see in val1 and val3 fields resultant data after decoding in php (associative array) Array ( [status] => > ACTIVE [result] => > [isworking] => > [margin] => > 1 [employee] => > Array ( [111] => > Array ( [val1] => > 5.7 [val2] => > 9/2 [val3] => > 5.7 ) [222] => > Array ( [val1] => > 31.55 [val2] => > 29/1 [val3] => > 31.55 ) ) ) please help me on how would i insert double quotes in values ? Thanks

    Read the article

< Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >