Search Results

Search found 865 results on 35 pages for 'hair of the dog'.

Page 6/35 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Can IBM Digest the UNIX Server Trifecta?

    OS Roundup: The UNIX server market is steadily shrinking, yet the three top heavyweights are about to launch new products. It's a dog-eat-dog market, and IBM has already nibbled at Solaris. Is HP-UX the next course for this seemingly large and aggressive mutt?

    Read the article

  • how to run multiple shell scripts in parallel

    - by tom smith
    I've got a few test scripts, each of which runs a test php app. Each script runs forever. So, cat.sh, dog.sh, and foo.sh, each run a php script, and each shell script runs the php app in a loop, so it runs forever, sleeping after each run. I'm trying to figure out how to run the scripts in parallel, and at the same time, see the output of the php apps in the stdout/term window. I thought, simply doing something like foo.sh > &2 dog.sh > &2 cat.sh > &2 in a shell script would be sufficient, but it's not working. foo.sh, runs foo.php once, and it runs correctly dog.sh, runs dog.php in a never ending loop. it runs as expected cat.sh, runs cat.php in a never ending loop *** this never runs!!! it appears that the shell script never gets to run cat.sh. if i run cat.sh by itself in a separate window/term, it runs as expected... thoughts/comments

    Read the article

  • SQL wont work? It doesn't come up with errors either

    - by Stefan
    Hey there, I have php function which checks to see if variables are set and then adds them onto my sql query. However I am don't seem to be getting any results back!? $where_array = array(); if (array_key_exists("location", $_GET)) { $location = addslashes($_GET['location']); $where_array[] = "`mainID` = '".$location."'"; } if (array_key_exists("gender", $_GET)) { $gender = addslashes($_GET["gender"]); $where_array[] = "`gender` = '".$gender."'"; } if (array_key_exists("hair", $_GET)) { $hair = addslashes($_GET["hair"]); $where_array[] = "`hair` = '".$hair."'"; } if (array_key_exists("area", $_GET)) { $area = addslashes($_GET["area"]); $where_array[] = "`locationID` = '".$area."'"; } $where_expr = ''; if ($where_array) { $where_expr = "WHERE " . implode(" AND ", $where_array); } $sql = "SELECT `postID` FROM `posts` ". $where_expr; $dbi = new db(); $result = $dbi->query($sql); $r = mysql_fetch_row($result); I'm trying to call the data after in a list like so: $dbi = new db(); $offset = ($currentpage - 1) * $rowsperpage; // get the info from the db $sql .= " ORDER BY `time` DESC LIMIT $offset, $rowsperpage"; $result = $dbi->query($sql); // while there are rows to be fetched... while ($row = mysql_fetch_object($result)){ // echo data echo $row['text']; } // end while Anyone got any ideas why I am not retrieving any data? -Stefan

    Read the article

  • Multi-Application Server Environment and Memcached Security

    - by jocull
    We are looking to integrate Memcached into our infrastructure, but have a security concern before we do. We run several platforms including ASP.NET and Coldfusion and have many app developers working many little applications across the different platforms. The concern is this: App A places item "dog" into cache. App B reads item "dog" (or worse: App B updates item "dog") After this happens, App A either retrieves bad information, or has already had its information viewed, aka "stolen". What we would like to do is make it so that each app can only interact with its own sandbox, and may not interfere with or read other application's data. Is this possible? Thanks.

    Read the article

  • Better solution then simple factory method when concrete implementations have different attributes

    - by danip
    abstract class Animal { function eat() {..} function sleep() {..} function isSmart() } class Dog extends Animal { public $blnCanBark; function isSmart() { return $this->blnCanBark; } } class Cat extends Animal { public $blnCanJumpHigh; function isSmart() { return $this->blnCanJumpHigh; } } .. and so on up to 10-20 animals. Now I created a factory using simple factory method and try to create instances like this: class AnimalFactory { public static function create($strName) { switch($strName) { case 'Dog': return new Dog(); case 'Cat': return new Cat(); default: break; } } } The problem is I can't set the specific attributes like blnCanBark, blnCanJumpHigh in an efficient way. I can send all of them as extra params to create but this will not scale to more then a few classes. Also I can't break the inheritance because a lot of the basic functionality is the same. Is there a better pattern to solve this?

    Read the article

  • Silverlight TemplateBinding to RotateTransform

    - by Trog Dog
    I am trying to create the simplest Silverlight templated control, and I can't seem to get TemplateBinding to work on the Angle property of a RotateTransform. Here's the ControlTemplate from generic.xaml: <ControlTemplate TargetType="local:CtlKnob"> <Grid x:Name="grid" RenderTransformOrigin="0.5,0.5"> <Grid.RenderTransform> <TransformGroup> <RotateTransform Angle="{TemplateBinding Angle}"/> <!-- This does not work --> <!-- <RotateTransform Angle="70"/> --> <!-- This works --> </TransformGroup> </Grid.RenderTransform> <Ellipse Stroke="#FFB70404" StrokeThickness="19"/> <Ellipse Stroke="White" StrokeThickness="2" Height="16" VerticalAlignment="Top" HorizontalAlignment="Center" Width="16" Margin="0,2,0,0"/> </Grid> </ControlTemplate> Here's the C#: using System.Windows; using System.Windows.Controls; namespace CtlKnob { public class CtlKnob : Control { public CtlKnob() { this.DefaultStyleKey = typeof(CtlKnob); } public static readonly DependencyProperty AngleProperty = DependencyProperty.Register("Angle", typeof(double), typeof(CtlKnob), null); public double Angle { get { return (double)GetValue(AngleProperty); } set { SetValue(AngleProperty,value); } } } }

    Read the article

  • Having problems with a mask in C#

    - by Nard Dog
    I guess this would be a DevExpress mask, but here is what I have: var dlEdit = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit(); dlEdit.Mask.MaskType = MaskType.RegEx; dlEdit.Mask.EditMask = "\\d{1,10}"; I'm trying to get a number that can be up to 10 digits in length that WILL accept leading 0's, as it is now it will show the leading 0's (ex. 0032421243) until the field is clicked off in which case it removes them. I tried a numeric masktype but same thing only it wouldn't let me enter the 0's to start with at all. I thought this would be my answer but this custom type isn't. Can someone point me in the right direction for what I need? Maybe a different type of mask or something?

    Read the article

  • Core Data Relationship List

    - by Dylan Copeland
    I'm not sure whether or not this is the appropriate way of doing this, but I was wondering what's the best way to approach a relationship to a value in a list with Core Data? For example, say you have a 'person' entity. Each person can have a different 'hair color'. I'm trying to basically define the hair colors in my data model and allow the 'person' entity to have a relationship to their given 'hair color. Is this possible? Good idea or bad? Thanks in advance.

    Read the article

  • How to create a rails habtm that deletes/destroys without error?

    - by Bradley
    I created a simple example as a sanity check and still can not seem to destroy an item on either side of a has_and_belongs_to_many relationship in rails. Whenever I try to delete an object from either table, I get the dreaded NameError / "uninitialized constant" error message. To demonstrate, I created a sample rails app with a Boy class and Dog class. I used the basic scaffold for each and created a linking table called boys_dogs. I then added a simple before_save routine to create a new 'dog' any time a boy was created and establish a relationship, just to get things setup easily. dog.rb class Dog < ActiveRecord::Base has_and_belongs_to_many :Boys end boy.rb class Boy < ActiveRecord::Base has_and_belongs_to_many :Dogs def before_save self.Dogs.build( :name => "Rover" ) end end schema.rb ActiveRecord::Schema.define(:version => 20100118034401) do create_table "boys", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end create_table "boys_dogs", :id => false, :force => true do |t| t.integer "boy_id" t.integer "dog_id" t.datetime "created_at" t.datetime "updated_at" end create_table "dogs", :force => true do |t| t.string "name" t.datetime "created_at" t.datetime "updated_at" end end I've seen lots of posts here and elsewhere about similar problems, but the solutions are normally using belongs_to and the plural/singular class names being confused. I don't think that is the case here, but I tried switching the habtm statement to use the singular name just to see if it helped (with no luck). I seem to be missing something simple here. The actual error message is: NameError in BoysController#destroy uninitialized constant Boy::Dogs The trace looks like: /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:105:in const_missing' (eval):3:indestroy_without_callbacks' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:337:in destroy_without_transactions' /Library/Ruby/Gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:insend' ... Thanks.

    Read the article

  • program that writes the even and odd numbers

    - by user292489
    enter code herei was writting a program that can read a set of numbers file called dog.txt; and also writes to two file separating odd and even. i was able to compile my program however, the output expected is not the same which was supposed to be even numbers in one file called EVEN, odd numbers in file odd. #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int i; int even,odd; int num; if (argc != 4) { printf("Usage: executable in_file output_file\n"); exit(0); } FILE *dog = fopen(argv[1], "r"); FILE *feven= fopen(argv[2], "w"); FILE *fodd= fopen (argv[3], "w"); while (fscanf(dog, "%d", &num) != EOF) { if (0==i%2){ i++; printf("even= %d\n", num); } else if(i!=0){ i++; printf("odd= %d\n", num); } } fclose(feven); fclose(fodd); fclose(dog); return 0; } output: even= 1 odd= 2 even= 34 odd= 44 even= 66 odd= 78 even= 94 odd= 21 even= 23 odd= 54 even= 44 odd= 65 even= 78 odd= 68 even= 92

    Read the article

  • Merging two Regular Expressions to Truncate Words in Strings

    - by Alix Axel
    I'm trying to come up with the following function that truncates string to whole words (if possible, otherwise it should truncate to chars): function Text_Truncate($string, $limit, $more = '...') { $string = trim(html_entity_decode($string, ENT_QUOTES, 'UTF-8')); if (strlen(utf8_decode($string)) > $limit) { $string = preg_replace('~^(.{1,' . intval($limit) . '})(?:\s.*|$)~su', '$1', $string); if (strlen(utf8_decode($string)) > $limit) { $string = preg_replace('~^(.{' . intval($limit) . '}).*~su', '$1', $string); } $string .= $more; } return trim(htmlentities($string, ENT_QUOTES, 'UTF-8', true)); } Here are some tests: // Iñtërnâtiônàlizætiøn and then the quick brown fox... (49 + 3 chars) echo dyd_Text_Truncate('Iñtërnâtiônàlizætiøn and then the quick brown fox jumped overly the lazy dog and one day the lazy dog humped the poor fox down until she died.', 50, '...'); // Iñtërnâtiônàlizætiøn_and_then_the_quick_brown_fox_... (50 + 3 chars) echo dyd_Text_Truncate('Iñtërnâtiônàlizætiøn_and_then_the_quick_brown_fox_jumped_overly_the_lazy_dog and one day the lazy dog humped the poor fox down until she died.', 50, '...'); They both work as it is, however if I drop the second preg_replace() I get the following: Iñtërnâtiônàlizætiøn_and_then_the_quick_brown_fox_jumped_overly_the_lazy_dog and one day the lazy dog humped the poor fox down until she died.... I can't use substr() because it only works on byte level and I don't have access to mb_substr() ATM, I've made several attempts to join the second regex with the first one but without success. Please help S.M.S., I've been struggling with this for almost an hour. EDIT: I'm sorry, I've been awake for 40 hours and I shamelessly missed this: $string = preg_replace('~^(.{1,' . intval($limit) . '})(?:\s.*|$)?~su', '$1', $string); Still, if someone has a more optimized regex (or one that ignores the trailing space) please share: "Iñtërnâtiônàlizætiøn and then " "Iñtërnâtiônàlizætiøn_and_then_" EDIT 2: I still can't get rid of the trailing whitespace, can someone help me out?

    Read the article

  • Naming convention for non-virtual and abstract methods

    - by eagle
    I frequently find myself creating classes which use this form (A): abstract class Animal { public void Walk() { // TODO: do something before walking // custom logic implemented by each subclass WalkInternal(); // TODO: do something after walking } protected abstract void WalkInternal(); } class Dog : Animal { protected override void WalkInternal() { // TODO: walk with 4 legs } } class Bird : Animal { protected override void WalkInternal() { // TODO: walk with 2 legs } } Rather than this form (B): abstract class Animal { public abstract void Walk(); } class Dog : Animal { public override void Walk() { // TODO: do something before walking // custom logic implemented by each subclass // TODO: walk with 4 legs // TODO: do something after walking } } class Bird : Animal { public override void Walk() { // TODO: do something before walking // custom logic implemented by each subclass // TODO: walk with 2 legs // TODO: do something after walking } } As you can see, the nice thing about form A is that every time you implement a subclass, you don't need to remember to include the initialization and finalization logic. This is much less error prone than form B. What's a standard convention for naming these methods? I like naming the public method Walk since then I can call Dog.Walk() which looks better than something like Dog.WalkExternal(). However, I don't like my solution of adding the suffix "Internal" for the protected method. I'm looking for a more standardized name. Btw, is there a name for this design pattern?

    Read the article

  • Replace apostrophe in json string with empty string

    - by user572844
    Hi, I have problem with deserialization of json string, because string is bad format. For example json object consist string property statusMessage with value "Hello "dog" ". The correct format should be "Hello \" dog \" " . I would like remove apostrophes from this property. Something Like this. "Hello "dog" ". - "Hello dog ". Here is it original json string which I work. "{\"jancl\":{\"idUser\":18438201,\"nick\":\"JANCl\",\"photo\":\"1\",\"sex\":1,\"photoAlbums\":1,\"videoAlbums\":0,\"sefNick\":\"jancl\",\"profilPercent\":75,\"emphasis\":false,\"age\":\"-\",\"isBlocked\":false,\"PHOTO\":{\"normal\":\"http://u.aimg.sk/fotky/1843/82/n_18438201.jpg?v=1\",\"medium\":\"http://u.aimg.sk/fotky/1843/82/m_18438201.jpg?v=1\",\"24x24\":\"http://u.aimg.sk/fotky/1843/82/s_18438201.jpg?v=1\"},\"PLUS\":{\"active\":false,\"activeTo\":\"0000-00-00\"},\"LOCATION\":{\"idRegion\":\"6\",\"regionName\":\"Trenciansky kraj\",\"idCity\":\"138\",\"cityName\":\"Trencianske Teplice\"},\"STATUS\":{\"isLoged\":true,\"isChating\":false,\"idChat\":0,\"roomName\":\"\",\"lastLogin\":1294925369},\"PROJECT_STATUS\":{\"photoAlbums\":1,\"photoAlbumsFavs\":0,\"videoAlbums\":0,\"videoAlbumsFavs\":0,\"videoAlbumsExts\":0,\"blogPosts\":0,\"emailNew\":0,\"postaNew\":0,\"clubInvitations\":0,\"dashboardItems\":1},\"STATUS_MESSAGE\":{\"statusMessage\":\"\"Status\"\",\"addTime\":\"1294872330\"},\"isFriend\":false,\"isIamFriend\":false}}" Problem is here, json string consist this object: "STATUS_MESSAGE": {"statusMessage":" "some "bad" value" ", "addTime" :"1294872330"} Condition of string which I want modified: string start with "statusMessage":" string can has any *lenght from 0 -N * string end with ", "addTime So I try write pattern for string which start with "statusMessage":", has any lenght and is ended with ", "addTime. Here is it: const string pattern = " \" statusMessage \" : \" .*? \",\"addTime\" "; var regex = new Regex(pattern, RegexOptions.IgnoreCase); //here i would replace " with empty string string result = regex.Replace(jsonString, match => ???); But I think pattern is wrong, also I don’t know how replace apostrophe with empty string (remove apostrophne). My goal is : "statusMessage":" "some "bad" value" to "statusMessage":" "some bad value" Thank for advice

    Read the article

  • Complex SQL query, one to many relationship

    - by Ethan
    Hey SO, I have a query such that I need to get A specific dog All comments relating to that dog The user who posted each comment All links to images of the dog the user who posted each link I've tried a several things, and can't figure out quite how to work it. Here's what I have (condensed so you don't have to wade through it all): SELECT s.dog_id, s.name, c.comment, c.date_added AS comment_date_added, u.username AS comment_username, u.user_id AS comment_user_id, l.link AS link, l.date_added AS link_date_added, u2.username AS link_username, u2.user_id AS link_user_id FROM dogs AS d LEFT JOIN comments AS c ON c.dog_id = d.dog_id LEFT JOIN users AS u ON c.user_id = u.user_id LEFT JOIN links AS l ON l.dog_id = d.dog_id LEFT JOIN users AS u2 ON l.user_id = u2.user_id WHERE d.dog_id = '1' It's sorta close to working, but it'll only return me the first comment, and the first link all as one big array with all the info i requested. The are multiple comments and links per dog, so I need it to give me all the comments and all the links. Ideally it'd return an object with dog_id, name, comments(an array of the comments), links(an array of the links) and then comments would have a bunch of comments, date_added, username, and user_id and links would have a bunch of links with link, date_added, username and user_id. It's got to work even if there are no links or comments. I learned the basics of mySQL somewhat recently, but this is pretty far over my head. Any help would be wonderful. Thanks!

    Read the article

  • how to fix my error saying expected expression before 'else'

    - by user292489
    this program intended to read a .txt, a set of numbers, file and wwrite to another two .txt files called even amd odd as follows: #include <stdio.h> #include <stdlib.h> int main(int argc, char *argv[]) { int i=0,even,odd; int number[i]; // check to make sure that all the file names are entered if (argc != 3) { printf("Usage: executable in_file output_file\n"); exit(0); } FILE *dog = fopen(argv[1], "r"); FILE *feven= fopen(argv[2], "w"); FILE *fodd= fopen (argv[3], "w"); // check whether the file has been opened successfully if (dog == NULL) { printf("File %s cannot open!\n", argv[1]); exit(0); } //odd = fopen(argv[2], "w"); { if (i%2!=1) i++;} fprintf(feven, "%d", even); fscanf(dog, "%d", &number[i]); else { i%2==1; i++;} fprintf(fodd, "%d", odd); fscanf(dog, "%d", &number[i]); fclose(feven); fclose(fodd);

    Read the article

  • Right way to return proxy model instance from a base model instance in Django ?

    - by sotangochips
    Say I have models: class Animal(models.Model): type = models.CharField(max_length=255) class Dog(Animal): def make_sound(self): print "Woof!" class Meta: proxy = True class Cat(Animal): def make_sound(self): print "Meow!" class Meta: proxy = True Let's say I want to do: animals = Animal.objects.all() for animal in animals: animal.make_sound() I want to get back a series of Woofs and Meows. Clearly, I could just define a make_sound in the original model that forks based on animal_type, but then every time I add a new animal type (imagine they're in different apps), I'd have to go in and edit that make_sound function. I'd rather just define proxy models and have them define the behavior themselves. From what I can tell, there's no way of returning mixed Cat or Dog instances, but I figured maybe I could define a "get_proxy_model" method on the main class that returns a cat or a dog model. Surely you could do this, and pass something like the primary key and then just do Cat.objects.get(pk = passed_in_primary_key). But that'd mean doing an extra query for data you already have which seems redundant. Is there any way to turn an animal into a cat or a dog instance in an efficient way? What's the right way to do what I want to achieve?

    Read the article

  • Can a PHP object respond to an undefined method?

    - by Nathan Long
    Rails relies on some of the neat aspects of Ruby. One of those is the ability to respond to an undefined method. Consider a relationship between Dog and Owner. Owner has_many :dogs and Dog belongs_to :owner. If you go into script/console, get a dog object with fido = Dog.find(1), and look at that object, you won't see a method or attribute called Owner. What you will see is an owner_id. And if you ask for fido.owner, the object will do something like this (at least, this is how it appears to me): I'm being asked for my .owner attribute. I don't have one of those! Before I throw a NoMethodError, do I have a rule about how to deal with this? Yes, I do: I should check and see if I have an owner_id. I do! OK, then I'll do a join and return that owner object. PHP's documentation is - ahem - a bit lacking sometimes, so I wonder if anyone here knows the answer to this: Can I define similar behavior for objects in PHP? If not, do you know of a workaround for flexible model joins like these?

    Read the article

  • Redirecting http to https (iis 7)

    - by Simon
    Our server redirects http://ourdomain.com/anything to http://ourdomain.com Is is possible to get it to redirect and retain the anything part? ie. http://ourdomain.com/cat/dog to https://ourdomain.com/cat/dog

    Read the article

  • Java enums: Gathering info from another enums

    - by Samuel Carrijo
    I made a similar question a few days ago, but now I have new requirements, and new challenges =). As usual, I'm using the animal enums for didactic purposes, once I don't want to explain domain-specific stuff I have a basic enum of animals, which is used by the whole zoo (I can add stuff to it, but must keep compatibility): public enum Animal { DOG, ELEPHANT, WHALE, SHRIMP, BIRD, GIRAFFE; } I need to categorize them in a few, non-related categories, like gray animals (whale (my whale is gray) and elephant), small animals (bird, shrimp and dog), sea animals (whale and shrimp). I could, as suggested in my previous questions, add a lot of booleans, like isGray, isSmall and isFromSea, but I'd like an approach where I could keep this somewhere else (so my enum doesn't need to know much). Something like: public enum Animal { DOG, ELEPHANT, WHALE, SHRIMP, BIRD, GIRAFFE; public boolean isGray() { // What comes here? } } Somewhere else public enum GrayAnimal { WHALE, ELEPHANT; } How is this possible? Am I requesting too much from Java?

    Read the article

  • macro returning length of arguments in C

    - by anon
    Is it possible to write a C macro that returns the length of its arguments? I want something that does: foo(1) -> 1 foo(cat, dog) -> 2 foo(red, green, blue) -> 3 Even better if this macro can be defined in such a way that it works with ## so that foo(1) -> bar1(1) foo(cat, dog) -> bar2(cat, dog) foo(red, green, blue) -> car3(red, green, blue) Thanks! EDIT: I really want a macro, not a function. Suggestions to use functions will be downvoted.

    Read the article

  • Custom jQuery dropdown

    - by Coughlin
    I am creating a custom simple dropdown using jQuery that hides/shows a element based on over state. The problem I have now is that when you go over the shown element it hides, you cant move your mouse in to the dropdown that was created. Any thoughts on how to fix that also, is there an easier way to do what I have? I am going to be reusing this and not sure the best way to set the code up for I dont need to copy/paste six times. $(function(){ $("#dog-nav").hover( function(){ $(".sub-drop-box-dog").show("fast"); }, function(){ $(".sub-drop-box-dog").hide("fast"); } ); $("#cat-nav").hover( function(){ $(".sub-drop-box-cat").show("fast"); }, function(){ $(".sub-drop-box-cat").hide("fast"); } ); });

    Read the article

  • php - regex- preg_replace - space after line-break!

    - by aSeptik
    Hi all guys! still on regex! i want learn it but i'm still crashing the head into my keybord! ;-) ok very trivial for you, i'm sure! Assuming i have this sting, the \s is where the space actualy is... \n where linebreak is.. DESCRIPTION: The quick brown fox jum`\s\n` `\s`ps over the lazy dog now, what i need to do is remove All the space after the A-Z: that i have achieved by this regex: /\s+(?![A-Z:])/m that produce this result DESCRIPTION: The quick brown fox jum ps over the lazy dog as you can see it leave the space between jum and ps how to have a result like this? DESCRIPTION: The quick brown fox jumps over the lazy dog thank's for the time!

    Read the article

  • Class inheritance in PHP 5.2: Overriding static variable in extension class?

    - by Christoffer
    Hi, I need to bea be able to use a static variable set in a class that extends a base class... from the base class. Consider this: class Animal { public static $color = 'black'; public static function get_color() { return self::$color; } } class Dog { public static $color = 'brown'; } echo Animal::get_color(); // prints 'black' echo Dog::get_color(); // also prints 'black' This works wonderfully in PHP 5.3.x (Dog::get_color() prints 'brown') since it has late static binding. But my production server runs PHP 5.2.11 and so I need to adapt my script. Is there a somewhat pretty workaround to solve this issue? Cheers! Christoffer

    Read the article

  • Oracle - Updating one column or another based on a condition

    - by z-dan
    I want to update a record in a table but based on a condition I will either update one column or another but I do not want to have 2 separate statements because the statements are very long and detailed. Here is the basic idea with over simplification to get to the point. PROCEDURE Animal_something(p_updater VARCHAR2) begin if p_updater = 'person' then -- I want to update the modified_by else -- if p_updater = 'a process' I want to update modified_by_process Update table_creatures set animal_type = 'Dog , **modified_by** = 'Bob' **or do this** **modified_by_process =** 'creature_package' where animal_legs = '4' I don't want: if p_updater = 'person' then Update table_creatures set animal_type = 'Dog , modified_by = 'Bob' where animal_legs = '4'; else Update table_creatures set animal_type = 'Dog , modified_by_process = 'creature_package' where animal_legs = '4'; end;

    Read the article

  • Wrap words in tags, keep markup

    - by spacevillain
    For example I have a string with markup (from html node): hello, this is dog "h<em>e<strong>llo, thi</strong>s i</em><strong>s d</strong>og" What is the most correct way to find some words in it (let's say "hello" and "dog"), wrap them in a span (make a highlight) and save all the markup? Desired output is something like this (notice properly closed tags) <span class="highlight">h<em>e<strong>llo</strong></em></span><strong>,</strong> <em><strong>thi</strong>s<em> i</em><strong>s <span class="highlight"><strong>d</strong>og</span> Looks the same as it should: hello, this is dog

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >