Search Results

Search found 250 results on 10 pages for 'muhammad adeel zahid'.

Page 9/10 | < Previous Page | 5 6 7 8 9 10  | Next Page >

  • php regex replace slashes and spaces and hyphens

    - by Muhammad Shahzad
    I have fews combinations of strings that I need to bring in to one pattern, that is multiple spaces should be removed, double hyphens should be replaced with single hypen, and single space should be replaced with single hyphen. I have already tried this expression. $output = preg_replace( "/[^[:space:]a-z0-9]/e", "", $output ); $output = trim( $output ); $output = preg_replace( '/\s+/', '-', $output ); But this fails in few combinations. I need help in making all of these combinations to work perfectly: steel-black steel- black steel black I should also remove any of these as well "\r\n\t".

    Read the article

  • Generated sql from LINQ to SQL

    - by Muhammad Kashif Nadeem
    Following code ProductPricesDataContext db = new ProductPricesDataContext(); var products = from p in db.Products where p.ProductFields.Count > 3 select new { ProductIDD = p.ProductId, ProductName = p.ProductName.Contains("hotel"), NumbeOfProd = p.ProductFields.Count, totalFields = p.ProductFields.Sum(o => o.FieldId + o.FieldId) }; Generated follwing sql SELECT [t0].[ProductId] AS [ProductIDD], (CASE WHEN [t0].[ProductName] LIKE '%hotel%' THEN 1 WHEN NOT ([t0].[ProductName] LIKE '%hotel%') THEN 0 ELSE NULL END) AS [ProductName], ( SELECT COUNT(*) FROM [dbo].[ProductField] AS [t2] WHERE [t2].[ProductId] = [t0].[ProductId] ) AS [NumbeOfProd], ( SELECT SUM([t3].[FieldId] + [t3].[FieldId]) FROM [dbo].[ProductField] AS [t3] WHERE [t3].[ProductId] = [t0].[ProductId]) AS [totalFields] FROM [dbo].[Product] AS [t0] WHERE (( SELECT COUNT(*) FROM [dbo].[ProductField] AS [t1] WHERE [t1].[ProductId] = [t0].[ProductId] )) > 3 Why is this CASE statement for ProductName and because of this instead of ProductName i am just getting 0 in my result set. It should generate sql like following, (where ProductName like '%hotel%' SELECT [t0].[ProductId] AS [ProductIDD], [ProductName], ( SELECT COUNT(*) FROM [dbo].[ProductField] AS [t2] WHERE [t2].[ProductId] = [t0].[ProductId] ) AS [NumbeOfProd], ( SELECT SUM([t3].[FieldId] + [t3].[FieldId]) FROM [dbo].[ProductField] AS [t3] WHERE [t3].[ProductId] = [t0].[ProductId]) AS [totalFields] FROM [dbo].[Product] AS [t0] WHERE (( SELECT COUNT(*) FROM [dbo].[ProductField] AS [t1] WHERE [t1].[ProductId] = [t0].[ProductId] )) > 3 AND t0.ProductName like '%hotel%' Thanks.

    Read the article

  • How do i connect with dart community to suggest something

    - by Muhammad Umer
    I am new to this stackoverflow and programming. So HI!!!! What i hope to do is tell something that i think is important to Dart community. If somehow it was possible to code android and or iphone apps using dart that would be very awesome and same for Dart.... There is one path, that is making program in dart compiling it to javascript and then making app using Adobe air..... .But looks inefficient. so is there any other way which i am unaware of, via which i can build an android app at least.. using dart i know you can build an app, using javascript..and css+html...so i am looking for html+css+dart. It'd be cool if adobe air supports dart language directly.

    Read the article

  • Update table without using cursor and on date

    - by Muhammad Kashif Nadeem
    Please copy and run following script DECLARE @Customers TABLE (CustomerId INT) DECLARE @Orders TABLE ( OrderId INT, CustomerId INT, OrderDate DATETIME ) DECLARE @Calls TABLE (CallId INT, CallTime DATETIME, CallToId INT, OrderId INT) ----------------------------------------------------------------- INSERT INTO @Customers SELECT 1 INSERT INTO @Customers SELECT 2 ----------------------------------------------------------------- INSERT INTO @Orders SELECT 10, 1, DATEADD(d, -20, GETDATE()) INSERT INTO @Orders SELECT 11, 1, DATEADD(d, -10, GETDATE()) ----------------------------------------------------------------- INSERT INTO @Calls SELECT 101, DATEADD(d, -19, GETDATE()), 1, NULL INSERT INTO @Calls SELECT 102, DATEADD(d, -17, GETDATE()), 1, NULL INSERT INTO @Calls SELECT 103, DATEADD(d, -9, GETDATE()), 1, NULL INSERT INTO @Calls SELECT 104, DATEADD(d, -6, GETDATE()), 1, NULL INSERT INTO @Calls SELECT 105, DATEADD(d, -5, GETDATE()), 1, NULL ----------------------------------------------------------------- I want to update @Calls table and need following results. I am using the following query UPDATE @Calls SET OrderId = ( CASE WHEN (s.CallTime > e.OrderDate) THEN e.OrderId END ) FROM @Calls s INNER JOIN @Orders e ON s.CallToId = e.CustomerId and the result of my query is not what I need. Requirement: As you can see there are two orders. One is on 2010-12-12 and one is on 2010-12-22. I want to update @Calls table with relevant OrderId with respect to CallTime. In short If subsequent Orders are added, and there are further calls then we assume that a new call is associated with the most recent Order Note: This is sample data so this is not the case that I always have two Orders. There might be 10+ Orders and 100+ calls. Note2 I could not find good title for this question. Please change it if you think of any better. Thanks.

    Read the article

  • Block temporarily interaction during wcf call!

    - by Muhammad Jamal Shaikh
    hi , Silverlight version : 4 Silverlight patter :MVVM Visual Studio template :Silverlight navigation application How do I block main navigation on (mainpage.xaml) as in any silverlight navigation application and block page's controls ( i.e whichever page is it in ) during async webservice calls in my viewmodel? Any best practices?

    Read the article

  • Entity framework generates values for NOT NULL columns which has default defined in db.

    - by Muhammad Kashif Nadeem
    Hi I have a table Customer. One of the columns in table is DateCreated. This column is NOT NULL but default values is defined for this column in db. When I add new Customer using EF4 from my code. var customer = new Customer(); customer.CustomerName = "Hello"; customer.Email = "[email protected]"; // Watch out commented out. //customer.DateCreated = DateTime.Now; context.AddToCustomers(customer); context.SaveChanges(); Above code generates following query. exec sp_executesql N'insert [dbo].[Customers]([CustomerName], [Email], [Phone], [DateCreated], [DateUpdated]) values (@0, @1, null, @2, null) select [CustomerId] from [dbo].[Customers] where @@ROWCOUNT > 0 and [CustomerId] = scope_identity() ',N'@0 varchar(100),@1 varchar(100),@2 datetime2(7) ',@0='Hello',@1='[email protected]',@2='0001-01-01 00:00:00' And throws following error The conversion of a datetime2 data type to a datetime data type resulted in an out-of-range value. The statement has been terminated. Can you please tell me how NOT NULL columns which has default values at db level should not have values generated by EF? DB: DateCreated DATETIME NOT NULL DateCreated Properties in EF: Nullable: False Getter/Setter: public Type: DateTime DefaultValue: None Thanks.

    Read the article

  • Define variables outside the PHP class.

    - by Muhammad Sajid
    Hello, I m using zend. I want to define the below code outside the controller class & access in different Actions. $user = new Zend_Session_Namespace('user'); $logInArray = array(); $logInArray['userId'] = $user->userid; $logInArray['orgId'] = $user->authOrgId; class VerifierController extends SystemadminController { public function indexAction() { // action body print_r($logInArray); } } How it is possible.

    Read the article

  • Exception when retrieving record using Nhibernate

    - by Muhammad Akhtar
    I am new to NHibernate and have just started right now. I have very simple table contain Id(Int primary key and auto incremented), Name(varchar(100)), Description(varchar(100)) Here is my XML <class name="DevelopmentStep" table="DevelopmentSteps" lazy="true"> <id name="Id" type="Int32" column="Id"> </id> <property name="Name" column="Name" type="String" length="100" not-null="false"/> <property name="Description" column="Description" type="String" length="100" not-null="false"/> here is how I want to get all the record public List<DevelopmentStep> getDevelopmentSteps() { List<DevelopmentStep> developmentStep; developmentStep = Repository.FindAll<DevelopmentStep>(new OrderBy("Name", Order.Asc)); return developmentStep; } But I am getting exception The element 'id' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List of possible elements expected: 'urn:nhibernate-mapping-2.2:meta urn:nhibernate-mapping- 2.2:column urn:nhibernate-mapping-2.2:generator'. Please Advise me --- Thanks

    Read the article

  • How to determine a text block of a file in one version come from which file in the previous version?

    - by Muhammad Asaduzzaman
    The problem is described below: Suppose I have a list of files in one version(say A,B,C,D). In the next version I have the following files(A,E,F,G). There are some similarities in their contents. The files in the later version comes from the previous version by file name renaming, content addition, deletion or partial modification or without any change( for example A is not changed). I take a block of text from a file(E, 2nd version) and check which files(in the 1st version) contain this text block. I found that B,C and D contain the text fragment. I want to determine from which file(B or c or d) this text block actually comes from.(I assume that E is a file whose name change in the second version). Since the contents may be changed, added or deleted in the later version, so in order to determine similarity I use LCS algorithm. But I cannot map the file with its previous version. I think one possible approach might be to use the location information of the match text blocks. But this heuristics not always work. Is there any research or algorithm exist to find so. Any direction will be helpful. Thanks in advance.

    Read the article

  • Stored procedure does not return result when using Temp table

    - by Muhammad Akhtar
    I have used temp table in my stored procedure and unable to get the result when executing. It return result fine when running the same as query. my query structure is something like... ALTER PROCEDURE [dbo].[test] as begin SET NOCOUNT ON; SELECT * INTO #Dates FROM Dates -- Used temp table SET @Query = ' SELECT [Name], [HotelName], '+@Dates+' FROM ( SELECT , HD.[Name], HD.[HotelName], HD.Price FROM #Dates D LEFT JOIN #HotelData HD ON D.DateVal = HD.OccDate) T PIVOT ( SUM(Price) FOR [Date] IN ('+@Dates+') ) AS PT' execute(@Query) end Exec test -- Exectuting, I am getting message command completed successfully

    Read the article

  • Website renders two scroll bars, is it the CSS, xhtml, or some jquery plugin?

    - by Muhammad
    I've come to notice a bug on my website, I see that there's two scroll bars when the window is re-sized from a full sized window (my desktop's 1280x900). This issue is untraceable with Firebug and it shows up on all browsers. I'm using a JQuery UI script on the page as well but I'm not sure if that's what's doing this. What's a good way to go about getting rid of this? Or has anyone ever encountered having two scroll bars on the page? BTW: The in-page scroll bar is actually above the footer, if that helps.

    Read the article

  • Query takes time on comparing non numeric data of two tables, how to optimize it?

    - by Muhammad Kashif Nadeem
    I have two DBs. The 1st db has CallsRecords table and 2nd db has Contacts table, both are on SQL Server 2005. Below is the sample of two tables. Contact table has 1,50,000 records CallsRecords has 75,000 records Indexes on CallsRecords: CallFrom CallTo PickUP Indexes on Contacts: PhoneNumber I am using this query to find matches but it take more than 7 minutes. SELECT * FROM CallsRecords r INNER JOIN Contact c ON r.CallFrom = c.PhoneNumber OR r.CallTo = c.PhoneNumber OR r.PickUp = c.PhoneNumber In Estimated execution plan inner join cost 95% Any help to optimize it.

    Read the article

  • Change array structure in PHP.

    - by Muhammad Sajid
    Refers to my previous question : Show values in TDropDownList in PRADO. ok fine the array i receive from query is an object array like : ContactRecord Object ( [id] => 1 [name] => leo [_recordState:protected] => 1 [_connection:protected] => [_invalidFinderResult:protected] => [_e:TComponent:private] => Array ( ) ) ContactRecord Object ( [id] => 2 [name] => ganda [_recordState:protected] => 1 [_connection:protected] => [_invalidFinderResult:protected] => [_e:TComponent:private] => Array ( ) ) If I convert it in to array like: Array ( [key 1] => leo [key 2] => ganda ) then I can populate values into TDropDownList. Now can anyone help me to convert array structure which I need ... ? Again thanks

    Read the article

  • How to set readonly property of textbox from css.

    - by Muhammad Sajid
    i create css code like .inputHide { font-size : 100px; width : 100px; height : 100px; border : none; background : transparent; readonly : true; } But it does not work. Although if i use font-size of 1px then by using tab i can access that textbox & can change it's value. Is there any way to make textbox readonly just using css..

    Read the article

  • AJAX: Permission denied to access property in iframe

    - by Muhammad Sajid
    Hi I created an php website which uses for AJAX post and was live at http://sprook.com.au/ but my client change it's domain to http://www.sprookit.net/ from his service provider Godaddy and now the firebug says: Permission denied to access property 'stopAjax' here stopAjax is my method name. script is there: <div class="post_area"> <form action="post.php" method="post" id="addVideo" enctype="multipart/form-data" target="post" onsubmit="return startAjax(this);"> <iframe id="post" name="post" src="#" style="width:0;height:0;border:0px solid #fff;"></iframe> <table width="860" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="435">POST YOUR AD FREE<br /> <em>Paste embed code from YouTube</em></td> <td width="322"><input type="text" id="videoLink" name="videoLink" class="input_textbox" /> </td> <td width="95"><input type="submit" name="set_video_link" id="set_video_link" value="" class="submt_post" /> </td> </tr> <tr> <td>&nbsp;</td> <td><div id="process"> Connecting please wait <img src="images/loading.gif" /><br/> </div></td> </tr> </table> </form> </div> And all content comes from old domain i removed index file and it stoped working, therefore it is cleared that scripts run from old domain.

    Read the article

  • Localhost doesnot work.

    - by Muhammad Sajid
    Hi, I installed wamp server on xp. During the installation it did not show any error/warning message. Then i start it & type http://localhost/ in url bar but it just show a blank page. I also checked notepad C:\WINDOWS\system32\drivers\etc\hosts their is no restriction for localhost. Help. Thanks...

    Read the article

  • project plan scheduling...

    - by Muhammad Adnan
    I am looking for some algorithm/library to get functionality like microsoft project caters for scheduling tasks dates as if we change any task date then its parent, predecessors and successors dates get effected. is there any help i can get... in any way.. Thanks,

    Read the article

< Previous Page | 5 6 7 8 9 10  | Next Page >