Daily Archives

Articles indexed Monday March 22 2010

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

  • Questions on SQL Server 2008 Full-Text Search

    - by Eddie
    I have some questions about SQL 2K8 integrated full-text search. Say I have the following tables: Car with columns: id (int - pk), makeid (fk), description (nvarchar), year (int), features (int - bitwise value - 32 features only) CarMake with columns: id (int - pk), mfgname (nvarchar) CarFeatures with columns: id (int - 1, 2, 4, 8, etc.), featurename (nvarchar) If someone searches "red honda civic 2002 4 doors", how would I parse the input string so that I could also search in the "CarMake" and "CarFeatures" tables?

    Read the article

  • Sales by Category in Magento?

    - by Tegan Snyder
    We have a category called "Clearance" on our Magento website. Ideally it would be nice to be able to get a report of all orders sold in that category. Is there anyway I can join the orders collection with the products collection and filter by category id? Here is a similar thread: http://www.magentocommerce.com/boards/viewthread/44296/ Any ideas, or am I crazy? It doesn't need to be pretty.

    Read the article

  • How to show errors using JSON when an update fails in Rails 2.3.5 with jQuery

    - by Fortuity
    I've got in-place editing on a page in my app (using Rails 2.3.5 and jQuery). I want to know how to display an error on the page when the update fails. I'm using ajax (an XMLHttpRequest) to save an update to a Comment object. The controller has an update method like this: def update @comment = Comment.find(params[:id]) respond_to do |format| # if @comment.update_attributes!(params[:comment]) if false #deliberately forcing a fail here to see what happens format.json { render :nothing => true } else format.json { render :json => @comment.errors, :status => :unprocessable_entity } end end end In Firebug, I can see the server returns a "422" (an appropriate validation error status code). But it's a response to an XMLHttpRequest so there is no redirect to an error page. I think I actually want to do this: format.json { render :json => @comment.errors} and trigger some Javascript function that iterates through (and displays) any errors. I'm using a rails plugin http://github.com/janv/rest_in_place/ to implement the in-place editing. It doesn't appear to have any callback function to handle a failure. What are my options? Can I write some Javascript to respond to a failure condition without hacking the plugin? Do I have to hack the rest_in_place plugin to handle a failure condition? Is there a better plugin (for Rails or jQuery) that handles in-place editing, including failure conditions?

    Read the article

  • XCode File Browsing doesn't open files!

    - by user288024
    Previously when I browsed source code files using Xcode's file browser (located on left side), clicking on a source file would open it in the right window. I must've accidentally changed some setting that stops this behavior -- now single clicking on any file doesn't do anything at all. I'd really like it to go back to the old behavior of opening the file. Any ideas? This behavior is driving me crazy. To open a source file I have to double-click and open in a separate window.

    Read the article

  • Problem copying files through xcopy using VBScript

    - by sushant
    I am using VBScript to copy files using xcopy. The problem is that the folder path has to be entered by the user. Assuming I put that path in a variable, say h, how do I use this variable in the xcopy command? Here is the code I tried: Dim WshShell, oExec, g, h h = "D:\newfolder" g = "xcopy $h D:\y\ /E" Set WshShell = CreateObject("WScript.Shell") Set oExec = WshShell.Exec(g) I also tried &h but it did not work. Could anyone help me work out the correct syntax? Any help is appreciated.

    Read the article

  • Network devices disabled

    - by Tao
    I've been running the Lucid Lynx alpha since first release and only now, after recently putting my computer into suspend then restarting, has the networking failed completely. Both wireless and ethernet list as disabled with sudo lshw -C network. The wireless adapter is an Atheros AR928X. The ethernet is a Realtek RTL8111/8168B. Any suggestions as to how I might go about fixing this?

    Read the article

  • SQL SERVER – Enumerations in Relational Database – Best Practice

    - by pinaldave
    Marko Parkkola This article has been submitted by Marko Parkkola, Data systems designer at Saarionen Oy, Finland. Marko is excellent developer and always thinking at next level. You can read his earlier comment which created very interesting discussion here: SQL SERVER- IF EXISTS(Select null from table) vs IF EXISTS(Select 1 from table). I must express my special thanks to Marko for sending this best practice for Enumerations in Relational Database. He has really wrote excellent piece here and welcome comments here. Enumerations in Relational Database This is a subject which is very basic thing in relational databases but often not very well understood and sometimes badly implemented. There are of course many ways to do this but I concentrate only two cases, one which is “the right way” and one which is definitely wrong way. The concept Let’s say we have table Person in our database. Person has properties/fields like Firstname, Lastname, Birthday and so on. Then there’s a field that tells person’s marital status and let’s name it the same way; MaritalStatus. Now MaritalStatus is an enumeration. In C# I would definitely make it an enumeration with values likes Single, InRelationship, Married, Divorced. Now here comes the problem, SQL doesn’t have enumerations. The wrong way This is, in my opinion, absolutely the wrong way to do this. It has one upside though; you’ll see the enumeration’s description instantly when you do simple SELECT query and you don’t have to deal with mysterious values. There’s plenty of downsides too and one would be database fragmentation. Consider this (I’ve left all indexes and constraints out of the query on purpose). CREATE TABLE [dbo].[Person] ( [Firstname] NVARCHAR(100), [Lastname] NVARCHAR(100), [Birthday] datetime, [MaritalStatus] NVARCHAR(10) ) You have nvarchar(20) field in the table that tells the marital status. Obvious problem with this is that what if you create a new value which doesn’t fit into 20 characters? You’ll have to come and alter the table. There are other problems also but I’ll leave those for the reader to think about. The correct way Here’s how I’ve done this in many projects. This model still has one problem but it can be alleviated in the application layer or with CHECK constraints if you like. First I will create a namespace table which tells the name of the enumeration. I will add one row to it too. I’ll write all the indexes and constraints here too. CREATE TABLE [CodeNamespace] ( [Id] INT IDENTITY(1, 1), [Name] NVARCHAR(100) NOT NULL, CONSTRAINT [PK_CodeNamespace] PRIMARY KEY ([Id]), CONSTRAINT [IXQ_CodeNamespace_Name] UNIQUE NONCLUSTERED ([Name]) ) GO INSERT INTO [CodeNamespace] SELECT 'MaritalStatus' GO Then I create a table that holds the actual values and which reference to namespace table in order to group the values under different namespaces. I’ll add couple of rows here too. CREATE TABLE [CodeValue] ( [CodeNamespaceId] INT NOT NULL, [Value] INT NOT NULL, [Description] NVARCHAR(100) NOT NULL, [OrderBy] INT, CONSTRAINT [PK_CodeValue] PRIMARY KEY CLUSTERED ([CodeNamespaceId], [Value]), CONSTRAINT [FK_CodeValue_CodeNamespace] FOREIGN KEY ([CodeNamespaceId]) REFERENCES [CodeNamespace] ([Id]) ) GO -- 1 is the 'MaritalStatus' namespace INSERT INTO [CodeValue] SELECT 1, 1, 'Single', 1 INSERT INTO [CodeValue] SELECT 1, 2, 'In relationship', 2 INSERT INTO [CodeValue] SELECT 1, 3, 'Married', 3 INSERT INTO [CodeValue] SELECT 1, 4, 'Divorced', 4 GO Now there’s four columns in CodeValue table. CodeNamespaceId tells under which namespace values belongs to. Value tells the enumeration value which is used in Person table (I’ll show how this is done below). Description tells what the value means. You can use this, for example, column in UI’s combo box. OrderBy tells if the values needs to be ordered in some way when displayed in the UI. And here’s the Person table again now with correct columns. I’ll add one row here to show how enumerations are to be used. CREATE TABLE [dbo].[Person] ( [Firstname] NVARCHAR(100), [Lastname] NVARCHAR(100), [Birthday] datetime, [MaritalStatus] INT ) GO INSERT INTO [Person] SELECT 'Marko', 'Parkkola', '1977-03-04', 3 GO Now I said earlier that there is one problem with this. MaritalStatus column doesn’t have any database enforced relationship to the CodeValue table so you can enter any value you like into this field. I’ve solved this problem in the application layer by selecting all the values from the CodeValue table and put them into a combobox / dropdownlist (with Value field as value and Description as text) so the end user can’t enter any illegal values; and of course I’ll check the entered value in data access layer also. I said in the “The wrong way” section that there is one benefit to it. In fact, you can have the same benefit here by using a simple view, which I schema bound so you can even index it if you like. CREATE VIEW [dbo].[Person_v] WITH SCHEMABINDING AS SELECT p.[Firstname], p.[Lastname], p.[BirthDay], c.[Description] MaritalStatus FROM [dbo].[Person] p JOIN [dbo].[CodeValue] c ON p.[MaritalStatus] = c.[Value] JOIN [dbo].[CodeNamespace] n ON n.[Id] = c.[CodeNamespaceId] AND n.[Name] = 'MaritalStatus' GO -- Select from View SELECT * FROM [dbo].[Person_v] GO This is excellent write up byMarko Parkkola. Do you have this kind of design setup at your organization? Let us know your opinion. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Best Practices, Database, DBA, Readers Contribution, Software Development, SQL, SQL Authority, SQL Documentation, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • importing same module more than once

    - by wallacoloo
    So after a few hours, I discovered the cause of a bug in my application. My app's source is structure like: main/ __init__.py folderA/ __init__.py fileA.py fileB.py Really, there are about 50 more files. But that's not the point. In main/__init__.py, I have this code: from folderA.fileA import * in folderA/__init__.py I have this code: sys.path.append(pathToFolderA) in folderA/fileB.py I have this code: from fileA import * The problem is that fileA gets imported twice. However, I only want to import it once. The obvious way to fix this (to me atleast) is to change certain paths from path to folderA.path But I feel like Python should not even have this error in the first place. What other workarounds are there that don't require each file to know it's absolute location?

    Read the article

  • PHP: Cookie only sent to http://www.xxx.com and NOT http://xxx.com

    - by Axel
    Hi, I have a php login which sets 2 cookies once some one login. the problem is that if you login from : http://www.mydomain.com and you go to http://mydomain.com you will find your self not logged in, I think that's because the browser only send the cookies to the first syntax. It's only one domain, the difference is the www. before the domain name, so how to set cookies to the whole domain whatever there is www. or not ? Thanks

    Read the article

  • how to add data to database from rails console

    - by rails_guy
    I have a User model. >> @u = User.new => #<User id: nil, userid: nil, password: nil, created_at: nil, updated_at: nil, user_first_name: nil, user_last_name: nil, user_status: nil, user_type: nil> I am not able to add data to the Users table from the console. I am doing the following: >> @u.userid="test1" => "test1" >> @u.password="test2" => "test2" >> @u.user_first_name="test3" => "test3" >> @u.user_last_name="test4" => "test4" >> @u.user_status="test5" => "test5" >> @u.user_type="test6" => "test6" >> @u.save NoMethodError: undefined method `userid' for nil:NilClass what am i doing wrong? I just simply want to add one row of data to the app.

    Read the article

  • asp.net update LINQ dbml files

    - by rockinthesixstring
    Is there a quick and easy way to update my LINQ dbml files? Right now, if I update a Stored Procedure, I need to open the dbml designer file, delete the old SP, save, drag and drop the new SP, and save again. I haven't researched this a whole bunch, but I'm wondering if there's an easy way for Visual Studio to just go into the DB and update the dbml to the latest SP's by just clicking an update button or something along those lines.

    Read the article

  • Is Programming Right for me?

    - by L1th1um
    I'm interested in programming, but it seems to me that I can't get into it. Every time I've tried to learn a language and stuff by looking through tutorials or books I'd never get past the part where I use the syntax to make something. And by interest, I mean that I read stack overflow a lot, coding horror, and stuff but the actual coding part is hard for me to get into. Did anybody start this way? How did you get past this block?

    Read the article

  • Hashing words to numbers with respect to definition

    - by thornate
    As part of a larger project, I need to read in text and represent each word as a number. For example, if the program reads in "Every good boy deserves fruit", then I would get a table that converts 'every' to '1742', 'good' to '977513', etc. Now, obviously I can just use a hashing algorithm to get these numbers. However, it would be more useful if words with similar meanings had numerical values close to each other, so that 'good' becomes '6827' and 'great' becomes '6835', etc. As another option, instead of a simple integer representing each number, it would be even better to have a vector made up of multiple numbers, eg (lexical_category, tense, classification, specific_word) where lexical_category is noun/verb/adjective/etc, tense is future/past/present, classification defines a wide set of general topics and specific_word is much the same as described in the previous paragraph. Does any such an algorithm exist? If not, can you give me any tips on how to get started on developing one myself? I code in C++.

    Read the article

  • How to make a web browser with tabbed browsing with vb 2008?

    - by felixd68
    I've tried multiple times to create a web browser with tabbed browsing. I know that I have to use "tab control". I have succeeded in creating a semi-tabbed browsing. People are able to add new tabs, but the webbrowser component only appears in one tab page. Coding: Form1_Load: Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim Browse As New WebBrowser TabControl1.TabPages.Add(1, "TabPage" & i) TabControl1.SelectTab(1 - 1) Browse.Name = "wb" Browse.Dock = DockStyle.Fill TabControl1.SelectedTab.Controls.Add(Browse) i = i + 1 End Sub Web Browser Component Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) url.Text = e.Url.ToString() 'your url text box will show the actual url of the page after the page is fully loaded url.Text = e.Url.ToString Me.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle & " - Webbrowser's name" TabControl1.SelectedTab.Text = CType(TabControl1.SelectedTab.Controls.Item(0), WebBrowser).DocumentTitle End Sub

    Read the article

  • VisualStateManager for WPF and Silverlight

    - by Allen Ho
    When you do code like VisualStates.GoToState(this, useTransitions, VisualStates.StateNormal); I believe this code will only work for Silverlight apps. will this affect the way a WPF app works... Trying to incorportae controls that can be shared between both silverlight and WPF apps and was just wondering what were the main pitfalls were...

    Read the article

  • Greasemonkey @require jQuery not working "Component not available"

    - by Greg K
    I've seen the other question on here about loading jQuery in a Greasemonkey. Having tried that method, with this require statement inside my ==UserScript== tags: // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js I still get the following error message in Firefox's error console: Error: Component is not available Source File: file:///Users/greg/Library/Application%20Support/ Firefox/Profiles/xo9xhovo.default/gm_scripts/myscript/jquerymin.js Line: 36 This stops my greasemonkey code from running. I've made sure I included the @require for jQuery and saved my js file before installing it, as required files are only loaded on installation. Code: // ==UserScript== // @name My Script // @namespace http://www.google.com // @description My test script // @include http://www.google.com // @require http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js // ==/UserScript== GM_log("Hello"); I have Greasemonkey 0.8.20091209.4 installed on Firefox 3.5.7 on my Macbook Pro, Leopard (10.5.8). I've cleared my cache (except cookies) and have disabled all other plugins except Flashblock 1.5.11.2, Web Developer 1.1.8 and Adblock Plus 1.1.3. My config.xml with my Greasemonkey script installed: <UserScriptConfig> <Script filename="myscript.user.js" name="My Script" namespace="http://www.google.com" description="My test script" enabled="true" basedir="myscript"> <Include>http://www.google.com</Include> <Require filename="jquerymin.js"/> </Script> I can see jquerymin.js sat in the gm_scripts/myscript/ directory. Additionally, is it common for this error to occur in the console when installing a Greasemonkey script? Error: not well-formed Source File: file:///Users/Greg/Documents/myscript.user.js Line: 1, Column: 1 Source Code: // ==UserScript==

    Read the article

  • PHP 5.2.11: Unable to load dynamic library complaints

    - by OldTroll
    I installed PHP 5.2.11 and upon enabling the php_mssql.dll module (and the obligatory restart of the services) started receiving warnings about not being able to load the dynamic library. The operating environment is IIS ISAPI under Windows 2003 R2. Here is the list of things that were checked File Exists in \PHP\ext directory and has the same timestamp as the other distribution delivered libraries. Permissions are correct to the file. Other extensions are enabled and functioning with identical permissions. ntwdblib.dll has been copied from a SQL Server 2005 installation (per php.net's requirements for the module) Other modules before and after the php_mssql entry are working. I've also stripped down and remove all non-essential references with detectable improvements. I turned up logging and enabled all the error logs in the php.ini, nothing is generated by the logs. Searching Google has turned up a slew of closed/unsolved bug reports on php.net and some miscellaneous near-matches, none of which have really addressed the problem or lead to any inspirations.

    Read the article

  • MediaWiki on MS Sql Server

    - by kdbolt70
    Hello all, I've been doing some digging on running mediawiki on sql server instead of mySQL, but haven't come across any concrete information. All of our servers are running SQL Server so I'd like to stick with that. I've tried Screwturn wiki, which is an ASP.NET wiki implementation using SQL Server, but I'm not terribly happy with the editing interface, and would really like to get MediaWiki up and running. Does anyone know if this is possible? Thanks!

    Read the article

  • attach / detach mssql 2008 sql server manager [SOLVED]

    - by Tillebeck
    An external consult wrote a guide on how to copy a database. Step two was detach the database using Sql Server Manager. After the detach the database was not visible in the SQL Server Manager... Not much to do but write a mail to the service provider asking to have the database attached again. The service porviders answer: Not posisble to attach again since the SQL Server security has been violated". Rolling back to last backup is not the option I want to use. Can any one give feedback if this seems logic and reasonable to assume that a detached database in a SQL Server 2008 accessed through SQL Server Manager cannot be reattached. It was done by rightclicking the database and choosing detach. -- update -- Based on the comments below I update the question with the server setup. There are two dedicated servers: srv1: Web server with remote desktop and an Sql Server Manager srv2: Sql server that can be accessed through the Sql Server Manager on the web server -- update2 -- After a restart of the server the DBA could suddenly do the attachment of the database. And I guess that after the restart it was a simple task. So all of your answer were rigth! It seems that I can only mark one as a correct answer so I marked the first answer correct. But all are correct answer. Thanks a lot. Without posting the link to this thread then we might had so suffer while watching our database beeing restored by a backup :-) Thanks a lot. BR. Anders

    Read the article

  • Login problems on SQL EXPRESS using a user

    - by meep
    Hello Serverfault. First time I set up a SQL server, so I hope you can help me out. I have a problem regarding logging in using SQL auth on my SQL EXPRESS 2008. I have added a user though the management interface as you can see on the image below. But as soon as I try to login using SQL auth I get an error the login failed for the user. The server log says: Login failed for user 'zebisgaard'. Reason: Could not find a login matching the name provided. [CLIENT: <named pipe>] Error: 18456, Severity: 14, State: 5. Do you have an idea why? I have triple checked that the username/password is correct, tried to recreate the user and so much more. And all this is localhost.

    Read the article

  • AutoRestart error in SQL Server logs (reason: Access is denied)

    - by Michael Teper
    My instance of SQL Server 2008 SP1 crashed, which is a separate issue, and I see the following set of messages in the SQL Server Agent log: [139] AutoRestart: Attempting to restart the MSSQLSERVER service (attempt #1)... [368] AutoRestart: Unable to restart the MSSQLSERVER service (reason: Access is denied) Is there an authoritative place that describes what permissions should be assigned to a domain account that the SQL Server Agent runs as? Thank you!

    Read the article

  • SQL Error Log Message- 'ACCESS_METHODS_SCAN_RANGE_GENERATOR'

    - by Chirag
    One of our SQL2005 Enterprise Servers running on Win2003 became unresponsive and on reboot I saw these errors logged before it went down. Date 17/09/2009 10:16:22 Log SQL Server (Archive #1 - 17/09/2009 10:17:00) Source spid111 Message Timeout occurred while waiting for latch: class 'ACCESS_METHODS_SCAN_RANGE_GENERATOR', id 000000002A761760, type 4, Task 0x000000000E609EB8 : 14, waittime 600, flags 0x1a, owning task 0x000000000E6129B8. Continuing to wait. Anyone know what this error points or relates to? Many thanks in advance.

    Read the article

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