Search Results

Search found 964 results on 39 pages for 'ryan migita'.

Page 26/39 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • CDI SessionScoped Bean results in two instances in same session

    - by Ryan
    I've got two instances of a SessionScoped CDI bean for the same session. I was under the impression that there would be one instance generated for me by CDI, but it generated two. Am I misunderstanding how CDI works, or did I find a bug? Here is the bean code: package org.mycompany.myproject.session; import java.io.Serializable; import javax.enterprise.context.SessionScoped; import javax.faces.context.FacesContext; import javax.inject.Named; import javax.servlet.http.HttpSession; @Named @SessionScoped public class MyBean implements Serializable { private String myField = null; public MyBean() { System.out.println("MyBean constructor called"); FacesContext fc = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession)fc.getExternalContext().getSession(false); String sessionId = session.getId(); System.out.println("Session ID: " + sessionId); } public String getMyField() { return myField; } public void setMyField(String myField) { this.myField = myField; } } Here is the Facelet code: <?xml version='1.0' encoding='UTF-8' ?> <!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" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> <f:view contentType="text/html" encoding="UTF-8"> <h:head> <title>Test</title> </h:head> <h:body> <h:form id="form"> <h:inputText value="#{myBean.myField}"/> <h:commandButton value="Submit"/> </h:form> </h:body> </f:view> </html> Here is the output from deployment and navigating to page: INFO: Loading application org.mycompany_myproject_war_1.0-SNAPSHOT at /myproject INFO: org.mycompany_myproject_war_1.0-SNAPSHOT was successfully deployed in 8,237 milliseconds. INFO: MyBean constructor called INFO: Session ID: 175355b0e10fe1d0778238bf4634 INFO: MyBean constructor called INFO: Session ID: 175355b0e10fe1d0778238bf4634 Using GlassFish 3.0.1

    Read the article

  • How do I attach a link (to a View) to an image in ASP.NET MVC?

    - by Ryan Pitts
    Ok, so here is my situation. I am creating a web application using ASP.NET MVC 2 using the C# language. I have programmed in HTML, CSS, and PHP for several years and I am very new to ASP.NET. The part that I am having trouble with is the image gallery. The setup: I have a link on the navigation bar that goes to a "Galleries" page. This page will show a list of galleries. Each gallery has a title, an image, and a description. All of this information is pulled from an XML file. I'm using the XML file like a database. I wanted to use this method so that i could easily update the list of galleries and have the updated XML file automatically be reflected by the website. Now, the galleries should link to an "Images" page. This page will display a list of images within the gallery based on what gallery was selected. This page will also pull from an XML file. The problem: I cannot seem to attach a dynamic link to the image? I am also stuck and not sure how to get the correct View to display. I know I need to do something with the controllers and models, right? I have some code if needed? I would greatly appreciate any help or direction for this! Thanks!

    Read the article

  • How can I split my conkeror-rc config over multiple files?

    - by Ryan Thompson
    Short version: can you help me fill in this code? var conkeror_settings_dir = ".conkeror.mozdev.org/settings"; function load_all_js_files_in_dir (dir) { var full_path = get_home_directory().appendRelativePath(dir); // YOUR CODE HERE } load_all_js_files_in_dir(conkeror_settings_dir); Background I'm trying out Conkeror for web browsing. It's an emacs-like browser running on Mozilla's rendering engine, using javascript as configuration language (filling the role that elisp plays for emacs). In my emacs config, I have split my customizations into a series of files, where each file is a single unit of related options (for example, all my perl-related settings might be in perl-settings.el. All these settings files are loaded automatically by a function in my .emacs that simply loads every elisp file under my "settings" directory. I am looking to structure my Conkeror config in the same way, with my main conkeror-rc file basically being a stub that loads all the js files under a certain directory relative to my home directory. Unfortunately, I am much less literate in javascript than I am in elisp, so I don't even know how to "source" a file.

    Read the article

  • RSA Encryption C#

    - by Ryan
    Hi guys, I have a class which in C# doing RSA encryption where I used the default RSACryptoServiceProvider class. But I have a concern regarding the following; If you have the word hello for an input and the encrypted string is returned as ABCDE, if you perform another encrypt operation on the input hello, using the same keys (public and private) for the RSA will the output be again ABCDE? Thanks in advance

    Read the article

  • How to use R's ellipsis feature when writing your own function?

    - by Ryan Thompson
    The R language has a nifty feature for defining functions that can take a variable number of arguments. For example, the function data.frame takes any number of arguments, and each argument becomes the data for a column in the resulting data table. Example usage: > data.frame(letters=c("a", "b", "c"), numbers=c(1,2,3), notes=c("do", "re", "mi")) letters numbers notes 1 a 1 do 2 b 2 re 3 c 3 mi The function's signature includes an ellipsis, like this: function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, stringsAsFactors = default.stringsAsFactors()) { [FUNCTION DEFINITION HERE] } I would like to write a function that does something similar, taking multiple values and consolidating them into a single return value (as well as doing some other processing). In order to do this, I need to figure out how to "unpack" the ... from the function's arguments within the function. I don't know how to do this. The relevant line in the function definition of data.frame is object <- as.list(substitute(list(...)))[-1L], which I can't make any sense of. So how can I convert the ellipsis from the function's signature into, for example, a list? To be more specific, how can I write get_list_from_ellipsis in the code below? my_ellipsis_function(...) { input_list <- get.list.from.ellipsis(...) output_list <- lapply(X=input_list, FUN=do_something_interesting) return(output_list) } my_ellipsis_function(a=1:10,b=11:20,c=21:30)

    Read the article

  • Trying to calculate large numbers in Python with gmpy. Python keeps crashing?

    - by Ryan Peschel
    I was recommended to use gmpy to assist with calculating large numbers efficiently. Before I was just using python and my script ran for a day or two and then ran out of memory (not sure how that happened because my program's memory usage should basically be constant throughout.. maybe a memory leak?) Anyways, I keep getting this weird error after running my program for a couple seconds: mp_allocate< 545275904->545275904 > Fatal Python error: mp_allocate failure This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Also, python crashes and Windows 7 gives me the generic python.exe has stopped working dialog. This wasn't happening with using standard python integers. Now that I switch to gmpy I am getting this error just seconds in to running my script. I thought gmpy was specialized in dealing with large number arithmetic? For reference, here is a sample program that produces the error: import gmpy2 p = gmpy2.xmpz(3000000000) s = gmpy2.xmpz(2) M = s**p for x in range(p): s = (s * s) % M I have 10 gigs of RAM and without gmpy this script ran for days without running out of memory (still not sure how that happened considering s never really gets larger.. Anyone have any ideas? EDIT: Forgot to mention I am using Python 3.2

    Read the article

  • What's the best way to match a query to a set of keywords?

    - by Ryan Detzel
    Pretty much what you would assume Google does. Advertisers come in and big on keywords, lets say "ipod", "ipod nano", "ipod 60GB", "used ipod", etc. Then we have a query, "I want to buy an ipod nano" or "best place to buy used ipods" what kind of algorithms and systems are used to match those queries to the keyword set. I would imagine that some of those keyword sets are huge, 100k keywords made up of one or more actual words. on top of that queries can be 1-n words as well. Any thoughts, links to wikipedia I can start reading? From what I know already I would use some stemmed hash in disk(CDB?) and a bloom filter to check to see if I should even go to disk.

    Read the article

  • Help needed in filling a questionnaire for dissertation will only take 5 minutes

    - by Ryan
    I am a Maltese student currently working on my dissertation which focuses on J2ME Wireless SOAP protocol. Since in my country i.e. Malta we don’t have professional mobile developers I had to turn myself to online questionnaires for my research methodology those of you who has done a thesis know what I am talking about ?. Please I anyone who has ever done any mobile development which concerns SOAP or any similar protocol used for web services, could you kindly answer my questionnaire as this is an essential core part of my thesis. Please respond with honesty and at your earliest convince since time is of top priority. Below is the link to the questionnaire: http://www.kwiksurveys.com/online-survey.php?surveyID=KHOHIO_c6f874da Thanks in advance

    Read the article

  • Mercurial repository usage with binary files for building setup files

    - by Ryan
    I have an existing Mercurial repository for a C++ application in a small corporate environment. I asked a co-worker to add the setup script to the repository and he added all of the dependency binaries, PDFs, and executable to the repository under an Install directory. I dislike having the binaries and dependencies in the same repository, but I'd like recommendations on best practices. Here are the options I am considering: Create a separate repository for the Installer and related files Create a subrepository for the Installer and related files Use a (yet to be identified) build dependency manager I am concerned with using a subrepository with Mercurial based on what I've read so far and the (apparently) incomplete implementation. I would like to get a project dependency system, e.g. Ivy, but I don't know all of the options and haven't had time yet to try out any options. I thought I'd use TortoiseHg as a basis, and it does not have the TortoiseHg binaries in the repository although it does have some binaries such as kdiff3.exe. Instead it uses setup.py to clone multiple repositories and build the apps. This seems reasonable for OSS, but not so much for corporate environments. Recommendations?

    Read the article

  • How do I specify a project dependency with Hudson?

    - by Brett Ryan
    We have common library projects shared amongst many projects that are required to be checked out into a "Libraries" folder which a developer needs to checkout prior to opening the main project in visual studio. How I tell hudson that there is this dependency? I figured one thing I could do is setup a custom workspace and specify the location for all projects, but how do I wire up the dependency between them all? Is simply specifying "Build after other projects are built" enough?

    Read the article

  • MCV/MVP Patterns and Applications that interface with Hardware (DAQ/PLC/etc)

    - by Ryan
    I've been reading a lot about the MCV and MVP patterns for use with UI and it seems like a really nice powerful way to handle user interfaces. I am - however - having a difficult time deciding how this could integrate into a system where data in the model is created from a Data Acquisition System or Serial/Ethernet devices. There is also the added step that 70% of application interaction is performed by a PLC instead of a live user. It seems that for apps that just read/write & manipulate information from a database this works great, but how does does hardware and automation fit into these patterns? Is it as simple as another controller (for lack of a better term) that interacts with hardware that manipulates data and writes to a model? Maybe I am over thinking this or thinking too simply, so any advice would be great. I'm not quite sure where I'm going with this, so if something doesn't make sense or I was too vague leave me a comment. Thanks!

    Read the article

  • How to Practically Split Values from CSV File into MySQL Database

    - by Ryan
    Let's suppose I have the following line in a CSV file (I removed the header row in this example): "500,000",2,50,2,90000 I have a PHP script read the CSV file, break the file into individual lines, and store each line in an array called $linearray. Then, I use a foreach loop to look at each line individually. Within the foreach loop, I break the line into separate variables using the following function: $line = str_replace("'","\'",$line); From here, I insert the values into separate columns within a MySQL database. The script works. The values are inserted into a database, but I run into a problem. I want: "500,000" | 2 | 50 | 2 | 90000 But I get this: "500 | 000" | 2 | 50 | 2 | 90000 The script isn't smart enough to understand it should skip commas within quotation marks. Do you know how I can alter my script to make sure I get the output I'm looking for? Thanks.

    Read the article

  • Executing logic before save or validation with EF Code-First Models

    - by Ryan Norbauer
    I'm still getting accustomed to EF Code First, having spent years working with the Ruby ORM, ActiveRecord. ActiveRecord used to have all sorts of callbacks like before_validation and before_save, where it was possible to modify the object before it would be sent off to the data layer. I am wondering if there is an equivalent technique in EF Code First object modeling. I know how to set object members at the time of instantiation, of course, (to set default values and so forth) but sometimes you need to intervene at different moments in the object lifecycle. To use a slightly contrived example, say I have a join table linking Authors and Plays, represented with a corresponding Authoring object: public class Authoring { public int ID { get; set; } [Required] public int Position { get; set; } [Required] public virtual Play Play { get; set; } [Required] public virtual Author Author { get; set; } } where Position represents a zero-indexed ordering of the Authors associated to a given Play. (You might have a single "South Pacific" Play with two authors: a "Rodgers" author with a Position 0 and a "Hammerstein" author with a Position 1.) Let's say I wanted to create a method that, before saving away an Authoring record, it checked to see if there were any existing authors for the Play to which it was associated. If no, it set the Position to 0. If yes, it would find set the Position of the highest value associated with that Play and increment by one. Where would I implement such logic within an EF code first model layer? And, in other cases, what if I wanted to massage data in code before it is checked for validation errors? Basically, I'm looking for an equivalent to the Rails lifecycle hooks mentioned above, or some way to fake it at least. :)

    Read the article

  • How Do I Pass The Value (Not The Reference) of a JS Variable to a Function?

    - by ryan
    Here is a simplified version of something I'm trying to run: for (var i = 0; i < results.length; i++) { marker = results[i]; google.maps.event.addListener(marker, 'click', function() { change_selection(i); }); } but I'm finding that every listener uses the value of results.length (the value when the for loop terminates). How can I add listeners such that each uses the value of i at the time I add it, rather than the reference to i?

    Read the article

  • Understanding The Convolution Matrix

    - by Ryan Naddy
    I am learning about the Convolution Matrix, and I understand how they work, but I don't understand how to know before hand what the output of a Matrix will look like. For example lets say I want to add a blur to an image, I could guess 10,000+ different combinations of numbers before I get the correct one. I do know though that this formula will give me a blur effect, but I have no idea why. float[] sharpen = new float[] { 1/9f, 1/9f, 1/9f, 1/9f, 1/9f, 1/9f, 1/9f, 1/9f, 1/9f }; Can anyone either explain to me how this works or point me to some article, that explains this? I would like to know before hand what a possible output of the matrix will be without guessing. Basically I would like to know why do we put that number in the filed, and why not some other number?

    Read the article

  • Supress output from Visual Studio output pane (C++)

    - by Ryan Ginstrom
    When I run my Win32 project in the Visual Studio debugger, I get this huge screed of output about which DLLs were loaded, first-chance exceptions, and so on. Is there a way that I can suppress this output? Some day, I might want to know when 'C:\Windows\SysWOW64\ntdll.dll' was loaded, but normally I don't care. This is especially true when I'm running unit tests, and just want to be told whether any of the tests failed. This stuff isn't output with console applications, but it is with windows applications. To give an example of what I mean, here are the first lines from the output of a recent unit-test run. 'MyProject.exe': Loaded 'C:\dev\MyProject\Testing\MyProject.exe', Symbols loaded. 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\dbghelp.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\msvcrt.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\user32.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\gdi32.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\lpk.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\usp10.dll' 'MyProject.exe': Loaded 'C:\Windows\SysWOW64\advapi32.dll' ... and on and on ...

    Read the article

  • Sharepoint publishing cache- counter missing on WFE(Object Caching)

    - by Ryan
    I want to tune object caching in my sharepoint environment. The way to do is check sharepoint publishing cache counter through perfmon on your farm. I have one application server and 2 WFE but when I am trying to create counter for my WFE its showing Sharepoint publishing cache but I am not able to add any instance of it but when I select my application server I can see all the instances. But If I want to check publishing hit ratio i need to run this on WFE also ...correct me if I m wrong? How to resolve this issue? Also, how to check the hit ratio as our site is not go-live so we don't get enuf users to hit the site to check this thing. Does it means that I can tune it up only my site go live and real load will get on it. Thanks, Amit

    Read the article

  • WebClient.DownloadString() Not Producing Exact HTML

    - by Ryan Fuentes
    So here's the deal. I'm creating a spider bot for a website that scans all the product pages and records the product data. I'm using C# and the WebClient library to download the HTML string. The site I'm crawling must be specially made because the HTML that is received from WebClient.DownloadString() is different than the HTML that I get when I view the source of the HTML when visiting it on a browser. This seems intentional because the only info I can't get is the price. Does anyone know a workaround for this problem or can anyone explain what is happening? Thanks.

    Read the article

  • Memory Leak with jQuery UI inside UpdatePanel in ie7

    - by Ryan
    I have a fairly complex asp.net page based on UpdatePanels and jQuery UI. Unfortunately, when the panels update, the jQuery UI widgets leak memory like crazy in ie7, even if I manually 'destroy' them. Does anyone know a technique/patch to prevent these leaks? I've created a simple example page with a slider inside an UpdatePanel. Just click the 'Leak' button and refresh the page to see the leak in sieve. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Leak2.aspx.cs" Inherits="Leak2" %> <%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %> <!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 runat="server"> <title>Leak</title> <link type="text/css" href="/jquery/css/custom-theme/jquery-ui-1.7.2.custom.css" rel="Stylesheet" /> <script type="text/javascript" src="/jquery/js/jquery-1.3.2.min.js"></script> <script type="text/javascript" src="/jquery/js/jquery-ui-1.7.2.custom.min.js"></script> </head> <body> <form id="form1" runat="server"> <div> <script type="text/javascript"> function initializeSlider() { $(".slider").slider({ min: 0, max: 100, value: 100, step: 5 }); } $(document).ready(function() { initializeSlider(); Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function() { initializeSlider(); }); }); </script> <asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <div style="width: 300px;"> <div class="slider"></div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Leak" /> </div> </ContentTemplate> </asp:UpdatePanel> </div> </form> </body> </html>

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >