Hello to all, I have a ruby script with a very long hash with more than 300 associations. The script looks like below: #!/usr/bin/env ruby Array_A = [] myHash = { "x1" => "2", "x2" => "0", "x3" => "1", . . . "X350" => "1" } myHash.keys.each do |z| Array_A << "This is key " + z end puts myHash.values.join("|") puts Array_A.join("|") But since the hash is very large, for reading purposes I'd like to put the hash at the end of the script and the each.do loop and puts command first, something like below. Is there a way …

Member Avatar
Member Avatar
+0 forum 8

I'm making a class for boolean expressions, a simpler version of bool. I need three operators, one for AND, one for OR and one for NOT. I can easily make **+** for OR, by overloading, but how can i declare **.** for AND and **'** for NOT? Can i even do this? Thanks in advance P.S, i'm a beginner :)

Member Avatar
Member Avatar
+0 forum 3

I'm having some trouble defining constants correctly. I know the format should be this: Const CONSTANT_NAME [As ConstantType] = value But I'm a little unclear of how to word it. So here is the Line I need to change into a Constant. Normally I would have a BAS file do this but I can't find one (Refer to other post). Code: With oXLSheet.Range("A1:A10") .Font.ColorIndex = 50 .HorizontalAlignment = xlCenter .VerticalAlignment = xlCenter End With That's the entire section that I'm dealing with. I don't think all of it needs to be constants, but maybe it does? I'm not sure. All …

Member Avatar
Member Avatar
+0 forum 1

Hi All! I'm trying to call a method defined in a jsp that is in my webcontent web application. I placed [CODE] <%@include file="method.jsp"%>[/CODE] in the jsp from where I want to call the method. I get an exception saying: [CODE]org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 247 in the jsp file: /replaceBlob.jsp The method replace(String, char, String, String) is undefined for the type replaceBlob_jsp[/CODE]

Member Avatar
Member Avatar
+0 forum 4

i made a header file with my function declarations and the cpp file with the definitions. While making the definitions in the .cpp file i included the header and from the highlighted text the definitions seemed to match declarations in the header. In the header the the declarations were able to show where each definition is located. But when i run a test, i get error that appears to be saying the definition cant be found. C:\Users\JAMES\programs\ClassTest-build-desktop-Qt_4_7_4_for_Desktop_-_MinGW_4_4__Qt_SDK__Debug\..\ClassTest\main.cpp:13: error: undefined reference to `fraction::addFractions(fraction)' cpp file [CODE] #include "Jims header.h" fraction::addFractions(fraction two) { int a1=_whole*_bottom+_top; int a2=two.Whle()*two.Den()+two.Num(); int b1=one.Den(); int b2=two.Den(); int …

Member Avatar
Member Avatar
+0 forum 6

Hi all, im looking for some help help, i have this css which looks great, im happy with how the input type text boxes are displayed and the textarea looks neat too - What I cant figure out is when I add a combo box, check box or image I cant resize them. Im trying to add a search image to a form, but the form increases the size of the image. any help would be appreciated please. heres my form [CODE] <input type="image" src="img/search.png" width="169" height="48" name="button" class="ta" /> [/CODE] heres the complete css - If someone can show …

Member Avatar
Member Avatar
+0 forum 5

Problem when i am using $webRoot / $srvRoot as a value for a variable or in defining a constant Code & problem is below: [CODE]<?php ini_set('display_errors', 'On'); error_reporting(E_ALL); $thisFile = str_replace('\','/', __FILE__); $docRoot = $_SERVER['DOCUMENT_ROOT']; $webRoot = str_replace(array($docRoot, 'testing.php'), '', $thisFile); $srvRoot = str_replace('testing.php', '', $thisFile); define('WEB_ROOT', $webRoot); //error on this line Variable Undefined define('SRV_ROOT', $srvRoot); //error on this line Variable Undefined echo 'thisFile- '.$thisFile ;//works perfect echo "<br>"; echo 'docRoot- '.$docRoot;//works perfect echo "<br>"; echo 'webroot- '.$webRoot ;//works perfect echo "<br>"; echo 'srvroot- '.$srvRoot ;//works perfect ?>[/CODE] what is it that i am doing wrong? Pls help me!

Member Avatar
Member Avatar
+0 forum 2

The last time I was making a program, I wanted to input from user a boolean answer (to save space ;)) An input of 0/1 works good (0-false) and (1-true), but if the user inputs the boolean values as "true" and "false", it comes out to be an error. So, are there any ways of doing so.? I believe, that the strings "true" and "false" are defines using #define in the header files because of which the input is creating an error. Am i correct.?

Member Avatar
Member Avatar
+0 forum 5

The End.