[Solved] I want to count frequency or occurrence of a every letter in a string C program

Ok here is the rewrite, the original code is better but this one might be easier to understand: #include <stdio.h> #include <string.h> int main() { char cur_char; char string[100]; int index = 0, count[255] = {0}; printf(“Enter a string\n”); gets(string); while (string[index] != ‘\0’) { char cur_char = string[index]; // cur_char is a char but … Read more

[Solved] Trend Analysis – Angular Js Vs JQuery [closed]

you are comparing two completely different things. The purposes of both frameworks are lays on different fields although they are intended for UI. Angular is the framework that allows you to separate model from view and controllers and structure your code in MVC patterns on the client side. So if you choose angular all your … Read more

[Solved] Changing vector in function by pointer

The function does not make sense. For starters it is unclear why you are using a pointer to the vector instead of a reference to the vector. Nevertheles, this declaration vector<unsigned char> vec(5); does not reseeve a memory for the vector. It initializes the vector with 5 zero-characters which will be appended with other characters … Read more

[Solved] why here Twice run program

Issues with Code : Object creation is not correct for password class. also argument self is not passed to class method . Fixed Code class password: def pas1(self): pas = [] tedad = int(input(‘how many do you have information ? : ‘)) for i in range(1,tedad): b=input(‘enter : ‘) pas.append(b) print(‘this is your pas —> … Read more

[Solved] How do I create a ListView like the YouTube App? [closed]

The most important thing to apply this kind of design is properly implement adapter, which will represent every piece of data (one video in your situation). More or less in for situation it will look like: <RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android” android:layout_width=”match_parent” android:layout_height=”wrap_content”> //you main picture <ImageView android:layout_width=”fill_parent” android:layout_height=”fill_parent”> //layout to place other info like number of likes, … Read more

[Solved] Replace item in menu using only custom.css in WordPress

Give this a whirl: .is-sticky img.menu-image-title-hide { background: url(http://www.spiritvoyage.com/blog/wp-content/uploads/Screen-shot-2011-12-06-at-2.56.08-PM-150×150.png) no-repeat; width: 150px; height: 150px; padding-left: 150px; } Should do the trick. It moves the original src image out of the way and adds a background image. As far as your user is concerned it’ll just look like it flips from one image to the other. … Read more

[Solved] How to create multiplethreads each with different ThreadProc() function using CreateThread()

Try this: DWORD WINAPI ThreadProc1( LPVOID lpParameter) { … return 0 ; } DWORD WINAPI ThreadProc2( LPVOID lpParameter) { … return 0 ; } … typedef DWORD (WINAPI * THREADPROCFN)(LPVOID lpParameter); THREADPROCFN fntable[4] = {ThreadProc1, ThreadProc2, …} ; //Start the threads for (int i = 0; i < max_number; i++) { DWORD ThreadId ; CreateThread( … Read more

[Solved] How to count the number of characters in a line in a csv file

I suggest you to read the javadoc of String.split. I think that you misunderstood the concept when you did this: String[] f=line.split(“,”); a[count]=Integer.parseInt(f[2]); //–> java.lang.NumberFormatException here! Avoid using ‘magic’ numbers in your code like int[] a = new int[24];. Why 24? Well, here comes a version that do what you want to do. Maybe it … Read more

[Solved] How to improve the uniformly distributed of a given random function to generate uniformly distributed numbers? [closed]

what can be improved on a given random function to make it more random or for a bigger range or something else? and therefore no SRANDOM can be used up to now. How to improve the randomness of the fuction above, if possible ? Sooo write your own SRANDOM with your own semantics. Ex: srandom() … Read more