The Entrepreneur Forum | Startups | Entrepreneurship | Starting a Business | Motivation | Success

OFF-TOPIC Having Fun

404profound

Platinum Contributor
I've Read UNSCRIPTED
Speedway Pass
Aug 27, 2017
1,317
2,679
658
Desert of Desertion
I have been working on my app for five full months now, and am making good progress. Just sharing some of the things I look at to get a laugh when the going (often) gets rough. Hopefully other technically-inclined folks can relate haha.









 

Don't like ads? Remove them while supporting the forum. Subscribe.

Dylan Hobrecht

Contributor
FASTLANE INSIDER
Read Millionaire Fastlane
I've Read UNSCRIPTED
Aug 26, 2017
100
92
78
Texas
That stuff is rough. I couldn't wrap my head around getting the exact right code. Especially with a wall of code.

Beneficial...so helpful. I know it sucks but if it's pushing you towards your goals. Nuh uh your not leaving me behind!


Sent from my iPhone using Tapatalk
 
OP
OP
404profound

404profound

Platinum Contributor
I've Read UNSCRIPTED
Speedway Pass
Aug 27, 2017
1,317
2,679
658
Desert of Desertion
This one is fantastic.
_______________
//Code sanitized to protect the foolish.
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using System.Web.UI;

namespace Mobile.Web.Control
{
/// <summary>
/// Class used to work around Richard being a F*cking idiot
/// </summary>
/// <remarks>
/// The point of this is to work around his poor design so that paging will
/// work on a mobile control. The main problem is the BindCompany() method,
/// which he hoped would be able to do everything. I hope he dies.
/// </remarks>
public abstract class RichardIsAFuckingIdiotControl : MobileBaseControl, ICompanyProfileControl
{
protected abstract Pager Pager { get; }

public void BindCompany(int companyId) { }

public RichardIsAFuckingIdiotControl()
{
MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity();
}

private void MakeSureNobodyAccidentallyGetsBittenByRichardsStupidity()
{
// Make sure nobody is actually using that F*cking bindcompany method
MethodInfo m = this.GetType().GetMethod("BindCompany", BindingFlags.DeclaredOnly |
BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
if (m != null)
{
throw new RichardIsAFuckingIdiotException("No!! Don't use the F*cking BindCompany method!!!");
}
// P.S. this method is a joke ... the rest of the class is F*cking serious
}

/// <summary>
/// This returns true if this control is supposed to be doing anything
/// at all for this request. Richard thought it was a good idea to load
/// the entire website during every request and have things turn themselves
/// off. He also thought bandanas and aviator sunglasses were "F*ckin'
/// gnarly, dude."
/// </summary>
protected bool IsThisTheRightPageImNotSureBecauseRichardIsDumb()
{
return Request.QueryString["Section"] == this.MenuItemKey;
}

protected override void OnLoad(EventArgs e)
{
if (IsThisTheRightPageImNotSureBecauseRichardIsDumb())
{
Page.LoadComplete += new EventHandler(Page_LoadComplete);
Pager.RowCount = GetRowCountBecauseRichardIsDumb();
}
base.OnLoad(e);
}

protected abstract int GetRowCountBecauseRichardIsDumb();
protected abstract void BindDataBecauseRichardIsDumb();

void Page_LoadComplete(object sender, EventArgs e)
{
BindDataBecauseRichardIsDumb();
}

// the rest of his reduh-ndant interface members
public abstract string MenuItemName { get; set; }
public abstract string MenuItemKey { get; set; }
public abstract bool IsCapable(CapabilityCheck checker, int companyId);
public abstract bool ShowInMenu { get; }
public virtual Control CreateHeaderControl()
{
return null;
}
}
}
 

Create an account or login to comment

You must be a member in order to leave a comment

Create account

Create an account on our community. It's easy!

Log in

Already have an account? Log in here.



Don't like ads? Remove them while supporting the forum. Subscribe to become an INSIDER.

Post New Topic

Please SEARCH before posting.
Please select the BEST category.

Post new topic

Fastlane Insiders

View the forum AD FREE.
Private, unindexed content
Detailed process/execution threads
Monthly conference calls with doers
Ideas needing execution, more!

Join Fastlane Insiders.

Top Bottom