Wikipedia:Reference desk/Archives/Computing/2013 January 2

= January 2 =

Model View Controller
Hi all, I've been working on a rare contribution to mainspace, and I'm hell peeved, because I've just found out it may be all wrong. I've been following a Stanford iTunes U series on iOS development, at, but this presents a version of the Model-View-Controller architecture that is very different to the one in our article. In the video, the Model and the View do not talk to each other, but only interact through the Controller. I have not found this design anywhere else; for example this describes a few different approaches, none of which involve separation of the View and the Model. Is the approach of the video, with strict separation between Model and View, a common variant? Does it have any special place among the different MVC design architectures? By "special", I mean in any way, so that I can characterise my contribution to the article, for example, it might be the latest approach, or an approach specific to Apple, or an approach that is a subclass of something more general. Any help appreciated, IBE (talk) 01:32, 2 January 2013 (UTC)
 * Model-View-Controller implementation in Objective C tends to be very difficult to translate to other languages. This "specificity" of the MVC pattern can be even more pronounced if you're using Xcode's tools, like the interface builder.  If you're struggling with the basic concepts of MVC design, the Objective-C version will also throw some curveballs at you: it will train you in using Objective C language features (like Protocols) that don't translate to, say, PHP.  So, step back for a moment; review the abstract concept of MVC philosophy; and try to see how one particular language and toolset have adapted those design tenets.  Then, step back again, and take a look at a totally different MVC design, like a data-driven web interface in PHP (say, MediaWiki).  It is not trivial to see how these implementations share a common design.  But, to some level of abstraction, they both follow a similar separation of concerns.
 * As I left school and worked in real commercial software, I began to strongly view "MVC" as a software antipattern - an approach that should be avoided. Now, I'm not a UI designer, so my opinion counts for aught; but just recognize this: MVC is an approach that is interpreted, and misinterpreted, and used and misused, by thousands of different programmers and software designers.  Sometimes, it gets pulled off in a stunning and simple way that makes me happy: encapsulation, separation of concerns, and all kinds of good, maintainable software.  Other times, sticking to MVC as if the design is gospel forces a programmer to carry around three times as much code for a trivial task.  After recognizing how frequently that occurs, I have come to appreciate the very very specific way that the Xcode toolchain imposes constraints on MVC.  Interface Builder allows you to place controllers for UI elements, in specific ways, that mimic "textbook application" of the pattern; so when you start a new project, you quickly spot a lot of familiar-looking, consistently-named stuff.  This forces developers to use, and not to abuse, the design pattern.   Nimur (talk) 15:56, 2 January 2013 (UTC)

Karnaugh Maps and Gate optimization
Hello!

For fun, i am working on making a vending machine in minecraft, using my newly learned knowledge of computer systems from a college course. As those of you familiar with this field should know, one method of figuring out a good optimization for logic gates is Karnaugh maps.....

My maps involve 6 input variables, far more complex than the 4 input values i would see maximum in my course. I found that, depending on which order the rows and columns are arranged, you can end up with a really poorly optimized map, or a really good one.

http://i50.tinypic.com/2ly0t4g.png

Above is a picture of my work with optimizing. You can see that i made the purple output (the purple highlights all the places where output "3" is 1) as optimized as possible. It was a mess the way it was when i started! I would like to do the same for orange ("2"), but i think i have made it as optimized as it can be..... its still so messy! :(

Does anyone have a better optimization idea? :) 172.162.57.6 (talk) 02:24, 2 January 2013 (UTC)
 * Karnaugh maps aren't limited to factorization in just four variables; they should reduce to the minimum logical complexity for all cases in any number of variables, always by factoring out any redundancy in any term. It's possible that your algebraic statement in six variables just doesn't have much redundancy... have you found a more optimal factorization of your expression using a different method?  If so, are you sure you're using the rule correctly when wrapping around edges of the map?    Nimur (talk) 15:40, 2 January 2013 (UTC)

Maybe we should look at this more directly. I have been doing a little research and i found this:

http://www-ihs.theoinf.tu-ilmenau.de/~sane/projekte/karnaugh/embed_karnaugh.html

... It Reports that an optimized formula (there may be more than one formula, but none are less complex) is:

/C1&/S3&S2+/C2&/S3&S2+/C1&/S4&S2+/C2&/C1&S2+C1&/S4&S3&/S2+/C2&C1&S3&/S2+C2&C1&/S3&/S2+C2&C1&/S4&/S2+C2&/C1&S4&S3&/S2

(I guess for this tool, "/C1" means "Not C1", and they redundantly use the and symbol... but this is fine...) I don't think there is any better way is there? I think my function happens to be that messy. :\

However.... i am looking into solving these issues algebraically, as this seems a reasonable route, but it wasnt introduced in my class.

172.162.6.57 (talk) 20:31, 2 January 2013 (UTC)


 * You may be able to reduce the gate count algebraically, but the K-map solution minimizes the depth, which gives you lower propagation delay. It also is simpler to synchronize so you don't get spurious intermediate results. 209.131.76.183 (talk) 13:37, 3 January 2013 (UTC)

The sort button on youtube is no longer there
I looked in the filters and it's no longer there. please send me a link it. 03:01, 2 January 2013 (UTC) — Preceding unsigned comment added by Venustar84 (talk • contribs)

This has already been answered. :)

See the post on January 1, regarding missing "sort by" on youtube. 172.162.57.6 (talk) 03:13, 2 January 2013 (UTC)


 * The "Filter" button is not displayed when you open the YouTube page. You need to first perform a search, and then the Filter button appears, just below the search box. Click it, and the options "Sort by Relevance, Upload date, View count, Rating" appear. --NorwegianBluetalk 14:52, 2 January 2013 (UTC)

The search options on youtube have changed
==I have go in to search filters but the sort options have changed: http://www.youtube.com/results?search_query=star&oq=star&gs_l=youtube.3..35i39l2j0l6j0i3j0.1453.2474.0.3531.4.4.0.0.0.0.846.1355.0j1j0j1j6-1.3.0...0.0...1ac.1.uh9d0V7pdik The search options seem to go by these: Upload date:

Anytime Today This week This month

Result type:

All Videos Channels Playlists

Duration:

All Short (~4 minutes) Long (20~ minutes)

Features:

All HD (high definition) Closed captions Creative Commons 3D Live

And not by this anymore: "Sort by Relevance, Upload date, View count, Rating". Does anyone know how I can use the old search options? thanks! Venustar84 (talk) 17:58, 2 January 2013 (UTC)


 * Here's what I get with Firefox 17.0.1 when clicking the Filter button:

Upload Date       Result Type    Duration               Features                  Sort by Last hour          Video           Short (~4 minutes)     HD (high definition)      Relevance Today             Channel         Long (20~ minutes)     CC (closed caption)       Upload date This week         Playlist                               Creative commons          View count This month        Movie                                  3D                        Rating This year         Show                                   Live
 * However, when I tried it using Internet Explorer 9 and Chrome (23.0.1271.97), the "Sort by" section was indeed missing. Since my language settings in Firefox were US English, and the settings in IE and Chrome were Norwegian, I tried switching the language settings in IE and Chrome to US English. The "Sort by" section then appeared. So, if your browser settings are anything else than US English, I suggest that you try switching to US English. Hopefully, the problem will then disappear. --NorwegianBluetalk 21:33, 2 January 2013 (UTC)

Persistent connection problems
I have been having persistent connection problems with the Internet since mid-November. This is most prominent with Wikipedia. I can view Wikipedia all OK, but trying to edit it mostly fails. Clicking on any button that sends an HTTP POST request (as opposed to clicking on a wikilink and sending an HTTP GET request) sends a couple of kilobytes, then the entire connection falls silent, causing Firefox to time the connection out, and no edit happens. This happens daily now. There are sporadic ten-to-twenty-minute intervals when HTTP POST requests work all OK, and I can edit Wikipedia as normal. Then the problems resume. This is not limited to Wikipedia - trying to even view Suomi24, much less write to it, was a huge pain, because requests to the ad servers weren't getting through. That problem was solved when I made Firefox block cookies from the ad servers. Facebook and Internet forums work OK, at least as long as I only submit text. I haven't tried uploading images yet. This is not just a WWW problem, as sending e-mail only sends about 10 kilobytes, then the connection falls silent. As a result, I can't send any e-mail over 10 kilobytes. This just happened in mid-November and has been going on ever since. What could possibly be the cause of this? Is anyone else experiencing this? J I P &#124; Talk 18:41, 2 January 2013 (UTC)


 * Firstly, the usual suspects: does this happen on multiple machines? Does it happen on a machine with a clean, unmodified linux install? Does it happen when the connection to the router is wired, or only wireless? Have you tried another NIC?  Have you tried another router. Consumer grade routers are, in my experience, junk, and I've seen some recently that are sporadically misbehaving due to cheap capacitors dying.  Only once you've tried all of that is it worthwhile worrying about whether the upstream connection is bad.  This entertaining blog post discusses a real upstream failure in a very odd scenario; I doubt you're having this same thing, but they steps they go through to isolate their problem could be instructive for you. -- Finlay McWalterჷTalk 18:59, 2 January 2013 (UTC)


 * That's a fascinating detective story, though I have to admit that I don't understand all the details. I regularly have an "edit" failure when trying to edit Wikipedia, but in my case I blame the complex series of microwave links between my house and the ISP (sometimes it fails on download, too).  I don't seem to have the same problem sending files via FTP.  I don't have the expertise to identify the exact location of the problem, but there are some very long "ping" and "tracert" delays when my internet connection is misbehaving.    D b f i r s   19:58, 2 January 2013 (UTC)
 * That edit worked OK!   D b f i r s   19:59, 2 January 2013 (UTC)


 * What is the manufacturer and model of your modem / router? The modems ISPs give out these days are often really terrible. I once had a router that would drop any TCP connection if it was idle for more than a few seconds. This caused, among others, the kind of problems you described: the computer would make an HTTP POST, and while the web server was processing my request, the modem would just drop the connection because it thought it had "died". Investigate the web interface of the modem, and try to troubleshoot the problem from there. If possible, put the router in "bridged mode", which disables all but the data link layer functionality of the modem. This worked in my case. --hydrox (talk) 10:21, 3 January 2013 (UTC)
 * It's an "Elisa Kotiboxi" modem/router. I don't know which company originally made the device. My ISP (Elisa) is renting it for me as part of the connection. I don't know how to access its configuration. I don't have any other computer at home to test the connection on. I do have both a desktop and a laptop computer at work, but as my user account there belongs to the company internal network, I don't know if I would even be able to log on to them if I brought them home. Besides, I don't even have administrator privileges on the laptop. (I do have them on the desktop.) I suspect the fault lies most probably in the modem/router or in the ISP. I should probably buy another modem/router to test the connection with. Merely writing this Wikipedia reply took over five minutes of waiting for the connection to work. J I P  &#124; Talk 18:56, 7 January 2013 (UTC)