• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 20:22
CEST 02:22
KST 09:22
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
ZeroSpace Early Access is Now Live!17Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)87Reynor: GSL Loss Wasn't About Preparation Format16[IPSL] Spring 2026 Grand Finals - This Weekend!18
StarCraft 2
General
How would you feel about frequent/monthly balance patches for SC2? Balance hotfix patch 5.0.16b (July 16) Clem: "I don't have that much hope in Blizzard" Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters [D] Wireframe Casting Removed
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event Master Swan Open (Global Bronze-Master 2) WardiTV Summer Cup 2026 GSL CK #5 Race War HomeStory Cup 29
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Animated Gateway HORROR STARCRAFT MOVIE How Famous was FlaSh before his Debut?
Tourneys
[Megathread] Daily Proleagues [IPSL] Spring 2026 Grand Finals - This Weekend! Escore Tournament - Season 3 Small VOD Thread 2.0
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
Path of Exile General RTS Discussion Thread Diablo IV ZeroSpace Early Access is Now Live! ZeroSpace at Steam NextFest - Last free demo
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Artificial Intelligence Thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe The Games Industry And ATVI
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread Series you have seen recently... Movie Discussion! [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023 McBoner: A hockey love story
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
Hello guys!
LIN1s
Role of Gaming on Mental Hea…
TrAiDoS
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
ramps on octagon
StaticNine
Customize Sidebar...

Website Feedback

Closed Threads



Active: 4448 users

The Big Programming Thread - Page 544

Forum Index > General Forum
Post a Reply
Prev 1 542 543 544 545 546 1032 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
Last Edited: 2014-11-07 02:52:13
November 07 2014 02:44 GMT
#10861
On November 05 2014 23:40 Gowerly wrote:
I posted that link and then realised I didn't mean it.
If I'm in Ruby, I will put braces in differently. If I'm doing something like

myArr.each { |item|
item.DoThing()
}

then my braces are like that. I don't know if Ruby even works without it as I'm still rather new.


For ruby if you want to one-line a block you use braces, otherwise you use do ... end

# one liner with braces
my_array.each { |item| item.do_thing }

# better one-liner
my_array.each(&:do_thing)

# even better
results = my_array.map(&:thing)

#block
my_array.each do |item|
item.do_thing
end


A couple stylistic things:
local variable and function names should be snake_case
No parens if you're not passing anything to the function
CatNzHat
Profile Blog Joined February 2011
United States1599 Posts
November 07 2014 02:49 GMT
#10862
On November 06 2014 22:55 djookz wrote:
Hey guys,
I've been an avid reader since this page came out but never felt the urge to make an account, but upon seeing this thread for the first time now (Usually not looking at General), I wanted to ask if some people here use R?

I'm starting a large data analysis project at work, so I've been doing a lot of research on various solutions. Looking at R it seems very useful for expressing complex mathematical expressions succinctly. Using it within Hadoop map/reduce jobs wouldn't be the worst thing the world, but Python, Mlib, and GraphX on top of Spark make it kind of an out-of-the-way solution.

If I were working with a smaller data set and focusing on machine learning R would be on the short list.
delHospital
Profile Blog Joined December 2010
Poland261 Posts
November 07 2014 14:33 GMT
#10863
On November 07 2014 11:49 CatNzHat wrote:
Show nested quote +
On November 06 2014 22:55 djookz wrote:
Hey guys,
I've been an avid reader since this page came out but never felt the urge to make an account, but upon seeing this thread for the first time now (Usually not looking at General), I wanted to ask if some people here use R?

I'm starting a large data analysis project at work, so I've been doing a lot of research on various solutions. Looking at R it seems very useful for expressing complex mathematical expressions succinctly. Using it within Hadoop map/reduce jobs wouldn't be the worst thing the world, but Python, Mlib, and GraphX on top of Spark make it kind of an out-of-the-way solution.

If I were working with a smaller data set and focusing on machine learning R would be on the short list.

If you are a fan of shell scripting, perl, javascript and other inconsistent, ugly languages, then r is just for you.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 07 2014 18:27 GMT
#10864
Apparently R is beautiful if you're a mathematician versus a programmer. Read somewhere that the language constructs are designed to feel good for math usage.
There is no one like you in the universe.
SilverSkyLark
Profile Blog Joined April 2008
Philippines8437 Posts
Last Edited: 2014-11-09 16:46:22
November 09 2014 03:53 GMT
#10865
Hi guys. I'm developing a web application in Ext JS 4.2.

I have a floating form where I have a print button which prints the form programmatically. I got the code from this wordpress website. So far, it works great if the form contains basic fields such as text fields, labels, images.

However, I'm starting to have problems printing a form with a Grid Panel and a Property Panel in it. Most of the time (around 9 times out of 10), when the print dialog comes up, it shows "Print Preview Failed". In instances that it does print, the bottom and right borders of the Grid Panel and the Property Grid doesn't show up at all - even if the form in the browser shows that my borders are there.


What I've done so far is I copy pasted my web app folder and tinkered with the duplicate. I've confirmed there that removing the Grid Panel and the Property Grid makes the printing process more consistent. Now I'm thinking that the CSS of the Grids may be messing me up. I've tried asking in StackOverFlow but they haven't answered.


Edit 1: The CSS doesn't matter.

Edit 2: Found a different way to do this using a different class, however, I'm having a tough time including an Ext.ux class while using the MVC framework.

Question in SO is over here
"If i lost an arm, I would play w3." -IntoTheWow || "Member of Hyuk Hyuk Hyuk cafe. He's the next Jaedong, baby!"
berated-
Profile Blog Joined February 2007
United States1134 Posts
November 09 2014 17:50 GMT
#10866
On November 05 2014 23:59 Manit0u wrote:
Ok guys, now I have a different problem... Had to switch branches with the code, all looks fine, except there's 2x more code like stuff I posted on the previous page. I ignore it for the moment but there are other funny things happening.

1. Compiling this code to .war produces file that's 5x smaller than previously, probably missing some dependencies...
2. Errors be thrown: java.lang.NoClassDefFoundError, definitely dependencies are missing...
3. 'mvn depdendency:resolve' downloads all the required stuff, 1 and 2 remain unchanged.

Help? I've recompiled the code like 15 times now, updated everything, all looks cool and dandy, maven is able to install, clean package and all that jazz, but it doesn't work

And yes, all deps are properly included in pom.xml and class that's throwing the error does import the right thing.


You make any progress on this? Did you switch maven versions from 2 to 3? Are you able to replicate the old build at all? Are you able to do a diff on the branches to see how the pom is different?

Just because the code compiles doesn't mean that you have have all your dependencies. If you are using internal libraries that don't declare their dependencies correctly then maven cannot correctly pull in all the transitive libraries. Did you mark all your dependencies as provided for some reason?

Do you have the old war file? Trying to spot the difference of which jars are in the old and not the new should help more quickly point you to why they are in the old but not the new.
MinoMoto
Profile Joined June 2011
Latvia107 Posts
November 09 2014 18:38 GMT
#10867
C# - How I can draw a triangle using a cycle
The size is set by the user.
Please help.
I can only make squares.
[image loading]
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-09 23:42:24
November 09 2014 23:34 GMT
#10868
generic lambdas in c++ are so god damned, so GOD DAMNED COOL.
[image loading]
screeeeaaaaaaaaaaaaaaaaaaaaaaaaaam!
conspired against by a confederacy of dunces.
Manit0u
Profile Blog Joined August 2004
Poland17799 Posts
Last Edited: 2014-11-10 03:04:54
November 10 2014 03:04 GMT
#10869
On November 10 2014 02:50 berated- wrote:
Show nested quote +
On November 05 2014 23:59 Manit0u wrote:
Ok guys, now I have a different problem... Had to switch branches with the code, all looks fine, except there's 2x more code like stuff I posted on the previous page. I ignore it for the moment but there are other funny things happening.

1. Compiling this code to .war produces file that's 5x smaller than previously, probably missing some dependencies...
2. Errors be thrown: java.lang.NoClassDefFoundError, definitely dependencies are missing...
3. 'mvn depdendency:resolve' downloads all the required stuff, 1 and 2 remain unchanged.

Help? I've recompiled the code like 15 times now, updated everything, all looks cool and dandy, maven is able to install, clean package and all that jazz, but it doesn't work

And yes, all deps are properly included in pom.xml and class that's throwing the error does import the right thing.


You make any progress on this? Did you switch maven versions from 2 to 3? Are you able to replicate the old build at all? Are you able to do a diff on the branches to see how the pom is different?

Just because the code compiles doesn't mean that you have have all your dependencies. If you are using internal libraries that don't declare their dependencies correctly then maven cannot correctly pull in all the transitive libraries. Did you mark all your dependencies as provided for some reason?

Do you have the old war file? Trying to spot the difference of which jars are in the old and not the new should help more quickly point you to why they are in the old but not the new.


A bit of progress. I managed to get old war to work on a new server partially. The biggest problem is the server configuration at the moment, because I have the old war (which is working on an old server perfectly) but I have no sources for it, only the compiled classes and there are no deps included in the old war, they're installed globally on the old server but I can't find them The dude who was setting it up did some truly magic things.
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
November 10 2014 03:56 GMT
#10870
On November 10 2014 08:34 nunez wrote:
generic lambdas in c++ are so god damned, so GOD DAMNED COOL.
screeeeaaaaaaaaaaaaaaaaaaaaaaaaaam!


too bad the syntax for c++ lambdas is absolutely unreadable ;-;
There is no one like you in the universe.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
November 10 2014 07:45 GMT
#10871
blasphemer! repent!
conspired against by a confederacy of dunces.
Isualin
Profile Joined March 2011
Germany1903 Posts
Last Edited: 2014-11-10 08:49:47
November 10 2014 08:45 GMT
#10872
Is there anyone who can help me with Apache Nutch? I need to match comments with articles from a website.
Comments in the website have a url to the article in www.domain.com/?p=##### format but it redirects to www.domain.com/headline-of-the-article-identifier. Looks like i need to index original target urls as well in case of redirects.
Edit: To be more clear, i am asking how can i get the value of original target urls and add them to nutchdocument for indexing? I am not hopeful to get an anwser but this is the best place on this forum to ask.
| INnoVation | The literal god TY | ByuNjwa | LRSL when? |
actionbastrd
Profile Blog Joined September 2010
Congo598 Posts
Last Edited: 2014-11-10 10:26:55
November 10 2014 10:26 GMT
#10873
Hey i am currently learning classes and multiple files using headers. C++

I am running into an issue where i have 2 classes, two different .h files. One class holds all the functions for displaying information, labeled display.h, and the other holds all the information gathered from the user. information.h. (the classes are corrispondingly named).

I want to have the header file of information.h inside of my display.h. I have been reading about header gaurds, but i am not sure how to implement them. Any assistance would be great. I have yet to be formally introduced to these header file concepts, but am trying to figure it out regardless.

Here is what i understand.
-at the top of the header file

display.h

#ifndef headername
#define headername

#include "information.h"
/* all content of .h file? Unsure. */

#endif

I cant seem to get it to work, and am a little confused on the header gaurd concept. Do i do this for every header? Does it go into main aswell? Any help will be great. I can easy finish my task without this, but i really want to understand this for my own desire.
It rained today inside my head...
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-10 10:48:39
November 10 2014 10:46 GMT
#10874
relevant wiki-material: one definition rule!

display.h:
#ifndef DISPLAY_H
#define DISPLAY_H

#endif

in a translation unit, the first time the file display.h is included (barring any unfortunate circumstance), the macro DISPLAY_H is undefined, so the code between #ifndef DISPLAY_H and #endif will be compiled.
the key point is that this code conatins the definition of the macro DISPLAY_H (second line of the code)!

the next time display.h is included in that same translation unit, the macro DISPLAY_H (barring any unfortunate circumstance) is now defined, and the code between #ifndef DISPLAY_H and #endif will be ignored.

thus any function definition within display.h will only appear once.

personally i just use #pragma once instead of header guards. this is not unproblematic, but it hasn't been a problem for me yet
conspired against by a confederacy of dunces.
Khalum
Profile Joined September 2010
Austria831 Posts
November 10 2014 12:57 GMT
#10875
On November 10 2014 19:26 actionbastrd wrote:
Does it go into main aswell?

Since it wasn't explicitly answered I'd like to mention that you do indeed only need header guards for header files (.h).
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
Last Edited: 2014-11-10 20:26:33
November 10 2014 20:21 GMT
#10876
On November 10 2014 08:34 nunez wrote:
generic lambdas in c++ are so god damned, so GOD DAMNED COOL.
[image loading]
screeeeaaaaaaaaaaaaaaaaaaaaaaaaaam!


Haha, you're such a nerd. Do you work? If yes, I imagine your company hasn't yet transitioned to C++14 if there is a working compiler at all.

On a different note, I'll soon have to re-install Windows on my personal computer, and I wonder whether I should stick with Windows 7 or Windows 8.1. I've read Windows 8.1 is 'faster' but is that really true?
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2014-11-10 21:43:28
November 10 2014 20:54 GMT
#10877
i have a part time programming job alongside my studies.
i haven't used generic lambdas there yet though (~supported by vs14), but used decltype(auto) for return type deduction!

here's a pretty neat, and super terse way of defining a type trait via overloaded function definitions:
#include<iostream>
#include<type_traits>
using namespace std;

float type_trait(int);
double type_trait(char);

template<class input>
using type_trait_t=decltype(type_trait(*(input*)(0))); //altenatively decltype(type_trait(declval<input>()))

template<class input>
type_trait_t<input>
func()
{ return 0; }

int main(){
static_assert(
is_same<decltype(func<int>()),float>::value&&
is_same<decltype(func<char>()),double>::value,
"type trait test fail"
);
}

the input type you want to specialize the trait for is placed as the argument type in the function overload definition, and the output type of the trait is placed as the return type. the output type for a given input type is produced by letting the compiler deduce the return type of the function call with a declvaled

the test is succesfull if it compiles, and it does. it doesn't impose any restrictions on the input types constructibility as the type traits output is deduced from an unevaluated context (inside decltype).

haven't tested it out much yet, as i only realized it was a viable approach today after writing that post about header guards, but in the cases i can get away with this instead of using nested type-aliases i think i prefer it.

here's the more common variant for comparison:
#include<iostream>
#include<type_traits>
using namespace std;

template<class input>
struct
type_trait;

template<>
struct
type_trait<int>
{ using type=float; };

template<>
struct
type_trait<char>
{ using type=double; };

template<class input>
using type_trait_t=typename type_trait<input>::type;

template<class input>
type_trait_t<input>
func()
{ return 0; }

int main(){
static_assert(
is_same<decltype(func<int>()),float>::value&&
is_same<decltype(func<char>()),double>::value,
"type trait test fail"
);
}
conspired against by a confederacy of dunces.
Cynry
Profile Blog Joined August 2010
810 Posts
Last Edited: 2014-11-10 21:36:20
November 10 2014 21:35 GMT
#10878
Hey guys, quick C question :

Assume I have a linked list of structures containing structures containing an int and a string, and that I have to keep all this information through different calls to the function that creates and manages the list.
I define the list as static, and this part seems to be working, but when I try to access the structures inside it segfaults on the second call to the function. I did not defined those as statics, is this where the error comes from ? I assumed only keeping the list of pointers would work...
Uranium
Profile Blog Joined May 2010
United States1077 Posts
November 10 2014 21:53 GMT
#10879
If this was C++ and you had a class that housed a linked list, then declared a static instance of that class within a function, I'd say you were safe, and that any segfaults were likely an issue with your implementation of the linked list.

However in C, it depends. How are you allocating the memory for the structures that you are attaching to the static list header inside the function?
"Sentry imba! You see? YOU SEE??!!" - Sen | "Marauder die die!" - oGsMC | "Oh my god, she texted me back!" - Day[9]
Cynry
Profile Blog Joined August 2010
810 Posts
Last Edited: 2014-11-10 22:14:39
November 10 2014 22:14 GMT
#10880
relevant code in the .c
int             get_next_line(int const fd, char **line)
{
int ret;
static t_list *files;
t_list *cursor;
t_file *new_file;

ret = 0;
if (files)
{
cursor = files;
while (cursor && cursor->content
&& ((t_file *)cursor->content)->fd != fd)
cursor = cursor->next;
if (cursor->content && ((t_file *)cursor->content)->fd == fd)
ret = ft_read_file(fd, cursor->content, line);
}
else
{
if (!(files = (t_list *)ft_memalloc(sizeof(*files))))
return (-1);
if (!(new_file = (t_file *)ft_memalloc(sizeof(*new_file))))
return (-1);
cursor = ft_lstnew(new_file, sizeof(*new_file));
((t_file *)cursor->content)->fd = fd;
((t_file *)cursor->content)->left_over = 0;
ft_lstadd(&files, cursor);
ret = ft_read_file(fd, cursor->content, line);
}
return (ret);
}

in the .h
#ifndef GET_NEXT_LINE_H
# define GET_NEXT_LINE_H

# define BUFF_SIZE 32
# define EOF "\n"

#include <string.h>

typedef struct s_list
{
void *content;
size_t content_size;
struct s_list *next;
} t_list;

typedef struct s_file
{
int fd;
char *left_over;
} t_file;

The segfault happens with the second call to get_next_line, when if (files) is checked and the program tries to access cursor->content->fd.
Prev 1 542 543 544 545 546 1032 Next
Please log in or register to reply.
Live Events Refresh
OSC
00:00
OSC Elite Rising Star #20
CranKy Ducklings33
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft387
ViBE194
Ketroc 34
StarCraft: Brood War
GuemChi 3196
Artosis 515
NaDa 33
Dota 2
NeuroSwarm133
League of Legends
Doublelift3558
Counter-Strike
minikerr46
Super Smash Bros
hungrybox754
AZ_Axe71
Other Games
summit1g7602
tarik_tv6380
Day[9].tv1373
Coldzera 943
shahzam514
JuggernautJason132
Trikslyr81
Organizations
Other Games
gamesdonequick1233
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 18 non-featured ]
StarCraft 2
• Hupsaiya 102
• CranKy Ducklings SOOP15
• davetesta11
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• iopq 10
• HerbMon 5
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• masondota21207
Other Games
• Day9tv1373
• imaqtpie1040
Upcoming Events
CrankTV Team League
10h 39m
Replay Cast
23h 39m
CrankTV Team League
1d 10h
Big Brain Bouts
1d 15h
Soulspirit vs goblin
TriGGeR vs Bunny
Korean StarCraft League
2 days
Afreeca Starleague
2 days
RSL Revival
2 days
Serral vs SHIN
herO vs Solar
Online Event
2 days
Replay Cast
2 days
RSL Revival
3 days
Clem vs ByuN
Rogue vs Lambo
[ Show More ]
OSC
3 days
WardiTV Weekly
4 days
Sparkling Tuna Cup
5 days
PiGosaur Cup
5 days
The PondCast
6 days
Kung Fu Cup
6 days
Patches Events
6 days
Liquipedia Results

Completed

Proleague 2026-07-22
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.