Search Results

Search found 1163 results on 47 pages for 'nick rtz'.

Page 32/47 | < Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >

  • Cocoa - Change text of label

    - by Nick
    I've got a cocoa application that reads in a text file. I'd like to display that text in a multi-line label, but I for the life of me can't figure it out. I opened up my .nib file and poped a multi-line label down but after that I'm stuck. I don't have any experience working with XCode or Cocoa, mostly Eclipse, Visual Studio, and pretty much every other IDE except XCode which seems very foreign.

    Read the article

  • Using JSP to Tail a file

    - by nick
    Is there a way to use JSP to create a file tail like Linux's "tail -f" and cache the results? That is, can I read the last X items, cache, and then read again if I get a request that exceeds some timeout?

    Read the article

  • Php JSON Response Array

    - by Nick Kl
    I have this php code. As you can see i query a mysql database through a function showallevents. I return a the $result to the $event variable. I try to return all rows of the data that i take with the msql_fetch_assoc. I don't get response even when i encode the $response variable. It returns null to all fields. Can anyone help me on what i am doing wrong. I had a valid code but it was returning only 1 row of data so i tried to make an associative array but seems i am failing. if ($tag == 'showallevents') { // Request type is show all events // show all events $event = $db->showallevents(); if ($event != false) { $data = array(); while($row = mysql_fetch_assoc($event)) { $data[] = array( $response["success"] = 1, $response["uid"] = $event["uid"], $response["event"]["date"] = $event["date"], $response["event"]["hours"] = $event["hours"], $response["event"]["store_name"] = $event["store_name"], $response["event"]["event_information"] = $event["event_information"], $response["event"]["event_type"] = $event["event_type"], $response["event"]["Phone"] = $event["Phone"], $response["event"]["address"] = $event["address"], $response["event"]["created_at"] = $event["created_at"], $response["event"]["updated_at"] = $event["updated_at"]); } echo json_encode($data); } else { // event not found // echo json with error = 1 $response["error"] = 1; $response["error_msg"] = "Events not found"; echo json_encode($response); } } else { echo "Access Denied"; } } ?>

    Read the article

  • Trying to match variables in a PHP array

    - by Nick B
    I'm stuck with a php array problem. I've to a webpage that takes values from a URL, and I need to cross reference those values against some values on the page and if they match output a 'yes'. It's an expression engine bodge job. The URL is something like domain.com/page/C12&C14 The C12 and C14 represent different categories. I've taken the last bit of the url, removed the 'C' from the values and then exploded the 12&14 into an array. I print_r the array on the page and it shows: Array ( [0] = 12 [1] = 14 ) So, the values are in the array. Lovely. Now on the page I have an html list which looks like 10 12 14 15 I want to output a YES next to the variables that are current in the array so the ideal output would be: 10 12 - YES 14 - YES 15 I was trying this but it keeps just saying No next to all of them. $currentnumber = 12; foreach ($tharray as $element) { if ($element == $currentnumber) { echo "Yes"; } else { echo "No"; } } I thought that should work, but it's not. I checked and the array and the variable are both stings. I did a strlen() on both to see if they are the same, but $currentnumber outputs '13' and the array variable outputs '2'. Any ideas as to why it's saying 13? Is the variable the wrong type of string - and if so how would I convert it?

    Read the article

  • SVG Using Adobe in IE doesn't work when loading page, but saving the page and then loading it works.

    - by Nick
    So I'm trying to get a SVG document to load in IE. I can see it fine, but all calls to .getSVGDocument() fail, the svg onload="onload()" function never gets called and the right-click Adobe SVG Viewer context menu doesn't show up when right-clicking on the svg. It seems as though I'm managing to crash the adobe SVG viewer or something before it is able to call the onload function but after it has drawn the SVG document. As a test I saved the html page to my hard drive and loaded it up and walla - it works! Right-click, onload, and .getSVGDocument() all work. Very curious. For some reason getting the page from the server makes the adobe plugin crap out but loading up static HTML is fine. Any thoughts?

    Read the article

  • How to do an additional search on archive in rails if record not found, by extending model?

    - by Nick Gorbikoff
    Hello, I was wondering if somebody knows an elegant solution to the following: Suppose I have a table that holds orders, with a bunch of data. So I'm at 1M records, and searches begin to take time. So I want to speed it up by archiving some data that is more than 3 years old - saving it into a table called orders-archive, and then purging them from the orders table. So if we need to research something or customer wants to pull older information - they still can, but 99% of the lookups are done on the orders no older than a year and a half - so there is no reason to keep looking through older data all the time. These move & purge operations can be then croned to be done on a weekly basis. I already did some tests and I know that I will slash my search times by about 4 times. So far so good, right? However I was thinking about how to implement older archival lookups and the only reasonable thing I can think of is some sort of if-else If not found in orders, do a search in orders-archive. However - I have about 20 tables that I want to archive and god knows how many searches / finds are done through out the code, that I don't want to modify. So I was wondering if there is an elegant rails-way solution to this problem, by extending a model somehow? Has anyone dealt with similar case before? Thank you.

    Read the article

  • How would make this run with an if statement and one for loop?

    - by Nick Jacobs
    I'm trying to get this to run by using an if statment, a for loop, and a list. The list is part of the parameters. I am not sure how to write the if statement and have the program loop through all of the different words and set everything how it is supposed to be. newSndIdx=0; for i in range (8700, 12600+1): sampleValue=getSampleValueAt(sound, i) setSampleValueAt(newSnd, newSndIdx, sampleValue) newSndIdx +=1 newSndIdx=newSndIdx+500 for i in range (15700, 17600+1): sampleValue=getSampleValueAt(sound, i) setSampleValueAt(newSnd, newSndIdx, sampleValue) newSndIdx +=1 newSndIdx=newSndIdx+500 for i in range (18750, 22350+1): sampleValue=getSampleValueAt(sound, i) setSampleValueAt(newSnd, newSndIdx, sampleValue) newSndIdx +=1 newSndIdx=newSndIdx+500 for i in range (23700, 27250+1): sampleValue=getSampleValueAt(sound, i) setSampleValueAt(newSnd, newSndIdx, sampleValue) newSndIdx +=1 newSndIdx=newSndIdx+500 for i in range (106950, 115300+1): sampleValue=getSampleValueAt(sound, i) setSampleValueAt(newSnd, newSndIdx, sampleValue) newSndIdx+=1

    Read the article

  • Reading server-side XML with JavaScript and jQuery

    - by Nick Lowman
    Hello, this is quite a simple question hopefully. Our client currently has a Flash banner ad on their site which they can change the text size, colour, position etc. by editing an XML file. They want to scrap flash and use JavaScript and jQuery. Now, as long as the XML file is at a readable URL I should be able make an AJAX request for the file and use it. Is that correct? Many thanks

    Read the article

  • Am I encrypting my passwords correctly in ASP.NET

    - by Nick
    I have a security class: public class security { private static string createSalt(int size) { //Generate a random cryptographic number RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] b = new byte[size]; rng.GetBytes(b); //Convert to Base64 return Convert.ToBase64String(b); } /// <summary> /// Generate a hashed password for comparison or create a new one /// </summary> /// <param name="pwd">Users password</param> /// <returns></returns> public static string createPasswordHash(string pwd) { string salt = "(removed)"; string saltAndPwd = string.Concat(pwd, salt); string hashedPwd = FormsAuthentication.HashPasswordForStoringInConfigFile( saltAndPwd, "sha1"); return hashedPwd; } } This works fine, but I am wondering if it is sufficient enough. Also, is this next block of code better? Overkill? static byte[] encrInitVector = new byte[] { 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF }; static string encrKey = "(removed)"; public static string EncryptString(string s) { byte[] key; try { key = Encoding.UTF8.GetBytes(encrKey.Substring(0, 8)); DESCryptoServiceProvider des = new DESCryptoServiceProvider(); byte[] inputByteArray = Encoding.UTF8.GetBytes(s); MemoryStream ms = new MemoryStream(); CryptoStream cs = new CryptoStream(ms, des.CreateEncryptor(key, encrInitVector), CryptoStreamMode.Write); cs.Write(inputByteArray, 0, inputByteArray.Length); cs.FlushFinalBlock(); return Convert.ToBase64String(ms.ToArray()); } catch (Exception e) { throw e; }

    Read the article

  • Programming Environment for a Motorola 68000 in Linux

    - by Nick Presta
    Greetings all, I am taking a Structure and Application of Microcomputers course this semester and we're programming with the Motorola 68000 series CPU/board. The course syllabus suggests running something like Easy68K or Teesside Motorola 68000 Assembler/Emulator at home to test our programs. I told my prof I run x64 Linux and asked what sort of environment I would need to complete my coursework. He said that the easiest environment to use is a Windows XP 32bit VM with one of the two suggested applications installed, however, he doesn't really care what I use as long as I can test what I write at home. So I'm asking if there exists some sort of emulator or environment for Linux so I can test my code, and what sort of caveats I will run into by writing and testing my code in Linux. Also, I plan to do my editing in Vim, which probably isn't a problem, but I would like any insight into editors for 68000 assembly, if you have any. Thanks! EDIT: Just to clarify - I don't want to install Linux on the board at all - I want to program on my home machine, test the code locally, and then bring it onto the board for grading/running.

    Read the article

  • Accessing custom user profile fields in CCK

    - by Nick Lowman
    I'm probably going about this the wrong way but... I’ve added a field to the User Profile called profile_real_name which is required by the user. Is there a way to access the details in CCK? For example in CCK when creating a new field I can access the user’s username with the ‘User reference’ Field type and setting the ‘Widget type’ to ‘Autocomplete text field’. Can I do the same with my real name field? Many thanks

    Read the article

  • Passing dependent objects to a parent constructor in Scala

    - by Nick Johnson
    Suppose I have the following class heirarchy: class A() class B(a:A) class C(b:B) class BaseClass(b:B, c:C) Now I want to implement a subclass of BaseClass, which is given an instance of A, and constructs instances of B and C, which it passes to its superclass constructor. If I could use arbitrary expressions, I'd do something like this: b = new B(a) c = new C(b) super(b, c) Because the second argument to the parent constructor depends on the value of the first argument, though, I can't see any way to do this, without using a factory function, or a gratuitous hack, such as : class IntermediateSubclass(b:B) extends BaseClass(b, new C(b)) class RealSubclass(a:A) extends IntermediateSubclass(new B(a)) Is there clean way to do this?

    Read the article

  • Issue reading in a cell from Excel with Apache POI

    - by Nick
    I am trying to use Apache POI to read in old (pre-2007 and XLS) Excel files. My program goes to the end of the rows and iterates back up until it finds something that's not either null or empty. Then it iterates back up a few times and grabs those cells. This program works just fine reading in XLSX and XLS files made in Office 2010. I get the following error message: Exception in thread "main" java.lang.NumberFormatException: empty String at sun.misc.FloatingDecimal.readJavaFormatString(Unknown Source) at java.lang.Double.parseDouble(Unknown Source) at the line: num = Double.parseDouble(str); from the code: str = cell.toString(); if (str != "" || str != null) { System.out.println("Cell is a string"); num = Double.parseDouble(str); } else { System.out.println("Cell is numeric."); num = cell.getNumericCellValue(); } where the cell is the last cell in the document that's not empty or null. When I try to print the first cell that's not empty or null, it prints nothing, so I think I'm not accessing it correctly.

    Read the article

  • ActionListener isn't Implementing

    - by Nick Gibson
    JFrameWithPanel is not abstract and does not override abstract method actionPerformed(java.awt.event.ActionEvent) in java.awt.event.ActionListener public class JFrameWithPanel extends JFrame implements ActionListener I Don't get this code. Book and Java site tells me this is the syntax for the method, but again this error shows up constantly. import javax.swing.*; import javax.swing.JOptionPane; import java.awt.*; import java.awt.event.*; import java.lang.Math.*; import java.lang.Integer.*; import java.util.*; import java.util.Random; import java.io.*; import java.text.*; import java.text.DecimalFormat.*; public class JFrameWithPanel extends JFrame implements ActionListener { JButton button = new JButton("Exit"); public JFrameWithPanel() { super("JFrame with Panel"); JComboBox packageChoice = new JComboBox(); packageChoice.addItem("A+ Certification"); packageChoice.addItem("Network+ Certification "); packageChoice.addItem("Security+ Certifictation"); packageChoice.addItem("CIT Full Test Package"); packageChoice.addActionListener(this); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); JPanel pane = new JPanel(); pane.add(button); pane.add(packageChoice); setContentPane(pane); setSize(200,100); setVisible(true); } } then later public class CreateJFrameWithPanel { public static void main(String[] args) { JFrameWithPanel panel = new JFrameWithPanel(); } }

    Read the article

  • apache httpclient and spawning a browser that will share the session

    - by Nick
    I'm have a java program that uses Apache httpclient api. This is used to login to and communicate to a webapp. Once logged in, there's a situation in which the program issues an execute process to open up firefox to hit the webapp and allow the user to see data in the browser. Since the java program is already logged in, is there a way to share that current session PHPSESSID so that the spawned firefox is already logged in and working in that same session?

    Read the article

  • Running applictions via ruby and multi-core support? (OSX)

    - by Nick Faraday
    Hi All, I'm looking for some tutorials/resources/tips that will show me how to run applications via a ruby script. I have several small tools that we use in our day to day operations that I want to manage their tasks in one ruby script. Basically what I'm trying to do is: run app via ruby script. (wait for result) get result code (success, or error msg) if ok, start the app on its next task. Also each of the tasks are independent so I'd like to take advantage of the 8 cores on my MacPro and run 8 instances at a time. Any resources you could point me towards would be greatly appreciated!

    Read the article

  • PowerPoint PlugIn does not read defaults from .dll.config file

    - by Nick T
    I'm working on a very simple PowerPoint plugin, and I'm quite a bit stumped. In my settings.settings file, I have configured a setting "StartPath", which references where the PowerPoint plugin will navigate to using a Browser component. After I compile the application, and run the installer generated by the Setup project, the application is installed and uses the default value in the settings file. However, if I edit the application.dll.config file, the plugin still uses the old values. How can I set things up such that the plugin references the .dll.config file and not its default settings? The code to access the settings is listed below, including the other variants I have tried: //Attempt 1 string location = MyApplication.Properties.Settings.Default.StartPath; //Attempt 2 string location = ConfigurationManager.AppSettings["StartPath"]; //Attempt 3: Configuration element is inaccessible due to its protection level string applicationName = Environment.GetCommandLineArgs()[0] + ".exe"; string exePath = System.IO.Path.Combine(Environment.CurrentDirectory, applicationName); Configuration config = ConfigurationManager.OpenExeConfiguration(exePath); string location = config.AppSettings["StartPath"];

    Read the article

  • Trust metrics and related algorithms

    - by Nick Gerakines
    I'm trying to learn more about trust metrics (including related algorithms) and how user voting, ranking and rating systems can be wired to stiffle abuse. I've read abstract articles and papers describing trust metrics but haven't seen any actual implementations. My goal is to create a system that allows users to vote on other users and the content of other users and with those votes and related meta-data, determine if those votes can be applied to a users level or popularity. Have you used or seen some sort of trust system within a social graph? How did it work and what were its areas of strength and weaknesses?

    Read the article

  • Pure sine wave inverter

    - by Nick
    Not exactly programming (sorry) but I think it's pretty close and can be of interest to other programmers. I'm trying to setup a battery power station so that I can work from anywhere. I go surfing a lot and my idea is to be able to work from wherever I can park my car (given there's coverage). So, I'm getting a deep cycle battery, a 240V charger (I'm in Australia), and an inverter. At the back of my laptop it says 19V and 4.62A. From the people I've spoken to that means it consumes about 90W at most. So my inverter needs to be able to output about 100W. Most of them seem to be 200W and up so this shouldn't be a problem. I want to be able run my laptop for 10 hours (plus the 2 hours I get from the laptop battery) straight. According to the people I've spoken to and from what I gather online I need a battery that has the amp hours for my "amp draw". I have no idea how to calculate this but I've been guesstimating. Most deep cycle batteries seem to be classified using amp hours (Ah)... 35Ah, 50Ah, 75Ah, 100Ah, and so on. However the amp hours on those batteries is for a 240V and I seem to be using 19V. According to an expert I spoke to you'd need a 100Ah battery to power a 5A appliance at 240V for 10 hours (you only get about 50% useful power). That to me is 5A * 240V = 100Ah battery. So, naive as I might be I take 240V and divide that by my 19V and reach the conclusion that I can get away with a battery that's about 12 times smaller than that 100Ah. The expert told me I needed a 50Ah battery so that's probably what I'll be getting, but it would be interesting to know what I theoretically would need to power my laptop for 10 hours. As for charging the battery the expert I spoke to said I needed a 3-5A charger to be able to charge that 50Ah battery from flat to full in about 10 hours (I will just leave it plugged in over night). Now to my question. The expert said it's not a matter of "if" more like a guaranteed "when" my computer will stuff up if I don't use a "pure sine wave inverter". From what I gather the power that comes out of that battery is not as clean as the power we get in the socket at home. Apparently it's "square" and the one in the socket is nice and smooth. I've already got an inverter, but it's not "pure". Do I really need to buy the $200-300 pure sine wave inverter or can I get away with something else? Perhaps the laptop adapter that sits in the middle of my laptop power cable already fixes that wave to be nice and smooth? Thanks!

    Read the article

  • Javascript: variable scope & the evils of globals

    - by Nick
    I'm trying to be good, I really am, but I can't see how to do it :) Any advice on how to not use a global here would be greatly appreciated. Let's call the global G. Function A Builds G by AJAX Function B Uses G Function C Calls B Called by numerous event handlers attached to DOM elements (type 1) Function D Calls B Called by numerous event handlers attached to DOM elements (type 2) I can't see how I can get around using a global here. The DOM elements (types 1 & 2) are created in other functions (E&F) which are unconnected with A. I don't want to add G to each event handler (because it's large and there's lots of these event handlers), and doing so would require the same kind of solution as I'm seeking here (i.e., getting G to E&F). The global G, BTW, is an array that is necessary to build other elements as they, in turn, are built by AJAX. I'm not convinced that a singleton is real solution, either. Thanks.

    Read the article

  • Truncating a string while storing it in an array in c

    - by Nick
    I am trying to create an array of 20 character strings with a maximum of 17 characters that are obtained from a file named "words.dat". After that the program should truncate the string only showing the first 17 characters and completely ignore the rest of that string. However My question is: I am not quite sure how to accomplish this, can anyone give me some insight on how to accomplish this task? Here is my current code as is: #include <stdio.h> #include <stdlib.h> #define WORDS 20 #define LENGTH 18 char function1(char[WORDS][LENGTH]); int main( void ) { char word_array [WORDS] [LENGTH]; function1(word_array); return ( 0 ) ; } char function1(char word_array[WORDS][LENGTH]) { FILE *wordsfile = fopen("words.dat", "r"); int i = 0; if (wordsfile == NULL) printf("\nwords.dat was not properly opened.\n"); else { for (i = 0; i < WORDS; i++) { fscanf(wordsfile, "%17s", word_array[i]); printf ("%s \n", word_array[i]); } fclose(wordsfile); } return (word_array[WORDS][LENGTH]); } words.dat file: Ninja DragonsFury failninja dragonsrage leagueoflegendssurfgthyjnu white black red green yellow green leagueoflegendssughjkuj dragonsfury Sword sodas tiger snakes Swords Snakes sage Sample output: blahblah@fang:~>a.out Ninja DragonsFury failninja dragonsrage leagueoflegendssu rfgthyjnu white black red green yellow green leagueoflegendssu ghjkuj dragonsfury Sword sodas tiger snakes Swords blahblah@fang:~> What will be accomplished afterwards with this program is: After function1 works properly I will then create a second function name "function2" that will look throughout the array for matching pairs of words that match "EXACTLY" including case . After I will create a third function that displays the 20 character strings from the words.dat file that I previously created and the matching words.

    Read the article

< Previous Page | 28 29 30 31 32 33 34 35 36 37 38 39  | Next Page >