how to duplicate a complex object along path in inkscape? - inkscape

Beginner in inkscape, I would like to make something that feel simple : I want to make a picture with cat's paw print along a path, as if a cat had walked in the snow.
For this I :
found a svg image of a cat's paw print
duplicate it and put it in front on the first
group the whole, and convert to path
draw a line along which I would like my paw print to be arranged
Then I tried two thing :
extensions/generate from path /pattern along path : inkscape put my line along the paw print and not the reverse...
path/path effect/pattern along path : I have a single paw print
It's frustrating because I followed a lots of tuto, and all work well with simple shape I make directly in inkscape (star, circle...) but with my paw print, I can't make it work. I probably miss something really stupid, can someone spot it ?

I just tried this one out and looked over the 'Help' option on the function, which states:
"There must be a single pattern object must be the topmost [in the Layers & Objects tab] for the pattern, groups of paths, groups of shapes or clone are allowed. Text Must be converted to path before using as a pattern."
Arranging the paths as suggested produced perfect results.

Related

Unable to use pyperclip and regex to search for a pattern?

While this seems very sketchy, I am doing this for my MGMT288 class, and am trying to create a program that searches for a SSN from a group of copied text. I have very little python background, and am just exploring regex and in extension pyperclip. Currently my code in the entirety looks like this.
import re,pyperclip
SSNREG=re.compile(r'(\d{3})(-)?(\d{2})(-)?(\d{4})')
SSN=[]
CB=pyperclip.paste()
for groups in SSNREG.findall(CB):
SSN.append(groups[0])
if len(SSN)>0:
pyperclip.copy('\n'.join(CB))
print('Copied '+len(CB)+' SSN\'s to clipboard!')
print('\n'.join(CB))
else:
print('There were no SSN\'s to be found in the text.')
Whenever I have a 3-2-4 digit number copied with the dashes, it still prints out that there were no SSN's in the clipboard, and I can't figure out what's wrong.
I've just changed the /d to \d and it still doesn't seem to find anything.

Regex-Match while ignoring a char from Searchword

I am using an Engineering Program which lets me Code formulas in order to filter out specific lines in a database. I am trying to look for a certain line in the database which contains e.g. "concrete" as a property.
In the Code I can use regular expressions.
The regex I was using so far looked like this:
".*(concrete).*";
so if the line in the database contains concrete, I will get the wanted result.
Now the Problem is: i would like to switch the word concrete with a variable, so that it Looks like this:
".*(#VARIABLE1).*";
(the Syntax with the # works in the program btw.)
the Problem is: if i set the variable as concrete, the program automatically switches it for 'concrete' . Obviously, the word concrete cant be found anymore, since the searchterm now contains the two ' Symbols in the beginning and i the end.
Is there a way to ignore those two characters using the Right regex?
what I want it to do is the following:
If a line in the database contains "25cm concrete in Grey"
I should get a match from the regex.
with the searchterm ".*(concrete).*"; it works, with the variable ".*(#VARIABLE1).*"; it doesnt.
EDIT:
the whole "Formula" in the program Looks like that:
if(Match(QTO(Typ:="Attribut{FloorsLayer_02_MaterialName}");".*(#V_QUALITY).*" ;"regex") ;QTO(Typ:="Attribut{Fläche}");0)
I want the if-condition to be true, when the match inside is true.
the whole QTO function is just the programs Syntax to use a certain Attribute into the match-function, the middle part is my Problem. I really don't know the programming language or anything,I'm new to this. hope it helps!
Thats more of a hack than a real solution and i'm not sure if it even works:
if you use the regex
.*(#VARIABLE1)?).*
and the string ?concrete(
this will result in a regex looking like this:
.*('?concrete(')?).*
which makes the additional characters optional.
This uses the following assumtption:
the string (#VARIABLE1) gets replaced by the ('<content of VARIABLE1>')

how to search for all constructors in c++ code?

I have to find out all the constructors in my code base (which is huge) , is there any easy way to do it (without opening each file , reading it and finding all classes)? Any language specific feature that I can use in my grep?
To find destructors it is easy , I can search for "~".
I can write some code to find "::" and match right and left words , if they are equal then I can print that line.
But if constructor is inside the class (with in H/HPP file), the above logic is missing.
Since you're thinking of using grep, I'm assuming you want to do it programmaticly, and not in an IDE.
It also depend if you're parsing the header or the code, again I'm assuming you want to parse the header.
I did it using python:
inClass=False
className=""
motifClass=re.compile("class [a-zA-Z][a-zA-Z1-9_]*)")#to get the class name
motifEndClass=re.compile("};")#Not sure that'll work for every file
motifConstructor=re.compile("~?"+className+"\(.*\)")
res=[]
#assuming you already got the file loaded
for line in lines:
if not inClass:#we're searching to be in one
temp=line.match(class)
if temp:
className=res.group(1)
inClass=True
else:
temp=line.match(motifEndClass)
if temp:#doesn't end at the end of the class, since multiple class can be in a file
inClass=False
continue
temp=line.match(motifConstructor)
if temp:
res.append(line)#we're adding the line that matched
#do whatever you want with res here!
I didn't test it,I did it rather quickly, and tried to simplify an old piece of code, so numerous things are not supported, like nested classes.
From that, you can do a script looking for every header in a directory, and use the result how you like !
Search all classes names and then find the function has same name like class name. And second option is that as we know that the constructor is always be public so search word public and find the constructor.

Xcode: How to exclude a path from Search Navigator

In Xcode, in this case 4.x, how would you go about excluding a path (or a path containing a pattern) from search results?
My use case:
My project is SVN controlled. Whenever I search for text (such as a function name), I often get irrelevant results returned from ".svn-base" files (which are used for making local diff's between your working copy and the last checked out revision).
I have setup a custom scope where the 'Location' 'is within the file or folder' 'Classes' (a subfolder I want to search). There doesn't seem to be a way to say "And Not..." or "And where path does not match". There is a "matches regex" and I feel the answer may lie around Look-arounds... Maybe something like (?!\.svn)?
In an extra condition in the settings of my custom scopes I use this:
^((?!\.svn).)*$
Check out this very good explanation here: stackoverflow

Extract pattern substring from NSString

I've created my own UITabBarController.
Additionally I've written a few lines of code to determine the current user.
E.g. if I am the current user do/display this, otherwise do/display this etc...
The format pattern is (firstname Lastname).
The Full name of the current user is in "displayName".
This is how I set the title of the tab depending on whether I am looking at 'my' tabs or someone else's tabs.
[activities setTitle:[viewingUser objectForKey:#"displayName"]];
I now want to extract only the firstname and display it like so:
"firstname's".
I do know of substringToIndex and substringWithRange but I just can't seem to work it out myself. I reckon I just need to find the first and extract the part it togehter with that ['s]. Can anybody please point me in the right direction?
Cheers
If first name and last name are separated by a space then simply execute the following statement which returns an NSArray which in your will contain the first and last names.
[displayName componentsSeparatedByString:#" "]
Take a look at the NSScanner documentation and associated sample code. There are simpler ways to do it if that is your only dataset, however, the moment you start getting into even semi-complex sequences, you'll need other, more powerful solutions. This is why I'm recommending NSScanner off the top.