Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Sulla Faex
May 14, 2010

No man ever did me so much good, or enemy so much harm, but I repaid him with ENDLESS SHITPOSTING
I've never developed mobile apps so I'm not sure. But I've seen the same problems on iphones and windows phones so it's not just an android thing, although they might very well have the same curse to greater degrees. It's just indicative of the modern concept -- people aren't clients, they're not customers, they're dairy cows who pay for the honour of being milked.

Adbot
ADBOT LOVES YOU

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Lumpy posted:

Use flexbox and say screw you to IE!!! Or use flexbox with inline-block fallover: http://jsfiddle.net/qzk5Q/1/ (take out the flexbox stuff to see what IE < 11 sees)


Just think, in like 4 or 5 years, we'll actually be able to use flexbox.....

(edited to make the text in the fiddle HUGER!)

I don't know why they picked the name 'flexbox' but I guess it's easier to type than 'use-a-layout-algorithm-rather-than-a-convoluted-annoying-puzzle-game-on-this-element' :allears:

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
I have a (probably easy) bootstrappish design question. I've got a list of Things that I'd like to display for the user, and also I'd like to provide the option to add a new Thing. Right now it looks like this, with 'New Portfolio' being the active item (eg, somewhere else on the screen the user is able to edit / view this item). This is a bootstrap list-group, and the top is just a regular button. It looks goony as hell but I can't figure out what makes sense. Should I make the entire top row a colored button? Should I just center the button that's there? Should I break the button out of the list-group and have it above or below? This problem is solved in about a billion different webpages but for some reason I can't locate any right now.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Newf posted:

I have a (probably easy) bootstrappish design question. I've got a list of Things that I'd like to display for the user, and also I'd like to provide the option to add a new Thing. Right now it looks like this, with 'New Portfolio' being the active item (eg, somewhere else on the screen the user is able to edit / view this item). This is a bootstrap list-group, and the top is just a regular button. It looks goony as hell but I can't figure out what makes sense. Should I make the entire top row a colored button? Should I just center the button that's there? Should I break the button out of the list-group and have it above or below? This problem is solved in about a billion different webpages but for some reason I can't locate any right now.



A pattern I use frequently is to have an "add" button off to the side of the title of the list. Here is a very ugly example: http://jsfiddle.net/zBUCX/

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Munkeymon posted:

I don't know why they picked the name 'flexbox' but I guess it's easier to type than 'use-a-layout-algorithm-rather-than-a-convoluted-annoying-puzzle-game-on-this-element' :allears:

Hyatt picked "flex-box" in 1998 when we were doing the first versions of XUL in order to do UI layout (poorly supported by CSS's box model, especially then, as we all know). It was "flex" for "flexibility" as I recall, because it indicated how much that element should be resized, proportionately, in order to fill the containing element. When he went to Apple to work on Safari in secret (:ssh:) he implemented it again there, mostly-compatibly in khtml-later-WebKit. Modern flex-box semantics don't match the XUL ones, and this is very much for the best.

The Android permissions model is arguably the worst of available options: mismatched socks from a drawer of permissions, vaguely described for maximum terror, and no ability to ask for permissions in-flow where it can be clearer to the user why the permission is needed. Example is calendar-access, which in Facebook is for event<->calendar sync (widely requested feature!), but we can't really tell you that and you can't tell us/the OS whether you want to enable it. Compare location/push/photos/contacts on iOS. Requesting a new permission also breaks auto-update in some cases (but not all, so I'm not sure what the point is anymore tbh), and at one point *removing* a permission request also blocked auto-update. (When I managed the FB Android team, I pushed out one release that just removed a permission and changed a diagnostic flag. Interestingly, we got the same amount of "everything is worse"/"everything is better" Play Store feedback as with every other release.)

The Dave
Sep 9, 2003

Newf posted:

I have a (probably easy) bootstrappish design question. I've got a list of Things that I'd like to display for the user, and also I'd like to provide the option to add a new Thing. Right now it looks like this, with 'New Portfolio' being the active item (eg, somewhere else on the screen the user is able to edit / view this item). This is a bootstrap list-group, and the top is just a regular button. It looks goony as hell but I can't figure out what makes sense. Should I make the entire top row a colored button? Should I just center the button that's there? Should I break the button out of the list-group and have it above or below? This problem is solved in about a billion different webpages but for some reason I can't locate any right now.



If I'm getting this correct, this is like an option select, the are currently in "New Portfolio", and you want to support creating a new portfolio as an option?

This could be alleviated by not having the active item also looking so much like a button. I feel like if "Add New portfolio" was maybe just blue text, and "New Portfolio" was just highlighted by a light grey, it would better convey the message.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
I think that I agree with you, and the selected items are really quite loud. This is Bootstrap's default though - each list item is class="list-item" and the active one is class="list-item active". The following is an adjustment along the lines of Lumpy's suggestion, and I think it improves things but I think I've still got a way to go.

Portfolio 3 below is reacting to a :hover (again, bootstrap defaults).

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

Newf posted:

I think that I agree with you, and the selected items are really quite loud. This is Bootstrap's default though - each list item is class="list-item" and the active one is class="list-item active". The following is an adjustment along the lines of Lumpy's suggestion, and I think it improves things but I think I've still got a way to go.

Portfolio 3 below is reacting to a :hover (again, bootstrap defaults).



Add a btn-success to that "Add New" and it will be much less confusing. I think that's the class that makes things green in Bootstrap.

Newf
Feb 14, 2006
I appreciate hacky sack on a much deeper level than you.
I'm a little hesitant to do that because all of the 'Constructive' elements on the page are using the btn-primary (blue) class that the existing button is using. I added this glyphicon though, which helps to differentiate the whole mess. Good enough for now, I think. Thanks for the input.

ShadowHawk
Jun 25, 2000

CERTIFIED PRE OWNED TESLA OWNER
Is attempting to obscure email addresses from crawlers still a thing these days? I'm talking about stuff like displaying an email as "foo AT bar DOT com" in an attempt to confuse harvesting scripts.

Ghostlight
Sep 25, 2009

maybe for one second you can pause; try to step into another person's perspective, and understand that a watermelon is cursing me



I'm interested if more experienced developers can weigh in on it - but:

Everything I read says that you should obscure email addresses from crawlers, but also that basic text processing was part of what crawlers did so simply replacing the @ with 'at' doesn't do anything but inconvenience people because as soon as it became a way to confuse harvesting scripts, harvesting scripts were written to read it. When we put emails on our website I was told they had to have obfuscation but it was left to me how to do it, so they're currently being served up by javascript in rot13 and then unjumbled. I don't know how good that actually is (certainly better than AT DOT), but we didn't get the expected spike in raw spam numbers after putting emails up.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION
I'm not sure if this is the best thread for this, but we use Sitefinity for our CMS and I've just now noticed some strange errors in my Sitefinity logs:
code:
07/29/2014 16:15:19
Type : System.Web.HttpException, System.Web
Message : The file '/api.ashx' does not exist.
Requested URL : [url]http://proxymm.com/api.ashx?cmd=HI[/url]
code:
07/29/2014 23:21:42
Type : System.Web.HttpException, System.Web
Message : A potentially dangerous Request.Path value was detected from the client (:).
Requested URL : [url]http://*.*.*.*/w00tw00t.at.blackhats.romanian.anti-sec:[/url])
These look like some kind of attempted exploit, but I'm a bit confused. The first one is a request to the URL "proxymm.com" - how did my server end up receiving that? I'm assuming they have run their request through a proxy and they're looking for "api.ashx" on our server - why? The second is a request directly to the server IP address with a weird path afterward. How could that possibly be an exploit? Anyone know what they're trying to do here?

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

The Wizard of Poz posted:

I'm not sure if this is the best thread for this, but we use Sitefinity for our CMS and I've just now noticed some strange errors in my Sitefinity logs:
code:
07/29/2014 16:15:19
Type : System.Web.HttpException, System.Web
Message : The file '/api.ashx' does not exist.
Requested URL : [url]http://proxymm.com/api.ashx?cmd=HI[/url]
code:
07/29/2014 23:21:42
Type : System.Web.HttpException, System.Web
Message : A potentially dangerous Request.Path value was detected from the client (:).
Requested URL : [url]http://*.*.*.*/w00tw00t.at.blackhats.romanian.anti-sec:[/url])
These look like some kind of attempted exploit, but I'm a bit confused. The first one is a request to the URL "proxymm.com" - how did my server end up receiving that? I'm assuming they have run their request through a proxy and they're looking for "api.ashx" on our server - why? The second is a request directly to the server IP address with a weird path afterward. How could that possibly be an exploit? Anyone know what they're trying to do here?

If you have a publicly facing server, you can expect these kinds of automated attacks every day. DNS determines what proxymm.com points to but you can override that in your hosts file and make it point to whatever you want.

As for the 2nd one, that's more of them just saying hello to your server and leaving a little calling card. Well, more like waving the middle finger at you as they drive by, I guess.

putin is a cunt
Apr 5, 2007

BOY DO I SURE ENJOY TRASH. THERE'S NOTHING MORE I LOVE THAN TO SIT DOWN IN FRONT OF THE BIG SCREEN AND EAT A BIIIIG STEAMY BOWL OF SHIT. WARNER BROS CAN COME OVER TO MY HOUSE AND ASSFUCK MY MOM WHILE I WATCH AND I WOULD CERTIFY IT FRESH, NO QUESTION

fletcher posted:

If you have a publicly facing server, you can expect these kinds of automated attacks every day. DNS determines what proxymm.com points to but you can override that in your hosts file and make it point to whatever you want.

As for the 2nd one, that's more of them just saying hello to your server and leaving a little calling card. Well, more like waving the middle finger at you as they drive by, I guess.

Okay cool, that was more or less what I suspected. Good to know there's nothing really to worry about then.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

The Wizard of Poz posted:

Okay cool, that was more or less what I suspected. Good to know there's nothing really to worry about then.

I just checked my logwatch report for the first time in awhile, lo and behold...

code:
    404 Not Found
       /MyAdmin/scripts/setup.php: 1 Time(s)
       /admin/config.php: 1 Time(s)
       /apple-touch-icon-precomposed.png: 2 Time(s)
       /apple-touch-icon.png: 2 Time(s)
       /browserconfig.xml: 1 Time(s)
       /manager/html: 1 Time(s)
       /myadmin/scripts/setup.php: 1 Time(s)
       /phpMyAdmin/scripts/setup.php: 1 Time(s)
       /phpmyadmin/scripts/setup.php: 1 Time(s)
       /pma/scripts/setup.php: 1 Time(s)
       /w00tw00t.at.blackhats.romanian.anti-sec:): 1 Time(s)
       /wp-login.php: 1 Time(s)
       /yearbook/uploads/e66239259be184e0cac83290ed5612a4.jpeg: 1 Time(s)
       http://hotel.qunar.com/render/hoteldiv.jsp ... back=XQScript_4: 1 Time(s)
       http://proxymm.com/api.ashx?cmd=HI: 3 Time(s)
Looks like they hit my server about every 3 days for the past 4 years.

Molten Llama
Sep 20, 2006

The Wizard of Poz posted:

These look like some kind of attempted exploit, but I'm a bit confused. The first one is a request to the URL "proxymm.com" - how did my server end up receiving that?

Though it's rarely used by actual clients, the HTTP standard allows for absolute URIs in requests.

GET http://www.mysite.com/ is just as valid as the common GET /. Your server received that because the request was made to your server. Similarly, you can ask Google's servers for the Yahoo front page, and they'll see a request for yahoo.com in their logs.

Abusing this was popular a few years back to get people to click spam/malware links from their logs.

Molten Llama fucked around with this message at 07:53 on Jul 30, 2014

Vitamean
May 31, 2012

I'm pretty much an amateur at web development, but over the summer we got a pretty large project at my work study position (I work for my school's web services department) for putting together a page to be displayed on a kiosk monitor. I've been getting by pretty well on my own, banging out what I can and googling what I don't know how to do, but I've hit a wall recently and was wondering if I could get some help.

Each kiosk has policies delivered to it that we can then assign to variables if we wish. So, in order to determine the location of a kiosk, each kiosk will be assigned a policy with their location name. So, the one in the main lobby will be sent a location policy with the name Main.Lobby, or the ones positioned at the north/south entrances of the theater will receive a North.Theater/South.Theater policy, respectively. This part I've pretty much figured out how to do, but it leads into my actual problem.

Each kiosk is meant to list the events currently happening on campus, as well as a directory listing of departments. When the user touches the location name of an event or department, it's meant to pull up a map on an iframe to direct them to the building where the office or event is at.

What I want to do is, on the server, create separate folders for each starting location, then in each folder will be maps for each destination. So, in the /mainlobby/ folder will be images titled andershall.png, cafeteria.png, and so on. Then, in Javascript, I'd like to assign to a string variable the location of each map folder, which I feel like I've done correctly:

code:
  
  var mapRoot = "/"

  if (kiosk_name == "Main.Lobby"){
	mapRoot = "http://.../kiosk/maps/mainlobby/"}
  else if (kiosk_name == "South.Theater"){
	mapRoot = "http://.../kiosk/maps/stheater/"}
  else if (kiosk_name == "North.Theater"){
	mapRoot = "http://.../kiosk/maps/ntheater/"}

After that is where I get confused. What I want to happen is, in the HTML, I want to be able to append the name of the destination map to the end mapRoot string(so the resulting link would end up reading ".../ntheater/cafeteria.png", for example), and then have the resulting link open in the destination iframe. I can find information on doing one or two of these things individually, but not how to make it all happen at once.

Jimlit
Jun 30, 2005



Moldy Taxes posted:


code:
  
  var mapRoot = "/"

  if (kiosk_name == "Main.Lobby"){
	mapRoot = "http://.../kiosk/maps/mainlobby/"}
  else if (kiosk_name == "South.Theater"){
	mapRoot = "http://.../kiosk/maps/stheater/"}
  else if (kiosk_name == "North.Theater"){
	mapRoot = "http://.../kiosk/maps/ntheater/"}

After that is where I get confused. What I want to happen is, in the HTML, I want to be able to append the name of the destination map to the end mapRoot string(so the resulting link would end up reading ".../ntheater/cafeteria.png", for example), and then have the resulting link open in the destination iframe. I can find information on doing one or two of these things individually, but not how to make it all happen at once.

First things first, get some semi-colons in there. Specifically after your variables and else if statement.

Secondly, are you using a library like jquery? There are a bunch of ways to do what you are asking and the best answer depends on what you are using.

v1nce
Sep 19, 2004

Plant your brassicas in may and cover them in mulch.

Moldy Taxes posted:

What I want to do is, on the server, create separate folders for each starting location, then in each folder will be maps for each destination. So, in the /mainlobby/ folder will be images titled andershall.png, cafeteria.png, and so on. Then, in Javascript, I'd like to assign to a string variable the location of each map folder, which I feel like I've done correctly:

code:
  
  var mapRoot = "/"

  if (kiosk_name == "Main.Lobby"){
	mapRoot = "http://.../kiosk/maps/mainlobby/"}
  else if (kiosk_name == "South.Theater"){
	mapRoot = "http://.../kiosk/maps/stheater/"}
  else if (kiosk_name == "North.Theater"){
	mapRoot = "http://.../kiosk/maps/ntheater/"}

I want [..] the resulting link would end up reading ".../ntheater/cafeteria.png", for example), and then have the resulting link open in the destination iframe.

Cool kid bandwagon: Do it with JSON.

See those three IF statements that look exactly the same? That's usually the start of a code smell. If your application grows bigger, you'll be duplicating that same code over and over and over to handle more destinations and start locations. Rather than the code reacting to specific parameters (the way your IF statements hinge on kiosk_name), the code could instead parse the request against some configuration, and produce a result.

Also consider using jQuery for DOM interactions and lo-dash for extra cool JS tools. I'm going to write this as if you're using jQuery.

code:
<script>

// JSON Start Locations config
// Each path should contain the full list of Destinations
var startLocations = [
    "Main.Lobby": {
        
        name: "Main Lobby",
        path: "/kiosk/maps/ntheater/",
    },
    "South.Theater": {
        name: "South Theatre",
        path: "/kiosk/maps/stheater/",
    },
    "North.Theater": {
        name: "North Theatre"
        path: "/kiosk/maps/ntheater/",
    }
];

// JSON Destinations Config
// Each folder from StartLocations should have these destinations.
var destinations = [
    "cafeteria": {
       name: "Cateteria",
       path: "cafeteria.png"
    },
    "toilets": {
       name: "Toilets",
       path: "toilets.png"
    }
];
</script>
I'm only going off your description, but that provides two lists. One is a list of startLocations, which provides the full URL to the base directory, and the second is destinations, which lists all possible destinations. I'm assuming these kiosks are only located at startLocations.

I've made the keys of the objects the name used to look them up. That way we can access them quickly by doing startLocations[ "Main.Lobby" ] for instance.
I made up some keys for the destinations. I assume they're picked by a click on an imagemap or something.

code:

<!-- The only HTML you didn't mention was the iFrame. Here it is. 
     Side note: You're just pointing to an image (not a page) so is it necessary to use an iFrame? Why not just an img? -->
<div>
   <iframe id="MyCoolIframe"></iframe>
</div>

<script>
/**
 * Get the route URL from the given kiosk_name and destination_name
 * I'm assuming these get defined (picked) by the user, or something.
 * @param string kiosk_name         Should match "startLocations.x"
 * @param string destination_name   Should match "destinations.x"
 * @return string|false
 */
function createRouteUrl(kiosk_name, destination_name) {

    // Resolve locations
    var start = startLocations[kiosk_name];
    var dest = destinations[destination];

    // Validate: Does start location NOT exist?
    if (start === undefined) {
        // TODO: Consider doing this a better way. Modal? Noty?
        alert('Selected start location does not exist');
        return false;
    }

    // Validate: Does end location NOT exist?
    if (dest === undefined) {
        // TODO: Consider doing this in a better way. Modal? Noty?
        alert('Selected destination does not exist');
        return false;
    }

    // Generate URL
    return start.path + dest.path;
}


/**
 * Change the target location of the iFrame based on kiosk_name and destination_name
 * @param string kiosk_name         Should match "startLocations.x"
 * @param string destination_name   Should match "destinations.x"
 */
function changeMap(kiosk_name, destination_name) {

    // Fetch URL
    var url = createRouteUrl(kiosk_name, destination_name);

    // Validate: URL returned should be non-false. False indicates a cock-up.
    if (url === false) {
        // Do nothing else on error.
        return;
    }

    // Change iFrame src attribute
    $('#MyCoolIframe').attr('src', url);
}

// TODO: Something (user interaction?) should trigger this:
// (this is just a jquery wrapper to fire this on document.ready)
$(function() {

    // Everybody poops
    changeMap("Main.Lobby", "toilets");

});

</script>
So there's a small amount of validation going on in createRouteUrl() - we test the start/dest with a type-sensitive (===) check for "undefined", which basically ensures we could find it in the config array. If it's NOT found, we chuck up an alert and return false.
The parent function, changeMap() checks the result returned by createRouteMap() to ensure it actually returned non-false. It does nothing if an error occurred.

Consider the wonders of configuration; your codes does not need to change in order to add more destinations, you just add it to the config. The trade-off is it's more difficult to handle unique situations, for instance you can't have one destination easily do something the other destinations does not, because it all runs through the same code path.

For future reference, as this is the kind of question that can get pretty complex, it would be good for you to throw the source up on jsFiddle for us if you run into further problems. Your question had so little code it was difficult to write an answer.

v1nce fucked around with this message at 00:31 on Jul 31, 2014

neurotech
Apr 22, 2004

Deep in my dreams and I still hear her callin'
If you're alone, I'll come home.

While this isn't strictly related to web design or development, I'm curious to hear what you guys have to say.

I'm currently in a 'one man band' position where a fairly large amount of responsibility intersects with my role. I don't have any redundancy in terms of an assistant/team member, and if I were to be 'hit by a bus' tomorrow my workplace would be eviscerated for at least a little while. (This isn't bragging, it's just the reality of how things have turned out).

I'm trying to determine some best practices/suitable tools for how to document my work, my processes, various useful items of information related to role responsibilities, etc. I want to start building some sort of central store of documentation in case of the aforementioned 'hit by a bus' scenario occurring.

What do others do in this sorts of situations? Have you been in this situation before? Do you curate and maintain a wiki/giant Word doc on a USB drive/custom web application?

I'm currently leaning towards a wiki because of discreet silos of information in the form of pages, versioning, easy linking - but I'm getting a bit spooked thinking about going too far down the path of something like MediaWiki due to the fact that it needs some sort of server with PHP, MySQL, etc.

Apologies for the text blast but I need to get this out of my brain and into some sort of solution.

The Dave
Sep 9, 2003

For one project my company has a Confluence ( https://www.atlassian.com/software/confluence ) and we use JIRA to plan sprints so it all works pretty well together.

Are your tasks documented at all? You might want to get them in some sort of service so you have written proof of just how much you're doing, then try to use that as leverage to at the least get an intern if you can't get someone you can manage.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb
Confluence and JIRA are awesome, but they are quite large and complex. It might be overkill for your needs.

For smaller projects I like to just use bitbucket issues & wiki

neurotech
Apr 22, 2004

Deep in my dreams and I still hear her callin'
If you're alone, I'll come home.

The Dave posted:

For one project my company has a Confluence ( https://www.atlassian.com/software/confluence ) and we use JIRA to plan sprints so it all works pretty well together.

Are your tasks documented at all? You might want to get them in some sort of service so you have written proof of just how much you're doing, then try to use that as leverage to at the least get an intern if you can't get someone you can manage.

I had a look at Confluence, but I agree with fletcher that I think it's overkill.

I have a little documentation but 99% of it is in my head, which is part of the motivation to start dumping it all into a system.

fuf
Sep 12, 2004

haha
Are any of those cool project management sites / software geared towards one-man operations?

I'd love to consolidate my calendar, todos, documentation and maybe git repos into one place but I've never found something that felt quite right.

Heskie
Aug 10, 2002

fuf posted:

Are any of those cool project management sites / software geared towards one-man operations?

I'd love to consolidate my calendar, todos, documentation and maybe git repos into one place but I've never found something that felt quite right.

Would like this too. The ones I've found aimed at freelancers etc seem to be more focused on billing etc.

I might just have to see how far I can get with Google Apps.

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

fuf posted:

Are any of those cool project management sites / software geared towards one-man operations?

I'd love to consolidate my calendar, todos, documentation and maybe git repos into one place but I've never found something that felt quite right.

Bitbucket is great for this stuff. No support for a calendar though, just use Google Calendar for that.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo
How do y'all do stuff like Chrome Dev Tools on mobile? Specifically, I'd like to do some simple request profiling in various network conditions.

Thermopyle
Jul 1, 2003

...the stupid are cocksure while the intelligent are full of doubt. —Bertrand Russell

fuf posted:

Are any of those cool project management sites / software geared towards one-man operations?

I'd love to consolidate my calendar, todos, documentation and maybe git repos into one place but I've never found something that felt quite right.

Github works well.

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Kobayashi posted:

How do y'all do stuff like Chrome Dev Tools on mobile? Specifically, I'd like to do some simple request profiling in various network conditions.

You can use an Android Debugging Bridge to get at everything an Android phone does, us able as a chrome extension, connect with USB.

For iOS you need a Mac and Safari, connect by USB and you'll get dev tools in Safari.

In both cases you need to activate developer mode on the phone. Google for that.

If you just want network traffic you can use a inspector proxy such as Charles Debugging Proxy or Fiddler, which will show you everything. They're also good to use as a DNS spoof as you may need the phone to point to proper URLs, for example if running oAuth, so you don't want to access the app via IP address.

You really need a proxy to properly debug mobile in these cases, because you want to work off a dev instance rather than live staging or something.

Kobayashi
Aug 13, 2004

by Nyc_Tattoo

Maluco Marinero posted:

You can use an Android Debugging Bridge to get at everything an Android phone does, us able as a chrome extension, connect with USB.

For iOS you need a Mac and Safari, connect by USB and you'll get dev tools in Safari.

In both cases you need to activate developer mode on the phone. Google for that.

If you just want network traffic you can use a inspector proxy such as Charles Debugging Proxy or Fiddler, which will show you everything. They're also good to use as a DNS spoof as you may need the phone to point to proper URLs, for example if running oAuth, so you don't want to access the app via IP address.

You really need a proxy to properly debug mobile in these cases, because you want to work off a dev instance rather than live staging or something.

Good info, thanks. The proxy is probably a bit overkill for my needs. A lot of what I want to do boils down to adding a little empirical weight to my subjective observations. For example, instead of simply telling a client, "hey, you're really hurting the user experience by using multiple redirects," I want to quantify the effects. I wish it wasn't so dorky to find an area with poor network reception and plop open my laptop, but if that's what it takes to make my case, that's what I'll do.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Kobayashi posted:

Good info, thanks. The proxy is probably a bit overkill for my needs. A lot of what I want to do boils down to adding a little empirical weight to my subjective observations. For example, instead of simply telling a client, "hey, you're really hurting the user experience by using multiple redirects," I want to quantify the effects. I wish it wasn't so dorky to find an area with poor network reception and plop open my laptop, but if that's what it takes to make my case, that's what I'll do.

iOS has a "Network Link Conditioner" available on the device under "Settings", "Developer". There's also a prefpane with the same name for OS X, which will work in the simulator. Both let you simulate lovely connections (for various definitions of lovely: upload and download latency, upload and download packet loss, DNS latency). Add to that some tracing in your apps and you got data.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



Kobayashi posted:

Good info, thanks. The proxy is probably a bit overkill for my needs. A lot of what I want to do boils down to adding a little empirical weight to my subjective observations. For example, instead of simply telling a client, "hey, you're really hurting the user experience by using multiple redirects," I want to quantify the effects. I wish it wasn't so dorky to find an area with poor network reception and plop open my laptop, but if that's what it takes to make my case, that's what I'll do.

In addition to what pokeyman said, if you can get DD-WRT on a router, you can limit the connection speed by MAC address which is great for simulating a slow network on one device. Don't know if you can simulate latency, though.

Heskie
Aug 10, 2002
Also it looks like Chrome's Dev tools are getting even better mobile emulation, you'll be able to throttle network speeds like 3G. Its in Canary at the moment so won't be long.

There's a post on it here: http://www.elijahmanor.com/enhanced-chrome-emulation-tools/

Pollyanna
Mar 5, 2005

Milk's on them.


Has anyone been unable to rename files in Sublime Text recently? I've got ST3 running right now, and when I try to right-click -> rename a file in the sidebar, it fails saying "Unable to rename". Searching for this on Google doesn't take me to any recent/useful answers.

edit: vvv Never mind. For some bizarre reason, it was just that one folder. I opened a window elsewhere and it was fine. :confused:

Pollyanna fucked around with this message at 22:27 on Aug 1, 2014

fletcher
Jun 27, 2003

ken park is my favorite movie

Cybernetic Crumb

Pollyanna posted:

Has anyone been unable to rename files in Sublime Text recently? I've got ST3 running right now, and when I try to right-click -> rename a file in the sidebar, it fails saying "Unable to rename". Searching for this on Google doesn't take me to any recent/useful answers.

Works fine for me on Stable Channel Build 3059 w/ Windows 7. Perhaps you don't have permission to rename that particular file?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

We have an internal tool that lets you go to a web interface on your device, pick a network profile (by bandwidth, latency, simulation of networks in certain regions, etc.) and then it fucks with your traffic appropriately. Can view network traces and so forth as well.

https://us.pycon.org/2014/schedule/presentation/97/

I'm not sure if we're going to release it (I hope so) but if someone was looking to build something like it themselves I'm sure our engineers would be happy to answer questions and so forth.

Pollyanna
Mar 5, 2005

Milk's on them.


For anyone who's used Middleman - I'm trying to make a layout that uses HAML, instead of the usual ERb. However, I'm running into this issue:

code:
NoMethodError at /blog/firstpost.html
undefined method `<<' for nil:NilClass

Ruby	/Library/Ruby/Gems/2.0.0/gems/padrino-helpers-0.12.2/lib/padrino-helpers/output_helpers/erb_handler.rb: in concat_to_template, line 12
Web	GET localhost/blog/firstpost.html

Traceback:

/Library/Ruby/Gems/2.0.0/gems/padrino-helpers-0.12.2/lib/padrino-helpers/output_helpers/erb_handler.rb: in concat_to_template
          output_buffer << text...
/Library/Ruby/Gems/2.0.0/gems/padrino-helpers-0.12.2/lib/padrino-helpers/output_helpers.rb: in concat_content
          handler.concat_to_template(text)...
/Library/Ruby/Gems/2.0.0/gems/padrino-helpers-0.12.2/lib/padrino-helpers/output_helpers.rb: in concat_safe_content
        concat_content text.html_safe...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/rendering.rb: in wrap_layout
          concat_safe_content render_individual_file(layout_path, @current_locs || {}, @current_opts || {}, self) { content }...
/Users/path/to/my/layouts/article_layout.haml: in block in singleton class
- wrap_layout :layout do...
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb: in call
      method.bind(scope).call(locals, &block)...
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb: in evaluate
      method.bind(scope).call(locals, &block)...
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/haml.rb: in evaluate
        super...
/Library/Ruby/Gems/2.0.0/gems/tilt-1.4.1/lib/tilt/template.rb: in render
      evaluate scope, locals || {}, &block...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/renderers/haml.rb: in render
    super.html_safe...
/Library/Ruby/Gems/2.0.0/gems/padrino-helpers-0.12.2/lib/padrino/rendering.rb: in render
        super.html_safe...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/rendering.rb: in render_individual_file
          content = template.render(context, locs, &block)...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/rendering.rb: in render_template
            content = render_individual_file(layout_path, locs, opts, context) { content }...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/sitemap/resource.rb: in block in render
          app.render_template(source_file, locs, opts, blocks)...
/Library/Ruby/Gems/2.0.0/gems/activesupport-4.1.4/lib/active_support/notifications.rb: in instrument
          yield payload if block_given?...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/util.rb: in instrument
        ::ActiveSupport::Notifications.instrument(suffixed_name, payload, &block)...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/application.rb: in instrument
    delegate :instrument, to: ::Middleman::Util...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/sitemap/resource.rb: in instrument
      delegate :logger, :instrument, to: :app...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/sitemap/resource.rb: in render
        instrument 'render.resource', path: relative_source, destination_path: destination_path  do...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/request.rb: in process_request
            output = resource.render do...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/request.rb: in block in call!
            process_request(env, req, res)...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/request.rb: in catch
          catch(:halt) do...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/request.rb: in call!
          catch(:halt) do...
/Library/Ruby/Gems/2.0.0/gems/middleman-core-3.3.3/lib/middleman-core/core_extensions/request.rb: in call
          dup.call!(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb: in call
      to_app.call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/urlmap.rb: in block in call
        return app.call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/urlmap.rb: in each
      @mapping.each do |host, location, match, app|...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/urlmap.rb: in call
      @mapping.each do |host, location, match, app|...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/showexceptions.rb: in call
      @app.call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/head.rb: in call
    status, headers, body = @app.call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/lint.rb: in _call
      status, headers, @body = @app.call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/lint.rb: in call
      dup._call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/builder.rb: in call
      to_app.call(env)...
/Library/Ruby/Gems/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb: in service
        status, headers, body = @app.call(env)...
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb: in service
      si.service(req, res)...
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/httpserver.rb: in run
          server.service(req, res)...
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/webrick/server.rb: in block in start_thread
          block ? block.call(sock) : run(sock)
It sorta seems like it tries to place the HAML into the ERb template, but thinks that it's ERb instead of HAML. Like it's treating .haml as .erb, and it gets weirded out when it doesn't parse correctly. Middleman should be able to handle .haml layouts perfectly well, though. What's going on here?

This is the HAML article_layout:

code:
- wrap_layout :layout do
		%h1 My Blog
		%article
			= yield
and this is the default ERb layout:

code:
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    
    <!-- Always force latest IE rendering engine or request Chrome Frame -->
    <meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
    
    <!-- Use title if it's in the page YAML frontmatter -->
    <title><%= current_page.data.title || "The Middleman" %></title>
    
    <%= stylesheet_link_tag "normalize" %>
    <!-- <%= stylesheet_link_tag "normalize", "all" %> -->
    <%= javascript_include_tag  "all" %>
  </head>
  
  <body class="<%= page_classes %>">
    <%= partial "header" %>
    <%= yield %>
    <%= partial "footer" %>
  </body>
</html>

pipes!
Jul 10, 2001
Nap Ghost
Don't use HAML, if you can. It's temperamental, difficult to troubleshoot, and overly strict (and this is coming from someone who has a serious boner for web standards).

Pollyanna
Mar 5, 2005

Milk's on them.


Sure, but I'd like to familiarize myself with it so I'm using the same thing everyone else at work is. Plus, I don't wanna be stuck using ERb for some unknown reason :(

Adbot
ADBOT LOVES YOU

prom candy
Dec 16, 2005

Only I may dance

pipes! posted:

Don't use HAML, if you can. It's temperamental, difficult to troubleshoot, and overly strict (and this is coming from someone who has a serious boner for web standards).

HAML is great, where did you get this idea?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply