[Solved] How to make regex for 3 slashes?

You can try this regex, although your question is not clear to me. ^students\/([\w\-\d]+)\/data\/sessions$ Check here https://regex101.com/r/xnxwCX/1 you can grab the data in between students/, /data/session. solved How to make regex for 3 slashes?

[Solved] A SQL Server query that increases the value of everyone’s pension fund by one month’s worth of contributions

I would expect something like this: INSERT INTO PensionFunds (EmployeeId, Amount, PensionProvider) SELECT EmployeeId, Salary * 0.05, PensionId FROM CompanyEmployees; This does not take a zillion things into account, such as: Not all rows in CompanyEmployees might be active employees. Not all rows in CompanyEmployees might be contributing to the pension fund. There could perhaps … Read more

[Solved] Swift NStask function

Try this: func commmand(argument: String) -> String { let task:NSTask = NSTask() let pipe:NSPipe = NSPipe() task.launchPath = “/bin/menubar” task.arguments = [argument] task.standardOutput = pipe task.launch() let handle = pipe.fileHandleForReading let data = handle.readDataToEndOfFile() let result_s = String(data: data, encoding: NSUTF8StringEncoding)! return result_s } print(commmand(“getip”)) 2 solved Swift NStask function

[Solved] Data screaping based on Search engines

You can do that using google api https://developers.google.com/custom-search/json-api/v1/overview and a related php client https://github.com/google/google-api-php-client. Later on you need to write a web scraper to download the websites (curl) and parse the html parser (i.e. https://github.com/paquettg/php-html-parser). I would, however, not recommend php for the latter task. There are much more sophisticated scraping tools available for python … Read more

[Solved] How do I add and animate infinite number of objects coming from the bottom of the screen in random order in gradually increasing speeds?

I would not recommend using [NSThread sleepForTimeInterval:2]; Instead trying using [self performSelector:@selector(addBall) withObject:nil afterDelay:2]; -(void)addBall { self.addedBall++; if (self.addedBall > 500) { return; } randomNumber = arc4random_uniform(3); if (randomNumber == 0) { [self addRedBall]; SKAction *moveBall = [SKAction moveToY:CGRectGetMaxY(self.frame) duration:5]; dispatch_queue_t actionDispatchRed; actionDispatchRed = dispatch_queue_create(“com.redball.dispatch”, NULL); dispatch_async(actionDispatchRed, ^ { [redBall runAction:moveBall]; }); [self performSelector:@selector(addBall) withObject:nil … Read more

[Solved] Caesar cypher in Python

Use split() numbers = input(“Please type a code: “).split() # [’16’, ’25’, ’20’, ‘8’, ’14’, ‘0’, ‘9’, ‘,19’, ‘0’, ‘3’, ’15’, ’15’, ’12’] Use for .. in .. for num in numbers: print( x[int(num)] ) If you use 0 as space you have to add space at the begginig of list x = [‘ ‘, … Read more

[Solved] C++ add pointers to structure

Very simply, create a class that has Uczestnik as a member variable. struct UczestnikList { UczestnikList *next; UczestnikList *prev; Uczestnik val; // or Uczestnik* val; }; Now you can use the UczestnikList and traverse through it. Also note that val could be an embedded member variable or a pointer (Uczestnik* val) depending on how you … Read more

[Solved] Need help i get segmentation fault in program in C

A proper implementation of getfiles (gets all the files in a directory in a dynamic array) and provides a deallocator: #include <stdio.h> #include <dirent.h> #include <string.h> #include <stdlib.h> /* returns a NULL terminated array of files in directory */ char **getfilelist(const char *dirname) { DIR *dp; char **entries = NULL; struct dirent *entry; off_t index … Read more

[Solved] Pattern by means of function

We, beginners, should help each other.:) Here you are. The code is written in C++. So you need to investigate it and rewrite it in C yourself. #include <iostream> int main() { while ( true ) { std::cout << “Input the number of elements : “; unsigned int n; if ( not ( std::cin >> … Read more

[Solved] How would I approach sorting something like this

Here is how you would do that without using a Treeview (why wouldn’t you I don’t know): void Main() { string values = @”1 14 141 141010 141020 141030 141040 141050 141060 142 142010 142020 144 1440 144010 144020 144030 144040 145020 145030 145010 “; int myValue; // Splitting and converting to a collection of … Read more