[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
/dpt/ - Daily Programming Thread
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 32
File: 1458239867725.jpg (58 KB, 699x468) Image search: [Google]
1458239867725.jpg
58 KB, 699x468
New thread: >>53726474

What are you working on, /g/?
>>
Really /g/, what is OOP exactly and why is it so good?
[spoiler]
There are thousands of definitions, all of them are bullshit. And you can't defend it without using the True Scotsman fallacy that this mess enables. It's just a costly mirage, we should move on to Concurrency Oriented Programming.
[/spoiler]
>>
So far the only reason you guys gave for why Java is bad is all meme reasons. Verbosity is not a real argument either is reference equality or serialization
>>
>people actually think java is respectable
>>
>>53733370
fuck off retard

see

https://rbt.asia/g/thread/S52476540#p52479462

and it's basically syntactic sugar for structs, which makes good programming LESS verbose
>>
File: ancap foo-de lowest res.png (4 MB, 1560x3928) Image search: [Google]
ancap foo-de lowest res.png
4 MB, 1560x3928
>>53733384
>not a real argument
>>
>>53733370
>what is OOP
Grouping functions and variables into instanced namespaces.
>>
>>53733370
Functional programming is the way forward.
>>
>>53733394
>>53733412
This is not enough to make a cult for it tho.
>>
Why are Indians the best programmers and have all the programming jobs in every language?
>>
File: xEby2QO.png (38 KB, 561x852) Image search: [Google]
xEby2QO.png
38 KB, 561x852
>>53733358
Image isn't trying to prove anything, I just think it's odd that C# implements '==' differently for primitives and objects.
>>
>>53733413
>not being part of the multi paradigm master race
>>
>>53733451
I haven't seen many poo in loos for Go fortunately.
>>
OOP is much better for large real applications to make the code more easier to maintain and easier to fix
>>
>>53733451
Motivation.

>If you get good at this, you can leave this hellhole of a country and live like a king, comparatively speaking.
>>
https://github.com/sridharv/gojava

uhh...
>>
File: 1456538206444.jpg (273 KB, 586x634) Image search: [Google]
1456538206444.jpg
273 KB, 586x634
CGo pointer rules added in 1.6 are really confusing at times.

- return C.GoBytes(unsafe.Pointer(&img.data), img.size), nil
+ return (*[1 << 30]byte)(unsafe.Pointer(img.data))[:img.size:img.size],nil
That'll fix it for now.
I was in a Go datastructure that the C code kept around and then calling C.GoBytes on data that was allocated by gc.
Go pointer to Go pointer.
>>
>>53733472
>endless repetition of code
>>>>""maintainable""
>>
>>53733497
The whole point of OOP is to not repeat things.
>>
>>53733497
It's easy: just write a factory
>>
>>53733516
You know there's functions and polymorphism for that already right?

btw: OOP "polymorphism" is not true polymorphism
>>
>>53733516

Avoiding unnecessary repetition is the goal of PROGRAMMING, not of OOP. Many other paradigms have much stronger solutions.

>>53733519
>write a factory
Repetition.
>>
>>53733458
When will you learn? Multi paradigm doesn't work.
>>
>>53733531
>OOP "polymorphism" is not true polymorphism
Can you expand on this?

Examples with no object-oriented characteristics would be appreciated.
>>
>>53733394
>>53733412
This. There are only two important parts.
First: typename_methodname(instance, ...) turns into instance.methodname(...)
Second: easy polymorphism through inheritance without fiddling around with function pointers.

That's all there is to it but then your university professor says you should use polymorphism and inheritance everywhere because it magically solves all your problems when in reality you should only use it when you actually need it.
>>
>>53733556
>C++
>C#
>rust
>go
>d
>f#
>nim

>multi paradigm doesn't work
>>
>>53733549
>Many other paradigms have much stronger solutions.
Such as?
>>
File: 1J5Zu.png (27 KB, 537x230) Image search: [Google]
1J5Zu.png
27 KB, 537x230
I asked this question before but i always get no reply, how do you disable the close button on a Windows program? I've seen malware do it, but i don't know how to make it happen on purpose in a proper program.

I wan't to help my users not accidentally close the installer. This isn't an evil program...
>>
>>53733407
When will china finally run out?
>>
>>53733573
All failures. Otherwise we wouldn't be looking for something better.
>>
>>53733561
I think he means that OOP polymorphism is just a corner case of polymorphism

I.e. oop polymorphism is subtypying via inheritance

Polymorphism includes:
Parametric polymorphism (templates, generics)
Ad hoc polymorphism (overloading, overload sets)
Subtype polymorphism (inheritance, discriminated union, implicit casting)

Lots of "OOP languages" use the others, but these aren't OOP features
>>
>>53733582
Botnet please go
>>
>>53733582
You've got replied multiple times, do not do that, handle close events properly.
>>
>>53733582
Call user32.dll you stupid fucking Indian
 Local $calcHwnd=WinGetHandle("")
$menu = DllCall("user32.dll","hwnd","GetSystemMenu","hwnd", $calcHwnd, "int",0)
DllCall("user32.dll", "int", "RemoveMenu", "hwnd", $menu[0] , "int", $SC_CLOSE, "int", 0x0)

Wow that was fucking hard
Did you even LOOK on msdn for one fucking minute before asking this? its in the documentation for how to manipulate system control bar on windows.
>>
>>53733577
Such as generalised abstract data types and declarations, type classes/concepts, lexicographical analysis, some degree of custom syntax etc

All of these will help you turn "write a factory" into something that's automatically done
>>
>>53733621
Thanks you
>>
>>53733621
What the fuck am I looking at?
>>
Which programming application should I make that will have the highest chance of making a lot of money
>>
>>53733676
Ransomware or a Code of Conduct (they're very similar)
>>
>>53733676
Inane android app geared towards the lowest common denominator with ad revenue and/or some basic microtransaction
>>
>>53733676
>learn mandarin
>learn go
>apply for job at Baidu
>>
>>53733701
Such as what?
>>
>>53733561
You just get to dispatch based on one argument, arbitrarily promoted as the "receiver". It has its uses, but in a statically typed environment, you can use much more typing information that that. take the eternal Haskell example:
mySum :: Num a => [a] -> a
mySum = foldl (+) 0

Here, Haskell selects one of the many existing implementations of +, based on the type of the list. It does this once at compile time, instead of doing it as much times as there are elements on the list, and throwing an exception at the 999th elements on 1000 because it is not satisfied with the other term of the addition for some reason.
>>
>>53733674
Its an autohotkey script for calling user32.dll, with the basic syntax and the values necessary to do this so that he can port it to whatever fucking language he's writing his malware in.

Program's GUI windows on Windows operating system have a control bar at the top, known as the system menu. a system DLL (user32.dll) exists that can manipulate any window's system menu by targeting its identifying hwnd and then you issue the call with the RemoveMenu function to adjust its menu which updates the UI provided by the OS.

Be aware that adjusting menu's dynamically is STRONGLY DISCOURAGED on msdn as it looks unsettling to the user, no one will want to use your piece of shit software if it does this, just saying.
>>
>>53733674
Calls to native windows dlls from a high-level language to modify the way the operating system inherently displays a window
>>
>>53733531
Polymorphism is an extremely generic term. Different groups of people use the same word to refer to different things. There is no such thing as "true polymorphism".

Arguing about "true polymorphism" is like a birdwatcher and a construction worker arguing about whether a "true crane" refers to a bird or a machine. Both are equally valid.
>>
I want to an anki clone that focus on learning japanese and japanese vocabulary.

how do I make in java (it's for android) a class that contains let's say 500 strings and each string contains also information like being in the top 10, 20, 50, 100, 500, cathegories (as to easily make top 10 and other sublists) plus also having a score based on how many times you guessed right it and a time float indicating the time it should come back for review.

Also I should be able to have for each entry a certain ID so I can randomize the order in which they appear.

Also information over each word about it's grammatical function (noun, verb, adjective, adverb, conjunction, etc).

Also a bunch of tags like office, family names, places, etc.

All this information for making diferent vocabulary list like top 10 adverbs, top 50 verbs and list like food and so on.

What data structure should be the best for this?
>>
>>53733761
ArrayList
>>
>>53733761
Store your shit in a SQLite database.
>>
Is it bad to bundle additional software, such as a plugin or toolbar with your program?

I have heard that there's nothing wrong with it as long as you allow the user to opt-out, right?

I have some perks for including this bundled software in my program if i add it is why i ask
>>
>>53733780
This.
>>
>>53733802
People will hate you if your malware shit is installed by default.
>>
Give ma Android application ideas
>>
>>53733780
>>53733808
explain to a retard what is a SQLite database.
>>
>>53733849
SQLite (/ˌɛskjuːɛlˈlaJt/[3] or /ˈsiːkwəl.laJt/[4]) is a relational database management system contained in a C programming library. In contrast to many other database management systems, SQLite is not a client–server database engine. Rather, it is embedded into the end program.

SQLite is ACID-compliant and implements most of the SQL standard, using a dynamically and weakly typed SQL syntax that does not guarantee the domain integrity.[5]

SQLite is a popular choice as embedded database software for local/client storage in application software such as web browsers. It is arguably the most widely deployed database engine, as it is used today by several widespread browsers, operating systems, and embedded systems, among others.[6] SQLite has bindings to many programming languages.
>>
>>53733839
I gave them a chance to decline the bundle though, are you telling me people don't read the installer and just click Yes every dialog?
>>
>>53733872
Basically what you are saying it is SQL for local web browser only?
>>
File: lole.png (170 KB, 1236x1600) Image search: [Google]
lole.png
170 KB, 1236x1600
>>53733747
What do you think of as being a "field" first anon?

pic is a form with a lot of fields about a trip to a field
>>
>>53733872
wtf does that means and how can It help me?

I've never coded something related to a database.
>>
>>53733895
No it's a database contained in a single file.
>>53733901
It's a magic box holding your data. Seriously, if you've never used a database, don't start that project. Stick with fizzbuzz tier challenges.
>>
Im working in a new compression algorithm that can theorically compress 80% most of the files without data loss.

Pros: Theorically can compress 1GB files to 50MB

Cons: Is slow, almost 3 minutes to compress files bigger than 10 MB, and the times exponencially grows.

All praise the Richard Super Conpression Algorithm (RSCA)
>>
>>53733929
I've made games and shit before, but I've never tried to make something that needs a database.
>>
>>53733358

Porting a project to js. I've been trying different methods of rendering a lot of shapes to the screen and I've settled on WebGl after SVG + Bonsai.js proved too slow.

Js has a lot of potential - I can see that, but is there any IDE/editor plugin that will catch simple errors as I type?

I think that one of the reasons why Java is so popular is that eclipses live syntax checking is awesome. I don't see why this couldn't be done for other languages as well because it's one of the most powerful productivity tools around.

Eclipse Parallel edition + Fortran gives red underline syntax errors when you build but I don't see why this couldn't be done live.
>>
>>53733929
Ohh I see so an entire database in one file where you can manipulate data locally on your device such as a phone?
>>
>>53733967
Yeah, it's a database meant to run on your own machine.
>>
>>53733957
You should learn SQL first
>>
Someone help me with sql
Lets say you have 2 tables with 1 row one (1,2,1,2) and second (2,1,2,1) when i do a normal inner join :select * from table1,table2 where table1.row=table2.row

Now if i type it like this i get 22112211 and if i switch table1 with table2 i get 11221122 why is this?
how the fk joins work?
I've been told that only the common members from both tables are shown according to that condition but why instead of 4 members my resulted table has 8?
>>
no matter what your opinion is about java, you're retarded if you don't think C# is worse than java.

C# is literally a cargo-cult clone of java with massive feature-creep due to a load of dunning-kruger pythonesque "features" tacked onto it that you aren't even supposed to use

>many of the disadvantages of java
>many of the disadvantages of C++
>few of the advantages of java
>few of the advantages of C++

java is good for its simplicity. if you don't need simplicity you may as well use C++ instead. the "low level features" in C# still give you shit performance.
>>
>>53734175
Hahaha, I don't even use C# and I know it's a thousand times better than Java you desperate fucking twat
>>
>>53734182
epic meme fag
>>
>>53733962
can't be done for JavaScript because it's dynamically typed (no type errors until the code is run)
I mean, syntax errors are still possible to catch, but it will never catch all the errors your IDE can catch for Java. if you want something that can, I recommend trying out TypeScript in Visual Studio Code
>>53734175
it's okay pajeet, we're here for you
>>
>>53734214
you can catch type errors in javascript - create your own type system
>>
>>53734214
Pajeet my son
>>
>>53734140
BUMP.
>>
>>53734175
The only reason C# doesn't receive all the hate is because of muh Microsoft.
>>
File: 7phuJaq6.jpg (42 KB, 512x512) Image search: [Google]
7phuJaq6.jpg
42 KB, 512x512
>Java
>C#
>C++
>>
>>53734214

Yeah I figured that Js and C++ would be a little too complex but surely C/Fortran and one or two other languages are simple enough to allow live linting and catching 99% of syntax bugs without having to run it and see the compiler output.
>>
File: robpike.jpg (151 KB, 923x677) Image search: [Google]
robpike.jpg
151 KB, 923x677
>D
>>
>>53734233
>tfw you started the andreiposting
feels good
>>
>>53734230
no, it's because they actually put some thought in it and realized how retarded some of the ideas behind Java were
>method overloading is okay
>operator overloading is too difficult
>but some operators are overloaded anyways
>>
>>53734230
>implying Microsoft doesn't receive hate
>>
>>53734175

C# is literally Java except it adds features that Java is missing to make it a decent language.
>>
>>53734247
who the fuck is this guy and why are you trying to force this non meme
>>
File: andrei.jpg (18 KB, 200x256) Image search: [Google]
andrei.jpg
18 KB, 200x256
>Go
>>
>>53734140
BUMP.
SOMEONE ANSWER.
How joins work???
>>
>>53734233
They're the same language.
>>
>>53734277
You're not even using a join.
>>
File: rob.pike.jpg (26 KB, 500x335) Image search: [Google]
rob.pike.jpg
26 KB, 500x335
>ur mum
>>
required listening (and watching)
https://www.youtube.com/watch?v=qzC5H5xrr-E

https://www.youtube.com/watch?v=WjTrfoiB0MQ
https://www.youtube.com/watch?v=LIb3L4vKZ7U
https://www.youtube.com/watch?v=3NihZVcZqto
https://www.youtube.com/watch?v=Qq_WaiwzOtI
https://www.youtube.com/watch?v=vrfYLlR8X8k
https://www.youtube.com/watch?v=9tvbz8CSI8M
>>
>>53734259
>Implying method overloading is a bad thing

Just admit it you guys Java is a bro tier language
>>
>>53733457
it depends on how the == operator is overloaded in the concrete type, which makes perfectly sense
>>
>>53734332

more like barf tier
>>
>>53734315
look at the shape of his neck & head
he is literally a bellend, a dickhead, a snaketip, a willy wonka
>>
File: C o C.png (6 KB, 505x74) Image search: [Google]
C o C.png
6 KB, 505x74
https://forum.dlang.org/thread/[email protected]
>>
>>53734350
xD
>>
>>53734140
Shit, Pajeet.

Get it together.

You aren't even doing a join in your example.

Try:
SELECT *
FROM table1
JOIN table2 ON table1.row = table2.row
>>
>>53734370
I read through that thread a few days ago, what a clusterfuck.
Luckily most of the people in it could give two shits about the topic
>>
how hard is to learn SQL and SQL lite?
>>
File: Dlicious.jpg (840 KB, 1580x3422) Image search: [Google]
Dlicious.jpg
840 KB, 1580x3422
>>53734393
>>
>>53734410
>how hard is to learn SQL
Not hard at all.

SQL was literally designed to be able to be used by non-technical people.

I'm a database architect.

Do you have any particular questions about databases, querying, or database design?
>>
>>53734419
What is the best solution to implement SQL in Android programming
>>
>>53734419
see
>>53733761
>>
>>53734450
ask github for an implementation of the CLR on the JVM
>>
You guys do realize if we all worked together on programming an application we could have a medium sized useful application that would actually make money
>>
>>53734556
This is bait.
>>
>>53734450
>>53734454
Assuming all of your devices will be 'calling home' and retrieving data from a centralized location, you could stand up a server(your OS/distro of choice) with a MySQL or PostgreSQL installation for free (other than hardware/hosting costs).

A relational database would likely be the best way to get the structure you're describing, because the connections and relation between objects is meaningful.

This would force the application to be online-only, but you could also implement a caching system locally on the device. As far as storing this information directly on an Android device, I am not familiar with best practices for that.

As for retrieving the data, there are numerous Java libraries for sending and retrieving data from most database servers.

For example, in C#, you could do something like this:
SqlConnection thisConnection = new SqlConnection(@"Data Source=localhost;
Initial Catalog=default;
Persist Security Info=True;
User ID=user;
Password=B1GT1tti3z");
thisConnection.Open();

string Get_Data =
@"SELECT *
FROM tablename";

SqlCommand cmd = thisConnection.CreateCommand();
cmd.CommandText = Get_Data;

SqlDataAdapter sda = new SqlDataAdapter(cmd);
DataTable dt = new DataTable();
sda.Fill(dt);
var ayy = dt.AsEnumerable().ToList();

foreach (var number in ayy)
{
WriteLine(number.ItemArray[0]);
}
>>
>>53734556
>You guys do realize if we all worked together on programming an application
>if we all worked together on programming an application
>if we all worked together
>programming an application
>worked
>together
>programming
>
>>
>>53734556
In Java?
>>
>>53734570
LOL yes epic meme! This is why I come to 4chan

>>53734581
Obviously only in Java
>>
How often are the std:: containers like vector set and list used in some seriois software? I've only started programing in c++ and I don't know if I should rely on them that often or not, are they a good foundation or a crutch?
>>
>>53734556
>that would actually make money
Who gets the money?
>>
>>53733952
Sounds like a pipe dream. Post test results?
>>
>>53734600
vector - ALL THE TIME
set - ocassionally
list - HAHAHAHAHAHAHAHA
>>
>>53734602
Share the profits all of us
>>
>>53734613
Legally, how?

Wouldn't a company needed to be created first to legally hold the funds?

Then there's all sort of legal tomfoolery that needs to be gone through to create the company, hire all of us as 'employees', enforce less than 36 hours of work so we don't have to pay benefits...

Too much work on the overhead.
>>
>>53734419
I'm making a small program which should determine the canonical cover for a set of functional dependencies, candidate keys, and maybe even how to break it down to BCNF.

Do you rely on applications to do that type of work for you, or do you do that by hand? Also have you ever had to normalize stuff beyond BCNF?
>>
>>53734632
I don't know I'm retarded
>>
>>53734273
java is good because it purposefully omits certain features such as operator overloading

if you want such features, use C++
>>
>tfw can't into junit testing
i've literally programmed for 3 days without testing anything and it's due this thursday. my first test is going to be trying to run the complete program and i'll have to chase bugs down all the way from the top
>>
What is a reasonable project that you guys would agree to work on together for fun?
>>
>>53734600
You can't even spell serious correctly, how can you expect a serious answer Pajeet?
>>
>>53734233
literally the only decent languages suitable for use in real life
>>
>>53734704
You forgot about Php, Javascript, and Sql
>>
>>53734565
that sounds overcomplicated for what I need.

Hell, I could make a shitty list of a custom class that contains the information of every word.
>>
>>53733962
"use strict" and jshint
>>
>>53734691
>java is good because it purposefully omits certain features such as custom function names

>if you want such features, use C
>>
>>53734610
I'm using a list in a program I'm making because sometimes I'd need to decompose an element into several others and replace it with the resulting elements. That's why the splice function is useful to me, and the list by extension.
>>
File: 124411126661.jpg (908 KB, 1920x1200) Image search: [Google]
124411126661.jpg
908 KB, 1920x1200
http://www.businessinsider.de/npm-left-pad-controversy-explained-2016-3?utm_content=buffer65507&utm_medium=social&utm_source=facebook.com&utm_campaign=buffer%3Fr%3DUS&IR=T

What the fuck? What the fuck is wrong with web devs? What the fuck is wrong with the industry?
>>
>>53734722
you could use deque, or use a vector of vectors of T as a vector of T
>>
Why couldn't Pike just leave macros and pointers to Go and leave the gc out? Why is he such a fucking faggot?
>>
>>53734698
Sys tray icon notification "app" for new posts in threads. That way you can post in threads, then CLOSE YOUR FUCKING BROWSER, and only receive notifications for shit that's relevant, rather than leaving your browser open which not only eats up resources but also encourages more browsing and shitposting.
>>
>>53734730
web dev is more fun than programming t b h f a m
>>
>>53734654
>Do you rely on applications to do that type of work for you, or do you do that by hand?
That's usually done in the initial setup of all of the data definitions and proposed table design. When you're doing this, you generally work hand-in-hand with the software/application designers.

You start defining things, such as
>What is a computer?
Well, each computer has a primary key and some basic statistics about the computer.
>Well, a computer could have any number of disk drives
Cool, let's have a table for disk drives and the drives have a key pointing to the computer they belong to.
Etc.

>Also have you ever had to normalize stuff beyond BCNF?
Generally, no. The use-cases for normalization beyond your basic 3NF are limited and usually the uses are a bit contrived.

However, my opinion is that every database SHOULD be normalized AT LEAST to 3NF, because you can always denormalize with views later if needed. There are some use-cases where denormalized tables are 'fine', but generally they cause more harm than the problems they solve.
>>
>>53734730
welcome to last week, anon
>>
>>53734714
for web/crud stuff sure, not for things like desktop applications and games
>>
>>53734736
I KNOW YOU WANT TO NOT USE GC SO LISTEN WHILE I EXPLAIN HOW YOU AVOID IT:

WHAT YOU REALLY WANT IS TO USE GC
GC IS NOT THAT BAD
YOU SHOULD USE GC

THATS WHY YOU SHOULDNT AVOID GC
thank you for listening
>>
>>53734770
gc is only an issue if you retardedly keep creating mass amounts of new objects and throwing them away
>>
>>53734749
Lets do this! This is a good idea I am willing to contribute on this you would all benefit from it
>>
>>53734790
Thank you for continuing the meme of GC fags responding to "how do I not use GC?" with "why you should use gc"
>>
>>53734770
Yeah but I want my macros
>>
>>53734391
i am doing old joins without the Join syntax,Rajeesh.
>>
>>53734795
Tbh I'd only work on this if it also worked on Windows, because it's what I use, however if I'm not mistaken Boost and/or QT are platform independent, so that'll likely be the framework used. Shall I set up a GitHub? I'm very fluent in C++ but my specialization is 3D Graphics not UI or windows programming. I'm okay with using C# as it's basically the same thing.
>>
>>53734847
You can do joins without the JOIN keyword, but you're giving the finger to the DBMS and likely fucking over the optimizations it would otherwise try to perform.

I'm not even entirely sure what your original sample tables were supposed to look like because your post at >>53734140
is borderline incoherent.

Screenshots would help.
>>
>>53734734
I'll look into that deque, although the ve tor<vector <T>> looks unwieldy for what I want to do.

What's wring with the list except the linear access times?
>>
>>53734749
I could hack this out within a week, as I already have working examples of parsing and retrieving API data.

It would be trivial to create a service that checks your 'watched' threads and notifies when you get a (You).

Lame.
>>
>>53734905
linear access times are REALLY bad
better off copying a large vector than transversing a medium list
>>
I have a hard time reading documentation and get overwhelmed from all the information. I also want to know how do you guys figure out what you need for your program? Say I want to build a simple chat room. How would I know which libraries I would need to implement etc
>>
>>53734910
It wasn't meant for (You)'s, it was for all posts in a thread, exactly like what your browser tab specifies minus the browser, the main goal was to encourage small scale collaboration on an easy project to learn teamwork, as you've quite autistically pointed out that a solution could be hacked together by one person in just a week, but whatevs.
>>
File: oAxQ9S9.png (20 KB, 341x774) Image search: [Google]
oAxQ9S9.png
20 KB, 341x774
>>53734140
>>53734883
I've setup the tables that I think you are referring to here.

Are you asking why the query result leads with '2'?
>>
>>53734979
What's a medium list in terms of processing power these days? What I'm doing shouldn't handle more than ten-fifteen elements at a time.
>>
>>53735093
then use a vector it'll be much faster
>>
>>53735110
This. It'll be very likely to fit in a cache line
>>
>>53734609
Sorry anon, everything is still on paper.
Its a midly serious investigation, and we dont want to code anything untill everybody on the team knows exactly how it works forward and backwards.
All our test are by merely calculations, and in theory, we can compress any file by 80%.

Other pros: No need for dictionary. Theorically you can compress a compressed file multiple times and recuce its size again.

Other cons: The compression level is based in procesor architecture, so you will cant decompress files that where compressed in 64 bits OS, to a 32 bits OS. (But we expect to fix this oin the future).

If everything goes right, we can (and will) release an alpha version of the compressor and decompressor for windows in abouth 3 months. So wait for it dear anon.
>>
>>53735164
>The compression level is based in procesor architecture
u wot m8
>>
>>53735164
>can compress any file
Hahahahahahaha no
>>
File: noire.jpg (16 KB, 200x303) Image search: [Google]
noire.jpg
16 KB, 200x303
>>53735164
>Theorically you can compress a compressed file multiple times and recuce its size again
>>
>>53735228
Mate it's easy
You store the file in Pi, then store the index in Pi, etc until you have a 1 bit number
>>
>>53735164
So, eventually everything can be compressed to zero bytes?
>>
Is there a website that gives you problems to solve with code? I really want to get into coding, friends.
>>
>>53735261
no you need 1 bit to tell if there's anything there in the first place
>>
>>53735270
Euler project
>>
>>53735164
sounds like bullshit. Try compressing an optimised jpeg, or h264 video file and see can you get anywhere close to 80% compression.
>>
File: hqdefault-4.jpg (17 KB, 480x360) Image search: [Google]
hqdefault-4.jpg
17 KB, 480x360
>>53735252
>mrw all data is just 0b1
>>
>>53735252
The fuck are you talking about?
>>
>>53735277
Okay, so everything compresses to 1 bit, either 0 or 1. Which file does 0 decompress to? Which file does 1 decompress to?
>>
>>53735252
Weed + programming

They really don't go together.
>>
>>53735292
>>53735296
>>53735319

>none of these faggots understand data compression
bet you're gonna end up in 5 years time paying to store files in e or Ω instead like faggots
>>
>>53735341
perhaps I don't, but i sure as fuck understand it a lot more than you.
>>
>>53735296
He's on about looking up a sequence of bits in the binary representation of pi that are the file that has been 'compressed'. For this, you'd need a start index and a length. This should work, if every possible sequence of bits eventually turns up in pi, but it won't be able to reduce the size of every possible file.
>>
>>53735341
It won't work m8. Lossless compressions are bijective functions. They can't make everything smaller.
>>
>>53735356
I presumed that's what he meant, but the size of the start index is most likely going to be much much larger than the size of of number being looked up. Probably astronomically larger.
>>
>>53735341
DUDE WEED LMAO
>>
>>53735379
Yes, exactly. It will compress some inputs, but not most.
>>
https://github.com/philipl/pifs
>>
>>53735392
Not a compression method at all even. If anything it's a lossless codec.
>>
>>53735401
8/10, strung me along for a while
>>
>>53735422
That's what you get for being a fedora-fucking faggot that even entertained the idea of something so ridiculous.

God damn it.
>>
>>53735418
Yeah, you're right. I was using compression in the colloquial sense, à la WinRAR.
>>
>>53735432
I've encountered people IRL who believe such a thing is possible.
>>
How to know if you're a shit programmer:
1. Did you open this thread?
Yes? you're a shit programmer.
No? you still might be a shit programmer.
>>
>>53735445
Possible, in the same sense that bogosort technically has the potential to be the most efficient sorting algorithm if you woke up with 13 four-leaf-clovers sticking out of your asshole instead of short and curly butt hairs.
>>
Is it true that crossdressing makes you a better programmer?
>>
>>53735464
That's okay, we can be shit programmers together.

*unzips dick*

>>53735481
Unverifiable.

Any potential test is likely to be full of bias and lack of control groups, given a lack of understanding of basic human sexuality and humiliation thresholds in many given environments.
>>
>>53735445
This world is a nightmare.

>>53735464
Speak for yourself m8. I'm a great programmer.
>>
>>53735497
What do you mean?
>>
File: average dpt poster.png (147 KB, 500x281) Image search: [Google]
average dpt poster.png
147 KB, 500x281
>>53735481
[spoiler]Yes[/spoiler]
>>
>>53735495
Is getting a zipper surgically mounted to your dick skin all the rage these days?
>>
>>53735464
I'll have you know I can average two ints in C
>>
>>53735495
I think if you're crossdressed you'll be less likely to go outside, so you'll be more likely to finish whatever you're working on.
>>
The trap meme needs to die.
>>
>>53735505
people being dumb. It's depressing at times.
>>
>>53735521
not possible
>>
>>53735528
It's not a meme if it's true.
>>
>>53735521
But can you implement memsort?
>>
>>53735529
I think that most people simply haven't been taught how to think.
>>
Java is master race
>>
>>53735544
What is memesort?

I can do quicksort and mergesort
>>
>>53735534
Of course it is
I'd show how I did it, but my average implementation is close sourced
>>
>>53735573
Java isn't a race.
>>
>>53735559
That's very caring of you. Regardless of the reason, the reality remains the same however.
>>
>>53735577
Does it work for 2 billion and 2.1 billion?
>>
>>53735584
He means Java programmers. Java programmers generally only know Java, so they defend it as if they are superior to other programmers who have different preferences, as if most programmers also only know one language and simply have never tried Java to know how great it is. This is the mind frame of the sort of person who says "Java master race". I find 9/10 of these people only know Java or maybe one or two other terrible languages like PHP or JavaScript.
>>
>>53735628
See also: blub paradox
>>
File: 1450530245913.jpg (12 KB, 177x278) Image search: [Google]
1450530245913.jpg
12 KB, 177x278
>>53735164
>in theory, we can compress any file by 80%.
>any file

>Theorically you can compress a compressed file multiple times and recuce its size again.

>The compression level is based in procesor architecture
>>
>>53735628
python, haskell and lisp are legitimately worse than java
>>
>>53735594
Yes
>>
>>53735576
>memesort
memsort, not memesort.

It's a genius sorting algorithm I invented that is similar to sleep sort, but instead of using the value as a parameter to a sleep function, the value is used as an index into an array, where the value in the array at that index is incremented.
You then loop through the array and for each non-zero element, you append the index of that value into the output array and then decrement the value, repeat until 0.

I had an example implementation but I threw it away, it's easy enough to re-implement anyway.

I haven't compared it to other algorithms, but I imagine it being quite efficient in certain situations.
>>
What gives you guys the motivation having to read endlessly and program so much to become really good at programming?
>>
>>53735695
No shit sherlock. Being able to list worse languages than language X, hardly makes language X a "master race" language. PHP is worse than JavaScript, JavaScript must be master race!!
>>
>>53735714
The motivation is that I'm making something cool. As the motivation should be for any craft.
>>
>>53735752
What are you making?
>>
>>53735761
A little productivity tool for Windows. It has really nice UX, which is what I enjoy working on most.
>>
>>53733585
Demolished
>>
>>53735695
only "Java master race" faggots are this dumb
>>
>>53733585
present-day china is capitalist

chinese poorfags don't get free handouts, they have to earn their money
>>
>>53735803
He's right though.
Java is pretty fucking garbage, but Python, Haskell, and LISP are certainly a lot smellier than Java.
>>
File: where are the methods.png (38 KB, 1002x629) Image search: [Google]
where are the methods.png
38 KB, 1002x629
Newfag question:
Where can I find documentation about the methods included in Python 3 ???
There is the Python Standard Library but it only contains standard functions and libraries and not the methods.
Methods like
object.search("text")
>>
>>53735824
how? have you tried using any of those?
>>
>>53735791
Both Rand and Bernie are retards beyond belief. Watching them debate. Watching them both attempt to debate each other is more embarrassing than I can bear. I'm grateful to live in a country where we don't have retards of that magnitude with serious chances of having influence in government.
>>
>>53735838
Yes.
>>
>>53735714
I like the problem solving aspect of programming. It doesn't have to be a very complex issue though. I consider writing clean code as problem solving too. I guess it's the same with any other hobby.
>>
>>53735752
this

>>53735761
i'm making a game
>>
>>53735843
they are the only two politicians who aren't completely retarded about technology
>>53735847
so what specific issues did you have (with any of those 3)?
>>
File: one fucking starfighter.png (901 KB, 939x1195) Image search: [Google]
one fucking starfighter.png
901 KB, 939x1195
>>53735843
>>
>>53735879
>they are the only two politicians who aren't completely retarded about technology
If only they weren't retarded about everything else.
>>
>>53735900
rand isn't retarded
>>
File: stl.png (98 KB, 922x628) Image search: [Google]
stl.png
98 KB, 922x628
>>53733358
I'm still working on "standard library" for my C++ project. I hate STL for the bloat and its inconsistent API so I'm rolling my own shit.

I don't even link to libstdc++ anymore.

C with classes is the only right way to use C++.
>>
>>53735935
holy shit that's literally god awful
>>
File: aikido.webm (491 KB, 720x404) Image search: [Google]
aikido.webm
491 KB, 720x404
Ask your much beloved programming literate anything (IAMA)
>>
File: superfappable!.png (1018 KB, 640x941) Image search: [Google]
superfappable!.png
1018 KB, 640x941
Working on my file server with torrent support.
I'm currently implementing a indicator to show if a download is new. This is needed so I can track which episode I've watched.
>>
>>53735912
Using taxes to fund social programs isn't something that necessarily will ever run out.. There's absolutely no reason for it to. Rand has a habit of implying retarded shit like this. I don't know why. It's blindingly wrong and just makes him look like a stupid asshole.
>>
>>53735963
thanks, I like it
>>
>>53735164
i just cracked up in the middle of my dining hall
>>
Programming should be mandatory course for all high school kids
>>
>>53735998
It really shouldn't
>>
>>53735935
looks neat

also, what colorscheme?
>>
File: christian wife.png (245 KB, 678x678) Image search: [Google]
christian wife.png
245 KB, 678x678
>>53735967
Have you heard of our lord and saviour?
>>
>>53736008
It should we need better programmers and all the best programmers have luckily picked up programming when they were a kid
>>
>>53736028
they aren't good programmers because they picked up programming as kids, they picked up programming as kids because they're good programmers and are actually interested in programming
forcing dumb normies to learn programming won't accomplish a thing
>>
>>53735705
If you're willing to waste space, why not just use a BST?
>>
Good programmers don't exist
Andrei excluded
>>
>>53736028
Yeah, and you'll create jack shit good programmers by forcing kids to learn it. They'll just do the shittiest job possible, unless they are actually interested in it. In which case they'll pick it up themselves. It's not like there's a big barrier to learned how to program. All you need is the world's shittiest functional laptop and something like charge it with and you're set.
>>
>>53736051
this, I hate the fact that fucking goverments are pushing programming into schools. If anything it will only make kids hate it (just like math, physics, etc). Those interested in CS will learn it without help of school.
>>
>>53736051
>>53736071
You learn better as a kid compared to as an adult and it's much easier for a kid so you would naturally be much better
>>
>>53736071
>this is what liberals actually believe

yeah and making english a requirement makes kids worse at english
>>
>>53736071
You also need a compiler, dumbshit.
You can't program without some tech literacy on a desktop OS, so that already precludes 95% of kids.
>>
>>53736088
https://scratch.mit.edu/
>>
>>53736085
go look at a high school programming class
90% of the students fail and are never interested again
the rest either already knew everything or would have learned on their own
>>
>>53736104
if 10% of students become interested that'll be a significant increase

people that never would've done it giving up on it is of no consequence
>>
>>53736086
>this is what liberals actually believe
>Burgerfat think's everything he disagrees with is a "liberal" opinion.
What I said has nothing to do with your country's liberal/conservative political cancer.
>>
>>53736104
It is better for people to be exposed to which will greatly help people pursue a career in IT if they like it. Also, that isn't true schools are working to improve how programming is taught these days with an easy scripting language first
>>
>>53736085
no, not really, a kid doesn't have a fully developed brain, they will not become great programmers until they're in their 20's if ever
>>
>>53736115
>people that never would've done it giving up on it is of no consequence
They could have been learning a subject they actually had an interest in in the time they were forces to learn programmering. We need plenty of engineers and shit too you know.
>>
>>53736132
>liberal/conservative political cancer
liberal detected
inb4 >muh same coin
>>
>>53736115
Fuck off. Stop trying to ruin yet another skilled profession.
>>
>>53736149
programming > english lit
Thread replies: 255
Thread images: 32

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.