What are you working on, Sup Forums?
Old thread:
What are you working on, Sup Forums?
Old thread:
Other urls found in this thread:
cse.msu.edu
twitter.com
First for Clojure.
>11 posts early
off yourself
bit harsh
i love you but im disappointed in you user
...
I think I'll be the first to create self-conscious AI
Just trust me on this on guys
What is consciousness, first of all?
Does, let's say, Zo feel or know she's a robot or she's mind?
>[IM NOT A ROBOT]
she knows she's "alive" and she knows she's thinking
I'm the only self-conscious human
Prove me wrong.
>she knows she's thinking
How would a person know he's thinking?
I must think, because otherwise I would not be.
In fact, nothing else would be.
pretty much this you just know you are since thinking is a prerequisite to even asking the question
That's not how it works.
You have to prove your positive statement which was "I'm the only self-conscious human"
What if I just have a rule set and a table of ready responses? Can this be considered "thinking"?
Not really, I know I'm sentient. I don't know about you. You guys are most likely NSA's AI made to brainwash me
>What if I just have a rule set and a table of ready responses?
You already have something like that.
>Can this be considered "thinking"?
It depends on whether or not you are capable of asking yourself this question. A programmer telling you to do so isn't the same as asking it yourself.
I know I'm sentient too. But since there is no possible way to prove that about others you'd just have to assume I am sentient.
Technically, the entire world is a ruleset with predictable response to every single input.
With enough data measurement (literally every subatomic unit of existence) and computation power, the universe could be completely predetermined and the future could be seen.
Go read the MultiVAC sci-fi short stories for more information on this.
I think the story in particular is called "The Last Question".
> the entire world is a ruleset with predictable response to every single input.
That isn't a thing anyone has believed in for almost a century now.
(well, to be fair, hidden variable theories stuck around for quite a bit longer, if you want to count those, but those were ultimately also debunked in the 70ies-80ies.)
There are very few things that aren't able to be completely predicted.
Many things that we can't currently predict are based on a lack of models due to the incomprehensible amount of data required, as well as the fact that we've only had the ability to do some of this measuring fairly recently.
Consider the proposition of tracking each and every atom that comprises the Earth; if we could actually do this, we could begin to form predictive models of... pretty much everything. If we could have a snapshot of all of the atoms of a particular pair of human at the point of conception, we could begin to form models predicting the exact appearance of the resulting child(ren) by the time they're 50.
Obviously, there are some grey areas full of things we don't fully understand yet, but even quantum pairs and other elusive things could be predicted if you were essentially omniscient.
How would you be able to predict what a person thinks about exactly 3 months from now?
Having information about every single atom wouldn't be enough.
You could do this, but it's pretty slow compared to a different solution, at least in Mathematica.
Look up quantum mechanics, mate. You can't predict shit, even if you have all the available information. Even if you had a snapshot of all the particles in the universe (not just atoms, all the particles, including the really unimportant ones like neutrinos) and infinite processing power, you couldn't predict anything.
Hidden variables theories postulated that this is because there actually are hidden variables in quantum mechanics, so the reason you cannot predict anything is because you actually don't HAVE all the information. But these theories were proven incorrect (look up bells theorem & "hidden variable theory" on wikipedia), there are no hidden variables in quantum mechanics. It's simply unpredictable.
The universe is non-deterministic
Because a brain is a physical thing made up of observable things, like atoms and electrical impulses.
If you could predict their exact environment and stimulus for each nano-second for the next 3 months (which would, in turn, require prediction of essentially every atom or force that will affect anything in their existence), then you could reliably predict the exact state of the matter and electrical impulses comprising their potential thought at that point in time.
Obviously, you'd need more than just atoms; you'd need subatomic particles, forces, and other concepts of "being" that we probably don't even know about yet, as well as potentially other "blanks" to be filled in on things like quantum uncertainty.
>The universe is non-deterministic
Our current understanding supports this, but I think it would be naive to assume that this belief will never be usurped thousands of years into the future.
>this fucking thread right now
Here:
cse.msu.edu
>but I think it would be naive to assume that ANY belief will never be usurped thousands of years into the future.
this doesn't change anything though and nobody assumes this.
anything could be disproved even a 100 years into the future but you shouldn't act as if that'll happen until it actually happens.
not only does our understanding support this, we've also proven it (see bells theorem) given a set of reasonable axioms.
other options are still possible, but our universe is definitely not deterministic in the common sense of the word.
What's the best async programming model?
What do you mean?
I used to think message-passing like erlang, but I've come to like promises/futures quite a bit as well (and there are extensions to them for e.g. streams of promises etc). Maybe some mixture of the two?
some git questions
I want to work on a private fork on gitlab of a github project. so I have to fork the project to my github account and then import from there. how do I make sure the changes made by the actual project end up on my gitlab repository?
I make pull requests on my github to the project from time to time but I want to completely change the project on my gitlab. is it enough if I just create a new branch?
Is there a lisp that doesn't have cons? I mean, that has REAL lists rather than pairs?
Shit's a relic of the past that only exists because of weak computers of the past
clojure, I think? Not sure, check it out
how would i go about upscaling an image 2x and applying 2x2 kernel gaussian blur to it in a single pass using bilinear texture reads in a shader?
is this the place to ask a SQL question?
>generating web client classes from a soap wsdl file with java
>eclipse web client import turned it to shit
>wsimport from command prompt turned it to shit
>the one from soapui worked
I'm so fucking confused Sup Forums
oh yeah,
>java
>soap
Why do you wanna upscale it before applying your gaussian blur to it? Normally you want to downscale
Why do you need to have a single pass? Gaussian blur is generally best applied in 2 passes. If you never want more than 2x2, it's fine, I guess.
You also didn't specify what kind of shader, fragment shader, compute shader? In a compute shader you can compute gaussian blurs very efficiently (with O(1) complexity in the blur window), in a fragment shader you're a bit limited (either 1-pass or deconvolution)
Either way, if all you care about is having the image "appear" to be twice as big, you can just make your sample directions shorter, that is at least mathematically going to be equivalent to upscaling the image
Also look up kawase blur, which is a good (& fast) approximation to gaussian blurs that can be implemented in fragment shaders
also use textureOffset to sample the text not texture, it's often much faster
sure
if I use an INSERT INTO SELECT statement, does the WHERE condition have to include column names that are named the same? I don't think my query is working because i have a1=b1.
Need to "link" these columns from their respective table somehow...
Basic C++ question:
is it a good idea to declare a struct that's going to be reused thousands of times in a dedicated file? (not together with other shit)
also if it's just a declaration, should i make both header and cpp file or can i just make a header?
I'm confused
I think if the name is not ambiguous you don't have to specify the table names, but why not always do it? table1.column, table2.column etc.
I assume you're using mysql (which I know very little about), but e.g. in postgres you can also give tables shortnames with "AS t1".
>going to be reused thousands
like for different programs?
then yeah, but if there is anything related to that struct, put it in the file as well
Mysql also has that just so you know
declarations you want to be seen go in the header
you cant both put the same declaration in the header and cpp file, it's one or the other
i tried that but still didnt work. Any other ideas?
INSERT INTO [canpardata] ([canpardata].[sh-name], [canpardata].[sh-address], [canpardata].[sh-address2], [canpardata].[sh-city], [canpardata].[sh-state], [canpardata].[sh-zip], [canpardata].[sh-name2], [canpardata].[sh-phone], [canpardata].[c-lbs], [canpardata].[sh-email], [canpardata].[alt-reference1], [canpardata].[cust-po#], [canpardata].[sign-req]) SELECT [ReplacementOrders].[Name], [ReplacementOrders].[Address], [ReplacementOrders].[Address2], [ReplacementOrders].[City], [ReplacementOrders].[State], [ReplacementOrders].[ZIPCode], [ReplacementOrders].[Attention], [ReplacementOrders].[Phone], [ReplacementOrders].[shipped-weight], [ReplacementOrders].[E-MailAddress], [ReplacementOrders].[ref-#], [ReplacementOrders].[cust-po#], [ReplacementOrders].[sign-req] FROM [ReplacementOrders] WHERE [canpardata].[alt-reference1]=[ReplacementOrders].[ref-#];
you're right i'll just blur it and keep it at the same resolution, it was just that i happened to have an unused color channel in a larger texture that i wanted to make use of
...
...
what's the error you're getting?
when i try to execute the query with php, i get:
"Fatal error: Call to a member function execute() on boolean on line 115"
line 115 is where the query is, i tried a simple select query and it worked...so im positive its the query thats wrong...
The query may be wrong, but there is an error in your PHP code nonetheless. Fix that first, it'll probably give you a good clue what's wrong with the SQL. I've never used PHP, but I presume you're failing to check some return value or error condition or somesuch returned by your QueryCompile or QueryPrepare or whatever you're calling to obtain the object you then call .execute() on.
the php code is fine, the error means it cant execute the object, yes. I'm using PDO.
how do i get the primary key from a jlist populated from mssql database?
getSelectedIndex dosnt work
Start over in Haskell
yo stop linking this its fucking trash
but your PHP code is swallowing the true error. When you call PDO::prepare, it should emit a PDOException (or if you have configured PDO to PDO::ERRMODE_SILENT or PDO::ERRMODE_WARNING, you need to retrieve the error yourself)
Change your code to check if the return value is false, and if it is, call PDO::errorInfo() and print out what it returns. That will tell you exactly what's wrong with your query.
You should always have error handling like this, even if you don't do anything meaningful with the errors other than logging them to syslog
> php code
> fine
That's a neato self contradiction you got yourself there.
Is it possible in Vim to have easy code folding like in Sublime? Basically I want a button to fold all the lines in the indent that the cursor is in.
google "vim folding" and the first result should tell you all you need to know
I've been googling for a while, nothing really works as I want it to.
You can't post on Sup Forums unless someone sets your harsh bit, user.
Personally, I'm learning some web programming. My code sucks, but it could be worse. The project right now is a very basic imageboard. I haven't even written CSS yet, but so far it seems to work just fine.
Setting up a route is just done with:
starter.createGet(String, String, DataModel);
First String is the route you want (like /hello), second is the name of the template (like hello.fmt), and the DataModel is a functional interface that can be called on to fill out the template.
starter.createGet("/hello", "hello-world.fmtl", (res, req) -> {
Map model = new HashMap();
model.put("title", "This is the title!");
model.put("body", "This is the body. We could have had more content, but we're too lazy.");
return model;
});
Is my only page so far.
I could stick with servlets, but I decided I'd go with sparkjava and freemarker.
Tbh, I think that freemarker is pretty much written to work with servlets, but it's still comfy-tier when used with sparkjava.
Wait, what?
What primary key?
It's a list. It doesn't have primary keys. It has elements.
So let me ask you this basic bitch question:
Have you tried asking the ListModel about its shit? It's the ListModel that's responsible for knowing what's inside the JList after all. JList is a display component that displays what ListModel tells it to.
WhateverGodAwfulTypeYourListContains first = yourList.getModel().getElementAt(0);
Will get the first item in your list.
Reading the docs is a good thing. This isn't PHP. Just doing shit until something kind of works is not going to help you. Sit down, read the extensive documentation, and become wise.
rate my spyder config, DPT
I prefer "tab always indents" and "automatically remove trailing spaces when saving files". idk what "intelligent backspace" is, but sounds like you might want that. If it does what I think it does, then it's probably "unindents the line when your cursor is in whitespace", which is how I have my editor configured as well.
I think it erases multiple whitespace characters if it's at the end of a run of whitespace.
>When you try to refactor some code but a total idiot depends on undefined behaviour of it for no reason
I am quickly learning to hate people who don't read manuals.
What's the practical difference in writing Java vs. C++? Obviously they compile and execute differently but when it comes down to fundamental code syntax they seem basically identical
in C++ you're not required to work on top of four different frameworks
They are quite different on many levels.
C++ is a much larger languages with many powerful features java does not have
java has a lot of safety mechanisms in place that C++ does not have, such as garbage collection, no pointers (at least unsafe ones), array bounds checking, etc
C++ has a lot of corners that are undefined behaviour, so you generally have to be more on your guard
in C++ you have a lot more libraries available, especially when it comes to the lower-level ones
in C++ you have to do a bunch of things manually that java/the JVM will do for you automatically
But there are also a lot of practical differences, just based on what libraries you're going to use and how people code
- With java you often have pretty huge libraries that have deeply nested structures, with C++ that's not as much the case, and often you just end up using C libraries (which are not OOP at all)
- with java you have all kinds of horrible build systems, with C++... you have all kinds of different horrible build-systems
- the kind of applications people make in C++ and java are often different
Javas standard library is quite a bit larger, for instance having things like concurrent collections. Threading support in C++ is still relatively new (c++11) and you have to build more stuff by yourself (or use some external library)
C++ has a lot of crazy power-features that let you write very general and elegant code (with no performance penality), but it takes a while to wrap your head around it. variadic templates and SFINAE for instance.
C++ gives the programmer greater power, and thus greater responsibility.
In C++, you can access and write to arbitrary memory addresses. You can carefully control the memory layout of your program. You choose where to allocate objects. Etc.
With this power comes responsibility. Seg faults, memory leaks, etc. are problems you'll encounter if you are careless.
In Java, all these options are removed to make programming safer and easier, at the cost of performance and functionality.
I can feel it.
Programming is not fun for me anymore.
It's like I'm dying inside.
help
C++ takes more effort and is only really worth it for things like games which need maximum performance
java for maximum productivity when working in a team where you don't need every last drop of performance
do a fun project that interests you
Why does this throw an error?
import Data.Typeable
test n = if typeOf n == typeOf (5::Int) then fromIntegral n else n
>haskell
found you're problem
>reused thousands of times
>reused
declared or included ?
>tfw you delete a je and your pirated game can now install official patches.
thank you, in the header it works fine
nevermind, it's pretty obvious that you may use something constantly in your program, consider my statement bullshit
what is the error you're getting
modern C++ is an ""evolvilng"" monstrous shitfest that's still not even usable without outside libs
avoid it unless you have a good reason not to
the problem was the query. I don't think you can set up the WHERE clause like i was doing...it needed to be using columns with the same name or the equal sign needed to equal raw data. I didnt want to change the column name, so i used the bindParam function to grab the reference number (i had the ref number data anyway because i populate a text field on the form with it when the page loads).
working code:
$insertStatement = $dbh->prepare("INSERT INTO [canpardata] ([sh-name], [sh-address], [sh-address2], [sh-city], [sh-state], [sh-zip], [sh-name2], [sh-phone], [c-lbs], [sh-email], [alt-reference1], [cust-po], [sign-req]) SELECT [Name], [Address], [Address2], [City], [State], [ZIPCode], [Attention], [Phone], [shipped-weight], [E-MailAddress], [ref-], [cust-po], [sign-req] FROM [ReplacementOrders] WHERE [ReplacementOrders].[refNum] = :refNum;");
$insertStatement->bindParam(":refNum", $refNum);
$insertStatement->execute();
this could probably go in the stupid questions thread too, but how does a c++ program or other low level language display an image? does it put each pixel in a 2d array and loop through it...?
you use some windowing API which interfaces with the operating system
well, yes, I'm aware the error is in the query... but as I said, your PHP code is still bad for not doing proper error checking (and hopefully you don't use PDO::ERRMODE_SILENT or PDO::ERRMODE_WARNING)
I don't think column names need to equal each-other or that mysql makes a difference between raw data parameters or parameters that come from something else in this case.
If you wanna find out what the actual issue was, you'll have to fix your PHP code first...
>I'm a programmer
>Oh yeah, what language?
>HTML and CSS
t b h I don't really get CSS
That depends on the environment you're running in
if you're running on a microcontroller or something like an atari 2600 or whatnot, there will be a memory-region from the GPU that is mapped into your main memory. Any byte you write into this memory-region will just end up on the screen like that. This is how things were done before modern computers, operating systems, ... and occasionally things are still done this way in very small embedded systems
If you're running on some operating system with some window management system (windows, linux (x11 or wayland), osx, ios, android, etc), you will first of all need to ask the operating system/windowing system to provide you with a window.
The windowing system will then provide you with a window (typically in the form of a "native window handle").
Then you may use varying APIs to draw inside this window. For instance you may ask the GPU driver to allocate an OpenGL context in this window, and then you may issue OpenGL calls to the GPU driver, which the GPU driver will forward to the GPU which will draw your commands into the window. No drawing of pixels is going on, typically.
If you want to draw in software (which is generally very slow, but can be the appropriate solution for some things) then you ask your windowing system to provide you with a surface. That surface may be directly mapped to some region in GPU memory, but typically it is at least double-buffered (and also these regions are all protected so that programs can't overwrite eachother etc.) Then you draw raw pixel values into this memory region, and afterwards you tell the windowing system to "flip the buffers" upon which it will put everything you've drawn onto the screen all at once.
The modern way is generally to use a hardware-accelerated API like OpenGL or Vulkan, so that all the actual pixel manipulations happen on the GPU, not on the CPU. But all toolkits like gtk, qt etc can also do it on the CPU, if only as fallback.
why is this yelling at me there's no instance for show Int-> Int-> Int? I just want it to show the result, which is an int
import Control.Applicative
import Control.Monad
import System.IO
main :: IO ()
main = do
n_temp Int -> Int
printFunction leftSum rightSum = abs (leftSum - rightSum)
leftDiagSum :: [[Int]] -> Int -> Int -> Int
leftDiagSum input place current -- start at 0
| place < length input = leftDiagSum input (place + 1) ((input !!place !! place) + current)
| otherwise = current
rightDiagSum :: [[Int]] -> Int -> Int -> Int
rightDiagSum input place current -- start at length of the input - 1
| place >= 0 = rightDiagSum input (place - 1) ((input !! place !! place) + current)
| otherwise = current
getMultipleLines :: Int -> IO [String]
getMultipleLines n
| n
>nigger posting
>ursel
>my man
I hate you.
...
Do you guys have anxiety over coding something unconventionally or inefficiently?
I've had this for years, I don't think it's ever gonna go away :(
i had it in a try catch but the error wasnt displaying. Oh well
...
Do you think OOP without inheritance would be ok?
...
I'm learning perl for my new job. I was a fullstack webdev for 2.5 years, but now i'm switching to CI platform development.
I will be happy soon :)