Search Results

Search found 30014 results on 1201 pages for 'go yourself'.

Page 75/1201 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Full text index requires dropping and recreating - why?

    - by Amjid Qureshi
    Hi all, So I've got a web app running on .net 3.5 connected to a SQL 2005 box. We do scheduled releases every 2 weeks. About 14 tables out of 250 are full text indexed. After not every release, but a few too many, the indexes crap out. They seem to have data in there, but when we try to search them from the front end or SQL enterprise we get timeouts/hangs. We have a script that disables the indexes, drops them, deletes the catalog and then re creates the indexes. This fixes the problem 99 times out of 100. and the one other time, we run the script again and it all works We have tried just rebuilding the fulltext index but that doesn't fix the issue. My question is why do we have to do this ? what can we do to sort the index out? Here is a bit of the script, IF EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[Address]')) ALTER FULLTEXT INDEX ON [dbo].[Address] DISABLE GO IF EXISTS (SELECT * FROM sys.fulltext_indexes fti WHERE fti.object_id = OBJECT_ID(N'[dbo].[Address]')) DROP FULLTEXT INDEX ON [dbo].[Address] GO IF EXISTS (SELECT * FROM sysfulltextcatalogs ftc WHERE ftc.name = N'DbName.FullTextCatalog') DROP FULLTEXT CATALOG [DbName.FullTextCatalog] GO -- may need this line if we get an error BACKUP LOG SMS2 WITH TRUNCATE_ONLY CREATE FULLTEXT CATALOG [DbName.FullTextCatalog] ON FILEGROUP [FullTextCatalogs] IN PATH N'F:\Data' AS DEFAULT AUTHORIZATION [dbo] CREATE FULLTEXT INDEX ON [Address](CommonPlace LANGUAGE 'ENGLISH') KEY INDEX PK_Address ON [DbName.FullTextCatalog] WITH CHANGE_TRACKING AUTO go

    Read the article

  • Bringing ideas to life

    - by danixd
    I understand that this forum is filled with computer science genius's but there must come a point where your expertise in coding can not keep up with your creativity. I am a front end programmer and designer of sorts. I have so many ideas, with no ways of implementing them. I know of platforms that can help, I am really into the arduino project for physical ideas and I know Flash is an amazing platform for software, but when it comes to complex ideas, even such as a 3D game, things can be too much to handle individually. When you have an idea, what is your typical methodology of bring them to life? Write down the idea, save if for later (never gets made right...) Try building it yourself, on the platforms you work with and are good at Consult people on what platform it is best suited to and collaborate with an expert in that field to do the dirty work Consult people on what platform it is best suited to and try to learn it and make it yourself (at least the alpha stages) Are there any communities that support this idea of bringing things to life? Can you pitch ideas to x company as a business model and hope they take you on / sponsor you? Do you have to spend lots of $$$ to get things made?

    Read the article

  • Can iPad/iPhone Touch Points be Wrong Due to Calibration?

    - by Kristopher Johnson
    I have an iPad application that uses the whole screen (that is, UIStatusBarHidden is set true in the Info.plist file). The main window's frame is set to (0, 0, 768, 1024), as is the main view in that frame. The main view has multitouch enabled. The view has code to handle touches: - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event { for (UITouch *touch in touches) { CGPoint location = [touch locationInView:nil]; NSLog(@"touchesMoved at location %@", NSStringFromCGPoint(location)); } } When I run the app in the simulator, it works pretty much as expected. As I move the mouse from one edge of the screen to the other, reported X values go from 0 to 767. Reported Y values go from 20 to 1023, but it is a known issue that the simulator doesn't report touches in the top 20 pixels of the screen, even when there is no status bar. Here's what's weird: When I run the app on an actual iPad, the X values go from 0 to 767 as expected, but reported Y values go from -6 to 1017. The fact that it seems to work properly on the simulator leads me to suspect that real devices' touchscreens are not perfectly calibrated, and mine is simply reporting values six pixels too low. Can anyone verify that this is the case? Otherwise, is there anything else that could account for the Y values being six pixels off from what I expect? (In a few days, I should have a second iPad, so I can test this with another device and compare the results.)

    Read the article

  • How to perform a binary search on IList<T>?

    - by Daniel Brückner
    Simple question - given an IList<T> how do you perform a binary search without writing the method yourself and without copying the data to a type with build-in binary search support. My current status is the following. List<T>.BinarySearch() is not a member of IList<T> There is no equivalent of the ArrayList.Adapter() method for List<T> IList<T> does not inherit from IList, hence using ArrayList.Adapter() is not possible I tend to believe that is not possible with build-in methods, but I cannot believe that such a basic method is missing from the BCL/FCL. If it is not possible, who can give the shortest, fastest, smartest, or most beatiful binary search implementation for IList<T>? UPDATE We all know that a list must be sorted before using binary search, hence you can assume that it is. But I assume (but did not verify) it is the same problem with sort - how do you sort IList<T>? CONCLUSION There seems to be no build-in binary search for IList<T>. One can use First() and OrderBy() LINQ methods to search and sort, but it will likly have a performance hit. Implementing it yourself (as an extension method) seems the best you can do.

    Read the article

  • Python/YACC: Resolving a shift/reduce conflict

    - by Rosarch
    I'm using PLY. Here is one of my states from parser.out: state 3 (5) course_data -> course . (6) course_data -> course . course_list_tail (3) or_phrase -> course . OR_CONJ COURSE_NUMBER (7) course_list_tail -> . , COURSE_NUMBER (8) course_list_tail -> . , COURSE_NUMBER course_list_tail ! shift/reduce conflict for OR_CONJ resolved as shift $end reduce using rule 5 (course_data -> course .) OR_CONJ shift and go to state 7 , shift and go to state 8 ! OR_CONJ [ reduce using rule 5 (course_data -> course .) ] course_list_tail shift and go to state 9 I want to resolve this as: if OR_CONJ is followed by COURSE_NUMBER: shift and go to state 7 else: reduce using rule 5 (course_data -> course .) How can I fix my parser file to reflect this? Do I need to handle a syntax error by backtracking and trying a different rule?

    Read the article

  • Do you feel threatened by younger developers?

    - by bobsmith123
    When an opportunity for a new project in my company presented itself, I volunteered with a little bit of skepticism but a lot of excitement. I have been working with this company for 5 years on a different project in which I was a team lead for several releases. I have a consistent track record of delivering good quality projects. The new project has a team that is built from ground up and the management decided to hire new developers. The technologies used are the latest ones that are different from the previous project I had worked on (although they both are in .NET). The newer and the younger developers in the team have more experience with the latest technologies from their previous gigs. The younger developers have a lot more energy, can work 14 hours a day (they remind me of my early 20s) and live on ramen noodles. Since they are new, I feel they are obligated to show what they are made of and to prove their mettle. I feel like I am sidelined in this project and the management obviously like the younger developers as they bring more to the table. I know ageism is rampant in our field and the more I think about this, the more it makes me feel that there are very few transferable skills from one project to the other and one day you could be a team lead managing a number of developers, the next day some one you hired becomes your boss. Do you see yourself in situations like this very often? What plans do you have to make yourself valuable in a long term perspective?

    Read the article

  • how to make sure the non disclosure agreement is read

    - by Xin Qian Ch'ang
    Every time a user registers to our site we need to show a non-disclosure agreement. In order to continue the user has to accept it. My issue is that I have the NDA in all one page and the user does not really read it and accept (like we all do). What I want is to make sure the user reads the NDA and accepts it one he "read" it? What I have now is a simple jqeury validation if the user checks a box and click on accept. then it goes to the next page. Here's what i have <script> $(document).ready(function() { $('#go').click(function() { // check if checkbox is check and go to next page }); }); </script> <div> full nda <hr> <input type=checkbox> <input type=button value=go id=go> </div> Thanks

    Read the article

  • SQL Pivot table error-using variable gives syntax error

    - by Antoni
    Hi my coworker came to me with this error and now I am hooked and trying to figure it out, hope some of the experts can help us! Thanks so much! When I execute Step6 we get this error: Msg 102, Level 15, State 1, Line 4 Incorrect syntax near '@cols'. --Sample of pivot query --Creating Test Table Step1 CREATE TABLE Product(Cust VARCHAR(25), Product VARCHAR(20), QTY INT) GO -- Inserting Data into Table Step2 INSERT INTO Product(Cust, Product, QTY) VALUES('KATE','VEG',2) INSERT INTO Product(Cust, Product, QTY) VALUES('KATE','SODA',6) INSERT INTO Product(Cust, Product, QTY) VALUES('KATE','MILK',1) INSERT INTO Product(Cust, Product, QTY) VALUES('KATE','BEER',12) INSERT INTO Product(Cust, Product, QTY) VALUES('FRED','MILK',3) INSERT INTO Product(Cust, Product, QTY) VALUES('FRED','BEER',24) INSERT INTO Product(Cust, Product, QTY) VALUES('KATE','VEG',3) GO -- Selecting and checking entires in table Step3 SELECT * FROM Product GO -- Pivot Table ordered by PRODUCT Step4 select * FROM ( SELECT * FROM Product) up PIVOT (SUM(QTY) FOR CUST IN ([FRED], [KATE])) AS pvt ORDER BY PRODUCT GO --dynamic pivot???? Step5 DECLARE @cols NVARCHAR(2000) select @cols = STUFF(( SELECT DISTINCT TOP 100 PERCENT '],[' + b.Cust FROM (select top 100 Cust from tblProduct)b ORDER BY '],[' + b.Cust FOR XML PATH('') ), 1, 2, '') + ']' --Show Step6 SELECT * FROM (SELECT * FROM tblProduct) p PIVOT (SUM(QTY) FOR CUST IN (@cols)) as pvt Order by Product

    Read the article

  • PDCurses TUI with C++ Win32 console application

    - by Bach
    I have downloaded pdcurses source and was able to successfully include curses.h in my project, linked the pre-compiled library and all good. After few hours of trying out the library, I saw the tuidemo.c in the demos folder, compiled it into an executable and brilliant! exactly what I needed for my project. Now the problem is that it's a C code, and I am working on a C++ project in VS c++ 2008. The files I need are tui.c and tui.h How can I include that C file in my C++ code? I saw few suggestions here but the compiler was not too happy with 100's of warnings and errors. How can I go on including/using that TUI pdcurses includes!? Thanks EDIT: I added extern "C" statement, so my test looks like this now, but I'm getting some other type of error #include <stdio.h> #include <stdlib.h> using namespace std; extern "C" { #include <tui.h> } void sub0(void) { //do nothing } void sub1(void) { //do nothing } int main (int argc, char * const argv[]) { menu MainMenu[] = { { "Asub", sub0, "Go inside first submenu" }, { "Bsub", sub1, "Go inside second submenu" }, { "", (FUNC)0, "" } /* always add this as the last item! */ }; startmenu(MainMenu, "TUI - 'textual user interface' demonstration program"); return 0; } Although it is compiling successfully, it is throwing an Error at runtime: 0xC0000005: Access violation reading location 0x021c52f9 at line startmenu(MainMenu, "TUI - 'textual user interface' demonstration program"); Not sure where to go from here. thanks again.

    Read the article

  • Return if remote stored procedure fails

    - by njk
    I am in the process of creating a stored procedure. This stored procedure runs local as well as external stored procedures. For simplicity, I'll call the local server [LOCAL] and the remote server [REMOTE]. USE [LOCAL] GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[monthlyRollUp] AS SET NOCOUNT, XACT_ABORT ON BEGIN TRY EXEC [REOMTE].[DB].[table].[sp] --This transaction should only begin if the remote procedure does not fail BEGIN TRAN EXEC [LOCAL].[DB].[table].[sp1] COMMIT BEGIN TRAN EXEC [LOCAL].[DB].[table].[sp2] COMMIT BEGIN TRAN EXEC [LOCAL].[DB].[table].[sp3] COMMIT BEGIN TRAN EXEC [LOCAL].[DB].[table].[sp4] COMMIT END TRY BEGIN CATCH -- Insert error into log table INSERT INTO [dbo].[log_table] (stamp, errorNumber, errorSeverity, errorState, errorProcedure, errorLine, errorMessage) SELECT GETDATE(), ERROR_NUMBER(), ERROR_SEVERITY(), ERROR_STATE(), ERROR_PROCEDURE(), ERROR_LINE(), ERROR_MESSAGE() END CATCH GO When using a transaction on the remote procedure, it throws this error: OLE DB provider ... returned message "The partner transaction manager has disabled its support for remote/network transactions.". I get that I'm unable to run a transaction locally for a remote procedure. How can I ensure that the this procedure will exit and rollback if any part of the procedure fails?

    Read the article

  • How to overcome the programmer's block ?

    - by Nicolas Dorier
    How do you do when, during the development of your application, you can't decide yourself what to do next. You have no problem technically speaking, you have no problem to write clean code BUT you have a problem to decide yourself on what to code now. And you spend time thinking and thinking again on your design, in the car, in the shower, and you cannot write a single line of code... I think we call this "analysis paralysis". I hate being in this state ! How can you avoid this ? How do you do to not fall in this state ? I think this occurs when we are writting a big chunk of code with no visible improvement, but I'm not sure... UPDATE Like some of you said, this problem is also what we call the "programmer's block" (analogy with the writer's block). Doing some TDD doesn't help because I'm stuck, I can't decide myself what class to code, what methods to put inside (even a name of method). Though I admit that it helps to break a big chunk of code into smaller ones. Like Talesh said my head becomes full of "what-if".

    Read the article

  • Partioning with Hibernate

    - by Alex
    Hello, We have a requirement to delete data in the range of 200K from database everyday. Our application is Java/JEE based using Oracle DB and Hibernate ORM tool. We explored various options like Hibernate batch processing Stored procedure Database partitioning Our DBA suggests database partitioning is the best way to go, so we can easily recreate and drop the partitioned table everyday. Now the issue is we have 2 kinds of data, one which we want to delete everyday and the other which we want to keep it. Suppose this data is stored in table "Trade". Now with partitioning, we have 2 tables "Trade". We have already existing Hibernate based DAO layer to fetch/store trades from/to DB. When we decide to partition the database, how can we control the trades to go in which of the two tables through hibernate. Basically I want , the trades need to be deleted by end of the day, to go in partitioned table and the trades I want to keep, in main table. Please suggest how can this be possible with Hibernate. We may add an additional column to identify the trades to be deleted but how can we ensure these trades should go to partitioned trade table using hibernate. I would appreciate if someone can suggest any better approach in case we are on wrong path.

    Read the article

  • How can I stop a movie (from current frame) playing when I click on next frame - FLASH CS4?

    - by ladygeekgeek
    I have four movie clips (.f4v) in 4 frames in a movie with watch buttons.. This movie has them been imported into a main movie container that has next and previous buttons. However if i play a movie then hit next frame, the movie continues to play in the background. How can I shop this? The code below shows one of the actionscripts for a movie clip and then the main actionscript in the main movie. I am a flash newbie, so all help appreciated. Many thanks. stop(); watch1_btn.addEventListener(MouseEvent.CLICK, playMovie1); function playMovie1(event:MouseEvent):void { movie1_mc.play(); } // Button Listeners next_btn.addEventListener(MouseEvent.CLICK, nextSection); prev_btn.addEventListener(MouseEvent.CLICK, prevSection); function nextSection(event:MouseEvent):void { var thisLabel:String = pages_mc.currentLabel; // gets current frame label as string var thisLabelNum:String = thisLabel.replace("sct", ""); // cuts the leading letters off of the number var curNumber:Number = Number(thisLabelNum); // converts that string number to a real number if (curNumber < 5) { var nextNum:Number = curNumber + 1; // adds 1 to the number so we can go to next frame label pages_mc.gotoAndStop("sct" + nextNum); // This allows us to go to the next frame label } } /////////////////////////////////////////////////////////////////////////// function prevSection(event:MouseEvent):void { var thisLabel:String = pages_mc.currentLabel; // gets current frame label as string var thisLabelNum:String = thisLabel.replace("sct", ""); // cuts the leading letters off of the number var curNumber:Number = Number(thisLabelNum); // converts that string number to a real number var prevNum:Number = curNumber - 1; // subtracts 1 from the number so we can go to next frame label pages_mc.gotoAndStop("sct" + prevNum); // This allows us to go to the previous frame label }

    Read the article

  • SQL Server stored procedure return code oddity

    - by gbn
    Hello The client that calls this code is restricted and can only deal with return codes from stored procs. So, we modified our usual contract to RETURN -1 on error and default to RETURN 0 if no error If the code hits the inner catch block, then the RETURN code default to -4. Where does this come from, does anyone know...? IF OBJECT_ID('dbo.foo') IS NOT NULL DROP TABLE dbo.foo GO CREATE TABLE dbo.foo ( KeyCol char(12) NOT NULL, ValueCol xml NOT NULL, Comment varchar(1000) NULL, CONSTRAINT PK_foo PRIMARY KEY CLUSTERED (KeyCol) ) GO IF OBJECT_ID('dbo.bar') IS NOT NULL DROP PROCEDURE dbo.bar GO CREATE PROCEDURE dbo.bar @Key char(12), @Value xml, @Comment varchar(1000) AS SET NOCOUNT ON DECLARE @StartTranCount tinyint; BEGIN TRY SELECT @StartTranCount = @@TRANCOUNT; IF @StartTranCount = 0 BEGIN TRAN; BEGIN TRY --SELECT @StartTranCount = 'fish' INSERT dbo.foo (KeyCol, ValueCol, Comment) VALUES (@Key, @Value, @Comment); END TRY BEGIN CATCH IF ERROR_NUMBER() = 2627 --PK violation UPDATE dbo.foo SET ValueCol = @Value, Comment = @Comment WHERE KeyCol = @Key; ELSE RAISERROR ('Tits up', 16, 1); END CATCH IF @StartTranCount = 0 COMMIT TRAN; END TRY BEGIN CATCH IF @StartTranCount = 0 AND XACT_STATE() <> 0 ROLLBACK TRAN; RETURN -1 END CATCH --Without this, we'll send -4 if we hit the UPDATE CATCH block above --RETURN 0 GO --Run with RETURN 0 and fish line commented out DECLARE @rtn int EXEC @rtn = dbo.bar 'abcdefghijkl', '<foobar />', 'testing' SELECT @rtn; SELECT * FROM dbo.foo DECLARE @rtn int EXEC @rtn = dbo.bar 'abcdefghijkl', '<foobar2 />', 'testing2' --updated OK but we get @rtn = -4 SELECT @rtn; SELECT * FROM dbo.foo --uncomment fish line DECLARE @rtn int EXEC @rtn = dbo.bar 'abcdefghijkl', '<foobar />', 'testing' --Hit outer CATCH, @rtn = -1 as expected SELECT @rtn; SELECT * FROM dbo.foo

    Read the article

  • Shrinking the transaction log of a mirrored SQL Server 2005 database

    - by Peter Di Cecco
    I've been looking all over the internet and I can't find an acceptable solution to my problem, I'm wondering if there even is a solution without a compromise... I'm not a DBA, but I'm a one man team working on a huge web site with no extra funding for extra bodies, so I'm doing the best I can. Our backup plan sucks, and I'm having a really hard time improving it. Currently, there are two servers running SQL Server 2005. I have a mirrored database (no witness) that seems to be working well. I do a full backup at noon and at midnight. These get backed up to tape by our service provider nightly, and I burn the backup files to dvd weekly to keep old records on hand. Eventually I'd like to switch to log shipping, since mirroring seems kinda pointless without a witness server. The issue is that the transaction log is growing non-stop. From the research I've done, it seems that I can't truncate a log file of a mirrored database. So how do I stop the file from growing!? Based on this web page, I tried this: USE dbname GO CHECKPOINT GO BACKUP LOG dbname TO DISK='NULL' WITH NOFORMAT, INIT, NAME = N'dbnameLog Backup', SKIP, NOREWIND, NOUNLOAD GO DBCC SHRINKFILE('dbname_Log', 2048) GO But that didn't work. Everything else I've found says I need to disable the mirror before running the backup log command in order for it to work. My Question (TL;DR) How can I shrink my transaction log file without disabling the mirror?

    Read the article

  • Clever Next and Previous Buttons in jQuery

    - by matt
    I have created a webpage which when you press 'down' automatically scrolls down to the next ID (a section which isn't visible due to overflow: hidden) When you press 'up' it scrolls back up. At the moment each arrow simply tells the webpage to go to a specific div e.g. the 'down arrow' says <a class="tab" href="#page2">Down</a> This is ok for just two pages however as I will be having more pages what I would like is to be able to specify the amount of pages and for the arrows to automatically change which link it needs to go to next. For example, on page 1 the 'up arrow' is not visible and when you press the 'down arrow' it scrolls to #page2 whereupon the 'up arrow' is then visible. If you now press the down arrow again it will take you to #page3 whereupon it then becomes hidden as page 3 is the last page. I'm guessing I need to create a 'var' which specifies the amount of pages and that to make the arrows invisible it will change the css property 'display' to none yet I don't know how to do this nor to make the links work out which number to go to next! edit: Just botched together some code which hides the arrows based on the page number however still need to work out how to update the variables and change the links the arrows go to. (please exclude the coding, it's my first time trying to write script as opposed to just editing plugins!) var PageNumber = 1; var PageAmount = 2; function getPageNumber() { } function hideUpArrow() { if(PageNumber==1) { $("#up_arrow").css({ "display": "none" }); } } function hideDownArrow() { if(PageNumber==PageAmount) { $("#down_arrow").css({ "display": "none" }); } } $(document).ready(function(){ hideUpArrow(); });

    Read the article

  • SQL Aggregate all Purchases for a certain product with same rebatecode

    - by debuggerlikeanother
    Hi SO, i would like to aggregate all purchases for a certain product that used the same rebatecode (using SQL Server 2005) Assume we have the following table: ID ProductID Product RebateCode Amount 1 123 7HM ABC 1 2 123 7HM XYZ 2 3 124 7HM ABC 10 4 124 7HM XYZ 20 5 125 2EB LOI 4 6 126 2EB LOI 40 CREATE TABLE #ProductSales(ID SMALLINT, ProductID int, Product varchar(6), RebateCode varchar(4), Amount int) GO INSERT INTO #ProductSales select 1, 123, '7HM', 'A', 1 union all select 2, 123, '7HM', 'B', 2 union all select 3, 124, '7HM', 'A', 10 union all select 4, 124, '7HM', 'B', 20 union all select 5, 125, '7HM', 'A', 100 union all select 6, 125, '7HM', 'B', 200 union all select 7, 125, '7HM', 'C', 3 union all select 8, 126, '2EA', 'E', 4 union all select 8, 127, '2EA', 'E', 40 union all select 9, 128, '2EB', 'F', 5 union all select 9, 129, '2EB', 'F', 50 union all select 10, 130, '2EB', 'F', 500 GO SELECT * FROM #ProductSales GO /* And i would like to have the following result Product nrOfProducts CombinationRebateCode SumAmount ABC LOI XYZ 7HM 2 ABC, XYZ 33 11 0 22 2EB 2 LOI 44 0 44 0 .. */ CREATE TABLE #ProductRebateCode(Product varchar(6), nrOfProducts int, sumAmountRebateCombo int, rebateCodeCombination varchar(80), A int, B int, C int, E int, F int) Go INSERT INTO #ProductRebateCode select '7HM', 2, 33, 'A, B', 2, 2, 0, 0, 0 union all select '7HM', 1, 303, 'A, B, C', 1, 1, 1, 0, 0 union all select '2EA', 2, 44, 'E', 0, 0, 0, 2, 0 union all select '2EB', 3, 555, 'E', 0, 0, 0, 0, 2 Select * from #ProductRebateCode -- Drop Table #ProductSales IF EXISTS ( SELECT * FROM tempdb.dbo.sysobjects WHERE name LIKE '#ProductSales%') DROP TABLE #ProductSales -- Drop Table #ProductRebateCode IF EXISTS ( SELECT * FROM tempdb.dbo.sysobjects WHERE name LIKE '#ProductRebateCode%') DROP TABLE #ProductRebateCode I would like to have the result like in the example (see second select (#ProductRebateCode). I tried to achieve it with the crosstab from this post: http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=6216&whichpage=6. exec CrossTab2b @SQL = 'SELECT [ProductID], Product, RebateCode, Amount FROM #ProductSales' ,@PivotCol = 'RebateCode' ,@Summaries = 'Sum(Amount ELSE 0)[_Sum], Count([ProductID])[_nrOfProducts]' /* SUM(Amount ELSE 0)[Amount], COUNT(Amount)[Qty] */ ,@GroupBy = 'RebateCode, Product' ,@OtherFields = 'Product' I believe that this could work, but i am unable to solve it. Do you believe that it is possible to achieve what i am trying without MDX or the other fancy ?DX-Stuff? Best regards And Thanks a lot debugger the other

    Read the article

  • URL routing in an MVC framework - PHP

    - by Walderman
    I'm developing an MVC framework in PHP from scratch; mostly for the learning experience but this could easily end up in a live project. I went through this tutorial as a base and I've expanded from there. Requests are made like this: examplesite.com/controller/action/param1/param2/ and so on... And this is my .htaccess file: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA] So all requests go to index.php and they are routed to the correct controller and action from there. If no controller or action is given, then the default 'index' is assumed for both. I have an index controller with an index action, which is supposed to be the home page of my site. I can access it by going to examplesite.com (since the index part is assumed). It has some images, a link to a stylesheet, and some scripts. They are linked with paths relative to index.php. I thought this would be fine since all request go to index.php and all content is simply included in this page using php. This works if I go to examplesite.com. I will see all of the images and styles, and scripts will run. However, if I go to examplesite.com/index, I am routed to the correct part of the site, but all of the links don't work. Does the browser think I am in a different folder? I would like to be able to use relative paths for all of the content in my site, because otherwise I need to use absolute paths everywhere to make sure things will show up. Is this possible?

    Read the article

  • When is Googling it wrong?

    - by Drahcir
    I've been going through Stack Overflow for quite a bit now and noticed certain people (usually experienced programmers) frown upon Googling (researching) certain problems. Since I myself tend to use Google quite a bit to solve certain programming related issues I found certain comments rather demoralising. Now some of you may have come here trigger happy to delete this post but I needed some clarification. I usually Google things that usually syntax related that I would have never figured out on my own. For example I once wondered how to access the properties of a class that I didn't have a direct relationship to. So after a bit of research I discovered reflection and got what I wanted. Now in another scenario is learning a new language, in my case Silverlight were it differs in certain aspects of .NET compared to say ASP.NET. A few weeks ago I had no idea how to load another Silverlight page (usercontrol) and had to Google my way to the solution which I found wasn't as simple as I had imagined. In scenario three is were I myself frown up, that is just stealing a huge chunk of code to avoid doing the work yourself, for example paging a HTML table using JavaScript, where one just copies and pastes the JavasSript code without as much as trying to understand how it works. I do admit I have done this once or twice before for trivial tasks that had very little time limit and weren't all that important but most of the time still have to throw away what I found because it took too much time to adapt it and get what I wanted out of it. In the last scenario, I sometimes have a piece of code that I would be really unhappy about, as in I find it sloppy or too overcomplicated and try to look on the Internet to see other ways to tackle the same problem, let's say filtering through a table. With the knowledge I acquire I learned new coding practices that help me work more efficiently like "Do not repeat yourself" and such. Now in your opinion when do you find it wrong to use Google (or any other researching tool) to find a solution to your problem?

    Read the article

  • typeahead.js remote with subset matching

    - by rebelde
    Instead of returning to the server after each additional letter is typed, I want it to only go to the server once, get all matching words, and filter the downloaded data after that. We are having trouble making this work. We are successfully using "remote" to wait until two letters are typed, but we can't get it to stop going to the server as additional letters are typed. Steps: 1. After two letters are typed, retrieve all matching words that start with those two letters. 2. When a third and additional letters are typed, don't go to the server again, just filter from the previous list that was sent. An example: "mo" is typed in. All 100 words that start with "mo" are returned. (Only 10 are shown.) "mor" - now with a third letter, we don't go back to the server. We just find the 20 words that match from within the previous set of words. Can anybody make this work? In real life (using YUI2), we do this and then go back to the server if somebody types in a space after the word. At that point, we know to retrieve additional words. Thanks!

    Read the article

  • PHP what is faster to use

    - by user1631500
    What is faster / better to use? To put html into variables and print them later, or to just html print / echo print the content based on condition? EXAMPLE 1:(html into variables) if(!isset($_SESSION['daddy'])) { $var = "<span class='something'>Go here:<a href='#'>Click</a></span> <span class='something'>Go here:<a href='#'>Click</a></span>" } else { $one=$_SESSION["one"]; $two=$_SESSION["two"]; $three=$_SESSION["three"]; $var = You are cool enough to view the content; } echo $var; EXAMPLE 2:(print based on condition) if(!isset($_SESSION['daddy'])) { $var = 1; } else { $one=$_SESSION["one"]; $two=$_SESSION["two"]; $three=$_SESSION["three"]; $var = 0; } if ($var==1) { ?> <span class='something'>Go here:<a href='#'>Click</a></span> <span class='something'>Go here:<a href='#'>Click</a></span <?php } else { ?> You are cool enough to view the content. <?php } ?>

    Read the article

  • Capturing stdout from an imported module in wxpython and sending it to a textctrl, without blocking the GUI

    - by splafe
    There are alot of very similar questions to this but I can't find one that applies specifically to what I'm trying to do. I have a simulation (written in SimPy) that I'm writing a GUI for, the main output of the simulation is text - to the console from 'print' statements. Now, I thought the simplest way would be to create a seperate module GUI.py, and import my simulation program into it: import osi_model I want all the print statements to be captured by the GUI and appear inside a Textctrl, which there's countless examples of on here, along these lines: class MyFrame(wx.Frame): def __init__(self, *args, **kwds): <general frame initialisation stuff..> redir=RedirectText(self.txtCtrl_1) sys.stdout=redir class RedirectText: def __init__(self,aWxTextCtrl): self.out=aWxTextCtrl def write(self,string): self.out.WriteText(string) I am also starting my simulation from a 'Go' button: def go_btn_click(self, event): print 'GO' self.RT = threading.Thread(target=osi_model.RunThis()) self.RT.start() This all works fine, and the output from the simulation module is captured by the TextCtrl, except the GUI locks up and becomes unresponsive - I still need it to be accessible (at the very minimum to have a 'Stop' button). I'm not sure if this is a botched attempt at creating a new thread that I've done here, but I assume a new thread will be needed at some stage in this process. People suggest using wx.CallAfter, but I'm not sure how to go about this considering the imported module doesn't know about wx, and also I can't realistically go through the entire simulation architecture and change all the print statements to wx.CallAfter, and any attempt to capture the shell from inside the imported simulation program leads to the program crashing. Does anybody have any ideas about how I can best achieve this? So all I really need is for all console text to be captured by a TextCtrl while the GUI remains responsive, and all text is solely coming from an imported module. (Also, secondary question regarding a Stop button - is it bad form to just kill the simulation thread?). Thanks, Duncan

    Read the article

  • How do you safely wrap a JS string variable in double quote chars?

    - by incombinative
    Obviously when you're creating an actual string literal yourself, you backslash escape the double quote characters yourself. var foo = "baz\"bat"; Just as you would with the handful of other control characters, like linebreaks and backslashes. var bar = "baz\\bat"; but when you already have a variable, and you're wrapping that existing variable in quote characters, there's some confusion. Obviously you have to escape any potential double quote characters that are in the string. (Assuming whatever system you're giving the explicitly quoted string to, needs to be able to parse them correctly. =) var doubleQuoteRe = /\"/g; var quoted = unquoted.replace(escaper, '\\\"'); However from there opinions diverge a little. In particular, according to some you also have to worry about escaping literal backslash characters in the variable. // now say i have a string bar, that has both single backslash character in it, // as well as a double-quote character in it. // the following code ONLY worries about escaping the double quote char. var quoted = bar.replace(doubleQuoteRe, '\\\"'); The above seems fine to me. But is there a problem im not seeing?

    Read the article

  • How to build a dynamic resize-able Flash player

    - by Leon
    Morning stackers! So my question today isn't dealing with any code, but how to go about this the correct way from the start. I have a video player built to a static size (max: 800x600) which I'll have to re-code every time I need it to be a different size. What I need it to do in the near future is dynamically resize itself and all the elements inside of it based on 1 width variable that it will received either from HTML or XML. Now to me there are 2 ways to go about this: Start with the smallest size possible and resize upwards, but I'm unsure of how the Flash movie will actually expand upwards as of right now. Or 2, start with the largest size possible (in this case 800x600) and size everything down. Step 1, I think seems to be the better way to go about this (ala YouTube style), but Step 2 also seems like it could be the easier way? A friend of mine mentioned that I should go with the larger size and have elements resize in each class, then fix to the upper left hand corner. However for the player to fit inside of certain div columns on sites, blogs whatever he said that there will have to be an HTML/CSS side of this... meaning that the div containing the resized flash player will have to cover up the areas of the Flash movie that are not to be shown? Is that possible to put a 800x600 flash movie into a div that smaller then 800 pixels wide? And cover it up with another div? Anyways, my mission is to be able to have a dynamically sized player like this: Thoughts? Recommendations? Best practices for this before I start?

    Read the article

  • Codeigniter .htaccess not working in subdirectory

    - by xzdead
    I have this codeingniter project structure webRoot | |/application | | | |/controllers | | | |/admin | |/public | | | |/admin | | | | | |/css | | |/img | |/css | |/img And this is my .htacess file, located in /public. I use this in every local project running xampp: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php/$1 [L] </IfModule> <IfModule !mod_rewrite.c> # If we don't have mod_rewrite installed, all 404's # can be sent to index.php, and everything works as normal. # Submitted by: ElliotHaughin ErrorDocument 404 /index.php </IfModule> It works fine in localhost, but doesn't work in a dreamhost server. I always get "no input file specified". So after searching the web and trying lots of combinations, the best I got is this .htaccess file: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] With this one, if I go to http://development.mydomain.com - I see the codeigniter welcome page But if I go to: http://development.mydomain.com/admin - I see the directory listing of /public/admin and doesn't execute the controller in /application/controllers/admin Again, if I go to: http://development.mydomain.com/admin/admin - I see the private area, it executes the controller and goes to the default controller defined in routes, "dashboard" This works fine too: http://development.mydomain.com/admin/dashboard I have set in my config file: $config['index_page'] = ''; $config['base_url'] = ''; $config['uri_protocol'] = 'AUTO'; I think that whatever is wrong in my .htaccess is causing other path issues I have with my project. Any help would be great. Thanks to all in advance EDIT: I removed this line: RewriteCond %{REQUEST_FILENAME} !-d because admin directory exists, that's why I see the public directory listing. But now I see the codeigniter welcome page when I go to http://development.mydomain.com/admin So now my .htaccess file looks like: Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] #RewriteRule ^(.*)$ /index.php?/$1 [L] I also tried with the commented RewriteRule but I get the same result.

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >