09-09-2013
As I haven't done any C programming for about 15 years, I'm glad you guys showed up to add better explanations to the matter.
Thanks
Last edited by Scott; 09-09-2013 at 02:00 PM..
Reason: Actually it's only 15 years!
10 More Discussions You Might Find Interesting
1. Programming
Hi all,
I am trying to create a function that return an array of integer based on the char parameter pass into the function. I.e.
func_a(char * str)
{
example str is equal to "1,2,3,4"
return an array of integers of 1,2,3,4
}
Please advise
regards
dwgi32 (2 Replies)
Discussion started by: dwgi32
2 Replies
2. Shell Programming and Scripting
Hi experts,
How to get the length of an Array in PERL.
for eg., @Var having 5 elements.
regards
Anent (5 Replies)
Discussion started by: anent
5 Replies
3. UNIX for Advanced & Expert Users
Hello. I'm working on a project that involves creating public/private keys server-side using openssl and using the public key in a Javascript application to encrypt sensitive data in form fields before transmission to the server. Using an SSL https server connection was not an option in this... (1 Reply)
Discussion started by: jhopper
1 Replies
4. Shell Programming and Scripting
I need to implement the following logic and need some expert help from UNIX community.
These are the steps in my Shell script.
1. Analyze a file.
2. Extract all the ID's in that file.
3. Use the ID's from #2 to run another filter on the file.
I've implemented # 1 and 2 using... (3 Replies)
Discussion started by: katwala
3 Replies
5. Shell Programming and Scripting
Hi !
I'm looking for a way to transform certain floating point numbers in a one-line, variable length file to integers.
I can do this in a crude way with sed :
sed -e 's/0\.\(\):/\1:/g' -e 's/0\.0\(\):/\1:/g' -e 's/1\.000:/100:/g' myfile ... but this doesn't handle the rounding correctly.
... (3 Replies)
Discussion started by: jossojjos
3 Replies
6. Shell Programming and Scripting
As Brendan O'Conner writes in this blog, mawk is near 8 times faster than gawk, so I am going to give mawk a go, but I got errors when trying to print the length of an array in mawk using length() function, is it not supported in mawk? or there's another way to get the length of an array in mawk?
... (3 Replies)
Discussion started by: kevintse
3 Replies
7. Shell Programming and Scripting
I would be grateful if someone could help me. I am trying to write a .sh script in UNIX.
I have the following code;
User=john
User=james
User=ian
User=martin
for x in ${User}
do
print ${#x}
done
This produces the following output;
4
5
3
6 (12 Replies)
Discussion started by: mmab
12 Replies
8. Shell Programming and Scripting
Hello All,
I have this script that does stuff like "starting, stopping & restarting" a Daemon Process running on my machine...
My main question is why in part of my code (which you will see below) does the Array Length (i.e. ${#PIDS} )
return "1" when I know the Array is empty..?
Here is... (17 Replies)
Discussion started by: mrm5102
17 Replies
9. Shell Programming and Scripting
Does anyone know how to find length of multi dimension array
of following type
A Afor simple array I is to do
for (i in A)n++ to find length of array but if it is multi dimension how to find the length ? (2 Replies)
Discussion started by: nex_asp
2 Replies
10. UNIX for Beginners Questions & Answers
Hi there,
I'm listing files and sorting them. When I try to get length of array variable in which these files are stored I get 1 as value. That's weird.
files_info="$(find $input_dir -name "*_CHR$i.info" | sort )"
printf ${#files_info}"\n" #print length
#--loop through... (6 Replies)
Discussion started by: genome
6 Replies
LEARN ABOUT OSX
moose::cookbook::meta::whymeta
Moose::Cookbook::Meta::WhyMeta(3) User Contributed Perl Documentation Moose::Cookbook::Meta::WhyMeta(3)
NAME
Moose::Cookbook::Meta::WhyMeta - Welcome to the meta world (Why Go Meta?)
VERSION
version 2.0604
SUMMARY
You might want to read Moose::Manual::MOP if you haven't done so yet.
If you've ever thought "Moose is great, but I wish it did X differently", then you've gone meta. The meta recipes demonstrate how to change
and extend the way Moose works by extending and overriding how the meta classes (Moose::Meta::Class, Moose::Meta::Attribute, etc) work.
The metaclass API is a set of classes that describe classes, roles, attributes, etc. The metaclass API lets you ask questions about a
class, like "what attributes does it have?", or "what roles does the class do?"
The metaclass system also lets you make changes to a class, for example by adding new methods or attributes.
The interface presented by Moose.pm ("has", "with", "extends") is just a thin layer of syntactic sugar over the underlying metaclass
system.
By extending and changing how this metaclass system works, you can create your own Moose variant.
Examples
Let's say that you want to add additional properties to attributes. Specifically, we want to add a "label" property to each attribute, so
we can write "My::Class->meta()->get_attribute('size')->label()". The first recipe shows how to do this using an attribute trait.
You might also want to add additional properties to your metaclass. For example, if you were writing an ORM based on Moose, you could
associate a table name with each class via the class's metaclass object, letting you write "My::Class->meta()->table_name()".
SEE ALSO
Many of the MooseX modules on CPAN implement metaclass extensions. A couple good examples include MooseX::Aliases and
MooseX::UndefTolerant. For a more complex example see Fey::ORM or Bread::Board::Declare.
AUTHOR
Moose is maintained by the Moose Cabal, along with the help of many contributors. See "CABAL" in Moose and "CONTRIBUTORS" in Moose for
details.
COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Infinity Interactive, Inc..
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
perl v5.16.2 2012-09-19 Moose::Cookbook::Meta::WhyMeta(3)