• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 14:07
CEST 20:07
KST 03:07
  • 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
[ASL19] Finals Recap: Standing Tall10HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0TL Team Map Contest #5: Presented by Monster Energy6
Community News
Firefly given lifetime ban by ESIC following match-fixing investigation9$25,000 Streamerzone StarCraft Pro Series announced4Weekly Cups (June 30 - July 6): Classic Doubles6[BSL20] Non-Korean Championship 4x BSL + 4x China9Flash Announces Hiatus From ASL66
StarCraft 2
General
Firefly given lifetime ban by ESIC following match-fixing investigation TL Team Map Contest #4: Winners Weekly Cups (June 30 - July 6): Classic Doubles The SCII GOAT: A statistical Evaluation The GOAT ranking of GOAT rankings
Tourneys
FEL Cracov 2025 (July 27) - $8000 live event $25,000 Streamerzone StarCraft Pro Series announced Sparkling Tuna Cup - Weekly Open Tournament RSL: Revival, a new crowdfunded tournament series WardiTV Mondays
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome Mutation # 478 Instant Karma
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ i aint gon lie to u bruh... ASL20 Preliminary Maps [G] Progamer Settings [ASL19] Finals Recap: Standing Tall
Tourneys
[Megathread] Daily Proleagues [BSL20] Non-Korean Championship 4x BSL + 4x China [BSL20] Grand Finals - Sunday 20:00 CET CSL Xiamen International Invitational
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Nintendo Switch Thread Stormgate/Frost Giant Megathread Path of Exile What do you want from future RTS games? Beyond All Reason
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Positive Thoughts on Setting Up a Dual-Caliber FX
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Summer Games Done Quick 2025! Stop Killing Games - European Citizens Initiative
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
Anime Discussion Thread [Manga] One Piece [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion 2024 - 2025 Football Thread NBA General Discussion TeamLiquid Health and Fitness Initiative For 2023 NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
momentary artworks from des…
tankgirl
Culture Clash in Video Games…
TrAiDoS
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Customize Sidebar...

Website Feedback

Closed Threads



Active: 719 users

The Big Programming Thread - Page 793

Forum Index > General Forum
Post a Reply
Prev 1 791 792 793 794 795 1031 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.
waffelz
Profile Blog Joined June 2012
Germany711 Posts
November 04 2016 15:31 GMT
#15841
On November 05 2016 00:26 tofucake wrote:
The big power draw is the motor that will do the locking/unlocking. Wifi dongles are relatively low-power.


Sorry, i misunderstood. I will rephrase my post, the cupboard won't be properly locked, the device does nothing more but shout at the intruder. It really will be just a gimmick/reminder to the flatmantes to ask first.
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
tofucake
Profile Blog Joined October 2009
Hyrule19031 Posts
November 04 2016 15:33 GMT
#15842
Ah, well then that changes things. Shouldn't be too difficult to make then. An arduino can run something like that fairly easily on a few batteries for probably a week or so.
Liquipediaasante sana squash banana
Acrofales
Profile Joined August 2010
Spain17971 Posts
November 04 2016 15:41 GMT
#15843
On November 05 2016 00:33 tofucake wrote:
Ah, well then that changes things. Shouldn't be too difficult to make then. An arduino can run something like that fairly easily on a few batteries for probably a week or so.


This. I'm also not quite sure why wifi is required at all if all it needs to do is play a sound when someone opens the cupboard. If it is, I am not sure why the IP would be reset ever. When you set it up, just reserve an IP for the device on the router. Even cheap and shoddy ones you get with your internet subscription offer that functionality (at least here). It's one of the very very basic things in DHCP setup.

tofucake
Profile Blog Joined October 2009
Hyrule19031 Posts
November 04 2016 15:46 GMT
#15844
He wants it controlled by an app, which is why I was thinking wifi, because I doubt there's an ethernet port inside the cabinet
Liquipediaasante sana squash banana
waffelz
Profile Blog Joined June 2012
Germany711 Posts
November 04 2016 15:47 GMT
#15845
On November 05 2016 00:41 Acrofales wrote:
This. I'm also not quite sure why wifi is required at all if all it needs to do is play a sound when someone opens the cupboard. If it is, I am not sure why the IP would be reset ever. When you set it up, just reserve an IP for the device on the router. Even cheap and shoddy ones you get with your internet subscription offer that functionality (at least here). It's one of the very very basic things in DHCP setup.


I was talking about a reset of the external IP. In Germany it is quite common for your external IP to reset every 24h, as long as it isn’t cable. I don't have much more information about the router but they will probably change provider anyways. If I am lucky, they end up with the same router that I have which will makes things much more easy to me, even though it isn't great either. So the IP problem isn’t about internal network communication.
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Acrofales
Profile Joined August 2010
Spain17971 Posts
November 04 2016 15:50 GMT
#15846
On November 05 2016 00:47 waffelz wrote:
Show nested quote +
On November 05 2016 00:41 Acrofales wrote:
This. I'm also not quite sure why wifi is required at all if all it needs to do is play a sound when someone opens the cupboard. If it is, I am not sure why the IP would be reset ever. When you set it up, just reserve an IP for the device on the router. Even cheap and shoddy ones you get with your internet subscription offer that functionality (at least here). It's one of the very very basic things in DHCP setup.


I was talking about a reset of the external IP. In Germany it is quite common for your external IP to reset every 24h, as long as it isn’t cable. I don't have much more information about the router but they will probably change provider anyways. If I am lucky, they end up with the same router that I have which will makes things much more easy to me, even though it isn't great either. So the IP problem isn’t about internal network communication.

Why does the external IP matter? Or does he want to be able to control his cabinet from outside of the LAN? If so, there's things like dyndns (I think that still exists) which get around the problem (just set up a cronjob to update the dns every time your lease expires).
waffelz
Profile Blog Joined June 2012
Germany711 Posts
November 04 2016 16:10 GMT
#15847
On November 05 2016 00:50 Acrofales wrote:
Why does the external IP matter? Or does he want to be able to control his cabinet from outside of the LAN? If so, there's things like dyndns (I think that still exists) which get around the problem (just set up a cronjob to update the dns every time your lease expires).


Yeah, but that’s the kind of stuff I only can really consider when I am sure about the hardware I am dealing with, both in terms of arduino/raspberry and router (my former router had a free subscription to dyndns service as well as an build in support for it. very convenient times back then. At least all the dyndnsservices I used after that aren't free anymore). At the moment the main crux is choosing between arduino/raspberry/possible third alternatives I don’t know about.
RIP "The big travis CS degree thread", taken from us too soon | Honourable forum princess, defended by Rebs-approved white knights
Manit0u
Profile Blog Joined August 2004
Poland17244 Posts
November 04 2016 16:23 GMT
#15848
On November 04 2016 23:41 mantequilla wrote:
Show nested quote +
On November 04 2016 22:29 Manit0u wrote:
On November 04 2016 20:00 mantequilla wrote:
On November 04 2016 19:21 Nesserev wrote:
On November 04 2016 18:37 mantequilla wrote:
I'm a web app developer (from scratch with code) but got suggested using a cms for a customer with simple needs, they need to make announcements etc on their website, some static info and links to other systems. I'm alien to whole cms thing.

when I'm making a website for a customer using a cms, am I supposed to write code regularly? Is the online content editing thing for the non technical customer to just update the site content?

I quickly tried to put a language selector on top of the main page using couple of cms'es, and they suggested me to write server side code (jsp) to put it there. I thought I'd be just drag-dropping a ready lang selector component on the online page

There's usually a lot of content on a website that the owner of a website should be able to change without the intervention of any web developer; a CMS provides the interface that allows him/her to do this.

Does it make sense that a web developer has to be contacted every time you want to add a post on a blog, change the banner of your website, etc.? - No, so that's why you use a CMS. Not just for simple websites, but for almost any website.

If the question to "should the owner be able to change this?", you need a CMS.

And it's not just for the owner, even the developer can benefit; sometimes it's the most convenient to hook something up to the CMS beforehand, instead of manually changing it in the HTML later on.



I know-understand when a cms is needed, that wasn't the thing I was trying to ask. I wanted to ask how much programming is involved with me. Am I supposed to write code regularly, or is it a rare task only needed with advanced cases? I never worked with them so have no idea what the usual workflow is :/


It depends on client demands. If you're not OK with just using some existing CMS and its out-of-the-box features than you can expect plenty of coding on your part to incorporate the necessary stuff into the CMS. But usually after you ship it you rarely have to touch it.

The programming work involved can be anything from a couple of days to a couple of months.


the chapter 1 of liferay book teaches how to checkout code and install ant etc. first page in opencms documentation talks about writing jsp. confused


Show nested quote +

I'm not sure I understand the question right. If your job is to build a CMS, it will involve a fair amount of programming (how much depends on lots and lots of other things in your project). If your job is to update the website using the CMS then it *should* require no programming at all. It probably won't even require any CSS/HTML.


job is to create a simple website using cms that:

- has multiple locales selectable
- has an announcement feature where owners can make announcements which shows on main page
- have some links to external websites



http://octobercms.com/features
Time is precious. Waste it wisely.
Thaniri
Profile Blog Joined March 2011
1264 Posts
Last Edited: 2016-11-05 05:50:36
November 05 2016 05:12 GMT
#15849
+ Show Spoiler +
I'm working my way through project euler in Java, I've done 6 problems so far. I'm stuck on problem 3 though:
projecteuler.net

+ Show Spoiler +
public class ID3 {

public static void main(String[] args) {
findFactors(600851475143);
sieve(600851475143);
}

public static long findFactors(long input){
//won't accept long as an input

return 1;
}

public static long[] sieve(long input){
//this is just a copy pasted sieve of eratosthenes

long[] primes = new long [numberOfPrimesFound];

return primes;
}
}



My plans are this:
- Find the primes up to 600851475143 then check if they are factors in descending order.
or
- Find the factors of 600851475143 and then check if they are primes in ascending order.

Neither plan will work due to the size being above the range of an int.

I cannot declare a long array because that'd be stupid according to stack overflow (need 16gb of memory) and my findFactors method won't take a long as an argument, however I can't google an answer as to why.

Anyone have an idea for a better plan or how to make an argument accept a long as an input?

I'm trying my best to not just google the answer, though I admit I copied the sieve from stack overflow.

edit:

http://pastebin.com/rdH9H1cM

BigInt isn't working either.


I'm an idiot:

600851475143L allows long to be used as an argument
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-11-05 05:54:26
November 05 2016 05:54 GMT
#15850
You have to add an 'L' to a number to mark it as a long.

findFactors(600851475143L);

edit: nice
There is no one like you in the universe.
Thaniri
Profile Blog Joined March 2011
1264 Posts
Last Edited: 2016-11-05 06:27:00
November 05 2016 06:24 GMT
#15851
http://pastebin.com/ncE1ZjxS

Unfortunately BigDecimal doesn't allow for comparison operators, I think I'mma have to sleep on this one. I might have to create my own method that compares two BigDecimal numbers.

edit: I think posting things online instantly allows me to find the answer. Guess what? BigDecimal has a compareTo() method.

What I'll do is ask a mod to let me post in this thread but "shadowban" me like on reddit so no-one else sees my posts. Thus I will get the answers and not bother anyone.
phar
Profile Joined August 2011
United States1080 Posts
November 05 2016 17:31 GMT
#15852
Don't sweat it. What you are doing is called rubber duck debugging. It will never go away, even in industry.
Who after all is today speaking about the destruction of the Armenians?
phar
Profile Joined August 2011
United States1080 Posts
November 05 2016 17:37 GMT
#15853
On November 05 2016 01:10 waffelz wrote:
Show nested quote +
On November 05 2016 00:50 Acrofales wrote:
Why does the external IP matter? Or does he want to be able to control his cabinet from outside of the LAN? If so, there's things like dyndns (I think that still exists) which get around the problem (just set up a cronjob to update the dns every time your lease expires).


Yeah, but that’s the kind of stuff I only can really consider when I am sure about the hardware I am dealing with, both in terms of arduino/raspberry and router (my former router had a free subscription to dyndns service as well as an build in support for it. very convenient times back then. At least all the dyndnsservices I used after that aren't free anymore). At the moment the main crux is choosing between arduino/raspberry/possible third alternatives I don’t know about.

How long does it need to be powered for, with what power source (battery? How big?). This could greatly affect your choice of underlying device ... a raspberry pi or even the tiny arduino may not last all that long on battery.
Who after all is today speaking about the destruction of the Armenians?
Wrath
Profile Blog Joined July 2014
3174 Posts
November 05 2016 19:45 GMT
#15854
Can someone be nice and guide me to a good resource to understand MVC architecture? I feel really lost. Also, it would be really really cool if it contains a small project to practice the MVC architecture, it will help to understand it if possible.
RoomOfMush
Profile Joined March 2015
1296 Posts
November 05 2016 20:16 GMT
#15855
On November 06 2016 04:45 Wrath wrote:
Can someone be nice and guide me to a good resource to understand MVC architecture? I feel really lost. Also, it would be really really cool if it contains a small project to practice the MVC architecture, it will help to understand it if possible.

Its just a simple concept of how to structure your classes in OOP. There isnt much to it. A "simple" example for MVC isnt of much use though. The concepts benefits only really come to light in bigger applications where well separated layers make maintenance and extension more comfortable and less error prone.
BluzMan
Profile Blog Joined April 2006
Russian Federation4235 Posts
November 05 2016 22:49 GMT
#15856
On November 06 2016 04:45 Wrath wrote:
Can someone be nice and guide me to a good resource to understand MVC architecture? I feel really lost. Also, it would be really really cool if it contains a small project to practice the MVC architecture, it will help to understand it if possible.


Well, try this for starters:
blogs.msdn.microsoft.com

And keep in mind that there ain't actually a common understanding of what modern MVC really is. The abundance of views on the topic can get really confusing at times. What everyone agrees upon is that there is a definite advantage to be gained from separating application logic and the way user interacts with it (both input and output), hence the M-V pair which is present everywhere. A neat way to separate that is ask yourself: "how much of the application can I package as a command-line app in a way that the application data can be displayed in any way thinkable?" then make that your model. The rest will be your VW (View Whatever). The third "magic component" is understood differently everywhere so just consult your platform's documentation to clarify (iOS has one way to look at things, Qt has another etc). It's best to always understand what exact problem your patterns are solving and adapt them accordingly. For instance, our team has a cross-platform mobile app which is mostly written in C++, but uses platform code for UI, so our views end up being extremely dumb (to keep as much code as possible in the cross-platform part, we don't even allow Swift classes to handle user taps on their own) which is I guess an example of a "Model View PresentationModel" pattern from the article, but there isn't any magic in that besides solving an exact problem we have.
You want 20 good men, but you need a bad pussy.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
Last Edited: 2016-11-05 22:53:05
November 05 2016 22:52 GMT
#15857
There are also quite a lot of variants/interpretations of MVC.

The best way I found to understand it is that you have three groupings of classes: the group that controls your database, the group that does any logic, and the group that controls the interface. The group that does logic is the glue between the other two groups.

The general path of information is that the user interacts with the interface; this triggers a call to some logic in the logic group, which often but not always then calls for some data from the database group. Then the logic group send the data to the interface group which displays it.

However, some will disagree as to how MVC this is; some versions have the model doing a lot more logic, other times the model and controller are combined and basically only the view is extracted, and so on.

EDIT Just saw BluzMan's post, pretty much better summary of the variations/interpretations than I gave.
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-11-06 00:34:33
November 06 2016 00:24 GMT
#15858
http://pastebin.com/bJraUvyK

if anyone can help a little bit, i'm doing hackerrank's synchronous shopping.

https://www.hackerrank.com/challenges/synchronous-shopping

i have a solution but i can't get it to run fast enough for all inputs. my breadth first search is too slow :/ if anyone could take a look, i'd appreciate it. the slow method is synchronous_shopping(path)

things i've tried:

using list as underlying container for queue
using a 1D array like a 2D array
There is no one like you in the universe.
slmw
Profile Blog Joined October 2010
Finland233 Posts
November 06 2016 02:26 GMT
#15859
Usually in competitive programming you should look for optimizations that make your code faster by an order of magnitude. You can simply look at the asymptotic runtime of data structure operations to estimate whether it is good enough, e.g. changing a list to a queue won't change pretty much anything.

Did you try to calculate approximately how many times your algorithm will check a node in a worst case scenario? How useful is the condition on line 117 if you assume the input is designed by your worst enemy? Is BFS the best algorithm for path finding in a graph with variable edge costs?

If you want to know the answer:
+ Show Spoiler +
Use Dijkstra's algorithm. Only process a pair (shop, bitmask) once, since the first time is guaranteed to be the cheapest way to reach it. My solution.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2016-11-06 04:48:37
November 06 2016 04:35 GMT
#15860
That feel when you started from Dijkstra's and way diverged because you weren't getting the right answer :'D Thanks a bunch slmw :3 I don't do much competitive programming.

edit: I've been doing the find min for Dijkstra's wrong my entire life - priority queue.... T_T
There is no one like you in the universe.
Prev 1 791 792 793 794 795 1031 Next
Please log in or register to reply.
Live Events Refresh
WardiTV European League
16:00
Swiss Groups Day 3
Scarlett vs ShamelessLIVE!
WardiTV809
TKL 279
Liquipedia
uThermal 2v2 Circuit
16:00
Warmup Cup 2
uThermal297
IndyStarCraft 230
SteadfastSC115
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
mouzHeroMarine 380
uThermal 297
TKL 279
IndyStarCraft 230
SteadfastSC 115
BRAT_OK 84
UpATreeSC 77
ProTech36
MindelVK 17
StarCraft: Brood War
Bisu 1565
Shuttle 955
EffOrt 931
firebathero 303
Mini 272
TY 91
Dewaltoss 90
soO 56
sas.Sziky 18
yabsab 11
[ Show more ]
IntoTheRainbow 9
GoRush 7
Dota 2
Gorgc11730
qojqva1918
League of Legends
Dendi1038
Grubby1
Counter-Strike
fl0m1144
byalli546
flusha354
zeus216
Foxcn181
sgares47
Heroes of the Storm
Liquid`Hasu414
Khaldor139
Other Games
FrodaN2224
Beastyqt601
oskar147
KnowMe143
QueenE53
Trikslyr47
ArmadaUGS16
Organizations
Other Games
gamesdonequick45299
StarCraft 2
angryscii 15
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 19 non-featured ]
StarCraft 2
• Reevou 7
• intothetv
• sooper7s
• Migwel
• AfreecaTV YouTube
• LaughNgamezSOOP
• IndyKCrew
• Kozan
StarCraft: Brood War
• FirePhoenix3
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• C_a_k_e 2575
• masondota2817
League of Legends
• Nemesis6327
• Jankos1196
• TFBlade1059
Other Games
• imaqtpie980
• Shiphtur604
Upcoming Events
Replay Cast
5h 53m
RSL Revival
15h 53m
ByuN vs SHIN
Clem vs Reynor
OSC
18h 53m
Replay Cast
1d 5h
RSL Revival
1d 15h
Classic vs Cure
FEL
1d 21h
OSC
2 days
RSL Revival
2 days
FEL
2 days
FEL
2 days
[ Show More ]
CSO Cup
2 days
BSL20 Non-Korean Champi…
2 days
Bonyth vs QiaoGege
Dewalt vs Fengzi
Hawk vs Zhanhun
Sziky vs Mihu
Mihu vs QiaoGege
Zhanhun vs Sziky
Fengzi vs Hawk
Sparkling Tuna Cup
3 days
RSL Revival
3 days
FEL
3 days
BSL20 Non-Korean Champi…
3 days
Bonyth vs Dewalt
QiaoGege vs Dewalt
Hawk vs Bonyth
Sziky vs Fengzi
Mihu vs Zhanhun
QiaoGege vs Zhanhun
Fengzi vs Mihu
Replay Cast
5 days
Liquipedia Results

Completed

Proleague 2025-07-07
HSC XXVII
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
Acropolis #3
KCM Race Survival 2025 Season 2
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
Championship of Russia 2025
RSL Revival: Season 1
Murky Cup #2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025

Upcoming

2025 ACS Season 2: Qualifier
CSLPRO Last Chance 2025
CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Chat StarLAN 3
K-Championship
uThermal 2v2 Main Event
SEL Season 2 Championship
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
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 © 2025 TLnet. All Rights Reserved.