Search Results

Search found 1263 results on 51 pages for 'nick rogers'.

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

  • entity framework - getting null exception using foreign key

    - by Nick
    Having some trouble with what should be a very simple scenario. For example purposes, I have two tables: -Users -Comments There is a one-to-many relationship set up for this; there is a foreign key from Comments.CommentorID to Users.UserID. When I do the LINQ query and try to bind to a DataList, I get a null exception. Here is the code: FKMModel.FKMEntities ctx = new FKMModel.FKMEntities(); IQueryable<Comment> CommentQuery = from x in ctx.Comment where x.SiteID == 101 select x; List<Comment> Comments = CommentQuery.ToList(); dl_MajorComments.DataSource = Comments; dl_MajorComments.DataBind(); In the ASPX page, I have the following as an ItemTemplate (I simplified it and took out the styling, etc, for purposes of posting here since it's irrelevant): <div> <%# ((FKMModel.Comment)Container.DataItem).FKMUser.Username %> <%# ((FKMModel.Comment)Container.DataItem).CommentDate.Value.ToShortDateString() %> <%# ((FKMModel.Comment)Container.DataItem).CommentTime %> </div> The exception occurs on the first binding (FKMUser.Username). Since the foreign key is set up, I should have no problem accessing any properties from the Users table. Intellisense set up the FKMUser navigation property and it knows the properties of that foreign table. What is going on here??? Thanks, Nick

    Read the article

  • Google I/O 2011: Kick-Ass Game Programming with Google Web Toolkit

    Google I/O 2011: Kick-Ass Game Programming with Google Web Toolkit Ray Cromwell, Philip Rogers GWT does more than make awesome Enterprise Apps, it's a great tool for games too. Learn to write 2D and 3D games using HTML5 and GWT, leverage and port existing game libraries and physics engines, share game code between GWT and Android, publish to the Chrome Web Store, and of course, see demos of really neat GWT games in action. From: GoogleDevelopers Views: 14283 176 ratings Time: 44:59 More in Science & Technology

    Read the article

  • Curva de adoção tecnológica.

    - by Fernando Kimura-Oracle
    Diariamente estamos em contato com diversas tecnologias, muitas delas complementares ou realizam tarefas muito semelhantes como o caso dos tablets X smartphones. Não podemos negar o quanto estas tecnologias passaram a fazer parte do hábito diário universalmente, alterando o padrão como consumimos informação, e até mesmo como utilizamos ou utilizávamos o computador.Basicamente existem 2 tipos de inovação:1 – incremental – que ocorre de acordo com as melhorias, ajustas, releituras e evolução de um produto. Este tipo de inovação podemos ver em automóveis, que seguem o mesmo princípio, porém quando comparamos um automóvel atual com um fabricado a 20 anos atrás, podemos perceber as inovações incrementais que alteraram o produto.2 – disruptiva – este tipo de inovação geralmente causar um novo momento, é até uma alteração do hábito de uso dos produtos. Foi o caso da revolução industrial, que automatizou processos de produção, ou da câmera digital que alterou a forma como habitualmente fotos eram tiradas e reveladas.Dentro deste processo existe uma curva de adoção tecnológica, esta curva foi criada americano Everett M. Rogers, PHd em sociologia e estatística.Em seu livro “The diffusion of inovations” (1962) – em português – A difusão das inovações, Rogers apresenta após diversas análises e estudos a curva de adoção tecnológica, Roger´s é o criador do termo Early Adopters muito utilizado nos dias de hoje.Abaixo podemos entender a curva de adoção:2,5% da população são os Innovators/Inovadores – eles possuem acesso á qualquer inovação antes de todos, por questões sociais, influência, conhecimento. São as pessoas que tem acesso a inovação antes que ela esteja disponível no mercado. 13,50 % são os Early Adopters, pessoas e empresa que por uma questão comportamental buscam ter as inovações assim que são lançadas, frente a isso existe uma série de vantagens e desvantagens. Estar à frente do mercado muitas vezes significa utilizar coisas que o mercado ainda não utiliza, por isso este comportamento pode colocar muitas empresas a frente de seus concorrentes mais tradicionais. Há também o risco da inovação não ser 100% aceita, ou passar por algum processo de ajuste, mas certamente os early adopters conseguem explanar melhor sobra visão de futuro.34% são os Early Majority, nesta fase da adoção muitas pessoas/empresas são influenciadas pelos early adopters, bem como inicia-se uma clico “natural” de busca por inovação. 34% são os late majority, ou seja empresas/pessoas que esperam que todos utilizem e adotam quase na última onda.Ao final temos 16% os laggards – retardatários, empresas e pessoas que só adotam inovações porque não possuem mais saída frente as alterações causadas, e precisam de alguma forma sobreviver frente as mudanças.Frente a este cenário onde você este inserido? Onde sua empresa está inserida?Vale pensar e refletir nos benefícios de ser Early adopters ou Early Majority.Aproveite e baixe GRATUITAMENTE o e-book – Simplifique sua MOBILIDADE EMPRESARIAL. E conheça o poder transformacional da mobilidade em seu negócio.http://bit.ly/e-bookmobilidade

    Read the article

  • Key Features of the Samsung SCX 5835FN

    The SCX 5835FN is just one in a long line of exceptional multifunction printers from Samung. Featuring some of the most advanced technology you';ll find on any modern printer, this all-inclusive devic... [Author: Derek Rogers - Computers and Internet - May 23, 2010]

    Read the article

  • why can't asp.net find my textbox?

    - by phunehehe
    Hello, I'm trying to add more fields to the CreateUserWizardStep, here is what I added: <asp:CreateUserWizardStep ID="CreateUserWizardStep1" runat="server"> <ContentTemplate> <table border="0"> <tr> <td align="right"> <asp:Label ID="NickNameLabel" runat="server" AssociatedControlID="NickName">Nick Name:</asp:Label> </td> <td> <asp:TextBox ID="NickName" runat="server"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="NickName" ErrorMessage="Nick Name is required." ToolTip="Nick Name is required." ValidationGroup="CreateUserWizard1">*</asp:RequiredFieldValidator> </td> </tr> <%-- The default code is left unchanged, but not shown here --%> </table> </ContentTemplate> </asp:CreateUserWizardStep> Then I tried to reference the objects like this protected void NewUserWizard_CreatedUser(object sender, EventArgs e) { CreateUserWizardStep step = NewUserWizard.FindControl("CreateUserWizardStep1") as CreateUserWizardStep; TextBox nickName= step.FindControl("NickName") as TextBox; // insert additional information to the database } The problem is, I'm getting nulls for nickName. Am I using FindControl("") incorrectly?

    Read the article

  • Nice way to break a reply up into pieces in ruby

    - by ChaosR
    Hello, I'm writing an IRCd. For this topic it doesn't really matter if you know much about IRC. Its a simple code style problem. Quick overview of the problem: No message may be longer than 512 characters If the message is more, it must be broken into pieces The NAMES reply sends all the nicknames of users on a channel, and quickly grows beyond 512 characters. I currently concocted this marvelous piece of code, it works perfectly. However, its just not "ruby-like". This piece of code is more what you expect in some piece of C code. # 11 is the number of all fixed characters combined in the reply pre_length = 11 + servername.length + mynick.length + channel.name.length list = [""] i = 0 channel.nicks.each do |nick, client| list[i+=1] = "" if list[i].length + nick.length + pre_length > 500 list[i] << "#{channel.mode_char(client)}#{client.nick} " end list.each { |l| send_numeric(RPL_NAMREPLY, channel.name, l.strip) } send_numeric(RPL_ENDOFNAMES, channel.name) So my question is, any ideas to do this more nicely? PS. code has been slightly modified to make it easier to understand out-of-context

    Read the article

  • How to load the SQL data into several ComboBox easily, am i doing the correctly or is there another way

    - by Dominic Deepan.d
    I have a Combobox to fill the data for City, State and PinCode these combobox is dopdown list and the user will pick it. and it loads once the form opens. Here is the CODE: /// CODE TO BRING A DATA FROM SQL INTO THE FORM DROP LIST /// To fill the sates from States Table cn = new SqlConnection(@"Data Source=Nick-PC\SQLEXPRESS;Initial Catalog=AutoDB;Integrated Security=True"); cmd= new SqlCommand("select * from TblState",cn); cn.Open(); SqlDataReader dr; try { dr = cmd.ExecuteReader(); while (dr.Read()) { SelectState.Items.Add(dr["State"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { cn.Close(); } //To fill the Cities from City Table cn1 = new SqlConnection(@"Data Source=Nick-PC\SQLEXPRESS;Initial Catalog=AutoDB;Integrated Security=True"); cmd1 = new SqlCommand("SELECT * FROM TblCity", cn); cn.Open(); SqlDataReader ds; try { ds = cmd1.ExecuteReader(); while (ds.Read()) { SelectCity.Items.Add(ds["City"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { cn1.Close(); } // To fill the Data in the Pincode from the City Table cn2 = new SqlConnection(@"Data Source=Nick-PC\SQLEXPRESS;Initial Catalog=AutoDB;Integrated Security=True"); cmd2 = new SqlCommand("SELECT (Pincode) FROM TblCity ", cn2); cn2.Open(); SqlDataReader dm; try { dm = cmd2.ExecuteReader(); while (dm.Read()) { SelectPinCode.Items.Add(dm["Pincode"].ToString()); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { cn2.Close(); } its kinda Big, i am doing the same steps for all the combo-box, but is there a way i can merge it in a simple way.

    Read the article

  • Why is ListBoxFor not selecting items, but ListBox is?

    - by Roger Rogers
    I have the following code in my view: <%= Html.ListBoxFor(c => c.Project.Categories, new MultiSelectList(Model.Categories, "Id", "Name", new List<int> { 1, 2 }))%> <%= Html.ListBox("MultiSelectList", new MultiSelectList(Model.Categories, "Id", "Name", new List<int> { 1, 2 }))%> The only difference is that the first helper is strongly typed (ListBoxFor), and it fails to show the selected items (1,2), even though the items appear in the list, etc. The simpler ListBox is working as expected. I'm obviously missing something here. I can use the second approach, but this is really bugging me and I'd like to figure it out. For reference, my model is: public class ProjectEditModel { public Project Project { get; set; } public IEnumerable<Project> Projects { get; set; } public IEnumerable<Client> Clients { get; set; } public IEnumerable<Category> Categories { get; set; } public IEnumerable<Tag> Tags { get; set; } public ProjectSlide SelectedSlide { get; set; } } Update I just changed the ListBox name to Project.Categories (matching my model) and it now FAILS to select the item. <%= Html.ListBox("Project.Categories", new MultiSelectList(Model.Categories, "Id", "Name", new List<int> { 1, 2 }))%> I'm obviously not understanding the magic that is happening here. Update 2 Ok, this is purely naming, for example, this works... <%= Html.ListBox("Project_Tags", new MultiSelectList(Model.Tags, "Id", "Name", Model.Project.Tags.Select(t => t.Id)))%> ...because the field name is Project_Tags, not Project.Tags, in fact, anything other than Tags or Project.Tags will work. I don't get why this would cause a problem (other than that it matches the entity name), and I'm not good enough at this to be able to dig in and find out.

    Read the article

  • Getting an Error Trying to Create an Object in Python

    - by Nick Rogers
    I am trying to create an object from a class in python but I am getting an Error, "e_tank = EnemyTank() TypeError: 'Group' object is not callable" I am not sure what this means, I have tried Google but I couldn't get a clear answer on what is causing this error. Does anyone understand why I am unable to create an object from my EnemyTank Class? Here is my code: #Image Variables bg = 'bg.jpg' bunk = 'bunker.png' enemytank = 'enemy-tank.png' #Import Pygame Modules import pygame, sys from pygame.locals import * #Initializing the Screen pygame.init() screen = pygame.display.set_mode((640,360), 0, 32) background = pygame.image.load(bg).convert() bunker_x, bunker_y = (160,0) class EnemyTank(pygame.sprite.Sprite): e_tank = pygame.image.load(enemytank).convert_alpha() def __init__(self, startpos): pygame.sprite.Sprite.__init__(self, self.groups) self.pos = startpos self.image = EnemyTank.image self.rect = self.image.get_rect() def update(self): self.rect.center = self.pos class Bunker(pygame.sprite.Sprite): bunker = pygame.image.load(bunk).convert_alpha() def __init__(self, startpos): pygame.spriter.Sprite.__init__(self, self.groups) self.pos = startpos self.image = Bunker.image self.rect = self.image.get_rect() def getCollisionObjects(self, EnemyTank): if (EnemyTank not in self._allgroup, False): return False self._allgroup.remove(EnemyTank) result = pygame.sprite.spritecollide(EnemyTank, self._allgroup, False) self._allgroup.add(EnemyTank) def update(self): self.rect.center = self.pos #Setting Up The Animation x = 0 clock = pygame.time.Clock() speed = 250 allgroup = pygame.sprite.Group() EnemyTank = allgroup Bunker = allgroup e_tank = EnemyTank() bunker = Bunker()5 #Main Loop while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() screen.blit(background, (0,0)) screen.blit(bunker, (bunker_x, bunker_y)) screen.blit(e_tank, (x, 0)) pygame.display.flip() #Animation milli = clock.tick() seconds = milli/1000. dm = seconds*speed x += dm if x>640: x=0 #Update the Screen pygame.display.update()

    Read the article

  • SignalR recording when a Web Page has closed

    - by Benjamin Rogers
    I am using MassTransit request and response with SignalR. The web site makes a request to a windows service that creates a file. When the file has been created the windows service will send a response message back to the web site. The web site will open the file and make it available for the users to see. I want to handle the scenario where the user closes the web page before the file is created. In that case I want the created file to be emailed to them. Regardless of whether the user has closed the web page or not, the message handler for the response message will be run. What I want to be able to do is have some way of knowing within the response message handler that the web page has been closed. This is what I have done already. It doesnt work but it does illustrate my thinking. On the web page I have $(window).unload(function () { if (event.clientY < 0) { // $.connection.hub.stop(); $.connection.exportcreate.setIsDisconnected(); } }); exportcreate is my Hub name. In setIsDisconnected would I set a property on Caller? Lets say I successfully set a property to indicate that the web page has been closed. How do I find out that value in the response message handler. This is what it does now protected void BasicResponseHandler(BasicResponse message) { string groupName = CorrelationIdGroupName(message.CorrelationId); GetClients()[groupName].display(message.ExportGuid); } private static dynamic GetClients() { return AspNetHost.DependencyResolver.Resolve<IConnectionManager>().GetClients<ExportCreateHub>(); } I am using the message correlation id as a group. Now for me the ExportGuid on the message is very important. That is used to identify the file. So if I am going to email the created file I have to do it within the response handler because I need the ExportGuid value. If I did store a value on Caller in my hub for the web page close, how would I access it in the response handler. Just in case you need to know. display is defined on the web page as exportCreate.display = function (guid) { setTimeout(function () { top.location.href = 'GetExport.ashx?guid=' + guid; }, 500); }; GetExport.ashx opens the file and returns it as a response. Thank you, Regards Ben

    Read the article

  • Default values for model fields in a Ruby on Rails form

    - by Callum Rogers
    I have a Model which has fields username, data, tags, date, votes. I have form using form_for that creates a new item and puts it into the database. However, as you can guess I want the votes field to equal 0 and the date field to equal the current date when it is placed into the database. How and where would I set/apply these values to the item? I can get it to work with hidden fields in the form but this comes with obvious issues (someone could set the votes field to a massive number.

    Read the article

  • How do I use SVN effectively?

    - by Tim Rogers
    I have an SVN repository that I've set up on my VPS, and I know all the basics (update, commit), but I don't know what all the other options mean. I am running TortoiseSVN on Windows (which is great!) and can see all these features like branching, locking, merging and patching! What do all these things mean? Is there anywhere with a good guide about how all the little bits and pieces in SVN work? Thanks, Tim

    Read the article

  • Using boost::random as the RNG for std::random_shuffle

    - by Greg Rogers
    I have a program that uses the mt19937 random number generator from boost::random. I need to do a random_shuffle and want the random numbers generated for this to be from this shared state so that they can be deterministic with respect to the mersenne twister's previously generated numbers. I tried something like this: void foo(std::vector<unsigned> &vec, boost::mt19937 &state) { struct bar { boost::mt19937 &_state; unsigned operator()(unsigned i) { boost::uniform_int<> rng(0, i - 1); return rng(_state); } bar(boost::mt19937 &state) : _state(state) {} } rand(state); std::random_shuffle(vec.begin(), vec.end(), rand); } But i get a template error calling random_shuffle with rand. However this works: unsigned bar(unsigned i) { boost::mt19937 no_state; boost::uniform_int<> rng(0, i - 1); return rng(no_state); } void foo(std::vector<unsigned> &vec, boost::mt19937 &state) { std::random_shuffle(vec.begin(), vec.end(), bar); } Probably because it is an actual function call. But obviously this doesn't keep the state from the original mersenne twister. What gives? Is there any way to do what I'm trying to do without global variables?

    Read the article

  • Render action return View(); form problem

    - by Roger Rogers
    I'm new to MVC, so please bear with me. :-) I've got a strongly typed "Story" View. This View (story) can have Comments. I've created two Views (not partials) for my Comments controller "ListStoryComments" and "CreateStoryComment", which do what their names imply. These Views are included in the Story View using RenderAction, e.g.: <!-- List comments --> <h2>All Comments</h2> <% Html.RenderAction("ListStoryComments", "Comments", new { id = Model.Story.Id }); %> <!-- Create new comment --> <% Html.RenderAction("CreateStoryComment", "Comments", new { id = Model.Story.Id }); %> (I pass in the Story id in order to list related comments). All works as I hoped, except, when I post a new comment using the form, it returns the current (parent) View, but the Comments form field is still showing the last content I typed in and the ListStoryComments View isn’t updated to show the new story. Basically, the page is being loaded from cache, as if I had pressed the browser’s back button. If I press f5 it will try to repost the form. If I reload the page manually (reenter the URL in the browser's address bar), and then press f5, I will see my new content and the empty form field, which is my desired result. For completeness, my CreateStoryComment action looks like this: [HttpPost] public ActionResult CreateStoryComment([Bind(Exclude = "Id, Timestamp, ByUserId, ForUserId")]Comment commentToCreate) { try { commentToCreate.ByUserId = userGuid; commentToCreate.ForUserId = userGuid; commentToCreate.StoryId = 2; // hard-coded for testing _repository.CreateComment(commentToCreate); return View(); } catch { return View(); } }

    Read the article

  • Should I replace string patterns in asp.net mvc using a custom viewengine?

    - by Roger Rogers
    Have an ASP.NET MVC site that is localized. The localization functionality adds the two digit language ID to the URL, e.g. /es/Page. If no language Id is found in the URL, the site switches to the user's browser culture. All's good. However, the site's hyperlinks, a mixture of hard-coded href tags, actionlinks, etc., don't include the base language ID, so when clicking through the site the set culture is lost, and the site reverts to the user's browser culture. My (lazy) thought is to replace all href values, that don't point to an external site, with the localized URL (e.g. include the /es/). Otherwise, all site links will need to be updated to include the culture code. Is this just plain dumb? Or, reasonable, and should be done using a custom view engine, or some other approach?

    Read the article

  • Parallel scroll textarea and webpage with jquery

    - by Roger Rogers
    This is both a conceptual and how-to question: In wiki formatting, or non WYSIWYG editor scenarios, you typically have a textarea for content entry and then an ancillary preview pane to show results, just like StackOverflow. This works fairly well, except with larger amounts of text, such as full page wikis, etc. I have a concept that I'd like critical feedback/advice on: Envision a two pane layout, with the preview content on the left side, taking up ~ 2/3 of the page, and the textarea on the right side, taking up ~ 1/3 of the page. The textarea would float, to remain in view, even if the user scrolls the browser window. Furthermore, if the user scrolls the textarea content, supposing it has exceeded the textarea's frame size, the page would scroll so that the content presently showing in the textarea syncs/is parallel with the content showing in the browser window. I'm imagining a wiki scenario, where going back and forth between markup and preview is frustrating. I'm curious what others think; is there anything out there like this? Any suggestions on how to attack this functionality (ideally using jquery)? Thanks

    Read the article

  • SqlLite/Fluent NHibernate integration test harness initialization not repeatable after large data se

    - by Mark Rogers
    In one of my main data integration test harnesses I create and use Fluent NHibernate's SingleConnectionSessionSourceForSQLiteInMemoryTesting, to get a fresh session for each test. After each test, I close the connection, session, and session factory, and throw out the nested StructureMap container they came from. This works for almost any simple data integration test I can think, including ones that utilize Fluent NHib's PersistenceSpecification object. When I test the application's lengthy database bootstrapping process, which creates and saves thousands of domain objects, I start seeing issues. It's not that the setup and tear down fails, in fact, the test successfully bootstraps the in-memory database as the application would bootstrap the real database in the production environment. The problem occurs when the database bootstrapping occurs a second time on a new in-memory database, with a new session and session factory. The error is: NHibernate.StaleStateException : Unexpected row count: 0; expected: 1 The row count is indeed Unexpected, the row that the application under test is looking for should be in the session. You see, it's not that any data from the last integration test is sticking around, it's that for some reason the session just stops working mid-database-boostrap. And I've looked everywhere for a place I might be holding on to an old session and I can't find one. I've searched through the code for static singleton objects, but there are none anywhere near the code in question. I have a couple StructureMap InstanceScope singleton's but they are getting thrown out with each nested container that is lost after every test teardown. I've tried every possible variation on disposing and closing every object involved with each test teardown and it still fails on this lengthy database bootstrap. But non-bootstrap related database tests appear to work fine. I'm starting to run out of options and may have to surrender lengthy database integration tests in favor of WatiN-based acceptance tests. Can anyone give me any clue about how I can figure out why some of my SingleConnectionSessionSourceForSQLiteInMemoryTesting aren't repeatable? Any advice at all, about how to make an NHibernate SqlLite database integration test harness repeatable?

    Read the article

  • breakdown c++ code size

    - by Evan Rogers
    I'm looking for a nice stackoverflow-style answer to the first question in this old blog post, which I'll repeat below: "I’d really like some tool (ideally, g++ based) that shows me what parts of compiled/linked code are generated from what parts of C++ source code. For instance, to see whether a particular template is being instantiated for hundreds of different types (fixable via a template specialization) or whether code is being inlined excessively, or whether particular functions are larger than expected."

    Read the article

  • Using StructureMap, how do you explicitly trigger the reinstantiation of a object with InstanceScope

    - by Mark Rogers
    I have an integration test harness where I want to teardown and then re-instantiate some of the singleton-scoped objects I've registered with StructureMap, after and before each test. This way I can simulate the actual run time environment, but not have the singleton's state being passed from one test to another. Maybe this isn't a great way to do an integration test, but I'm running out of alternative solutions (read open to any advice). So can an object with InstanceScope.Singleton, be re-instantiated? What's the best way to do re-instantiate a singleton-scoped object with StructureMap?

    Read the article

  • Characters in string changed after downloading HTML from the internet.

    - by Callum Rogers
    Using the following code, I can download the HTML of a file from the internet: WebClient wc = new WebClient(); // .... string downloadedFile = wc.DownloadString("http://www.myurl.com/"); However, sometimes the file contains "interesting" characters like é to é, ? to ↠and ????? to フシギダãƒ. I think it may be something to do with different unicode types or something, as each character gets changed into 2 new ones, perhaps each character being split in half but I have very little knowledge in this area. What do you think is wrong?

    Read the article

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