Search Results

Search found 4763 results on 191 pages for 'adams john'.

Page 111/191 | < Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >

  • can't explain NullPointerException

    - by John Pope
    In the following code, i have a method to get a Vector of persons with the same zodiac sign. persoane is a Vector. I keep getting a NullPointerException at the if condition (persoane is definetly not null). I am unable to see why. Any help would be greatly appreciated public Vector<Persoana> cautaDupaZodie(String zodie) { Vector<Persoana> rezultat= new Vector<Persoana>(); for(int i=0; i<persoane.size(); i++) { if(persoane.get(i).getData().getZodie().equals(zodie)) //the exception occurs here { rezultat.add(persoane.get(i)); } } return rezultat; }

    Read the article

  • Is it good practice to name variables differently when defining more than one function?

    - by John
    For example, in this simple function where fun1 takes as input two numbers, adds them together and passes them to function 2 for printing the output. var1_in is local to each function, so is it OK to use the name var1_in in both functions, or is it better practice to call them different things? fun1 <- function (var1_in, var2_in) { var3 = var1_in + var2_in fun2(var3) } fun2 <- function (var1_in) { var4 = var1_in print(var4) }

    Read the article

  • Building a NSPredicate for a filter

    - by John
    Hi, Just wondering what the best way to build a NSPredicate is if some filters are optional? This is basically for a filter, so if some options aren't selected I don't to filter by them eg. If I have option1 and option2 set for the filter. NSPredicate* predicate = [NSPredicate predicateWithFormat:@"option1 = %@ AND option2 = %@] .... otherwise if just option1 NSPredicate* predicate = [NSPredicate predicateWithFormat:@"option1 = %@] .... The key being there are 10 different options to filter, so I don't want to have to code for the 10x10 possible combinations. Thanks

    Read the article

  • jquery: how to append elements to emtpy object

    - by John
    I want to create a set of options, that will be appended to every select in grid column <option> option 1 </option> <option> option 2 </option> ... <option> option N </option> but I don't know how to create a set of elements without parent element. appending to an empty jquery object doesn't work var options = $(''); options.append('<option></option>')

    Read the article

  • Thoughts on streamlining multiple .Net apps

    - by John Virgolino
    We have a series of ASP.Net applications that have been written over the course of 8 years. Mostly in the first 3-4 years. They have been running quite well with little maintenance, but new functionality is being requested and we are running into IDE and platform issues. The apps were written in .Net 1.x and 2.x and run in separate spaces but are presented as a single suite of applications which use a common navigation toolbar (implemented as a user control). Every time we want to add something to a menu in the nav we have to modify it in all the apps which is a pain. Also, the various versions of Crystal reports and that we used tables to organize the visual elements and we end up with a mess, especially with all the multi-platform .Net versions running. We need to streamline the suite of apps and make it easier to add on new apps without a hassle. We also need to bring all these apps under one .Net platform and IDE. In addition, there is a WordPress blog styled to match the style of the application suite "integrated" into the UI and a link to a MediaWiki Wiki application as well. My current thinking is to use an open source content management system (CMS) like Joomla (PHP based unfortunately, but it works well) as the user interface framework for style templating and menu management. Joomla's article management would allow us to migrate the Wiki content into articles which could be published without interfering with the .Net apps. Then essentially use an IFrame within an "article" to "host" the .Net application, then... Upgrade the .Net apps to VS2010, strip out all the common header/footer controls and migrate the styles to use the style sheets used in the CMS. As I write this, I certainly realize this is a lot of work and there are optimization issues which this may cause as well as using IFrames seems a bit like cheating and I've read about issues with IFrames. I know that we could use .Net application styling, but it seems like a lot more work (not sure really). Also, the use of a CMS to handle the blog and wiki also seems appealing, unless there is a .Net CMS out there that can handle all of these requirements. Given this information, I am looking to know if I am totally going in the wrong direction? We tried to use open source and integrate it over time, but not this has become hard to maintain. Am I not aware of some technology out there that will meet our requirements? Did we do this right and should we just focus on getting the .Net streamlined? I understand that no matter what we do, it's going to be a lot of work. The communities considerable experience would be helpful. Thanks!! PS - A complete rewrite is not an option.

    Read the article

  • `php -v` segmentation fault

    - by John
    I'm getting an odd segmentation fault in PHP. Every few times, when I run: php -v I see: PHP 5.2.6 (cli) (built: Aug 19 2009 16:59:56) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies Segmentation fault (core dumped) Analyzing the core dump (backtrace with gdb): #0 0x00002ba6412f6c6c in ?? () #1 0x0000003f90c06367 in start_thread () from /lib64/libpthread.so.0 #2 0x0000003f904d2f7d in clone () from /lib64/libc.so.6 #3 0x0000000000000000 in ?? () Any ideas? OS: Linux version 2.6.18-92.el5 ([email protected]) (gcc version 4.1.2 20071124 (Red Hat 4.1.2-42)) #1 SMP Tue Jun 10 18:51:06 EDT 2008

    Read the article

  • Is there an existing algorithm for this notation translation/conversion?

    - by John
    A system has a notation that would require writing an expression like (A+B)*C as #MUL(#ADD(A,B),C). Is there already an algorithm to do this kind of notation conversion so users can enter in a more conventional way? In other words an algorithm to convert from infix - my notation. First issue is I don't know an exact name for my notation... it's similar to reverse-polish but not quite. Every operator is encoded as a function taking arguments.

    Read the article

  • Is this a bug? Or is it a setting in ASP.NET 4 (or MVC 2)?

    - by John Gietzen
    I just recently started trying out T4MVC and I like the idea of eliminating magic strings. However, when trying to use it on my master page for my stylesheets, I get this: <link href="<%: Links.Content.site_css %>" rel="stylesheet" type="text/css" /> rending like this: <link href="&lt;%: Links.Content.site_css %>" rel="stylesheet" type="text/css" /> Whereas these render correctly: <link href="<%: Url.Content("~/Content/Site.css") %>" rel="stylesheet" type="text/css" /> <link href="<%: Links.Content.site_css + "" %>" rel="stylesheet" type="text/css" /> It appears that, as long as I have double quotes inside of the code segment, it works. But when I put anything else in there, it escapes the leading "less than". Is this something I can turn off? Is this a bug? Edit: This does not happen for <script src="..." ... />, nor does it happen for <a href="...">. Edit 2: Minimal case: <link href="<%: string.Empty %>" /> vs <link href="<%: "" %>" />

    Read the article

  • I want just the insert query for a temp table.

    - by John Stephen
    Hi..I am using C#.Net and Sql Server ( Windows Application ). I had created a temporary table. When a button is clicked, temporary table (#tmp_emp_details) is created. I am having another button called "insert Values" and also 5 textboxes. The values that are entered in the textbox are used and whenever com.ExecuteNonQuery(); line comes, it throws an error message Invalid object name '#tbl_emp_answer'.. Below is the set of code.. Please give me a solution. Code for insert (in insert value button): private void btninsertvalues_Click(object sender, EventArgs e) { username = txtusername.Text; examloginid = txtexamloginid.Text; question = txtquestion.Text; answer = txtanswer.Text; useranswer = txtanswer.Text; SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=tempdb;Integrated Security=True;"); SqlCommand com = new SqlCommand("Insert into #tbl_emp_answer values('"+username+"','"+examloginid+"','"+question+"','"+answer+"','"+useranswer+"')", con); con.Open(); com.ExecuteNonQuery(); con.Close(); }

    Read the article

  • Object or primitive type

    - by John
    Hi, Can someone explain to me the usage of Integer, Boolean etc in place of their primitive types in JAVA? I can't seem to grasp the advantages their are providing. They seem to create unnecessary problems of handling null values. Thanks!

    Read the article

  • Polling servers at the same port - Threads and Java

    - by John
    Hi there. I'm currently busy working on an IP ban tool for the early versions of Call of Duty 1. (Apparently such a feature wasn't implemented in these versions). I've finished a single threaded application but it won't perform well enough for multiple servers, which is why I am trying to implement threading. Right now, each server has its own thread. I have a Networking class, which has a method; "GetStatus" -- this method is synchronized. This method uses a DatagramSocket to communicate with the server. Since this method is static and synchronized, I shouldn't get in trouble and receive a whole bunch of "Address already in use" exceptions. However, I have a second method named "SendMessage". This method is supposed to send a message to the server. How can I make sure "SendMessage" cannot be invoked when there's already a thread running in "GetStatus", and the other way around? If I make both synchronized, I will still get in trouble if Thread A is opening a socket on Port 99999 and invoking "SendMessage" while Thread B is opening a socket on the same port and invoking "GetStatus"? (Game servers are usually hosted on the same ports) I guess what I am really after is a way to make an entire class synchronized, so that only one method can be invoked and run at a time by a single thread. Hope that what I am trying to accomplish/avoid is made clear in this text. Any help is greatly appreciated.

    Read the article

  • SQL Databases and table design/organization

    - by John McMullen
    (NOOB disclaimer) I'm working on a system (a type of map), that is accessed mostly via 3 fields: ID (auto incremented), X coordinate, and Y coordinate. As it is right now, i have all data on the map, stored in 1 table. Whenever the map display is loaded it simply queries the database for contents in x and y, and the DB gives the data (other fields in the same entry). If an item on the map is doing something, it has a flag saying its doing something, and then has an ID of the action in another table holding that type of 'actions'. Essentially, for all map data, its stored in 1 table. All actions of a certain type are stored in their own table. I'm a noob, and i'm wondering what the most effective/efficient structure for such a design? (a map that has items, and each item has stats/actions). I'm using PHP atm, using standard SQL queries to get my data. Should i split up the tables so that there are only x number of entries on a table? (coord range limits)? Should it just keep growing and growing? There's a lot of queries to the table... so just tryin to see what is best :/

    Read the article

  • POST parameters strangely parsed inside phantomjs

    - by user61629
    I am working with PHP/CURL and would like to send POST data to my phantomjs script, by setting the postfields array below: In my php controller I have: $data=array('first' => 'John', 'last' => 'Smith'); $url='http://localhost:7788/'; $output = $this->my_model->get_data($url,$data); In my php model I have: public function get_data($url,$postFieldArray) { $ch = curl_init(); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookieFile); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS, $postFieldArray); curl_setopt($ch, CURLOPT_URL, $url); $output = curl_exec($ch); In my phantomJS script that I am running locally I have: // import the webserver module, and create a server var server = require('webserver').create(); var port = require('system').env.PORT || 7788; console.log("Start Application"); console.log("Listen port " + port); // Create serever and listen port server.listen(port, function(request, response) { // Print some information Just for debbug console.log("We got some requset !!!"); console.log("request method: ", request.method); // request.method POST or GET if(request.method == 'POST' ){ console.log("POST params should be next: "); console.log("POST params: ",request.post); exit; } I first start and run the phantomjs script (myscript.js) from the command line, then I run my php script. The output is: $ phantomjs.exe myscript.js Start Application Listen port 7788 null We got some requset !!! request method: POST POST params should be next: POST params: ------------------------------e70d439800f9 Content-Disposition: form-data; name="first" John ------------------------------e70d439800f9 Content-Disposition: form-data; name="last" Smith ------------------------------e70d439800f9-- I'm confused about the the output. I was expecting something more like: first' => 'John', 'last' => 'Smith Can someone explain why it looks this way? How can I parse the request.post object to assign to variables inside myscript.js

    Read the article

  • Easiest way to convert json data into objects with methods attached?

    - by John Mee
    What's the quickest and easiest way to convert my json, containing the data of the objects, into actual objects with methods attached? By way of example, I get data for a fruitbowl with an array of fruit objects which in turn contain an array of seeds thus: {"fruitbowl": [{ "name": "apple", "color": "red", "seeds": [] },{ "name": "orange", "color": "orange", "seeds": [ {"size":"small","density":"hard"}, {"size":"small","density":"soft"} ]} } That's all nice and good but down on the client we do stuff with this fruit, like eat it and plant trees... var fruitbowl = [] function Fruit(name, color, seeds){ this.name = name this.color = color this.seeds = seeds this.eat = function(){ // munch munch } } function Seed(size, density){ this.size = size this.density = density this.plant = function(){ // grow grow } } My ajax's success routine currently is currently looping over the thing and constructing each object in turn and it doesn't handle the seeds yet, because before I go looping over seed constructors I'm thinking Is there not a better way? success: function(data){ fruitbowl.length = 0 $.each(data.fruitbowl, function(i, f){ fruitbowl.push(new Fruit(f.name, f.color, f.seeds)) }) I haven't explored looping over the objects as they are and attaching all the methods. Would that work?

    Read the article

  • Paginating data, has to be a better way

    - by John Tyler
    I've read like 10 or so "tutorials", and they all involve the same thing: Pull a count of the data set Pull the relevant data set (LIMIT, OFFSET) IE: SELECT COUNT(*) FROM table WHERE something = ? SELECT * FROM table WHERE something =? LIMIT ? offset ?` Two very similar queries, no? There has to be a better way to do this, my dataset is 600,000+ rows and already sluggish (results are determined by over 30 where clauses, and vary from user to user, but are properly indexed of course).

    Read the article

  • Having trouble with post-commit hook

    - by John Isaacks
    I am following this tutorial that is like the hello world for post-commit I am using unbuntu 10.04. I installed svnnotify and ran $ which svnnotify which output: /usr/bin/svnnotify so I changed the path in the turorial from /usr/local/bin/svnnotify to /usr/bin/svnnotify I also tried changing the line: #!/bin/sh to #!/bin/bash since bash is the login shell in ubuntu 10.04. I tried to run it the way the tutorial originally had it, with my changes, and combinations of the two. Everytime the commit is successful but I get Warning: post-commit hook failed (exit code 1) with no output. The original way had output not found I am very new to linux and shell scripting and have exhausted everything I can think of. What am I doing wrong?

    Read the article

  • Make a mouse pointer do a hyper-jump?

    - by John M
    I run a dual monitor setup. To get from monitor 1 to 2 (or vice-versa) requires lots of unnecessary mouse movement. My thought was to leverage a extra mouse button (I have two) and have the mouse hyper-jump (apologies to Star Trek) from the XY coordinates on monitor 1 to the same XY coordinates on monitor 2. How would I go about doing this? Could it be done via C#?

    Read the article

  • I want a insert query for a temp table

    - by John Stephen
    Hi..I am using C#.Net and Sql Server ( Windows Application ). I had created a temporary table. When a button is clicked, temporary table (#tmp_emp_answer) is created. I am having another button called "insert Values" and also 5 textboxes. The values that are entered in the textbox are used and whenever com.ExecuteNonQuery(); line comes, it throws an error message Invalid object name '#tbl_emp_answer'.. Below is the set of code.. Please give me a solution. Code for insert (in insert value button): private void btninsertvalues_Click(object sender, EventArgs e) { username = txtusername.Text; examloginid = txtexamloginid.Text; question = txtquestion.Text; answer = txtanswer.Text; useranswer = txtanswer.Text; SqlConnection con = new SqlConnection("Data Source=.;Initial Catalog=tempdb;Integrated Security=True;"); SqlCommand com = new SqlCommand("Insert into #tbl_emp_answer values('"+username+"','"+examloginid+"','"+question+"','"+answer+"','"+useranswer+"')", con); con.Open(); com.ExecuteNonQuery(); con.Close(); }

    Read the article

  • R: How to update a package and keep it from reverting to the original?

    - by John
    I want to upgrade the package ggplot2: library(ggplot2) packageDescription("ggplot2")["Version"] > 0.8.3 But the current version is 0.8.7. I tried update.packages(), which seemed to work OK. But it still returned older version 0.8.3. So I downloaded and installed the package source from Cran, which says 0.8.7 in the download page. I then install it via the GUI menu in R. It returns ** building package indices ... * DONE (ggplot2) I then run: packageDescription("ggplot2")["Version"] > 0.8.3 And still I have the older version! I don't know why this is not working, what's more I had already come across this problem before and solved it (I can't remember exactly what) but now it has gone back to the older version! What's the easiest way to keep packages like this updated automatically and not have them refer back to older packages?

    Read the article

  • How do I temporarily change the require path in Ruby ($:)?

    - by John Feminella
    I'm doing some trickery with a bunch of Rake tasks for a complex project, gradually refactoring away some of the complexity in chunks at a time. This has exposed the bizarre web of dependencies left behind by the previous project maintainer. What I'd like to be able to do is to add a specific path in the project to require's list of paths to be searched, aka $:. However, I only want that path to be searched in the context of one particular method. Right now I'm doing something like this: def foo() # Look up old paths, add new special path. paths = $: $: << special_path # Do work ... bar() baz() quux() # Reset. $:.clear $: << paths end def bar() require '...' # If called from within foo(), will also search special_path. ... end This is clearly a monstrous hack. Is there a better way?

    Read the article

  • Convolving two signals

    - by John Elway
    Calculate the convolution of the following signals (your answer will be in the form of an equation): h[n] = delta[n-1] + delta[n+1], x[n] = delta[n-a] + delta[n+b] I'm lost as to what I do with h and x. Do I simply multiply them? h[n]*x[n]? I programmed convolution with several types of blurs and edge detectors, but I don't see how to translate that knowledge to this problem. please help!

    Read the article

  • Which XML library for what purposes?

    - by John Mee
    A search for "python" and "xml" returns a variety of libraries for combining the two. This list probably faulty: xml.dom xml.etree xml.sax xml.parsers.expat PyXML beautifulsoup? HTMLParser htmllib sgmllib Be nice if someone can offer a quick summary of when to use which, and why.

    Read the article

  • Include a unique URL in EXE

    - by John Grey
    Hi :) I want to give users of my site the ability to upload their software/hardware configuration automatically on Windows. So I'm thinking of having an EXE file download, and somehow put in that EXE a unique URL for each user. When the data is collected, the program would just posts some JSON to that URL. How can I do it? I'm most familiar with .NET platform. Tools like this do exist, for example Blizzard uses this approach for their beta test enroll. Each user downloads a slightly different EXE. TIA

    Read the article

< Previous Page | 107 108 109 110 111 112 113 114 115 116 117 118  | Next Page >