• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 11:12
CEST 17:12
KST 00:12
  • 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 2912Serral 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
Reynor: GSL Loss Wasn't About Preparation Format12[IPSL] Spring 2026 Grand Finals - This Weekend!1Weekly Cups (July 6 - 12): Protoss strike back7BSL Season 22 Full Overview & Conclusion8BSL Season 22 Full Overview & Conclusion8
StarCraft 2
General
Weekly Cups (July 6 - 12): Protoss strike back Serral wins HomeStory Cup 29 Reynor: GSL Loss Wasn't About Preparation Format Latest hotfix to Patch 5.0.16 Co-op Commander Guide: Kerrigan
Tourneys
WardiTV Summer Cup 2026 GSL CK #5 Race War RSL Revival: Season 6 - Qualifiers and Main Event HomeStory Cup 29 Vespene Cup #1 — $300+ USD, July 10
Strategy
[G] Having the right mentality to improve
Custom Maps
New Map Maker - Looking for Advice - Love or Hate Work In Progress Melee Maps [D]RTS in all its shapes and glory <3
External Content
The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together Mutation # 532 Nuclear Family
Brood War
General
screpdb: new Starcraft reporting tool Pros Debate: Zerg Unfairly Nerfed? (ASL S22 map) ASL 22 Proposed Map Pool BSL Season 22 Full Overview & Conclusion BGH Auto Balance -> http://bghmmr.eu/
Tourneys
[ASL22] Wildcard Qualifier [IPSL] Spring 2026 Grand Finals - This Weekend! [Megathread] Daily Proleagues IPSL Spring 2026 Top 4!
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Creating a full chart of Zerg builds Relatively freeroll strategies
Other Games
General Games
Nintendo Switch Thread General RTS Discussion Thread Stormgate/Frost Giant Megathread Path of Exile Summer Games Done Quick 2026!
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
NeO.D_StephenKing vs This Guy From 1 Million Dance TL Mafia Community Thread TL Mafia Power Rank Vanilla Mini Mafia
Community
General
US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread YouTube Thread Canadian Politics Mega-thread
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Anime Discussion Thread [Req][Books] Good Fantasy/SciFi books Movie Discussion! Series you have seen recently...
Sports
2024 - 2026 Football Thread McBoner: A hockey love story Tennis[sport] Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023
World Cup 2022
Tech Support
Simple Questions Simple Answers FPS when play League Of Legend on laptop How to clean a TTe Thermaltake keyboard?
TL Community
The Automated Ban List
Blogs
Poker (part 2)
Nebuchad
The Experiences We Want and …
TrAiDoS
An Exploration of th…
waywardstrategy
Gauntlet SC2: A Retrospectiv…
Ctone23
ramps on octagon
StaticNine
Funny Nicknames
LUCKY_NOOB
Evil Gacha Games and the…
ffswowsucks
Customize Sidebar...

Website Feedback

Closed Threads



Active: 5829 users

The Big Programming Thread - Page 387

Forum Index > General Forum
Post a Reply
Prev 1 385 386 387 388 389 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.
sluggaslamoo
Profile Blog Joined November 2009
Australia4494 Posts
Last Edited: 2013-11-07 10:38:20
November 06 2013 22:47 GMT
#7721
On November 07 2013 00:31 AsmodeusXI wrote:
Question for the wizards in here: does anyone have any recommendations for a JavaScript library/framework for games development? I'm interested in doing game creation in HTML5 and there are a LOT of options out there, so I'm looking for some opinions.


Client side only (whole game is loaded in the browser with no interaction on server besides assets).

Or

Online multiplayer?

EaselJS is something which is like SDL for HTML5 Canvas, its quite good.
http://www.createjs.com/#!/EaselJS

Also I like to use coffeescript instead of javascript, its much nicer to code in.

I don't have a lot of experience in using off the market pre-made game engines in JS, but HTML5 Canvas is very easy to use and fast enough that you don't need to bother with optimisations for something simple. I think anything you find on google should be good enough, its not like the old days where there was a ton of boiler plate involved with drivers and there were big differences even in amateur engines (e.g 2D with .ini files vs 2.5D with relational database).

Also if you are going to use Coffeescript make sure to put undefined at the end of any long loops in order to prevent it building an array and returning it which while it is useful in web-development, it is costly for games.
Come play Android Netrunner - http://www.teamliquid.net/forum/viewmessage.php?topic_id=409008
Cyx.
Profile Joined November 2010
Canada806 Posts
November 06 2013 22:55 GMT
#7722
On November 07 2013 06:03 Zorkmid wrote:
Show nested quote +
On November 07 2013 04:17 Cyx. wrote:
On November 06 2013 12:46 Zorkmid wrote:
A lot of people that I've talked to say that IDEs are a bad way to learn a language for just that very reason.


And this is why we don't post without fully reading what we're responding to. 0o

don't listen to me, I was responding mostly to the 'why should I use an editor' rather than the 'what tools should I get to learn c' =/


I wasn't really responding to anything you said, just giving one point of view on IDEs as a learning tool. No need for the saltyness.


Sorryyyy lol, I meant that I had posted without reading, I wasn't saying anything about you ^^ badly worded, my bad.
Zorkmid
Profile Joined November 2008
4410 Posts
November 07 2013 00:14 GMT
#7723
Ah, my bad.
Birdie
Profile Blog Joined August 2007
New Zealand4438 Posts
November 07 2013 01:59 GMT
#7724
I'm streaming (and will be streaming this week and for several weeks) StarServer development (a new BW server). Feel free to have a look, and give tips and advice, as I'm a pretty noobie programmer. http://www.twitch.tv/birdietelevision
Red classic | A butterfly dreamed he was Zhuangzi | 4.5k, heading to 5k as support!
Zorkmid
Profile Joined November 2008
4410 Posts
November 07 2013 03:19 GMT
#7725
On November 07 2013 10:59 Birdie wrote:
I'm streaming (and will be streaming this week and for several weeks) StarServer development (a new BW server). Feel free to have a look, and give tips and advice, as I'm a pretty noobie programmer. http://www.twitch.tv/birdietelevision


Sounds interesting. I'll follow you.

I'll also mention that there's someone streaming development of a new version of a game called Uniball (like the pen) that I used to and still occassionally play.

http://www.uniballhq.com/
http://www.twitch.tv/ubdev
sob3k
Profile Blog Joined August 2009
United States7572 Posts
Last Edited: 2013-11-07 03:23:34
November 07 2013 03:22 GMT
#7726
CSS/HTML peeps, have you used the checkbox hack to make events happen permanently onclick?

I have it working but I can't get it to trigger an onclick on itself.

Like:

I can make clicking on div1 make div2 change color

but i cant make clicking on div1 make div1 change color

how do you do this? Why won't it work? It it because the sibling conjugator isn't working on itself?

input[type=checkbox]:checked ~ .output {
background: red;
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
TiCHEN
Profile Joined June 2011
Netherlands152 Posts
November 07 2013 18:39 GMT
#7727
Hi all,

i have a small question about javascript and html. This small part of my HTML code needs to be checked with javascript. What has to be done is that javascript needs to check if atleast 1 radio input is filled in and give an error in text, so no pop up.

I don't know how to do this. If any1 could tell me how, i would be very pleased. It is the last part of my assignment

This part with the radio which i need help on
+ Show Spoiler +
<fieldset id="inschrijving">
<div class="container">
<div class="floatLeft">
<label>22 april</label>
<br/>
<br/>
<input type="radio" name="size" value="Hele dag" />Hele dag </br>
<input type="radio" name="size" value="Ochtend" />Ochtend </br>
<input type="radio" name="size" value="Middag" />Middag </br>
<input type="checkbox" name="size3" value="I" />Inclusief lunch </br>
</div>
<div class="floatRight">
<label>23 april</label>
</br>
<br/>
<input type="radio" name="size1" value="Q" />Hele dag<br/>
<input type="radio" name="size1" value="W" />Ochtend<br/>
<input type="radio" name="size1" value="E" />Middag<br/>
<input type="checkbox" name="size2" value="R" />Inclusief lunch<br/>
</div>
</div>


This is my current javascript which includes some other stuff
+ Show Spoiler +
// <SCRIPT LANGUAGE="JavaScript">
// <script>
function validateForm()
{
var errorFound;

if (isEmpty("Naam"))
{
errorFound = true;
}

if (isEmpty("Adres"))
{
errorFound = true;
}

if (isEmpty("Postcode"))
{
errorFound = true;
}

if (isEmpty("Plaats"))
{
errorFound = true;
}

return (!errorFound)



}





function isEmpty(fieldName)
{
var x = document.forms["myForm"][fieldName].value;

if (x==null || x=="")
{
document.forms["myForm"][fieldName].className = "required";
document.getElementById(fieldName + "Verplicht").style.display = "inline";

return true;
}
else
{
document.forms["myForm"][fieldName].className = "";
document.getElementById(fieldName + "Verplicht").style.display = "none";

return false;
};
}

function myPostcode()
{
var x=document.getElementById("postcode").value;
document.getElementById("postcode").value=x.toUpperCase();
}
// </script>
// </SCRIPT>


This is my full HTML file
+ Show Spoiler +
<!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-1" />
<title>vereniging WIES</title>
<script src="file.js">
</script>
<link rel="stylesheet" type="text/css"
href="mainform.css" />
</head>
<body>
<div id="form">
<h3>Aanmelding WIES Congres</h3>


<form name="myForm" action="showform.php" onsubmit="return validateForm();" method="post">


<INPUT TYPE="hidden" NAME="to" VALUE="a" />
<p class="legend">Deelnemer</p>
<fieldset id="deelnemer">

<label>Naam</label><input type="text" name="Naam" size="30"/>
<label> Bedrijf </label><input type = "text" name = "Bedrijf" size = "30" /> </br>
<label>Adres</label><input type = "text" name = "Adres" size = "30" /><br/>
<label>Postcode</label><input type = "text" name = "Postcode" id="postcode" onblur="myPostcode();" size = "30" />
<label> Plaats</label><input type = "text" name = "Plaats" size = "30" /></br>

<label>Land</label>
<select name="land">
<option value="Nederland" selected="selected">Nederland</option>
<option value="Belgie">Belgie</option>
<option value="Duitsland">Duitsland</option>
<option value="Frankrijk">Frankrijk</option>
<option value="Luxemburg">Luxemburg</option>
</select>
<br/><br/>

<label>WIES ID</label><input type="radio" name="Ja" value="Ja" id="Ja" />Ja<input type="radio" name="Ja" value="Nee" id="Nee"/>Nee<br/>
<label class="lidnummer">Lidnummer</label><input type = "text" name = "getal1" maxlength = "6" size = "25" /><br/>
<label class="lidnummer">WIES pin</label><input type = "password" maxlength ="4" name = "getal2" size = "25" /><br/>

<div>
<span id="NaamVerplicht" class="Error">* Naam is verplicht.</span><br />
<span id="AdresVerplicht" class="Error">* Adres is verplicht.</span><br />
<span id="PostcodeVerplicht" class="Error">* Postcode is verplicht.</span><br />
<span id="PlaatsVerplicht" class="Error">* Plaats is verplicht.</span><br />
</div>

</fieldset>

<p class="legend">inschrijving</p>
<fieldset id="inschrijving">
<div class="container">
<div class="floatLeft">
<label>22 april</label>
<br/>
<br/>
<input type="radio" name="size" value="Hele dag" />Hele dag </br>
<input type="radio" name="size" value="Ochtend" />Ochtend </br>
<input type="radio" name="size" value="Middag" />Middag </br>
<input type="checkbox" name="size3" value="I" />Inclusief lunch </br>
</div>
<div class="floatRight">
<label>23 april</label>
</br>
<br/>
<input type="radio" name="size1" value="Q" />Hele dag<br/>
<input type="radio" name="size1" value="W" />Ochtend<br/>
<input type="radio" name="size1" value="E" />Middag<br/>
<input type="checkbox" name="size2" value="R" />Inclusief lunch<br/>
</div>
</div>
</br></br></br>

De kosten voor de hele dag zijn 150,--,
een enkele sessie: 90,--. <br/>
WIES leden 50% korting
De lunch kost 15,--
</fieldset>


<p class="legend">Enquete</p>
<fieldset id="Enquête">
<label>Functie</label><input type="radio" name="size6" value="H" />Manager <input type="radio" name="size6" value="H" />Informatieanalist
<input type="radio" name="size6" value="H" />Ontwikkelaar <input type="radio" name="size6" value="H" />Docent
<input type="radio" name="size6" value="H" />Overig
</br>
</br>
<label class="Vakgebied">Vakgebied </label>
<select name="beroep" id="beroep"
multiple="multiple" size="4">
<option value="automatisering" selected="selected">automatisering</option>
<option value="onderwijs">onderwijs</option>
<option value="overheid">overheid</option>
<option value="industrie">industrie</option>
<option value="handel">handel</option>
<option value="gezondheidszorg">gezondheidszorg</option>
<option value="banken
verzekeringen">banken
verzekeringen</option>
<option value="telecommunicatie">telecommunicatie</option>
<option value="Overig">Overig</option>
</select>
</br>
</br>

<label class="labelenquette">Bedrijfsgrootte</label>
<select name="personeel">
<option value="weining">0-10</option>
<option value="mkb">10-50</option>
<option value="mkbgroot">50-100</option>
<option value="zakelijk">100-500</option>
<option value="grootzakelijk">500 of meer</option>
</select>

</fieldset>
<p class="legend">Opmerkingen</p>
<fieldset id="Opmerkingen">
<TEXTAREA NAME="Opmerkingen" ROWS="5" COLS="40">

</TEXTAREA>
</fieldset>

<p id="buttons">
<input type="submit" value="Aanmelden" />
</p>
</form>
</div>
</body>
</html>


I had something like this:
if (!document.getElementById("radio button 1").checked && !document.getElementById("radio button 2").checked && !document.getElementById("radio button 3").checked && !document.getElementById("radio button 4").checked && !document.getElementById("radio button 5").checked &&!document.getElementById("radio button 6").checked )
{
errorFound=true;
}

I put this in my validateForm function. Im a big Javascript noobie so any help is appreciated.
VyingsP
Profile Joined December 2011
France174 Posts
November 07 2013 19:43 GMT
#7728
On November 08 2013 03:39 TiCHEN wrote:
Hi all,

i have a small question about javascript and html. This small part of my HTML code needs to be checked with javascript. What has to be done is that javascript needs to check if atleast 1 radio input is filled in and give an error in text, so no pop up.

I don't know how to do this. If any1 could tell me how, i would be very pleased. It is the last part of my assignment

This part with the radio which i need help on
+ Show Spoiler +
<fieldset id="inschrijving">
<div class="container">
<div class="floatLeft">
<label>22 april</label>
<br/>
<br/>
<input type="radio" name="size" value="Hele dag" />Hele dag </br>
<input type="radio" name="size" value="Ochtend" />Ochtend </br>
<input type="radio" name="size" value="Middag" />Middag </br>
<input type="checkbox" name="size3" value="I" />Inclusief lunch </br>
</div>
<div class="floatRight">
<label>23 april</label>
</br>
<br/>
<input type="radio" name="size1" value="Q" />Hele dag<br/>
<input type="radio" name="size1" value="W" />Ochtend<br/>
<input type="radio" name="size1" value="E" />Middag<br/>
<input type="checkbox" name="size2" value="R" />Inclusief lunch<br/>
</div>
</div>


This is my current javascript which includes some other stuff
+ Show Spoiler +
// <SCRIPT LANGUAGE="JavaScript">
// <script>
function validateForm()
{
var errorFound;

if (isEmpty("Naam"))
{
errorFound = true;
}

if (isEmpty("Adres"))
{
errorFound = true;
}

if (isEmpty("Postcode"))
{
errorFound = true;
}

if (isEmpty("Plaats"))
{
errorFound = true;
}

return (!errorFound)



}





function isEmpty(fieldName)
{
var x = document.forms["myForm"][fieldName].value;

if (x==null || x=="")
{
document.forms["myForm"][fieldName].className = "required";
document.getElementById(fieldName + "Verplicht").style.display = "inline";

return true;
}
else
{
document.forms["myForm"][fieldName].className = "";
document.getElementById(fieldName + "Verplicht").style.display = "none";

return false;
};
}

function myPostcode()
{
var x=document.getElementById("postcode").value;
document.getElementById("postcode").value=x.toUpperCase();
}
// </script>
// </SCRIPT>


This is my full HTML file
+ Show Spoiler +
<!DOCTYPE html>
<html>
<head>
<meta charset="iso-8859-1" />
<title>vereniging WIES</title>
<script src="file.js">
</script>
<link rel="stylesheet" type="text/css"
href="mainform.css" />
</head>
<body>
<div id="form">
<h3>Aanmelding WIES Congres</h3>


<form name="myForm" action="showform.php" onsubmit="return validateForm();" method="post">


<INPUT TYPE="hidden" NAME="to" VALUE="a" />
<p class="legend">Deelnemer</p>
<fieldset id="deelnemer">

<label>Naam</label><input type="text" name="Naam" size="30"/>
<label> Bedrijf </label><input type = "text" name = "Bedrijf" size = "30" /> </br>
<label>Adres</label><input type = "text" name = "Adres" size = "30" /><br/>
<label>Postcode</label><input type = "text" name = "Postcode" id="postcode" onblur="myPostcode();" size = "30" />
<label> Plaats</label><input type = "text" name = "Plaats" size = "30" /></br>

<label>Land</label>
<select name="land">
<option value="Nederland" selected="selected">Nederland</option>
<option value="Belgie">Belgie</option>
<option value="Duitsland">Duitsland</option>
<option value="Frankrijk">Frankrijk</option>
<option value="Luxemburg">Luxemburg</option>
</select>
<br/><br/>

<label>WIES ID</label><input type="radio" name="Ja" value="Ja" id="Ja" />Ja<input type="radio" name="Ja" value="Nee" id="Nee"/>Nee<br/>
<label class="lidnummer">Lidnummer</label><input type = "text" name = "getal1" maxlength = "6" size = "25" /><br/>
<label class="lidnummer">WIES pin</label><input type = "password" maxlength ="4" name = "getal2" size = "25" /><br/>

<div>
<span id="NaamVerplicht" class="Error">* Naam is verplicht.</span><br />
<span id="AdresVerplicht" class="Error">* Adres is verplicht.</span><br />
<span id="PostcodeVerplicht" class="Error">* Postcode is verplicht.</span><br />
<span id="PlaatsVerplicht" class="Error">* Plaats is verplicht.</span><br />
</div>

</fieldset>

<p class="legend">inschrijving</p>
<fieldset id="inschrijving">
<div class="container">
<div class="floatLeft">
<label>22 april</label>
<br/>
<br/>
<input type="radio" name="size" value="Hele dag" />Hele dag </br>
<input type="radio" name="size" value="Ochtend" />Ochtend </br>
<input type="radio" name="size" value="Middag" />Middag </br>
<input type="checkbox" name="size3" value="I" />Inclusief lunch </br>
</div>
<div class="floatRight">
<label>23 april</label>
</br>
<br/>
<input type="radio" name="size1" value="Q" />Hele dag<br/>
<input type="radio" name="size1" value="W" />Ochtend<br/>
<input type="radio" name="size1" value="E" />Middag<br/>
<input type="checkbox" name="size2" value="R" />Inclusief lunch<br/>
</div>
</div>
</br></br></br>

De kosten voor de hele dag zijn 150,--,
een enkele sessie: 90,--. <br/>
WIES leden 50% korting
De lunch kost 15,--
</fieldset>


<p class="legend">Enquete</p>
<fieldset id="Enquête">
<label>Functie</label><input type="radio" name="size6" value="H" />Manager <input type="radio" name="size6" value="H" />Informatieanalist
<input type="radio" name="size6" value="H" />Ontwikkelaar <input type="radio" name="size6" value="H" />Docent
<input type="radio" name="size6" value="H" />Overig
</br>
</br>
<label class="Vakgebied">Vakgebied </label>
<select name="beroep" id="beroep"
multiple="multiple" size="4">
<option value="automatisering" selected="selected">automatisering</option>
<option value="onderwijs">onderwijs</option>
<option value="overheid">overheid</option>
<option value="industrie">industrie</option>
<option value="handel">handel</option>
<option value="gezondheidszorg">gezondheidszorg</option>
<option value="banken
verzekeringen">banken
verzekeringen</option>
<option value="telecommunicatie">telecommunicatie</option>
<option value="Overig">Overig</option>
</select>
</br>
</br>

<label class="labelenquette">Bedrijfsgrootte</label>
<select name="personeel">
<option value="weining">0-10</option>
<option value="mkb">10-50</option>
<option value="mkbgroot">50-100</option>
<option value="zakelijk">100-500</option>
<option value="grootzakelijk">500 of meer</option>
</select>

</fieldset>
<p class="legend">Opmerkingen</p>
<fieldset id="Opmerkingen">
<TEXTAREA NAME="Opmerkingen" ROWS="5" COLS="40">

</TEXTAREA>
</fieldset>

<p id="buttons">
<input type="submit" value="Aanmelden" />
</p>
</form>
</div>
</body>
</html>


I had something like this:
if (!document.getElementById("radio button 1").checked && !document.getElementById("radio button 2").checked && !document.getElementById("radio button 3").checked && !document.getElementById("radio button 4").checked && !document.getElementById("radio button 5").checked &&!document.getElementById("radio button 6").checked )
{
errorFound=true;
}

I put this in my validateForm function. Im a big Javascript noobie so any help is appreciated.


What exactly is your problem ? The answer Mindcrime gave you seems to be working...
http://jsfiddle.net/3n3Kx/

Corrections of my bad english are much welcome
TiCHEN
Profile Joined June 2011
Netherlands152 Posts
November 07 2013 20:24 GMT
#7729
Ah yes, i got it now. I had it misstyped in my if statement . i only had 1 & in one of my lines. Idk why, probably deleted it by accident.

I got this to work now. Now what I think i need to do, is make a new function in my javascript that will tell my html that it is not checked and my html can display some kind of error,
Something like this?: <span id="sizeVerplicht" class="Error">* day required</span><br />

like i did in my first paragraph :
<div>
<span id="NaamVerplicht" class="Error">* Naam is verplicht.</span><br />
<span id="AdresVerplicht" class="Error">* Adres is verplicht.</span><br />
<span id="PostcodeVerplicht" class="Error">* Postcode is verplicht.</span><br />
<span id="PlaatsVerplicht" class="Error">* Plaats is verplicht.</span><br />
</div>

The thing is, i made this with a isEmpty function, but i can't use that for my radio buttons can i? How exactly can i do this?
VyingsP
Profile Joined December 2011
France174 Posts
November 07 2013 20:37 GMT
#7730
On November 07 2013 12:22 sob3k wrote:
CSS/HTML peeps, have you used the checkbox hack to make events happen permanently onclick?

I have it working but I can't get it to trigger an onclick on itself.

Like:

I can make clicking on div1 make div2 change color

but i cant make clicking on div1 make div1 change color

how do you do this? Why won't it work? It it because the sibling conjugator isn't working on itself?

input[type=checkbox]:checked ~ .output {
background: red;


Dunno if that's what you are looking for, or if you found by yourself already, but I think I got this working :
http://jsfiddle.net/as3nT/

But I'm pretty sure a div inside a label is not w3c compliant
Corrections of my bad english are much welcome
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
November 07 2013 21:29 GMT
#7731
.NET networking question:

All that I'm about to describe happens within a LAN...

So I have a server with a windows service that I built. This service does work all day, specifically database work. What I would like to do is build a client service that will run on individual client machines. This client service will listen for events from the server service and alert the user to key events should they happen. These key events are user specific, meaning the server service can generate an event that might only apply to one specific user.

I typically approach things from a database perspective. From that perspective, it would be easy to have the server service generate events and save them in the database, and have the client services always checking the database and looking for user specific events. But I don't think that would be practical in this case. The database is already taxed during the day. It would be hard-pressed if I had a few hundred clients constantly running checks against the server.

I think a better solution would be to have the client services to connect and talk directly to the server service via peer-to-peer network connectivity. Perhaps the client machines can send a packet to the service saying "hey, I'm here" along with the user credentials every so often, and when the service has an event specific to the user, it will alert the client that has that user's credentials if the client has pinged within a certain threshold. If it fails, it's fine; it just means the user has logged off or shutdown the computer.

I'm just not entirely sure how to do direct peer-to-peer network connectivity in .NET. Anyone have any experience with this sort of thing? Perhaps can you point me in the right direction without giving a detailed solution if you don't want to?
supereddie
Profile Joined March 2011
Netherlands151 Posts
November 07 2013 21:33 GMT
#7732
Check out WCF service with Callbacks. Might be overkill for a simple app though.
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
VyingsP
Profile Joined December 2011
France174 Posts
November 07 2013 21:42 GMT
#7733
Maybe try something like the observer pattern ? When the client app starts, it contacts the server and registers to some events and whenever an event occurs, the server contacts the app back and notifies it ? Depends on your environment obviously.
Corrections of my bad english are much welcome
ThatGuy
Profile Blog Joined April 2008
Canada695 Posts
November 07 2013 21:46 GMT
#7734
You could use the .NET Socket class to establish network connectivity and handle communication between the server and the client. You can read up on the Socket class and its usage here: http://msdn.microsoft.com/en-us/library/System.Net.Sockets.Socket(v=vs.110).aspx

As for how to approach this problem, I think a good place to start would be to have the server have a listening loop available (check Socket.Listen), awaiting incoming connections from clients. When a new client asks to connect, the server receives the request and saves it locally to a client list. Conversely, the server removes the client from its list when it detects that a connection has been terminated (plenty of exception handling you'll have to watch out for). When it has something it needs to communicate to the clients, it iterates through the list of clients, broadcasting its message.

Client side, it sits there waiting for signals from the server (like the listen loop), and does whatever you want it to .

You may want to look into multithreading this application (especially the server), to prevent your applications from stalling while it listens for information.
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
November 07 2013 22:00 GMT
#7735
I've known of the Socket class, but never dabbled into it since most of the work I do is database driven. That might be the solution I'm looking for; I'll do some googling and see if I can find some basic examples using it.

For some reason, I always thought the WCF was for web services. Either way, I'll check that out too.

I wasn't expecting answers so quickly! Thanks for your help.
Zocat
Profile Joined April 2010
Germany2229 Posts
November 07 2013 22:26 GMT
#7736
WCF - MSMQ
Overall you're looking for the publish/subscribe or message queuing patterns.
Those should be able to deliver the messages even if the client went offline (as soon as he goes on he can consume it).

If you just want to broadcast to active clients, I'd say sockets & keeping a userlist (with various flags for the type of message they should receive). If you dont care about security you can perform the "is the message for me" check on the client.

misirlou
Profile Joined June 2010
Portugal3306 Posts
November 07 2013 23:56 GMT
#7737
MSMQ only really needed if you want the messages to be delivered offline. I think using WCF with callbacks (wsdualhttpbinding if I recall?) is the most appropriate option, it implements the observer pattern. Sockets are also easy to use, but they aren't really web services.
sob3k
Profile Blog Joined August 2009
United States7572 Posts
November 08 2013 07:20 GMT
#7738
On November 08 2013 05:37 VyingsP wrote:
Show nested quote +
On November 07 2013 12:22 sob3k wrote:
CSS/HTML peeps, have you used the checkbox hack to make events happen permanently onclick?

I have it working but I can't get it to trigger an onclick on itself.

Like:

I can make clicking on div1 make div2 change color

but i cant make clicking on div1 make div1 change color

how do you do this? Why won't it work? It it because the sibling conjugator isn't working on itself?

input[type=checkbox]:checked ~ .output {
background: red;


Dunno if that's what you are looking for, or if you found by yourself already, but I think I got this working :
http://jsfiddle.net/as3nT/

But I'm pretty sure a div inside a label is not w3c compliant


Thanks a ton, looks great to me!
In Hungry Hungry Hippos there are no such constraints—one can constantly attempt to collect marbles with one’s hippo, limited only by one’s hippo-levering capabilities.
PandaCore
Profile Blog Joined September 2010
Germany553 Posts
November 08 2013 14:40 GMT
#7739
This is pretty much a long shot, but I'm kind of stuck right now. I haven't been in web development for 7 years and I'm a bit out of touch concerning new technologies in that area.

Hopefully someone can point me in a direction where I can read up on a bit more.

I need to develop a rich internet application, where a user can customize their own UI. It starts as an empty page and then you can add elements for visualization (i.e. gauges, line graphs, bar graphs, etc.) and position them freely on the main window.

These visual elements receive data from a remote server and have to be able to display those within milliseconds. This is very important. Also this should just run on most of the modern browser without the need of any additional plugins. Using Flash is out of question as well, even though it seems quite good for that kind of application.

That's the very basic description. HTML5+jQuery looks nice for just visualizing data, but I'm not too sure on the actual aspect of being able to customize the appearance freely in a browser environment (i.e. being able to get context menus, adding new elements, opening configuration windows for the elements etc.).

I come from a background of desktop application development, so I probably need to rethink how to let the user interact and work with things in a browser environment as well.
I has a flavor
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
November 08 2013 17:52 GMT
#7740
On November 08 2013 23:40 PandaCore wrote:This is pretty much a long shot, but I'm kind of stuck right now. I haven't been in web development for 7 years and I'm a bit out of touch concerning new technologies in that area.

Hopefully someone can point me in a direction where I can read up on a bit more.

I need to develop a rich internet application, where a user can customize their own UI. It starts as an empty page and then you can add elements for visualization (i.e. gauges, line graphs, bar graphs, etc.) and position them freely on the main window.

These visual elements receive data from a remote server and have to be able to display those within milliseconds. This is very important. Also this should just run on most of the modern browser without the need of any additional plugins. Using Flash is out of question as well, even though it seems quite good for that kind of application.

That's the very basic description. HTML5+jQuery looks nice for just visualizing data, but I'm not too sure on the actual aspect of being able to customize the appearance freely in a browser environment (i.e. being able to get context menus, adding new elements, opening configuration windows for the elements etc.).

I come from a background of desktop application development, so I probably need to rethink how to let the user interact and work with things in a browser environment as well.


You actually don't, these days. If you want to do the displaying part yourself, familiarize yourself with the HTML5 Canvas, which is basically a 2D graphics environment that you can manipulate just like in a normal desktop environment.

Depending on wether you want to have your data transfer active or passive (polling), you can either go websockets (active) which work similar to TCP as a persistent 2-way connection or you simply use AJAX to regularly request new data (passive) and then update the canvas elements belonging to it.

There are also some libraries, jquery and otherwise, that already deal with making graphs out of things. A quick google offers 5 libraries that should do the job. About 2 years ago i worked with jqPlot for a similar use-case and it was easy enough to use, though other libraries might be better suited for your specific use-case.

You can treat it just like a desktop environment with it's own scripting language and network protocol, no real need to concern yourself too much with HTTP other than as a proxy between the browser and the database. Just think about how you would do it in a desktop application and do it just the same way except in javascript.
Prev 1 385 386 387 388 389 1032 Next
Please log in or register to reply.
Live Events Refresh
Kung Fu Cup
11:00
2026 Week 15
IntoTheiNu 1281
RotterdaM751
WardiTV613
Ryung 457
TKL 315
SteadfastSC189
IndyStarCraft 177
Rex143
CosmosSc2 79
EnkiAlexander 42
LiquipediaDiscussion
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
RotterdaM 751
Ryung 457
TKL 315
SteadfastSC 189
IndyStarCraft 177
LamboSC2 170
Rex 143
CosmosSc2 79
StarCraft: Brood War
Calm 4882
Bisu 3207
Shuttle 2703
Jaedong 1737
Horang2 609
Soma 571
Mini 485
Light 424
Stork 352
actioN 285
[ Show more ]
EffOrt 280
ggaemo 223
firebathero 201
Zeus 182
hero 161
Soulkey 134
Mong 102
sorry 93
Snow 87
Killer 63
Pusan 57
Movie 51
Free 51
soO 40
Hyun 37
ToSsGirL 35
910 32
scan(afreeca) 27
Barracks 24
Yoon 13
zelot 13
Rock 13
Sacsri 13
IntoTheRainbow 12
GoRush 11
NotJumperer 10
Terrorterran 9
Sexy 8
Dota 2
Gorgc7472
qojqva348
syndereN187
XcaliburYe142
canceldota5
League of Legends
Doublelift3205
KnowMe79
Counter-Strike
byalli575
x6flipin222
kRYSTAL_14
Heroes of the Storm
Khaldor108
Other Games
Liquid`RaSZi735
hiko703
B2W.Neo665
Lowko355
Liquid`VortiX127
XaKoH 123
Livibee120
ToD108
amsayoshi46
Organizations
Other Games
gamesdonequick2625
BasetradeTV208
StarCraft: Brood War
Kim Chul Min (afreeca) 10
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 14 non-featured ]
StarCraft 2
• mYiSmile111
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
League of Legends
• Jankos2463
• TFBlade979
Other Games
• Shiphtur48
Upcoming Events
Replay Cast
17h 48m
CrankTV Team League
19h 48m
Replay Cast
1d 17h
CrankTV Team League
1d 19h
Replay Cast
2 days
RSL Revival
2 days
Clem vs Lambo
Scarlett vs Cure
CranKy Ducklings
2 days
IPSL
3 days
Dragon vs Hawk
RSL Revival
3 days
Classic vs Trap
herO vs SHIN
Sparkling Tuna Cup
3 days
[ Show More ]
IPSL
4 days
Bonyth vs Ret
WardiTV Weekly
4 days
Monday Night Weeklies
5 days
PiGosaur Cup
6 days
The PondCast
6 days
Liquipedia Results

Completed

YSL S3
HSC XXIX
Eternal Conflict S2 E2

Ongoing

IPSL Spring 2026
Acropolis #4
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
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
BLAST Rivals Spring 2026

Upcoming

Escore Tournament S3: W3
ASL S22 SEASON OPEN Day 1
Escore Tournament S3: W4
ASL S22 SEASON OPEN Day 2
Escore Tournament S3: W5
CSLAN 4
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
Light Tournament 2026
Eternal Conflict S2 Finale
Eternal Conflict S2 E3
Logitech G Connect 2026
StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
BLAST Bounty Summer Qual
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.