Wikipedia:Reference desk/Archives/Computing/2015 January 23

From Wikipedia, the free encyclopedia
Computing desk
< January 22 << Dec | January | Feb >> January 24 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


January 23[edit]

Conecting HTC One X Mate to Fedora 20[edit]

I've been trying to mount my phone (HTC One X Mate) on my laptop (VAIO running Fedora 20). I've realised that this no longer happens automatically. Following various discussions I've found online I've installed mtplib and simple-mtpfs (version 0.2). On plugging in, Dmesg shows

usb 2-3: new high-speed USB device number 17 using ehci-pci
usb 2-3: New USB device found, idVendor=0bb4, idProduct=0f25
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-3: Product: Android Phone
usb 2-3: Manufacturer: HTC
usb 2-3: SerialNumber: [redacted]
usb-storage 2-3:1.1: USB Mass Storage device detected
scsi host7: usb-storage 2-3:1.1
usb 2-3: USB disconnect, device number 17
usb 2-3: new high-speed USB device number 18 using ehci-pci
usb 2-3: New USB device found, idVendor=0bb4, idProduct=0f25
usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 2-3: Product: Android Phone
usb 2-3: Manufacturer: HTC
usb 2-3: SerialNumber: [redacted]

so the kernel is recognising it; but when I try to use simple-mtpfs (version 0.2) to find the device to mount it, I type simple-mtpfs -l and it replies 1: and then stops without a carriage return, which I think means it has crashed out.

Has anybody successfully done this? --ColinFine (talk) 11:00, 23 January 2015 (UTC)[reply]

Exception thrown when trying to insert multiple rows to database in .NET C#[edit]

In the work project I mentioned earlier, I have to insert multiple rows into a database in one go. I thought I could do this by opening a database connection, then using multiple database commands in the same connection and then committing the transaction at the end. But for some reason, this causes the transaction to be rolled back instead of committed, with an exception saying "Operation is not valid due to the state of the object."

We are using Oracle's C# database driver. We have our own custom extensions of the C# classes but they don't have much added functionality relating to this problem. What I'm trying to do is something like this:

using (OracleConnection connection = new OracleConnection(connectionString)
{
  OracleTransaction transaction = connection.BeginTransaction();

  for (int i=0; i<10; i++)
  {
    OracleCommand command = new OracleCommand("insert into mytable (mycolumn) values (" + i + ")");
    command.Connection = connection;
    command.Transaction = transaction;
    command.ExecuteNonQuery();
  }

  transaction.Commit();
}

This causes the above exception at the end of the using block. No actual rows are inserted. I might not remember the exact underlying command structure, but it's very similar to the above. I can look the details up at work on Monday. Does anyone have any idea what causes this?

And in the meantime, is it possible to insert several rows, all with different values, by using only a single insert into SQL statement? JIP | Talk 18:16, 23 January 2015 (UTC)[reply]

I don't know Oracle, but in Microsoft SQL Server (2008 onwards, I think) you can insert multiple rows (up to 1000) with a single INSERT statement. The syntax is (from memory) :

INSERT INTO mytable (col1, col2) Values
(1,2),
(2,3),
(4,5)

and this is much quicker than INSERTing one row at a time. AndrewWTaylor (talk) 19:39, 23 January 2015 (UTC)[reply]

Not to mention that style of coding is horrible and leaves you open to SQL injection attacks. Use the OracleBulkCopy class and pass it a datatable that has your rows in it. Gaijin42 (talk) 19:50, 23 January 2015 (UTC)[reply]

I know about SQL injection attacks. What I'm really doing is parametrising the SQL statement, not concatenating literal values to it. I just thought it was quicker to write it this way, because the main point is to ask why the operation fails, not to ask how pass parameters properly. I'll try the multi-row insert statement when I get back to work on Monday. JIP | Talk 19:55, 23 January 2015 (UTC)[reply]

What problems can't machine learning deal with?[edit]

Provided lots of data. --Senteni (talk) 20:52, 23 January 2015 (UTC)[reply]

Well, there is an entire class of problems that are not solvable by any means - the Halting problem being the most well known. But anything that requires an an iterated algorithm would be essentially impossible using 'learning' techniques. "What is the millionth digit of pi?", for example, can't really be learned - if the answer itself isn't specifically in the training data - it has to be computed. Of course you might argue that a sufficiently intelligent piece of software would learn the equation for computing pi from whatever digits of it are in the training set and start using it to calculate the answer, but that requires more than just learning, it requires the ability to generate mathematical theorems from evidence, which is a deductive reasoning problem, not a learning issue. SteveBaker (talk) 00:17, 24 January 2015 (UTC)[reply]
How about problems where the rules constantly change ? A classic example might be predicting stock prices, since, once a method is developed, and sent out, this affects the stock market, and hence the accuracy of the prediction. Sports might be another example, with literal rule changes, equipment changes, new training methods, steroids, etc. StuRat (talk) 01:41, 24 January 2015 (UTC)[reply]
Most practical problems, even NP ones, can obtain sensible solutions from a Genetic algorithm. Machines still haven't passed the Turing test, so the problem of defining the problem, thinking like a human, would be top of the list. Fiddlersmouth (talk) 02:46, 24 January 2015 (UTC)[reply]

Socially positive video games[edit]

Many video games prominently feature hatred and warfare. Which video games prominently feature love and peace?
Wavelength (talk) 20:59, 23 January 2015 (UTC)[reply]

Well, there are a lot of neutral games...it's hard to attribute hatred and warfare to Tetris, for example. The real problem here is that love and peace don't make for huge amounts of adrenalin-fuelled excitement. You need opposing forces (widely construed) to create a challenge - if you're not striving to do something difficult, it's not really a game.
That said, there is an entire genre of Dating sims - they are very popular in Japan. They aren't exactly "socially positive" though. SteveBaker (talk) 00:02, 24 January 2015 (UTC)[reply]
In a flower garden game or a vegetable garden game, there can be enjoyment from collaborating to overcome natural challenges and achieve desired results. Also, there can be solitaire versions of those games, where the computer plays the part of a friend.
Wavelength (talk) 01:23, 24 January 2015 (UTC)[reply]
How about games where your team works together to defeat some unreal threat, like a dragon ? StuRat (talk) 01:35, 24 January 2015 (UTC)[reply]
In those games, the threat and its defeat are (too) prominent, whereas love and peace are not prominent (enough).
Wavelength (talk) 03:14, 24 January 2015 (UTC)[reply]
I thought of the same thing. Unfortunately, co-op is quite rare in recent titles. It was more common in the 1990s.
Raiding in WoW sort of stands out, but then again, 90% of raiding consists of (a) calling the worse players "n00bs" and/or calling the better players "cheaters". Doesn't really fit the "social" aspect, either... :( 217.255.178.185 (talk) 06:40, 26 January 2015 (UTC)[reply]
SimCity typically focuses on reducing conflict. Mitch Ames (talk) 13:59, 24 January 2015 (UTC)[reply]
The LittleBigPlanet franchise is all about humankind working together to build new worlds with our collective imagination and invite strangers to play in them. A lot of these worlds turn out pretty unfun and/or violent, but Stephen Fry lays the love on thick throughout single-player. Warm and fuzzy, but not too disgusting for adults, either. InedibleHulk (talk) 14:45, 24 January 2015 (UTC)[reply]
How about "happy customer" games ? There's Crazy Cakes, for example, where each customer ask for some version of a cake, and you need to bake it in time to make the customer happy and get a big tip. There are variations on that where you are a restaurant waitress or a hair salon stylist. I've even seen a version from Progressive Insurance where your goal is to get the customers the coverage they want in a timely manner. Of course, in all of those games, if you are too slow, the customer gets angry and storms off. StuRat (talk) 06:48, 26 January 2015 (UTC)[reply]
As they should. Insurance is one of the least wholesome games on the planet. All about forcing people to gamble, and not letting them make their own pick. They have to bet they (or their stuff) will die or hurt. Going peacefully in your sleep at 100 means you lost. Dying suddenly and violently pays double, a rule that's directly caused far more murders than Grand Theft Auto. InedibleHulk (talk) 18:55, 26 January 2015 (UTC) [reply]
Animal Crossing (whole series), Katamari_Damacy (three games), Harvest moon (whole series) PaRappa_the_Rapper (two games), Ico, Brothers:_A_Tale_of_Two_Sons, maybe Scott_Pilgrim_vs._the_World:_The_Game. SemanticMantis (talk) 14:29, 26 January 2015 (UTC)[reply]
Scott Pilgrim is a classic old-school beat-em-up. Tons of violence there. PaRappa is about conflict between two guys...admittedly the object of their conflict is love of a girl - but the game is mostly about conflict. Karamari Damarcy is about...well, it's hard to tell actually...but rolling up the entire world into a big ball seems like a fairly violent act and the fun really does come from large-scale destruction...I don't recall any love and/or peace there. Animal Crossing is closer....peace is certainly a part of it...but it's really not much of an actual game - there are no real goals to meet, little in the way of real excitement. Brothers also has its share of violence - our article lists many sources of that ("facing challenges like the local bully, a farmer's aggressive dog, and deadly wolves"). Sure, there is cooperation - but then many extremely violent games have cooperative play modes. I don't know about ico or Harvest moon...but I'd be really surprised if they were able to meet our OP's needs.
The thing is that there are a ton of games that aren't about violence and hatred - but there isn't much in the way of love and peace because it simply doesn't make for a playable game. There simply has to be serious problems to overcome in order to provide a challenge...and problems generally amount to violence and hatred of one kind or another. Sure we can make games where love conquers all, and everyone strives for peace - but the game elements that have to be overcome to get to that laudable goal are inevitably the negation or contradiction of love and peace. Without some kind of contrast between present-state and desired-goal, there is no game.
The best you can do is to abstract the violence away - but in so doing, you also abstract away the goals of the game. So if you play (let's say) poker - there is no violence or hatred in the game play - but there is no love or peace in the end result...it does, however embody deception and other less wonderful human traits. Things like Animal Crossing truly do remove all of those sources of conflict and stress - and wind up not really being games at all...playing it is just like having a job and going to work to earn money...there is no element of "game" in it...ditto "FarmVille". Only when you add an element of conflict, stress, whatever, do you deliver the joy that comes with overcoming it and the energy that comes from trying to get to that end state.
In the end, you need difficulty in order to enjoy success...and for a game to be plausible, the difficulty has to be in proportion to the goals. So if the goal is love and peace - then the sources of conflict and difficulty have to be proportionately large - hatred, violence. If the goal is merely to score more points than you did last time, then stacking blocks of the right shapes together is a proportionate amount of difficulty. A game where you stacked blocks in order to achieve love would seem silly - it would trivialize the end goal and come across as just plain silly.
SteveBaker (talk) 16:54, 26 January 2015 (UTC)[reply]
OP didn't say anything about violence, only hatred and war. Whatever, those were just some candidates of games that I thought had elements of love and peace in them, I certainly didn't expect anyone to come along and tell me that my opinions were wrong :) Unlike other responders, I at least have a serious list of candidates. But if you want more of my perspective:
Scott Pilgrim was admittedly a bit of a joke candidate. Sure, there is cartoon violence, but there are also very sweet and romantic cut scenes.
Please don't no true scotsman me on Animal Crossing, it's a game series for Nintendo consoles, and has sold millions of units around the world. There are certainly challenges and difficulties in it, but even if there weren't it's just silly to say it's not a video game. Brothers is probably the most emotionally moving game I've played in decades, and the final portion is all about brotherly love. PaRappa also has many themes about how people should get along and be nice to each other. Let me quote just one song:
I'd like to think that most of us could agree that that is an explicit call to love and peace. Moving on: if you didn't catch anything about love and peace in Katamari, I suggest you weren't paying much attention to what the King says. I'll quote again
I detect a bit of love and peace there as well, but I suppose it's up to interpretation. For many of these games, you'd have to play more than a few minutes of them to see what they're all about.
I do take your point in your original post though, games (like novels, and plays, and movies, etc) often work through conflict and resolution. Animal Crossing and Harvest Moon are probably the two most famous games that are mostly peaceful, have little-to-no violence, and instead focus on more "wholesome" messages and goals. SemanticMantis (talk) 18:15, 26 January 2015 (UTC)[reply]
Here's a whole "game jam" devoted to making games that are more about peace and love: [1]. Their examples page reminded me of another rater peaceful game Fez. You'll probably find more of this stuff in the Indie_game category, compared to the famous games released by large studios. SemanticMantis (talk) 18:26, 26 January 2015 (UTC)[reply]

Thank you all for your replies. Although I used the word "war", I could have used the (more inclusive) word "violence" and even the word "competition" (referring to competition between players), because I want the games to avoid all those things. A challenge does not need to imply competition between players, but it can involve limitations of the knowledge and skill of players. A player can overcome that type of challenge by acquiring knowledge and developing skill (either in a solitaire game or in a cooperative game). In a cooperative game, players can help each other to acquire knowledge and develop skill, and they can share resources. —Wavelength (talk) 21:12, 27 January 2015 (UTC)[reply]

You can race in LittleBigPlanet, against yourself for a personal best time. No competition there, if you're not doing it to get on the leaderboard. Most actual racing games offer this "time trial" deal, too. InedibleHulk (talk) 21:20, 27 January 2015 (UTC)[reply]
Thank you. Although I have some interest in speed (in relation to this topic), I am mostly thinking outside the box of "Faster, Higher, Stronger". The "game jam" link posted by SemanticMantis was the best link posted by any respondent in this discussion.
Wavelength (talk) 00:13, 28 January 2015 (UTC)[reply]
Now I feel like a loser. Damn you, spirit of competition! Good game, Mantis. InedibleHulk (talk) 00:53, 28 January 2015 (UTC) [reply]