[ / / / / / / / / / / / / ] [ random / 55chan / komica / lumidor / magali / mental / nofap / x ]

/prog/ - Programming

Programming

Catalog  Archive

Name
Email
Subject
REC
STOP
Comment *
File
Password (Randomized for file and post deletion; you may also set your own.)
Archive
* = required field[▶Show post options & limits]
Confused? See the FAQ.
Options

Allowed file types:jpg, jpeg, gif, png, webp,webm, mp4, mov
Max filesize is16 MB.
Max image dimensions are15000 x15000.
You may upload5 per post.


File: 1438816683135.png (95.39 KB,680x478,340:239,093.png)

4026af No.2978 [Open Thread]

…syntax doesn't matter, but that's obviously bullshit, since programming languages are just another user interface.

However, is there serious research about effectiveness, readability etc pp.?

Not necessarily limited to programming, but also text in general?

2 posts omitted. Click [Open Thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4026af No.3004

>>3003

>Lisp user telling you syntax doesn't matter

They probably didn't know what they were talking about. Lisp's syntax is the major reason why it's so useful.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4026af No.3005

>>2991

>>3003

>>3004

That's all pretty dank and meme'd, but could we go back to topic?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4026af No.3030

Most likely the person who told you this was talking about abstract concepts, in which it isn't so much the syntax of the language you need to focus on, but the core idea. At least that is my best guess.

For example, you could describe rocket mechanics in English, German, or Russian, and while the syntax is different, the abstract concepts are the same.

It is possible that the language could inhibit your understanding of a concept, and this is a case where syntax does matter. For instance it would be quite hard to talk about rocket propulsion in Swahili.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4026af No.3031

Syntax matters for learning programming, which is why SICP chose a language with almost no syntax so you could focus on programming and not get hung up on whitespace/syntax.

Syntax also matters to Don E Knuth who invented literate programming so you wouldn't need comments (since almost nobody properly comments) and you could read a program like a book.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

4026af No.3910

>>2991

>Technically, every language capable of being turing complete is a programming language, so English could be a programming language.

True. But what separates languages from programmming languages is that they are not 100% literal.

>>3031

But that requires that there's no ambiguity in the names of the variables, yes?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1452381678522.jpg (61.78 KB,396x264,3:2,Linux .jpg)

46b5cd No.3839 [Open Thread]

Hello there people with no lives and girlfriends.

I've this question that I would like you to answer for me, please.

This Linux+ book came out just recently and I there is this other 2 books that are a bit older but not that much, should i buy the newest or not? I know new =/= good.

>1.CompTIA Linux+ / LPIC-1 Cert Guide BY Ross Brunson and Sean Walberg (thats the newest one)

http://www.amazon.com/CompTIA-Linux-LPIC-1-Cert-Guide/dp/078975455X/ref=sr_1_1?s=books&ie=UTF8&qid=1452380509&sr=1-1

>2.Linux+ Guide to Linux Certification 4th Edition by Jason W. Eckert (I was told it's good)

http://www.amazon.com/gp/product/1305107160?keywords=Linux%2B%20Guide%20to%20Linux%20Certification%20eckert&qid=1452380460&ref_=sr_1_1&sr=8-1

and finally…

>3. CompTIA Linux+ Study Guide: 2nd Edition by Roderick W. Smith (seems like everyone advises this one and that it's the best and easy to follow.

http://www.amazon.com/gp/product/1118531744?keywords=linux%2B%20roderick&qid=1452380558&ref_=sr_1_1&sr=8-1

Now what do you think guys?

ps before you mention RHCSA is much better, don't worry thats on my mind too but everything in its own time.

3 posts omitted. Click [Open Thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

46b5cd No.3879

>>3878

Getting a "Linux certification" means about as much as a B.A. in philosophy. All you need is to know your shit and preferably have a CS degree, and you can start making shekels.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

46b5cd No.3886

>>3879

What about CS degree + certifications?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

46b5cd No.3889

>>3886

degree + work expierence works much better

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

46b5cd No.3890

>>3886

>>3889

Needless to say since you likely won't have much if any experience right out of uni, the degree itself is still highly appealing to potential employers. Better than applicants with degrees in other fields or none at all.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

9355ac No.5270

alacrity

log into Anyone with password 0

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1453177111172.png (94.86 KB,337x450,337:450,403.png)

c6be61 No.3852 [Open Thread]

I wrote a python script to download images from tinyboard/vichan imageboards.

It works on every imageboard I try except 8ch, which gives me a 403 forbidden error. I tried changing my user agent within the script (perhaps unsuccessfully), but still 403. What gives?


#!/usr/bin/env python3

import argparse, bs4, os, urllib.request, urllib.parse

parser = argparse.ArgumentParser()
parser.add_argument("url", help="Link to thread")
parser.add_argument("-d", help="Directory to download to")
args = parser.parse_args()

if args.d:
if not os.path.exists(args.d):
os.makedirs(args.d)
os.chdir(args.d)

soup = bs4.BeautifulSoup(urllib.request.urlopen(args.url))

domain = urllib.parse.urlparse(args.url).netloc
http = urllib.parse.urlparse(args.url).scheme + "://"

for link in soup.find_all("p", class_="fileinfo"):
image = http + domain + link.next_sibling.get("href")
filename = image.rsplit("/", 1)[1]
if not os.path.exists(filename):
urllib.request.urlretrieve(image, filename

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c6be61 No.3853

Note that I accidentally removed a parenthesis to close the very last line.

- urllib.request.urlretrieve(image, filename

+ urllib.request.urlretrieve(image, filename)

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c6be61 No.3882

>>3852

If I had to guess,

>image = http + domain + link.next_sibling.get("href")

href of link is is https://media.8ch.net/prog/src/1453177111172.png for 8chan. Look at in in a page inspector.

I think it's because hotwheels has some weird hacky shit with the servers due to bui and/or site growth.

You might have figured this out by yourself already, since this was a while ago.

I might try writing my own version in javascript or bash for 8chan specifically. I'll prob post it here if I do

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

c6be61 No.3883

>>3852

If I had to guess,

>image = http + domain + link.next_sibling.get("href")

href of link is is https://media.8ch.net/prog/src/1453177111172.png for 8chan. Look at in in a page inspector.

I think it's because hotwheels has some weird hacky shit with the servers due to bui and/or site growth.

You might have figured this out by yourself already, since this was a while ago.

I might try writing my own version in javascript or bash for 8chan specifically. I'll prob post it here if I do

fak you flood detection

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1453522198030.jpg (27.65 KB,311x475,311:475,SICM.jpg)

f720d4 No.3862 [Open Thread]

Hey /prog/, I'm looking for some compsci-related physics books other than pic related. Discovered it thanks to the godlike sticky.

Even RMS got his B.A. in the field. There must be at least a few others that are useful for programmers.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f720d4 No.3863

>>3862

P.S. I already checked out /sci/'s directories, and I didn't see any undergrad textbooks worth the gorillion shekels they usually go for. Nor did I find any good paperback texts akin to "What is Mathematics?" (R. Courant) or "How to Solve It" (G. Polya).

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

f720d4 No.3872

>>3862

> compsci-related physics books

you mean computational physics? that is heavy numerical analysis for physics problems solutions?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1453418162765.jpg (19.9 KB,225x350,9:14,292080.jpg)

78ff58 No.3859 [Open Thread]

/prog/, have you worked on a distributed extensible autonomous REPL before? How would I go about it?

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

78ff58 No.3867

What the fuck does that even mean?

How would you make an autonomous REPL? Autonomous means self functioning without input. A REPL is a user input/output interface.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

78ff58 No.3870

>>3859

i am actually working on the same thing. have you done any work at all. maybe we can collaborate

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

78ff58 No.3881

>>3859

>distributed extensible autonomous REPL

This sounds like a manager trying to buzzwordily say "AI hive mind" who only sort of knows what each word means.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1451939639934.jpg (57.03 KB,851x315,851:315,Anonymous One Team To Save….jpg)

1b208c No.3807 [Open Thread]

ADVANCED HACKING TOOLS.zip DOWNLOAD

https://archive.org/details/ADVANCEDHACKINGTOOLS

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1b208c No.3850

>>3807

Thanks

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1b208c No.3851

omg thx op i cum on cat she hiss at penis

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1b208c No.3854

>not just downloading Backtrack

Anyone that downloads this is an idiot and has no business doing what they are attempting to do.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1b208c No.3868

>>3807

oh boy I can finally be a hacker

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1b208c No.3869

/prog/ humor, like /tech/ humor except several orders of magnitude slower.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1451855068740.gif (454.97 KB,242x318,121:159,Stu Loses Control.gif)

a13374 No.3804 [Open Thread]

How plausible is finding a remote job as a middle C++ dev?

One of my internet buddies works through upwork, but based on what I've heard from him, it's not very pretty. Remote jobs are mostly web-related and very few job propositions that are there quite often are small, low pay contract jobs that have tons of indians competing, promising that they'll make it for free and this instant.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a13374 No.3806

>>3804

I'd recommend using upwork as something you just regularly keep up with, but don't be in any rush to land work on it, because you'll either end up under selling your work or giving up out of frustration.

I know people who have found solid clients that they regularly work with from there and I would say I get contacted by what I consider to be legit companies once every couple months and I don't even network there, that is just from companies finding my profile.

You just have to position yourself as professional software developer who is interested in finding the ideal client, you're not some desperate curry nigger who will work for third world wages.

Unfortunately, it will take some time and you'll have to keep at it, but once you find a few legit clients, it is all worth it.

If you're needing to pay the bills right away, then obviously you're just going to have bite the bullet and find whatever you can locally.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a13374 No.3812

>>3806

Can you give me some advice on making my profile?

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

a13374 No.3842

>>3812

Stuff it with keywords relevant to the types of work you'd like to do so when they're searching for contractors your profile shows up.

Just talk about your experience, your knowledge, the type of work you are capable of doing and the type of opportunities you are personally interested in. Mention that you are a native english speaker because this will matter to your ideal clients.

Include a picture regardless of your opinion of your looks, just like on dating sites, profiles with pictures draw more attention.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



5eb464 No.3829 [Open Thread]

Alright, faggots. You're going to take a first-year computer science class at MIT.

https://www.edx.org/course/introduction-computer-science-mitx-6-00-1x-6

Register. It starts next week.

>But Python is for plebs!

Well, good thing that Harvard is running a course that uses C and recommends Linux. No excuses. This one is even self-paced.

https://www.edx.org/course/introduction-computer-science-harvardx-cs50x

>But muh blub languages

I SAID NO EXCUSES. Here's a course that uses Scheme. This one is also self-paced.

https://www.edx.org/xseries/systematic-program-design

Those are your choices. If you don't choose any of these, you're a lazy sack of shit.

Even if you already know the basics of programming, you will almost definitely get something out of these if you haven't had a formal education yet.

If we do it together, we can make threads about it and encourage each other. I'm doing the third one, and I've been programming for 2 years.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

5eb464 No.3836

Sure.

I'll join you through Systemic Program Design.

I'm going to check out the Harvard one, I initially passed on it because it seemed like they use a multiple languages meant they wouldn't really get that deep into the subject, but the reviews seem to be very positive.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

5eb464 No.3837

>>3836

the use of multiple languages*

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

5eb464 No.3840

>>3836

It's pretty popular. I was talking to a woman at my university who helps put things on EDX, and she had heard of it and wanted to take it.

I started on it last year, but life got in the way. From what I saw it was pretty good, but obviously it's still only a first year introductory course. I would have been taking it this time, but I just couldn't resist a modern course in Scheme.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1452310435251.png (145.99 KB,1920x1125,128:75,based.png)

6aff7f No.3833 [Open Thread]

Guys, I had this script which enabled me to make my computer write whatever I chose, using Chrome. It no longer works. Why? and how to fix it?

I'll copypasta the script in the thread.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

6aff7f No.3834

Here's the post from the anon who taught me how to do this:

in google chrome do this:

1. press ctrl-shift-j

2. paste this script, DO NOT FUCKING HIT ENTER YET

(function() {

var text = prompt("Enter some text.");

var width = $(".active-cursor").width();

var height = $(".active-cursor").height();

var start = $(".active-cursor").offset();

var current = {

top: Math.round(start.top + height / 2),

left: Math.round(start.left + width / 2)

};

var i = 0;

function next() {

var c = text.charAt(i);

if (c === "\n") {

current.left = start.left;

current.top += height;

} else {

$(document.elementFromPoint(current.left, current.top)).click();

w.typeChar(c);

current.left += width;

}

i++;

if (i < text.length) {

setTimeout(next, 10);

}

}

next()

})();

3. copy the ascii you want to post

4. press enter, a prompt will come up, paste your ascii into the prompt

5. profit!

for repeat pastes you only need to go to the java console and press the up arrrow, it will recall the last script you used even if you have closed chrome and opened it again

if you don'Post too long. Click here to view the full text.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

6aff7f No.3838

>>3834

What is the error message you are getting in the javascript console?

I'm getting a TypeError: cannot read property 'top' of undefined.

That 'undefined' is start.

$('.active-cursor').offset() returns undefined when I try to run your script

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1451590124908.jpg (46.65 KB,500x670,50:67,starfox.jpg)

18059a No.3787 [Open Thread]

Lads I have been trying to teach myself c++ and this exercise from my book is driving me crazy!

"Write a program in which you create a Text class that contains a string object to hold the text of a file. Give it two constructors: a default constructor and a constructor that takes a string argument that is the name of the file to open. When the second constructor is used, open the file and read the contents of the file into the string member object. Add a member function contents() to return the string so that you can display it. In main(), open a file using Text and display the contents."

I have a full solution that compiles but does not actually store any information from the inputed file (it prints empty lines or sometimes a single } )

http://coliru.stacked-crooked.com/a/d1ab2c2ad4e1b05d

Help me obi-wan you are our only hope

4 posts and 1 image reply omitted. Click [Open Thread] to view. ____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

18059a No.3795

>>3792

It's a great example of why you should never write it either his way or the way you suggested - it's so easy to accidentally leave a stray line terminator in that changes the logic. A better style is


while(...) {

as it resists these types of bugs (which are actually rather common in real code by good programmers). People get super stubborn about this even though this style is objectively better due to the lowered error rate. It's also a good example of why python got it (mostly) right with its spacing.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

18059a No.3799

>>3795

> this style is subjectively better

> FTFY

If you use Allman style and always use braces, even when there is only one statement, then you don't make these sorts of errors.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

18059a No.3831

The first thing you should do is fix all warnings and then quickly go fuck yourself for not using plain C.

Also write in some if statements to check whether or not you variables actually have any /value/.

guday m8

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

18059a No.3832

>>3795

Or you could format code in a decent way and not be a retard/faggot.

If you are used to writing shit this way you shouldn't have errors. It also makes you look 1337 as fuck.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

18059a No.3856

>>3792

Never Python. Not even once.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1452304624517.jpg (43.29 KB,526x526,1:1,kista.jpg)

6e4d85 No.3830 [Open Thread]

i need some serious help. i was in court today and the prosecutor asked the secretary if it was possible to run the vin and see when that vehicle had insurance and when it was canceled and so on. she said no. got me thinking if i can write a code and bring it maybe i can get off. what language would be best for this do you guys think. basically i need the prog to have a search bar to put in the vin. then i need it to search the databases of the insurance companies (with permission of course) just wondering what language and where i should start. writing the code or getting permission. i think i should write the code show it to them then they can get the companies databases since they wouldnt want to give it to a criminal. please help. here is a pic of my baby shaking her bones to trey and the gd at fare thee well gd50

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

6e4d85 No.3835

>(with permission of course)

You won't get direct access to the database, ever. Even if you have a court order for something from the database, they won't give you access, they will instead search the database themselves and then give you only the data that was specifically ordered. Don't even write a single line of code until they give you an account on a database server.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

6e4d85 No.3848

This thread is retarded. Insurance company databases don't just sort of have public interfaces you can plug into to pull arbitrary information about arbitrary VINs. You would have to either contact the company and have them give you the information or get the info off their website customer portal.

Furthermore, if there was a standard public interfaces for this, there would already be 50 different programs to pull the information.

It's pretty telling that you only describe the search function as "have a search bar". You either have no idea how to program or just know minimal bits of web design.

This is " code a GUI in Visual Basic to trace the killer's IP" level of retarded.

tl;dr: not only is it not possible, you also have no idea what you're talking about in the first place.

Your baby is a hippy retard and you probably are too, fuck back off to Reddit r/reiki/ or whatever stupid fucking spirit science board you come from.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1450844390813.jpg (38.85 KB,475x740,95:148,lfd.jpg)

8298ef No.3752 [Open Thread]

Hello /prog/,

I would like to start off this new year by committing to learning at least 1 new, major library or SDK. Why only 1 library for the year? This way we don't end up hopping from library to library without gaining any real skill. This way we get to master it.

I suggest these:

>Android (make mobile apps, make money!)

>OpenCL (accelerate your computation, put that graphics card to better use!)

>Qt (gui's and so much more!)

>SQLite (master your data!)

Alternatively, it would also be very useful for any anons looking for a job to master machine learning techniques. I was thinking of working through pic related for starters. Would any anons be interested in learning neural nets / svm's / relevant tools, techniques, and libraries instead?

Who else would be interested in this? Are there any very useful, very practical libraries you would recommend beyond those listed?

After we settle on a library / learning we work through it for the year, post code, results, ideas, advice, explanations, and keep each other motivated.

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8298ef No.3776

how about

>have an actual goal

>learn what you need in order to achieve that goal

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8298ef No.3780

>>3752

I've just started learning Android development.

I'm stating off with the free Udacity course. It's way slower than I'd like as it is designed for complete programming noobs, but it's material seems to be comprehensive, as I've had little problem following along and building the simple apps.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

8298ef No.3786

>>3780

yes same here, just starting out but i've made some simple apps.

maybe we should make this an android app coding thread. and we try to make the most interesting apps and share them.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



File: 1451330733539.png (348.7 KB,540x396,15:11,12391045_847259475371410_1….png)

1a6620 No.3775 [Open Thread]

I need help. I am working on a text editor for mobile and its a hybrid app, so its made with web technology. Everything is fine and all until I want to make a button that bolds future text, kind of like in Word. But I can only find one that makes everytext in the text area bold. This is not what I want. I cant find any help on how to do this in Javascript/Jquery on the internet.

This is what I have with jquery and jquery mobile:

$("#bold").on("tap",function(){

$(".editor").toggleClass("bold");

});

It makes every text in the editor bold. I want to make only future text bold.

Can someone help me?

Thank you

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1a6620 No.3777

>text editor

>bold

well you're off to a bad start.

In order to do this, you can't have a single text area. when the user clicks bold you need to add a new DOM element with a bold style, and you need to handle mouse-clicks, arrow movement, selections, etc., to make your dense list of DOM elements function like a single area. it's a tremendous amount of work for literally no payoff: your users would be just as happy typing [b]blah[/b]

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

1a6620 No.3778

>>3777

Ahh so what your saying is when a user clicks the bold button, I'll need to replace the text area in the background? That sounds like a lot of extra work but nothing too bad to be honest.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



9d5869 No.2970 [Open Thread]

Bring all dirty, disgusting and generally cancer code here.

I start

http://pastebin.com/DYCcxWER

Because "Hello, World!" is too mainstream

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

9d5869 No.3769

>>2970

Got a laugh out of me

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



7b3b8e No.3760 [Open Thread]

This seems to be the best board for this question, what are the most important Terminal commands to know? So far, I only know the following.


pwd
ls
cd
sudo -i
vi(m)
apt-get install
gcc -o file *.c

____________________________
Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

7b3b8e No.3761

grep

sed

find

awk

make

ed

man

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.

7b3b8e No.3763

The most important terminal commands are

[code]\n

\r

\e[30m thru \e[37m

\e[40m thru \e[47m

\e[1m

\e[0m

\e[2J

\e[?25h and \e[?25l

\e[n;mH with n and m as coordinates

\e[s and \e[u

\e[n;mr with n and m as the top and bottom row[code]

That last one is pretty killer.

inb4 curses. You may as well use a fucking web browser.

Disclaimer: this post and the subject matter and contents thereof - text, media, or otherwise - do not necessarily reflect the views of the 8kun administration.



Delete Post [ ]
[]
[1] [2] [3] [4] [5] [6] [7] [8] [9]
| Catalog | Nerve Center | Random
[ / / / / / / / / / / / / ] [ random / 55chan / komica / lumidor / magali / mental / nofap / x ]