[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / w / wg] [i / ic] [r9k] [cm / hm / y] [3 / adv / an / cgl / ck / co / diy / fa / fit / hc / int / jp / lit / mlp / mu / n / po / pol / sci / soc / sp / tg / toy / trv / tv / vp / x] [rs] [status / ? / @] [Settings] [Home]
Board:  
Settings   Home
4chan
/g/ - Technology
Text Board: /tech/


Posting mode: Reply
Name
E-mail
Subject
Comment
Verification
reCAPTCHA challenge image
Get a new challenge Get an audio challengeGet a visual challenge Help
File
Password (Password used for file deletion)
  • Supported file types are: GIF, JPG, PNG, PDF
  • Maximum file size allowed is 3072 KB.
  • Images greater than 250x250 pixels will be thumbnailed.
  • Read the rules and FAQ before posting.
  • このサイトについて - 翻訳
  • You may highlight syntax and preserve whitespace by using [code] tags.


New HTML/CSS rolled out two weeks ago. Be sure to check out the new mobile-optimized layout for phones, and inline extension features.

We also added two new themes (first time in 4.5 years!). Thanks to seaweed for porting them over from OneeChan!

We are still working through a few bugs with the new code. Please report any bugs you find to newhtml@4chan.org.

File: 1338123966023.png-(42 KB, 757x238, Screen shot 2012-05-27 at 15.05.45.png)
42 KB
Testing code snippets.

DecayNetworkPlot[s_, size_, ratio_] :=
LayeredGraphPlot[
Sort[
Select[
Transpose[
{Network[s], DecaySymbols[s, 12]}
], (Not[#[[1, 2, 1, 1]] === Missing["Variable"]] \[And]
Not[#[[2, 1, 1, 1, 1, 3]] === "SF"]) &
] // Quiet
],
VertexLabeling -> True,
ImageSize -> size,
AspectRatio -> ratio,
PlotRangePadding -> 0,
VertexRenderingFunction -> (Text[
Framed[Style[#2, 8], Background -> LightYellow,
RoundingRadius -> 5], #1] &)
]
>>
>wrong # character parsing
>too narrow code block
5/10 it's a start
>>
>>25130148
How does one do it?

int main()
{
return 0;
}
>>
it's all in the sticky.
>>
if ($tell == 1) {
my $delete_query = "DELETE FROM tell WHERE UPPER(tonick)=UPPER(?)";
my $delete_handle = $dbh->prepare($delete_query);
$delete_handle->execute($user);
$tell = 0;
}
$dbh->disconnect;

if ($chat =~ /(\S+)(\+\+)(\s.*)?$/ || $chat =~ /(\w+)(--)(\s.*)?$/) {
$type = 2;
$output = "$2 karma assigned to $1!";
}
>>
>>25130177
 and closing with 
.

It's in the sticky for god's sake
>>
>>25130197
>sticky
This is what I get for using catalog.neet.
>>
//test
int test;
void test()
{
return test; //test
}
>>
//test
int test;
void test()
{
return test; //test
}
>>
>>25130114
package main

import "fmt"

func main() {
fmt.Println("Code tags test thread.")
}
>>
Shit:
#include <iostream>

using namespace std;

int main()
{
int priv=0, pri=0;
cout<<"Input privilege points, enter \"-99\" when finished: \n";
while(pri!=-99)
{priv+=pri;
cin>>pri;}
cout<<"Privilege level is "<<priv<<"."<<endl;
return 0;
}
>>
Is this only on /g/?
>>
while OP == a faggot {

install gentoo
}

return fag;

}

>>
 I Like White Backgrounds 
>>
>>25130286
#include <iostream>
using namespace std;

int main()
{
cout << "Yes." << endl;

return 0;
}
>>
And you had to make a new thread about it?

Typical ricing scum.
>>
msg * Hi /g/ am I a programmer yet?
>>
Something I wrote a few days ago
[CODE]
#include "event.h"
#include "events.h"

// note: "events" is declared in events.h, which is a global stream of type Event

class Izanami {
private:
Event eventA;
Event eventB;
Event eventType;
Event eventWanted;

public:
Izanami(Event eventMatch, Event eventWanted) {
this->eventMatch = eventMatch;
this->eventWanted = eventWanted;
}

void scan() {
begin();
end();
}

void run() {
Event e;
do {
e = events.getNext();
if (e.match(eventB)) {
events.clear();
events.pushFront(eventA);
}
} while (!e.match(eventWanted));
}

private:
void begin() {
eventA = scanUntil(eventMatch);
}

void end() {
eventB = scanUntil(eventMatch);
}

Event scanUntil(Event event) {
Event e;
while (true) {
e = events.getNext();
if (e.match(event)) {
return e;
}
}
}
};

int main(...) {
Event trigger("[Sword] Hit: Itachi");
Event wanted("[Mind] Change: Kabuto");
Izanami i(trigger, wanted);
Izanami.scan();
Izanami.run();
return 0;
}
[/CODE]
>>
test
>>
File: 1338124950570.gif-(277 KB, 200x308, tetra.gif)
277 KB
>>25130331
Well, turns out [ code ] is case sensitive. Good to know.
>>
>>25130331
>>25130345
4chan x ruined these posts
>>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

Just testing width.
>>
File: 1338125024346.jpg-(83 KB, 680x680, f5753870a40ccef114a6cb88e7f485(...).jpg)
83 KB
>>25130270
>>
this post contains non-breaking spaces
>>
>>25130362
12345678901234567890123456789012345678901234567890123456789012345678901234567890
>>
>>25130380
Not anymore.
>>


>>
GUYS
GUYS
I figured out how to do it!

  



THANK YOU BASED MOOT
>>
>>25130430
 

>>
>>25130114
bool fag = true;
while(fag)
{
cout << "OP is a fag." << endl;
}
>>
>>25130331
#include "event.h"
#include "events.h"

// note: "events" is declared in events.h, which is a global stream of type Event

class Izanami {
private:
Event eventA;
Event eventB;
Event eventType;
Event eventWanted;

public:
Izanami(Event eventMatch, Event eventWanted) {
this->eventMatch = eventMatch;
this->eventWanted = eventWanted;
}

void scan() {
begin();
end();
}

void run() {
Event e;
do {
e = events.getNext();
if (e.match(eventB)) {
events.clear();
events.pushFront(eventA);
}
} while (!e.match(eventWanted));
}

private:
void begin() {
eventA = scanUntil(eventMatch);
}

void end() {
eventB = scanUntil(eventMatch);
}

Event scanUntil(Event event) {
Event e;
while (true) {
e = events.getNext();
if (e.match(event)) {
return e;
}
}
}
};

int main(...) {
Event trigger("[Sword] Hit: Itachi");
Event wanted("[Mind] Change: Kabuto");
Izanami i(trigger, wanted);
Izanami.scan();
Izanami.run();
return 0;
}

This thread is now in an Izanami loop


>>
>>25130463
fucking naruto
>>
>>25130307
Install oneechan, code blocks are styled.
>>
 

>>
Testing python
class Foo:
def __init__(self, bar):
this.bar = bar
def foobar:
print this.bar

def generator(n):
for x in xrange(1, n + 1):
yield x ** 2

foo = Foo(12)

for n in generator(foo.bar):
print n
>>
NIGGER NIGGER NIGGER NIGGER
>>
>>25130463
scrollbars, nice
6/10 the score has risen
>>
File: 1338125721545.png-(37 KB, 523x359, 2012-05-27-153440_523x359_scro(...).png)
37 KB
>>
>>
(defun when-moot-when ()
(dotimes (n 100)
(format t "COMMON LISP WHEN?")))
>>
>>
File: 1338125782288.png-(146 KB, 1920x1080, good.png)
146 KB
Looks good.
>>
>>
File: 1338125816805.png-(14 KB, 395x147, 2012-05-27-153630_395x147_scro(...).png)
14 KB
>>25130489
beautiful
>>
>>25130555
Dats pretty.
>>
        private static int CompareByInteger(IWzImageProperty val1, IWzImageProperty val2) {
int val1Int = Convert.ToInt32(val1.Name);
int val2Int = Convert.ToInt32(val2.Name);
if (val1Int < val2Int) return -1;
else if (val1Int > val2Int) return 1;
else return 0;
}
>>
>>25130555
That looks good. Link?
>>
>>25130583
Where the fuck is my syntax highlighting?
namespace test
{
public class test
{
public static void test()
{
int i = 0;
Console.WriteLine("Hi");
}
}
}
>>
>>25130612
Refresh the page.
>>
>>25130622
derp
>>
File: 1338126150235.gif-(327 KB, 500x281, laughing-at-you.gif)
327 KB
>>25130612
>shit-tier language getting syntax highlighting
>>
>>25130589

It's on userstyles dot org as "4chan Dark Candy -- New 4chan HTML Style".
>>
they mad
>>
>>25130642
Gracias, signore.
>>
>>25130641
>yes it's shit tier because it's meant for windows only
>which is the majority of the market share
heh
>>
(print '(Testing common lisp quoting))
>>
>>25130660

>Lots of people use it therefore it's good

https://en.wikipedia.org/wiki/Argumentum_ad_populum
>>
>>25130694
>lots of people use it therefore it's important enough to get syntax highlighting
>>
>>25130692

Should have known it wouldn't work correctly with Lisp.

(defun median (x)
(let* ((len (length x))
(lst (sort x #'<))
(a (ash len -1))
(b (1- a)))
(cond ((= len 0) ())
((= len 1) (car x))
((oddp len) (nth (ash len -1) lst))
(t (float (/ (+ (nth a lst) (nth b lst)) 2))))))
>>
>>25130706

Moving the goalposts, are we?
>>
>>25130741
I am not the same Anon. >>25130641 was still a dumb thing to say.
>>
>>25130694
Whether or not it's good is based more on how a user can apply the language, but it's certainly not shit. The only issue I see with it is that it's far slower, however it's more convenient to program in.
>>
>>25130327
#include <stdio.h>

int main()
{
int i;
char string[5][12]={"not.","are","you","faggot,"&
#44;"No"};

for(i=4;i>=0;i--)
{printf("%s ",string[i]);}
printf("\n");
return 0;
}
>>
>>25130660
It's shit tier because it's non-portable. Whether the system it can only run on is the most popular or fucking as obscure as Haiku is irrelevant.
>>
>>25130817
http://www.mono-project.com/
>>
>>25130765

>The only issue I see with it is that it's far slower, however it's more convenient to program in.

Slower, inhibited by legal issues, limited in platform availability, limited in hardware applicability, limited in scope by being managed, lacking in many powerful abilities available elsewhere, unstandardised. Pointless beyond enabling the incompetent to make software badly.

There are lots of reasons to dislike C#. You just either don't know enough to care.
>>
(defun print-range (n)
(dotimes (i n)
(format t "~R~%")))

(defun print-range2 (n)
(dotimes (i n)
(format t '(~R~%))))
>>
>>25130870
Whoops, should be
(format t "~R~%" i)

and
(format t '(~R~%) i)
>>
>>25130838

Now try porting across a win32 program to Mono (you fucking idiot).
>>
int foo::bar::baz(int a)
{
return a + a;
}
>>
>>25130838
Mono is not a full C# implementation. One can code for Mono and (hopefully) have it work on .NET.

That is not the definition of portability. That is a reverse-engineered workaround, similar to WINE.
>>
Joining the tests with Scala example snippets from its page:
object Main {
def main(args: Array[String]) {
val res = for (a <- args) yield a.toUpperCase
println("Arguments: " + res.toString)
}
}


object primes extends Application {
def isPrime(n: Int) = (2 until n) forall (n % _ != 0)
for (i <- 1 to 100 if isPrime(i)) println(i)
}
>>
>>25130940
that is not exactly true.

MS has published the full spec for mono, and it IS a full c# implementation.

The parts missing from mono are all of the libraries and extensions that MS has written for c#.

Sure, it's like trying to program in C without Lib C, but it is still technically programming in C
>>
Testing with the greatest language ever devised by man
Option Strict On

Imports System
Imports com.lowagie.text
Imports com.lowagie.text.pdf
Imports System.IO

Public Class Chap0101
Public Shared Sub Main(ByVal args As String())
Console.WriteLine("Chapter 1 example 1: Hello World")

' step 1: creation of a document-object
Dim document As New Document()

' step 2:
' we create a writer that listens to the document
' and directs a PDF-stream to a file

PdfWriter.getInstance(document, New FileStream("Chap0101.pdf", FileMode.Create))

' step 3: we open the document
document.open()

' step 4: we add a paragraph to the document
document.add(New Paragraph("Hello World"))

' step 5: we close the document
document.close()
End Sub

End Class
>>
>>25130905
>>25130940
Of course it's not complete, but it's not completely pinned to one platform. I suppose it's still shit though, since it doesn't work on the 5% of linux desktops in the world, right?
>>
>>25130978
err... MS has published the full spec for C#, and mono is a full implementation of C#
>>
I installed Oneechan but I can no longer see the 4chan x settings button, does anyone remember the keybind for the options?
>>
>>25130986
By that goddamn logic, Windows programs are therefore portable because WINE exists.
>>
>>25131006
Ctrl+O
>>
>>25131006
Ctrl+O
>>
-----------------------------------------------------------------
Project name: SPG_Project_55_completed
-----------------------------------------------------------------
Stage has 0 stacks
-----------------------------------------------------------------
-----------------------------------------------------------------
Sprite named: Pointer1
Pointer1 has 1 stack
-----------------------------------------------------------------
when space key_pressed
{
go_to_x: -120 y: 0
point_in_direction 90
show
clear
pen_down
repeat 24
{
repeat 6
{
move 55 steps
turn 60 degrees
}
turn 15 degrees
}
}

-----------------------------------------------------------------
Sprite named: Pointer2
Pointer2 has 1 stack
-----------------------------------------------------------------
when space key_pressed
{
go_to_x: 120 y: 0
point_in_direction 90
show
clear
pen_down
repeat 24
{
repeat 6
{
move 55 steps
turn 60 degrees
}
turn 15 degrees
}
}


>>
>>25130990

C# has been unstandardised for over 6 years, while Microsoft continue to try to act like their own standardisation body.

>>25130986

>Continuing with an argumentum ad populum despite being called out on that bullshit.
>>
>>25131020
No, by that logic, the C# language != the .NET framework.
>>
>>25131020
WINE is the enemy of your freedom. Don't run proprietary software on FOSS systems
>>
File: 1338127450935.png-(27 KB, 165x280, Screen shot 2012-05-27 at 16.0(...).png)
27 KB
firefox CPU usage while in this thread (note the spikes)
>>
>>25131042
This is accurate.

c# != .NET

Mono has a complete implementation of C#, they do not have a complete implemenation of .NET
>>
>>25131044
>implying there are no libre Windows programs
>>
How about going into one of the other 5 threads relating the subject and post there?
>>
>>25131026
>>25131029
Thanks, I was hitting Shift + O
>>
public class CodeTagThread
{

Thread thread = new Thread;

public CodeTagThread
{
Bitmap codeTags = new bitmap(bitmapFactory.decodeResource(codetags))

thread.start();
}



class OP implements Thread
{
boolean trollOP = true;
run()
{
while(trollOP)
{
canvas.drawBitmap(codeTags, 0, 0, true)
}
}
}
}
>>
>>25130978
>The parts missing from mono are all of the libraries and extensions that MS has written for c#.
>Sure, it's like trying to program in C without Lib C, but it is still technically programming in C.

This Anon is more correct, but it should be obvious that not having what people regard as parts of their usual "standard" libs (even though this part is not standardized in the international specification, but just their companies and development environments) available on other platforms is a massive hindrance.


If you have a practical interest, see >>25130942 for a superior alternative that runs on the JVM.
>>
>>25130463
>no horizontal scroll
RUINED!
>>
>>25131042
I know. I'm talking about the majority of programs written in C#, which depend on Microsoft's implementation of .NET.
>>
<html>
<p>I wonder if HTML works too</p>
<ul>
<li>Testing</li>
<li>Testing</li>
<li>Still Testing</li>
</ul>
</html>
>>
>>25131080
if it's truly free, then the source is available. Port that shit to linux if you want to run it.

Don't use freedom hating software like WINE. Freedom to throw away your freedom isn't real freedom
>>
>>25131181
Hey, I'm just saying that WINE itself isn't any "enemy of my freedom". Only the proprietary programs one could run on it are.
>>
>>25131104
Scala is way too verbose for my taste. I don't know how cool the standard features and libraries are (i.e. java's are a mess, C#'s are rather clean and practical), but I'd use C++ for cross-platforming anyway. C# for RAD, because the tools pretty much already exist on other OSs.
>>
#include <stdio.h>

/* This is a comment. */
int main(int argc, char *argv[])
{
int distance = 100;

// this is also a comment
printf("You are %d miles away.\n", distance);

return 0;
}
>>
why is this not monospace
>>
Pipes yet?
|||||||||||||
>>
>>25131303
What browser do you use? FF has it monospaced


Delete Post [File Only] Password
Style
[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / w / wg] [i / ic] [r9k] [cm / hm / y] [3 / adv / an / cgl / ck / co / diy / fa / fit / hc / int / jp / lit / mlp / mu / n / po / pol / sci / soc / sp / tg / toy / trv / tv / vp / x] [rs] [status / ? / @] [Settings] [Home]
[Disable Mobile View / Use Desktop Site]

- futaba + yotsuba -
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.