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

/dpt/

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 322
Thread images: 30

File: Programmers.jpg (117KB, 460x640px) Image search: [Google]
Programmers.jpg
117KB, 460x640px
/dpt/ - Daily Programming Thread

old thread: >>56048452


What are you working on, /g/?
>>
>>56055124

Trying to figure out something useful to do.
>>
>>56055124
Hey isn't that Dan "Get in the Van" Schneider?
>>
>306 posts
This is an illegitimate spam thread.
>>
>>56055124
shit op
shit thread
before bump limit
sage
>>
Why do some of you idiots dislike do-whiles? Say you have an initial value of a variable set to 0. The user is told to input a value between two numbers that are variable controlled. If zero is within those two numbers the user will never get the chance to enter his value.
>>
Haskell or Rust? Which is the future?

>inb4 some language that doesn't have a decent concurrency model is suggested
>>
>>56055168

I don't know of there being a general dislike of do-while as a construct.
>>
>>56055124
What are some good resources for learning java?
Going to college next year and I wanna be ahead of the curve
>>
>>56055255
Look in the last thread, bunch of people saying not to use them and that they've never seen the need for them.
>>
>>56055250
How is python with pypy-stm not an option?
>>
Other thread got deleted.

I started writing an imageboard software in C and I quickly realized I have no idea what I'm doing.

I have the database schema finished, but I just realized I have to implement a way to tokenize URLs like /g/thread/56055170 and turn them into something the CGI program can understand.
>>
>>56055124
so, no one knows how to average two integers in Go?
top kek /dpt/, buncha useless fags ITT
>>
File: HaskellRoadCover.jpg (20KB, 322x475px) Image search: [Google]
HaskellRoadCover.jpg
20KB, 322x475px
>>56055124
How's pic related?
>>
>>56055269
Can't you just use the 56055170 as the pk for the thread table? And have some logic in your application that creates a new thread in the table if one with that id doesn't exist?
>>
i used to jerk off so much to the grills on that show
>>
>>56055281
is that book some sort of pedo code?
>>
>>56055124
Tool to quickly send pictures to different directories
(don't want my /h/ mixed with my /s/)

# part one


# Ubuntu 16.04: `sudo apt-get install libtcltk-ruby`
require 'tk'
# themes and new-style widgets
require 'tkextlib/tile'
# support for civilized and common image formats (.jpg, .png, etc)
# Ubuntu 16.04: `sudo apt-get install libtk-img`
require 'tkextlib/tkimg'

class HotkeysWindow
attr_accessor :hotkeys

def initialize parent
@parent = parent

path_entries = []

@hotkey_window = TkToplevel.new @parent.root_win
10.times.each do |index|
Tk::Tile::Label.new(@hotkey_window) { text "When I press #{index.to_s} move the image to:" }.grid( :row => index, :column => 0, :sticky => 'w' )
path_entry = Tk::Tile::Entry.new(@hotkey_window).grid( :row => index, :column => 1, :sticky => 'w' )
path_entries.push path_entry
Tk::Tile::Button.new(@hotkey_window) {
text 'Set path'
command(proc{
path_entry.value = Tk::chooseDirectory
})
}.grid( :row => index, :column => 2, :sticky => 'w' )
end

# defining these here so we can access instance vars in such a way that they survive being passed through several blocks to the button commands
onok = proc {
@parent.set_hotkeys(path_entries.map { |e| e.value if e.value and e.value != '' })
@hotkey_window.destroy
}
oncancel = proc {
@hotkey_window.destroy
}
Tk::Tile::Button.new(@hotkey_window) { text 'Ok'; command onok }.grid( :row => 11, :column => 0 )
Tk::Tile::Button.new(@hotkey_window) { text 'Cancel'; command oncancel }.grid( :row => 11, :column => 1 )
end
end
>>
>>56055329
# part two


class ImageSorter
attr_accessor :root_win, :hotkeys

def initialize
@hotkeys = {}
@image_list = []
@current_img_index = 0

build_gui
end

def build_gui
@root_win = TkRoot.new { title 'Image Sorter' }

menubar = TkMenu.new @root
mfile = TkMenu.new menubar
mfile.add :command, :label => 'Set Hotkeys', :command => proc{ show_hotkeys_window }, :accelerator => 'ctrl + h'
mfile.add :command, :label => 'Open Directory', :command => proc{ open_dir }, :accelerator => 'ctrl + o'
mfile.add :command, :label => 'Quit', :command => proc{ exit }, :accelerator => 'ctrl + q'
menubar.add :cascade, :menu => mfile, :label => 'File'
@root_win['menu'] = menubar

@image_display = Tk::Tile::Label.new(@root_win).pack( :side => 'top', :fill => 'both', :expand => 'yes' )

@root_win.bind 'Control-h', proc{ show_hotkeys_window }
@root_win.bind 'Control-o', proc{ open_dir }
@root_win.bind 'Control-q', proc{ exit }

@root_win.bind 'Left', proc{ on_prev }
@root_win.bind 'Right', proc{ on_next }
@root_win.bind 'Key', proc{ |k| on_hotkey k }, "%A"

return @root_win
end

def open_dir
@top_level_dir = Tk::chooseDirectory
return unless Dir.exists? @top_level_dir
#puts "open '#{@top_level_dir}'"
@image_list = find_all_images @top_level_dir
@image_list.sort!
@current_img_index = 0

set_image @image_list[@current_img_index]
end

def show_hotkeys_window
hkw = HotkeysWindow.new self
end

def set_hotkeys keys
#keys.each do |k, hk|
# puts "set hotkey #{hk} (48 + #{hk.key} = #{hk.ascii_key}) => #{hk.path}"
#end
@hotkeys = keys
end
>>
>>56055338
# part three

def on_prev
@current_img_index = @current_img_index - 1
@current_img_index = @image_list.length - 1 if @current_img_index < 0
set_image @image_list[@current_img_index]
end

def on_next
@current_img_index = @current_img_index + 1
@current_img_index = 0 if @current_img_index > @image_list.length - 1
set_image @image_list[@current_img_index]
end

def on_hotkey k
path = @hotkeys[k.to_i]
unless path.nil? or path == ''
puts "move #{@image_list[@current_img_index]} => #{path}"

end
end

# return an array of all image paths under path (recursive)
def find_all_images path
# looks in path and also in sub-dirs of path
return Dir[
"#{path}/**/*.jpg",
"#{path}/**/*.png",
"#{path}/**/*.gif"
]
end
>>
>>56055345
# part four

# show the image at path if it exists
def set_image path
if !path.nil? and File.exists? path
#puts "Go to '#{path}'"
tmp = TkPhotoImage.new( :file => path )
img = TkPhotoImage.new()

# we must manually figure out how much to subsample it to make it fit
# because Tk sucks at handling images so we can't just say "shrink or zoom to fit"
image_ratio = tmp.width.to_f / tmp.height.to_f
window_ratio = @root_win.winfo_width.to_f / @root_win.winfo_height.to_f

if window_ratio > image_ratio
fit_res = [(tmp.width.to_f * @root_win.winfo_height.to_f / tmp.height.to_f).to_i, @root_win.winfo_height]
else
fit_res = [@root_win.winfo_width, (tmp.height.to_f * @root_win.winfo_width.to_f / tmp.width.to_f).to_i]
end

subsample = [(tmp.width.to_f / fit_res[0].to_f).ceil, (tmp.height.to_f / fit_res[1].to_f).ceil]
subsample[0] = (subsample[0] > 0) ? subsample[0] : 1
subsample[1] = (subsample[1] > 0) ? subsample[1] : 1

#puts "#{image_ratio}, #{window_ratio} -> #{fit_res}, #{subsample} ; #{tmp.width}, #{tmp.height} ; #{@root_win.winfo_width}, #{@root_win.winfo_height}"

img.copy( tmp, :subsample => subsample )
tmp = nil
@image_display['image'] = img

@root_win['title'] = path
else
raise "Image path not found: '#{path}' (has the image been moved or deleted?)"
end
end
end


if __FILE__ == $0
i = ImageSorter.new

Tk.mainloop
end


The only think left is to actually move the file when the hotkey is pressed.
>>
>>56055168
Oregon Trail pajeet from the last thread reporting in. (though the quoted post isn't me) Wouldn't a do-while loop be more efficient then reassigning the variable through every iteration of a loop?

For example wouldn't
var something;
for (i = 0; i < 100; i++) {
do {
input(something);
} while (something != somethingElse);
}

be more efficient than
for (i = 0; i < 100; i++) {
var something;
while (something != somethingElse) {
input(something);
}
}
>>
File: @2.webm (1MB, 500x500px) Image search: [Google]
@2.webm
1MB, 500x500px
>>56055124
Basic rougelike style game in C++. Not doing random generation yet, map data is read from a file.
>>
>>56055349

ffs why didn't you just pastebin it?

>>56055355

do while and while in this situation should generate the same code. It's a matter of preference.
>>
>>56055282
i put all the comments and OP posts in the same table when i realized the thread and comment tables were almost identical.
each row has a field for is_parent and parent_id if it's not a OP post.
>>
>>56055329
>>56055338
>>56055349

Made something similar to sort my porn a few months ago.

Takes two config files, one with a list of source dirs, and one with a list of dest dirs (each with a shorthand name).

Then it just displays each pic in the source dir and you click one of the buttons created to send it where it belongs.

Kinda surprised something so simple didn't exist, or if it did, I couldn't find it.
>>
File: 2016-08-13 08.11.17.png (185KB, 1080x960px) Image search: [Google]
2016-08-13 08.11.17.png
185KB, 1080x960px
reddit wants developers to unionize

Isn't that communism?
>>
>>56055377
Surely you want a seperate table for ops though? Think about something like the catalog, would be easier just to "SELECT * FROM Threads" vs "SELECT * FROM Posts WHERE op_post"
>>
>>56055368
Pretty neat.

>>56055370
http://pastebin.com/FXLx0Y32
>>
>>56055355
int initialPurchase (int a[]){
char *items[]={"oxen","ammunition","clothing","food","misc. supplies"};
int money, min[]={200,0,0,0,0}, max[] = {300,700,700,700,700};
do{
money = 700;
for(int i = 0;i<5;i++){
printf("How much would you like to spend on %s, you have $%d remaining? $", items[i],money);
scanf("%d",&a[i]);
while(a[i]<min[i] || a[i]>max[i]){
printf("Please enter a number between $%d and $%d: $",min[i],max[i]);
scanf("%d",&a[i]);
}
money -= a[i];
}
if(money<0)
puts("You spent more than $700");
}while(money<0);

return money;
}
>>
>>56055398
Is there a real performance difference?
I have no problems doing something like
SELECT * FROM posts WHERE is_parent = 1;
To generate a thread page, i just grab all the posts that match that parent_id and display them in ascending post number order.
>>
>>56055393
yes. grab a gun and kill random people before the commie developers take over
>>
>>56055436
Surely any query with a WHERE in it will be less performant than one without? Even the best database will perform worse when you ask it to filter rows in any way. In your case you would want to create an index for is_parent in the posts table to make that selection as efficient as possible, but the db will still have to add to the index on each INSERT.

Not that any of this matters at your scale, but if you are thinking about efficiency there you go. Note that I'm not an amazing db person, so the above could be wrong.
>>
>>56055124
Is that Dan "hymen divider" Schneider
>>
>>56055511
His name is Dan "Large Hymen Collider" Schneider fyi.
>>
>>56055250
so not rust then? plain old threads isn't a decent concurrency model

I heard rust had green threads but thanks to their runtime autism (muh C replacement) they scrapped it
>>
What languages do you guys know?
>>
>>56055124
Who is this guy, again?
>>
>>56055541
Spanish, english, and C#. Damn, my C and sepples are super rusty.
>>
>>56055562
Dan "Hold Her Tighter She's A Fighter" Schneider
Dan "The Big Dick At Nick" Schneider
Dan "If You Want A Role Give Up That Hole" Schneider
>>
Cool what kind of things have you made with C?
>>
>>56055393

Unions aren't communism until they're not optional.
>>
>>56055593
Recursive fizzbuzz.
>>
>>56055577
This is the best dpt so far
>>
>>56055541

C, C++ (a bit), Matlab/Octave, LabVIEW and Lua
>>
>>56055562
Dan "bend her over and fill her end" Schneider
>>
>>56055541
C/C++, C#, Python, Ruby, Javascript, Unrealscript, PHP, and a smattering of Lua, Rust, D, and Haskell.
>>
What's the point of languages that aren't C++, D or Haskell?
>>
>>56055750
Java is the best language, it works on any platform and is just as fast as c++.

Now the better question is, what's the point of languages that aren't Assembly?
>>
>>56055541
java, c/c++, c#, javascript, ruby, and barely some python
>>
>>56055798
>Java is the best language, it works on any platform and is just as fast as c++.

Java's portability is greatly overstated. Generally it's implemented in C/C++ and then bootstrapped. It literally runs on as many platforms as C/C++.
>>
if i allocate o(n^2) space at the beginning of my algorithm but free it at the end does my algorithm technically use o(1) space
>>
>>56055900
...
no
>>
>>56055798
>just as fast as c++
Wow. Spotted the first-year pajeet retard.
>>
>>56055959
What a pajeet, don't you know that in some cases Java is actually faster than C++? Try writing a huge for loop in each language and compare the times, Java will be faster because of the JIT.
>>
>>56055959
Idiot.
>>
i dont get how someone can just start programming something. I don't see how it can be used to make shit. Someone blue pill me on this
>>
>>56055593
2D platformer with SDL2
hobby interpreted language
space gravity simulator
conway's game of life
nintextdogs


need new idea pls
>>
>>56055967
That's not how JIT works.
>>
>>56055977
The problem is that you need an idea and a plan on how to complete that idea. i.e. you don't go from "i want to make app that find women" to programming immediately; you have to think about how it will work and how you will implement it
I usually write a short write-up for my reasoning and doodle some design graphs before getting started
>>
File: 1470886525874.jpg (74KB, 720x783px) Image search: [Google]
1470886525874.jpg
74KB, 720x783px
>>56055599
Communism is always optional; being stateless, it is not implemented, but spread.
The most horrible form of subjugation comes from within ourselves, the only way to be free is to surrender ourselves to the absolute, to be connatured into eternity.
>>
>>56055403
That's not at all true to the original game. I wanted to make the user experience identical. Not saying your code is bad (it's certainly better than mine) but it's just not what I was going for.

Here's Pajeet remakes The Oregon Trail part deux: Electric PooALoo
http://pastebin.com/4i1LkvCt
>>
>>56056084
>it is not implemented, but spread.

top fucking laughing, mate. If that's true, then what do you need the revolution for?
>>
anyone here knows some good text-to-speech engines?
>>
>>56056198
ms sam
>>
>>56055393
Unions are not communism or socialism. But strictly speaking, they run contrary to the ideals of a free and open market, and often make the workplace worse for all parties.

We don't need unions. We just need to stop this push towards making everyone a Computer Science major. Convince people either that it is too hard, that it is boring, or that the job market is flooded. There is a grain of truth to all of these, depending on who you are talking to.

>>56056183
If communism is stateless, logic follows that revolution occurs to get rid of the state altogether. Of course, what follows will always be the creation of a state, because the majority of the population wants a state to exist. So what you get is a government that tries to "enforce" communism. What follows is numerous human rights violations in the name of a shitty ideology that doesn't even work on paper.
>>
>>56056183
>top fucking laughing, mate. If that's true, then what do you need the revolution for?
the retarded anarcho-capitalist strikes again with his incredibly twisted (if not simply stupid) logic
>>
Newfag here. I barely know Java and have been using Eclipse. I want to learn C++ so I can make some applications in linux. Is installing the eclipse-cpp package a good ide for C++ development? Or are there other IDE's in linux that you guys use?
>>
>>56056252
I just installed geany because I got tired of using different one-lang IDEs for every lang I wanted to learn, but I haven't really used it yet so I can't recommend it really
>>
>>56056252
Use Vi.
>>
>>56056277

I currently use Geany for XML, javascript, json, etc. I was wanting a more noob friendly IDE that automatically imports missing packages and stuff, like Eclipse does with Java.
>>
>>56056308
>using ides that encourage bad programming habits
>>
>>56055976
>>56055967
If Java is beating your C or C++ then you're butt-fuck shitting-in-the-streets retarded.

http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=java&lang2=gpp

Pajeets BTFO with facts.
>>
>>56056213
those don't allow free commercial use :(
>>
Is it possible to use a css val(--whatever) in conjunction with a css transition?
I'm using a polymer iron-icon and trying to use transitions to have it expand from 0px to 32px. But whether I apply the --iron-icon-width:0px using setProperty or by applying a class, it doesn't seem to be rerendering the icon, even though if I poll the value using getPropertyValue, it has been updated correctly.
>>
>>56055529
commonly known as Dan "Hold Her Tighter, She's a Fighter" Schneider
>>
File: 1469643738953.png (541KB, 1280x720px) Image search: [Google]
1469643738953.png
541KB, 1280x720px
>>56056183
We don't need the revolution, nobody does, revolution is and always has been a tragedy, it is the gold of fools who do not understand what they are overthrowing.
And yet now we celebrate it, can you believe it?
We overthrow the very precepts of western thought and yet we still call ourselves western people.
Now we have only a view through the looking glass; nobody is acquainted with people like Aquinas or Aristotle except superficially, they see it all as if the strife of the last ~2000 years amounts to a mere behavioral quirk of historical peoples that no longer concerns us.
>>
>>56055393
>more like Saaaanjaaaay
>>
File: cpp_vs_java_diagram.png (21KB, 800x600px) Image search: [Google]
cpp_vs_java_diagram.png
21KB, 800x600px
>>56056343
Oh look it's another idiot who thinks Java is inherently inferior to c++.

Fyi it's a tie.
>>
>>56056536
Now compare memory usage
>>
>>56056536
nice bait desu
>>
File: PMC2267699_1471-2105-9-82-4.png (43KB, 512x443px) Image search: [Google]
PMC2267699_1471-2105-9-82-4.png
43KB, 512x443px
>>56056571
Ram is cheap :')
>>
>>56056536
>this much bait
>>
>>56056594
>>56056536
>hurr durr these graphs with no source and no source code prove me right!!!
>>
https://www.youtube.com/watch?v=PkoY1zRgQik

Can /g/ use even a single one of these languages?
>>
Here are real comparisons and Java is about 2 times as slow.

http://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=java&lang2=gpp

Considering all benefits Java brings, though, I'd pick it over C++ any time of day.
>>
>>56056657
Perl, Js, C++, Assembly (isn't a language).

The list's shit.
>>
>>56056657
>Haskell
>difficult
>>
>>56056007
>>56056343
>in some cases Java is faster
By some cases, I mean cases where the JIT can cause Java to actually perform much faster than equivalent C++.

Example:
for (int i = 0; i < 1000; i++) {
for (int j = 0; j < 1000; j++) {
// Some insignificant constant time operations here. Don't ever do a benchmark like this with standard output though, you will end up speed limited by the terminal.
}
}

Java's hot spot JIT will cause this to perform much better than equivalent C++ code.
>>
>>56055262
Sounds like legitimate idiots. The alternative to a do while loop is to have at least some part of the code duplicated before the do while loop and write the condition with one complete iteration in mind.

Do while loops are certainly a good language construct to have if it also has while loops.
>>
>>56055534
Rust just gained a great Future's library. If it gets generators / yield, it'll have an incredibly solid async + concurrency story, better than any other language suitable for a C++ replacement.
>>
Trying to make my own finite element modeller to enable me to do 2D plate analysis without paying out the ass for software.

I've never programmed before

Top. Fucking. Kek.

Yes I'm serious. I always do hard things to force myself to learn.
>>
>>56055355
Well here you're comparing an uninitialized value. Its not equivalent code.
>>
File: aaa.jpg (188KB, 1893x893px) Image search: [Google]
aaa.jpg
188KB, 1893x893px
Just started learning Python on Codeacademy.
I'm pretty dumb and english isn't my first language, but I'm stuck here, what am I doing wrongK?
>>
>>56056707
>benchmark with standard output
Why would anyone do that ever? Collate your profiling information. Its not hard.
>>
>>56056767
Jesus...nvm I just noticed the ":" was missing.
>>
>>56056772
If you do a google search for "$(language) for loop benchmark" you will see a bunch of dinguses with a huge for loop with a printf in the middle. So I think it's worth mentioning any time you mention benchmarks.
>>
>>56056536
>it's a tie
That's an impossibility. One of these are a language that gives you control to write the code in a way that allows you to replicate the other if you like. What you're arguing is that Java has solved performance. But that's impossible because your java code doesn't know everything it's actually trying to do.
>>
>>56056745
Forgot to include a link to the announcement about the new Future's library: https://aturon.github.io/blog/2016/08/11/futures/
>>
>>56056790
Java is fastest language its JIT outperforms C on every step hurr durr
>>
>>56056789
Why would you benchmark a jmp, mov, compare and add instruction?

Really if you're not using a language which boils down to offline asm in some way why do you care about performance?

But yeah if they're that retarded please do mention it. I haven't seen that though.
>>
File: Untitled-1.png (133KB, 800x800px) Image search: [Google]
Untitled-1.png
133KB, 800x800px
Working (again) on nudity detection.

I'm this time getting a model to detect location of nipples on a picture - turning the picture on the left into a picture on the right.

I have a simple model with a lot of 8 chained 3x3 convolution layers, each with from 8 to 22 planes.

On a training set of 188 images it's about getting to work after 100 epochs.

One thing I've learned the hard way is to use batch size of 1. Larger batch sizes let me finish each epoch much faster (i imagine this has to do with being able to parallelize with GPU better), but despite this it takes more epochs to learn anything, so I end up spending more time anyway.

I'm also using tanh activations. With relu the model just stops doing anything, outputting perfectly black pictures all the time. I have one leaky relu after last layer.
>>
>>56056767
>check the hint if you need help
Wow how incredibly mean. If you wrote that same thing and ran it directly on your computer it'd tell you what the problem is. Why would codeacademy hide that from you?

Not using your tools just makes you a worse programmer.
>>
Isn't haskell problems fixed with
{-# LANGUAGE Strict #-} 
>>
>>56056829
haskell's*
>>
>>56056826
It's showing the same error as python on your local computer would...?
>>
>>56056826
yeah actually does, I'm just dumb drunk nvm
>>
>>56056816
Very nice
>>
>>56056816
But why anon?
>>
>>56056841
Your python just says 'invalid syntax'? Are you serious?
>>
>>56056816
could you do one to detect anime pictures or kpop pictures (to detect spam so you could say md5 the image and add it to a filter)
>>
>>56056729
The guy you are replying to is an idiot. His code was so bad when he posted it I don't even know where to start. He had do-whiles that should have been whiles, inside reduntant if statements that did nothing, inside of a redundant for loop. Nothing wrong with the do-while, but it should only be used when it makes your code clearer.
>>
>>56056816
Also can it differentiate between male and female nipples?
>>
>>56056816
So it's just a nipple detector? It won't detect nudity in general, only nipples?

So like a huge veiny penis would get through your nudity filter.
>>
>>56056877
andrey@Shanghai:~/System/ncnn$ python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> answrer=5
>>> if answer>5
File "<stdin>", line 1
if answer>5
^
SyntaxError: invalid syntax
>>>

Well, yes...

>>56056892
That should definitely be possible. I'm fairly new to NN though so even simple things take me a lot of trial and error, so I don't think I'd be doing it anytime soon.

>>56056899
No. The information about sex is already embedded into the picture so I only plan to use the NN on picture of girls.

>>56056876
To add a "hide nude" filter to the interface.
>>
>>56056920
Oh i was thinking you are doing God's work by trying to find more nudes... You broke my heart
>>
>>56056904
Well, I'm not making a general one fits all solution. The reality of NN not being a magic wand that solves everything has by now sunk deep enough into me so I'm undertaking fairly simple tasks for now.
>>
>>56056936
Do you honestly not have enough nudes?
>>
>>56056949
Well yeah but this is 4chan i dont come here expecting reasonable appliication of programs.
>>
>>56056657

>JavaScript
>Hard
It's counter-intuitive in a few areas, but it's easy as shit.
>>
>>56056198
espeak
>>
>>56056984
>http://espeak.sourceforge.net/samples/raven.ogg
just kill me now
>>
>>56056996
free as in freedom
>>
>>56056984
>>56056996
http://mary.dfki.de/ This one sounds much better.
>>
File: miku.png (650KB, 794x775px) Image search: [Google]
miku.png
650KB, 794x775px
>>56056198
how about text to song
>>
>>56057076
This one is great.

What happened with espeak, I imagine, is that the dude was developing it f or a long time, alone, and his brain learned to recognize that gibberish. To him, it is "The speech is clear, and can be used at high speeds".
>>
>>56057076
italian is pretty much ok

>>56057105
that's human adaptability for you
>>
>>56055541
java,python,Matlab, some c++
>>
>>56056500
>>56055562
Fairly sure that is Dan 'if you have a daughter, better hide her' Schneider.
>>
File: ss+(2016-08-13+at+11.50.59).jpg (499KB, 1240x1449px) Image search: [Google]
ss+(2016-08-13+at+11.50.59).jpg
499KB, 1240x1449px
It also seems that the model learned to generalize.

I thought I'd have to add pictures without nipples to the training set, but apparently training set with every picture having nipples is good enough to have a model that can can produce an empty black rectangle for a picture without any.
>>
File: 4c4gpLL.jpg (296KB, 1777x1306px) Image search: [Google]
4c4gpLL.jpg
296KB, 1777x1306px
>>56055124
ayy danny
>>
>>56057287
Please don't let this technology fall into the hands of the jannys
>>
>>56057287
Can you add a browser extension that detects black people and makes them blacker?
Like, can't see them because they're so black, black
>>
>>56057470
or one that hides the posts automatically

but it can't be programmed in Python
>>
>>56057482
There are some NN libraries for JS but they are obviously extremely slow (no access to GPU) and I just want to take it easy with python's easy NN libs.

>detects black people and makes them blacker?
I get that you're trying to make a joke but there are some very interesting articles on that.

http://blog.clarifai.com/what-convolutional-neural-networks-see-at-when-they-see-nudity/

In this case they're making non-porn images look more porn-like.
>>
What the fuck is an interface in .NET?
>>
>>56055124
so I found out about watir and wrote a script to download porn zips from a javascript-using pay site
>>
>>56057571
.NET? You mean C#?
>>
>>56056669
/ thread
>>
>>56055541
In order of proficiency:
English, Japanese, C++, Java, Python, some Javascript
>>
>>56057648
wwwwwwwwwww
>>
>>56057631
VB has them too, AFAIK.
>>
>>56057648
How is programming with moon runes?
>>
>>56056920
>if answer>5
>if answer>5:
ftfy. Everyone forgets those fucking colons when they are just starting out.
>>
And here ladies and gentleman is shining example of rust community

https://github.com/Immington-Industries/way-cooler

Tiling manager with embedded chromium panel...
>>
>>56057835
I don't get it. I don't see the chromium panel there.
>>
>>56057808
if you want to use the same method on different classes you write the method name in the interface definition and make all those classes implement it

then you can do something like making a list/array of classes that implement that method and apply it to every element of that list
>>
>>56057957
i3 tabbed/stacked tiling
Floating windows
Tiling window through configurable Lua scripts (awesome-style)
Server-side borders around window clients
An Electron powered status bar <-----
More customization settings
>>
So, this is my code for so far for a guess my number game:

package Exercises;

import java.util.Random;
import java.util.Scanner;

/**
* Created by :^) on 8/9/2016.
*/
public class guessMyNumberCopy {
/**
* gwt numbr, compare with random number, tell how high or low, ask for the number again if wrong.
* /
public static void Highlow(int input, int guessed){


if (input < (guessed-50)){
System.out.println("Ice cold!");

} else if (input< (guessed-40)){
System.out.println("That's too low! ");
} else if (input< (guessed -30)){
System.out.println("That is low.");
} else if ( input < (guessed -20)){
System.out.println("getting higher");
} else if (input< (guessed -10)){
System.out.println("Almost there!");
} else if (input > (guessed +40)){
System.out.println("That's a too high number!");
} else if (input > (guessed + 30)){
System.out.println("That's still high");
} else if (input > (guessed +20)){
System.out.println("getting lower");
} else if (input > (guessed + 10)){
System.out.println("almost there!");
} else if (input == guessed){
System.out.println("you guessed right :)");
}

}

public static void main(String[] args) {

System.out.println("I'm thinking about a number between 1 and 100\n" +
"(including both). Can you guess what it is?");
System.out.println("Type a number: ");
Scanner sc = new Scanner(System.in);
int guess = sc.nextInt();
System.out.println("your guess was: "+ guess);
//after the guessis shown, the random object is being invoked
Random random = new Random();
int number = random.nextInt(100) + 1;
// the number may be
Highlow(guess, number);

}

}

>>
>>56058105
Fuck, moot should raise the char amount to post in here.
So, is it possible to implement a recursive prompt to the user to enter a new number, tell it where it's guess is and then ask him again for input in a method?
The base case would be input != guessed for it.
The moment the user has entered the same number, the program should terminate with a pat on the users head.
>>
>>56058125
That's a loop you want
>>
>>56058125
yes, I believe it's called a "loop"
>>
>>56058125
>The base case would be input != guessed for it.
More like input == guessed if we are talking recursion here. And yeah, you just have to early return in case the answer is right, and tail recurse at the very end of your method.
>>
>>56057835
>tiling manager for wayland
Sweet
>titlebars and window borders wasting space
Fix it.

>>56057970
>i3 tiling
Fuck this. I want AUTOMATIC tiling like Awesome. Otherwise it's fucking pointless.
>lua scripting
More failure. Use JS. Lua is garbage by comparison. (1 based indexing?!?!?!)
>electron powered status bar
So... HTML, CSS, JS status bar... but Lua scripting? This is retarded.
>server-side borders around window clients
There shouldn't be any borders in the first place...
>>
>>56058262
>JS
bitch please
({}) === undefined
>>
>>56055124
Dan "the man with a plan" Schneider?
>>
>>56058344
Dan "go ahead and hide her, my cock's been inside her" Schneider
>>
File: 1464823306282.png (5KB, 270x175px) Image search: [Google]
1464823306282.png
5KB, 270x175px
>>56058338
pic

>>56055150 >>56055511 >>56055529 >>56055577 >>56055720
>>56056500 >>56057128 >>56057303 >>56058344 >>56058433
You can stop spamming now
>>
File: waterfox_2016-08-13_06-49-47.png (32KB, 526x304px) Image search: [Google]
waterfox_2016-08-13_06-49-47.png
32KB, 526x304px
>>56058494
>>
>>56058513
It doesn't matter if it's one person or ten people, it's still spam and adds nothing to the thread
It's just repetition of a shit joke that wasn't even funny in the first place
Come up with something funny or new at least
>>
File: 1470694239600.png (728KB, 1165x1075px) Image search: [Google]
1470694239600.png
728KB, 1165x1075px
>>56058262
>Use JS. Lua is garbage by comparison.
>>
File: 1455622256183.png (812KB, 600x600px) Image search: [Google]
1455622256183.png
812KB, 600x600px
>>56058433
>>
>>56058543
Who cares, after this thread hits bump limit there will be a new dpt and you'll all keep talking about whatever you want.
No need to be a killjoy, dpt isn't going anywhere
>>
File: mozilla and linux.jpg (4MB, 3008x2000px) Image search: [Google]
mozilla and linux.jpg
4MB, 3008x2000px
>>56058692
>it's ok to ruin the thread because there'll be another one
What a stupid fucking excuse, are you fucking new or something?
Go to /b/ if you want this dumbass shit, leave this board alone
>>
>big lawyer firm uses their own accounting software
>it's written in Java
>they desperately need a programmer to jump in, implement automatic server backups, and test it on their network within 5 days

How much would you guys charge for this job? It's not an offer, I'm just curious what a reasonable person would bill.
>>
List of things to code? I'm not super proficient but I wanna try and get through some things
>>
>>56058754
How is it ruined? Just ignore the posts you don't like you autist.


You're just trying to stir shit by not ignoring it
>>
>>56055368
e
>>
>>56058818
Here's something fun you could try. Your task is to write a really basic emulator. When it's done, it'll be able to decrypt and run a simple Unix-like OS.

http://boundvariable.org/task.shtml
>>
I figured out how to make theorem proving bearable in a dependently-typed language.

Because proofs (values of propositional type) have no computational content, they don't have to be passed by value, they can be passed automatically "by type" as long as they exist in the context. Functions from proofs to proofs also have no computational content, so they can be invoked by type instead of by name.

Linear capabilities (which also have no computational content) work much the same way, only they can be removed from the context when they're used.
>>
>>56058906
dafuq you talking about? jesus
>>
>>56058781
>within 5 days
Nothing, the project is bound to fail. Just ask some Indians on freelancer.com to do it for $100.
>>
>>56058781
>How much would you guys charge for this job?
$ 75,000
>>
>>56058819
This isn't /b/.

>killjoy
>just ignore
Are you underage by any chance?

>you're just trying to stir shit
I'm trying to stir you either fucking off or following the god damn rules and not shitting up this thread

>>56058906
But types and values are basically interchangeable in a dependent language, and types do have runtime overhead in most languages - especially if you want a dependent type system
>>
>>56058837
What?
>>
>>56058781
>lawyers
>java
>within 5 days
$10k
>>
>>56058781
$50,000 because of the time constraints. Also, it will never happen.
>>
>>56058917
For "static verification". For example, to make sure an array access doesn't go out of bounds, you put a constraint that the index is less than the length. This constraint is expressed by requiring a proof of propositional type (index < length). To prove this, you can do a runtime check or manipulate an already-proved proposition. So if you have (index < 10) and (length >= 10), you can turn that into (index < length) and access the array.
>>
>>56058874
oh these are really cool
I remember doing a similar one. Don't remember what it was called, there was some text adventure game after you completed the emulator
>>
>>56058998
addendum: $2k up front in cash before I even start, $8k upon completion.
>>
>>56059000
For most useful tasks you would end up needing a runtime check
>>
File: 1471084346989.webm (3MB, 640x360px) Image search: [Google]
1471084346989.webm
3MB, 640x360px
>>
>>56058990
I don't mean you pass a runtime representation of the type. I mean that it's looked up by type automatically in the context. Or, when trying to find a rule like (x <= y) /\ (y <= z) -> (x <= z), you write the type and it's looked up (or generated at compile time using something like QuickCheck).
>>
>>56059017
obviously using ropes at 0:28
>>
If I'm porting something on github, should I fork the original repo, or make a new one?
>>
>>56059032
A lookup to what? Runtime information?
>>
>>56059046
oh wait I didn't even watch the whole thing
>>
>>56058998
lol, 2 months bills for what will obviously be an enormous headache. Make sure you sign a contract saying they can't skip payment if you don't finish on time.
>>
>>56059017
She told him that she uses non-free software.
>>
>>56059049
i'll let you decide on that
>>
>>56059014
Yes, but the caller is responsible, not the callee. If you need to call the same function many times with the same input, you can just do a single check (or apply some rule to an existing proof) and then call it many times after that.

It gains safety without leaving elision of runtime checks up to the compiler.
>>
>>56059075
Yes, but in procedural languages this is still achieved manually

I don't really see there being a big gain in terms of performance or memory usage or anything like that
>>
>>56055124

Using Ruby to call C inline Assembly.
Hehehe..


require "inline"

class Ruby_to_C_to_Assembly
inline do |builder|
builder.c \
'int add(int v1, int v2)
{
__asm__ __volatile__("addl %%ebx,%%eax"
:"=a"(v1)
:"a"(v1), "b"(v2)
);
return v1;
}'
end
end

puts Ruby_to_C_to_Assembly . new . add(17, 4)
>>
>>56059052
All of this happens during type checking. If a proof of a required proposition cannot be found in the context, type checking fails.
>>
I am trying to embed a C++ library in a LuaJIT module with the FFI library. And I'm having a hell of a time. I never learned C/C++. I can at least wrap my head around the basics of C, but C++ is godamn over my head.

I am stuck right now trying to figure out how to return a string in a C++ function which streams it with << from of a local file to cout.

I can get as far as making a main function which will read the file path, and print the contents in a LuaJIT repl after I bind it with cdef and load the .so library from the .cpp, but I can't allocate the cout to a lua string. Calling the function from the LuaJIT repl just prints the content, and I can't do anything with it. I tried streaming the file content to a buffer, but the compiler won't let me return a string. When I try to create an std::string object in the C++ code and stream into it, it compiles, but then the LuaJIT freaks out. I don't have the time to learn C++, and I need those functions to read some enormous strings from files. Want to hang myself in front of the fucking desk.
>>
>>56055124
Dan "likes em tighter" Schneider?
>>
>>56059108
Yes, but you still need the same runtime information. Types and terms are effectively the same thing at this point.
>>
>>56059092
There isn't one, it's a gain in safety without a loss in performance that doesn't require ugly proof-passing boilerplate.
>>
>>56059129
>without a loss in performance
>>
>>56059074
Thanks, anon. I finally have my answer.
>>
>>56059126
That doesn't mean they have to exist at runtime.

The whole point of "no computational content" is that these proofs only exist during type checking. The same goes for any type without an eliminator (such as types of types in most dependently typed languages).
>>
>>56059144
Where do you see a loss in performance in something that only happens during type checking?
>>
>>56059171
>>
>>56059171
>Dan "The Man With The Plan (to rape)" Schneider
lost
>>
>>56059158
This is kind of the big idea of Curry-Howard, FYI. Programs (values) are proofs, but it only matters that the proof exists. True propositions are unit type, while false propositions are uninhabited. Neither has runtime representation.
>>
>>56059158
>>56059168

You still need to do runtime checks. Otherwise you're just dealing with functions on compile time constants. The same thing is done in procedural languages with extra terms. All you do is move the terms into types, which I'm not saying is bad but you don't gain performance.

Type information still needs to exist at runtime, or you don't have polymorphism
>>
>>56059242
You have to do the runtime checks in C or assembly. The point of all this is to make a function safe by restricting the arguments instead of by doing internal checks or assertions. And usually, restricting the arguments is too limited (SMT) or too verbose (proof-passing).
>>
>>56059266
It's exactly the same and requires the same information and computation

Performance problems are not problems that fail to typecheck, they're "if already sorted do X else do Y" problems. Type systems help but they don't give you better performance, and every functional language performs slower than the main procedural languages. It might work in theory but it clearly doesn't in practice, and they've been working for half a century.
>>
>>56056506

That is, in the philosophical sense, not an argument.
>>
>>56059323
You have no idea what's going on, I don't know how to explain it in dumber terms. I also don't know where you're getting "functional" from.
>>
>>56059346
At this point, I think he's just flailing around for something resembling an argument.
>>
>>56059346
Name a non-functional dependent language

>You have no idea what's going on
No, YOU have no idea what's going on

You're imagining a fictional world where there's no input at runtime.
Work has to be done to decide which predicates the input satisfies, and that information is used to dispatch differently.
In dependent languages, that's type information. It's still runtime information.
>>
>>56059116
Man, most of your post was unintelligible. Why the hell not just use C functions? LuaJIT was built with C in mind, not C++. You can't yield a C++ String type to Lua, it must be a C style string, or the ffi.string function can take a length. Also, C++ string objects will release their memory before the JIT can pass it to Lua, hence the garbage, you'll have to copy the string into a buffer allocated in Lua with ffi.new and passed to the function.
>>
>>56059376
I'm not sure what there is to argue about in the first place. Curry-Howard isn't revolutionary, I just found a way to make it nicer to use.
>>
File: 1447459739194.jpg (52KB, 376x419px) Image search: [Google]
1447459739194.jpg
52KB, 376x419px
>>56059171
This is one unfunny meme.
>>
There is no reason any new programming language should not have an advanced strong static type system.
>>
>>56055329

Dude, don't want to be nitpicking, but some details about your code:


>10.times.each do

That pretty redundant.
Either "10.times do" or "(1..10).each do"

>grid( :row => index, :column => 2, :sticky => 'w' )

Why are you not using the shortcut notation for maps here?
grid( row: index, column: 2, sticky: 'w' )


>@image_list = find_all_images @top_level_dir
>@image_list.sort!

Shorter:
@image_list = find_all_images(@top_level_dir).sort


>@current_img_index = @current_img_index - 1

Shorter:
@current_img_index -= 1


Hope you don't mind my comment, it's an impressive script, though..
>>
>>56059346

The simplest way to explain this is to point out that you are literally saying your program's performance can improve if only it doesn't compile.

Whether or not an array is sorted or not, and hence fit for using some other more efficient algorithm, is not exclusive to dependent languages. You do not gain performance.
>>
Dan "the hymen collider" Schneider
>>
File: kek.jpg (60KB, 500x495px) Image search: [Google]
kek.jpg
60KB, 500x495px
>>56059069
>>
>>56055124
>Name a non-functional dependent language
Doesn't matter.

>You're imagining a fictional world where there's no input at runtime.
>Work has to be done to decide which predicates the input satisfies, and that information is used to dispatch differently.
>In dependent languages, that's type information. It's still runtime information.
I'm not sure where you're getting this. The safe array access doesn't do a bounds check, it makes the programmer prove that the index is less than the length. This prevents REDUNDANT runtime checks without sacrificing safety. This is a well-established concept. The big problem with it is the verbosity, which I believe I have found a simple solution to.
>>
File: readImage.jpg (27KB, 399x385px) Image search: [Google]
readImage.jpg
27KB, 399x385px
>>56059069
lel
>>
>>56059387
Actually, the simpler way is to make the string static, keeps the buffer from being deallocated. Once it's interned with ffi.string, it's fine for the buffer contents to change on proceeding calls to the same function.
>>
>>56059116
Lua can only interface with static C++ methods or C-style functions. Don't use cout, use printf or puts or something.
>>
>>56059069
top cake
>>
File: KNK11_7.png (86KB, 708x151px) Image search: [Google]
KNK11_7.png
86KB, 708x151px
Is this a decent solution? I haven't tested it too far yet, but seems to accept any day_of_year and year value I throw at it without any errors.

Just want to make sure I'm not missing anything/if there's a way to do it better.

#include <stdio.h>

void split_date(int day_of_year, int year, int *month, int *day);

int main(void){
int dayOfYear = 365, year = 2015, month, day;

split_date(dayOfYear, year, &month, &day);

printf("Month: %d; Day: %d", month, day);

return 0;
}

void split_date(int day_of_year, int year, int *month, int *day){
int end[13] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int i;

if(year % 4 == 0)
end[2] = 29;

for(i = 1; i <= 12; i++){
if(day_of_year - end[i] > 0){
day_of_year -= end[i];
*month = i + 1;
}
}

*day = day_of_year;
}
>>
>>56055124
>The simplest way to explain this is to point out that you are literally saying your program's performance can improve if only it doesn't compile.
Quote me.

>Whether or not an array is sorted or not, and hence fit for using some other more efficient algorithm, is not exclusive to dependent languages. You do not gain performance.
I already said many times there is no performance gain. You gain safety without performance loss. Dependent types simply allow you to type the procedure implementing the algorithm such that it cannot be called on an array that isn't proven to be sorted (and the easiest way to obtain such a proof is to sort it).
>>
a
>>
>>56059452
>Doesn't matter.
Yes it does.

>I'm not sure where you're getting this. The safe array access doesn't do a bounds check, it makes the programmer prove that the index is less than the length. This prevents REDUNDANT runtime checks without sacrificing safety.

Yes, redundant checks which can be avoided anyway by not writing them in the first place. Those are not where people are having performance issues.

The interesting situations are where you have data that may or may not satisfy a condition, and you branch based on that. You don't benefit from that in dependent languages. You still need to do a runtime check, the only difference is that your data is considered type information rather than term information.
>>
>>56059530
BIG
>>
>>56057303
living the dream
>>
>>56059490
>Quote me
That's how a typechecker works. If the types aren't met, it (normally) fails.

>I already said many times there is no performance gain.
Then why have you been arguing back?
That is all I've been saying.

As for "without performance loss", that's said often in theory but rarely in practice. Programming functionally is "without performance loss" - in theory.
>>
>>56059535
You're missing the whole point, which is zero-cost safety. I'm not talking about shit like Timsort.
>>
>>56059568
I wasn't arguing about safety, I never mentioned it. I've been saying you don't gain performance the entire time.

It's really just a cleaner way of doing what many people already do with smart constructors
>>
>>56059604
Smart constructors aren't zero-cost.
>>
>>56059486
#include <stdio.h>

void split_date(int day_of_year, int year, int *month, int *day)
{
int num_days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int i;

if (!(year % 4) && (year % 100 != 0 || !(year % 400)))
num_days[1] = 29;

for (i = 0; i < 12; i++)
if (day_of_year - num_days[i] > 0)
day_of_year -= num_days[i];
else
break;

*month = i + 1;
*day = day_of_year;
}

int main()
{
int day_of_year, year, month, day;
printf("Enter day_of_year: ");
scanf("%d", &day_of_year);
printf("Enter year: ");
scanf("%d", &year);
split_date(day_of_year, year, &month, &day);
printf("month: %d, day: %d\n", month, day);

return 0;
}
>>
program idea: "everything(tm) search engine" for the windows registry
>>
>>56059620
They can be. But if you thought that, you should be thinking the same of dependent types too
>>
>>56059646
Dependent types are types.
>>
>>56059646
>>56059620

For instance
data Natural where
exceptNat :: Integer -> Natural -- throws
unsafeNat :: Integer -> Natural


unsafeNat does nothing whatsoever with the data.
All it does is tells the compiler that it's now a Natural.
If you know it's going to be >= 0 you use unsafeNat
It's a no op, so there's no work to be done

in theory

>>56059664
Do you want polymorphism or not?
>>
>>56055368
This could be the next indie hit, just give it a shitty 2deep4u story like undertale and there you go.
>>
>>56055124
Dan "pop her boipussy" Schneider.
>>
>>56055393
>Developers unionize
>H1B hires increase by 150%

Great idea
>>
>>56059683
>unsafe
My point exactly.

>polymorphism
Elaborate.
>>
>>56059733
Any kind of polymorphism whatsoever.

For instance, if you consider ad hoc polymorphism, with dependent types you could have something like

maximum :: { array Nat | isSorted ascending } -> Nat
-- access the last element
maximum :: { array Nat | isSorted descending } -> Nat
-- access the first element
maximum :: array Nat -> Nat
-- scan for the maximum

You want a function that finds the maximum of any array, but if it's sorted you want to use the optimised functions.


Another example is parametric polymorphism
func :: forall a. (a -> a) -> (a -> a)
emphasis on the forall, you want to be able to specialise at runtime, and have generics at runtime
>>
>>56059815
hot him but, why are you interested in this?

is it fundamental to learn programming ?
>>
>>56059905
What do you mean?
>>
>>56059409
it's 2016, how new languages don't come with HKT is beyond me
>>
i'm trying to draw a cross in the terminal, but its not working, the right side doesn't cross diagonally
def draw(n):
a = ""
for i in range(n):
print a + "*" + (" "*(n-i)) + "*"
a += " "

draw(8)


output
*        *
* *
* *
* *
* *
* *
* *
* *
>>
>>56059815
That ad-hoc example is using refinement types, not just dependent types.

Rank-1 parametric polymorphism can be done with templates, anything higher just requires a level of indirection to implement.

Not sure what you were trying to prove here.
>>
>>56059960
make that (" " * (n-1)*2 ) or something
>>
>>56059973
Actually, that comment about refinement types was silly. Doesn't make a difference if the polymorphism is purely at compile time, but if it's at runtime you need some kind of tag or vtable to distinguish between the three.
>>
>>56059996
*                *
* *
* *
* *
* *
* *
* *
* *
>>
>>56060027
Aaand I forgot to make my point, which is that dependent types have nothing to do with dynamic dispatch.
>>
>>56059973
>>56060027
>you need some kind of tag or vtable
yes, namely you need exactly the same amount of information as in a regular language

>>56059973
C++ templates aren't proper parametric polymorphism
if you take map for instance:
(a -> b) -> ([a] -> [b])

if you give this a polymorphic function a -> b then you should get back a polymorphic function [a] -> [b]

with templates, you can only give it a monomorphic function

>>56060048
you still need to do dynamic dispatch, which is the point.
you still need information - you need type information at run time
the only difference is in a dependent language there's no real difference between type information and term information
>>
>>56055124
>yes, namely you need exactly the same amount of information as in a regular language
I never claimed dependent types have anything to do with this.

>>>56059973
>C++ templates aren't proper parametric polymorphism
>if you take map for instance:
>(a -> b) -> ([a] -> [b])
>if you give this a polymorphic function a -> b then you should get back a polymorphic function [a] -> [b]
>with templates, you can only give it a monomorphic function
Hence my mention of rank-2 (or higher) parametric polymorphism, which is what you are asking for.

>>>56060048
>you still need to do dynamic dispatch, which is the point.
>you still need information - you need type information at run time
>the only difference is in a dependent language there's no real difference between type information and term information
See above. Besides, dependent types just mean terms can appear in types, not that types are terms. Even if you have types as terms, they don't need to be represented at runtime unless you eliminate (e.g. pattern match on) them.
>>
>>56059905
>is it fundamental to learn programming ?
Proves without a shadow of a doubt that you are not passionate, because if you were you wouldn't be asking this question. No it's not if you are a vulgar utilitarian, but if you know you're making assumptions all the time when coding and you'd like to know these systems that claim to reify assumptions, it's interesting, and it makes you more passionate and clever.
>>
>>56060132

If you ever want to actually call a function, you need information
>>
>>56060217
Okay.
>>
>>56060229
And parametric functions need to be called with types
>>
>>56059905
>is it fundamental to learn programming ?
no it's some useless "functional programming" bullshit
>>
>>56060246
Templates and void pointers mean no RTTI.
>>
>>56055259
Read a book. O'Reilly books are pretty good for newbies. Hell, your Uni might even prescribe it as the required textbook.
>>
how can one enter the C++ programmer job market? what kind of jobs are the least popular among devs so they can be accessible to relative beginners ?
>>
>>56060264
No, they don't.
Applications of compile time constants are the way to avoid redundant run time information.

Templates and void pointers are not magical, they're less powerful and monomorphic.
>>
>>56060304
to be a C++ programmer you should be pretty much an expert because it's one of the most complex and difficult languages to work with
>>
>>56055259
Moving to London
>>
>>56060311
I should add
Templates are parametric polymorphism for compile time constants.
>>
>>56060311
>>56060330
And in a dependent language this becomes MUCH more important.

It's the difference between std::array and std::vector
>>
>>56060330
Yes, and void pointers are parametric polymorphism for when you can't monomorphize with templates; when you have higher-rank parametric polymorphism like your example.
>>
>>56060355
There's a big difference between dependent product (forall) and dependent sum (exists). Dependent sums take a bit more to implement because they may lead to exotically-sized types, but they're a way to encode growable arrays (just a pair of a length and an array of that length, with the array behind a pointer at runtime).
>>
>>56060373
Void pointers are useless for polymorphism, it's the same as I said earlier with compile time constants - except the result type is a compile time constant.

What if you've got something that could be an int or a float? Or could be an array or a sortedArray? You need information.

>>56060424
Dependent sums can be implemented through dependent products
Not to mention that a lot of dependent languages like Agda won't have language primitives (aside from compiler optimisations)

The whole point of a dependent language is you move more information into the type. You still need the same amount of run time information.
>>
>>56055137
here you go
>>
>>56055124
>What if you've got something that could be an int or a float? Or could be an array or a sortedArray? You need information.
That's ad-hoc polymorphism.

>Dependent sums can be implemented through dependent products
No, they can't.

>Not to mention that a lot of dependent languages like Agda won't have language primitives (aside from compiler optimisations)
I'm not talking about existing languages, I'm talking about concepts.

>The whole point of a dependent language is you move more information into the type. You still need the same amount of run time information.
I'm not contesting this. From the sounds of it you are saying you need MORE with dependent types which is absurd.
>>
>>56060486
>mfw most of the easy ones seem too hard for me
>>
>>56060522
>That's ad-hoc polymorphism.
In a dependent language maybe, but that doesn't matter, the problem still exists.

>No, they can't.
http://stackoverflow.com/questions/26542350/dependent-types-how-is-the-dependent-pair-type-analogous-to-a-disjoint-union/26543176#26543176

>I'm not talking about existing languages, I'm talking about concepts.
So you want dependent languages that don't use their dependant types?

>From the sounds of it you are saying you need MORE with dependent types which is absurd.
No, you need the same amount. With dependent types it could be less clear though, and you could end up with redundant information being carried.
>>
Rotating a curve between (0, 1) and (1, 2) about the x-axis generates a surface of revolution. Obtain an upper bound on the minimum value S∗ of its surface area by using the trial-function method (and a software package for numerical integration).
>>
>>56060316
expert without experience?? how the fuck does that happen?
>>
i just made my very first java program, it asks for your name and then it salute you

Im so excited and proud man
>>
>>56056816
I feel like this task is more amenable to traditional computer vision techniques.

Nah fuck it just throw a shit ton of data at it.
>>
>>56060750
>I feel like this task is more amenable to traditional computer vision techniques.
Care to elaborate?
>>
File: sampleScan2.png (151KB, 1920x1080px) Image search: [Google]
sampleScan2.png
151KB, 1920x1080px
I have data that looks like this.

Ignore everything but the blue diamonds, they are what i'm interested in.

I want to implement some kind of pattern recognizer. All I need it to do is recognize and generate a best fitting circle around the biggest cluster. how do I do this? I don't even know where to start.
>>
>>56060486
rrrrrrrrrrrrrrrrrrrrrrrrrrrrol
>>
>>56060839
k-means or some other algo
>>
>>56060806
Well yeah you're trying to detect circular patches of roughly uniform color sitting on another patch of roughly uniform color.

I'm no computer vision genius but that seems like something you should be able to get decent accuracy on without going full-meme with CNNs.
>>
>>56060839
>identify the biggest cluster
>find convex hull
>put circle around it

or alternatively find the centroid and radius or something if it doesnt need to be precise
>>
>>56060839
There are so many algorithms for clustering. Pick 1000 and try each one until you find one you like. I'm pretty sure Sci-kit-learn has a bunch already implemented.
>>
File: 1443742535692.jpg (79KB, 500x650px) Image search: [Google]
1443742535692.jpg
79KB, 500x650px
Neck deep in the "Intel 64 and IA-32 Architectures Software Developer Manual", reading about the GDT and its structure.
>>
>>56060839
google clustering algorithms

there's a million

some are simple, others are more complex

what you apply and how is more like an art
>>
File: intellij.png (74KB, 1383x913px) Image search: [Google]
intellij.png
74KB, 1383x913px
Did i fell for the intelliJ idea meme?
Where is the document tab?, i have tried changing the jar in the /plugins/javafx of intellij i have selected the exe of scene builder, the jar and nothing the document tab never appears

can anybody enlighten me? should i ditch the intellij's embedded scene builder?
>>
>>56060486
>99: C compiler
>easy
guess I'll do that
>>
>>56060869
Colors can vary wildly, shapes can vary wildly, textures on those patches can also vary wildly and there is a huge room for false positives. You have to be insane to try and account for all of it by hand.

Plus, CNNs are not full-memes. Those computations are fairly straightforward and pretty much search for shapes the way your described - only they learn automatically from the training set instead of a person having to write all code by hand.

>traditional computer vision techniques.
Was there even computer vision before NNs?
>>
>>56060839
>>56060903
yep, scikit learn if you know some python (or even if you don't) can help you with this
>>
What does /dpt/ think of haxe?
>>
>>56060486
>Basic bootloader
>Fuck you

>C compiler
>Easy

Who the fuck made this.
>>
>>56060965
So shit we forgot it existed
>>
>>56060967
rofl
>youtube to mp3
>hard
literally just ffmpeg plugin
>>
>>56060939
That's why I said DECENT accuracy. Obviously you're not going to reach a level of accuracy that CNNs would get with millions of training examples but who has a dataset like that.

CNNs suffer from false positives/negatives too, arguably much on a much more sinister level since they're essentially big black boxes that you can't debug.
https://www.youtube.com/watch?v=M2IebCN9Ht4

>Was there even computer vision before NNs?
Ha.
>>
>>56060869
Please fuck off.
>>
>>56061046
>HE IS AGAINST THE GROUPTHINK HISSSSSSS
>>
>>56061056
>i have no basis for it but please listen to my solution while i attack your well founded solution
>>
>>56061056
>CNN's are getting lots of use and research because they're very powerful.
>Therefore, it is quite clear without a single doubt, that CNN's are a meme.
Please fuck off and kill yourself.
>>
>>56061032
>since they're essentially big black boxes that you can't debug.
Welp. NN is just a big graph representing a computation. You can debug it however you want.

Also the attack on the NN they are showing in the video requires them having the full trained network at their disposal - they can't fool a network that exist somewhere else and only remotely responds to their classification requests. They also are able to carry out that attack precisely because they can debug the NN.

And who knows, maybe if we got to properly map the neural network inside of one particular person, maybe we'd be able to create pictures that would fool that person just as well as they are fooling those artificial neural networks.
>>
webkit replacement made in some FP language when?

>>56061082
but that's the "logic" /dpt/ uses all the time to attack this or that language. so the anon must be right.
>>
which is the sanest way to manage floats here?
I think this is half-assed
#include <stdio.h>

main()
{
int grade, grade_number, fail_count, i;
float average;
float grade_total;

printf("How many grades are you entering?\n");
scanf("%d", &grade_number);

for (i = 1; i <= grade_number; ++i){
printf("Enter grade #%d\n", i);
scanf("%d", &grade);

grade_total += grade;

if (grade <= 65){
++fail_count;
}
grade = 0;
average = (grade_total / (float) grade_number);
}

printf("average is:%.2f\n", average);
printf("fail count is %d\n", fail_count);

return 0;
}

>>
>>56061093
>Welp. NN is just a big graph representing a computation. You can debug it however you want.
That's like saying the same for brains.
>>
>>56061093
>Also the attack on the NN they are showing in the video requires them having the full trained network at their disposal - they can't fool a network that exist somewhere else and only remotely responds to their classification requests
They can fool it so long as the net outputs a confidence rating.

>They also are able to carry out that attack precisely because they can debug the NN.
Don't know where you're getting that.

>And who knows, maybe if we got to properly map the neural network inside of one particular person, maybe we'd be able to create pictures that would fool that person just as well as they are fooling those artificial neural networks.
Idiotic.
>>
>>56061156
Well, yes, except we don't have any control over flow of data between neurons, which means we can't debug it. But, yes.
>>
>>56061228
That's not the problem
>>
>>56061264
ehhhhh

I think that is a problem.

I think if we had means to properly inspect data traveling between nodes in a real brain, if we had real full mapping of the brain, we'd have achieved a much greater understanding of the brain by now.
>>
File: out.webm (474KB, 1888x686px) Image search: [Google]
out.webm
474KB, 1888x686px
working on a tree-like gui for a client, they want non tech savvy people to be able to add new input fields to the website, they deal with tree structures in their profession, so thought this would be a good way to go
>>
>>56055368
Yo first year CS student learning C++ here, how can I start working on these kinds of projects? I'm not really sure how to make the jump from simple calculators and shit to actual programs.
>>
>>56061163
Ah. I thought of a different way of fooling NNs, by altering images using gradients from the NN back-propagation.

Still though, even that video, which I now watched to the end (despite the horrible voice that makes you want to close it immediately) specifically mentions the result they achieved this gives you understanding of how CNNs work.

>Idiotic.
:^)
>>
>>56061336
>Ah. I thought of a different way of fooling NNs, by altering images using gradients from the NN back-propagation.
You're a few years late on that one. Look up DCGANs.
>>
I'd like to know how to download videos from google drive (using the api) providing the url and quality as arguements.
>>
>>56061327
Use GDI
>>
>>56061285
what language are you using?
>>
NEW THREAD!

>>56061461
>>
NEW THREAD WITHOUT WEEB SHIT
>>56061464

NEW THREAD WITHOUT WEEB SHIT
>>56061464

NEW THREAD WITHOUT WEEB SHIT
>>56061464
>>
>>56061475
stop spamming the board
>>
>>56061414
javascript/php
>>
>>56055329
>using to_s inside a string interpolation
That's redundant m8
Thread posts: 322
Thread images: 30


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

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.