Programming :: Insert Data In A Nested STL Map?

Dec 13, 2010

Following is the declaration:

Code:
std :: map <QString, std :: vector <std :: pair <QString, QString> > > configFileDataVector; How should I insert data in it? All the examples which I have looked up in Google are of plain maps!

I tried this, but it failed:

[Code]...

View 4 Replies


ADVERTISEMENT

Programming :: C++: Extracting Data From A NESTED STL Map?

Feb 8, 2011

Code for insertion of data:

Code:

#include <map>
#include <iostream>
int main ()

[code]....

I don't know how to fetch the data from the nested map here.

View 5 Replies View Related

Programming :: Access Value From Nested Struct <c Language>?

Mar 11, 2010

I having a nested structures which are referenced with pointer variables :

example :
typedef struct {
int a ;
char *b ;
int *c ;
}EXP2 ;

[Code]...

While trying to access the value of sv.exp2->a it throws segmentation fault error.How to acess this variable ??

View 3 Replies View Related

Programming :: Breaking Out Of Nested Switch Java

Sep 20, 2010

I've only gone into the first case statement of the first switch and I am trying to get out of it but the break statement I added doesn't seem to have any effect and it just goes on to the next case instead of exiting the switch.

Code:
import java.util.*;
import javax.swing.*;
public class A2 {
public static void main(String[] args) {
double gross_Pay;
int payment_Method;
final double salary_Pay = 1000.00;
final double hourly_Pay = 25.00;
double overtime1 = 20.00;
double overtime2 = 30.00; .....

View 2 Replies View Related

Programming :: [ Bash ] Count Nested HTML Tags?

Jan 7, 2011

I need to search through HTML files to count the number of <li> tags nested within the first <ul> tag:

Code:
<ul>
<li>text 1</li>
<li>text 2</li>
</ul>
...
<ul>

[Code]...

Unfortunately, the second grep is greedy swallowing everything up to the last </ul> close tag. (The desired result is 2.) Speed is an issue as I will be searching through 350,000 files.

View 14 Replies View Related

Programming :: Passing An Enum Value To A Nested Class Constructor C++?

Jun 18, 2011

the compiler (g++ 4.4.5) does not recognize PRE as a type in the following code:


Code:
enum mode {PRE, IN, POST};
class tree

[code]...

View 9 Replies View Related

Programming :: Getting Closer To The Answer - Python Iterations Over Nested Tuples?

May 22, 2010

Code:
tupe=("File",("Open","Open a file"),"Edit",("Cut","Cut a file"),("Paste","Paste a file"),"About",("About","About the program"))
menutitle=""
menupos=0
for items in tupe:
if type(items)==str:

[Code]...

I'm trying to understand how to make "File" be the parent information for "Open","Open a file" and "Edit" to be the parent of "Cut, Cut a file" and "Paste", "paste a file". Does anyone have a suggestion for accessing the a nested tuple in this manner? The above code does not quite do what I want it to. The above code is for visual purposes, but I'm learning how to refactor for wx.python.

View 3 Replies View Related

Programming :: Nested Loop Using A Counter To Increment Array Output?

Feb 2, 2011

I work in a simulations environment. I'm trying to write a bash script that will read fields from a .csv file into an array, the first field being an identifiyng number and the second field being a corresponding url. There are about 1600 of these number/url combinations in the .csv file that i'm reading from. Once that is done i want it to parse a text file and match the number, when it has a match i want it to enter the corresponding url into a particular line in the text file. The script I have written (with the help of the people on this forum a while back) does this well, but now I have a lot more data to parse. I think the script itself is explanatory enough to see what i'm doing. What i would like to do is cut it down to one while loop nested inside another loop so that I don't have 1600 or so elif statements. I can't figure out how to increment the output of the array. for instance, the first cycle would find the number that matches ${record1[2]} and input the url stored in ${record1[3]}. the next cycle would match ${record1[4]} and input the url in ${record1[5]}, and so on, does that make sense? The code is below and a sample .csv and text file are attached.

[Code]...

View 14 Replies View Related

Server :: Use PHP To Insert/select Data From The Database?

May 29, 2010

I have a LAMP server. I know sql but I'm currently learning PHP.

Correct me if I'm wrong, but you're supposed to use PHP to insert/select data from the database, right? If so, SQL shouldn't need a port at all.

Apache uses port 80, but it's listening for connections. MySQL uses port 3306, but I've never logged into it from anywhere besides 127.0.0.1/localhost. I have mysqladmin installed and it demands that I give it an IP so I used localhost.

I'm not interested in doing anything remote, so can I block this port? When I say "block" I mean on the router, not locally through iptables. Obviously I have to foward port 80 because that's how people would connect to my server. But once they connect and send something, my server would interpret the data locally and send it back on port 80.

View 8 Replies View Related

Programming :: Sed (?) Insert String Between 2 Others?

May 21, 2010

I have a file like this:

Code:
/opt/local/some/dir/
blablablabiugfyugf

[code]....

View 10 Replies View Related

Networking :: Insert Routing Data Into The Routing Table Doesn't Work?

Apr 6, 2010

I have a firewall, this consists of three NIC's:

Code: eth0[192.168.0.2] eth1[192.168.1.2] and eth2[10.10.165.2]

I am trying to ping eth0 from eth2, but I am not able to succesfully get a response from pinging the device, I am using:

Code: ping 192.168.0.2 -I eth2

I have tried to insert routing data into the routing table, but it still doesn't work

View 2 Replies View Related

Programming :: Insert $2 Argument Until The End To Variable?

May 17, 2011

how to insert $2 argument until the end to variable?For example:

>> cucu.csh user "long long message "
$1 = user
$2 = "long long message "

View 10 Replies View Related

Programming :: Insert A Character In Line Using Sed/awk?

Jul 25, 2011

I have a string as below

LogFormat "%h %l %u %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined

Want the above string to be modified as

LogFormat "%h %l %u %D %t "%r" %>s %b "%{Referer}i" "%{User-Agent}i"" combined

inserting %D after %u in the string

View 3 Replies View Related

Programming :: Insert Paragraph At Particular Line?

Jul 26, 2011

I want to copy below content to a file after line 200.

Alias /A/ "/A/B/C/D/"
<Directory "/E/F/G/H/">
Options Indexes MultiViews
AllowOverride None

[Code]....

Or is it possible if I can copy this content in some other file and insert to the main file.

View 4 Replies View Related

Programming :: Insert Query In Mysql ?

Jul 12, 2011

When i enter this query to mysql:

Code:

return this error:

Code:

when i delete the insert part :

Code:

query is ok:

Code:

1 row in set (0.00 sec)

View 2 Replies View Related

Programming :: Sed To Search And Insert Column?

Feb 24, 2011

I have the following file.

B0 49.2230869 -102.5743868
C 1LPRK 654.90
C 1PREU 3693.90
C 1JRSU 3693.90

[code]....

I need to insert text ABCDEF starting at position 26 if a line starts with C. I need it to look like:

C 1VKNG ABCDEF 3097.00
C 1JLFU ABCDEF 3157.20
C 1MNVL ABCDEF 3346.10

I would prefer to use sed to do this and not perl.

View 14 Replies View Related

Programming :: Insert Graphics Into Latex File?

May 30, 2011

I want to insert graphics into latex file, for longtime I used xfig to create graphs, but it is limited,specially for math formulas, dia i find not easy to use.Finally I want to try asymptote or tikz which one is more appropriate

View 1 Replies View Related

Programming :: How To Insert Characters Into String In Shellscripts

Nov 15, 2010

My problem is to insert one sign like space or ':' into a line or string.The goal is to get a demiliter for `cut`.I tried to do it with `tr A-Z "'A '-'Z '" and such but without success.I guess a while read loop could do it but I don't know howto use it with ` expr length $STR`

View 5 Replies View Related

Programming :: Insert A Line In The Test File With Sed?

Jul 15, 2010

I have following file workers file: There are 800 entries like this.

# consensus/uat
worker.consensus-uat1.host=lonlx10409
worker.consensus-uat1.port=13702
worker.consensus-uat1.type=ajp13

[code]....

I want to insert one line just below the line starting with "woker.list". I think sed can do it but I am not aware.

View 14 Replies View Related

Programming :: Insert Kernel Module Into Menuconfig

Jan 14, 2011

I am looking for information to insert kernel module into kernel. I am not looking at dynamically insert of kernel module using insmod, modprobe etc. I am looking for statically insertion of kernel module procedure, such as what to change on makefile, what to change on menuconfig, what to change on .config file, etc.

View 2 Replies View Related

Programming :: Insert Text Before The First Pattern Found?

Apr 8, 2011

i need to add this line nameserver 208.67.122.221 from ISP before the first nameserver already exists in resolv.conf in all workstations i know

Code:

sed '/nameserver/ i
ameserver 208.67.122.221'

but that insert it on every line after nameserver not only before the first one

Code:

# blah blah
# blah blah
domain mydom.com

[code]....

View 3 Replies View Related

Programming :: Insert Text Message In Textarea Using Php?

Dec 13, 2010

i trying to add text messge in textarea and i got error in connection and i don't know if it correct syntax. and i wonder when i was install xamp server it no password required. but i dont know what password that i input in my php connection.?

PHP Code:

<?php
$con = mysql_connection("localhost","root","123");
if(!$con)
{

[code]....

PHP Code:

<textarea rows="3" cols="30" name="txtcomment" wrap="physical">Leave a Comment

View 4 Replies View Related

Programming :: Insert A Variable Into A Regex In Perl?

Jan 17, 2010

I was wondering if you insert a variable into a regex in Perl, will the contents of the variable be expanded by the regex engine?

View 14 Replies View Related

Programming :: Sed Insert Line With Leading Spaces?

Mar 3, 2011

I'm trying to insert a line using sed that has leading spaces before the text. Sed seems to be just dropping the spaces and only inserting the text. Any ideas what I'm missing?

Code:

NAM=rb134
sed -i.bak -e "$i
host ${NAM} {" /etc/crap

Instead of inserting a line with 8 leading spaces inserts it with "host" at the beginning of the line. I tried

Code:

NAM=rb134
sed -i.bak -e "$i
^ host ${NAM} {" /etc/crap

but it put the "^" at the begging of the line.

View 6 Replies View Related

Programming :: Insert Values Into A MySql Database?

Feb 9, 2010

I want to insert values into a MySql database. The following line works fine:1

Code:
mysql_query(connection, "INSERT INTO main (NumofShows , Title) VALUES('12', 'Home')");
but if the data to be inserted is from a string... like....
Code:
string NewTitle = "Monaco";
string NumofShows = "2";

How do i edit my sql statements so variables can be inserted into the Values ( ) , and it will be able to read the variables and then store it into the database.

View 4 Replies View Related

Programming :: Get Data From Serial Port Function Read() Blocks When Data Not Available?

Jun 11, 2009

I am using read() in c++ to get data from a serial port. However, if no data is available on the serial port the function blocks until dta arrives.Example code:

//------------------------------------------------------------
char m_readBuffer[255] = {0};
char* p_curChar = m_readBuffer;

[code]...

View 1 Replies View Related

Programming :: Insert Elements Into A Combobox From A Database Using NETBEANS?

Apr 13, 2010

I'm trying to make a combo box which should have elements dynamically taken from a database. I've an Exam Table,and it has columns Sno,Ename,Month,year. i need the combobox to list to the elements that are present in Ename.

i read some things in the web and tried that out in the netbeans. it said to rightclick the combobox and set bind ->elements and bind->selecteditem. But i'm not sure how to set the binding expressions inorder to get the required list in the combobox.

View 1 Replies View Related

Programming :: Insert Line Of Text Prior To Pattern Only Once?

Jun 29, 2010

I have a file like so:

Code:

one
two
three
four

I would like to insert prior to the word "three" all items from this second file with the following contents:

Code:

four
three
two
one

Now my issue is, and I have been using both sed and awk currently, that after the second line of the new file is read there will of course now be 2 copies of the word "three" but I would like to only insert the final 2 words, ie "two" and "one" prior to only the first occurrence of the word "three" so final file will look like:

Code:

one
two
four

[code]....

So here there is now only one of each word from the second file joined to make the new file. For simple code I have tried something like the following:

Code:

while read line
do
awk -v n=$line '!f && /three/{print n;f++}1' file1 > tmp_file
mv tmp_file file1
done < file2

Now this works but seems very clumsy to me. There is obviously a better sed and / or awk out there.

View 5 Replies View Related

Programming :: Script To Insert Characters At End Of Basename In A Filename

Aug 19, 2010

Enterprise Linux 4 (2.6.9-78 kernel)...rename not working! Need to insert "_T" at the end of every file in a directory, just before the ".extension"

I have tried sed substitution with no success (because I do not know the codes and effects of anchoring well enough).

An example filename:

My failed tests:

Code:

Code:

Code:

Code:

View 9 Replies View Related

Programming :: Sed To Read The File And Replace And Insert The Pattern?

Jun 11, 2009

I want to read from the file and check for the pattern, if the line has some word like <string>: then string should be copied into buffer. Afterwards, I want to insert the same <string> with some word in the next line of the file. use sed command to perform the above mentioned operations?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved