Search Results

Search found 1393 results on 56 pages for 'brian postow'.

Page 37/56 | < Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >

  • Ruby on Rails - f.error_messages not showing up

    - by Brian Roisentul
    Hi, I've read many posts about this issue but I never got this to work. My model looks like this: class Announcement < ActiveRecord::Base validates_presence_of :title, :description end My controller's create method(only its relevant part) looks like this: def create respond_to do |format| if @announcement.save flash[:notice] = 'Announcement was successfully created.' format.html { redirect_to(@announcement) } format.xml { render :xml => @announcement, :status => :created, :location => @announcement } else @announcement = Announcement.new @provinces = Province.all @types = AnnouncementType.all @categories = Tag.find_by_sql 'select * from tags where parent_id=0 order by name asc' @subcategories= '' format.html { render :action => "new" } #new_announcement_path format.xml { render :xml => @announcement.errors, :status => :unprocessable_entity } end end end My form looks like this: <% form_for(@announcement) do |f| %> <%= error_messages_for 'announcement' %> <!--I've also treid f.error_messages--> ... What am I doing wrong?

    Read the article

  • How to determine values saved on the stack?

    - by Brian
    I'm doing some experimenting and would like to be able to see what is saved on the stack during a system call (the saved state of the user land process). According to http://lxr.linux.no/#linux+v2.6.30.1/arch/x86/kernel/entry_32.S it shows that the various values of registers are saved at those particular offsets to the stack pointer. Here is the code I have been trying to use to examine what is saved on the stack (this is in a custom system call I have created): asm("movl 0x1C(%esp), %ecx"); asm("movl %%ecx, %0" : "=r" (value)); where value is an unsigned long. As of right now, this value is not what is expected (it is showing a 0 is saved for the user value of ds). Am I correctly accessing the offset of the stack pointer? Another possibility might be could I use a debugger such as GDB to examine the stack contents while in the kernel? I don't have much extensive use with debugging and am not sure of how to debug code inside the kernel. Any help is much appreciated.

    Read the article

  • Relative Position in PHP between 2 points (Lat/Long)

    - by Brian H
    I have a database of airports with Latitude and Longitude for each point. I want to run a PHP script to find all airports that are nearby a given airport, with their distance and relative direction. I.e. for Airport KLDJ (40-37-02.810N 074-14-40.539W) Airport Nearby KJFK - John F Kennedy Airport (21.2 nm NE) (40-38-23.104N 073-46-44.132W) I have used code from http://www.movable-type.co.uk/scripts/latlong.html to find distance, and tried to use it to find bearing, which might not be right. //BEARING RHUMB LINE $phi = log(tan($lat2/2+pi/4)/tan($lat1/2+pi/4)); $distance['bearing'] = (rad2deg(atan2($theta, $phi)) +180) % 360; I basically want to run all points through this script and find the distance, which I have already, but then the direction. (i.e. N, S, W, E, NW, SW, NE, SE)

    Read the article

  • Java Compiler - Load Method

    - by Brian
    So I have been working on a java project where the goal is to create a virtual computer. So I am basically done but with one problem. I have created a compiler which translates a txt document with assembly code in it and my compiler has created a new-file with this code written as machine executable ints. But now I need to write a load method that reads these ints and runs the program but I am having difficulty doing this. Any help is much appreciated....also this is not homework if you are thinking this. The project was simply to make a compiler and now I am trying to complete it for my own interest. Thanks. Here is what I have so far for load: public void load(String filename) { FileInputStream fs = new FileInputStream(filename); DataInputStream dos = new DataInputStream(fs); dos.readInt();

    Read the article

  • ColdFusion CFC implementation of C# Partial Class?

    - by Brian David Berman
    Does ColdFusion offer a mechanism for splitting CFCs into multiple files? I am NOT talking about extension, I am talking about splitting the SAME CFC into multiple files; the same way C# allows for "partial" classes. The reason for this is because I am using T4 to generate a bunch of CFCs and I want to be able to tag functionality onto the generated CFC by doing so in another file. I want to do this in a way that doesn't violate the Open-Closed Principle.

    Read the article

  • Access report not showing data

    - by Brian Smith
    I have two queries that I am using to generate a report from, the problem is when I run the report, three fields do not show any data at all for some reason. Query 1: SELECT ClientSummary.Field3 AS PM, ClientSummary.[Client Nickname 2] AS [Project #], ClientSummary.[Client Nickname 1] AS Customer, ClientSummary.[In Reference To] AS [Job Name], ClientSummary.Field10 AS Contract, (select sum([Billable Slip Value]) from Util_bydate as U1 where U1.[Client Nickname 2] = ClientSummary.[Client Nickname 2]) AS [This Week], (select sum([Billable Slip Value]) from Util as U2 where U2.[Client Nickname 2] = ClientSummary.[Client Nickname 2] ) AS [To Date], [To Date]/[Contract] AS [% Spent], 0 AS Backlog, ClientSummary.[Total Slip Fees & Costs] AS Billed, ClientSummary.Payments AS Paid, ClientSummary.[Total A/R] AS Receivable, [Forms]![ReportMenu]![StartDate] AS [Start Date], [Forms]![ReportMenu]![EndDate] AS [End Date] FROM ClientSummary; Query 2: SELECT JobManagement_Summary.pm, JobManagement_Summary.[project #], JobManagement_Summary.Customer, JobManagement_Summary.[Job Name], JobManagement_Summary.Contract, IIf(IsNull([This Week]),0,[This Week]) AS [N_This Week], IIf(IsNull([To Date]),0,[To Date]) AS [N_To Date], [% Spent], JobManagement_Summary.Backlog, JobManagement_Summary.Billed, JobManagement_Summary.Paid, JobManagement_Summary.Receivable, JobManagement_Summary.[Start Date], JobManagement_Summary.[End Date] FROM JobManagement_Summary; When I run the report from query 2 these 3 fields don't appear. N_This Week, N_To Date and % Spent. All have no data. It isn't the IIF functions, as it doesn't matter if I have those in there or remove them. Any thoughts? If I connect directly to the first recordset it works fine, but then SQL throws the error message: Multi-level GROUP BY cause not allowed in subquery. Is there any way to get around that message to link to it directly or does anyone have ANY clue why these fields are coming back blank? I am at wits end here!

    Read the article

  • Help a Beginner with a PHP based Login System

    - by Brian Lang
    I'm a bit embarrassed to say, but I've run into issue with creating a PHP based login system. I'm using a site template to handle the looks of the the login process, so I will spare you the code. Here is my thought process on how to handle the login: Create a simple login.php file. On there will be a form whose action is set to itself. It will check to see if the submit has been clicked, and if so validate to make sure the user entered a valid password / username. If they do, set a session variable save some login info (username, NOT password), and redirect them to a restricted area. If the login info isn't valid, save an error message in a session variable, display error message giving further instruction, and wait for the user to resubmit. Here is a chunk of what I have - hopefully one of you experts can see where I've gone wrong, and give me some insight: if(isset($_POST['submit'])) { if(!empty($_POST['username']) AND !empty(!$_POST['password'])) { header("Location: http://www.google.com"); } else { $err = 'All the fields must be filled in!'; } } if($err) { $_SESSION['msg']['login-err'] = $err; } ? Now the above is just an example - the intent of the above code is to process user input, with the script validating simply that the user has given input for username and password. If they have, I would like them, in this case, to be redirected to google.com (for the sake of this example). If not, save an error message. Given my current code, the error message will display perfectly, however if the user submits and has something entered for the username and password, the page simply doesn't redirect. I'm sure this is a silly question, but I am a beginner, and well, to be honest, a bit buzzed right now. Thanks so much!

    Read the article

  • Can I do the following with the Twitter API?

    - by Brian Scott
    Hi, I'm looking to do the 2 following tasks automatically via the twitter API? Allow a user to provide their credentials and have their twitter account to subscribe to my website feed directly from a form on the site. Allow a user to integrate tweets from my websites twitter feed into their outgoing tweets. I'm finding it hard to find any informationon how to achieve these, can anyone shed any light? Thanks in advance.

    Read the article

  • Minimizing SQL queries using join with one-to-many relationship

    - by Brian
    So let me preface this by saying that I'm not an SQL wizard by any means. What I want to do is simple as a concept, but has presented me with a small challenge when trying to minimize the amount of database queries I'm performing. Let's say I have a table of departments. Within each department is a list of employees. What is the most efficient way of listing all the departments and which employees are in each department. So for example if I have a department table with: id name 1 sales 2 marketing And a people table with: id department_id name 1 1 Tom 2 1 Bill 3 2 Jessica 4 1 Rachel 5 2 John What is the best way list all departments and all employees for each department like so: Sales Tom Bill Rachel Marketing Jessica John Pretend both tables are actually massive. (I want to avoid getting a list of departments, and then looping through the result and doing an individual query for each department). Think similarly of selecting the statuses/comments in a Facebook-like system, when statuses and comments are stored in separate tables.

    Read the article

  • SQL - Two foreign keys that have a dependency between them

    - by Brian
    The current structure is as follows: Table RowType: RowTypeID Table RowSubType: RowSubTypeID FK_RowTypeID Table ColumnDef: FK_RowTypeID FK_RowSubTypeID (nullable) In short, I'm mapping column definitions to rows. In some cases, those rows have subtype(s), which will have column definitions specific to them. Alternatively, I could hang those column definitions that are specific to subtypes off their own table, or I could combine the data in RowType and RowSubType into one table and work with a single ID, but I'm not sure either is a better solution (if anything, I'd lean towards the latter, as we mostly end up pulling ColumnDefs for a given RowType/RowSubType). Is the current design SQL Blasphemy? If I keep the current structuree, how do I maintain that if RowSubTypeID is specified in ColumnDef, that it must correspond to the RowType specified by RowTypeID? Should I try to enforce this with a trigger or am I missing a simple redesign that would solve the problem?

    Read the article

  • Gridview delete/edit not working when using select parameter

    - by Brian Carroll
    new to ASP.NET. I created a sqldatasource and set up basic select query (SELECT * FROM Accounts) using the wizard. I then had the sqldatasource wizard create the INSERT, EDIT and DELETE queries. Connected this datasource to a gridview with EDITING and DELETING enabled. Everything works fine. The SELECT query returns all records and I can edit/delete them. Now I need to send a parameter to the SELECT command to filter the records to those with the user's id (pulled from Membership.GetUser). When I add this parameter, the SELECT command works fine, but the EDIT/DELETE buttons in the gridview no longer work. No error is generated. The page refreshes but the records were not updated in the database. I don't understand what is wrong. CODE: <% Dim u As MembershipUser Dim userid As String u = Membership.GetUser(User.Identity.Name) userid = u.ProviderUserKey.ToString SqlDataSource1.SelectParameters("UserId").DefaultValue = userid %> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="ID" DataSourceID="SqlDataSource1"> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:BoundField DataField="ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="ID" /> <asp:BoundField DataField="UserId" HeaderText="UserId" SortExpression="UserId" /> <asp:BoundField DataField="AccountName" HeaderText="AccountName" SortExpression="AccountName" /> <asp:BoundField DataField="DateAdded" HeaderText="DateAdded" SortExpression="DateAdded" /> <asp:BoundField DataField="LastModified" HeaderText="LastModified" SortExpression="LastModified" /> </Columns> </asp:GridView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CheckingConnectionString %>" DeleteCommand="DELETE FROM [Accounts] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Accounts] ([UserId], [AccountName], [DateAdded], [LastModified]) VALUES (@UserId, @AccountName, @DateAdded, @LastModified)" SelectCommand="SELECT * FROM [Accounts] WHERE [UserId] = @UserId" UpdateCommand="UPDATE [Accounts] SET [UserId] = @UserId, [AccountName] = @AccountName, [DateAdded] = @DateAdded, [LastModified] = @LastModified WHERE [ID] = @ID"> <DeleteParameters> <asp:Parameter Name="ID" Type="Int32" /> </DeleteParameters> <InsertParameters> <asp:Parameter Name="UserId" Type="String" /> <asp:Parameter Name="AccountName" Type="String" /> <asp:Parameter Name="DateAdded" Type="DateTime" /> <asp:Parameter Name="LastModified" Type="DateTime" /> </InsertParameters> <UpdateParameters> <asp:Parameter Name="UserId" Type="String" /> <asp:Parameter Name="AccountName" Type="String" /> <asp:Parameter Name="DateAdded" Type="DateTime" /> <asp:Parameter Name="LastModified" Type="DateTime" /> <asp:Parameter Name="ID" Type="Int32" /> </UpdateParameters> <SelectParameters> <asp:Parameter Name="UserId"/> </SelectParameters> </asp:SqlDataSource>

    Read the article

  • How to design a C / C++ library to be usable in many client languages?

    - by Brian Schimmel
    I'm planning to code a library that should be usable by a large number of people in on a wide spectrum of platforms. What do I have to consider to design it right? To make this questions more specific, there are four "subquestions" at the end. Choice of language Considering all the known requirements and details, I concluded that a library written in C or C++ was the way to go. I think the primary usage of my library will be in programs written in C, C++ and Java SE, but I can also think of reasons to use it from Java ME, PHP, .NET, Objective C, Python, Ruby, bash scrips, etc... Maybe I cannot target all of them, but if it's possible, I'll do it. Requirements It would be to much to describe the full purpose of my library here, but there are some aspects that might be important to this question: The library itself will start out small, but definitely will grow to enormous complexity, so it is not an option to maintain several versions in parallel. Most of the complexity will be hidden inside the library, though The library will construct an object graph that is used heavily inside. Some clients of the library will only be interested in specific attributes of specific objects, while other clients must traverse the object graph in some way Clients may change the objects, and the library must be notified thereof The library may change the objects, and the client must be notified thereof, if it already has a handle to that object The library must be multi-threaded, because it will maintain network connections to several other hosts While some requests to the library may be handled synchronously, many of them will take too long and must be processed in the background, and notify the client on success (or failure) Of course, answers are welcome no matter if they address my specific requirements, or if they answer the question in a general way that matters to a wider audience! My assumptions, so far So here are some of my assumptions and conclusions, which I gathered in the past months: Internally I can use whatever I want, e.g. C++ with operator overloading, multiple inheritance, template meta programming... as long as there is a portable compiler which handles it (think of gcc / g++) But my interface has to be a clean C interface that does not involve name mangling Also, I think my interface should only consist of functions, with basic/primitive data types (and maybe pointers) passed as parameters and return values If I use pointers, I think I should only use them to pass them back to the library, not to operate directly on the referenced memory For usage in a C++ application, I might also offer an object oriented interface (Which is also prone to name mangling, so the App must either use the same compiler, or include the library in source form) Is this also true for usage in C# ? For usage in Java SE / Java EE, the Java native interface (JNI) applies. I have some basic knowledge about it, but I should definitely double check it. Not all client languages handle multithreading well, so there should be a single thread talking to the client For usage on Java ME, there is no such thing as JNI, but I might go with Nested VM For usage in Bash scripts, there must be an executable with a command line interface For the other client languages, I have no idea For most client languages, it would be nice to have kind of an adapter interface written in that language. I think there are tools to automatically generate this for Java and some others For object oriented languages, it might be possible to create an object oriented adapter which hides the fact that the interface to the library is function based - but I don't know if its worth the effort Possible subquestions is this possible with manageable effort, or is it just too much portability? are there any good books / websites about this kind of design criteria? are any of my assumptions wrong? which open source libraries are worth studying to learn from their design / interface / souce? meta: This question is rather long, do you see any way to split it into several smaller ones? (If you reply to this, do it as a comment, not as an answer)

    Read the article

  • JavaScript "confirm" on SelectedIndexChange of RadioButtonList

    - by Brian David Berman
    I have a RadioButtonList control and I would like to do a Javascript "confirm" when a user tries to change the index. Currently AutoPostBack is set to TRUE. I can, of course, just call __doPostBack from within a javascript function, etc. I tried a few things with jQuery but you have to worry about mousedown vs. click and then there is always the fact that you can click the checkbox label to select it, etc. Anyone have a nice solution for this? To be clear, I am looking for a way to prompt the user with a confirm box prior to their selection being made and triggering a postback.

    Read the article

  • Creating Emulated iSCSI Target in a Lab/Testing Environment using Windows Server 2008 R2

    - by Brian McCleary
    We have a single server running Windows Server 2008 with Hyper-V installed running 5 virtual machines. I have purchased a second DELL R805 Server so that we can create a fail-over cluster to our current R805 that is currently in production. Right now, our R805 connects via iSCSI to a MD3000i iSCSI SAN. Before we try to roll out the second server and clustering to our production environment, I want to be able to test and "play with" the clustering features in our lab before rolling it out. The problem is that I don't want to spend a couple thousand dollars on another iSCSI SAN server just for testing. I already have two servers in my lab that are installed with Windows Server 2008 R2 64bit (one is the R805 and another spare desktop that was laying around) and with the Hyper-V roll enabled that should be ready to test with, but I don't have an iSCSI target to use as the Cluster Shared Volume. Is there anyway to install, either on a Hyper-V image or on a external spare computer that we have some sort of emulated iSCSI target? In our lab, we obviously don't need a real SAN, just something that we can test out how to setup the clustering properly outside of our production environment. Any advise is appreciated. FYI - I have read Jose Barret's blog on WUDSS at http://blogs.technet.com/josebda/archive/2008/01/07/installing-the-evaluation-version-of-wudss-2003-refresh-and-the-microsoft-iscsi-software-target-version-3-1-on-a-vm.aspx, but it seems awfully complex. I'm hoping for an easier solution.

    Read the article

  • How can one make a web-site accessible only when someone has a dongle?

    - by Brian M. Hunt
    Suppose you want to add an extra layer of credentials on top of a SSL-encrypted login/password, but you don't want to increase complexity to the user. Is there a way to add the requirement of the possession of a dongle to web-server authentication schemes with existing cross-platform browser capabilities? In other words, to get access to the web-site, you would need a username, password, and a USB dongle that has been plugged into the client computer. The dongle would presumably do some sort of challenge/response. It'd be ideal if this dongle solution worked with Firefox automatically or with the simple addition of a plugin. Thoughts and suggestions are appreciated.

    Read the article

  • Fabric "TypeError: not all arguments converted during string formatting"

    - by Brian Carpio
    I have the following fabric task: @task def deploy_west_ec2_ami(name, puppetClass, size='m1.small', region='us-west-1', basedn='joe', ldap='arch-ldap-01', secret='secret', subnet='subnet-d43b8ab d', sgroup='sg-926578fe'): execute(deploy_ec2_ami, name='%s',puppetClass='%s',size='%s',region='%s',basedn='%s',ldap='%s',secret='%s',subnet='%s',sgroup='%s' %(name, puppetClass , size, region, basedn, ldap, secret, subnet, sgroup)) However when I run the command: fab deploy_west_ec2_ami:test,java I get the following Traceback: Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/fabric/main.py", line 710, in main *args, **kwargs File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 321, in execute results['<local-only>'] = task.run(*args, **new_kwargs) File "/usr/local/lib/python2.6/dist-packages/fabric/tasks.py", line 113, in run return self.wrapped(*args, **kwargs) File "/home/bcarpio/Projects/githubenterprise/awsdeploy/fabfile.py", line 35, in deploy_west_ec2_ami execute(deploy_ec2_ami, name='%s',puppetClass='%s',size='%s',region='%s',basedn='%s',ldap='%s',secret='%s',subnet='%s',sgroup='%s' %(name, puppetClass, size, region, basedn, ldap, secret, subnet, sgroup)) TypeError: not all arguments converted during string formatting I am not sure I understand why. I am pretty sure I have all the values defined here just fine. Also when I run the execute task deploy_ec2_ami as so: deploy_ec2_ami:test,java,m1.small,us-west-1,'dc\=test\,dc\=net',ldap-01,secret,subnet-d43b8abd,sg-926578fe It works just fine

    Read the article

  • Classic ASP - How to convert string to UTF8 to USC2

    - by Brian G
    I have a problem where I am storing a UTF8 string in SQL Server as USC2, when I pull it out to display on a page with content-type set to UTF-8 it works fine. But I have a third party javascript component which when I pass it the string for the database it renders it as USC2. or not UTF8. Is there a way in ASP to convert this string to UTF-8 after reading it from the database to pass it to the third party component ( obfuscated ) . Hope this makes sense.

    Read the article

  • Use string value to create new instance

    - by Brian David Berman
    I have a few classes: SomeClass1, SomeClass2. How can I create a new instance of one of these classes by using the class name from a string? Normally, I would do: var someClass1 = new SomeClass1(); How can I create this instance from the following: var className = "SomeClass1"; I am assuming I should use Type.GetType() or something but I can't figure it out. Thanks.

    Read the article

  • Error while installing Microsoft SQL Server 2005 on Windows 7

    - by Brian Roisentul
    I was trying to install Microsoft SQL Server 2005 on my Windows 7 pc. When I tried to install it, it tells me that I have a newer version installed on my pc. So, I checked that Microsoft Sharepoint 2010 installed some sql server 2008 tools for me. I decided to uninstall SharePoint 2010(which I wasn't using) and then tried to install MS SQL Server 2005 again. This threw me the following exception: Error 1603 installing microsoft sql server setup support files Searching on Google I found this article: http://support.microsoft.com/kb/916760 but it's not my case actually. Any help will be appreciated. I really need this to continue working.

    Read the article

  • How can I properly handle 404s in ASP.NET MVC?

    - by Brian
    I am just getting started on ASP.NET MVC so bear with me. I've searched around this site and various others and have seen a few implementations of this. EDIT: I forgot to mention I am using RC2 Using URL Routing: routes.MapRoute( "Error", "{*url}", new { controller = "Errors", action = "NotFound" } //404s ); The above seems to take care of requests like this (assuming default route tables setup by initial MVC project): "/blah/blah/blah/blah" Overriding HandleUnknownAction() in the controller itself: //404s - handle here (bad action requested protected override void HandleUnknownAction(string actionName) { ViewData["actionName"] = actionName; View("NotFound").ExecuteResult(this.ControllerContext); } However the previous strategies do not handle a request to a Bad/Unknown controller. For example, I do not have a "/IDoNotExist", if I request this I get the generic 404 page from the web server and not my 404 if I use routing + override. So finally, my question is: Is there any way to catch this type of request using a route or something else in the MVC framework itself? OR should I just default to using Web.Config customErrors as my 404 handler and forget all this? I assume if I go with customErrors I'll have to store the generic 404 page outside of /Views due to the Web.Config restrictions on direct access. Anyway any best practices or guidance is appreciated.

    Read the article

  • Is this a bug or something I am doing wrong?

    - by Brian Gideon
    I cannot imagine how this is anything other than a bug, but since I do not currently have a login for the MS Connect website I will ask here first. I have Visual Studio 2008 SP 1 with all post SP1 hotfixes I could find relating to the crash installed. Can you reproduce the following crash? 1) Create a new "WPF Application" project using VB as the language (though I suspect it will happen in C# as well). 2) Enter the following code in the Window1.xaml.vb file. Friend MustInherit Class A End Class Friend MustInherit Class A(Of T) Inherits A End Class 3) Add a namespace declaration the Window1.xaml file so that it looks like the following. <Window x:Class="Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:WpfApplication1" Title="Window1" Height="300" Width="300"> <Grid> </Grid> </Window> 4) Now attempt to edit the xaml file by opening a new xml tag via the < character. 5) CRASH! Edit: Microsoft has confirmed this bug. The issue still exists in VS2010 beta 2, but will be fixed in the next release.

    Read the article

< Previous Page | 33 34 35 36 37 38 39 40 41 42 43 44  | Next Page >