Old thread at >>51218729
What are you working on, /g/?
Converting a MATLAB program into C++.
It's a pain in the ass.
>>51222251
You should restructure it, I highly doubt a direct translation is either efficient or elegant. Matlab is for testing algorithms, not design.
thoughts on pypy/pypy-stm?
>>51222231
Please don't use an anime image next time.
>>51222231
Got my GUI kit's scrollbars working better than they ever have. So, not great but at least they render.
>>51222251
That's on my to-do list. I'll probably just end up using Python instead.
Ask your beloved programming literate anything.
>>51222231
>>51222231
>What are you working on, /g/?
a general utility C library for /dpt/
>>51222492
How do I draw simple graphical shapes using C?
>>51222520
SDL
OpenGL
Cairo
etc.
>>51222532
Which one do you prefer?
>>51222520
ASCII, stdout
>>51222520
Do you mean circles, lines, squares and so?
>>51222492
I'm interested in NLP but obviously it's too big of a field.
Now let's say that instead of processing any given arbitrary sentence, first it filters the sentence looking for keywords (permutations of a few verbs + nouns). If they aren't found, then it simply returns an error.
If it does find one of the keys, then it attempts to map the sentence into a function.
For example
>Foo, Bar and Baz were at the study group session yesterday. Quux too.
The
>were at the study group session
block means that the program should add those persons to a roll call table for example.
If I can process the verb-noun block then everything else is relatively easy. Once the program understands the sentence as adding to a roll call, it just finds patterns that match people and dates (I can easily provide what to look for each function).
There are some loose ends, like "yesterday and last monday, but Quux wasn't last monday", but let's say I don't care about such complicated cases.
Since I only have a few functions, I think it should be manageable. What's your opinion?
>>51222580
Something like Swing graphics
>>51222610
OpenGL, use SDL or just Win32
>>51222610
SDL: http://sdl-draw.sourceforge.net/
Cairo: http://cairographics.org/
Who here is programming in the new Pipes language?
>>51222721
sounds vaginal and empowering
Got a basic implementation of my Lisp going. I plan to start playing around with Mark and Sweep GC soon.
>>51222432
this tbh fam
Trying to wrap my head around llvm. If I understand it correctly (which I probably don't) if someone were to write a llvm frontend for java, could it run natively, ie no jvm?
Just using java here as an example btw
>>51222721
>yet another meme language
>>51222721
It's shit.
>>51222901
there's already a java compiler
>>51222901
Sure. If you created a transpiler for Java -> LLVM IR, you could theoretically write native Java.
>>51222901
yes like gcj
>>51222492
Are you a girl?
Why is apple cider so good?
>>51223446
Apples are tasty
>>51223498
Is that why Apple phones are great?
Can anyone offer a hint how I might structure some data better? I'm doing the following many times for many palettes and it's a little gross.
This being C++.int vBlues[] = { 0x26839E, 0x2D85BF, 0x369FE5, 0xF6F792, 0x3DD3FF };
palette Blues(vBlues, 5);
why is she hugging her huge boner?
>>51223561
A struct?
>>51223590
girls just wanna have fun
>>51221293
this is my best shot at it
I basically reinvented the wheel to do it, my library doesn't do the whole line.rotate thing and collision detection at the same time
so I had to convert 360 degrees into radians and use cos and sin and do my detection on the individual lines intersecting the points..
ton of debugging but finally got it to work
and the line wasn't even captured by the screen recorder thing
http://pastebin.com/N9tF70Li
>2015
>coding in anything but scheme
Trying to figure out which functional language to learn. I'd really like to do second order predicate logic a al prolog but in a modern language... does anything like that exist?
I'm working on a game that is a reflection piece on what God is doing in my life. The idea is that there are monsters that represent sin and you get power ups / skills from God to help you beat them.
Multivariate Gaussian classification of GLCM texture-analysis
>>51223686
Do you actually need to rotate the line? I'm pretty sure that's just a visualization of the algorithm. For a given point (also given that you know the extreme point), finding the next in the hull should be a simple O(n) search amongst the n remaining points, giving you <O(n^2) for the entire algorithm.
>>51223549
Apple phones are not tasty. They are also not great.
>>51222492
What all is in your library?
>>51223808
Learn Scheme
Then you won't want to learn anything else
>>51223874
do they pay you for this or do you do it without payment?
>>51223874
>Scheme
will look at it.
>>51223901
Scheme is open-source and backed by MIT senpaitachi, it doesn't need shills unlike tacky OOP IN LOO languages like J*va.
>>51223930
so they don't pay you then?
>>51223869
fixed length arrays (・_・ ;)
I'm probably an idiot, but why does my linked list do nothing? I try to print the list and nothing happens. I'm new to C so call me naive.
>>51223839
in hindsight the whole thing could be done without a visualization at all.. just a few simple manipulations of a 2d array
oh well
Hoping someone can help me out. I'm learning C++ from pic related and I'm learning about constants. I'm trying to get constexpr to work, but the compiler doesn't recognize it and throws an error. I looked up a fix and changed my compiler settings in Code::Blocks to: "Have g++ follow the C++11 ISO C++ language standard".
Problem is, whenever I change my settings to that, I get an error in "locale_facets_nonio.h". I've found if I exclude "std_lib_facilities.h", I don't get the error anymore, but I need "std_lib_facilities.h" for the book I'm learning from. Any fixes for this?
>>51224134
Pick a better compiler.
C++11? Come on, it's 2015.
>>51224088
try assigning ptr to root after you malloc root.
>>51224152
I'm currently using "GNU GCC", which was the default. Which one of these would you recommend?
>>51224134
you could always add the includes yourself if you peep in the std_lib_facilities.h
other than that, i dont know
>>51224134
Post code and errors.
>>51224010
Anything else?
>>51224199#include "std_lib_facilities.h"gives this error on "locale_facets_nonio.h":
using namespace std;
int main()
{
cout << "Hello world!" << endl;
return 0;
}
1869 | error: template-id 'do_get<>' for 'String std::messages<char>::do_get(std::messages_base::catalog, int, int, const String&) const' does not match any template declaration
locale_facets_nonio.h line 1869:messages<char>::do_get(catalog, int, int, const string&) const;
>>51224162
Nada. I've revised the code, though, removing infinite looping while loops. Program still freezes.
>>51224195
I recommend you use an entirely different IDE.
>>51224277
>std_lib_facilities.h
I'm learning Java by writing a simple chess engine. Right now I'm profiling my naive implementation of a multi-threaded alpha-beta search. I get okay scaling for a few cores, but if I go full bulldozer or improve my move search ordering I'll need much smarter threading to see the same improvement.
>>51224319
I need that header file for the book I'm learning from.
>>51224306
I thought Code::Blocks was pretty much the /g/ standard.
it's just a project from uni, but i gotta make a UI for this little calculus sheet i made, sorry for the spanish though, it's done with simple circular linked lists in C.
>>51224134
-std=c++11 is normally all you need to pass to g++
Creating a Wordpress plugin.
Writing a particle sim and one of my class methods is doing a thing I don't want it to.__str__(self)for some reason does not want to return a string.
Here's the body.(Yes, I realise that python is not really suited to physics simulation. I'm being lazy)#for the particle class
def __str__(self):
return 'position = {0}, velocity = {1}, mass = {2}'.format(
self.position, self.velocity, self.mass)
As a note. The position and velocity attributes are from another custom class for vectors. relevant vector code below. I like my tuples.def __str__(self):
if type == CARTESIAN:
return 'Vector(' + str(self.value) + ')'
elif type == POLAR:
return 'Vector(' + str(( Vector.abs(self), Vector.angle(self) )) + ')'
[\code]
Where do you guys go for ideas for projects? I find it hard to pick a project and stick to it.
Can anyone explain why people use NewLisp? I don't understand why anyone still use dynamic scope
Can someone explain two's complement to a retard?
>>51224646
Personally. I haven't done a whole lot but I mostly think about something I haven't seen before.(like a hyper-dimensional particle simulator) and scratch out a few ideas on how it might work. If I get bored after that then I go onto teh next idea that strikes my fancy.
Maybe carrying a notebook can help with keeping those ideas readily available. I carry a sketchbook around for my various hobbies anyway.
also having a good idea to have is to use a phased design process to give yourself a clear idea of what you want and build a way to go about making things.
I'm >>51224549 btw
>>51224733
Want to convert a number between positive?
Flip the bits and add one.
Out of curiosity, how do processes read the memory of other processes?
In example, there are programs like MultiEx which are designed to take a live running application, scan the process' memory and rip 3D meshes directly from the memory rather than decrypt/decompress a binary archive.
I want to see if I can rip a regular 2D image from a game.
>>51224010
>>51224088
These are both pretty reasonable fonts. I will never stop loving Terminus, but what are these?
>>51224806
Acorn Nostalgia (>>51224010)
>>51224366
> I need that header file for the book I'm learning from.
Then find a better book. E.g. one which uses standard C++ rather than rolling its own dialect (the header is probably just to make all of the examples shorter).
Or you could try pastebin-ing that header in the hope that someone bothers to look at it.
>>51224791
> Out of curiosity, how do processes read the memory of other processes?
Highly platform-specific. On Linux, there's ptrace() or /proc/<pid>/mem. No idea about Windows.
How do I deal with the feeling of futility that comes from the knowledge that I have to write my own implementations of famous algorithms to understand them, yet I will have to inevitably throw them all away and use implementations (much better) written by other people?
>>51224892
Even so, parsing the memory structure?
Is there some kind of literature on this?
Is C++ much harder than Java?
>>51225041
you're asking the wrong questions.
>>51225033
Maybe they just find out where the heap starts and rip all of the allocations that there were.
Going through the official rails guide because why not get an easy 100k / year job
>>51225000
You make a better version or suck it up.
If you make it good but not quite as good, that's potentially better than their version since you know the code well and have easy access to the source meaning changes are easier.
>tfw building qt from source
see you next week
Hi anons, I'm trying to write a python program which organises my music folder for me. Specifically, I'm trying to get it to break up the names of my mp3 files into artist and title, then rename the file, and add the artist as a tag to the file. I'm editing the files using the Mutagen library as follows:from mutagen.easyid3 import EasyID3
from mutagen.mp3 import MP3
import mutagen.id3
.
.
.
def handleNewFile(file):
#some other stuff
try:
edit = MP3(file, ID3=EasyID3)
edit["artist"] = artist
edit.save()
except:
#do some stuff
And this all works fine. The artist shows up when I look at my ID3 tags in my console. But when I look at them in my file system (running wangblows 8.1), the artist doesn't show up in the "contributing artists" field. This is really irritating as it means that the artist won't show up in Foobar2000 either. Can anyone tell me what I'm doing wrong?
>>51224791
ReadProcessMemory
still working on http://nask.co/
So like, how come when it's printed in the info section it shows up correctly as as a decimal of 0.5
but when I print it later on it shows only as 0
I'd imagine it's because the first time it's literally the print command, and the second time, it's io.write
so how would I show a decimal in the string?
Language is lua
>>51225431
Are you treating it as an int?
>>51225448
integer? I don't know...
I could literally just write it in for the enemies, but the player can have different ones naturally, and I don't think I can print a variable with a string, or whatever things in quotes are called
>>51225411
any suggestions/feature requests/bug reports/testing are welcome
>>51225033
> Even so, parsing the memory structure?
At what level?
/proc/<pid>/maps tells you which parts of which files (executables, libraries) are mapped where, and with what permissions. Those will at least have a symbol table, and possibly debug information.
If there's no debug information, anything below the level of individual sections (code, data, rodata, bss, heap, stack) is guesswork.
>>51225458
So it's the exact same variable with no modifications at all?
Is it basicallyfloat myVar = 0.5;
print(myVar);
printWithOtherMethod(myVar);
If not then there's a chance that during one of your calculations you're treating it as an int somewhere. Make sure the data's actually what you're expecting it to be before you start doubting the library (I had a similar problem with non-english characters in C# showing up as "?", turned out the console just doesn't support them with its default settings).
>>51225431
http://powershell.com/cs/blogs/tips/archive/2014/03/05/formatting-numbers-easily.aspx
>>51225502
In many languages, the default print style of a decimal which is some distance from some integer just prints the integer.
Since it's unlikely that Unicode is fucking with him, it's surely because he didn't realize that if he expects a certain format from his strings, then he should explicitly format it and not rely on the standard library to format it to his expectations.
what other operations an fixed-length array does need ? currentlyArray<T> Operations:
Error Array<T>_initialize (CPP_Array<T> dest, C_Length length)
Size Array<T>_length (CPC_Array<T> a)
Void Array<T>_finalize (P_Array<T> a)
Void Array<T>_finalizeCleanup (PP_Array<T> a)
T Array<T>_get (CPC_Array<T> a, C_Index i)
Void Array<T>_set (CP_Array<T> a, C_Index i, T e)
Size Array<T>_size (CPC_Array<T> a)
Void Array<T>_copy (CP_Array<T> dest, CPC_Array<T> src)
>>51225502
float, right that's a thing I should remember,
Anyways I turned it into
Pmultiplierstring = '0.25'
and that prints normally, but in the
io.write string.format line it returns it 0
>>51225555
my variablesPmultiplier = 0.25
Pmultiplierstring = '0.25'
and execution
print ('Damage Multiplier: ',(Pmultiplier))
io.write (string.format ('Test : %d', Pmultiplierstring))
assuming I did that right
>>51225523
is the spacing thing just a powershell issue then?
>>51225549
0.5 has the decimal right next to the dot though.
And I was meaning to just make sure it wasn't a mistake with your own code before thinking it's a mistake with someone else's, the first thing he thought of was io.write was wrong which is most likely not the case.
>>51225550
Strictly speaking, a fixed-length array should only require allocation of memory and its related actions (initialization), and memory access.
Everything else is extra.
get() and set() should only apply to an entire datastructure.
In data collection nomenclature, get() is most commonly used to refer to an element in the collection, and is suitable for access and mutation of the element.
>>51225550
Construct from a C array.
Copy from a C array.
>>51225555
>>51225563
>%d
I think that's your problem, isn't it %f for floats?
>>51225583
copy,get, and set are here for safety reasons (there no bounds checking in C).
Hi /g/
I do not usually post in these threads as I don't have much experience in programming but I recently came up with an idea of a program.
I like to do film photography as a hobby every now and then and I'd like to record some information about the films and pictures. Basically I would like to manage information about the film rolls that I have in my inventory and that I have used. Typical information that might be useful is film brand/type, ISO speed, number of frames and expiry year/month. Currently I am using a spreadsheet file to manage this information.
And for each of the frames of a film roll I probably might want to store short descriptions about the subject, lighting conditions and photographic settings (focal length, shutter speed, lens aperture). And if some of the film frames ends up being scanned, I might also want this program to know whether or not this frame has been digitized.
Do you think it would be a totally silly idea for a beginner programmer? If not, would you have any advice on how to proceed with this idea? Also, I often see Python as the recommended language for beginners. Would learning Python be a good starting point for me?
>>51225609
That's true, but there's no reason you couldn't have a single get() function that performed out-of-range checks.
The only feasible reason I could see for having set() is to differentiate this array from an immutable array, which is kind of dumb.
>>51225625
That sounds like a job for a database, learn whatever language you want then learn about databases.
It'll probably take you a while to get to that stage though (a month or two would be my guess if you're going straight for it).
>>51225550
i want to be able to easily loop over the array
>>51225625
You never mentioned what your actual idea is.
>>51225633
>there's no reason you couldn't have a single get() function
how so ?
also considering adding slicing operation. eg:Array<T> Array<T>_slice (Array<T> a, Index start, Index end);
>>51225625
excel will be better than anything I can write for you, sorry
Really anything you program will take you hours more to work out and will not be worth it at all
just trust me on this one
>>51225656
>and I'd like to record some information about the films and pictures. Basically I would like to manage information about the film rolls that I have in my inventory and that I have used.
That's clearly a basic inventory management program.
>>51225664
I said it before.
set() doesn't belong with data collections. It should only be used with monolithic data structures.
There is already a well defined get() function present in most OOP languages which returns a reference to an element in the data collection, at which point you can both access and mutate that element.
A proper get function would look like
T* Array<T>_get (CPC_Array<T> a, C_Index I)
Although I have no idea how your language handles references.
>>51225602
Didn't know that was a thing, but now I have this issue I guess even with the one that's in quotes
>>51225625
Just go digital nigga
>>51225671
Of course. I could have told him to write a database, and then he could store whatever the fuck he wanted.
But how does he actually want to interact with that database? Does he want to make a GUI with a set of dropdown templates so that he doesn't have to completely rewrite each item he inserts in the database?
>>51225678
I guess I could just print the first half, but then, I don't think the normal print command can handle multiple variables
>>51225678
Try %.2f (this is java's String.Format, I'm assuming it carries over to other languages somewhat similarly) where .2 is the number of decimal places you want.
>>51225678
Look up printf-style formatting, you can do some nifty stuff.
>>51225695
thanks, seems to have fixed it
why wasn't I simply born stupid but charismatic, coding is such a bitch
>>51225700
they're called formatted strings, bud.
PowerShell may or may not have a recent C#6.0 feature called "String Interpolation", where you can literally just jam variables directly into a string. It's intended to be syntactic sugar for String.Format().
>>51225714
and it appears to have all worked out, now I just need to decide if I'm actually going to continue working on this or make a GUI or ASCII version
>>51225717
In this specific case it's using printf-style, though. There are other styles of formatted strings, as well as interpolation and stream-control-based formatting.
>>51225741
make it similar to anything made using ncurses
>>51225676
can't do that, Array<T> does mean that the array has elements of type <T> so getting the nth element result of a value of type <T>, not of type <T*>. Otherwise, that would mean that anything could manage the memory of the array without passing by the interface which would put too many constrains on the underlaying implementation (especially when concurrency is involved).
>>51225741
Work on your variable names.
>D10a, D10b, D10c, Emultiplier, PDR, PHP
>>51225761
I was just going to go with love2D or something, but that might work, not sure if it'll work for the ASCII route though, I need to somehow get multiple units on the screen
that appears to be GNU, but is it still available for commercial use?
>>51225783
They make more sense to me I guess, D10 is a 10 sided die, E Multiplier is Enemy Damage Multiplier, PDR is Player Defense Rating, and PHP, is Player hit points naturally
>>51225792
I mean the convention, you don't start variables with uppercase, you certainly don't make them all caps (unless they're constant).
Pick a common convention and stick with it (or just pick the most common one for that language).
http://lua-users.org/wiki/LuaStyleGuide
>>51225824
I suppose, probably just going to stick to what makes sense to me though
>>51225839
Learn a convention and make that make sense to you, you'll thank yourself later when you move onto larger projects.
Why don't people realize that braces are a really awful way to denote code blocks?
/rust general/ - embedded edition
This is Rust General, embedded in the DPT. All posts for rust general should quote this post so they can all be linked together.
https://doc.rust-lang.org/stable/book/
>>51225978{
string s = "suck";
}
{
string s = "my dick";
}
{
string s = "python";
}
>>51226020
Actually, I'm an Ada shill :^)
In Haskell, why can't I pattern match with specific stuff when something is a generic type? Example:myFunc :: a -> String
myFunc 0 = "You entered 0!"
myFunc 1 = "You entered 1!"
myFunc "asdf" = "You entered a string!"
>>51226041
Still a type of snake if you go by phonetics.
>>51225999
That's a smexy language and it performs extremely well.
I'm not going to bother learning it until it gets popular, though. I just don't have time to waste.
>>51222417
please respond
>>51223821
hi terry
>>51223821
how about changing the paradigm of what makes a video game, instead of merely changing the plot devices?
>>51225684
Nigga, I already have K10D that I use most of the time. Sometimes it's just fun to shoot a mechanical camera.
>>51225665
Indeed, Libreoffice does this job quite well and is easy to use. I just thought it would be a nice way to learn.
>>51225688
GUI would be nice but I was thinking that some kind of text user interface would be easier to do, is that correct?
>>51226158
Translation: Make another walking/reading simulator.
>>51226221
it's actually flying/listening simulator
/dpt/
I'm trying to make a user interface library like Qt, WPF or Swing or whatever.
I'm looking for some guides and information on how to do this for some of the more complicated aspects.
I can create simple widgets, draw buttons and so on... but things like ListViews and TableViews are pretty complicated.
I can always take a look at Qt's source code (and I have a few times before) but I'm looking for something a bit more instructive.
Do you know of any sites or books, etc?
>>51226221
not exactly. all games have the same core mechanics: power ups, some ability, press this button repeatedly to do everything, all the mechanics of an rpg, all the mechanics of shooters, of puzzle games, etc.
nobody thinks of anything different. if you've played 5 games, you've played them all. the only difference are the plot devices, teh things that make the plot. terrible example, but i can't be arsed to write a treatise: call of duty, and halo. yeah, one game you have to get shot a few more times before you die, than in the other. but they have the same plot devices, just arranged in slightly different ways.
>>51226221
>>51226276
well i guess you were right, except i mean *dont* make another one of either of those
>>51226308
This is like complaining all books have the same structure, they have a problem then the problem is solved. Read one and you've read them all.
You're over generalising (and you're wrong anyway, not all games have those things).
>>51226308
>. if you've played 5 games, you've played them all.
K tard
>>51223727
>>51223874
Scheme vs Common Lisp
Go
>>51226308
>Overgeneraliations: The Post
#include <stdio.h>
main()
{
printf("hello, ");
printf("world");
printf("\n");
}
working on hard c ^^
implemented webm into my image manager, and basically project is finished, old pic because i dont any recent
>>51226535
Racket scheme especially appears to be more powerful. But I like the lisp-2 semantics, it makes calling the result of a computation more explicit.((make-closure) (compute-data))
versus
[code
(funcall (make-closure) (compute-data))
this way you don't rely on subtle parenthesisation differences that programmers must scan for, instead they detect the "keyword" and they go okaaaaaaaaaay.
Why does this works so well?const Rational sum(const Rational& rhs) const;
Rational& Rational::operator+=(const Rational& rhs) {
*this = sum(rhs);
return *this;
}
>>51226302
I don't know any. I've looked into it once or twice before. Best thing is to just look at the API's for UI library's you like and do all you can to understand how they work.
>>51226757
Your const-correctness make no sense. Why are you constructing a new rational from sum and returning it as constant? The copy constructor you have by default isn't affected, but it clashes with move semantics
>>51226059
In some cases you have to specify generally what kind of data the parameter is. In this case it sees the numbers being pattern matched, then sees the string being pattern matched and realizes that strings aren't a numeric type, so it stops.
I don't really know what the intent of this function would be, but I made a couple examples that compile
In this case the constraint (Show a) makes it so a can only be something that can be turned into a string. Yes I know it makes redundant single and double quotes in its output but I don't feel like fixing it just for this example.myFunc :: Show a => a -> String
myFunc x = "hello, you entered: " ++ show x ++ "!"
This one just pattern matches strings...myFunc' :: String -> String
myFunc' "hello" = "world"
myFunc' "world" = "hello"
myFunc' _ = "goodbye world"
I can't really think of an instance where your example would be useful. Could have just made all the inputs strings.
>>51222231
>What are you working on, /g/?
I finished a box today. .webm related
It sends data and the receiver has to be programmed now.
>>51227018
looks pretty cool anon :^)
>>51227018
>>51227025
woops. forgot the webm :^)
>>51227038
damn man, that box is ugly af
and congrats, you can turn on an LED!
>>51226680
well done, maybe hiroshima will make it a feature, if it can run on the webserver. idk if it's a windows thing or a javascript extension
>>51227075
woah
I didn't notice it in the webm, but you have like, what, 10 light sources?
how the fuck can you deal with that
>>51227187
typical of a cheapo multi-led desk kamp
God my lisp is so ugly and unreadable.(defun helm-mpd-tracks (artist album)
(helm :sources
'((name . "MPD Find Track")
(candidates
. (lambda ()
(mapcar
'(lambda (candidate)
(let ((number (car candidate))
(title (car (cdr candidate))))
`(,(concat number ". " title)
. ,title)))
(sort
(mapcar
(lambda (title) (map1 artist album title))
(mpd-list "title" :artist artist :album album))
(lambda (t1 t2)
(< (string-to-number (car t1))
(string-to-number (car t2))))))))
(action
. (("Play track"
. (lambda (title)
(progn
(mpd-clear-playlist mpdconn)
(mpd-find-add :artist artist :album album :title title)
(mpd-play mpdconn)))))))
:buffer "*Helm MPD Album*"))
Any tips on how to write clean lisp?
In java, i have a square matrix, m[i][j]
After reading the matrix elements, i need to parse the matrix like in the picture, and display the numbers in the order of parsing
For example, in the matrix
1 2 3
4 5 6
7 8 9
The output would be 1 2 3 6 5 4 7 8 9
How do i do this?
>>51227379
forgot picture
>>51227386
>homework
>>51227379
structure your matrix as a single dimensional array in row major order and it becomes absolutely trivial
>>51224088
>rand()
Obsolete garbage.
>>51227386
I saw this question a couple days ago and now again//not java
for i in range 100
if i % 1 = 0
print list[i].reverse()
else print list[i]
>>51227431
in range list.countRows()*
>>51227379#include <stdio.h>
int main(void) {
int m[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
for (int i = 0; i < 3; i++) {
int j, stop, inc;
if (i % 2)
j = 2, stop = -1, inc = -1;
else
j = 0, stop = 3, inc = 1;
while (j != stop) {
printf("%d ", m[i][j]);
j += inc;
}
}
printf("\n");
}
First thing that came to mind. There's probably a better way.
>>51227436
That code is really over complicated.
>>51227318
Not just yours.
>>51225000
Learn DP and you'll do everything that way at some point.
Writing a text adventure with a GUI just because I kinda felt like it. How does it look? Any advice?
>>51227510
what language?
>>51227456
How would you simplify it?
>>51227498
What do you mean?
DP algorithms are the ones I rather implement myself because existing code is usually completely incomprehensible (how fucking hard is it to just add a comment with a short description of the underlying recursive function and the eval order? do people just omit this just to fuck with you?)
>>51227539
Python, using GTK and Glade.
>>51227510
Why would you add a GUI to a text adventure?
>>51227562
Because I can.
>>51222231
Learning some Prolog today for my AI class, fun times! First time playing with a declarative language, totally new way of thinking and it is pretty fun, I like it!
>>51227574
For anyone who is interested : http://www.learnprolognow.org/
>>51227543int main(void) {
int m[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
for (int i = 0; i < 3; i++) {
int j;
for (j = 0; i < 3; j++) {
if (i % 1 == 0)
printf("%d", m[i][3 - 1 - j]);
else printf("%d", m[i][j]);
}
printf("\n");
}
}
>>51227613
Good one. I made some more changes.#include <stdio.h>
#include <stdbool.h>
int main(void) {
int m[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
bool even = true;
for (int i = 0; i < 3; i++, even = !even)
for (int j = 0; j < 3; j++)
printf("%d ", m[i][even ? j : 3 - 1 - j]);
printf("\n");
}
>>51224366
gcc is fine. The problem is that it seems to include non-standard headers.
>>51227543#include <stdio.h>
#define SIZE 3
int main(void) {
int m[SIZE][SIZE] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
for (int i = 0; i < SIZE; ++i) {
for (int j = 0; j < SIZE; ++j) {
printf("%d ", m[i][i % 2 * (SIZE - 1) + j * (1 - i % 2 * 2)]);
}
}
printf("\n");
}
>>51227650
I thought about defining the size, but you give the array in the function, so I don't really see the point.
>>51227647
Nice one
>>51227647
>stdbool
ew
>>51227613
small time#include <stdio.h>
int main(void) {
int m[3][3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
for (int i = 0; i < 9; i++) {
printf("%d\n", *(m[0]+i)); // YOLO
}
}
Im currently in my first semester of computer science and have trouble with the programming. Can somebody recommend me some good sites where i can learn myself and look stuff up?
>>51227650
>>51227681
those work
thanks dudes
>>51227698
What are you programming about?
>>51226712
Except because of the parentheses, it's impossible to miss the fact you're calling an expression so the argument is invalid. Lisp2 >>>/trash/.
>>51227670
What's wrong with it?
>>51227712
Stuff like that gives me the impression that C is a failed by design language.
>>51227717
who needs bool when you've 1 and 0
what is the most useful short piece of code you have ever seen?
I think for me Dekkers Algorithm is pretty darn elegant and powerful
>>51227733
Because 2.
>>51227717
>implying 1-bit types make sense for any language somewhat close to hardware
>>51227705
Well i guess for you guys.
Pic related is one of my problem i have to solve
>>51227743
is no 2
>>51227737
I like to define useful as something with practical value, which an algorithm in itself does not have.
To answer your question, a solver.
>>51224088
>>51224299
Initially you didn't assign ptr to a valid root (so ptr remained NULL). The program should've segfaulted due to such dereferences. This tells me that the program never even entered any of the loops and it is hanging elsewhere.
>>51227762
Interesting thought process. Dekkers solves the issue of Mutual Exclusion allowing for concurrent applications to run, don't you think that has practical value?
>>51227750
What is your problem exactly? The syntax of Java? Problem solving?
>>51227681
>>51227650
im retarded
explain how these work
>>51227777
your quints
I have a question, guys.
I have something like this in Javamain {
...
ArrayList<String> a;
.....
method(a);
...
}
public static VOID method (ArrayList<String> a){
....
a.remove(0);
....
}
Will the value at position 0 be deleted from the list back when I keep working with it in main?
>>51227789
Awww shit nigga, my first quints. I'm fucking blessed.
>>51227796
> Homework
>>51227802
It's an end of semester project
>>51227785
Learn how memory and arrays in C works
>>51227808
That's called homework.
>>51227777
Checked.
Ah sry you talk about my problem.
Overall i know what i have to do and how to solve this problem. But when it comes to the programming part in java im clueless
>>51227772
Oh, I thought it was just some generic algorithm.
I guess that does have practical value
>>51227821
Thats why god invented documentation. https://search.oracle.com/search/search
>>51227816
So?
The OP says
>What are you working on, /g/?
Not
>What commercial software are you working on, /g/?
Go be a faggot somewhere else
>>51227832
*A faggot that can do their homework
>>51227832
Where does the OP say "pls help me google/look up docs questions here"?
>>51223561
vector?
has size() in it too, and dynamic, depending on your needs
Anyone using vim with rainbow parenthesis? I get some lag when I edit some cpp files but I have no idea why this is the case given c files work perfectly well with the same config.
I compared two versions >>51227650 and >>51227647 and found that branchless one is superior in performance :^)#include <time.h>
#include <stdio.h>
#define SIZE 10000
int mod() {
unsigned int foo = 0;
for (int i = 0; i < SIZE; ++i) {
for (int j = 0; j < SIZE; ++j) {
foo += i % 2 * (SIZE - 1) + j * (1 - i % 2 * 2);
}
}
return foo;
}
int branch() {
unsigned int foo = 0;
int even = 1;
for (int i = 0; i < SIZE; ++i) {
for (int j = 0; j < SIZE; ++j, even = !even) {
foo += even ? j : SIZE - 1 - j;
}
}
return foo;
}
void bench(int (*func)()) {
for (int i = 0; i < 100; ++i)
func(); // Warm up
double start = (double)clock() / CLOCKS_PER_SEC;
for (int i = 0; i < 100; ++i)
func();
printf("Time: %f s\n", (double)clock() / CLOCKS_PER_SEC - start);
}
int main(void) {
bench(mod);
bench(branch);
}$ cc -O2 -Wall branchtest.c -o branchtest
$ ./branchtest
Time: 0.001636 s
Time: 7.293253 s
Does anyone have those super beginner programing challenges image?
>>51222231
I'm trying to get protocol buffers(https://developers.google.com/protocol-buffers/) working on my system but I can't get the library working
Getting a shitload of undefined references when trying to compile an example.
>>51227889
False dichotomy. My even optimisation was still an improvement over the mod+branch implementation. Here:int neither() {
unsigned int foo = 0;
int odd = 0;
for (int i = 0; i < SIZE; ++i, odd = !odd) {
for (int j = 0; j < SIZE; ++j) {
foo += odd * (SIZE - 1) + j * (1 - i % 2 * 2);
}
}
return foo;
}$ ./test
Time: 0.009440 s # mod()
Time: 9.539466 s # branch()
Time: 0.002296 s # neither()
>>51224366
> Code::Blocks
>/g/ standard
In what fucking universe?
Codeblocks is such garbage (and also dead) that even in bizarro /g/, everyone shits on it.
>>51228001
Oh, I missed one of the mods. And when I reordered it, the results changed. Maybe some compiler optimisation.
So I'm writing a crypter which evades anti-virus software for educational purposes.
I did it as follows:
>encrypt the virus exe
>to execute it:
>decrypt it into a buffer
>create a suspended version of the process
>WriteProcessMemory the process with what represents the virus' virtual memory
The crypted infected virus is undetectable, so that's good. However, when I do the in-memory execution part (the suspend process and write its memory part), many antiviruses go off.
How to make the virus undetectable even when its loaded in virtual memory? Do I just fill the virus memory with junk and tons of NOPs to try to fuck up signature-based detection?
>trying to make the program wait and only continue until a user clicks their mouse
>doesn't work
what's wrong with this code?GEvent event = getNextEvent(MOUSE_EVENT);
while (event != NULL && getEventType(event) != MOUSE_CLICKED)
{
event = getNextEvent(MOUSE_EVENT);
}
>>51228153
AVs will scream at you if you rewrite executable memory
you can't get past that
most viruses decrypt an exe into the users temp directory and run that, which is less suss.
>>51228183
>AVs will scream at you if you rewrite executable memory
Not necessarily. If you create a process and suspend it, and then write its memory, it will go unnoticed as long as you don't write malicious instructions.
The problem is that the malicious instructions get detected by signature-based AV detection.
I guess that what needs to be done is to somehow obfuscate those instructions to make them radically different from the virus signatures anti-virus software has.
A month ago every thread had a F# shilling. Now I'm hooked and no one cares.
>>51228320
>she fell for the meme
>>51228320
>taking language suggestion from /dpt/
>>51228320
I'm a huge F# shill. But I only post about it when it's relevant.
What's the difference between dynamic analysis and debugging? Sorry if this question is stupid - I'm a retard.
>>51226601
Do you know that you can rewrite those printfs in one line#include <stdio.h>
main()
{
printf("hello, "); printf("world"); printf("\n");
}
total life hack. thank me later ;) :)
>>51228645
>tries saving space
>not putting the opening parenthesis after function name
RRREEEEEEEEEEE
>>51228645
ayyyy, real life hack brother
How come all systems development isn't done with X#?
>>51228710
To be even more compact you can write it all on one line.#include <stdio.h>
main(){printf("hello, ");printf("world");printf("\n")'}
Reading TLPI:
http://www.man7.org/tlpi/
So, so good.
>>51222231
W-what is she hugging OP?
>>51228173
p-plz respond
>>51229148
if you need to print a lot of statements (say, more than 5):#include <stdio.h>
int (*p)(const char *format, ...);
main(){p = printf;p("hello");p(",");p(" ");p("world");p("!");p("\n");}
>>51229300
Or you just write out the damn thing because doing this makes your code unreadable garbage.
What do you guys recommend for C++ GUI? I'd like something simple and small (so no Qt), works on at least Linux+Windows, but doesn't look like a Windows 98 program (so no wxWidgets).
Hi friends. Here's some syntax for your printf debugging fun.#lang racket/base
(require (for-syntax racket/base syntax/parse))
(provide print-let print-let*)
(define (let-printer-base names vals)
(for ((name names)
(val vals))
(printf "\t~a: ~s\n" name val))
(newline))
(define (let-printer-count loop-name)
(define count 0)
(λ(names vals)
(printf "Loop \"~a\" ~a\n" loop-name count)
(set! count (add1 count))
(let-printer-base names vals)))
(define let-printer (make-parameter let-printer-base))
(define-syntax (print-let* stx)
(syntax-parse stx
((_ ((name:id exp:expr) ...) body ...)
(syntax (let* ((name exp) ...)
((let-printer) (quote (name ...)) (list name ...))
(let () body ...))))))
(define-syntax (print-let stx)
(syntax-parse stx
((_ ((name:id exp:expr) ...) body ...)
(syntax (let ((name exp) ...)
((let-printer) (quote (name ...)) (list name ...))
(let () body ...))))
((_ loop:id ((name:id exp:expr) ...) body ...)
(syntax (parameterize ((let-printer (let-printer-count (quote loop))))
(let loop ((name exp) ...)
((let-printer) (quote (name ...)) (list name ...))
(let () body ...)))))))
Use example:Welcome to DrRacket, version 6.2 [3m].
Language: racket/base [custom]; memory limit: 1024 MB.
> (require (rename-in user/debug-lets
(print-let let)))
> (define (fib n)
(if (zero? n)
0
(let fib-iter ((a 0)
(b 1)
(n (sub1 n)))
(if (zero? n)
b
(fib-iter b (+ a b) (sub1 n))))))
> (fib 3)
Loop "fib-iter" 0
a: 0
b: 1
n: 2
Loop "fib-iter" 1
a: 1
b: 1
n: 1
Loop "fib-iter" 2
a: 1
b: 2
n: 0
2
>
>>51229300
a macro is shorter
>>51229220
He's hugging his dick.
Do you any of you guys actually have programming jobs?
>>51229148
you mad because i use this simple shit code here, arent you?
lel
here, nice code for you. relax now#include <stdio.h>
/* count digits, white space, others */
main()
{
int c, i, nwhite, nother;
int ndigit[10];
nwhite = nother = 0;
for (i = 0; i < 10; ++i)
ndigit[i] = 0;
while ((c = getchar()) != EOF)
if (c >= '0' && c <= '9')
++ndigit[c-'0'];
else if (c == ' ' || c == '\n' || c == '\t')
++nwhite;
else
++nother;
printf("digits =");
for (i = 0; i < 10; ++i)
printf(" %d", ndigit[i]);
printf(", white space = %d, other = %d\n",
nwhite, nother);
}
>>51229382
Yes.
>>51229382
yea why? you have doubts?
>>51229343
durr why didn't I think of that
yeah, use a macro
>>51229305
m8, we are OPTIMIZING
>>51223549
I suck, therefor iPhones suck.
Androids are p damn cool senpai, see Data from tng.
That is why android phones are best.
>>51228173
http://stanford.edu/~stepp/cppdoc/GEvent-class.html#Function:getNextEvent
> if not, getNextEvent returns an invalid event.
getNextEvent doesn't block. Your event queue is never being filled with a mouse click event because you're never waiting. This loop is running as fast as it can to empty the event queue of MOUSE_EVENTs.
Try waitForEvent.
>>51229421
Not to any of you. I was just curious. I'm hoping I can land one by the end of the year. Is it all about the interview or more about your portfolio?
>>51229477
Degree gets your foot in the door, portfolio opens it, interview closes it behind you.
>>51229477
portfolio help you get an interview, interview test you if you sufficient to do the job.
>>51229477
It's about both. It depends largely on the employer, of course, but some will give you a pass on a shitty interview if you have a good portfolio.
It also helps to know about the stupid fucking frameworks that they use at the job. Because for some reason, managers and "tech leads" will give more weight to that than overall skill.
It has to do with the fact that they completely overestimate the cost of someone learning Spring or some shit for a month. That's it. "Geez, if we bring this guy on, we're going to have to wait half a year for him to be productive!" Bull fucking shit. I don't want to hear it. Do they know what dependency injection is? Do *you* know what dependency injection is? What does Spring DO?
Oh, you mean you're not paid to understand the lower level details, but you're going to pass on someone because they don't have any experience with it; even though you manage a whole team of people using this concept and have no idea what it is. That's great. You really deserve that fucking job.
Know this, anon. The workplace is all about classes. What class of people do you belong to? Are you a well-off, stoic, goody two-shoes who doesn't know a pointer from his ass, but you'll be in there at 6am every morning grabbing coffee, talking about your kids and laughing at all the weird people?
Or are you genuinely interesting? Are you actually passionate about your job? Are you a huge fucking nerd? Uh oh. You are bound to be a weirdo developer forever. Better get used to not having any of your expertise count for shit when it comes to anything important. Just get back in the saddle and do your job like I pay you to do, you insolent fucking NERD.
High school doesn't end. It's the same shit. But, now you're grown up. So that counts for something, I guess.
>>51227707
> what is legibility
When you come from a lisp where there is a named form for it, it really looks like special syntax even though it's not. But I csn live with it
>>51229629
>Or are you genuinely interesting? Are you actually passionate about your job? Are you a huge fucking nerd? Uh oh. You are bound to be a weirdo developer forever. Better get used to not having any of your expertise count for shit when it comes to anything important. Just get back in the saddle and do your job like I pay you to do, you insolent fucking NERD.
I've met these kinds of developers. They often have a desperate need to prove how smart they are when socializing.
Instead of teaching, they look down from what little height on the social ladder they can get when someone doesn't know something they do and scoff when someone has skills elsewhere because obviously the skills they have were the most important to learn at the time.
They often lack empathy and make for shitty team members. And honestly, 95% of software is just CRUD shit and you don't need a super nerd to solve that kind of problem.
So if you're one of those people choose your first job carefully because going through multiple jobs where you don't fit in socially will make you hate your career choices until you see the light and become a consultant making bank.
im passionate about wining but not about programming, how to connect both together anons?
im getting mad when i lose even its very little or insignificant. help me use my anger to work my ass hard because im lazy too.
>>51229477
i was kidding m8. im currently unemployment, looking for a job. newly graduated. ^^
>>51229322
SFML
>>51229726
sounds like you should grow the fuck up
>>51222231
are research papers an obsolete medium that holds back academia?
>>51229726
Try killing yourself in the most imaginative way possible. A locked room murder that was actually a suicide. Implicate the last person that beat you at something.
>>51229775
Nothing holds back academia. Industry first hates academic work, then they grudgingly see some side benefits and replicate it halfway, then a programming language that implements a 20+ year old feature gets popular.
Lisp: the language of the future for over 50 years.
>>51229629
you still get more and more salary with programming, more exp = more money. if they dont gave you a rise, change job.
so what is the problem with classes in the work really? everywhere has its own classes which divide people into something. you hate people at work, dont you? lel
and btw who need to prove something to other like its intelligent, that guy is insecure af and need to accept by society. needing something from others is make you a insecure faggot.
>>51229809
um, industry is definitely on a trend of stomping academia. check out what's happening in computer vision -- google research kills it and catches up with academics. industry pays better and they'll transfer most of the talent out of academia
>>51229832
This proves what?
>porting linux program to windows
>function call just doesn't work
>changeassert(function_call() == 0);
>tolog(debug, "function_call: %d", function_call());
>works
JUST
>>51229716
> multiple jobs where you don't fit in socially will make you hate your career choices
God how true.
I am a consultant. However, I did wrote that post.
> Instead of teaching, they look down from what little height on the social ladder they can get when someone doesn't know something they do and scoff when someone has skills elsewhere because obviously the skills they have were the most important to learn at the time.
This is not necessarily true and it's the same shit I've heard from people who *feel* inadequate when talking to someone who has a deep understanding of something that they don't.
Look, I get that empathy is required. Emotional intelligence is a severely unappreciated skill when it comes to developers. However, that door swings both ways. For this reason, teaching is hard.
I may be genuinely trying to instruct you or pique your interest in a subject. I may want to hear what you think. All the while, you may think I'm just trying to display my intelligence because you are unaware that *I am* unaware that I needed to start at the beginning.
It's the same reason people hate on their professors. Really, there's just a disconnect. Recognizing and remedying that in conversation is one of the hardest jobs any of us face.
What I'm complaining about is the other side of that two-way street. The people that choose to socially isolate themselves from the nerds. More often than not, they become the managers, the leads, the directors. Because they fit in with the VP or C-level crowd.
>>51229855
nothing, it just addresses points like "industry first hates academic work", "nothing holds back academia" (lol @ academic funding) and the claim that industry is always "20+ years" behind.
>>51229629
>Because for some reason, managers and "tech leads" will give more weight to that than overall skill.
It's called training cost. If they don't have to pay, say, one week's worth of salary during which you're unproductive, they're happy. Most people are "slow" learners and will need at least this long, if not longer, to learn a new framework.
>>51227707
>there is actually a /trash/ board now
Fucking hiroshima!
>>51229832
google is, for the most part, just copy-pasting academia research and scaling it up. The only recent exception was DRAW.
>>51229878
So we have different ideas of what the question meant by "holding back." Funding holds back nearly everything so it seems an uninteresting point to raise in both academia and industry, but you're not wrong.
>>51229300
That's good, but there's room for improvement.#include <stdio.h>
#define ※ printf("
#define :^) );
#define ‡ (
#define ¤ }
main‡){※hello":^)※world":^)※\n":^)¤
>>51229474
>>51229474
thanks, for the help, I think I understand why.
I know there is waitForClick() which I used instead, but didn't know why it wasn't working the other way
is this a good way to code it though, if I didn't want to use waitForClick()? it works, as the program doesn't proceed until a click is made, but is there any way i could make the code better/cleaner?int clicked = 0;
while (clicked == 0)
{
GEvent event = getNextEvent(MOUSE_EVENT);
if (event != NULL && getEventType(event) == MOUSE_CLICKED)
{
clicked = 1;
}
}
>>51229898
that's a bit unfair to say when they have top class researchers on their payroll
http://www.cs.berkeley.edu/~barron/
>>51229901
that's a bit silly. funding holds back some more than the others, so there is a discussion to have.
any feasible communication medium holds back people to a degree, but you can still talk about it, compare it, analyze it, improve it
>>51229775
i have written several research papers now
academic research papers are 50% bullshit. the review process is basically luck, like a job interview, and everyone freely admits this. if you get reviewers who are either clueless or pissed off then you're screwed, and this is very likely because reviewers aren't paid. reproducability is also an issue, although we're better than many sciences in this regard
industry research papers are tbqh worse, more like 90% bullshit. google, for example, does okay research but HOLY HELL their papers are garbage. they never give away important details, everyone copies their research because "google is big," and then the copies are trash because the details aren't there. see: hadoop. i suspect that google "farms" unfinished ideas out to the research community by publishing on them before they're fully realized, and letting academics do the polish.
what's funny is that google is actually a pretty upstanding citizen. facebook is worse, amazon is much worse and apple does virtually nothing (cont)
>>51230028
>beginner
>create an FTP client
wat
Trying to learn MIPS and qtspim so I can do some
projects in assembly.
Trying to figure out what the different registers are for and a decent tutorial.
>>51230116
spim comes with a reference manual just use that
What's the difference between debugging and dynamic analysis?
>>51230028
rolling
>>51230096
>Beginner
>FizzBuzz
You don't have to do all of them
>>51230094
the academic brain drain is real -- we lost a tenured professor to google some years ago, it was disastrous -- but the meme that "industry is crushing academia" is just advertising, it's part of the brain drain process. in SOME areas industry is creating more advanced technology than academia but that DOESN'T mean they're "doing good research" or that they're "publishing good research." first off, a lot of good internal research isn't published, and while unpublished research has a kind of aura of coolness, more often than not it's just regressive because everyone is duplicating each other and no one is building on each other. so you end up with really narrow internal systems that lack basic features and kind of pass into some narrow use very quietly, it's hugely wasteful
the other thing is that even if the internal technology is good, doesn't mean the research is good, because research has high epistemic standards (i.e. reproduction). as bad as academic reproduction is, industry reproduction is often much worse, e.g. facebook will publish a paper with these garbage, incomparable performance numbers where the metric unit is e.g. a percentage of their proprietary cluster. (200 MACHINES! VERY BIG SCALE!) 6 years ago such a paper would be automatically accepted (200 MACHINES!) but thankfully we've passed that bump and now it just looks stupid when they do it. in contrast, academics tend to publish their source code and use computer systems that one can realistically obtain access to
it is very, very important to peel away the mystique of "big company internal systems" and realize that most of these things are just not that advanced, they're just trade secrets
>>51230137
Dynamic Analysis is buzzword compliant.
>>51230094
are industry papers really that bad? http://arxiv.org/pdf/1507.00410v2.pdf
>>51230137
you do dynamic analysis if you are a coder ;)
>>51230134
I see the name of the reference manual when I do
"man spim"
Have no clue how to actually pull it up.
>>51230288
wow
just give up on mips programming
and life
Using python to scrape xml to a mysql db
what am i even doing
>>51229918
noice
>>51222231
If I "use" code from a GPLv3 project, at what point do I have to come out and release my source code?
Is it only once I try to make money off it or release to the public?
>>51230346
what's wrong with that? is there an alternative if no public api is provided and u need the data?
>>51230365
When you distribute application.
>>51230346
this is normal
>>51228645
You are absolutely fucking retarded.#include <stdio.h>
int main()
{
puts("hello, word");
return 0;
}
>>51229918
This is easier in C++, where you can actually mold the syntax into a natural-language programming language.#include <iostream>
#define wew int
#define lad main()
#define looks {
#define like std::cout<<
#define you "hello,"
#define spared <<
#define no "world\n"
#define expense ;}
wew lad looks like you spared no expense
>>51230393
Do I only need to distribute the source code to those who I distribute it to?
>>51230344
Hey, thanks for the help man. I appreciate it.
Good post.
>>51230365
...Dude, read the actual license. It tells you.
>>51230443
Thank you.
I can only hope it helped you to decide to kill yourself or learn how to google.
>>51230424
http://www.gnu.org/licenses/gpl-3.0.html Chapter 6.
>>51230028
roll
>>51230527
>reading licences yourself and making potentially costly decisions based on your naive understanding unless you are a lawyer
good idea
>>51230396
>absolutely fucking retarded.
>"hello, word"
>word
>>51230424
https://www.gnu.org/licenses/gpl-faq.html#GPLRequireSourcePostedPublic
If it's private, no.
>>51229970
Just because they have good researchers does not mean they're allowed to do anything good, nor does it mean they're any productive.
>>51230094
Confirmed for not having written a single paper.
>>51230605
Why?
>>51230204
Industry papers tend to be about the technicalities (how to apply something to data 10x as large, or when you can't get meta-information for your data; how to speed stuff up, how to parallelize everything, how to distribute tasks efficiently, etc.) as opposed to actual advances.
What is a good algorithm that finds a path through a non-directed graph, visiting all nodes only once. Edge weight is not important.
Of course this is not possible in every graph. In this case it is okay if the algorithm does not succeed.
Pic is something I came up with. From a start node following the red arrows is the path I'd like the algorithm to find.
>>51230554
>asking 4chan instead of reading himself
good idea
>>51230666
Look up graph traversal algorithms, m80.
>>51230666
Run BFS/DFS and remember nodes visited to avoid them
>>51230549
fuck that reroll
>>51230753
no more excuses now
I'm new to C as well as pointers. How do I maintain a linked list while still growing it?
Here's my list.struct list {
int val;
list *next;
}
I declare a global list next.struct *list theList = NULL;
list = malloc(sizeof(struct list));
Then in some functions I add to the list.void load(int var) {
list->val = var;
list->next = NULL;
list = list->next;
}
Say I do:for (int i = 0; i < 5; i++) { load(i); }
At the end I'm left with list = NULL. I can't go backwards.
How do I maintain the original list?
http://pastebin.com/aKWLxXeb
For the love of god why is this supposed to be the "easy" way of compiling
How the fuck am I supposed to understand this shit
>>51230666
>visiting all nodes only once.
every node in the graph?
that would be a Hamiltonian path
>>51230771
>How do I maintain the original list?
Keep an extra pointer to the root node.
>>51227753
No that's 3
>>51230375
>>51230395
>implying I can into OOP
>>51230799
but you dont need oop
you just have no idea what you're doing
>>51230771
In your load function, you're setting list->next to NULL, and then list to list->next. This means list is NULL.
NEW THREAD AT >>51230807
NEW THREAD AT >>51230807
>>51230829
>functional pussy
the BEST Jerry
>>51229382
Yup
>>51230771
By the way, use p = malloc(sizeof *p), not p = malloc(sizeof(Type)).
>>51230137
Dynamic analysis removes the need for formal written tests in all but the largest applications.
>>51230605
i literally just presented at a top-tier database conference. i am not really interested in ID'ing myself on 4chan, though
>>51230204
i'm honestly not qualified to assess ML research. it's not that i can't read it, just that i don't know the state of the field
>>51230666
visiting every node only once is hamiltonian path, which is NP-complete. this is because it's equivalent to asking whether there exists a longest path of length >= k = |V|, which is also NP-complete
unfortunately i don't know any good heuristics for hamiltonian path. afaik it is one of the "actually hard" NPC problems and has comparatively little economic interest
>https://en.wikipedia.org/wiki/Hamiltonian_path_problem
>>51230771
Response over here: >>51231067
How realistically viable it is to work at home?
I hate going to work, i hate those passive agressive pretentious fucking pricks, i hate the whole social bullshit ass game that they play and it really, really, really drains all my energy, i get wolf of wall street levels of stress.
But since i need the money, i can't just quit.
Does anyone here get money from personal projects or something like that? I have one or two ideas that i'm pretty sure i could sell for a good amount, but that amount wouldn't last more than a year.