Search Results

Search found 19928 results on 798 pages for 'multiple constructors'.

Page 97/798 | < Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >

  • Replacing multiple patterns in a block of data

    - by VikrantY
    Hi All, I need to find the most efficient way of matching multiple regular expressions on a single block of text. To give an example of what I need, consider a block of text: "Hello World what a beautiful day" I want to replace Hello with "Bye" and "World" with Universe. I can always do this in a loop ofcourse, using something like String.replace functions availiable in various languages. However, I could have a huge block of text with multiple string patterns, that I need to match and replace. I was wondering if I can use Regular Expressions to do this efficiently or do I have to use a Parser like LALR. I need to do this in JavaScript, so if anyone knows tools that can get it done, it would be appreciated.

    Read the article

  • Database strucure for versioning and multiple languages

    - by phobia
    Hi, I'm wondering how to best solve the issue of content existing in multiple versions and multiple languages. An image of my current structure can be seen here: http://i46.tinypic.com/72fx3k.png Each content can only have one active version in each language, and that's how I'm curious on how to best solve. Right now I have a column of the contentversions table, which means for each change of active version I have to run a update and set active=false on all version and then a update to set active=true for the piece of content in question. Any thoughts? :)

    Read the article

  • MVVM and division of amongst multiple developers

    - by nlawalker
    Can anyone speak to the ease of dividing work amongst multiple developers when designing and building a medium- to large-complexity Silverlight or WPF application? My team is finding it difficult to cleanly split work when you've got, for example, a number of controls that provide different visualizations of a Model/ViewModel that's fairly complex and has a lot of properties and methods for interacting with data. It seems like a very big portion of the work ends up being the design and build of the Model/ViewModel, and much less inside each of the controls, which are naturally what are easy to ration out to multiple people.

    Read the article

  • Passing multiple aruments to a UNIX shell script

    - by Waffles
    Hello all, I have the following (bash) shell script, that I would ideally use to kill multiple processes by name. #!/bin/bash kill `ps -A | grep $* | awk '{ print $1 }'` However, while this script works is one argument is passed: end chrome (the name of the script is end) it does not work if more than one argument is passed: $end chrome firefox grep: firefox: No such file or directory What is going on here? I thought the $* passes multiple arguments to the shell script in sequence. I'm not mistyping anything in my input - and I the programs I wan to kill (chrome and firefox) are open. Any help is appreciated.

    Read the article

  • Multiple task in one page?(php - mysql - jquery)

    - by python
    My goal is to build an application in a page that can be use multiple task(crud) for example in this html code.there are multiple submit,multiple action in the same page after (user submit (CURD) it will load result table below.) In juery how Can I do this.? <script type="text/javascript" src="jquery.js"></script> <script> $(document).ready(function(){ $("#button1").click(function(){ $('form#crudform').attr({action: "script_1.php"}); $('form#crudform').submit(); }); $("#button2").click(function(){ $('form#crudform').attr({action: "script_2.php"}); $('form#crudform').submit(); }); $("#button3").click(function(){ $('form#crudform').attr({action: "script_3.php"}); $('form#crudform').submit(); }); }); </script> Form CRUD: <form id="crudform" method="post"> <p>Name: <input type="text" name="name"/></p> <p>Age: <input type="text" name="age"/></p> <input type="button" id="button1" value="Cancel" /> <input type="button" id="button2" value="Save" /> <input type="button" id="button3" value="Update" /> </form> Result: <form id="result" method="post"> <table border="1"> <tr> <tr><td></td><td>Name</td><td>Age</td> </tr> <tr><td><input type="checkbox" name="name1"></td><td>Name1</td><td>10</td><tr> <tr><td><input type="checkbox" name="name1"></td><td>Name2</td><td>15</td></tr> <tr><td><input type="checkbox" name="name3"></td><td>Name3</td><td>16</td></tr> </table> <input type="button" id="button4" value="change" /> <input type="button" id="button5" value="drop" /> </form> Anybody know the tutorials relating ..with my tasks.or tips,guide.....are welconme :)

    Read the article

  • How to remove multiple instances and just have one instance while multiple function calls in php ?

    - by Rachel
    public function getHelperInstance() { $user = new Helper(); $user->set($result['data']); return $user; } I am calling getHelper() class multiple times and if $user is not empty than am calling getHelperInstance(), now in my case getHelperInstance() always creates a new instance of Helper() class and so every time I call getHelperInstance() function am creating a new instance of Helper() so is there any way where can I can just create one instance of Helper() and use it multiple times instead of creating a new instance everytime. Any suggestions !!! public function getHelper() { $user = array(); if (!empty($user)) { $user = $this->getHelperInstance(); } return $user; }

    Read the article

  • Android: How to invalidate multiple parts of screen

    - by user342731
    I need to be able to selectively invalidate multiple (about 20) rectangles on the screen for performance reasons, so tried the following: Vector<Rect> myRects = new Vector<Rect>(); // ... add some Rects to myRects for (Rect r : myRects) { invalidate(r); } However this seems to invalidates a union of all the Rect's, forming one large rectangle which covers all of small ones I'm trying to invalidate. How can one invalidate multiple areas on the screen, and only those areas?

    Read the article

  • Windows Workflows - While Activity for creating multiple tasks not working

    - by Georgil Mathew
    I am using a while activity for creating multiple tasks for a workflow. The code is executed fine and the task is created when the loop runs only once. But when the loop runs twice or more, only one task is getting created. Also the WF status shows as Error Occured. All I want to do here is create multiple tasks (no of tasks depends on an entered column value) for the same user. Is it posible to use 'while' in this scenario? Or is there any other way to go ahead? NB: I am using state machine workflow.

    Read the article

  • .NET | Persist multiple objects in minimum number of queries

    - by VarunGupta
    I have a list of objects which needs to be persisted in a SQL Server database table, where each object gets persisted as single record. i.e. List of objects result in insertion of multiple records. Trivial way of saving the objects is to loop over the list and fire a query/stored procedure/etc. for saving that record. But this results in multiple database interactions. Is there a way to persist the list of objects in lesser number of database interactions?

    Read the article

  • Need to get Multiple tables from SqlServer at a time

    - by narmadha
    Hi ,I am working with C#.net,I am using cursor concept in my storedprocedure,While executing it in Sqlserver it is showing Multiple tables,but it is not returning multiple Tables in the code,it is returning only the first table,The following is the code which i have used: DataSet ds = new DataSet("table1"); using (SqlConnection connection = new SqlConnection(connectionstring)) { using (SqlDataAdapter da = new SqlDataAdapter("getworkpersondetails_Orderidwise", connection)) { da.SelectCommand.CommandType = CommandType.StoredProcedure; SqlParameter param; param = new SqlParameter("@OrderId", SqlDbType.Int); param.Value = OrderId; da.SelectCommand.Parameters.Add(param); param = new SqlParameter("@CompanyId", SqlDbType.Int); param.Value = CompanyId; da.SelectCommand.Parameters.Add(param); connection.Open(); da.Fill(ds); connection.Close(); return ds; } }

    Read the article

  • PHP Flatten Array with multiple leaf nodes

    - by tafaju
    What is the best way to flatten an array with multiple leaf nodes so that each full path to leaf is a distinct return? array("Object"=>array("Properties"=>array(1, 2))); to yield Object.Properties.1 Object.Properties.2 I'm able to flatten to Object.Properties.1 but 2 does not get processed with recursive function: function flattenArray($prefix, $array) { $result = array(); foreach ($array as $key => $value) { if (is_array($value)) $result = array_merge($result, flattenArray($prefix . $key . '.', $value)); else $result[$prefix . $key] = $value; } return $result; } I presume top down will not work when anticipating multiple leaf nodes, so either need some type of bottom up processing or a way to copy array for each leaf and process (althought that seems completely inefficient)

    Read the article

  • One big call vs. multiple smaller TSQL calls

    - by BrokeMyLegBiking
    I have a ADO.NET/TSQL performance question. We have two options in our application: 1) One big database call with multiple result sets, then in code step through each result set and populate my objects. This results in one round trip to the database. 2) Multiple small database calls. There is much more code reuse with Option 2 which is an advantage of that option. But I would like to get some input on what the performance cost is. Are two small round trips twice as slow as one big round trip to the database, or is it just a small, say 10% performance loss? We are using C# 3.5 and Sql Server 2008 with stored procedures and ADO.NET.

    Read the article

  • ssrs: one static row matrix, multiple columns will not filter out nulls

    - by pbarton99
    Using a ssrs 2005 matrix client side. I want to list the multiple addresses of one person, hence one row, multiple columns. The Column field is =Fields!StreetName.Value. The data details field is =First(Fields!StreetPrefix.Value) & " " & First(Fields!StreetName.Value). The datasource has a row for each address; however, some rows will have nulls since the datasource is composed of outer joins. The column grouping works, but the first column is always empty, (first 2 rows of datasource are null) addresses appear only after the empty column. I want to filter out nulls on the matrix, but its like the filter is ignored. I have also tried having the dataset return an empty string for a null streetname and setting the filter to =Fields!StreetName.Value != ="" but no difference. What am I missing?

    Read the article

  • Multiple Asserts in a Unit Test

    - by whatispunk
    I've just finished reading Roy Osherove's "The Art of Unit Testing" and I am trying to adhere to the best practices he lays out in the book. One of those best practices is to not use multiple asserts in a test method. The reason for this rule is fairly clear to me, but it makes me wonder... If I have a method like: public Foo MakeFoo(int x, int y, int z) { Foo f = new Foo(); f.X = x; f.Y = y; f.Z = z; return f; } Must I really write individual unit tests to assert each separate property of Foo is initialized with the supplied value? Is it really all that uncommon to use multiple asserts in a test method? FYI: I am using MSTest.

    Read the article

  • SQL - Joining multiple records to one record

    - by ho
    I've got a SQL Server database with the the following tables: Client (ClientID, ClientName) SalesAgent (AgentID, AgentName) Item (ItemID, Description) Purchase (PurchaseID, ClientID, Price) PurchaseSalesAgent (PurchaseID, AgentID) Each purchase is only ever one item to one client but there can have been multiple agents involved. I want to return the following list of columns: ClientName, Description, Price, Agents Where Agents is the names of all the agents involved in the purchase. Either as a comma separated list or as multiple columns with one agent in each. I'm looking for a way that's compatible with SQL Server 2000 but I'd also be interested in if there's a better way of doing it in SQL Server 2008.

    Read the article

  • What is prefered stratigies for cross browser and multiple styled table in CSS

    - by jitendra
    in default css what should i predefined for <table>, td, th , thead, tbody, tfoot I have to work in a project there are so many tables with different color schemes and different type of alignment like in some table , i will need to horizontally align data of cell to right, sometime left, sometime right. same thing for vertical alignment, top, bottom and middle. some table will have thin border on row , some will have thick (same with column border). Some time i want to give different background color to particular row or column or in multiple row or column. So my question is: What code should i keep in css default for all tables and how to handle table with different style using ID and classes in multiple pages. I want to do every presentational thing with css. How to make ID classes for everything using semantic naming ? Which tags related to table can be useful?

    Read the article

  • Loading the last related record instantly for multiple parent records using Entity framework

    - by Guillaume Schuermans
    Does anyone know a good approach using Entity Framework for the problem described below? I am trying for our next release to come up with a performant way to show the placed orders for the logged on customer. Of course paging is always a good technique to use when a lot of data is available I would like to see an answer without any paging techniques. Here's the story: a customer places an order which gets an orderstatus = PENDING. Depending on some strategy we move that order up the chain in order to get it APPROVED. Every change of status is logged so we can see a trace for statusses and maybe even an extra line of comment per status which can provide some extra valuable information to whoever sees this order in an interface. So an Order is linked to a Customer. One order can have multiple orderstatusses stored in OrderStatusHistory. In my testscenario I am using a customer which has 100+ Orders each with about 5 records in the OrderStatusHistory-table. I would for now like to see all orders in one page not using paging where for each Order I show the last relevant Status and the extra comment (if there is any for this last status; both fields coming from OrderStatusHistory; the record with the highest Id for the given OrderId). There are multiple scenarios I have tried, but I would like to see any potential other solutions or comments on the things I have already tried. Trying to do Include() when getting Orders but this still results in multiple queries launched on the database. Each order triggers an extra query to the database to get all orderstatusses in the history table. So all statusses are queried here instead of just returning the last relevant one, plus 100 extra queries are launched for 100 orders. You can imagine the problem when there are 100000+ orders in the database. Having 2 computed columns on the database: LastStatus, LastStatusInformation and a regular Linq-Query which gets those columns which are available through the Entity-model. The problem with this approach is the fact that those computed columns are determined using a scalar function which can not be changed without removing the formula from the computed column, etc... In the end I am very familiar with SQL and Stored procedures, but since the rest of the data-layer uses Entity Framework I would like to stick to it as long as possible, even though I have my doubts about performance. Using the SQL approach I would write something like this: WITH cte (RN, OrderId, [Status], Information) AS ( SELECT ROW_NUMBER() OVER (PARTITION BY OrderId ORDER BY Id DESC), OrderId, [Status], Information FROM OrderStatus ) SELECT o.Id, cte.[Status], cte.Information AS StatusInformation, o.* FROM [Order] o INNER JOIN cte ON o.Id = cte.OrderId AND cte.RN = 1 WHERE CustomerId = @CustomerId ORDER BY 1 DESC; which returns all orders for the customer with the statusinformation provided by the Common Table Expression. Does anyone know a good approach using Entity Framework?

    Read the article

  • Wireshark Plugin: Dissecting Payloads With Multiple Packets Per UDP Frame

    - by John Dibling
    I am writing a Wireshark plugin to dissect a protocol that places multiple application-level packets in a single UDP frame. There is no enclosing protocol that indicates how many packets there are in the frame. So essentially, the payload coming down the wire will look like this: uint64 sequence1 uint64 data1 uint8 flags1 uint64 sequence2 uint64 data2 uint8 flags2 : : : uint64 sequence_n uint64 data_n uint8 flags_n In my server code that actually processes this information, I simply loop through the frame until I reach the end. In looking through the plugins included with the wireshark source code, I didn't see any protocols that did any looping like this. I know other protocols pack multiple payloads per frame. What is the cannonical or standard way to handle protocols like this in a Wireshark dissector?

    Read the article

  • How to show/hide certain div when i have multiple div with same class name

    - by Rajasekar
    I had multiple div with class name blueflip i want to toggle this class's div content when the div link_button is clicked. My Code : $(document).ready(function(){ $('.blueflip').hide(); $('.link_button').click(function() { $('.blueflip').toggle(400); return false; }); }); It works fine. But my problem is, my page has multiple link_button and blueflip div's all over the page. when i click any one of link_button all of the blueflip div's are toggling. But i need to toggle the corresponding child blueflip div only Note : The divs are dynamically generated from database. How to achieve that, Plz help. Any suggestion will be highly appreciated

    Read the article

  • DataReader or DataSet when pulling multiple recordsets in ASP.NET

    - by Gern Blandston
    I've got an ASP.NET page that has a bunch of controls that need to be populated (e.g. dropdown lists). I'd like to make a single trip to the db and bring back multiple recordsets instead of making a round-trip for each control. I could bring back multiple tables in a DataSet, or I could bring back a DataReader and use '.NextResult' to put each result set into a custom business class. Will I likely see a big enough performance advantage using the DataReader approach, or should I just use the DataSet approach? Any examples of how you usually handle this would be appreciated.

    Read the article

< Previous Page | 93 94 95 96 97 98 99 100 101 102 103 104  | Next Page >