Daily Archives

Articles indexed Sunday May 23 2010

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

  • Using unless in rails uniqueness validation

    - by dunxd
    I am just starting out in Rails, and trying to develop a simple application. I need to validate three values submitted to the application - each must meet the same validation criteria. The validation is pretty simple: Value is valid if unqiue, null or equal to "p" or "d". The following gets me halfway there: validates_uniqueness_of :value1, :value2, :value3, :allow_nil => true I think I can use :unless to check whether the value is either "p" or "d", however I can't figure out how. I guess I am trying to combine validates_uniqueness_of with validates_inclusion_of. Any suggestions?

    Read the article

  • Rails Atom builder xml.tag!("activity:object-type") error

    - by Anup
    I am creating a activity stream of my feeds according to the http://activitystrea.ms standard. I am using rails atom builder to create a valid atom feed, but when I use xml.tag!("activity:object-type", "http://activitystrea.ms/schema/1.0/person") the atom feed goes blank.On seeing the source I find the correct xml format from what I have found out the ":object" is giving the problem.

    Read the article

  • How do i set up a fully featured small business network?

    - by JoshReedSchramm
    This has the possibility to be a very large question but I recently acquired a few rack mount servers and the hardware necessary to run them. Unfortunately I'm a programmer with very little understanding of how to set up a good working network so I'm hoping someone on here might be able to help. What I want to do is run a domain with a series of subdomains which would all be externally accessible. The setup would live inside my home and my internet connection is your run of the mill cable model (which means a dynamic IP) I want to be able to set up a couple site, specifically: www.mycompany.com (mycompany.com with no subdomain would redirect to this) build.mycompany.com (for my continuous integration server) ruby.mycompany.com (for ruby projects) win.mycompany.com (for windows project) etc. Additionally this is still my home network so our personal machines need to be able to get on via wifi with at least the same security we have now through an out of the box router from best buy. I'm thinking i need a DNS server, DHCP server and one of those would run either no-ip or dyndns to accommodate the dynamic ip. I don't necessarily need mail but it might be helpful to have some sort of mail server i could use for testing, it doesn't need to get out to the greater internet though. So how do i set up this kinda of network? tl;dr Need to know how to set up your standard office style network in my home off my normal consumer level cable modem connection.

    Read the article

  • How to set default web browser

    - by Nrew
    I'm really annoyed when I uninstall a program and then it opens up internet explorer. Can I change this to a portable web browser?Or even prevent the uninstalled program to open up a web browser.

    Read the article

  • SQLAuthority News – Virtual Launch Event for Office 2010 – Contest – Win MS Office License

    - by pinaldave
    Office products are integral products of any PC. I accept that without Office Suites, I can not survive or make enough leaving. I am blogger and use word to create my blogs. I am SQL Server Trainer  and I use PowerPoint as my presentation tool. I am SQL Server consultant and I use Excel to keep my work log. I can not see my life with Office Tools. Just like any other Microsoft Product there is strong community following Office Tools. Please count me in. The same community is hosting a Virtual Launch Event for Office 2010 on May 25 and 26th. The webcasts is FREE to attend and people can take part either online or by going to the nearest available center. The sessions will be delivered by MVPs. To register please visit: http://www.meraoffice.com. In June, limited cities will be hosting Community Launch Events for Office 2010. At the launch events, attendees will get to see Office 2010 in action and learn how to do their work better with Office 2010.  The details are available on http://office.merawindows.com. To support one of the largest community, I am announcing one contents. It is very easy to take part in the contest. You just have to answer one very simple question. Contest: Choose best option: With which Microsoft Office Product Powerpivot is associated? Options: 1) PowerPoint 2) Excel 3) Word Hint: http://search.sqlauthority.com Rules: Winner will be awarded 1 Office 2007 Home and Student. This will be freely upgradeable to Office 2010 once it releases in June. The winners will be sent emails and they will redeem their awards via microsoftstore.co.in The prizes can only be shipped to India and Indian residents are eligible. Winner will be selected by selected community leaders and MVPs at their sole discretion. Winner will be informed by email about the award. Most creative and informative comment will win the contest. Please spread the words about this contest. SQLAuthority.com will also send SQL Server book to the person who generates the most traffic to this blog post using Twitter, Facebook and other social media. This competition is also open to Indian residents only. I will measure the traffic using my wordpress.com stats plugin. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority News, T SQL, Technology Tagged: Office

    Read the article

  • rails update whole index of a model with one click

    - by mattherick
    hello! i have a store model, this will handle my leaflet and my shoppingcart for my shop. now i d´like to show all items added from an user to his leaflet in the index of store. in the store an user can change the quantity of the choosen items. and now i want to save that the changes of the different quantities in the database with one click on a button "update store". so how could i implement an update over the whole index with one click? i´d like to do this with ajax and most dynamically. somebody has an idea? i render all items into a form so far, but now i have the problem, when i submit this form only the last quantity and item id are included in the params. further i pushed every quantity into an array and i want to submit this also as a param. but i could not. please give me some tips, will be very fine :) mattherick

    Read the article

  • WPF validation red border doesn't show If UserControl collapsed first

    - by Creepy Gnome
    There seems to be a bug with WPF in 3.5, and I was hoping someone may have found a workaround. Basically if you have a custom UserControl that contains a TextBox and it is in a Window but initialized to be Collapsed by default in the xaml or code behind if it fails validation when you make the control visible it will not show the red border until it fails while visible. However, this works correctly when visibility is set to Hidden, just no when Collapsed. I am already overriding the ErrorTemplate with a style to workaround the Adornment issue with the red border staying visibile when you collapse the control. Below is my full style for the TextBox. If there is any additional changes or additions to make it work correctly with collapsed controls that would be great. <Style TargetType="TextBox"> <Setter Property="Margin" Value="3" /> <Setter Property="Validation.ErrorTemplate"> <Setter.Value> <ControlTemplate> <ControlTemplate.Resources> <BooleanToVisibilityConverter x:Key="converter" /> </ControlTemplate.Resources> <DockPanel LastChildFill="True"> <Border BorderThickness="2" BorderBrush="Red" Visibility="{ Binding ElementName=placeholder, Mode=OneWay, Path=AdornedElement.IsVisible, Converter={StaticResource converter}}" > <AdornedElementPlaceholder x:Name="placeholder" /> </Border> </DockPanel> </ControlTemplate> </Setter.Value> </Setter> <Style.Triggers> <Trigger Property="Validation.HasError" Value="true" > <Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource Self}, Path=(Validation.Errors)[0].ErrorContent}" /> </Trigger> </Style.Triggers> </Style>

    Read the article

  • How do i get the reg string from the handle integer?

    - by Tom
    Hi, ive got the reg handles (as ints) being outputted, but i need to convert this to the HKLM/bla/bla.... I know that the 5 Root Keys are 0x80000000Y where Y is a value from 0 to 4, but i'm also getting much smaller values which represent nodes lower down in the registry leaves.

    Read the article

  • Doing a SetLength on an array passed into a proc by reference

    - by csharpdefector
    Hi All, Sure, even I can do this... var testarray : array of string; setlength(testarray, 5); but if I want to get clever and have a procedure into which I pass the array by referance like this I cant do it! procedure DoStuffWithArray(var passedarray : array of string); begin setlength(passedarray, 5); end; compiler says 'incompatible types' on the single line of code in my proc. I can do other stuff on the array like set set element values if i do a setlength before i call the proc, but I cannot do the setlength in my proc, which is what I want to do. Any help much appreciated, thanks all.

    Read the article

  • Good Perlin noise resources/implementation?

    - by Chumpy
    Are there any good resources out there detailing Perlin noise generation? I understand that most languages have noise generating libraries available, but I'm interested in creating my own for fun/experience. I've already looked at this, which seems pretty popular, but it only gives an in-depth explanation of one dimensional noise. Google searches have been relatively unhelpful so far, as most of them focus on applications instead of how to create a generator. Books and/or websites are welcome, even if their focus is not the generation itself so long as it gives a thorough explanation of an implementation, or at least the concepts involved so I can "discover" my own.

    Read the article

  • How to unit test chrome extensions?

    - by swampsjohn
    Is there a good way to do this? I'm writing an extension that interacts with a website as a content script and saves data using localstorage. Are there any tools, frameworks, etc. that I can use to test this behavior? I realize there are some generic tools for testing javascript, but are those sufficiently power to test an extension?

    Read the article

  • Microsoft Sponsored - Give Camp

    - by Ken Lovely, MCSE, MCDBA, MCTS
    Are you ready to connect with the local tech community for a good cause? GiveCamp needs your support. For one weekend in June, we’ll take on the technology wish lists of 20 non-profit organizations, and we’re looking for about 100 volunteers, both technical and non-technical, to help us do it. A typical GiveCamp draws 75 to 100 volunteers. Individuals can work with their colleagues in company teams, or they can opt to be matched with fellow volunteers who have complementary skill sets. Everyone is welcome to head home for the evenings – but there are always the diehards who work from Friday kickoff straight through Sunday afternoon. Food and drinks, especially of the caffeinated variety, are provided, along with game systems for breaks. Technical volunteers We're looking for graphic or UX designers, developers with .NET/Java/LAMP/Open Source/CMS experience, project managers, system/network administrators, DBAs, and non-profit technical consultants and web strategists. Non-technical volunteers Beyond the technology, there are many other aspects that make GiveCamp a success. We need non-technical volunteers to run errands, help with setting up and cleaning up, and everything in between. Whether you can offer a couple hours of your time or join GiveCamp for a couple days, your support is needed Sign up at; http://www.eventbrite.com/event/650615007 Feel free to contact me or Dani Diaz of Microsoft for more information

    Read the article

  • sqlce in Xenocode

    - by user184204
    Please direct answers to : http://stackoverflow.com/questions/1518867/sqlce-in-xenocode This question is an accidental duplicate I'm using Xenocode in my application so that it works without a .NET framework. I'm using Xenocode Virtual Application Studio(version 6.1). Everything works fine except the .sdf file which I have embedded inside the application directory. actually in the application the instead of SQL server i have used SQL Compact edition(3.5) and i have included the reqired dll . All the files are working except the ".sdf" file. Any idea y is that so? Is it because the ".sdf" file is being used when the xenocode after snapshot was taken? if so what is the solution for that? i cannot avoid using it because Xenocode's after snapshot will not recognise the application if it's not running and if I run the application ".sdf" file will be used. Anyway to solve this?

    Read the article

  • How Can I: Generate 40/64 Bit WEP Key In Python?

    - by Aktariel
    So, I've been beating my head against the wall of this issue for several months now, partly because it's a side interest and partly because I suck at programming. I've searched and researched all across the web, but have not had any luck (except one small bit of success; see below), so I thought I might try asking the experts. What I am trying to do is, as the title suggests, generate a 40/64 bit WEP key from a passphrase, according to the "de facto" standard. (A site such as [http://www.powerdog.com/wepkey.cgi] produces the expected outputs.) I have already written portions of the script that take inputs and write them to a file; one of the inputs would be the passphrase, sanitized to lower case. For the longest time I had no idea what the defacto standard was, much less how to even go about implementing it. I finally stumbled across a paper (http://www.lava.net/~newsham/wlan/WEP_password_cracker.pdf) that sheds as much light as I've had yet on the issue (page 18 has the relevant bits). Apparently, the passphrase is "mapped to a 32-bit value with XOR," the result of which is then used as the seed for a "linear congruential PRNG (which one of the several PRNGs Python has would fit this description, I don't know), and then from that result several bits of the result are taken. I have no idea how to go about implementing this, since the description is rather vague. What I need is help in writing the generator in Python, and also in understanding how exactly the key is generated. I'm not much of a programmer, so explanations are appreciated as well. (Yes, I know that WEP isn't secure.)

    Read the article

  • CHECK/NOCHECK for Sql Compact Edition

    - by Ryan H
    I am attempting to wipe and repopulate test data on SQL CE. I am getting an error due to FK constraints existing. Typically in Sql2005 I would ALTER TABLE [tablename] CHECK/NOCHECK CONSTRAINT ALL to enable/disable all constraints. From what I could find in my searching, it seems that this might not be supported in CE. Is that true? If so, is there an alternative?

    Read the article

  • Call into a website and use php to recognize caller ID

    - by Phil
    I have this idea where I want to allow someone to call a phone number from their cell phone, and then a website would display their caller ID. I want to do this in php, but I'm really not sure how. I'm pretty good with PHP and I'm assuming you need some kind of GSM modem attached to the web server to accept the incoming phone calls, but that's really as far as I can get. If anyone can point me in the right direction that would be great. Thanks!

    Read the article

  • Advice about insert into SQLCE

    - by Alexander
    i am inserting about 1943 records by these function into SQLCE.This is my insert function.Parameters come from StringReader(string comes from webservice).This function executes 1943 times and takes about 20 seconds.I dropped table's indexes,what can i do to improve it?I create just 1 time mycomm and sqlceresultset. Public Function Insert_Function(ByVal f_Line() As String, ByRef myComm As SqlCeCommand, ByRef rs As SqlCeResultSet) As String Try Dim rec As SqlCeUpdatableRecord = rs.CreateRecord() rec.SetInt32(0, IIf(f_Line(1) = "", DBNull.Value, f_Line(1))) rec.SetInt32(1, IIf(f_Line(2) = "", DBNull.Value, f_Line(2))) rec.SetInt32(2, IIf(f_Line(3) = "", DBNull.Value, f_Line(3))) rec.SetInt32(3, IIf(f_Line(4) = "", DBNull.Value, f_Line(4))) rec.SetValue(4, IIf(f_Line5(5) = "", DBNull.Value, f_Line(5))) rs.Insert(rec) rec = Nothing Catch ex As Exception strerr_col = ex.Message End Try Return strerr_col End Function

    Read the article

  • Mutation Problem - Clojure

    - by Silanglaya Valerio
    having trouble changing an element of my function represented as a list. code for random function: (defn makerandomtree-10 [pc maxdepth maxwidth fpx ppx] (if-let [output (if (and (< (rand) fpx) (> maxdepth 0)) (let [head (nth operations (rand-int (count operations))) children (doall (loop[function (list) width maxwidth] (if (pos? width) (recur (concat function (list (makerandomtree-10 pc (dec maxdepth) (+ 2 (rand-int (- maxwidth 1))) fpx ppx))) (dec width)) function)))] (concat (list head) children)) (if (and (< (rand) ppx) (>= pc 0)) (nth parameters (rand-int (count parameters))) (rand-int 100)))] output )) I will provide also a mutation function, which is still not good enough. I need to be able to eval my statement, so the following is still insufficient. (defn mutate-5 "chooses a node changes that" [function pc maxwidth pchange] (if (< (rand) pchange) (let [output (makerandomtree-10 pc 3 maxwidth 0.5 0.6)] (if (seq? output) output (list output))) ;mutate the children of root ;declare an empty accumulator list, with root as its head (let [head (list (first function)) children (loop [acc(list) walker (next function)] (println "----------") (println walker) (println "-----ACC-----") (println acc) (if (not walker) acc (if (or (seq? (first function)) (contains? (set operations) (first function))) (recur (concat acc (mutate-5 walker pc maxwidth pchange)) (next walker)) (if (< (rand) pchange) (if (some (set parameters) walker) (recur (concat acc (list (nth parameters (rand-int (count parameters))))) (if (seq? walker) (next walker) nil)) (recur (concat acc (list (rand-int 100))) (if (seq? walker) (next walker) nil))) (recur acc (if (seq? walker) (next walker) nil)))) ))] (concat head (list children))))) (side note: do you have any links/books for learning clojure?)

    Read the article

  • How do I rename a table in SQL Server Compact Edition?

    - by romkyns
    I've designed my SQL CE tables using the built-in designer in VS2008. I chose the wrong names for a couple. I am now completely stuck trying to find a way to rename them. I am refusing to believe that such a feature could have been "forgotten". How do I rename an existing table using the VS2008 designer, or a free stand-alone app?

    Read the article

  • MS Chart control with WPF C#

    - by Birgir Hrafn Sigurðsson
    Hello, Ive got a MS Chart control and it works just fine except that I can't figure out how to "format" the Y-Axis. I am adding a lot of double numbers into a Serie but when the double numb are actually whole numbers (20.000000.....) the Y-Axis on my chart shows 20. example: this serie : 12.32 11.00 10.13 would actually show up like this: 12.32 11 10.13 I have tried formatting the data as I insert it into the serie like this: serie.Points.AddXY(date.ToString(),double[i].ToString("##.##")); but that doesn't seem to work. I've tried to search for a place to format it in Chart.Series[0].* and Chart.ChartAreas[0].* but I didn't find it there. Thanks in advance, Regards, Birgir Hrafn

    Read the article

  • sqlce in Xenocode

    - by jankhana
    I'm using Xenocode in my application so that it works without a .NET framework. I'm using Xenocode Virtual Application Studio(version 6.1). Everything works fine except the .sdf file which I have embedded inside the application directory. actually in the application the instead of SQL server i have used SQL Compact edition(3.5) and i have included the reqired dll . All the files are working except the ".sdf" file. Any idea y is that so? Is it because the ".sdf" file is being used when the xenocode after snapshot was taken? if so what is the solution for that? i cannot avoid using it because Xenocode's after snapshot will not recognise the application if it's not running and if I run the application ".sdf" file will be used. Anyway to solve this?

    Read the article

  • problem with date in sql CE

    - by Gold
    i have sqlCE DataBase, i have Tdate field (datetime) i notice that his format is: MM/DD/YYYY in my C# program i work with date in: DD/MM/YYYY format. how i can insert to my sqlCE data base my C# format ?

    Read the article

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