Search Results

Search found 18143 results on 726 pages for 'null'.

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

  • Avoiding null in a controller

    - by Kevin Burke
    I'm trying to work through how to write this code. def get(params): """ Fetch a user's details, or 404 """ user = User.fetch_by_id(params['id']) if not user: abort(404) # Render some template for the user... What's the best way to handle the case where the lookup fails? One principle says you should avoid returning null values from functions. These lead to mistakes and AttributeErrors etc. later on in the file. Another idea is to have fetch_by_id raise a ValueError or similar if no user exists with that id. However there's a general principle that you shouldn't use exceptions for control flow, either, which doesn't help much. What could be done better in this case?

    Read the article

  • Comparable and Comparator contract with regards to null

    - by polygenelubricants
    Comparable contract specifies that e.compareTo(null) must throw NullPointerException. From the API: Note that null is not an instance of any class, and e.compareTo(null) should throw a NullPointerException even though e.equals(null) returns false. On the other hand, Comparator API mentions nothing about what needs to happen when comparing null. Consider the following attempt of a generic method that takes a Comparable, and return a Comparator for it that puts null as the minimum element. static <T extends Comparable<? super T>> Comparator<T> nullComparableComparator() { return new Comparator<T>() { @Override public int compare(T el1, T el2) { return el1 == null ? -1 : el2 == null ? +1 : el1.compareTo(el2); } }; } This allows us to do the following: List<Integer> numbers = new ArrayList<Integer>( Arrays.asList(3, 2, 1, null, null, 0) ); Comparator<Integer> numbersComp = nullComparableComparator(); Collections.sort(numbers, numbersComp); System.out.println(numbers); // "[null, null, 0, 1, 2, 3]" List<String> names = new ArrayList<String>( Arrays.asList("Bob", null, "Alice", "Carol") ); Comparator<String> namesComp = nullComparableComparator(); Collections.sort(names, namesComp); System.out.println(names); // "[null, Alice, Bob, Carol]" So the questions are: Is this an acceptable use of a Comparator, or is it violating an unwritten rule regarding comparing null and throwing NullPointerException? Is it ever a good idea to even have to sort a List containing null elements, or is that a sure sign of a design error?

    Read the article

  • NHibernate IUserType convert nullable DateTime to DB not-null value

    - by barakbbn
    I have legacy DB that store dates that means no-date as 9999-21-31, The column Till_Date is of type DateTime not-null="true". in the application i want to build persisted class that represent no-date as null, So i used nullable DateTime in C# //public DateTime? TillDate {get; set; } I created IUserType that knows to convert the entity null value to DB 9999-12-31 but it seems that NHibernate doesn't call SafeNullGet, SafeNullSet on my IUserType when the entity value is null, and report a null is used for not-null column. I tried to by-pass it by mapping the column as not-null="false" (changed only the mapping file, not the DB) but it still didn't help, only now it tries to insert the null value to the DB and get ADOException. Any knowledge if NHibernate doesn't support IUseType that convert null to not-null values? Thanks //Implementation public class NullableDateTimeToNotNullUserType : IUserType { private static readonly DateTime MaxDate = new DateTime(9999, 12, 31); public new bool Equals(object x, object y) { //This didn't work as well if (ReferenceEquals(x, y)) return true; //if(x == null && y == null) return false; if (x == null || y == null) return false; return x.Equals(y); } public int GetHashCode(object x) { return x == null ? 0 : x.GetHashCode(); } public object NullSafeGet(IDataReader rs, string[] names, object owner) { var value = rs.GetDateTime(rs.GetOrdinal(names[0])); return (value == MaxDate)? null : value; } public void NullSafeSet(IDbCommand cmd, object value, int index) { var dateValue = (DateTime?)value; var dbValue = (dateValue.HasValue) ? dateValue.Value : MaxDate; ((IDataParameter)cmd.Parameters[index]).Value = dbValue; } public object DeepCopy(object value) { return value; } public object Replace(object original, object target, object owner) { return original; } public object Assemble(object cached, object owner) { return cached; } public object Disassemble(object value) { return value; } public SqlType[] SqlTypes { get { return new[] { NHibernateUtil.DateTime.SqlType }; } } public Type ReturnedType { get { return typeof(DateTime?); } } public bool IsMutable { get { return false; } } } } //Final Implementation with fixes. make the column mapping in hbm.xml not-null="false" public class NullableDateTimeToNotNullUserType : IUserType { private static readonly DateTime MaxDate = new DateTime(9999, 12, 31); public new bool Equals(object x, object y) { //This didn't work as well if (ReferenceEquals(x, y)) return true; //if(x == null && y == null) return false; if (x == null || y == null) return false; return x.Equals(y); } public int GetHashCode(object x) { return x == null ? 0 : x.GetHashCode(); } public object NullSafeGet(IDataReader rs, string[] names, object owner) { var value = NHibernateUtil.Date.NullSafeGet(rs, names[0]); return (value == MaxDate)? default(DateTime?) : value; } public void NullSafeSet(IDbCommand cmd, object value, int index) { var dateValue = (DateTime?)value; var dbValue = (dateValue.HasValue) ? dateValue.Value : MaxDate; NHibernateUtil.Date.NullSafeSet(cmd, valueToSet, index); } public object DeepCopy(object value) { return value; } public object Replace(object original, object target, object owner) { return original; } public object Assemble(object cached, object owner) { return cached; } public object Disassemble(object value) { return value; } public SqlType[] SqlTypes { get { return new[] { NHibernateUtil.DateTime.SqlType }; } } public Type ReturnedType { get { return typeof(DateTime?); } } public bool IsMutable { get { return false; } } } }

    Read the article

  • null from C# getting converted into 'NULL' in Sql Server

    - by Anand
    I am trying to insert NULL value in Sql Server if I have null value in corresponding C# String object like below : String Residence = xmlDoc.Descendants("Appointment").Single().Element("StateOfResidence") == null ? null : xmlDoc.Descendants("Appointment").Elements("StateOfResidence").Single().Value; I am using Entity framework for Database access. So if Residence is null, 'NULL' gets inserted into Database instead of NULL. How can insert NULL for null ?

    Read the article

  • MS Access PIVOT with User Defined Field

    - by user2535359
    Any of you good souls please help!! I need to query the source table shown in the below. (NULL are blank fields) UNUM, Ticket, Overflow 1 , 135 , NULL 1 , 136 ,NULL 1, 137, NULL 1, 138, NULL 1, NULL, 2b 2, 135, NULL 2, 136, NULL 2, 137, NULL 3, 135, NULL 3, 136, NULL 3, 137,NULL 3, 138, NULL 3, 139, NULL 3, 140, NULL 3, NULL, 66a 4, NULL, 12a 5, NULL, 14a I need to generate the output as shown below. UserNum, Ticket1, Ticket2, Ticket3, Ticket4, Ticket5, Ticket6, Ticket7, Ticket8, Ticket9, Overflow 1, 135, 136, 137, 138, Null, Null, Null, Null, Null, 2b 2, 135, 136, 137, Null, Null, Null, Null, Null, Null, Null 3, 135, 136, 137, 138, 139, 140, Null, Null, Null, 66a 4, Null, Null, Null, Null, Null, Null, Null, Null, Null, 12a 5, Null, Null, Null, Null, Null, Null, Null, Null, Null, 14a The source table has multiple tickets assigned to user. There are always maximum of 9 tickets. The user either has a ticket or an overflow but here can be only overflow per user. I am having issue pivoting the data in Ticket column to pre-defined field names like Ticket1, Ticket2...

    Read the article

  • Problems Enforcing Referential Integrity on SQL Server Tables

    - by SidC
    Hello All, I have a SQL Server 2005 database comprised of Customer, Quote, QuoteDetail tables. I want/need to enforce referential integrity such that when an insert is made on quotedetail, the quote and customer tables are also affected. I have tried my best to set up primary/foreign keys on my tables but need some help. Here's the scripts for my tables as they stand now (please don't laugh): Customers: USE [Diel_inventory] GO /****** Object: Table [dbo].[Customers] Script Date: 05/08/2010 03:39:04 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Customers]( [pkCustID] [int] IDENTITY(1,1) NOT NULL, [CompanyName] [nvarchar](50) NULL, [Address] [nvarchar](50) NULL, [City] [nvarchar](50) NULL, [State] [nvarchar](2) NULL, [ZipCode] [nvarchar](5) NULL, [OfficePhone] [nvarchar](12) NULL, [OfficeFAX] [nvarchar](12) NULL, [Email] [nvarchar](50) NULL, [PrimaryContactName] [nvarchar](50) NULL, CONSTRAINT [PK_Customers] PRIMARY KEY CLUSTERED ([pkCustID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] Quotes: USE [Diel_inventory] GO /****** Object: Table [dbo].[Quotes] Script Date: 05/08/2010 03:30:46 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[Quotes]( [pkQuoteID] [int] IDENTITY(1,1) NOT NULL, [fkCustomerID] [int] NOT NULL, [QuoteDate] [timestamp] NOT NULL, [NeedbyDate] [datetime] NULL, [QuoteAmt] [decimal](6, 2) NOT NULL, [QuoteApproved] [bit] NOT NULL, [fkOrderID] [int] NOT NULL, CONSTRAINT [PK_Bids] PRIMARY KEY CLUSTERED ( [pkQuoteID] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[Quotes] WITH CHECK ADD CONSTRAINT [fkCustomerID] FOREIGN KEY([fkCustomerID]) REFERENCES [dbo].[Customers] ([pkCustID]) GO ALTER TABLE [dbo].[Quotes] CHECK CONSTRAINT [fkCustomerID] QuoteDetail: USE [Diel_inventory] GO /****** Object: Table [dbo].[QuoteDetail] Script Date: 05/08/2010 03:31:58 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[QuoteDetail]( [ID] [int] IDENTITY(1,1) NOT NULL, [fkQuoteID] [int] NOT NULL, [fkCustomerID] [int] NOT NULL, [fkPartID] [int] NULL, [PartNumber1] [float] NOT NULL, [Qty1] [int] NOT NULL, [PartNumber2] [float] NULL, [Qty2] [int] NULL, [PartNumber3] [float] NULL, [Qty3] [int] NULL, [PartNumber4] [float] NULL, [Qty4] [int] NULL, [PartNumber5] [float] NULL, [Qty5] [int] NULL, [PartNumber6] [float] NULL, [Qty6] [int] NULL, [PartNumber7] [float] NULL, [Qty7] [int] NULL, [PartNumber8] [float] NULL, [Qty8] [int] NULL, [PartNumber9] [float] NULL, [Qty9] [int] NULL, [PartNumber10] [float] NULL, [Qty10] [int] NULL, [PartNumber11] [float] NULL, [Qty11] [int] NULL, [PartNumber12] [float] NULL, [Qty12] [int] NULL, [PartNumber13] [float] NULL, [Qty13] [int] NULL, [PartNumber14] [float] NULL, [Qty14] [int] NULL, [PartNumber15] [float] NULL, [Qty15] [int] NULL, [PartNumber16] [float] NULL, [Qty16] [int] NULL, [PartNumber17] [float] NULL, [Qty17] [int] NULL, [PartNumber18] [float] NULL, [Qty18] [int] NULL, [PartNumber19] [float] NULL, [Qty19] [int] NULL, [PartNumber20] [float] NULL, [Qty20] [int] NULL, CONSTRAINT [PK_QuoteDetail] PRIMARY KEY CLUSTERED ( [ID] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] ) ON [PRIMARY] GO ALTER TABLE [dbo].[QuoteDetail] WITH CHECK ADD CONSTRAINT [FK_QuoteDetail_Customers] FOREIGN KEY ([fkCustomerID]) REFERENCES [dbo].[Customers] ([pkCustID]) GO ALTER TABLE [dbo].[QuoteDetail] CHECK CONSTRAINT [FK_QuoteDetail_Customers] GO ALTER TABLE [dbo].[QuoteDetail] WITH CHECK ADD CONSTRAINT [FK_QuoteDetail_PartList] FOREIGN KEY ([fkPartID]) REFERENCES [dbo].[PartList] ([RecID]) GO ALTER TABLE [dbo].[QuoteDetail] CHECK CONSTRAINT [FK_QuoteDetail_PartList] GO ALTER TABLE [dbo].[QuoteDetail] WITH CHECK ADD CONSTRAINT [FK_QuoteDetail_Quotes] FOREIGN KEY([fkQuoteID]) REFERENCES [dbo].[Quotes] ([pkQuoteID]) GO ALTER TABLE [dbo].[QuoteDetail] CHECK CONSTRAINT [FK_QuoteDetail_Quotes] Your advice/guidance on how to set these up so that customer ID in Customers is the same as in Quotes (referential integrity) and that CustomerID is inserted on Quotes and Customers when an insert is made to QuoteDetial would be much appreciated. Thanks, Sid

    Read the article

  • SQL SERVER – A Puzzle – Fun with NULL – Fix Error 8117

    - by pinaldave
    During my 8 years of career, I have been involved in many interviews. Quite often, I act as the  interview. If I am the interviewer, I ask many questions – from easy questions to difficult ones. When I am the interviewee, I frequently get an opportunity to ask the interviewer some questions back. Regardless of the my capacity in attending the interview, I always make it a point to ask the interviewer at least one question. What is NULL? It’s always fun to ask this question during interviews, because in every interview, I get a different answer. NULL is often confused with false, absence of value or infinite value. Honestly, NULL is a very interesting subject as it bases its behavior in server settings. There are a few properties of NULL that are universal, but the knowledge about these properties is not known in a universal sense. Let us run this simple puzzle. Run the following T-SQL script: SELECT SUM(data) FROM (SELECT NULL AS data) t It will return the following error: Msg 8117, Level 16, State 1, Line 1 Operand data type NULL is invalid for sum operator. Now the error makes it very clear that NULL is invalid for sum Operator. Frequently enough, I have showed this simple query to many folks whom I came across. I asked them if they could modify the subquery and return the result as NULL. Here is what I expected: Even though this is a very simple looking query, so far I’ve got the correct answer from only 10% of the people to whom I have asked this question. It was common for me to receive this kind of answer – convert the NULL to some data type. However, doing so usually returns the value as 0 or the integer they passed. SELECT SUM(data) FROM (SELECT ISNULL(NULL,0) AS data) t I usually see many people modifying the outer query to get desired NULL result, but that is not allowed in this simple puzzle. This small puzzle made me wonder how many people have a clear understanding about NULL. Well, here is the answer to my simple puzzle. Just CAST NULL AS INT and it will return the final result as NULL: SELECT SUM(data) FROM (SELECT CAST(NULL AS INT) AS data) t Now that you know the answer, don’t you think it was very simple indeed? This blog post is especially dedicated to my friend Madhivanan who has written an excellent blog post about NULL. I am confident that after reading the blog post from Madhivanan, you will have no confusion regarding NULL in the future. Read: NULL, NULL, NULL and nothing but NULL. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Puzzle, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • In retrospect, has it been a good idea to use three-valued logic for SQL NULL comparisons?

    - by Heinzi
    In SQL, NULL means "unknown value". Thus, every comparison with NULL yields NULL (unknown) rather than TRUE or FALSE. From a conceptional point of view, this three-valued logic makes sense. From a practical point of view, every learner of SQL has, one time or another, made the classic WHERE myField = NULL mistake or learned the hard way that NOT IN does not do what one would expect when NULL values are present. It is my impression (please correct me if I am wrong) that the cases where this three-valued logic helps (e.g. WHERE myField IS NOT NULL AND myField <> 2 can be shortened to WHERE myField <> 2) are rare and, in those cases, people tend to use the longer version anyway for clarity, just like you would add a comment when using a clever, non-obvious hack. Is there some obvious advantage that I am missing? Or is there a general consensus among the development community that this has been a mistake?

    Read the article

  • Java Constructor Style (Check parameters aren't null)

    - by Peter
    What are the best practices if you have a class which accepts some parameters but none of them are allowed to be null? The following is obvious but the exception is a little unspecific: public class SomeClass { public SomeClass(Object one, Object two) { if (one == null || two == null) { throw new IllegalArgumentException("Parameters can't be null"); } //... } } Here the exceptions let you know which parameter is null, but the constructor is now pretty ugly: public class SomeClass { public SomeClass(Object one, Object two) { if (one == null) { throw new IllegalArgumentException("one can't be null"); } if (two == null) { throw new IllegalArgumentException("two can't be null"); } //... } Here the constructor is neater, but now the constructor code isn't really in the constructor: public class SomeClass { public SomeClass(Object one, Object two) { setOne(one); setTwo(two); } public void setOne(Object one) { if (one == null) { throw new IllegalArgumentException("one can't be null"); } //... } public void setTwo(Object two) { if (two == null) { throw new IllegalArgumentException("two can't be null"); } //... } } Which of these styles is best? Or is there an alternative which is more widely accepted? Cheers, Pete

    Read the article

  • segfault when cd-ing into certain directories in bash

    - by user84207
    I have noticed this very strange behavior recently. After cd into certain directories, I get a segfault on the terminal. --- SIGSEGV (Segmentation fault) @ 0 (0) --- --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV (core dumped) +++ segmentation fault (core dumped) I proceeded to strace a bash session in which I cd into the target directory, and was able to reproduce the problem. I attached the log to this pastebin: I paste below the few lines from the read of "cd stumpwm", which is the directory in question, until the segfault. I included a few of the repetitions of calls to "rt_sigprocmask" and "brk" to give a glimpse of the pattern, which occurs for most of the strace, read(0, cd stumpwm "c", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "d", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, " ", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "s", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "t", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "u", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "m", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "p", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "w", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "m", 1) = 1 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 read(0, "\n", 1) = 1 rt_sigprocmask(SIG_BLOCK, [INT], [], 8) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig -icanon -echo ...}) = 0 ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon -echo ...}) = 0 ioctl(0, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon -echo ...}) = 0 rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 rt_sigaction(SIGINT, {0x457d50, [], SA_RESTORER, 0x7ffff76254a0}, {0x49edc0, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGTERM, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGQUIT, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGALRM, {0x457f50, [HUP INT ILL TRAP ABRT BUS FPE USR1 SEGV USR2 PIPE ALRM TERM XCPU XFSZ VTALRM SYS], SA_RESTORER, 0x7ffff76254a0}, {0x49edc0, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGTSTP, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGTTOU, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGTTIN, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, {SIG_IGN, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGWINCH, {0x457920, [], SA_RESTORER, 0x7ffff76254a0}, {0x49e6e0, [], SA_RESTORER|SA_RESTART, 0x7ffff76254a0}, 8) = 0 rt_sigaction(SIGINT, {0x457d50, [], SA_RESTORER, 0x7ffff76254a0}, {0x457d50, [], SA_RESTORER, 0x7ffff76254a0}, 8) = 0 brk(0xa9a000) = 0xa9a000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0xa9b000) = 0xa9b000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0xa9c000) = 0xa9c000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0xa9d000) = 0xa9d000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0xa9e000) = 0xa9e000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0xa9f000) = 0xa9f000 brk(0xaa0000) = 0xaa0000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0xaa1000) = 0xaa1000 brk(0xaa2000) = 0xaa2000 (pattern of rt_sigprocmask, brk continues ...) rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0x1d5b000) = 0x1d5b000 brk(0x1d5c000) = 0x1d5c000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 brk(0x1d5d000) = 0x1d5d000 brk(0x1d5e000) = 0x1d5e000 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 rt_sigprocmask(SIG_BLOCK, NULL, [], 8) = 0 --- SIGSEGV (Segmentation fault) @ 0 (0) --- --- SIGSEGV (Segmentation fault) @ 0 (0) --- +++ killed by SIGSEGV (core dumped) +++ segmentation fault (core dumped) How can I debug this? Is this likely to be a bash problem? The error does not occur with another shell, such as eshell. I have also run an fschk, although I haven't been able to see the output because of this bug.

    Read the article

  • Avoiding That Null Reference!

    - by TheJuice
    A coworker had this conversation with another of our developers. Names have been changed to protect the guilty. Clueless: hey! Clueless: I am using the ?? operator for null check below Nice Guy: hey Clueless: FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral ?? null; Nice Guy: that's not exactly how it works Clueless: I want to achive: FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral != null ? request.BoatCollateral : null; Clueless: isnt that equal to:  FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral ?? null; Nice Guy: that is functionally equivalent to FundLoanRequestBoatCollateral boatCollateral = request.BoatCollateral Nice Guy: you're checking if it's null and if so setting it to null Clueless: yeah Clueless: if its null I want to set it to null Nice Guy: if it's null then you're already going to set it to null, no special logic needed Clueless: I wanted to avoid a null reference if BoatCollateral is null   The sad part of all of this is that "Clueless" has been with our company for years and has a Master's in Computer Science.

    Read the article

  • HTMLUNIT Facebook javascript warning

    - by Shin
    Hi I am trying to create simple application that would be able to search people on facebook using given e-mail. I am already able to log into an account using the HTMLunit tool and even create a page, which should throw result of my search. But when I try to print the result as XML the file is missing some blocks of javascript results (I can tell that they are missing by comparing file created by my application and source code, that can be viewed by using IE) Is there any way around this? I just need to get the same result IE's showsource function does. Thanks a lot. During execution of file, I am getting these WARNINGS: 1.4.2010 23:25:14 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'https://s-static.ak.facebook.com/rsrc.php/z49PH/hash/9p47jvzp.js', but got 'application/x-javascript'. 21.4.2010 23:25:14 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'https://s-static.ak.facebook.com/rsrc.php/z5N5C/hash/dhdy6xq3.js', but got 'application/x-javascript'. 21.4.2010 23:25:14 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'https://s-static.ak.facebook.com/rsrc.php/z4TLI/hash/9ucb5trt.js', but got 'application/x-javascript'. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl notify WARNING: Expected content type of 'application/javascript' or 'application/ecmascript' for remotely loaded JavaScript element at 'http://static.ak.fbcdn.net/rsrc.php/z49PH/hash/9p47jvzp.js', but got 'application/x-javascript'. And then a lot of CSS errors 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [44:92] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [44:92] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [51:75] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [51:75] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [161:62] Error in style rule. Invalid token ":". Was expecting one of: <S>, "}", <COMMA>, ";", "/", <PLUS>, "-", <HASH>, <STRING>, <URI>, "!", "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [161:62] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [134:25] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [134:25] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [140:175] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [140:175] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [157:38] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [158:128] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [158:128] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [197:16] Error in pseudo class or element. Invalid token ":". Was expecting one of: <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [197:16] Ignoring the whole rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [218:58] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [218:58] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [349:141] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [349:141] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [356:101] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [356:106] Error in style rule. Invalid token "opacity". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [356:106] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [360:87] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [360:93] Error in style rule. Invalid token "opacity". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [360:93] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [365:39] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [365:43] Error in style rule. Invalid token "left". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [365:43] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [423:51] Error in style rule. Invalid token "~". Was expecting one of: <S>, <LBRACE>, <COMMA>, <PLUS>, <GREATER>, <IDENT>, "*", <HASH>, ".", "[", ":". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [423:51] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [466:135] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [466:135] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [501:30] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [501:30] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [584:59] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [584:64] Error in style rule. Invalid token "opacity". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [584:64] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [585:36] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [585:36] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [592:120] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [592:125] Error in style rule. Invalid token "opacity". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [592:125] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [598:44] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [598:48] Error in style rule. Invalid token "left". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [598:48] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [601:52] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [601:52] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [637:89] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [637:89] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [648:56] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [648:56] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [656:289] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [656:289] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [660:48] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [660:55] Error in style rule. Invalid token "-ms-filter". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [660:55] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [664:29] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [664:29] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [669:22] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [669:22] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [673:231] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [673:231] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [674:17] Error in pseudo class or element. Invalid token ":". Was expecting one of: <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [674:17] Ignoring the whole rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [690:81] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [690:87] Error in style rule. Invalid token "-ms-filter". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [690:87] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [693:84] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [693:91] Error in style rule. Invalid token "-ms-filter". Was expecting one of: "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [693:91] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [695:32] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [695:32] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [702:32] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [702:32] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [703:17] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [703:17] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [705:166] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [705:166] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [706:21] Error in pseudo class or element. Invalid token ":". Was expecting one of: <FUNCTION>, <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [706:21] Ignoring the whole rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [101:1] Error in declaration. Invalid token "}". Was expecting one of: <S>, ":". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [101:2] Error in style rule. Invalid token "\n". Was expecting one of: <S>, "}", ";". 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [101:2] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [185:39] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [185:39] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [186:38] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [186:38] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [235:84] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [235:84] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [290:26] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [290:26] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [291:70] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [291:70] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [298:52] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [298:52] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [299:48] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [299:48] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [305:50] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [305:50] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [306:69] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [306:69] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [307:89] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [307:89] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [309:83] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [309:83] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [317:84] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [317:84] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [473:215] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [473:215] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [475:137] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [475:137] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [480:78] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [480:78] Ignoring the following declarations in this rule. 21.4.2010 23:25:23 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [484:78] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [484:78] Ignoring the following declarations in this rule. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [486:91] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [486:91] Ignoring the following declarations in this rule. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [498:16] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [498:16] Ignoring the following declarations in this rule. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [506:33] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [506:33] Ignoring the following declarations in this rule. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [508:14] Error in pseudo class or element. Invalid token ":". Was expecting one of: <FUNCTION>, <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [508:14] Ignoring the whole rule. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [567:82] Error in expression. Invalid token "=". Was expecting one of: <S>, <COMMA>, "/", <PLUS>, "-", <HASH>, <STRING>, ")", <URI>, "inherit", <EMS>, <EXS>, <LENGTH_PX>, <LENGTH_CM>, <LENGTH_MM>, <LENGTH_IN>, <LENGTH_PT>, <LENGTH_PC>, <ANGLE_DEG>, <ANGLE_RAD>, <ANGLE_GRAD>, <TIME_MS>, <TIME_S>, <FREQ_HZ>, <FREQ_KHZ>, <DIMENSION>, <PERCENTAGE>, <NUMBER>, <FUNCTION>, <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [567:86] Error in style rule. Invalid token "opacity". Was expecting one of: "}", ";". 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning: null [567:86] Ignoring the following declarations in this rule. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler error WARNING: CSS error: null [572:159] Error in style rule. Invalid token "*". Was expecting one of: <S>, "}", ";", <IDENT>. 21.4.2010 23:25:24 com.gargoylesoftware.htmlunit.DefaultCssErrorHandler warning WARNING: CSS warning:

    Read the article

  • How to eliminate NULL fields in TSQL

    - by salvationishere
    I am developing a TSQL query in SSMS 2008 R2. I am trying to develop this query to identify one record / client. Because some of these values are NULL, I am currently doing LEFT JOINS on most of the tables. But the problem with the LEFT JOINs is that now I get 1 record for some clients. But if I change this to INNER JOINs then some clients are excluded entirely because they have NULL values for these columns. How do I limit the query result to just one record / client regardless of NULL values? And if there are non-NULL values then I want it to choose the record with non-NULL values. Here is some of my current output: group_profile_id profile_name license_number is_accepting is_accepting_placement managing_office region vendor_name vendor_id applicant_type Office Address status_description Cert Date2 race ethnicity_desc religion 9CD932F1-6BE1-4F80-AB81-0CE32C565BCF Atreides Foster Home 1 Atreides1 1 Yes Manchester, NH Gulf Atlantic Atreides1 00000007 Treatment Foster Home 4042 Arrakis Avenue, Springfield, VT 05156 Open/Re-opened 2011-06-01 00:00:00.000 NULL NULL NULL DCE354D5-A7CC-409F-B5A3-89BF664B7718 Averitte, Leon and Sandra 00000044 1 Yes Birmingham, AL Gulf Atlantic AL Averitte, Leon and Sandra 00000044 Treatment Foster Home 3816 5th Avenue, Bessemer, AL 35020, (205)482-4307 Open/Re-opened 2011-08-05 00:00:00.000 NULL NULL NULL DCE354D5-A7CC-409F-B5A3-89BF664B7718 Averitte, Leon and Sandra 00000044 1 Yes Birmingham, AL Gulf Atlantic AL Averitte, Leon and Sandra 00000044 Treatment Foster Home 3816 5th Avenue, Bessemer, AL 35020, (205)482-4307 Open/Re-opened 2011-08-05 00:00:00.000 Caucasian/White Non Hispanic NULL AD02A43C-6F38-4F35-8C9E-E12422690BFB Bass, Matthew and Sarah 00000076 1 Yes Jacks on, MS Central Gulf Coast MS Bass, Matthew and Sarah 00000076 Treatment Foster Home 506 Eagelwood Drive, Florence, MS 39073, (601)665-7169 Open/Re-opened 2011-04-01 00:00:00.000 NULL NULL NULL AD02A43C-6F38-4F35-8C9E-E12422690BFB Bass, Matthew and Sarah 00000076 1 Yes Jackson, MS Central Gulf Coast MS Bass, Matthew and Sarah 00000076 Treatment Foster Home 506 Eagelwood Drive, Florence, MS 39073, (601)665-7169 Open/Re-opened 2011-04-01 00:00:00.000 Caucasian/White NULL Baptist You can see that both Averitte and Bass profile names have one record with NULL race, ethnicity, religion. How do I eliminate these rows (rows 2 and 4)? Here is my query currently: select distinct gp.group_profile_id, gp.profile_name, gp.license_number, gp.is_accepting, case when gp.is_accepting = 1 then 'Yes' when gp.is_accepting = 0 then 'No ' end as is_accepting_placement, mo.profile_name as managing_office, regions.[region_description] as region, pv.vendor_name, pv.id as vendor_id, at.description as applicant_type, dbo.GetGroupAddress(gp.group_profile_id, null, 0) as [Office Address], gsv.status_description, ri.[description] as race, ethnicity.description as ethnicity_desc, religion.description as religion from group_profile gp With (NoLock) --Office Information inner join group_profile_type gpt With (NoLock) on gp.group_profile_type_id = gpt.group_profile_type_id and gpt.type_code = 'FOSTERHOME' and gp.agency_id = @agency_id and gp.is_deleted = 0 inner join group_profile mo With (NoLock) on gp.managing_office_id = mo.group_profile_id left outer join payor_vendor pv With (NoLock) on gp.payor_vendor_id = pv.payor_vendor_id left outer join applicant_type at With (NoLock) on gp.applicant_type_id = at.applicant_type_id and at.is_foster_home = 1 inner join group_status_view gsv With (NoLock) on gp.group_profile_id = gsv.group_profile_id and gsv.status_value = 'OPEN' and gsv.effective_date = (Select max(b.effective_date) from group_status_view b With (NoLock) where gp.group_profile_id = b.group_profile_id) left outer join regions With (NoLock) on isnull(mo.regions_id, gp.regions_id) = regions.regions_id left join enrollment en on en.group_profile_id = gp.group_profile_id join event_log el on el.event_log_id = en.event_log_id left join people client on client.people_id = el.people_id left join race With (NoLock) on el.people_id = race.people_id left join group_profile_race gpr with (nolock) on gpr.race_info_id = race.race_info_id left join race_info ri with (nolock) on ri.race_info_id = gpr.race_info_id left join ethnicity With(NoLock) On client.ethnicity = ethnicity.ethnicity_id left join religion on client.religion = religion.religion_id

    Read the article

  • DB Schema for ACL involving 3 subdomains

    - by blacktie24
    Hi, I am trying to design a database schema for a web app which has 3 subdomains: a) internal employees b) clients c) contractors. The users will be able to communicate with each other to some degree, and there may be some resources that overlap between them. Any thoughts about this schema? Really appreciate your time and thoughts on this. Cheers! -- -- Table structure for table locations CREATE TABLE IF NOT EXISTS locations ( id bigint(20) NOT NULL, name varchar(250) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Table structure for table privileges CREATE TABLE IF NOT EXISTS privileges ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, resource_id int(11) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=10 ; -- -- Table structure for table resources CREATE TABLE IF NOT EXISTS resources ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, user_type enum('internal','client','expert') NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Table structure for table roles CREATE TABLE IF NOT EXISTS roles ( id int(11) NOT NULL AUTO_INCREMENT, name varchar(255) NOT NULL, type enum('position','department') NOT NULL, parent_id int(11) DEFAULT NULL, user_type enum('internal','client','expert') NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ; -- -- Table structure for table role_perms CREATE TABLE IF NOT EXISTS role_perms ( id int(11) NOT NULL AUTO_INCREMENT, role_id int(11) NOT NULL, privilege_id int(11) NOT NULL, mode varchar(250) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Table structure for table users CREATE TABLE IF NOT EXISTS users ( id int(10) unsigned NOT NULL AUTO_INCREMENT, email varchar(255) NOT NULL, password varchar(255) NOT NULL, salt varchar(255) NOT NULL, type enum('internal','client','expert') NOT NULL, first_name varchar(255) NOT NULL, last_name varchar(255) NOT NULL, location_id int(11) NOT NULL, phone varchar(255) NOT NULL, status enum('active','inactive') NOT NULL DEFAULT 'active', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ; -- -- Table structure for table user_perms CREATE TABLE IF NOT EXISTS user_perms ( id int(11) NOT NULL AUTO_INCREMENT, user_id int(11) NOT NULL, privilege_id int(11) NOT NULL, mode varchar(250) NOT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ; -- -- Table structure for table user_roles CREATE TABLE IF NOT EXISTS user_roles ( id int(11) NOT NULL, user_id int(11) NOT NULL, role_id int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1;

    Read the article

  • Output a NULL cell value in Excel

    - by Peter
    I have an IF statement. If a cell = n, then do something, else output NULL =IF(A1=5, "Success", NULL) // #NAME? =IF(A1=5, "Success", "NULL") // NULL (as in text, not actually NULL!) =IF(A1=5, "Success", "") // blank but not NULL =IF(A1=5, "Success", 0) // zero value but not NULL

    Read the article

  • null != null - any ideas on how to re-arrange the code or prevent this?

    - by Alex
    Currently debugging, and found an if-statement which for no (I thought...) reason gave me an NPE, obviously for a reason. Which seemed to be that the statement turned out to be if(false && (null != null || null != Color)). if(destination != null && (destination.getPiece() != null || destination.getPiece().getColour() != pieceColour)) - the if-statement Both destination can be null and piece can be. The getColour() method returns an attribute of type Color from piece, which must be null if the piece is null. The piece at destination has a different pieceColour attribute then the one in the if-statement. Specifically, how do I re-arrange (destination.getPiece() != null) ?

    Read the article

  • Problem evaluating NULL in an IIF statement (Access)

    - by Mohgeroth
    Item in the recordset rstImportData("Flat Size") is = Null With that, given the following statement: IIF(IsNull(rstImportData("Flat Size")), Null, cstr(rstImportData("Flat Size"))) Result: Throws error 94: Invalid use of Null If I change the statement by removing the type conversion upon a false comparison: IIF(IsNull(rstImportData("Flat Size")), Null, 0) Result: Null It returns Null as it should have the first time. It appears that I cannot do a type conversion in an IIF if the value passed in should ever be null even if it passes an IIF test, it still attempts to evaluate it at both the true and false answer. The only reason I'm using IIF like this is because I have a 25 line comparison to compare data from an Import against a matching record in a database to see if I need to append the prior to history. Any thoughts? The way data is imported there will be null dates and where the spreadsheet import is in a string format I must convert either side to the other to compare the values properly but if either side is null this exception occurs :(

    Read the article

  • use .net webbrowser control by multithread, throw "EXCEPTION code=ACCESS_VIOLATION"

    - by user1507827
    i want to make a console program to monitor a webpage's htmlsourcecode, because some of the page content are created by some javescript, so i have to use webbrowser control. like : View Generated Source (After AJAX/JavaScript) in C# my code is below: public class WebProcessor { public string GeneratedSource; public string URL ; public DateTime beginTime; public DateTime endTime; public object GetGeneratedHTML(object url) { URL = url.ToString(); try { Thread[] t = new Thread[10]; for (int i = 0; i < 10; i++) { t[i] = new Thread(new ThreadStart(WebBrowserThread)); t[i].SetApartmentState(ApartmentState.STA); t[i].Name = "Thread" + i.ToString(); t[i].Start(); //t[i].Join(); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); } return GeneratedSource; } private void WebBrowserThread() { WebBrowser wb = new WebBrowser(); wb.ScriptErrorsSuppressed = true; wb.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler( wb_DocumentCompleted); while(true ) { beginTime = DateTime.Now; wb.Navigate(URL); while (wb.ReadyState != WebBrowserReadyState.Complete) { Thread.Sleep(new Random().Next(10,100)); Application.DoEvents(); } } //wb.Dispose(); } private void wb_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e) { WebBrowser wb = (WebBrowser)sender; if (wb.ReadyState == WebBrowserReadyState.Complete) { GeneratedSource= wb.Document.Body.InnerHtml; endTime = DateTime.Now; Console.WriteLine("WebBrowser " + (endTime-beginTime).Milliseconds + Thread.CurrentThread.Name + wb.Document.Title); } } } when it run, after a while (20-50 times), it throw the exception like this EXCEPTION code=ACCESS_VIOLATION (null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(nul l)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(n ull)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null) (null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(null)(nul l)(null)BACKTRACE: 33 stack frames: #0 0x083dba8db0 at MatchExactGetIDsOfNames in mshtml.dll #1 0x0879f9b837 at StrongNameErrorInfo in mscorwks.dll #2 0x0879f9b8e3 at StrongNameErrorInfo in mscorwks.dll #3 0x0879f9b93a at StrongNameErrorInfo in mscorwks.dll #4 0x0879f9b9e0 at StrongNameErrorInfo in mscorwks.dll #5 0x0879f9b677 at StrongNameErrorInfo in mscorwks.dll #6 0x0879f9b785 at StrongNameErrorInfo in mscorwks.dll #7 0x0879f192a8 at InstallCustomModule in mscorwks.dll #8 0x0879f19444 at InstallCustomModule in mscorwks.dll #9 0x0879f194ab at InstallCustomModule in mscorwks.dll #10 0x0879fa6491 at StrongNameErrorInfo in mscorwks.dll #11 0x0879f44bcf at DllGetClassObjectInternal in mscorwks.dll #12 0x089bbafa at in #13 0x087b18cc10 at in System.Windows.Forms.ni.dll #14 0x087b91f4c1 at in System.Windows.Forms.ni.dll #15 0x08d00669 at in #16 0x08792d6e46 at in mscorlib.ni.dll #17 0x08792e02cf at in mscorlib.ni.dll #18 0x08792d6dc4 at in mscorlib.ni.dll #19 0x0879e71b4c at in mscorwks.dll #20 0x0879e896ce at in mscorwks.dll #21 0x0879e96ea9 at CoUninitializeEE in mscorwks.dll #22 0x0879e96edc at CoUninitializeEE in mscorwks.dll #23 0x0879e96efa at CoUninitializeEE in mscorwks.dll #24 0x0879f88357 at GetPrivateContextsPerfCounters in mscorwks.dll #25 0x0879e9cc8f at CoUninitializeEE in mscorwks.dll #26 0x0879e9cc2b at CoUninitializeEE in mscorwks.dll #27 0x0879e9cb51 at CoUninitializeEE in mscorwks.dll #28 0x0879e9ccdd at CoUninitializeEE in mscorwks.dll #29 0x0879f88128 at GetPrivateContextsPerfCounters in mscorwks.dll #30 0x0879f88202 at GetPrivateContextsPerfCounters in mscorwks.dll #31 0x0879f0e255 at InstallCustomModule in mscorwks.dll #32 0x087c80b729 at GetModuleFileNameA in KERNEL32.dll i have try lots of methods to solve the problem, finally, i found that if i thread sleep more millseconds, it will run for a longer time, but the exception is still throw. hope somebody give me the answer of how to slove ... thanks very much !!!

    Read the article

  • converting mysql database to sql server

    - by every_answer_gets_a_point
    i have a mysql database: /* MySQL Data Transfer Source Host: 10.0.0.5 Source Database: jnetdata Target Host: 10.0.0.5 Target Database: jnetdata Date: 5/26/2009 12:27:33 PM */ SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- Table structure for chavrusas -- ---------------------------- CREATE TABLE `chavrusas` ( `id` int(11) NOT NULL auto_increment, `date_created` datetime default NULL, `luser_id` int(11) default NULL, `ruser_id` int(11) default NULL, `luser_type` varchar(50) default NULL, `ruser_type` varchar(50) default NULL, `SessionDay` varchar(250) default NULL, `SessionTime` datetime default NULL, `WeeklyReminder` tinyint(1) NOT NULL default '0', `reminder_phone` tinyint(1) NOT NULL default '0', `calling_card` varchar(50) default NULL, `active` tinyint(1) NOT NULL default '0', `notes` mediumtext, `ended` tinyint(1) NOT NULL default '0', `end_date` datetime default NULL, `initiated_by_student` tinyint(1) NOT NULL default '0', `initiated_by_volunteer` tinyint(1) NOT NULL default '0', `student_general_reason` varchar(50) default NULL, `volunteer_general_reason` varchar(50) default NULL, `student_reason` varchar(250) default NULL, `volunteer_reason` varchar(250) default NULL, `student_nli` tinyint(1) NOT NULL default '0', `volunteer_nli` tinyint(1) NOT NULL default '0', `jnet_initiated` tinyint(1) default '0', `belongs_to` varchar(50) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=5913 DEFAULT CHARSET=latin1; -- ---------------------------- -- Table structure for tbluseravailability -- ---------------------------- CREATE TABLE `tbluseravailability` ( `availability_id` int(11) NOT NULL auto_increment, `user_id` int(11) NOT NULL, `weekday_id` int(11) NOT NULL, `timeslot_id` int(11) NOT NULL, PRIMARY KEY (`availability_id`) ) ENGINE=MyISAM AUTO_INCREMENT=10865 DEFAULT CHARSET=latin1; -- ---------------------------- -- Table structure for tblusers -- ---------------------------- CREATE TABLE `tblusers` ( `id` int(11) NOT NULL auto_increment, `password` varchar(50) default NULL, `title` varchar(255) default NULL, `first` varchar(255) default NULL, `last` varchar(255) default NULL, `gender` varchar(255) default NULL, `address` varchar(255) default NULL, `address_2` varchar(255) default NULL, `city` varchar(255) default NULL, `state` varchar(255) default NULL, `postcode` varchar(255) default NULL, `country` varchar(255) default NULL, `email` varchar(255) default NULL, `emailnotes` varchar(255) default NULL, `Home_Phone` varchar(255) default NULL, `Office_Phone` varchar(255) default NULL, `Cell_Phone` varchar(255) default NULL, `Contact_Preference` varchar(255) default NULL, `Birthdate` datetime default NULL, `Age` varchar(255 and it goes on for about 10mb i need to convert it to ms sql, how do i do it?

    Read the article

  • How to set arrayList size as null?

    - by Jessy
    String a []= {null,null,null,null,null}; //add array to arraylist ArrayList<Object> choice = new ArrayList<Object>(Arrays.asList(a)); System.out.println(choice.size()); Why the size of the arrayList choice is 5 when all the elements have been set to null

    Read the article

  • SQL SERVER – Validating Spatial Object as NULL using IsNULL

    - by pinaldave
    Follow up questions are the most fun part of writing a blog post. Earlier I wrote about SQL SERVER – Validating Spatial Object with IsValidDetailed Function and today I received a follow up question on the same subject. The question was mainly about how NULL is handled by spatial functions. Well, NULL is NULL. It is very easy to work with NULL. There are two different ways to validate if the passed in the value is NULL or not. 1) Using IsNULL Function IsNULL function validates if the object is null or not, if object is not null it will return you value 0 and if object is NULL it will return you the value NULL. DECLARE @p GEOMETRY = 'Polygon((2 2, 3 3, 4 4, 5 5, 6 6, 2 2))' SELECT @p.ISNULL ObjIsNull GO DECLARE @p GEOMETRY = NULL SELECT @p.ISNULL ObjIsNull GO 2) Using IsValidDetailed Function IsValidateDetails function validates if the object is valid or not. If the object is valid it will return 24400: Valid but if the object is not valid it will give message with the error number. In case object is NULL it will return the value as NULL. DECLARE @p GEOMETRY = 'Polygon((2 2, 3 3, 4 4, 5 5, 6 6, 2 2))' SELECT @p.IsValidDetailed() IsValid GO DECLARE @p GEOMETRY = NULL SELECT @p.IsValidDetailed() IsValid GO When to use what? Now you can see that there are two different ways to validate the NULL values. I personally have no preference about using one over another. However, there is one clear difference between them. In case of the IsValidDetailed Function the return value is nvarchar(max) and it is not always possible to compare the value with nvarchar(max). Whereas the ISNULL function returns the bit value of 0 when the object is null and it is easy to determine if the object is null or not in the case of ISNULL function. Additionally, ISNULL function does not check if the object is valid or not and will return the value 0 if the object is not NULL. Now you know even though either of the function can be used in place of each other both have very specific use case. Use the one which fits your business case. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: PostADay, SQL, SQL Authority, SQL Function, SQL Query, SQL Server, SQL Tips and Tricks, T SQL, Technology Tagged: Spatial Database, SQL Spatial

    Read the article

  • C++ segmentation error when first parameter is null in comparison operator overload

    - by user1774515
    I am writing a class called Word, that handles a c string and overloads the <, , <=, = operators. word.h: friend bool operator<(const Word &a, const Word &b); word.cc: bool operator<(const Word &a, const Word &b) { if(a == NULL && b == NULL) return false; if(a == NULL) return true; if(b == NULL) return false; return a.wd < b.wd; //wd is a valid c string } main: char* temp = NULL; //EDIT: i was mistaken, temp is a char pointer Word a("blah"); //a.wd = [b,l,a,h] cout << (temp<a); i get a segmentation error before the first line of the operator< method after the last line in the main. I can correct the problem by writing cout << (a>temp); where the operator> is similarly defined and i get no errors. but my assignment requires (temp < a) to work so this is where i ask for help. EDIT: i made a mistake the first time and i said temp was of type Word, but it is actually of type char*. so i assume that the compiler converts temp to a Word using one of my constructors. i dont know which one it would use and why this would work since the first parameter is not Word. here is the constructor i think is being used to make the Word using temp: Word::Word(char* c, char* delimeters=NULL) { char *temporary = "\0"; if(c == NULL) c = temporary; check(stoppers!=NULL, "(Word(char*,char*))NULL pointer"); //exits the program if the expression is false if(strlen(c) == 0) size = DEFAULT_SIZE; //10 else size = strlen(c) + 1 + DEFAULT_SIZE; wd = new char[size]; check(wd!=NULL, "Word(char*,char*))heap overflow"); delimiters = new char[strlen(stoppers) + 1]; //EDIT: changed to [] check(delimiters!=NULL,"Word(char*,char*))heap overflow"); strcpy(wd,c); strcpy(delimiters,stoppers); count = strlen(wd); } wd is of type char* thanks for looking at this big question and trying to help. let me know if you need more code to look at

    Read the article

  • Dereferencing the null pointer

    - by zilgo
    The standard says that dereferencing the null pointer leads to undefined behaviour. But what is "the null pointer"? In the following code, what we call "the null pointer": struct X { static X* get() { return reinterpret_cast<X*>(1); } void f() { } }; int main() { X* x = 0; (*x).f(); // the null pointer? (1) x = X::get(); (*x).f(); // the null pointer? (2) x = reinterpret_cast<X*>( X::get() - X::get() ); (*x).f(); // the null pointer? (3) (*(X*)0).f(); // I think that this the only null pointer here (4) } My thought is that dereferencing of the null pointer takes place only in the last case. Am I right? Is there difference between compile time null pointers and runtime according to C++ Standard?

    Read the article

  • sql query where parameters null not null

    - by Laziale
    I am trying to do a sql query and to build the where condition dynamically depending if the parameters are null or no. I have something like this: SELECT tblOrder.ProdOrder, tblOrder.Customer FROM tblOrder CASE WHEN @OrderId IS NOT NULL THEN WHERE tblOrder.OrderId = @OrderId ELSE END CASE WHEN @OrderCustomer IS NOT NULL THEN AND tblOrder.OrderCustomer = @OrderCustomer ELSE END END This doesn't work, but this is just a small prototype how to assemble the query, so if the orderid is not null include in the where clause, or if the ordercustomer is not null include in the where clause. But I see problem here, for example if the ordercustomer is not null but the orderid is null, there will be error because the where keyword is not included. Any advice how I can tackle this problem. Thanks in advance, Laziale

    Read the article

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