Search Results

Search found 257 results on 11 pages for 'aj patel'.

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

  • Debian Package Control file Question.

    - by AJ
    Hello, I need to create a debian package for a java application. In my package there a .jar file which is executable , a script which will run this jar file and a .so file for fmod. I read the tutorial provided at http://tldp.org/HOWTO/html_single/Debian-Binary-Package-Building-HOWTO/ My question is in control file there is a Depends field which basically mentions the packages that need to installed in order to install my application. How do i find which packages are required for my application. I followed the instructions provided in the link for one of the .so and did ~/Desktop/PennTotalRecall/native/fmod/lib/linux64$ dpkg -S libfmodex64-4.28.09.so dpkg: libfmodex64-4.28.09.so not found. It gives above result. Also my application requires java 1.5 to be installed in order for it to run. How do I specify in my debian package. Thanks, AJ

    Read the article

  • .net converting bytearray to double[]

    - by AJ
    Hello, I am working with a database from a legacy app which stores 24 floating point values (doubles) as a byte array of length 192, so 8 bytes per value. This byte array is stored in a column of type image in a SQL Server 2005 database. In my .net app I need to read this byte array and convert it to a array of type Double[24]. I can access the field easy enough reader.GetBytes(...) but how to convert the returned ByteArray to Double[24] Any ideas? Thanks, AJ

    Read the article

  • Using Entity Framework for SQL Compact Edition 3.5 does not respect mode=exclusive property of conne

    - by AJ
    I am using SQL Server Compact 3.5 edition with Entity Framework and I want to have exclusive lock on the database as documented here http://msdn.microsoft.com/en-us/library/ms171817.aspx. However when you pass this in a connection string to Entity Framework it does not respect this at all. An example of the connection string as following private static readonly string _ConnectionStringFormat = @"metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl; provider=System.Data.SqlServerCe.3.5; provider connection string='Data Source={0};Mode=Exclusive'"; If anyone has come across this issue before and have found out how to resolve this, then please let me know. Thanks Aj

    Read the article

  • Scroll bar not maintaining its position in ListView (ASP.net)

    - by AJ
    Hi I have a listview inside a DIV which shows the scroll bars. At one time, let's say, 10 rows can be seen. I scroll down and click Edit on 25 row. To my surprise, the scroll goes to the first row (although if I go back to 25th row, the row is in edit mode) My issue, how I can make sure that the scroll bar maintains its position to 25th row after clicking on Edit button? Please advise. Thanks AJ .StopScroll1{ Z-INDEX: 20; POSITION: relative;left:-1px; TOP: expression(document.getElementById("divGrid1").scrollTop); }        ..... .....

    Read the article

  • Adding Silverlight pages to existing ASP.net page??

    - by AJ
    Hi I know how to add SL page as a whole to existing ASP.net application. We have existing ASP.net page with few tabs. Each tab is a user control. We want to add another tab, which will host Silverlight content. Is it possible to add silverlight content in one of the tabs of a page? Any example links? Another way of putting up the same question : Is it possible to have an ASP.net page with top half as regular asp.net content and other half containing silverlight content? Please advise. Thanks AJ

    Read the article

  • WCF web.config is getting overwritten after every compilation?

    - by AJ
    Hi I have a Silverlight application calling a WCF service. SimplehttpBinding stuff. Every I make changes to silverlight xaml code, the web.config gets refrshed also. Even if make any changes to web.cofig file, they get overwritten too. Its as if, some other process is writing these files. Why is that happening? How can I make sure that it does not get overwritten after every compile? Please advise. THanks AJ.

    Read the article

  • Macro - To create one [.csv] file from/using multiple workbooks, kept in a folder, containing multi

    - by AJ
    Hello, I have more than one Excel Workbooks containing multiple worksheets in each of them. I would like to have a macro which help me to create (combine the information from) all the worksheets into one pipe [|] delimited [.csv] file. These sheets should be combined/appended into the [.csv] file, in the same order these worksbooks appear in a folder and in the order sheets appear in these workbooks. The macro should ask for a delimiter/separator specific to me and the input and output path based on my selection. It would be great if the output [.csv] file is names as "foldername" + "Output.csv" Thank you, Best Regards - AJ

    Read the article

  • Rebuild whole page on callback?

    - by AJ
    Hello, In asp.net is it a requirement to rebuild the whole page during every callback? For example my web page is split into three distinct areas and I have an update panel for each area. Lets say I want to update the third area, do I have to bother with any processing of the other two areas? For example lets say there is a grid view in area two. The update panel in area three callbacks to update its content. Do I have to rebind the grid in area two? Thanks, AJ

    Read the article

  • List.AddRange inline declaration

    - by AJ
    Hello, This may seem an easy question, but not to me, also a search has led to nothing. Up until now the only .net programming I have done is with Delphi Prism. With Prism I can do things like: var l := new List<String>(['A','B','C']); or var l := new List<String>; l.AddRange(['A','B','C']; but can I do a similar thing in C#, or do I have to do it like: var a = new String[] {"A","B","C"}; var l = new List<String>(a); Thanks, AJ

    Read the article

  • Vitality of Product Information Management Showcased at OpenWorld 2012

    - by Mala Narasimharajan
     By Sachin Patel Can you hear the countdown clock ticking!! OpenWorld 2012 is almost here and as I write this Oracle is buzzing with fresh new ideas and solutions that will be showcased this year. What an exciting time for all of us to be in midst of a digital revolution. Whether it is Apple fans clamoring to find every new feature that has been added to the iPhone 5 or a startup launching a new digital thermostat (has anyone looked at the new one from Nest ), product information is a vital for companies to grow and compete in this cut-throat market. Customer today struggle to aggregate and enrich this product data from the myriad of systems they have in place to run their businesses and operations. Having a product information strategy is paramount to align your sales channels and operations with the most accurate and upto date product data. We have a number of sessions this year at OpenWorld where you can gain more insight into how Oracle’s next generation of Fusion Applications, in this case Fusion Product Hub can provide you with a solution to streamline and get control of your Product Master Data. Enabling Trusted Enterprise Product Data with Oracle Fusion Product HubTuesday, October 2nd 11:45 am, Moscone West 2022 Join me Sachin Patel, Director of Product Strategy and Milan Bhatia, VP of Development as we discuss how you can enable trusted product master data in your enterprise. In this session we plan to cover the challenges companies face today in mastering product data. The discussion will also include how Fusion Product Hub brings new and innovative features to empower your product data owners to create a holistic and rich product definition that can be leveraged across your enterprise. We will also be joined by Pawel Fidelus from Fideltronik an Early Adopter for Fusion Product Hub who will showcase their plans to implement Fusion Product Hub and the value it will bring to Fideltronik Multichannel Fulfillment Excellence in Direct-to-Consumer Market Thursday, October 4th, 12:45 am, Moscone West 2024 Do you have multiple order capture systems? Do you have difficulty in fulfilling orders for your customers across various channels and suppliers? Mark Carson, Director, Fusion DOO and Brad Kerr, Director, AGSS will be showcasing the Fusion Distributed Order Orchestration solution and how companies can orchestrate orders from multiple order capture systems and route them to the appropriate fulfillment system. Sachin Patel, Director Product Strategy for Product MDM will highlight the business pain points in consolidating and commercializing data from a Multi Channel Commerce point of view and how Fusion Product Hub helps in allowing you to provide a single source of truth to drive a singular and rich customer experience. Oracle Fusion Supply Chain Management: Customer Adoption and Experiences                                                Wednesday, October 3rd 10:15 am, Moscone West 2003 This is a great session to attend to learn about how Fusion Supply Chain Management and Fusion Product Hub Early Adopters, including Boeing and Fideltronik are leveraging Fusion Applications to improve their Supply Chain operations. Have a great OpenWorld and see you soon!!

    Read the article

  • Electronic circuit simulator four-way flood-filling issues

    - by AJ Weeks
    I've made an electronic circuit board simulator which has simply 3 types of tiles: wires, power sources, and inverters. Wires connect to anything they touch, other than the sides of inverters; inverters have one input side and one output side; and finally power tiles connect in a similar manner as wires. In the case of an infinite loop, caused by the output of the inverter feeding into its input, I want inverters to oscillate (quickly turn on/off). I've attempted to implement a FloodFill algorithm to spread the power throughout the grid, but seem to have gotten something wrong, as only the tiles above the power source get powered (as seen below) I've attempted to debug the program, but have had no luck thus far. My code concerning the updating of power can be seen here.

    Read the article

  • Help needed on a UI/Developer Interview

    - by AJ Seth
    I have a phone interview with a major Internet company and it is a mostly front-end developer position. If anyone has experience with UI/developer interviews and can give some advice/questions asked etc. that'll be great. Additionally, what resources can be read and reviewed for the following: Designing for performance, scalability and availability Internet and OS security fundamentals EDIT: Now I am told that the interview I am told will be mostly on coding, Data Structures, design questions etc. Anyone?

    Read the article

  • Ubuntu 12.04 connected to wireless network but internet not working

    - by A.J.
    I can connect to my house's wireless network just fine, but when I'm connected I can't browse the web. Firefox starts connecting to a site and then just poops out. This doesn't happen on my roommates' computers (running Windows) or on our 3DSes, so I know it's just my laptop. I already tried sudo dhclient -r sudo dhclient sudo ifconfig eth0 down sudo ifconfig eth0 up Results of a few commands I was asked to run in comments: ping -c 2 4.2.2.2 PING 4.2.2.2 (4.2.2.2) 56(84) bytes of data. ^C --- 4.2.2.2 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms ping -c 2 google.com PING google.com (173.194.33.38) 56(84) bytes of data. --- google.com ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1006ms nm-tool NetworkManager Tool State: connected (global) - Device: eth0 ----------------------------------------------------------------- Type: Wired Driver: atl1c State: unavailable Default: no HW Address: 88:AE:1D:6B:4E:E7 Capabilities: Carrier Detect: yes Speed: 100 Mb/s Wired Properties Carrier: off - Device: wlan0 [JUSTICE] ----------------------------------------------------- Type: 802.11 WiFi Driver: ath9k State: connected Default: yes HW Address: 1C:65:9D:65:C6:31 Capabilities: Speed: 1 Mb/s Wireless Properties WEP Encryption: yes WPA Encryption: yes WPA2 Encryption: yes Wireless Access Points (* = current AP) HOME-9B18: Infra, 00:26:F3:53:9B:18, Freq 2412 MHz, Rate 54 Mb/s, Strength 34 WPA WPA2 cougdad48 Network: Infra, 60:33:4B:E4:C4:5D, Freq 2437 MHz, Rate 54 Mb/s, Strength 22 WPA2 cougdad48 Guest Network: Infra, 66:33:4B:E4:C4:5D, Freq 2437 MHz, Rate 54 Mb/s, Strength 20 WPA2 belkin.ade: Infra, 94:44:52:FF:8A:DE, Freq 2457 MHz, Rate 54 Mb/s, Strength 20 WPA WPA2 *JUSTICE: Infra, 00:24:01:7B:9F:7E, Freq 2462 MHz, Rate 54 Mb/s, Strength 88 WEP CenturyLink: Infra, B2:B2:DC:8E:E2:58, Freq 2462 MHz, Rate 54 Mb/s, Strength 17 WPA WPA2 IPv4 Settings: Address: 192.168.0.11 Prefix: 24 (255.255.255.0) Gateway: 192.168.0.1 DNS: 192.168.0.1 (JUSTICE is my home's network.) ping -c 2 198.168.0.1 PING 198.168.0.1 (198.168.0.1) 56(84) bytes of data. --- 198.168.0.1 ping statistics --- 2 packets transmitted, 0 received, 100% packet loss, time 1007ms

    Read the article

  • Installing drivers for an ATI 6950

    - by aj.esler
    Is there any way to get ubuntu to recognise an ATI 6950? I have tried installing the proprietary ATI drivers, but these do not seem to work properly. It seems to screw up the gnome desktop, and starts booting into terminal. I'm somewhat of a linux newbie, so not really sure whats going wrong. I don't want to game on ubuntu, I just want it to recognise my dual monitor setup rather than mirroring the monitors, so any driver that does this is fine by me. It seems like the open source ATI radeon drivers will not support the 6950/6970 for some time, at least until kernel 2.6.38 is released. The card is also flashed with the 6970 firmware, not sure if this is important. I am running a 64 bit version of ubuntu, I installed ubuntu server 10.10, then installed gnome-desktop.

    Read the article

  • Installing drivers for an ATI 6950 in Ubuntu

    - by aj.esler
    Is there any way to get ubuntu to recognise an ATI 6950? I have tried installing the proprietary ATI drivers, but these do not seem to work properly. It seems to screw up the gnome desktop, and starts booting into terminal. I'm somewhat of a linux newbie, so not really sure whats going wrong. I don't want to game on ubuntu, I just want it to recognise my dual monitor setup rather than mirroring the monitors, so any driver that does this is fine by me. It seems like the open source ATI radeon drivers will not support the 6950/6970 for some time, at least until kernel 2.6.38 is released. The card is also flashed with the 6970 firmware, not sure if this is important. I am running a 64 bit version of ubuntu, I installed ubuntu server 10.10, then installed gnome-desktop.

    Read the article

  • historical weather data APIs

    - by AJ.
    I am building a web application where I need to display whole year's month wise weather conditions. So that users get an idea of what the weather conditions are like and plan their trips accordingly. I am using WunderGround's History feature but it does not give this data for smaller towns and destinations, even some very popular tourist destinations. Are there any alternatives which could provide me the same information.

    Read the article

  • Subsonic : Can’t decide which property to consider the Key? foreign key issue.

    - by AJ
    Hi I am trying to select count of rows from a table which has foreign keys of two tables. The C# code threw the error mentioned below. So, I added a primary key column to the table (schema as follows) and regenerated the code. But still the same error is coming. Error : Can't decide which property to consider the Key - you can create one called 'ID' or mark one with SubSonicPrimaryKey attribute sqLite Table schema CREATE TABLE "AlbumDocuments" ("Id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , "AlbumId" INTEGER NOT NULL CONSTRAINT fk_AlbumId REFERENCES Albums(Id) , "DocumentId" INTEGER NOT NULL CONSTRAINT fk_DocumentId REFERENCES Documents(Id)) C# code int selectAlbumDocumentsCount = new SubSonic.Query.Select() .From<DocSafeDB.DataLayer.AlbumDocumentsTable>() .Where(DocSafeDB.DataLayer.AlbumDocumentsTable.AlbumIdColumn).In(request.AlbumId) .Execute(); Not sure what I should be doing next as I can't do where against primary key because I don;t have that info. So my questions are: How do I select count of rows against foreign key column? Is primary key required in this scenario? I have several things but not sure why its not working. To me it looks like a very normal use case. Please advise. Thanks AJ

    Read the article

  • Typecasting EnityObject

    - by AJ
    Hello, I'm new to C# and am stuck on the following. I have a Silverlight web service that uses LINQ to query a ADO.NET entity object. e.g.: [OperationContract] public List<Customer> GetData() { using (TestEntities ctx = new TestEntities()) { var data = from rec in ctx.Customer select rec; return data.ToList(); } } This works fine, but what I want to do is to make this more abstract. The first step would be to return a List<EntityObject> but this gives a compiler error, e.g.: [OperationContract] public List<EntityObject> GetData() { using (TestEntities ctx = new TestEntities()) { var data = from rec in ctx.Customer select rec; return data.ToList(); } } The error is: Error 1 Cannot implicitly convert type 'System.Collections.Generic.List<SilverlightTest.Web.Customer>' to 'System.Collections.Generic.IEnumerable<System.Data.Objects.DataClasses.EntityObject>'. An explicit conversion exists (are you missing a cast?) What am i doing wrong? Thanks, AJ

    Read the article

  • Generic list typecasting problem

    - by AJ
    Hello, I'm new to C# and am stuck on the following. I have a Silverlight web service that uses LINQ to query a ADO.NET entity object. e.g.: [OperationContract] public List<Customer> GetData() { using (TestEntities ctx = new TestEntities()) { var data = from rec in ctx.Customer select rec; return data.ToList(); } } This works fine, but what I want to do is to make this more abstract. The first step would be to return a List<EntityObject> but this gives a compiler error, e.g.: [OperationContract] public List<EntityObject> GetData() { using (TestEntities ctx = new TestEntities()) { var data = from rec in ctx.Customer select rec; return data.ToList(); } } The error is: Error 1 Cannot implicitly convert type 'System.Collections.Generic.List<SilverlightTest.Web.Customer>' to 'System.Collections.Generic.IEnumerable<System.Data.Objects.DataClasses.EntityObject>'. An explicit conversion exists (are you missing a cast?) What am i doing wrong? Thanks, AJ

    Read the article

  • Dependent Dropdowns (Linked Selects) with single class (no other selectors)

    - by AJ
    I am trying to create multiple dependent dropdowns (selects) with a unique way. I want to restrict the use of selectors and want to achieve this by using a single class selectors on all SELECTs; by figuring out the SELECT that was changed by its index. Hence, the SELECT[i] that changed will change the SELECT[i+1] only (and not the previous ones like SELECT[i-1]). For html like this: <select class="someclass"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <select class="someclass"> </select> <select class="someclass"> </select> where the SELECTs other than the first one will get something via AJAX. I see that the following Javascript gives me correct value of the correct SELECT and the value of i also corresponds to the correct SELECT. $(function() { $(".someclass").each(function(i) { $(this).change(function(x) { alert($(this).val() + i); }); }); }); Please note that I really want the minimum selector approach. I just cannot wrap my head around on how to approach this. Should I use Arrays? Like store all the SELECTS in an Array first and then select those? I believe that since the above code already passes the index i, there should be a way without Arrays also. Thanks a bunch. AJ

    Read the article

  • Dependent Dropdowns with single class element

    - by AJ
    I am trying to create multiple dependent dropdowns (selects) with a unique way. I want to restrict the use of selectors and want to achieve this by using a single class selectors on all SELECTs; by figuring out the SELECT that was changed by its index. Hence, the SELECT[i] that changed will change the SELECT[i+1] only (and not the previous ones like SELECT[i-1]). For html like this: <select class="someclass"> <option value="volvo">Volvo</option> <option value="saab">Saab</option> <option value="mercedes">Mercedes</option> <option value="audi">Audi</option> </select> <select class="someclass"> </select> <select class="someclass"> </select> where the SELECTs other than the first one will get something via AJAX. I see that the following Javascript gives me correct value of the correct SELECT and the value of i also corresponds to the correct SELECT. $(function() { $(".someclass").each(function(i) { $(this).change(function(x) { alert($(this).val() + i); }); }); }); Please note that I really want the minimum selector approach. I just cannot wrap my head around on how to approach this. Should I use Arrays? Like store all the SELECTS in an Array first and then select those? I believe that since the above code already passes the index i, there should be a way without Arrays also. Thanks a bunch. AJ

    Read the article

  • How to create anroid to send to work in my place?

    - by aj-sin-dhal
    Hi I would like to create a life like android/robot to send to work in my place. Requirements 1) People should not be able to tell the difference between me and the android. My first attempt may not be perfect but I can tell people that its my twin that was dropped on its head while we were growing up. 2) Should have the same weight as me so it won't crush small children if it falls over. By small children I mean those above 7 years old. Those below 7 can easily be crushed by a normal human adult so it is not important to consider that special case. 3) Should run on linux. I have a tight budget and cannot afford to pay for any propreitary operating system. Will consider writing my own operating system if this is the best way to go. I am reading "The design of the unix operating system" by Maurice J. Bach currently. That should be useful. I also have an old copy of the dragon book. What other books should I read? I would like to finish this by monday if possible. I don't like working on mondays. I have made a start and have picked some clothes and shoes for my android worker. Any help will be appreciated. This is a serious question. AJ

    Read the article

  • NSSortDescriptor for NSFetchRequestController causes crash when value of sorted attribute is changed

    - by AJ
    I have an Core Data Entity with a number of attributes, which include amount(float), categoryTotal(float) and category(string) The initial ViewController uses a FethchedResultsController to retrieve the entities, and sorts them based on the category and then the categoryTotal. No problems so far. NSManagedObjectContext *moc = [self managedObjectContext]; NSEntityDescription *entityDescription = [NSEntityDescription entityForName:@"Transaction" inManagedObjectContext:moc]; NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease]; [request setEntity:entityDescription]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"(dateStamp >= %@) AND (dateStamp =< %@)", startDate, endDate]; [request setPredicate:predicate]; NSSortDescriptor *sortByCategory = [[NSSortDescriptor alloc] initWithKey:@"category" ascending:sortOrder]; NSSortDescriptor *sortByTotals = [[NSSortDescriptor alloc] initWithKey:@"categoryTotal" ascending:sortOrder]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortByTotals, sortByCategory, nil]; [request setSortDescriptors:sortDescriptors]; NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:request managedObjectContext:managedObjectContext sectionNameKeyPath:@"category" cacheName:nil]; aFetchedResultsController.delegate = self; self.fetchedResultsController = aFetchedResultsController; On selecting a row (tableView:didSelectRowAtIndexPath), another view controller is loaded that allows editing of the amount field for the selected entity. Before returning to the first view, categoryTotal is updated by the new ‘amount’. The problem comes when returning to the first view controller, the app bombs with *Serious application error. Exception was caught during Core Data change processing: Invalid update: invalid number of rows in section 0. The number of rows contained in an existing section after the update (1) must be equal to the number of rows contained in that section before the update (1), plus or minus the number of rows inserted or deleted from that section (0 inserted, 1 deleted). with userInfo (null) Program received signal: “EXC_BAD_ACCESS”.* This seems to be courtesy of NSSortDescriptor *sortByTotals = [[NSSortDescriptor alloc] initWithKey:@"categoryTotal" ascending:sortOrder]; If I remove this everything works as expected, but obviously without the sorting I want. I'm guessing this is to do with the sorting order changing due to categoryTotal changing (deletion / insertion) but can't find away fix this. I've verified that values are being modified correctly in the second view, so it appears down to the fetchedResultsController being confused. If the categoryAmount is changed to one that does not change the sort order, then no error is generated I'm not physically changing (ie deleting) the number of items the fetchedResultsController is returning ... the only other issue I can find that seem to generate this error Any ideas would be most welcome Thanks, AJ

    Read the article

  • SQL SERVER – Solution to Puzzle – Simulate LEAD() and LAG() without Using SQL Server 2012 Analytic Function

    - by pinaldave
    Earlier I wrote a series on SQL Server Analytic Functions of SQL Server 2012. During the series to keep the learning maximum and having fun, we had few puzzles. One of the puzzle was simulating LEAD() and LAG() without using SQL Server 2012 Analytic Function. Please read the puzzle here first before reading the solution : Write T-SQL Self Join Without Using LEAD and LAG. When I was originally wrote the puzzle I had done small blunder and the question was a bit confusing which I corrected later on but wrote a follow up blog post on over here where I describe the give-away. Quick Recap: Generate following results without using SQL Server 2012 analytic functions. I had received so many valid answers. Some answers were similar to other and some were very innovative. Some answers were very adaptive and some did not work when I changed where condition. After selecting all the valid answer, I put them in table and ran RANDOM function on the same and selected winners. Here are the valid answers. No Joins and No Analytic Functions Excellent Solution by Geri Reshef – Winner of SQL Server Interview Questions and Answers (India | USA) WITH T1 AS (SELECT Row_Number() OVER(ORDER BY SalesOrderDetailID) N, s.SalesOrderID, s.SalesOrderDetailID, s.OrderQty FROM Sales.SalesOrderDetail s WHERE SalesOrderID IN (43670, 43669, 43667, 43663)) SELECT SalesOrderID,SalesOrderDetailID,OrderQty, CASE WHEN N%2=1 THEN MAX(CASE WHEN N%2=0 THEN SalesOrderDetailID END) OVER (Partition BY (N+1)/2) ELSE MAX(CASE WHEN N%2=1 THEN SalesOrderDetailID END) OVER (Partition BY N/2) END LeadVal, CASE WHEN N%2=1 THEN MAX(CASE WHEN N%2=0 THEN SalesOrderDetailID END) OVER (Partition BY N/2) ELSE MAX(CASE WHEN N%2=1 THEN SalesOrderDetailID END) OVER (Partition BY (N+1)/2) END LagVal FROM T1 ORDER BY SalesOrderID, SalesOrderDetailID, OrderQty; GO No Analytic Function and Early Bird Excellent Solution by DHall – Winner of Pluralsight 30 days Subscription -- a query to emulate LEAD() and LAG() ;WITH s AS ( SELECT 1 AS ldOffset, -- equiv to 2nd param of LEAD 1 AS lgOffset, -- equiv to 2nd param of LAG NULL AS ldDefVal, -- equiv to 3rd param of LEAD NULL AS lgDefVal, -- equiv to 3rd param of LAG ROW_NUMBER() OVER (ORDER BY SalesOrderDetailID) AS row, SalesOrderID, SalesOrderDetailID, OrderQty FROM Sales.SalesOrderDetail WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ) SELECT s.SalesOrderID, s.SalesOrderDetailID, s.OrderQty, ISNULL( sLd.SalesOrderDetailID, s.ldDefVal) AS LeadValue, ISNULL( sLg.SalesOrderDetailID, s.lgDefVal) AS LagValue FROM s LEFT OUTER JOIN s AS sLd ON s.row = sLd.row - s.ldOffset LEFT OUTER JOIN s AS sLg ON s.row = sLg.row + s.lgOffset ORDER BY s.SalesOrderID, s.SalesOrderDetailID, s.OrderQty No Analytic Function and Partition By Excellent Solution by DHall – Winner of Pluralsight 30 days Subscription /* a query to emulate LEAD() and LAG() */ ;WITH s AS ( SELECT 1 AS LeadOffset, /* equiv to 2nd param of LEAD */ 1 AS LagOffset, /* equiv to 2nd param of LAG */ NULL AS LeadDefVal, /* equiv to 3rd param of LEAD */ NULL AS LagDefVal, /* equiv to 3rd param of LAG */ /* Try changing the values of the 4 integer values above to see their effect on the results */ /* The values given above of 0, 0, null and null behave the same as the default 2nd and 3rd parameters to LEAD() and LAG() */ ROW_NUMBER() OVER (ORDER BY SalesOrderDetailID) AS row, SalesOrderID, SalesOrderDetailID, OrderQty FROM Sales.SalesOrderDetail WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ) SELECT s.SalesOrderID, s.SalesOrderDetailID, s.OrderQty, ISNULL( sLead.SalesOrderDetailID, s.LeadDefVal) AS LeadValue, ISNULL( sLag.SalesOrderDetailID, s.LagDefVal) AS LagValue FROM s LEFT OUTER JOIN s AS sLead ON s.row = sLead.row - s.LeadOffset /* Try commenting out this next line when LeadOffset != 0 */ AND s.SalesOrderID = sLead.SalesOrderID /* The additional join criteria on SalesOrderID above is equivalent to PARTITION BY SalesOrderID in the OVER clause of the LEAD() function */ LEFT OUTER JOIN s AS sLag ON s.row = sLag.row + s.LagOffset /* Try commenting out this next line when LagOffset != 0 */ AND s.SalesOrderID = sLag.SalesOrderID /* The additional join criteria on SalesOrderID above is equivalent to PARTITION BY SalesOrderID in the OVER clause of the LAG() function */ ORDER BY s.SalesOrderID, s.SalesOrderDetailID, s.OrderQty No Analytic Function and CTE Usage Excellent Solution by Pravin Patel - Winner of SQL Server Interview Questions and Answers (India | USA) --CTE based solution ; WITH cteMain AS ( SELECT SalesOrderID, SalesOrderDetailID, OrderQty, ROW_NUMBER() OVER (ORDER BY SalesOrderDetailID) AS sn FROM Sales.SalesOrderDetail WHERE SalesOrderID IN (43670, 43669, 43667, 43663) ) SELECT m.SalesOrderID, m.SalesOrderDetailID, m.OrderQty, sLead.SalesOrderDetailID AS leadvalue, sLeg.SalesOrderDetailID AS leagvalue FROM cteMain AS m LEFT OUTER JOIN cteMain AS sLead ON sLead.sn = m.sn+1 LEFT OUTER JOIN cteMain AS sLeg ON sLeg.sn = m.sn-1 ORDER BY m.SalesOrderID, m.SalesOrderDetailID, m.OrderQty No Analytic Function and Co-Related Subquery Usage Excellent Solution by Pravin Patel – Winner of SQL Server Interview Questions and Answers (India | USA) -- Co-Related subquery SELECT m.SalesOrderID, m.SalesOrderDetailID, m.OrderQty, ( SELECT MIN(SalesOrderDetailID) FROM Sales.SalesOrderDetail AS l WHERE l.SalesOrderID IN (43670, 43669, 43667, 43663) AND l.SalesOrderID >= m.SalesOrderID AND l.SalesOrderDetailID > m.SalesOrderDetailID ) AS lead, ( SELECT MAX(SalesOrderDetailID) FROM Sales.SalesOrderDetail AS l WHERE l.SalesOrderID IN (43670, 43669, 43667, 43663) AND l.SalesOrderID <= m.SalesOrderID AND l.SalesOrderDetailID < m.SalesOrderDetailID ) AS leag FROM Sales.SalesOrderDetail AS m WHERE m.SalesOrderID IN (43670, 43669, 43667, 43663) ORDER BY m.SalesOrderID, m.SalesOrderDetailID, m.OrderQty This was one of the most interesting Puzzle on this blog. Giveaway Winners will get following giveaways. Geri Reshef and Pravin Patel SQL Server Interview Questions and Answers (India | USA) DHall Pluralsight 30 days Subscription Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, PostADay, Readers Contribution, Readers Question, SQL, SQL Authority, SQL Function, SQL Puzzle, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • How to calculate checksum?

    - by Patel Rikin
    I m developing instrument driver and i want to know how to calculate checksum of frame. Explanation: Expressed by characters [0-9] and [A-F]. Characters beginning from the character after [STX] and until [ETB] or [ETX] (including [ETB] or [ETX]) are added in binary. The 2-digit numbers, which represent the least significant 8 bits in hexadecimal code, are converted to ASCII characters [0-9] and [A-F]. The most significant digit is stored in CHK1 and the least significant digit in CHK2. This is sample frame : <STX>2Q|1|2^1||||20011001153000<CR><ETX><CHK1><CHK2><CR><LF> and i want to know what is value of chk1 and chk2 and i am new in this so i m totally blank about how to calculate checksum i am not getting above 3rd and 4th point. can any one provide sample code for c#. Please help me.

    Read the article

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