Hi all, I was just playing around with some ideas about optimizing a core piece of my library: the run-time type identification system (RTTI). What does that have to do with compile-time string concatenation? Well, the whole point of the RTTI is to provide information on the type of objects, and a string representation of that name is a pretty central part of that (as well as a hash value). Type names are made of identifiers, which are names that are known at compile-time, and could thus be compile-time string literals (that means things like `"Hello world!"`). The problem is, …

Member Avatar
Member Avatar
+6 forum 6

If I have two bytes representing 117, 117 or 1110101 , 1110101 and I want to concatenate them (technically I know how) then which end attaches to which? I understand they will be arranged in memory depending on endianess but overall, is there a standard way of concatenating bytes. Lets say I want to concatenate these two into a 16 bit variable and they are arranged as above in little endian on a windows machine. **1110101**1110101 , i've just bolded on for clarity. Is that the way I would have to do it? OR, does the first byte always link …

Member Avatar
Member Avatar
+0 forum 6

<td><a href="$_SERVER['PHP_SELF'] . '?id=' . $myrow["article_tittle"] ">'.$row["article_tittle"].'</a></td> what's the error in above code, its showing error Parse error: syntax error, unexpected T_STRING in ...../class.article.php on line 64 Please identify

Member Avatar
Member Avatar
+0 forum 4

Alright guys, I've been trying to think how to do this and I keep confusing myself. It's part of a project using piping in UNIX but first I need to get this small program running properly. I want to pass the final result (Hex value) to another program that will convert that result to binary. This is my current code, which runs fine, although I was thinking of storing the value where is says printf("A"); ,for example, into an array. Although, I need to pass the array to another program which is looking for an int value. I think the …

Member Avatar
Member Avatar
+0 forum 2

I need to prompt the user to enter two strings and then create a third string with the first half of string1 and the second half of string2. I was able to put the first half of string1 into string3 but I cannot figure out how to put the second half of string2 into string 3. Here's my code: [CODE] #include <stdio.h> #include <stdlib.h> #include <limits.h> #include <string.h> int main () { char string1[255], string2[255], string3[255]; int string1Len = 0, string2Len = 0; printf ("Enter String 1: "); fgets (string1, 255, stdin); string1[strlen(string1) - 1] = '\0'; string1Len = strlen(string1); …

Member Avatar
Member Avatar
+0 forum 13

All right. So i have child, parent, activity and register table and i want know how much money a parent will pay for his child if the child have 1 or more activities. So i came out with this code: [CODE]SELECT CONCAT_WS (' ', parent_title, parent_fname, parent_sname) AS 'Parent/Carer Name', CONCAT('£', act_price) AS Amount, COUNT(*) AS 'Nr of Act.' FROM Activity A, Parent P, Child C, Register R WHERE C.parent_id = P.parent_id AND C.child_id = R.child_id AND A.act_id = R.act_id GROUP BY P.parent_id[/CODE] and see atachment for result. the thing is in the Amount column the value are all £0.00 …

Member Avatar
Member Avatar
+0 forum 3

Hi I want to read a string (Last name) from keyboard, concatenate it to another string (First Name) and then print it on screen. (Windows, EMU8086, EXE Template) First I declare the variables in data segment [CODE] msg1 db 0ah,0dh,"Enter your last name: $" ;prompt message msg2 db "Kamiar " ;first name var lastname db 20,20 dup(?) ;srting var to save input [/CODE] then print prompt message and get input [CODE] lea dx,msg1 mov ah,09h int 21h call read read: lea dx,lastname mov ah,0ah int 21h [/CODE] concatenate it to the first name [CODE] add msg2,lastname [/CODE] finally print it …

Member Avatar
Member Avatar
+0 forum 6

Hey Guys, I have an issue with my checkbox and the values that are posted to the next page. The issue is that each time the checkbox is clicked it just adds another value. example - if i check it and uncheck it and check it again i will get 3 values instead of 1. So if the user makes a mistake and needs to uncheck it they end up with 2 values instead of empty. I use PHP to post between pages if that makes any difference. Thanks:) [CODE]<script type="text/JavaScript"> function concat(one) { if(one.checked) { var currval = document.getElementById('locality').value; …

Member Avatar
Member Avatar
+0 forum 1

Hi, I need to concatanate lines based on regex. Lines to be concatanated are scattered. All lines begin with number$number$number$number$sentences. There is nothing to mark the end of sentence, only the beginning. Here is an example. I want to rewrite this one [CODE]2 $5$233$ check big cat if it have not eaten all the meat 3 $5$233$ check big cat if it have not eaten all the meat <a href=""http://example.com"">An Example duh! </a> <a href=""http://example.com"">An Example duh! </a> 2 $5$233$ check big cat if it have not eaten all the meat check big cat if it have not eaten all …

Member Avatar
Member Avatar
+0 forum 19

For a program I'm writing, I'm trying to get rid of doubles in my string (which is a concatenation of a keyword and the alphabet). My code was compiling fine until I added the code about concatenating the substrings before and after the character I'm trying to get rid of. [code] for (int i = 0; i < fullcrypt.length(); i++) { System.out.println("i = " + i); System.out.println(fullcrypt.charAt(i)); for (int j = i+1; j <= fullcrypt.length(); j++) { System.out.println("j = " + j); System.out.println(fullcrypt.charAt(j)); //if characters match, recreate string with substrings before and after matching character if ((fullcrypt.charAt(i)) == (fullcrypt.charAt(j)) && …

Member Avatar
Member Avatar
+0 forum 7

Hi all, I need someone to help me out, I am trying to call a .php file with php variables - [code] include('Code.php?buyer='.$lastid.'&oid='.$oid.'&bid='.$bid.''); [/code] when i edit the url myself using values from the database it works like it should do. but when I am calling the php file using include, i am not seeing the results I am expecting. I would appreciate some pointers in the right direction please.

Member Avatar
Member Avatar
+0 forum 5

How can I use a variable to create another variable so that the output is not the content of the new variable but the php code for the new variable? For example: If variable $a = "house" and the name of the final variable is $b, then how do I produce variable $c so that the result of echoing $c is the php code: [code] <?php $b = "house"; ?> [/code] The context is that I am using one file to write another file. The second file needs to contain the line, <?php $b = "house"; ?>, which has been …

Member Avatar
Member Avatar
+0 forum 2

Hey everyone, PHP and MYSQL newbie here.....can really use your help right now. I implemented a Submodal into my script, and finally got it to submit "User Notes" into the database. Unfortunately with each new submission, the text that is submitted overwrites the previous submission. I was told to use CONCAT_WS to prevent that from happening...I have been trying for several hours on Dreamweaver to accomplish that but it's not working. Here is my code for that section... if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "lead_note_form")) { $updateSQL = sprintf ("UPDATE Leads SET Notes = CONCAT_WS('\n', Notes, '$Notes') WHERE Id=%s", GetSQLValueString($_POST['Notes'], "text"), …

Member Avatar
Member Avatar
+0 forum 15

can any body tell what is going to wrong with this syntax [CODE] echo '<div> <a href=' ".$path.$i.$s.$ext." '> . <img src=' ".$path.$i.$ext." '> </div>';[/CODE] Please Help

Member Avatar
Member Avatar
+0 forum 1

hi, i'm making a website for a company, with backoffice. when i want to add a new employee, i must specify the monthly fee and i created two inputs, one for the dollar part and the other for the cents parts. i wanted to concatenate the two parts with a dot in the middle and then cast to float. but when i insert the employee, the salary stays on 99.99 what can i do?

Member Avatar
Member Avatar
+0 forum 5

All, I have a small select box for deleting a page, and I need to include the pos(which is position when it gets submitted) - So I can update the database position of the pages. How can I put the pos in this too when it gets submitted? [CODE] <?php //This dropdown is for page deleting!! $query="SELECT id, linklabel, pos FROM pages ORDER BY pos ASC"; $result = mysqli_query($myConnection, $query); ?> <form action="../page_delete_parse.php" onsubmit="return confirm('- Are you sure you want to delete this page?')" method="post" /> <select class="boxstyles" name='linklabel' /> <?php // printing the list box select command while($row=mysqli_fetch_array($result)){//Array or …

Member Avatar
Member Avatar
+0 forum 4

I'm currently working on this course assignment and I'm trying to set up code to search within a database file (really its just a text file named a1.db). I hear we can use the popen function to implement shell code within a C program so here's what I tried: ---------------- outside main: [CODE] <all imports> FILE *read_fp char *command; ; char *input;[/CODE] [I][U]input[/U][/I] is a v[B]ariable in my program[/B] [CODE]<in a signal handler outside main (called by child)> command = "grep '[B]input[/B]' a1.dv\n" if ( !(read_fp = (FILE*)popen(command,"r")) ) { (record not found) [read_fp is null] } else { (record …

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, I was wondering if it is possible to point to a textbox created in the form designer via a string variable. Basically, I'm creating a golf management system with a feature allowing a user to define their own course. Each hole has a corresponding textbox into which a user can input the hole's par and then the system should total up the first 9 pars, the last 9 pars and then all 18 pars; displayed in 3 different textboxes. The input textboxes have been named txtP1, txtP2, ..., txtP18, so I was wondering if I could simply concatenate …

Member Avatar
Member Avatar
+0 forum 2

Concatenate a substring of the original string sentence starting from index 0 and ending before the middle Character(s). Use the substring() method. Use an if statement to account for even or odd, the end index that you need substring()the end index that you need for substring() will be different public static void main(String[] args) { String sentence= "Need Help" String midChars = ""; int sLength = 0; int midIndex= 0; char ch1 char ch2 sLength = sentence.length(); if (sLength % 2 != 0) { midIndex = sLength/2; ch1 = sentence.charAt(midIndex); midChars = String.valueOf(ch1); } else { ch1 = sentence.charAt(midIndex); ch2 …

Member Avatar
Member Avatar
+0 forum 9

Hi, I am a beginner-novice programmer using Python to build custom tools in ESRI's ArcGIS. I have what seems like a simple problem, but I am afraid I'm missing a core concept. Here goes... In this simple example I assign string values to some variables and then change the text of a map layout text element using a hard-coded format. [CODE] COUNTY = "Tioga" TOWN = "Wellsboro" someText.text = COUNTY + " - " + TOWN # someText would now read: Tioga - Wellsboro [/CODE] Now I would like the user to pass a custom format as a parameter. [CODE] …

Member Avatar
Member Avatar
+0 forum 5

Hi, My requirement is to identify '-' in string1 and delete those corresponding locations in string2. The logic I am implementing is that 1. find the locations in string1 where '-' occurs 2. At these locations, insert spaces in string2 and then 3. have string2 without spaces. I managed to find the locations where '-' appears in the string1. [CODE]string1 = 'actttcttc-dsfsdf-yy' locs = [match.start() for match in re.finditer(re.escape('-'), string1)][/CODE] I get the locations but now do not know how to proceed with the rest of my logic. If anyone has an idea how to proceed or better logic in …

Member Avatar
Member Avatar
+0 forum 1

The End.