General Programming |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Sep 05, 2006 8:41 am Post subject: Regular Expressions & make files |
|
|
Regular Expression Basics
"Regular expressions, sometimes referred to as regex, grep, or pattern
matching, can be a very powerful tool and a tremendous time-saver with a
broad range of application. As an extended form of find-and-replace, you
can use a regular expression to do things such as perform client-side
validation of email addresses and phone numbers, search multiple
documents for strings and patterns you wish to change or remove, or
extract a list of links from source code."
Last edited by delovski on Wed Oct 25, 2006 2:52 pm; edited 1 time in total |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Sep 05, 2006 8:44 am Post subject: |
|
|
Learning GNU Make Functions with Arithmetic
"GNU Make has no built-in arithmetic capability. In this article I present a
collection of GNU Make macros that implement functions for addition,
subtraction, multiplication, and division of integers. Functions are also
provided for integer comparisons such as “greater than” and “not equal.”
These macros are implemented entirely using GNU Make's built-in string
manipulation functions." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sat Oct 07, 2006 8:20 pm Post subject: |
|
|
Regular Expressions Cheat Sheet
"The Regular Expressions cheat sheet is designed to be printed on an A4
sheet of paper and live by a designer or developer's desk, to make life a bit
easier. A description of what is on the cheat sheet follows, or if you are
impatient, you can go straight to the full size Regular Expressions cheat
sheet." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Wed Oct 25, 2006 2:51 pm Post subject: |
|
|
Digg: Debugging make
"make and utilities like it are fundamental tools for streamlining the
application build process. Learn the structure of the makefile, how to
avoid common mistakes in its creation, and how to solve or work around
portability issues and other problems as they crop up." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 537
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Aug 22, 2007 8:48 pm Post subject: |
|
|
freshmeat: What is Wrong with Make?, by Adrian Neagu
"The first wrong thing is people's ignorance about Make's limitations with
respect to their requirements. I'll start my critique with a list of wrong beliefs
about this classic tool." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 537
|
Posted: Mon Dec 03, 2007 9:25 pm Post subject: |
|
|
How Regexes Work, by Mark-Jason Dominus
"This isn't an article about how to use regexes; you've probably seen plenty of
those already. It's about how you would write a regex package from scratch,
in a language like C that doesn't already have regexes." |
|
Back to top |
|
|
XNote Kapetan
Joined: 16 Jun 2006 Posts: 537
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Thu May 01, 2008 1:18 am Post subject: |
|
|
Apple: Building Makefile Projects With Xcode
"Although Xcode keeps track of build settings in its own preferences files for
information beyond what could normally be maintained in a makefile, it can
also work closely with your project’s makefiles. If you want to use Xcode for
development in Mac OS X, you can include a makefile in a Xcode project as
follows..." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Thu May 01, 2008 4:21 pm Post subject: |
|
|
uf - C on Linux
"Here's a link for further reading: http://www.airs.com/ian/configure/
As for 'make' and 'make install', these both invoke the Makefile with the
latter statement specifically referencing the "install" entry point. Here's a
typical Makefile that could build the hello.c program I provided earlier." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon May 26, 2008 9:36 am Post subject: |
|
|
Make - a tutorial
"Make uses a special target, named .SUFFIXES to allow you to define your
own suffixes. For example, the dependency line:
.SUFFIXES: .foo .bar
tells make that you will be using these special suffixes to make your own rules. " |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Thu Aug 21, 2008 6:39 pm Post subject: |
|
|
What’s wrong with make?
"So what is wrong with it? I’m not complaining about the simple annoyances
like insane use of tabs or being based on two inflexible programming languages
(shell script and make macros). No, it’s got two fundamental problems: it cannot
enforce correct dependency tracking and its dependency language is insufficiently
expressive for common tasks." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Nov 02, 2009 8:58 pm Post subject: |
|
|
reddit - Trying qmake and CMake (as an autotools user)
"The problem with autotools is that it is used for complicated things, and
people cut-and-paste complicated things even when they ought to be si-
mple. 99% of people just need a way to access .pc files and generate ju-
icy Makefiles, the portability part is taken care by glib, sdl and so on." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Jul 01, 2019 5:46 pm Post subject: |
|
|
so - Regex C code is not working on my mac osx
"I'm testing the following code on 4 Macbook. all Macbook are up to date with
10.8.4 on 3 of them it is working fine but not on my Macbook and I start be
crazy. I don't know what to do anymore." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Fri Jul 16, 2021 12:54 pm Post subject: |
|
|
so - How to write a Makefile with separate source and header directories?
"Following this tutorial...
I have 2 source files and 1 header file. I want to have them in separate
directories like in the tutorial.
.
├── include
│ └── hellomake.h
├── Makefile
└── src
. ├── hellofunc.c
. └── hellomake.c
fatal error: no input files" |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Sat Jan 21, 2023 7:13 pm Post subject: |
|
|
so - Search through NSString using Regular Expression
Code: | NSString *yourString = @"";
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression
regularExpressionWithPattern:@"(NS|UI)+(\\w+)"
options:NSRegularExpressionCaseInsensitive
error:&error];
[regex enumerateMatchesInString:yourString options:0 range:NSMakeRange(0, [yourString length]) usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop){
// your code to handle matches here
}];
|
https://regex101.com/r/uI8rR1/2
/^(?!0+\.0+$)\d{1,3}(?:,\d{3})*\.\d{2}$/ |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Sat Jan 21, 2023 7:46 pm Post subject: |
|
|
so - Search through NSString using Regular Expression
One simple way would be to validate the string using this regular expression:
Code: | ^[$][0-9]+([.][0-9]{2})?$
^ ^ ^ ^ ^ ^ ^ ^^
| | | | | | | ||
| | | | | | | |+-- End-of-input marker
| | | | | | | +--- Optional
| | | | | | +------ Repeated exactly two times
| | | | | +---------- A decimal digit
| | | | +-------------- A dot (literal)
| | | +----------------- Repeated once or more
| | +-------------------- A decimal digit
| +------------------------ The dollar sign (literal)
+-------------------------- Start-of-input marker |
Here is a sample code that uses the above expression:
Code: | NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression
regularExpressionWithPattern:@"^[$][0-9]+([.][0-9]{2})?$"
options:NSRegularExpressionCaseInsensitive
error:&error];
if ([regex numberOfMatchesInString:@"$321.05" options:0 range:NSMakeRange(0, 7)]) {
NSLog(@"Success");
}
|
>>> /([\d,.])*([kn|kuna|kune|eur|?|EUR| ])/g
>>> /([\d,.]*)(kn|kuna|eur|EUR|)/g
>>> /([\d,.]*)(kn|kuna|eur|EUR|| )/g |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Sun Mar 12, 2023 8:57 pm Post subject: |
|
|
>> ^\d{1,3}(?:.\d{3})*\,\d{2}$
>> ^\d{1,3}(?:.\d{3})*\,\d{2}
Tada:
^\d{1,3}(?:.\d{3})*\,\d{2}.*(EUR|KN|kn|Kn|Kuna|Kune|Eur)? |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
Posted: Wed Jun 05, 2024 4:40 pm Post subject: |
|
|
git - syedhali/curl-android-ios
"If you want to build the library, scripts are provided for both platforms."
Code: | export IPHONEOS_DEPLOYMENT_TARGET="7"
ARCHS=(armv7 armv7s arm64 i386 x86_64)
HOSTS=(armv7 armv7s arm i386 x86_64)
PLATFORMS=(iPhoneOS iPhoneOS iPhoneOS iPhoneSimulator iPhoneSimulator)
SDK=(iPhoneOS iPhoneOS iPhoneOS iPhoneSimulator iPhoneSimulator)
|
|
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3174 Location: Europe
|
|
Back to top |
|
|
|