What are you working on, Sup Forums?
Old thread:
What are you working on, Sup Forums?
Old thread:
Other urls found in this thread:
cprogramming.com
github.com
pastebin.com
twitter.com
I love you guys.
I have a little snippet I took from a bigger program
#include
int main(){
int a;
double b, c;
std::cin >> b >> c >> a;
std::cout
D
Who /web/ here?
It's not gay to love guys, is it?
so, i have this project structure on windows
my_program.cpp
/library
- apv32.dll
- apv32.lib
- apv++32.dll
- apv++2.dll
- lib32.dll
- LIB32.dll
- ap.h
- apv.h
- apv2.h
how do i compile with the "my_program.cpp" with the contents of the folder library?
i did
g++ my_program.cpp -I library/
to include all the files in the library folder
but doesn't work
tl;dr how to include folders in the compilation of c++ programs on windows
how 2 do that?
function = no state and definite output?
I do like
g++ -o test.exe test.cpp -I "C:\includes\moreincludes"
Not if you're a girl, no.
You didn't give a 'a' value
>tfw no trap gf to love tenderly while programming together and exchanging saliva
nope, the value is given via cin. Like I said, it works correctly in linux (or at least it doesn't yield a bad answer), but not in windows with the same command
>a 'a'
'a' a
Keep headers separate from libraries
Include the headers directory with -I
Include the libraries directory with -L
Yeah I see that now. Weird. Maybe it Microsoft's compiler reads the variables sequentially
why is everyone here a noob at programming?
Go to bed, wino. If you don't you'll just feel worst tomorrow.
We have plenty of people here who know their shit
I haven't seen one decent project here by any of the posters
hello newfag
That happens if you've only been here one day
go ahead name one
well, it wasn't so hard, but I don't have an explanation: removing those "" works on windows, so the command would be:
echo 1 2 3 | test.exe
command line in windows sucks hard
That guy who's written a Sup Forums browser in 20,000 lines of BASIC.
Where? post it I want to believee
It's not mine, you derp. Who in their right mind would write 20k lines of BASIC?
One guy's working on a VM, it's either in the last thread or the one before it
Most people here pick functional languages in the hope to become better coders. When they realize that it's not the magic recipe they begin doing what you are doing right now.
This guy's writing and assembler:
I am an object oriented programmer since I know the best way to manage medium to large programmers is by OOP
At what weight does a medium programmer become a large programmer?
do the .dll files have to be in the path of the system in order for me to compile with the libraries?
i tried what you said
g++ my_program.cpp -o out.exe -I heades -L library
and still no luck
sorry I meant medium to large projects
finally a decent project that is pretty cool actually
What are people making that isn't web based these days besides video games and mobile apps?
compilers
programming languages
kernel drivers
There aren't enough rust programmers here
I'm working in a cool project, but if I post it here I will stop being anonymous and don't want to be found that I browse Sup Forums for its strong relation with Sup Forums
i'm writing lightweight encryption software for shits and giggles
>heades
what kind of project is it? What is so bad about that? What would happen?
Sorry, -L should point directly to the library, not its containing folder
cprogramming.com
Google it if you're still confused, it'll be good for you
300 lbs.
Trying to make a Sup Forums board parser and am currently using the Sup Forums API (here: github.com
How do I even begin to organize the data?
Here's what I have so far:
import json
from urllib2 import urlopen
url = "
from json import dumps
dumps(text, indent=4)
You have successfully written (imported) a parser.
What do you want to do with the data.
i'm on windows
on my mingw folder i have
glu32.dll
glu32.lib
glut32.dll
glut32.lib
opengl32.dll
OPENGL32.lib
yet when i do
g++ opengl_program.cpp -lglu32 -lopengl32 -lglut32
it outputs
....../mingw32/bin/ld.exe: cannot find -lglut32
how the fuck it cannot find glut32, but the other libraries i included finds them?
fuk lads im leaving the board forever.
It was four spaces right?
//test
//test
[ code ] tags, look into the pinned thread on the first page.
Wakabamark-less boards suck indeed.
g++ -I ./library -L ./library
You will still have to link against the dlls with the -l flags (that's a lower case L). When the filename begins with "lib" as in libSDL2.dll, you'd use it like -lSDL. Otherwise, you'd use it like -l:apv32.dll
By the way, if those DLLs were compiled with MSVC++, you're going to have issues trying to link them in with g++. They use different name mangling schemes.
For now, I just want to get used to parsing JSON with Python. Something I'd want to do is to pass in a string argument and displays the threads with that contains the string as a subject (ie, searching for "dpt").
Eventually, i want to make a Sup Forums desktop browser (similar to clover for android)
Adding FLIF support to my taggable image viewer Ivy. It's mostly done, I just need to do some testing and some other busywork before I can call it complete.
Say you want to get all digits from a string, then add them back in the correct position.
How would you do that without arrays?
You are reading this tutorial wrong. In the tutorial, libfoo.so is located at /home/username/foo/libfoo.so. Therefore, you must use -L/home/username/foo (the folder containing the library) and -lfoo (the library itself).
You *have* parsed the JSON with that code. What you've called 'text' is the Python object that contains all the data.
Do this: And figure out where your thread names are within the object.
you again?
post input and output examples, so i can know what the fuck you talking about
>HEADES
thanks! it works now
forgot an r
>HEADE-->r
i'd do something like
do {
if (isdigit(str[n])
num = (num
Simple shit for an assignment - got full marks because we were only supposed to be marked for changing the colour of a div with Javascript.
Change background
Move box
Change content of paragraph
var box = document.getElementById("box");
var bgBtn = document.getElementById("bgBtn");
var moveBoxBtn = document.getElementById("moveBoxBtn");
var changeParaBtn = document.getElementById("changeParaBtn");
(function(){
window.alert("JavaScript is in use!");
}());
bgBtn.addEventListener("click", changeBackground, false);
function changeBackground(){
if (box.style.backgroundColor === "red"){
box.style.backgroundColor = "blue";
}
else {
box.style.backgroundColor = "red";
}
}
moveBoxBtn.addEventListener("click", moveBox, false);
function moveBox(){
if (box.style.left === "0px"){
box.style.left = "50px";
box.style.top = "50px";
}
else{
box.style.left = "0px";
box.style.top = "0px";
}
}
.
My problem is that clicking on "Move box" button does nothing for the first click then proceeds to work as intended.
Any reason why?
"Th1s 1s a t3st str12ng" as input, without numbers you should get "Th s s a t st str ng"
I get that you can just make it replace the numbers in the string with " " and save its position. However, when I try to put them back in order I get an out of bounds exception.
No problem, user.
what language?
C#
Full thing listed here - any pointers would be greatly appreciated.
Also note that the string for numbers and position are both the same length.
Position: "1 6 12 22"
Number: "3 3 8 5 ";
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace tonguemyanus
{
public class Program
{
public static void Main(string[] args)
{
string s = "Th1s 1s a t3st str12ng";
string s1= Regex.Replace(s,"[^A-Za-z_]"," ");
System.Console.WriteLine(s1);
}
}
}
output
Th s s a t st str ng
1. Use the debugger.
2. Inspect box.style.left before you click the button for the first time.
3. ?????
Main problem is getting the numbers back into the string at the correct position
Some people, when confronted with a problem, think “I know, I'll use regular expressions.” Now they have two problems.
4th step is profit thanks
>problem
you just have to save its position, for example in a hash map or something
because the very original box needs to be positioned properly in the top left corner
save the position in a tuple (or some other data structure)
List nums = new List();
var index = 0;
var output = "";
input.ToList().ForEach(c =>
{
if (char.IsDigit(c))
{
nums.Add(new Tuple(index, c));
output += " ";
}
else
output += c;
index++;
});
then iterate through the tuples and insert the numbers back in
nums.ForEach(n =>
{
output = output.Substring(0, n.Item1) + n.Item2 + output.Substring(n.Item1 + 1);
});
Here's the CSS in full.
#container{
width: 500px;
height: 300px;
border: 2px solid black;
position: relative;
background-color: #C9FFA2;
}
#box{
position: absolute;
width: 50px;
height: 50px;
background-color: blue;
left: 0px;
top: 0px;
}
.myButtons {
background-color: #252781;
border: none;
color: white;
padding: 10px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 6px;
}
.myButtons:hover {
background-color: #008CBA;
}
Hey i got a question
is this a college assignment or other thing?
i was looking to learn javascript and this looks neat to learn
I hope that the browser of those "web app devs" explodes, web apps are a threat to humanity and fellow programmers.
Alright... So the JSON is stored as a dictionary of unicode characters (or is it a list of dictionaries of unicode characters?), but I'm having trouble thinking of how to iterate through each "bracket" object and print out the subjects of each thread (or at least a tutorial where I can practice this)
I did, see The problem is that I get an out of bounds exception when I go through the string.
Should I go through the string of positions, check for digits, convert them and add the corresponding number to the string?
Position: "1 55"
Number: "4 7 "
Check if the number on position i in position is two digits, multiply the first by ten and add the second, use that as the index for the string, and use i on numbers to get the number on that index.
Is that correct, if you know what I'm trying to say?
box.style.left is not "0px" by default
`` javascript
console.log="100";
``
It's an assignment (THAT WAS ALREADY GRADED THIS IS EXTRA). I'm currently in college for this stuff, yeah.
The glu32 and glut32 libraries might conflict with each other.
test
making flask web app. untested code to yank a post with comments and comments of comments.
def loadPost(post_id):
db = get_db()
# retrieve post
cur = db.execute('SELECT * FROM posts where posts.id=?', [post_id])
post = cur.fetchone()
# get comments
cur = db.execute('SELECT * FROM comments where comments.post_id=? ORDER BY posts.date DESC LIMIT 5', [post_id])
postComments = cur.fetchall()
# store comments [(comment, [comments])]
comments = []
# get comments of comments
for comment in postComments:
cur = db.execute('SELECT * FROM comments where comments.comment_id=? ORDER BY posts.date DESC LIMIT 5', [post_id])
commentsOfComment = cur.fetchall()
commentRepo.append((comment, commentsOfComment))
cur.close()
return render_template('index.html', post=post, comments=comments)
Thanks! Just added it in. Great help, guys.
Again, you didn't give me marks for an assignment it was an already-graded lab quiz for the colour change.
box.style.left="0px";
box.style.top="0px";
moveBoxBtn.addEventListener("click", moveBox, false);
function moveBox(){
if (box.style.left === "0px"){
box.style.left = "50px";
box.style.top = "50px";
}
else{
box.style.left = "0px";
box.style.top = "0px";
}
}
I have done all that web dev stuff before it's all about experimenting
ah I missed that. Split your strings into arrays/lists and then work from there
var positions = Position.Split(' ').ToList();
var numbers = Numbers.Split(' ').ToList();
for(int i = 0; i < positions.Length; i++) {
//logic to insert number[i] into position position[i] of the output
}
guys I seriously thought it was only a dumb meme.
ifelifififelifelifelififelifififelififif
I'm sorry, if this was done with arrays, it wwould be easier, but the professor wants it without. Is my logic correct though?
i, ii, iii, n = '', '', '', n.split(" ")[0]
i feel like this shouldn't be allowed
i see nothing wrong with this code
Take a closer look Pajeet
still don't see it
You mentioned parsing the number in position and then adding that back to the string, but I think you want to parse position AND number then add the number to the correct position. Otherwise yea, your logic makes sense.
It might be easier to just look through the string until you hit a space, then int.Parse() whatever you get rather than reconstructing the numbers yourself. That way you can handle positions of any size rather than
I'm going to start using Windows more, and want to use gcc. Any reason why I shouldn't use MinGW over cygwin?
Why not Linux in a VM?
Through the position string? Does it parse correctly for multiple numbers?
So I check if it's either one, two or more numbers, then parse the either, one, two or more? I feel like I'm misunderstanding you.