Search Results

Search found 2 results on 1 pages for 'taschetto'.

Page 1/1 | 1 

  • Parse file to hash in Ruby

    - by Taschetto
    I'm a ruby newcomer who's trying to read a text file (a Valgrind simulation output) like this: -------------------------------------------------------------------------------- Profile data file 'temp/gt_1024_2_16.out' -------------------------------------------------------------------------------- I1 cache: 1024 B, 16 B, 2-way associative D1 cache: 32768 B, 64 B, 8-way associative LL cache: 3145728 B, 64 B, 12-way associative Profiled target: bash run.sh Events recorded: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Events shown: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Event sort order: Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw Thresholds: 99 0 0 0 0 0 0 0 0 Include dirs: User annotated: Auto-annotation: off -------------------------------------------------------------------------------- Ir I1mr ILmr Dr D1mr DLmr Dw D1mw DLmw -------------------------------------------------------------------------------- 1,894,017 246,981 2,448 519,124 4,691 2,792 337,817 1,846 1,672 PROGRAM TOTALS // other data I want to extract the PROGRAM TOTALS table and put it into a hash. Something like... myHash = { :Ir => 1894017, :I1mr => 246981, ILmr => 2448, ..., DLmw => 1672 } What are the best options for doing this? Could the CSV classes help me out? Thanks a bunch.

    Read the article

  • Build multiple sources into multiple targets in a directory

    - by Taschetto
    folks. I'm learning about GNU-Make and I have the following project structure: ~/projects /sysCalls ex1.c ex2.c ex3.c ex4.c ex5.c ex6.c ex7.c Each .c source is very simple, has its own main function and must be built into a corresponding binary (preferably named after its source). But I want to build into a bin directory (added to my .gitignore file). My current Makefile is: CC := gcc CFLAGS := -Wall -g SRC := $(wildcard *.c) TARGET := $(SRC:.c=) all: bin $(TARGET) mv $(TARGET) bin/ bin: mkdir bin clean: rm -fr bin/ It works as expected, but always builds every source. And I don't like moving everything to bin "manually". Any tips or ideas on how this Makefile could be improved?

    Read the article

1