[Solved] Math Results Inaccurate PHP [closed]

In the line $open = fopen(“http://quote.yahoo.com/d/quotes.csv?s=$symbol&f=sl1d1t1c1ohgv&e=.csv”, “r”); You need to substitute the actual symbol, not leave it as a string in the query. Maybe something like this: $open = fopen(“http://quote.yahoo.com/d/quotes.csv?s=”.$symbol.”&f=sl1d1t1c1ohgv&e=.csv”, “r”); to concatenate the symbol will help. If you have an invalid request, you are probably looking at garbage. Also – you need to make … Read more

[Solved] How to loop back to the beginning of the code on Python 3.7

username = [‘admin’,’bill’,’Kevin’,’mike’,’nick’] while True : name =input(“Please enter a username: “) if name==’admin’ : print(“Hello “+ name + ” ,would you like to see a status report?”) break elif name in username : print(“Hello ” + name.title() + ” thank you for logging in!”) break else: print(“Who are you ” + name.title() + ” … Read more

[Solved] How do I send message programmatically in iPhone [closed]

Use following way : // Add delegate in .h file @interface ContactsViewController : UIViewController<MFMessageComposeViewControllerDelegate> // Add this in your .m file MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init]; if(picker) { picker.messageComposeDelegate = self; picker.recipients = [NSArray arrayWithObject:number]; picker.body = @”body content”; [self presentViewController:picker animated:NO completion:nil]; picker = nil; } NSLog(@”SMS fired”); – (void)messageComposeViewController:(MFMessageComposeViewController *)controller didFinishWithResult:(MessageComposeResult)result { … Read more

[Solved] How to sort structs from least to greatest in C?

fix like this #include <stdio.h> #include <stdlib.h> #include <string.h> #define BUFF_SIZE 32 #define STRUCT_SIZE 512 struct info { char name[BUFF_SIZE]; char stAddress[BUFF_SIZE]; char cityAndState[BUFF_SIZE]; char zip[BUFF_SIZE]; }; void selectionSort(struct info *ptrStruct[], int size);//! int main(void){ int count, size;//! char buffer[600]; struct info *ptrStruct[STRUCT_SIZE]; for (count = 0; count < STRUCT_SIZE; count++){ ptrStruct[count] = (struct info*) … Read more

[Solved] [] operator in std::map is giving me segmentation fault [closed]

Maybe your myMap is no longer accessible. For instance, it might be a reference to a deleted pointer, or, much more probable, a member variable of an already deleted class: class MyClass { public: selfInsert(std::string myKey) { if(!myKey.empty()) { myMap[myKey] = this; } } private: std::map<std::string, myClass*> myMap; } int main() { MyClass *a = … Read more

[Solved] Free and paid version of iOS app [closed]

I have seen many developers publish a “Lite” version of the app for free with limited features, and a full featured version of the app that costs $$. I think there is plenty of precedent for this approach that you shouldn’t get any push back from Apple. But I have heard they can be somewhat … Read more

[Solved] VB If statement AND/OR

for simple .. use SELECT CASE Private Sub txtchange_Change() Select case Ucase(txtchange.Text) case “A” : lbloutput.Caption = “Apple” case “B” : lbloutput.Caption = “Banana” case “C” : lbloutput.Caption = “Cat” case “D” : lbloutput.Caption = “Dog” case “RED” : lbloutput.BackColor = RGB(255, 0, 0) case Else lbloutput.Caption = “Not Found” End Select End Sub 3 … Read more

[Solved] Creating a JavaScript global array with static elements?

The problem isn’t that removeFunction doesn’t have access to bigArray. The problem is in your onclick attribute, and the id you’re putting on the link: $(‘#div’).append(“<a href=”#” id=’bigArray[i]’ onclick=’removeFunction(bigArray[i])’>Element bigArray[i]</a><br />”); In the onclick, you’re referring to i, but A) I’m guessing i isn’t a global, and B) Even if it is, it will not … Read more

[Solved] How to randomly generate ANSI colors in Bash/Perl?

In bash, you need to use color escape sequences with echo -e random_colors.sh #!/bin/bash TXT=’the quick brown fox jumped over the lazy dog.’ WORDS=( $TXT ) for WORD in “${WORDS[@]}”; do let “i=$RANDOM % 256” echo -en “\e[38;5;${i}m$WORD \e[0m”; done; echo Running this 10 times: for i in `seq 1 10`; do bash random_colors.sh; done … Read more

[Solved] Using NSDateFormatter in objective-C [duplicate]

First, your date format is wrong — the second line should be [dateFormatter setDateFormat:@”yyyy-MM-dd’T’HH:mm:ss.000Z”]; — that is, you need the ss. after the mm: but before the 000Z. This will give you the correct NSDate. Next, you need to create a new date formatter with the format @”dd.M.yyyy” (or @”d.M.yyyy” if you want to remove … Read more