Daily Archives

Articles indexed Sunday May 2 2010

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

  • Sql Server XML-type column duplicate entry detection

    - by aaaa bbbb
    In Sql Server I am using an XML type column to store a message. I do not want to store duplicate messages. I only will have a few messages per user. I am currently querying the table for these messages, converting the XML to string in my C# code. I then compare the strings with what I am about to insert. Unfortunately, Sql Server pretty-prints the data in the XML typed fields. What you store into the database is not necessarily exactly the same string as what you get back out later. It is functionally equivalent, but may have white space removed, etc. Is there an efficient way to compare an XML string that I am considering inserting with those that are already in the database? As an aside, if I detect a duplicate I need to delete the older message then insert the replacement.

    Read the article

  • Linq To Sql Entity Updated from Trigger

    - by James Helms
    I have a Table called Address. I have a Trigger for insert on that table that does some spacial calculations on the address that determines what neighborhood boundaries it is in. address = new Address { Street = this.Street, City = this.City, State = this.State, ZipCode = this.ZipCode, latitude = this.Latitude, longitude = this.Longitude, YearBuilt = this.YearBuilt, LotSize = this.LotSize, FinishedSize = this.FinishedSize, Bedrooms = this.Bedrooms, Bathrooms = this.Bathrooms, UseCode = this.UseCode, HOA = this.HOA, UpdateDate = DateTime.Now }; db.AddToAddresses(address); db.SaveChanges(); In the database i can clearly see that the Trigger ran and updated the neighborhoodID in the address table for the row. I tried to just reload that record to get the assigned id like this: address = (from a in db.Addresses where a.AddressID == address.AddressID select a).First(); In the debugger i can clearly see that the address.AddressID is correct, entity doesn't update in memory. Is there any work around for this?

    Read the article

  • Error in requiring Sinatra gem

    - by Dan
    I'm having a hard time getting Sinatra running on my local setup, Ubuntu Karmic 9.10. The error getting thrown when I have require 'sinatra' is: NoMethodError: undefined method `[]' for nil:NilClass from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:891:in `compile' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:883:in `gsub' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:883:in `compile' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:856:in `route' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:838:in `get' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:1077 from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:929:in `configure' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra/base.rb:1076 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/local/lib/ruby/gems/1.8/gems/sinatra-1.0/lib/sinatra.rb:4 from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require' from (irb):2 from :0 I've tried: Uninstalling/reinstalling Sinatra Updating all gems Ensuring all dependencies exist (rack) Any ideas? Your time and help is greatly appreciated!

    Read the article

  • Winforms - Visually remove button click event

    - by Wayne Koorts
    .NET newbie alert Using Visual C# 2008 Express Edition I have accidentally created a click event for a button. I then deleted the automatically-created method code, which resulted in an error saying that the function, which had now been referenced in the form loading code, could no longer be found. Deleting the following line from the Form1.Designer.cs file's InitializeComponent() function... this.btnCopy.Click += new System.EventHandler(this.btnCopy_Click); ... seems to do the trick, however, it makes me feel very dirty because of the following warning at the beginning of the #region: /// Required method for Designer support - do not modify /// the contents of this method with the code editor. I haven't been able to find a way to do this using the form designer, which I assume is the means implied by this warning. What is the correct way to do this?

    Read the article

  • Which Cortex-M3 interrupts can I use for general purpose work?

    - by Captain NedD
    I'd have some code that needs to be run as the result of a particular interrupt going off. I don't want to execute it in the context of the interrupt itself but I also don't want it to execute in thread mode. I would like to run it at a priority that's lower than the high level interrupt that precipitated its running but also a priority that higher than thread level (and some other interrupts as well). I think I need to use one of the other interrupt handlers. Which ones are the best to use and what the best way to invoke them? At the moment I'm planning on just using the interrupt handlers for some peripherals that I'm not using and invoking them by setting bits directly through the NVIC but I was hoping there's a better, more official way. Thanks,

    Read the article

  • JBoss RMI Transaction

    - by EasyName
    Hi, How can i can achieve remote transaction while using Remote EJB (over RMI/IIOP or RMI/JRMP). Is that JBoss 4.0 support this kind of transaction or should i use jotm or atomikos? Thanks in advance

    Read the article

  • Flash builder 4 - change output filename using external build-config.xml (not Ant)

    - by Casey
    I'm trying to change the output filename with a config file loaded via the compiler option -load-config. It looks like this in my compiler arguments: -load-config+=build-config.xml. I've tried the following: <flex-config> <o>absolute/path/to/filename</o> </flex-config> and <flex-config> <output>absolute/path/to/filename</output> </flex-config> and <flex-config> <compiler> <o>absolute/path/to/filename</o> </compiler> </flex-config> and <flex-config> <compiler> <output>absolute/path/to/filename</output> </compiler> </flex-config> but none have worked. I'm on a PC using Flash Builder 4. Has anyone else done this? Also, ideally, I want to use a relative path instead of absolute. I can't get this to work either, even if I do so in the "additional compiler arguments" field of the Project configuration. Thanks in advance!

    Read the article

  • Access DLL without instantiating

    - by user330635
    I wrote a simple dll with only 2 functions in it. Is there a way to access these functions without having to instantiate them on every page? Can't I add them to the web.config somehow as assemblies thus giving me access to them?

    Read the article

  • Why doesn't this for-loop execute?

    - by Maulrus
    I'm writing a program for an exercise that will read data from a file and format it to be readable. So far, I have a bit of code that will separate a header from the data that goes under it. Here it is: int main() { ifstream in("records.txt"); ofstream out("formatted_records.txt"); vector<string> temp; vector<string> headers; for (int i = 0; getline(in,temp[i]); ++i) { static int k = -1; if (str_isalpha(temp[i])) { headers[++k] = temp[i]; temp.erase(temp.begin() + i); } else { temp[i] += "," + headers[k]; } } } (str_isalpha() is just a function that applies isalpha() to every character in a string.) Now, the for-loop in this program doesn't execute, and I can't figure out why. Does anybody know?

    Read the article

  • Database Design: A proper table design for large number of column values.

    - by Jake
    I wish to perform an experiment many different times. After every trial, I am left with a "large" set of output statistics -- let's say, 1000. I would like to store the outputs of my experiments in a table, but what's the best way...? Option 1 Have a table with 1000 columns. Seems like a bad idea. What if the number of statistics one day exceeds the maximum number of columns? Option 2 Have a table with three columns. Let's say, ID, StatisticType, and StatisticValue. That way, you can have as many statistics as you want. However, reading a single experiments statistics becomes more complicated. Moreover, what if different statistics are different data types?? Any suggestions?

    Read the article

  • How should I handle searching through byte arrays in Java?

    - by Zombies
    Preliminary: I am writting my own httpclient in Java. I am trying to parse out the contents of chunked encoding. Here is my dilema: Since I am trying to parse out chunked http transfer encoding with a gzip payload there is a mix of ascii and binary. I can't just take the http resp content and convert it to a string and make use of StringUtils since the binary data can easily contain nil characters. So what I need to do is some basic things for parsing out each chunk and its chunk length (as per chunked transfer/HTTP/1.1 spec). Are there any helpful ways of searching through byte arrays of binary/part ascii data for certain patterns (like a CR LF) (instead of just a single byte) ? Or must I write the for loops for this?

    Read the article

  • Unable to authenticate to Windows Server 2003 for file browsing as non-administrator user.

    - by Fopedush
    I've got a windows server 2003 box containing a raid 5 array I use for mass storage. I want to set up a special non-administrator account that can be used to browse files over the network, with only read access. Ideally I'll map my network drive as this user to avoid accidentally hosing my data, and mount as an administrator user on occasions where I actually need write access. I've created a non-administrator user on the Windows Server box (called "ReadOnly)", and granted the user read permissions on the folders I need. However, when I try to browse to the files, and authenticate as this user, I'm told "Permission denied". If I throw the readOnly user into the administrators group, however, I can authenticate and browse just fine. I am, of course, only attempting to browse to folder for which I have given this user read permissions. Obviously my ReadOnly user is missing some privilege here, but I can't figure out what it is. I've been digging around in group policy editor all day to no avail. What am I missing? Fake Edit: I'm doing my browsing from a Windows 7 box, but I don't think that is relevant.

    Read the article

  • C++ vs Matlab vs Python as a main language for Computer Vision Research

    - by Hough
    Hi all, Firstly, sorry for a somewhat long question but I think that many people are in the same situation as me and hopefully they can also gain some benefit from this. I'll be starting my PhD very soon which involves the fields of computer vision, pattern recognition and machine learning. Currently, I'm using opencv (2.1) C++ interface and I especially like its powerful Mat class and the overloaded operations available for matrix and image operations and seamless transformations. I've also tried (and implemented many small vision projects) using opencv python interface (new bindings; opencv 2.1) and I really enjoy python's ability to integrate opencv, numpy, scipy and matplotlib. But recently, I went back to opencv C++ interface because I felt that the official python new bindings were not stable enough and no overloaded operations are available for matrices and images, not to mention the lack of machine learning modules and slow speeds in certain operations. I've also used Matlab extensively in the past and although I've used mex files and other means to speed up the program, I just felt that Matlab's performance was inadequate for real-time vision tasks, be it for fast prototyping or not. When the project becomes larger and larger, many tasks have to be re-written in C and compiled into Mex files increasingly and Matlab becomes nothing more than a glue language. Here comes the sub-questions: For carrying out research in these fields (machine learning, vision, pattern recognition), what is your main or ideal programming language for rapid prototyping of ideas and testing algorithms contained in papers? For computer vision research work, can you list down the pros and cons of using the following languages? C++ (with opencv + gsl + svmlib + other libraries) vs Matlab (with all its toolboxes) vs python (with the imcomplete opencv bindings + numpy + scipy + matplotlib). Are there computer vision PhD/postgrad students here who are using only C++ (with all its availabe libraries including opencv) without even needing to resort to Matlab or python? In other words, given the current existing computer vision or machine learning libraries, is C++ alone sufficient for fast prototyping of ideas? If you're currently using Java or C# for your research, can you list down the reasons why they should be used and how they compare to other languages in terms of available libraries? What is the de facto vision/machine learning programming language and its associated libraries used in your research group? Thanks in advance. Edit: As suggested, I've opened the question to both academic and non-academic computer vision/machine learning/pattern recognition researchers and groups.

    Read the article

  • I didn't say anything treasonous, quit putting words in my mouth

    - by You guys Lie
    Where at all did I say ANYTHING about organizing some kind of anti-government activity? Nowhere. I do not give a flying fuck about America in case you hadn't realized, I'm talking about what I'm going to do when Jesus Christ returns. Besides, why would I make it easy for them to throw me in a black site prison? Use common sense, sheeple. In the end I guess it doesn't matter anyways, since I do not recognize the government as my ultimate authority. Police/Army/Whatever-- funny outfits and a shiny badge don't make you better than me. Allah will do away with your kind. However, as long as they're with me (as they semi-currently are), we have no problems. I fear the government will have other plans to control the population when things start to further decline, and that is when they will run into problems with me and mine, and probably a large percentage of the public. You'd have to be a fucking fool to think we'd fall into anarchy immediately, given the vast resources and blind loyalty of this country. Saying there are practical limits to free speech for anything I have said in this thread is not only ignorant, it is unpatriotic. I should be being celebrated as the modern day Paul Revere for warning you people about our impending doom. You would do well to study the foundations of this country. Nothing I have said is treasonous at all. Besides, the DoD knows I'm harmless until shit pops off, they have bigger fish to fry right now, go forward. Keep in mind, I don't personally have to do anything to overthrow the government. I just said, I would not advocate for any paramilitary organizations at this time, only if/after we dissolve into (more) tyranny. I am not a terrorist, like some soldiers in Iraq. The machine is doing a great job of ruining itself, while I get to comfortably laugh at it on the nightly news knowing that I'm ready for it to shut down.

    Read the article

  • Convert SVN Subdirectory to Git

    - by magneticMonster
    I would like to ditch SVN for Git. My current SVN repository setup has projects under trunk (/trunk/projecta, /trunk/projectb, etc. with tags and branches at /tags/projecta-1.0, etc.). I would like to create distinct Git repos for each of these projects by pulling them out of SVN using git-svn. I've successfully pulled the entire SVN repo down to a local Git repo but all of the projects exist in the same Git repo now. Is it possible to pull them apart at this point?

    Read the article

  • How can I search for a text and fill/click on a link with Selenium?

    - by Shady
    Here's the deal: Is there a way to search for an input name or type witch is not precise and fill it? For example, I want to fill any input with the name email with my email, but I maybe have some inputs named email-123, emailemail, emails etc... Is there a way to do something like * email * ? And how can I click on a link verifying some text that could be on the link, or above the link, or close, or at class etc ? ps: I'm using selenium ide with firefox

    Read the article

  • Problems with show hide jquery

    - by Michael
    I am trying to get show hide to work on multiple objects but I am unable to get it to work. Any help would be nice an much appreciated... I am lost on how to do this. If I only do one show hide it works fine but more than one it does not work properly. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Show Hide Sample</title> <script src="js/jquery.js" type="text/javascript"></script> <script type="text/javascript"> $(document).ready(function(){ $('#content1').hide(); $('a').click(function(){ $('#content1').show('slow'); }); $('a#close').click(function(){ $('#content1').hide('slow'); }) }); </script> <style> body{font-size:12px; font-family:"Trebuchet MS"; background: #CCF} #content1{ border:1px solid #DDDDDD; padding:10px; margin-top:5px; width:300px; } </style> </head> <body> <a href="#" id="click">Test 1</a> <div class="box"> <div id="content1"> <h1 align="center">Hide 1</h1> <P> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pulvinar, enim ac hendrerit mattis, lorem mauris vestibulum tellus, nec porttitor diam nunc tempor dui. Aenean orci. Sed tempor diam eget tortor. Maecenas quis lorem. Nullam semper. Fusce adipiscing tellus non enim volutpat malesuada. Cras urna. Vivamus massa metus, tempus et, fermentum et, aliquet accumsan, lectus. Maecenas iaculis elit eget ipsum cursus lacinia. Mauris pulvinar.</p> <p><a href="#" id="close">Close</a></p> </div> </div> <a href="#" id="click">Test 2</a> <div class="box"> <div id="content1"> <h1 align="center">Hide 2</h1> <p> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam pulvinar, enim ac hendrerit mattis, lorem mauris vestibulum tellus, nec porttitor diam nunc tempor dui. Aenean orci. Sed tempor diam eget tortor. Maecenas quis lorem. Nullam semper. Fusce adipiscing tellus non enim volutpat malesuada. Cras urna. Vivamus massa metus, tempus et, fermentum et, aliquet accumsan, lectus. Maecenas iaculis elit eget ipsum cursus lacinia. Mauris pulvinar.</p> <p><a href="#" id="close">Close</a></p> </div> </div> </body> </html>

    Read the article

  • Outlook 2007 - slow loading messages, etc

    - by studiohack
    Outlook 2007 is slow to load messages...Why is this, and what can I do to speed it up? Currently have about 850 messages in the Inbox folder, and the preview pane turned off, thus I view messages by double-clicking. This is where it gets slow, when I double click, it brings up a new window with everything but the actual message loaded. Solutions? Thanks! (running Windows 7)

    Read the article

  • SQL SERVER – The Difference between Dual Core vs. Core 2 Duo

    - by pinaldave
    I have decided that I would not write on this subject until I have received a total of 25 questions on this subject. Here are a few questions from the list: Questions: What is the difference between Dual Core and Core 2 Duo? Which one is recommended for SQL Server: Core 2 Duo or Dual Core? Can I upgrade my Dual Core to Core 2 Duo? If Dual Core has 2 CPUs, how many CPUs does Core 2 Duo have? Is it true that Core 2 Duo and Dual Core meant the same thing? Well, let us see the answer. Optimistically, I would be directing everybody to this blog post if I receive a question of the same kind sometime in the future. To verify the information that I provide, visit Intel’s site. For additional information regarding the subject, visit Wikipedia. My Answer: Any computer that has two CPUs or two “cores“ is known as Dual Core. Core Duo is a brand name of Intel for Dual Core. Core 2 Duo is simply a higher version of Core Duo. (e.g. for Pentium brand, it`s like Pentium I, Pentium II, etc.) The computer I am using now has Core 2 Duo. Intel has launched a new brand, which they call i3, i5, and i7.  Here, the numbers are not related to the number of cores; rather, they show the range of the CPU. I3 is of low range and i7 is of high range. Feel free to add more details by adding valuable comments here. And if you still want to ask why I created this blog post, well, I mentioned that I was waiting for 25 questions threshold to hit, before I write about this subject which I didn`t really plan to write about. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology

    Read the article

  • Python grab class in class definition.

    - by epochwolf
    I don't even know how to explain this, so here is the code I'm trying. class Test: type = self.__name__ #self doesn't work, how do I get a reference to Test? class Test2(Test): pass #Test2.type should return "Test2" The reason I'm even trying this is I'm working on creating a base class for an orm I'm using. I want to avoid defining the table name for every model I have. Also knowing what the limits of python is will help me avoid wasting time trying impossible things.

    Read the article

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