Search Results

Search found 496 results on 20 pages for 'nb'.

Page 13/20 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Please help clarify my regex pattern

    - by Dmitriy Sosunov
    I have the following string: <script>m('02:29:1467301/>Sender1*>some text message?<<02:29:13625N1/>Sender2*>Recipient2: another message??<>A<<02:29:1393100=>User1*|0User2*|%></B><<','');</script> N.B. messages are separated by << I need extract from message the following parts: 1. Time 2. Sender 3. Recipient 4. Text Recipient may being defined or not, this field is optional. I do this by the following pattern: (?<message>(?<time>\d{1,2}:\d{1,2}:[0-9a-z]+)/>(?<messageData>(?<sender>.+?)\*>(.+?)))<< But, I cannot extract recipient separately from the message text. (?<message>(?<time>\d{1,2}:\d{1,2}:[0-9a-z]+)/>(?<messageData>(?<sender>.+?)\*>(((?<recipient>.+?):){0,1}(?<messageText>.+?))))<< Please help correct my pattern.

    Read the article

  • Consuming WCF REST service in multiple ways (.Net, plain XML)

    - by Jan Jongboom
    I have become quite frustrated of WCF as I just want to use this simple scenario: Provide a webservice using REST, with a UriTemplate like /method/{param1}/{param2}/ and a 3th parameter that is sent to the service as XML as POST data. Use just plain XML, no SOAP overhead. Be able to generate a proxy in Visual Studio so a .Net using client can easily use the service (don't care about SOAP overhead here). I can create 1. and 2. but no way I can use 3. I tried adding both webHttpBinding and basicHttpBinding endpoints in my services config; I fooled around with the <services/> tag, but I just can't get this working. What am I missing here?! N.B. I checked out this article: http://stackoverflow.com/questions/186631/rest-soap-endpoints-for-a-wcf-service but nothing what is described there seems to work here?!

    Read the article

  • Define the base class or base functionality of a dynamic proxy (e.g. Castle, LinFu)

    - by Graham
    Hi, I've asked this in the NHibernate forumns but I think this is more of a general question. NHibernate uses proxy generators (e.g. Castle) to create its proxy. What I'd like to do is to extend the proxy generated so that it implements some of my own custom behaviour (i.e. a comparer). I need this because the following standard .NET behaviour fails to produce the correct results: //object AC is a concrete class collection.Contains(AC) = true //object AP is a proxy with the SAME id and therefore represents the same instance as concrete AC collection.Contains(AP) = false If my comparer was implemented by AP (i.e. do id's match) then collection.Contains(AP) would return true, as I'd expect if proxies were implicit. (NB: For those who say NH inherits from your base class, then yes it does, but NH can also inherit from an interface - which is what we're doing) I'm not at all sure this is possible or where to start. Is this something that can be done in any of the common proxy generators that NH uses?

    Read the article

  • Starting work with SVN and basic folder structure.

    - by Eugene
    I have read little about TortoiseSVN and it capabilities, but I just can't understand how should I use basic structure. /trunk /branches /tags I have created FSFS type repo and I have imported basic structure. NB! No checkouts yet. I also have my project files in another place. How should I continue my work from here? Should I checkout repository-place all files in trunk folder-add them-commit them-then create tag for current trunk state-create branche for my goal I'm tring to achive-switch to created branch and work there? By the way my repo is local and whole work too. I thank everyone for help.

    Read the article

  • How do I prevent WIX CAQuietExec from logging the command line?

    - by Noel Abrahams
    In order to prevent command windows from popping up during installation I am using the WIX built-in custom action CAQuietExec. First I define the command line: <CustomAction Id="A01" Property="QtExecCmdLine" Value="&quot;MyExe.exe&quot; /password [PASSWORD]" /> NB: The PASSWORD property is defined as Hidden. This prevents the Windows installer from writing the property value to the log. Then I call into the embedded WIX extension: <CustomAction Id="A02" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="ignore" /> This works fine. However, when I go to the temp folder and open up the MSI log I see the following entry: CAQuietExec: "C:\Program Files\MyExe.exe" /password INCLEARTEXT I.e. the password is displayed in clear text and not hidden. How do I prevent the CAQuietExec from logging the password in clear text?

    Read the article

  • How long until programming becomes a professionally certified (and respected as such) skill such as

    - by Michael Campbell
    Given Toyota's recent issues and the ENORMOUS amount of safety that is being relegated to computers, how long do you think it will be before programming, or perhaps programming certain things (embedded transportation software, (air) traffic control, electrical grid, hospital equipment, nuclear plant security, planes, etc.) becomes regulated? And/or, how long before there will be certain regulated certifications before you can call yourself a "software developer", like Architects and Engineers have now? (NB: I'm from the US, so I don't know how it works in other countries; please forgive my ignornace.)

    Read the article

  • Reliably detect caller domain over cURL request?

    - by Utkanos
    OK so server-side security is not my forte. Basically, I'm building a service which users may use (via an SDK) only on the domain they stipulated when they signed up. The SDK calls my web service over cURL in PHP. Would I be right in thinking I cannot reliably detect the caller domain, i.e. enforce that it is the same domain they stipulated when signing up? cURL of course sends this over headers, but headers can always (?) be faked. Is there a better course of action to enforce domain for this sort of thing? (NB I'm already using an API key, too - it's just I wanted to restrict domain, too) Thanks in advance

    Read the article

  • Displaying a collection of controls in a specific way in WPF

    - by Alvaro
    I have a collection of controls "MyCollection" wich changes in the Runtime. And I have to follow some constraints for that, for example: If my parameter "MyCollection.Count = 4" the property "NumberOfcolumns" will have the value 2, in order to create new Lines, and show the controls Two per Two. This is how I'm displaying my collection : <ItemsControl ItemsSource="{Binding MyCollection}" BorderThickness="0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" > <ItemsControl.ItemsPanel> <ItemsPanelTemplate > <UniformGrid Columns="{Binding NumberOfColumns}" VerticalAlignment="Center" HorizontalAlignment="Center" Background="Transparent"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> </ItemsControl> The problem is that my controls have different sizes, and as In UniformGrids, Cells are uniform... My design is not really pretty, because I have little controls shown in big Cells !! Can someone help me to solve this problem ? NB: Please give me a detailled solution if possible, not something like : "Use WrapPanel..."

    Read the article

  • asp.net mvc route clashing with physical path in IIS7

    - by Andrew Bullock
    I'm messing about with controller organisation and I've hit a problem. If I have the following physical structure /Home/HomeController.cs /Home/Index.aspx /Home/About.aspx and I request the URI: /Home/Index I get a 403 Directory Listing Denied :( (im using a custom IControllerFactory and IViewEngine to look in this non-default path) Why is this happening? (I know the 403 is because its hitting the /Home folder, but why is it hitting the folder?) Why doesn't the UrlRoutingModule rewrite the route and let the controller pick up the request? Application_BeginRequest fires, but then it seems to pass control back to IIS to try and serve from the filesystem. Is it the UrlRoutingModule that defaults to a physical path if it exists before rewriting? Is there a way to make this work? N.B. Please don't suggest relocating my controllers etc. I know this is an obvious option, but that isn't the question ;) Using IIS7 In Integrated Mode Thanks

    Read the article

  • default value for a static property

    - by Blitzz
    I like c#, but why can I do : public static bool Initialized { private set; get; } or this : public static bool Initialized = false; but not a mix of both in one line ? I just need to set access level to my variable (private set), and I need it set at false on startup. I wouldn't like to make that boring private _Initialized variable, which would be returned by the getter of the public Initialized var. I like my code to be beautiful. (NB: my variable is static, it can't be initialized in the constructor). Thanks

    Read the article

  • Nagios plugin script not working as expected

    - by Linker3000
    I have modified an off-the-shelf Nagios plugin perl script to (in theory) return a one or zero according to the existence, or not, of a file on a remote linux server. The script runs a remote ssh session and logs in as the nagios user. The remote linux servers have private keys setup for that user, and on the bash command line the script works as expected, but when run as a plugin it always returns '1' (true) even if the file does not exist. Some help with the logic or a comment on why things are not working as expected within Nagios would be appreciated. I'd prefer to use this ssh login method rather than having to install nrpe on all the linux servers. To run from a command line (assuming remote server has a user called nagios with a valid private key): ./check_reboot_required -e ssh -H remote-servers-ip-addr -p 'filename-to-check' -v Ta. #! /usr/bin/perl -w # # # License Information: # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # ############################################################################ use POSIX; use strict; use Getopt::Long; use lib "/usr/lib/nagios/plugins" ; use vars qw($host $opt_V $opt_h $opt_v $verbose $PROGNAME $pattern $opt_p $mmin $opt_e $opt_t $opt_H $status $state $msg $msg_q $MAILQ $SHELL $device $used $avail $percent $fs $blocks $CMD $RMTOS); use utils qw(%ERRORS &print_revision &support &usage ); sub print_help (); sub print_usage (); sub process_arguments (); $ENV{'PATH'}=''; $ENV{'BASH_ENV'}=''; $ENV{'ENV'}=''; $PROGNAME = "check_reboot_required"; Getopt::Long::Configure('bundling'); $status = process_arguments(); if ($status){ print "ERROR: processing arguments\n"; exit $ERRORS{'UNKNOWN'}; } $SIG{'ALRM'} = sub { print ("ERROR: timed out waiting for $CMD on $host\n"); exit $ERRORS{'WARNING'}; }; $host = $opt_H; $pattern = $opt_p; print "Pattern >" . $pattern . "< " if $verbose; alarm($opt_t); #$CMD = "/usr/bin/find " . $pattern . " -type f 2>/dev/null| /usr/bin/wc -l"; $CMD = "[ -f " . $pattern . " ] && echo 1 || echo 0"; alarm($opt_t); ## get cmd output from remote system if (! open (OUTPUT, "$SHELL $host $CMD|" ) ) { print "ERROR: could not open $CMD on $host\n"; exit $ERRORS{'UNKNOWN'}; } my $perfdata = ""; my $state = "3"; my $msg = "Indeterminate result"; # only first line is relevant in this iteration. while (<OUTPUT>) { my $result = chomp($_); $msg = $result; print "Shell returned >" . $result . "< length is " . length($result) . " " if $verbose; if ( $result == 1 ) { $msg = "Reboot required (NB: Result still not accurate)" . $result ; $state = $ERRORS{'WARNING'}; last; } elsif ( $result == 0 ) { $msg = "No reboot required (NB: Result still not accurate) " . $result ; $state = $ERRORS{'OK'}; last; } else { $msg = "Output received, but it was neither a 1 nor a 0" ; last; } } close (OUTPUT); print "$msg | $perfdata\n"; exit $state; ##################################### #### subs sub process_arguments(){ GetOptions ("V" => \$opt_V, "version" => \$opt_V, "v" => \$opt_v, "verbose" => \$opt_v, "h" => \$opt_h, "help" => \$opt_h, "e=s" => \$opt_e, "shell=s" => \$opt_e, "p=s" => \$opt_p, "pattern=s" => \$opt_p, "t=i" => \$opt_t, "timeout=i" => \$opt_t, "H=s" => \$opt_H, "hostname=s" => \$opt_H ); if ($opt_V) { print_revision($PROGNAME,'$Revision: 1.0 $ '); exit $ERRORS{'OK'}; } if ($opt_h) { print_help(); exit $ERRORS{'OK'}; } if (defined $opt_v ){ $verbose = $opt_v; } if (defined $opt_e ){ if ( $opt_e eq "ssh" ) { if (-x "/usr/local/bin/ssh") { $SHELL = "/usr/local/bin/ssh"; } elsif ( -x "/usr/bin/ssh" ) { $SHELL = "/usr/bin/ssh"; } else { print_usage(); exit $ERRORS{'UNKNOWN'}; } } elsif ( $opt_e eq "rsh" ) { $SHELL = "/usr/bin/rsh"; } else { print_usage(); exit $ERRORS{'UNKNOWN'}; } } else { print_usage(); exit $ERRORS{'UNKNOWN'}; } unless (defined $opt_t) { $opt_t = $utils::TIMEOUT ; # default timeout } unless (defined $opt_H) { print_usage(); exit $ERRORS{'UNKNOWN'}; } return $ERRORS{'OK'}; } sub print_usage () { print "Usage: $PROGNAME -e <shell> -H <hostname> -p <directory/file pattern> [-t <timeout>] [-v verbose]\n"; } sub print_help () { print_revision($PROGNAME,'$Revision: 0.1 $'); print "\n"; print_usage(); print "\n"; print " Checks for the presence of a 'reboot-required' file on a remote host via SSH or RSH\n"; print "-e (--shell) = ssh or rsh (required)\n"; print "-H (--hostname) = remote server name (required)"; print "-p (--pattern) = File pattern for find command (default = /var/run/reboot-required)\n"; print "-t (--timeout) = Plugin timeout in seconds (default = $utils::TIMEOUT)\n"; print "-h (--help)\n"; print "-V (--version)\n"; print "-v (--verbose) = debugging output\n"; print "\n\n"; support(); }

    Read the article

  • How can i connect two or more machines via tcp cable to form a network grid?

    - by Gath
    How can i connect two or more machines to form a network grid and how can i distribute work load to the two machines? What operating systems do i need to run on the machines, and what application should i use to manage the load balancing? NB: I read somewhere that google uses cheap machines to perform this fete, how do they connect two network cards( 'Teaming' ) and distribute load across the machines? Good practical examples would serve me good, with actual code samples. Pointers to some good site i might read this stuff will be highly appreciated.

    Read the article

  • XSLT Similar functionality to SQL "WHERE LIKE"

    - by Fishcake
    I have the following XML <Answer> <Label>FCVCMileage</Label> <Value>3258</Value> <Iteration>0</Iteration> <DataType>NUMBER</DataType> </Answer> And need to get the Value underneath the Mileage label. However the 4 letter prefix to Mileage could be any 1 of 8 different prefixes. I know I could find the value by testing for every combination using xsl:if or xsl:choose but is there a more elegant way that would work similar to the following SQL and also wouldn't need changes to code being made if other prefixes were added. WHERE label LIKE '%Mileage' NB. There will only ever be 1 label element containing the word Mileage Cheers!

    Read the article

  • Permutations in python 2.5.2

    - by flpgdt
    Hi, I have a list of numbers for input, e.g. 671.00 1,636.00 436.00 9,224.00 and I want to generate all possible sums with a way to id it for output, e.g.: 671.00 + 1,636.00 = 2,307.00 671.00 + 436.00 = 1,107.00 671.00 + 9,224.00 = 9,224.00 671.00 + 1,636.00 + 436.00 = 2,743.00 ... and I would like to do it in Python My current constrains are: a) I'm just learning python now (that's part of the idea) b) I will have to use Python 2.5.2 (no intertools) I think I have found a piece of code that may help: def all_perms(str): if len(str) <=1: yield str else: for perm in all_perms(str[1:]): for i in range(len(perm)+1): #nb str[0:1] works in both string and list contexts yield perm[:i] + str[0:1] + perm[i:] ( from these guys ) But I'm not sure how to use it in my propose. Could someone trow some tips and pieces of code of help? cheers, f.

    Read the article

  • Python Textwrap - forcing 'hard' breaks

    - by Tom Werner
    I am trying to use textwrap to format an import file that is quite particular in how it is formatted. Basically, it is as follows (line length shortened for simplicity): abcdef <- Ok line abcdef ghijk <- Note leading space to indicate wrapped line lm Now, I have got code to work as follows: wrapper = TextWrapper(width=80, subsequent_indent=' ', break_long_words=True, break_on_hyphens=False) for l in lines: wrapline=wrapper.wrap(l) This works nearly perfectly, however, the text wrapping code doesn't do a hard break at the 80 character mark, it tries to be smart and break on a space (at approx 20 chars in). I have got round this by replacing all spaces in the string list with a unique character (#), wrapping them and then removing the character, but surely there must be a cleaner way? N.B Any possible answers need to work on Python 2.4 - sorry!

    Read the article

  • Background task in mobile phone to access a secure element and a web server

    - by Splryxx
    Is it possible in a GSM mobile phone OS (e.g. Android, Win Mo, Symbian, etc.) to have some kind of background task or application able to exchange data at the same time with a web server and a secure element of the mobile? The purpose if for the web server to be able to push APDUs to the secure element (an retrieve response APDUs) without activating the IHM of the mobile. NB: I know that this is possible when the secure element is the one managing the GSM baseband, for example using BIP as described in Ulysse specifications. My question is only when using another secure element (e.g. Java Card in a microSD).

    Read the article

  • Netbeans not Dploying/Debugging

    - by Triztian
    Hello all, I have this problem, it's the second time it happens to me, I'm using the NB IDE 6.9.1 and after a while I was working fine, but then It stopped deploying my webapp when debugging or running the application, I don't recall messing with the ant build scripts or any strange configurations, it successfully builds the dist folder and *.war file, but I cannot debug it or run it, all I get is ClassNotFoundException for my servlets. I am unsure of what extra information would help to solve this issue Its pretty annoying, I don't know how it got solved the last time, it just "went away" any help is truly appreciated.

    Read the article

  • How to link more than one object at a time in Xcode 4.2?

    - by Beppe
    I'm probably missing the basics here... Is there a way to link more than one object to a method at a time using Interface Builder in Xcode 4.2? I set tons of UIButtons in my UIView. All of them call just one method (let's say - (IBAction)buttonPushed:(UIButton *)aButton) that should do something different depending on the sender. I can't figure out a way to link them all with my method at a time. Any advice will be very appreciated... N.B. I'm using Xcode 4.2 on Snow Leopard, without storyboard.

    Read the article

  • How to track conversion rate (clicks to sales) from an internal advertising system?

    - by Ed Woodcock
    I am currently writing an interal advertising system for a company client's website, where the adverts will only be seen by internal users, and all transactions take place internally to the site (i.e. the adverts are for member-only content available on the site). Does anyone have any recommendations as to the best way to track the conversion rate of these adverts (i.e. views:clicks:sales)? EDIT I'm not looking for a 'Why don't you use google analystics'-type answer, I'm looking into possible architecture outlines, i.e. a 'why don't use store a guid in a cache temporarily and see if it ties to the advert' kind of answer. /EDIT In a previous job I did something based on an internal cache, which simply did view:click tracking, however the addition of the sales rate makes this task more complex, especially if we take into account the idea that someone may click through to an advert and not purchase immediately. Cheers, Ed (N.B. I'm leaving this purposely vague in order to (hopefully) get some answers that provide ideas I've yet to have thought of by coming at the problem from a different angle)

    Read the article

  • Username correct, password incorrect?

    - by jonnnnnnnnnie
    In a login system, how can you tell if the user has entered the password incorrectly? Do you perform two SQL queries, one to find the username, and then one to find the username and matching (salted+hashed etc) password? I'm asking this because If the user entered the password incorrectly, I want to update the failed_login_attempts column I have. If you perform two queries wouldn't that increase overhead? If you did a query like this, how would you tell if the password entered was correct or not, or whether the username doesn't exist: SELECT * FROM author WHERE username = '$username' AND password = '$password' LIMIT 1 ( ^ NB: I'm keeping it simple, will use hash and salt, and will sanitize input in real one.) Something like this: $user = perform_Query() // get username and password? if ($user['username'] == $username && $user['password'] == $password) { return $user; } elseif($user['username'] == $username && $user['password'] !== $password) { // here the password doesn't match // update failed_login_attemps += 1 }

    Read the article

  • Best way to make an attribute always an array?

    - by Shadowfirebird
    I'm using my MOO project to teach myself Test Driven Design, and it's taking me interesting places. For example, I wrote a test that said an attribute on a particular object should always return an array, so -- t = Thing.new("test") p t.names #-> ["test"] t.names = nil p t.names #-> [] The code I have for this is okay, but it doesn't seem terribly ruby to me: class Thing def initialize(names) self.names = names end def names=(n) n = [] if n.nil? n = [n] unless n.instance_of?(Array) @names = n end attr_reader :names end Is there a more elegant, Ruby-ish way of doing this? (NB: if anyone wants to tell me why this is a dumb test to write, that would be interesting too...)

    Read the article

  • Change IP where domain is pointing

    - by Christian Sciberras
    This is probably a very strange request. I need to programmaticaly (via code) change the IP where a domain name is pointing to. IE: xyz.com points to 100.100.100.100 setIP('xyz.com','100.100.100.100'); I know this [code] is practically impossible, however, what I need is to do this via domain host API etc or other possible ways you might think of. I'd be happy even if it weren't anything more then sending an email to the DNS owner/host. Do you know of anything the like or which might help? (nb: considered throwing this at ServerFault, but felt it more at home here ;) ) Cheers!

    Read the article

  • populating a gridview with a button's click event

    - by david padi
    hi I have a page that has two dropdownlists(one for the locations, and the other for departments), an employee search textbox and a button. On the other page, I have a gridview. Now, what i want to archieve is that when a user types an employee's name in the textbox control, selects a location from the location dropdownlist, and a department from the departments dropdownlist, and click the button(search), the gridview on the other page must show the reqiured information of a SINGLE employee. Only one row must show. I have created a database for the employees. I know how to do this with the autopostback but i have not tried it using a button's click. NB: the gridview should show only one row of a selected employee. I'm using ASP.NET VB Your help will high apprecaited.

    Read the article

  • Is it possible to link a method marked with MethodImplOptions.InternalCall to its implementation?

    - by adrianbanks
    In trying to find the possible cause of an exception, I'm following a code path using Reflector. I've got deeper and deeper, but ended up at a method call that looks like: [MethodImpl(MethodImplOptions.InternalCall)] private extern void SomeMethod(int someParameter); This markup on the method tells the framework to call a C++ function somewhere. Is there any way to find out what method actually gets called, and in turn what else is likely to be called? NB: I don't really want to see the source code of this method, I just want to know the possible things that could throw the exception I am seeing that originates out of this method call.

    Read the article

  • Mathematica quickie: About making cells Input cells by default.

    - by andrz
    I'm going through some lecture notes, Fundamentals of Mathematica Programming (see the .nb file there). I'd like to be able to do the exercises right there in the notebook; but for some reason I can't figure out how to make the default cell an Input cell. In other words, when I'm clicking in that notebook to create a new cell--in the exercises--the cell is by default a text cell. I'd like for it to be an Input cell so that I don't have to manually change it each time. Ideas?

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >