How do I edit a video clip without increasing size?

Question: I have several video clips that are small files -- the videos are pretty low quality. I'm on a Windows computer. I just need to trim the videos and rotate them 180 degrees. You'd think that if I trim the videos, the files would be smaller than they started, but for some reason when I do it on Windows Moviemaker it makes them bigger. I'm not willing to pay for a legit movie editor to do something this simple. Does anybody know how I can do this? I just need to trim, rotate, and potentially combine clips without changing the resolution and without increasing the files sizes. Thanks so much!
Answer: The file gets bigger because the encoder struggles to keep the quality of the resulting file as close to the same as the original as possible. AviDemux allows you to cut out parts of a video file without re-encoding.
Answer: Why size increased? Because used different methods to compress frames, with different ratios. And every re-compression takes away some quality.
Why you need to recompress file? When you change something, even single pixel, you must recompress whole image. So, rotation of image will cause image recompression.
How to do even smaller file? Increase ratio of compression and lost some quality.
Yes, it possible in some cases do lossless recompression, for example, for mjpeg. But this method very limited and I don't know tools to end-users what can do this.
If you want just strip-out some segments of video and NOT touch frame content, I can suggest to use VirtualDub, where exist cool mode "direct stream copy".
Comment: This is not what I'm asking though. I don't see why it should have to recompress. Isn't there some software that doesn't mess with the compression rates and just gives it back to you with the same compression ratio that you inputted the video in the first place?
Comment: Yes there are, most Adobe programs can do this but there is no guarantee it will guess your codec correctly. Either way your settings have to be correct. Try ffmpeg
Comment: No, there aren't. As Bukojot said, if you change even a single pixel, the video will need to be recompressed. You have to wind down the quality of the recompression until the compromise between file size and quality is where you want it. Windows Movie Maker is probably not the best tool for this
Answer: When you use a professional editing software, you don't just save the video and let the software pick the render settings, you chose exactly how you want the output to be. Unlike Movie Maker, it does it for you.
What you can do is, save the videos from Movie Maker then compress them using Handbrake, its a FREE software and you can find many tutorials about it online.
Hope this helps.
Answer: This can easily be achieved with MPEG Streamclip
Step 1.
Right-Click your video and 'open with MPEG Streamclip'
Step 2.
In the player window, use keys 'I' and 'O' to mark IN/OUT over the section you want to trim down to
Step 3.
Go to 'File > Save As > MOV'
Hint:
Make sure you use the 'Save As' function and not the 'Export' function. If you use export you will end up re-encoding the video to a new compression which will make the file larger than the original. If you use 'Save As', the software will simply copy the existing video data into a new MOV container file for you, keeping the file small like you intend.
Answer: I recommend FFMPEG for that task.  It is lighter weight than the other proposed solutions.  The command you need is ffmpeg -i INPUTFILE -ss STARTTIME -to ENDTIME -c:v copy -c:a copy OUTPUTFILE.
You can use seconds, minutes:seconds and other time formats for STARTTIME and ENDTIME.
Make sure that -ss STARTTIME comes after -i INPUTFILE.  It may work before the input for some videos; but, with my test video, it looked horrible when used before the input and fine when used after.  I assume that there was not a keyframe shortly after the start time I specified so the output looked horrible because FFMPEG loaded the file from that point in time.  If someone does know the reason for that please let me know.
Comment: Whoops, just realized that this thread is over a year old...


InfoPath form that allows adding and editing multiple items

Question: I have a Records List that has a custom InfoPath form that adds an item to the list. However, there are many fields in a record, and I have a requirement to allow users (instead of adding one record at a time) to select a 'template' from a drop down, see default records (1 or more) that would be created for that template, edit the records if needed, and then create all the records.
Originally I was hoping to have a "Default List" that is structured the same as the main Records list except it would have a column called 'template'.  The InfoPath form would have a drop down that listed all the possible templates.  When the user would select a template, it would pull the items from the Default List for that template and display them in editable controls (with a repeating section?) so that the user could make changes.  Then, when clicking Submit, the new records would be added to the main Records list.
I know InfoPath can display multiple records, but I cannot seem to find a definitive answer as to if you can edit multiple records at the same time and then submit them all to a list.  I have tried to add a repeating section, but when I do, I cannot find a way to add a drop down control that would list the templates (the drop down always ends up in a repeating section)
I guess my questions are, can you edit multiple items in InfoPath at the same time and then submit all changes?  Does this have to be done in a Grid-like view only?  And, if you use repeating sections, can you have controls outside of the repeater that can display options pulled from another List (a List of templates)?
Thanks!
Answer: Short answer is yes it can be done. To achieve that you will need to write custom code and publish administrator approved IP form. Out of the box IP is really designed to work on the 1-1 with list items. But with code behind you can make it to do almost anything. Here is older example from SP2007 but with regards to IP not much has changed: Submitting Data from InfoPath 2007 to a SharePoint List


How do you say 'nappe' in Esperanto?

Question: Wikipedia has a disambiguation page for this term. The sense that I am interested in is the mathematical one, that is, either half of a double cone. This term (for any of the senses) does not appear in Benson, nor in Wells, nor in Vikivortaro. Wikipedia mentions, and defines, this term in its article on 'cone', but does not have a separate article on it, and therefore if there is an article on it in Vikipedio it is not reachable from the sidebar of the English-language article. I went directly to Vikipedio and tried bringing up the term with a few guesses, such as 'napo', 'napeo', and 'napio', but to no avail. I did the same with the online PIV, again to no avail. So, how should the mathematical sense of 'nappe' be rendered in Esperanto?
Comment: I think a new word will have to be invented for that.
Answer: Note that for mathematical terminology, ReVo is much more trustworthy than either PIV or Vikipedio, as it contains the full content of the Matematika vortaro kaj oklingva leksikono by Marc Bavant, the best source of mathematical terms in Esperanto. According to the definition in ReVo, konuso – when used to refer to a surface rather than a solid – actually means double cone (see definition a)), and the half of this surface that borders a solid cone is called duona konuso (see definition b)). Additionally, a comment after the definitions clarifies that one should use konusa surfaco or konusa solido in case there is a risk of misunderstanding about which meaning is meant. If I correctly understand the English nappe, it always refers to a surface, and never to a solid. So following this terminology, one should say either duona konuso or duonkonusa surfaco for a nappe.
Comment: I'm going with 'duona konuso'. I've up-voted your answer, and accepted it. Much thanks for sharing your research.
Answer: The word nappe ("tablecloth") is just the French term for a sheet of a surface.
In English we normally say, for example, hyperboloid of one sheet rather than one nappe.
Because a double cone is connected at the vertex, there seems to be hesitation about whether it is in one or two sheets, and this may have led people to follow French books of geometry and say it is in two nappes. However, I think it is probably not necessary in context to use a separate word.
In its entry for hiperbolo, PIV gives the examples unupeca, dupeca hiperboloido.
So my guess is that you could say la supra, suba peco de duoblakonuso.
Obviously, tuko and folio might be used, but peco is what they chose.
Comment: I appreciate your input, and have upvoted your answer, but I think the terms 'supra' and 'suba' inappropriate, because they presume a certain orientation of the cone.
Comment: If you search *nappe cone* on Google Books, you will see that very often an orientation is assumed, and that *upper and lower nappe* are standard terms.
Comment: They may be standard terms, but they are not mathematical terms. I was going for a mathematical term. (Ordinary language and technical language are two separate things. We often mix the two for convenience, but the mixture is like that of oil and water.) Science is not a democracy.
Answer:
In geology, a nappe or thrust sheet is a large sheetlike body of rock
  that has been moved more than 2 km (1.2 mi)... https://en.wikipedia.org/wiki/Nappe

I found this term tertavolo in ReVo, but I don't know.

tertavolo = Horizontala tavolo da tero
Comment: This answer has nothing to do with what the question is about.

How do you say ‘nappe’ in Esperanto?


How can I increase my reputation on Ask Ubuntu?

Question: I notice some users with very high reputation scores. What is their "trick", and how can I increase my reputation?
Comment: To some extent by [association bonus](http://meta.askubuntu.com/a/15123/338446). It's not much, but important in the start, and the user will likely benefit another community in the process.
Answer: The trick is providing quality answers to questions.
Or more specifically:

Providing detailed answers that are easy to understand
Asking questions that are well-written and include plenty of information
Accepting answers to your questions

You can find more information here.
Comment: Once you get enough reputation to write comments, it's also useful to comment on existing answers, e.g. if you think they are good but can be improved with additional info.
Answer: 1. Ask Good Questions
Firstly, ask good questions. Good and thorough questions are more likely to be upvoted to increase your reputation. When you ask questions you learn to, so you can help other people on the site with similar problems.
2. Edit Tag Wikis
Secondly, edit tag wikis. This is something that anyone can do with access to a search engine and some time on their hands. Adding descriptions to tags that don't have descriptions already will help you further understand Ubuntu and help other people to learn about terms that they don't already know. You can edit tags by clicking on the "Tags" link in the top navigation bar.
3. Leave Helpful Comments
Thirdly, leave thought-provoking and helpful comments. Don't be so critical to the point of being annoying. Leave a comment if something needs to be clarified, this will help the asker of the question so that the people who are trying to answer further understand the problem. Don't leave comments saying that the asker did a good job on their question, instead, upvote.
4. Be an active user
Fourth, be an active user of the site. You get badges for leaving so many comments, upvoting so many times, visiting the site for so many days in a row, etc. For more information on what badges you can get for doing what, go to the "Badges" tab in the top bar.  Read other people's questions and maybe they will help you learn something.
5. Give Detailed and Easy to understand Answers
Fifthly, Give quality answers to questions, Try to give answers after you actually do researches with them, tested them or at least confidence with them. Try to give instructions as clear as possible. Give several options for answers, if they exists. And Revise your answers as new information arrives. Also, always keep in mind the questioner's knowledge level with Ubuntu, so give answers accordingly.
Conclusion
You earn privileges for gaining rep. The more rep you have, the more stuff you can do. Remember that the FAQ says that "reputation is a measure of how much the community trusts you". In real life, building up trust takes time. Gaining a high reputation is going to take a lot of time and effort. Take some time and read through the whead the FAQ for some more ideas on how to gain rep and use the site appropriately.
Comment: IMHO answers should be number one.
Comment: You are right, almost all of my rep on Hardwarerecs comes from answering
Answer: I've been following recommendations from this discussion on meta.stackoverflow to formulate my answers.
Comment: One doubt How do I programatically increase askubuntu reputation? Can you provide a quickly template for it ? :p
Answer: Unfortunately the most efficient way to farm XP is to rephrase existing simple answers on easy questions while the question is still hot. Long detailed answers on difficult questions are not worth much because too little people are interested in them.
Edit: This is based on my observation on StackOverflow. There is, however, one important difference between StackOverflow and AskUbuntu: SO has so much traffic that questions only stay on the front page for about 10 minutes after the last answer.
Comment: Actually most of my rep seems to be coming from my older, more detailed answers.
Comment: I feel the main trick is the audience of the answer. I have gained load of reputation for very general and easy question that I just have the luck to be the first to answer. I have won just a +1 and accepted rep in some answers that take a lot of work but that seen to interest only me and the asker. Anyway I learned a lot with it and had fun, I value it quite more than some values in a random database in the net ;).


How are single-stranded binding proteins removed from the lagging strand during DNA replication?

Question: The lagging strand, downstream of the Okazaki fragment, is covered in single-stranded binding proteins (SSBPs) during DNA replication. What is the mechanism which ensures that SSBPs are removed from the lagging strand to allow for the binding of the next Okazaki fragment?
Answer: Actually, there has been some evidence that the SSBPs keep the bases facing outwards so DNA polymerase can still replicate the lagging strand with the SSBPs on them. There has also been other evidence that they can pop off spontaneously.
You can learn more about this by watching the lectures on https://www.edx.org/course/molecular-biology-part-1-dna-replication-and-repair
Comment: Your answer may well be correct but there is no way for anyone to know without reference to some external source that supports your answer. At the moment it is likely to be automatically flagged as low quality by the system. Please take a moment to read the [Help](https://biology.stackexchange.com/help/how-to-answer) on writing the sort of answers that are appropriate here, and then edit your answer.


Scoring GRE analytical writing practice essays

Question: I took the GRE and my analytical writing score wasn't what I hoped for. During the exam, I thought my answer was good. Having read about argumentation and practiced writing, I wonder if there is a reputable service that will score essays and give feedback?
Comment: Have you visited www.ets.org? I think they have excellent strategy on how to prepare.
Answer: You've got a few options:

See if your school has a GRE preparation course (you may have to pay for this) or other writing tutorials.
As Tirath said, look at ets.org for strategies.
If you're still in undergraduate school and have at least another semester, enroll in a writing class. The practice you get from the class should improve your overall ability.
Look online for test preparation courses. These can be expensive, but sometimes they have "guaranteed results," and you can probably figure out the best ones by looking at reviews.
Advertise on Craigslist (or similar) for a tutor. If you are in a college town, you may find someone willing to tutor you relatively cheaply.
Look online for GRE writing samples, and read as many as you can.
Practice writing every day. The more you practice, the better you'll get (and read as much as you can, too).

Keep in mind that while you always should strive for high scores, your field of study will partially dictate how important the writing score is. If you're going for a history PhD, you'll need a high score, but for a science degree this tends to be less important (for admissions--being able to write is important for any PhD!).
Comment: Check on the rules for the GRE.  You may be able to only retake the writing portion, or they may "blend" the top scores from each section, so you could take it a 2nd time and only focus on the writing portion (check me on this).
Answer: Ets offers a service to rate your essays. They charge approximately $10/essay and they rate the essays as in the actual examination. You could check the service by logging in your GRE account.
Answer: How about joining a MooC by UC, Berkely on eDX :
"College Writing 2.1x is an introduction to academic writing for English Language Learners, focusing on essay development, grammatical correctness, and self-editing."
Link - https://www.edx.org/course/berkeley/colwri2-1x/college-writing-2-1x-principles/1194 or http://online.berkeley.edu/news/introducing-latest-mooc-college-writing-21x-principles-written-english
Its a 5 week course and requires 5-6Hours/week effort. The course will be taught by Maggie Sokolik. And will be starting from November 8, 2013. So enrol now soon.
And one more, English Composition by Cousera :
English Composition Part 1 - https://www.coursera.org/course/composition#!
And then you can move on to part 2 ;-)
Answer: What I wound up doing is hiring a tutor through WyzAnt. I found someone with experience in this area, and wrote a few essays based on sample prompts from GRE study books. I emailed them to him, he estimated a score for each of them and made comments. We went through a second round of the same. My score did improve the second time I took the GRE.


How are Mono and Diglycerides metabolized without the Free Fatty Acids of Triglycerides?

Question: Having difficulty figuring out what the body does with ingested mono and diglycerides if the usual process of TAG metabolism includes the FFA released from the TAG returning to the MAG to recreate a TAG in the enterocyte, whereas with MAG and DAG consumption, those FFA don't exist. There are many studies (Nagao, 2000, Takatoshi, 2002 and others) confirming that DAG oil consumption leads to weight loss, which is seemingly obvious as the fat cannot be stored without the FFA getting repackaged into TAGs for storage in the adipose tissue. I have not found any studies on what actually happens to the MAGs in lieu of its normal course. I would much appreciate if someone could direct me to literature discussing this process or help me better understand it. Many thanks! Anyone?
Answer: Inside the intestinal lumen, di- and triacylglycerol are hydrolysed to free fatty acid and monoglyceride by lipase.
These diffuse through the plasma membrane of enterocyte where they will   used to resynthetize triacylglycerol, and ultimately the lipoprotein chylomicron for transport into the general circulation.
Contrary to what your question seems to imply, the glycerol to which the free fatty acid are affixed is not necessarily coming from the food: glycerol is routinely produced by glycolysis. (This notably also happens in the adypocytes). There is no requirement that food contain a ratio three fatty acid to one glycerol to be fully absorbed - if the weight loss property of DAG are true, it may be through  a different mechanism.
Comment: My question was not where the glycerols come from as there are present in MAGs and DAGs as well. The question was that without the extra FFAs which exist in TAGs, the MAGs which are entering the enterocyte do not have the usual accompanying FFAs to re-synthesize into TAGs.
Comment: Hello! This question was deemed worth of an answer, so why not upvote it? [Vote early, vote often](https://biology.meta.stackexchange.com/questions/22/vote-early-vote-often?rq=1) to encourage new users and keep the community alive!


Get current category id from post page wordpress

Question: I have a problem to get category id of current post. We are using <?php get_the_category( $id ) ?> for finding out category of current post.
If a post like 'demo' has 2 category like cat1 and cat2. When i open a cat1 page and then go to demo page, i want different layout.. and when i open a cat2 page and then go to demo page, i want to open this demo page with other layout. It can be only done when i will identify.. from which post has called.. but how??
Comment: I don't know if you ever got this solved, but I just finished writing a very extensive post navigation function for this, also check out the answer from @G.M. to my original question [here](http://wordpress.stackexchange.com/q/170007/31545). You can, stripping the code from both answers and combining it, know from which category the single post came from and then use the `single_template` filter to set a specific template
Answer: WordPress has a function wp_get_referer, which gets the referring url from the http-header. So, if you go from a category archive to a single post, the name of the category will normally be included in that url. This means you can start your single.php like this:
$refer = wp_get_referer();
if (strpos($refer, 'category/cat1') != false) {... do something ...}
elseif (strpos($refer, 'category/cat2') != false) {... do something else ...}
else {... do a default thing ...}

Depending on your setup this solution may need some tweaking, but the general idea is clear, I hope.
Answer: <?php $categories = get_the_category( $post->ID ); ?>

This will return an array of categories, which you can get the id from, like so:
$categories[0]-> term_id;

This will be for the first category in the array if there is more than one.
Information on usage can be found in the codex
Comment: Thanks,for this information. But i need a category from which post has called rather than first category.
Comment: Sorry, maybe I didn't quite understand, what do you mean by 'which post has called'?
Comment: Simply-- there is a category page for cat-1 and its display all its post i.e demo. when i open demo from this page i want to open demo post in layout-1. and if i open demo post from cat-2 category page then it must be open with layout-2.
Comment: I can do this using query string but i don't want to use this due to url issue.
Comment: I would suggest either setting the category as post data using either a form (though that's unsemantic) or javascript - though that won't work with javascript, at least it will gracefully degrade.

You might also want to rephrase your question to better reflect what you want - changing a posts layout depending on what category is was visited from - as you'll be more likely to get answers.
Comment: Layout of post that a post look in this format(just looks) or another format.. If i use javascript then its also place query string in url.
Comment: The only other thing I can think to suggest is using session variables to temporarily save the category page that was last visited, and then if the currently viewed post is in that category change the layout.
Comment: Thanks, for reply and suggestion. But can this be possible using some wordpress tricks rather than php.
Answer: As mentioned by Gaffen : "changing a posts layout depending on what category is was visited from"
First on the category template page in your theme (i.e. category.php)
get the category id and store it in the WordPress Transient option.
global $wp_query;

//get category id (or name, slug) and store to the transient api
$categoryId = $wp_query->queried_object->cat_ID;
set_transient( 'category_id_visited', $categoryId, 1 * HOUR_IN_SECONDS );

now on single.php or the single post display template page.
get the value from Transient and change display acccordingly
if ( false === ( $category_id_visited = get_transient( 'category_id_visited' ) ) ) {
    // this code runs when there is no valid transient set
    //do nothing for now
} else {
    echo 'You came by visiting category: ' . $category_id_visited;
    //delete transient if required, otherwise it will be expired automatically
    delete_transient( 'category_id_visited' );
}

Hope it helps.
Answer: In your single.php you could use for example
if(has_category('layout-1')) {
  // do layout-1-category stuff here
} elseif (has_category('layout-2')) {
  // layout-2 stuff here
} else {
  // stuff for all the other styles/regular stuff
}

Better yet, use get_template_part so you don't just flood your single.php with all kinds of silly code.
Answer: First get category ID:
$cat_id = get_queried_object_id();

Then get category name:
$cat_name = get_cat_name($cat_id)

Then you can decide depending on category name what to do:
if ($cat_name == 'Cat 1') {
   // ... url = layout-1
} elseif ($cat_name == 'Cat 2') {
   // ... url = layout-2
}

Comment: ```$cat_id = get_queried_object_id();``` will retrive the post ID and NOT the category ID when you are on a post page, like the OP asked.


Looking for malware detection dataset

Question: I'm looking for malware detection dataset. I have found some but they have very few features from the pe headers, which is not helpful for detecting malware as APIs/resource .... It would be better if there is raw files and i extract the features myself in a server.
Comment: What features - or do just want EXE images? And do you want non-malware as well, with the outcomes *this is/isn't*? And how much samples would you require? Please read [What a good request looks like](https://opendata.meta.stackexchange.com/questions/284/how-a-good-data-request-question-should-look-like)
Comment: as i said it would be better if there is exe imgaes dataset. if there isn't i need both malware/legit files and the features are imported/exported apis , characteristics and entropy of sections...
Answer: we created Windows API calls sequence of metamorphic malware. In our research, we have translated the families produced by each of the software into 8 main malware families: Trojan, Backdoor, Downloader, Worms, Spyware Adware, Dropper, Virus.
https://github.com/ocatak/malware_api_class
Answer: Endgame Malware BEnchmark for Research
The EMBER dataset is a collection of features from PE files that serve as a benchmark dataset for researchers. The EMBER2017 dataset contained features from 1.1 million PE files scanned in or before 2017 and the EMBER2018 dataset contains features from 1 million PE files scanned in or before 2018. This repository makes it easy to reproducibly train the benchmark models, extend the provided feature set, or classify new PE files with the benchmark models.
This paper describes many more details about the dataset: https://arxiv.org/abs/1804.04637
This is the best suitable data set I have found for malware detection.
Comment: Please add description.

Looking for malware detection dataset


10 year old will not help with anything around the house

Question: My child will help everyone else out. Neighbors, family, at school, bus driver, etc. He will not help out and I've asked him to tidy his room for months now. I've cleaned it myself many times and it always ends up the same way. He won't take his dirty clothes to the laundry basket, won't take dishes to sink, won't pick up toys without being reminded 10 times. I'm not exaggerating, he gets reminded over and over and only does the job half way. I've tried time outs, positive reinforcement (new games, family outings), grounding, taking away toys, offering allowance, even   begging. I've made lists for him placed on a large board on the wall, given one step directions, and still NOTHING. I'm at my wits end. He has Asperger's, so I know multi-step directions can be hard, but if he can help everyone else with chores I can't see why he can't do the same at home. Please help!
Comment: Has the given any reasons for not doing things?
Comment: @Erik, he hasn't given a reason, just that he heard me when I asked him to complete it, and that he understood what I meant. He just does the "I don't know". He listens to me when we are around other people (in town, in school, at family member's homes). It's incredibly frustrating.
Comment: One trait that may be common to some of us on the spectrum is elevated endorphins levels. The evidence is light at this point,   limited to a couple of small studies, so it's not"fact" or necessarily universal, which is why this is a comment.  Rewards and punishments don't mean as much because their normal state is "happier" in the sense that the normal hormonal response to rewards is always in play.
Comment: Is working *together* with you the same hassle?
Comment: Will he do a (small) task that can be done in one step immediately if prompted? Like after a meal, bringing *his* plate to the kitchen?
Comment: @Stephie, that's a hit or miss. Sometimes it will work, other times he just watches me cleaning. He will take his plates and dishes where they belong with a prompt.
Comment: He will tidy the yard after storms after asking if he can, and it wouldn't bother me as much if he didn't trash his room after it was done. But it's clothes pulled out of drawers, toys dumped, etc.
Answer: To me,  this sounds a lot like "normal kid" frustrating behavior, exacerbated by ASD.
Kids will let their standards of behavior lapse when they are comfortable (at home) in ways they would never do away from home. Ask any volunteer with youth about the number of parents who say "we wish our kids would behave like that at home".
I recently had a discussion with a young man i work closely with who has a reputation for a volatile temper, about why,  in spite of the amount of pressure I put on him,  I had never seen his temper flare. In fact,  the more pressure he had,  the steadier he gets.
At one point, I realized I had gone over the boundary of responsible concern to sheer nosiness (between my own ASD and brain injury I had to be WAY over the line to even realize it), and told him "This is where you say 'Mr. ____, it's time to shut up.'  He looked at me in shock and blurted out "But. I would never say that!  It would be rude. "
Shortly after that,  I was sitting and talking with his father when, unprovoked,  he said something much more hurtful and rude to his father. While it created a "teachable moment", it also illustrates the point I am trying to make.
The risk of loss of reputation with ones parents is perceived by a child to be low - they already see you at your worst, and still love you. With others,  you have opportunity to build reputation with best behavior and minimize their exposure to the less desirable behaviors.
Since my opinion of him as a person was important to him, he exercised much more self discipline for me than he did for his parents, who taught him the self discipline in the first place.


How to write interesting French compositions?

Question: What is in a good French composition that makes people want to read it even though there are no complicated words in it??
Comment: Are you asking what makes a text interresting to read? Isn't that the same in all languages? This question is VERY open-ended and therefore not a good fit for this site or any stackexchange site.
Comment: Can you be more specific?
Comment: What are the elements in a good French composition that grabs reader's attention?  Is it fancy words or something else?  My target group of readers are adults with considerable fluency in French
Answer: I'll add my two cents, even though your question is VERY open and whatsmore important the title and content do no match. In general, French language is considered very fancy. See for instance this nice question
What languages are perceived as classy or fancy to French speakers?
and the answers therein (in particular user Matthieu M. reply). Why is it so considered?

(wiki) From the 17th to the 19th centuries, France was the leading power of Europe; thanks to this, together with the influence of the Enlightenment, French was the lingua franca of educated Europe, especially with regards to the arts, literature, and diplomacy; monarchs like Frederick II of Prussia and Catherine the Great of Russia could both not just speak and write in French, but in most excellent French. The Russian, German and Scandinavian Courts spoke French as their main or official language, regarding their national languages as the language of the peasants.

Moreover according to https://www.ef.com/wwen/blog/language/most-beautiful-languages-in-the-world/

If there is a language which draws a unanimous worldwide consent
  regarding its beauty, it is French. (...) French has been described as smooth,
  flowing, elegant and aesthetically pleasing. With its unpronounceable
  "r", its nasal vowel sounds "en", "in", "un" and melodious intonation,
  it sounds extremely musical to the non-native ear. And let's not
  forget the strong cultural context which lends French the status of
  the most beautiful spoken language in the world.

There is also a relevant Quora thread: Why is the French language seen as beautiful and upper class?

The beauty of the French language is, in my humble opinion, due to its capacity to be extremely logic - and yet, on the other hand, for being able to create precise painting-like content when used on a more intimate level.
French language is extremely precise. It may be used as a tool in philosophical argument, as well as be the core of a poetical composition. There is a subtle balance in French, and you may practically express every reasoning with clarity and elegance. It is mainly due to our use of "pronouns", our various grammatical exceptions, tenses, the extensive use of "one's" and our ability to generalize an example towards a concept.
As a consequence, it was a diplomatic language for many European countries - it enabled nobility ans scientists to discuss topics without the possibilities of misunderstanding. Mastering French let them be really precise about what they intended to say ; nevertheless, even a shady comment could be said so as to appear socially acceptable.
There are "different sorts of French" - but high French is mesmerizing. High French locutions, directly derived from Latin authors or from old Bible saying, offer a vast possibility for cultural collusions. Even more prosaic elements are labelled in a "romantic" way : a lampshade is, for us, a "day-humbler" (abat-jour).
French people use their language as a display of their culture. When a French intellectual finds an equal, he may use this language to quote references. The fascinating ramifications of French create several layers in the same speech : through this smooth level of subtleness, you can quote prominent French literature, and still be understood by the commoner. French are elitists - yet there are accessible. That's pretty hard in other languages !
French has an elegant, whispering-like and vibrating sound. We do not use sounds that appear like noises. French is chanted, it has a rhythm and a precise movement. And even in our everyday life, we enjoy playing on sounds, puns, alliterations, metaphors… That's mainly a sport.

Of course one can find in Internet a plethora of relevant staff. For instance
http://mentalfloss.com/article/74461/what-makes-french-sound-sexy

What Makes French Sound Sexy?
There's just something about French, a certain je ne sais quoi that makes it widely considered to be the sexiest language in the world. The sensuality of the language, however, is not limited to spoken French itself; the French accent, in English at least, is excessively charming. The sex-appeal of this language knows no boundaries. But what is so sexy about French?


Can you use UML in a TDD project?

Question: If so, at what stage? or it is also an iterative process? If iterative, how formal? Also, how useful is UML for a solo programmer doing open source? While I like to see a picture of the system, it feel so formal and a bunny trail for TDD.
Thanks.
Answer:
Can you use UML in a TDD project?

The use of TDD does not prevent the use of UML, nor does the use of UML prevent TDD. In fact, I would suspect that using UML as a design tool to capture the behavior and interactions of the system would make it easier to write tests first. You would have a reference model of the implementation to use. However, as you implement, you would also need to keep your UML up-to-date, or it will quickly lose its value.

If so, at what stage? or it is also an iterative process?

If you are going to apply UML in a project, there are three points at which it would be most useful.
The first would be when designing the architecture of the system, where you would probably want to use component, deployment, and communication diagrams to show how large pieces of the system will be fitting together and where each component will be deployed. A deployment diagram would be especially useful in a distributed system, where you have nodes will different responsibilities and capabilities.
The next point would be a more detailed design phase, when you start planning class and method level interactions. Here, you would probably find class, composite structure, sequence, object, and state diagrams most useful. The specific diagrams that you would need depend a lot on the complexity of the system and what you want to show.
At each of these two phases, the use of UML allows for you to carry out design reviews. You can validate your design against your requirements to ensure that you aren't missing anything. In a TDD environment, you might want to use these reviews to identify potential problems with implementation of your tests.
The final stages would be during development, maintenance, and enhancement. You have a captured architecture and design that you can refer to. This should also capture your reasoning. As you continue to grow your system, you can see your old design decisions along with why you made them, to determine the feasibility and extent of changes of adding new features. It also provides a blueprint to work from when developing the system - you've done at least some of the thinking up front, so you don't need to worry about connecting your modules on the fly.
Iterative modeling is definitely something to strive for. Not only should you revisit your models early in each iteration as you are designing and planning for new features, but you should also look at reverse engineering to try to keep your models up-to-date. Not all tools can automatically reverse engineer all diagram types, but you can try to keep the other ones up-to-date manually. If you do let a diagram become outdated, be sure to denote it or nix it from any repositories or documents so you don't make decisions based on invalid data.

If iterative, how formal?

It depends.
I tend to be more informal with my UML models. I use the notation that I need to convey to myself and others exactly what the system is doing. I tend to be more minimalistic, focusing on getting a particular message to myself and other engineers for use when developing the system. I capture the message in text (such as notes on the diagram or by embedding the diagram in a Word document along with explanatory text) The idea is that as I develop the system, I'm also developing documentation for myself and others.

Also, how useful is UML for a solo programmer doing open source?

If it's a small system that's going to be built pretty quickly (<6 months of consistent development, or so, just as an off-the-cuff estimate) by one or two developers, the impact of UML would probably be minimal. Over a longer period of time, for more complex systems, or with a larger team, it will help you capture architectural and design decisions and then communicate these across the development team.
The point of UML is not about you, but about communication. If and when other people join your project as testers or developers, having up-to-date UML models can help them understand them system easier. A faster understanding means they are more easily able to get up to speed and start contributing, a plus for everyone.
Answer: Of course you can! You can use UML if and when you feel it would be helpful. It is just a tool and as such can be used not matter what development lifecycle/techniques you are using.
With TDD (and agile, which is usually not far away) it would be useful if, when implementing a new feature, a visualization of the existing code-base would help you or you want to visualize the changes/additions of your new feature. It should not be used to 'define' the code-base in this context, but only to help you understand it. You might just draw it freehand on a piece of paper. Agile/TDD development is quite fluid and a laminated UML diagram would no-doubt be thought of not unlike the devil.
Answer: Your question reflects the perceived chasm between "waterfall" and "agile" thinking, where UML is considered a technique used in BDUF (Big Design Up Front), which is an absolute NO in agile circles.
However, the agile manifesto never stipulated that one should not do any documentation or any design or any architecture up front. It only says "Just enough" and "we value working code more than documentation".
There are projects which do require a bit of up-front design and architecture, and UML is an obvious choice when trying to come to grips with these issues. The trick is to use it "just enough". How much exactly "just enough" is, depends on the project and the team, so you'll have to figure that out for yourself, I am afraid.
Comment: Somewhat disagree if you mean that UML means BDUF. Irrespective of that you can use UML to visualize (i.e. sketch quickly) the code structure when you want to explain how things work.
Comment: @Spoike: I agree with you that UML does not necessarily mean BDUF. I was talking about perceptions and how they influence thinking.

Can you use UML in a TDD project?


Interaction in generalized linear model

Question: I have 2 continuous variables as my predictors and the interaction between them, so 3 effects all together (when I center my predictors only the interaction is significant). I am using a binary logit model except where I have fixed the value of the number of trials at 20, for my dependent variable. My problem has to do with further understanding the nature of the interaction. I know that in generalized linear models the interaction is more complex compared to the linear model because of the link function. I have read that interpreting the sign of the parameter estimates is very limited, so I am trying to find a way to further understand the interaction, and graphing it would be nice as well. Unfortunately, I only have SPSS at my disposal. Jeff Gill (http://www.artsci.wustl.edu/~jgill/papers/interactions3.pdf) wrote about a method called first differences which seems very similar to the inteff command in stata. If anybody could tell me how to how to further understand and test the interaction in a generalized linear model using spss or hand calculations I would be eternally grateful.
Answer: In general, the existence of an interaction means that the effect of one variable depends on the value of the other variable with which it interacts.  If there isn't an interaction, then the value of the other variable doesn't matter.
This is easiest to understand in the case of linear regression.  Imagine we are looking at the adult height (say at 25) of a child based on the adult height of the father.  We further include sex as an additional predictor variable, because men and women differ considerably in adult height.  Let's imagine that there is no interaction between these two variables (which may be true, at least to a first approximation).  We could then plot our model simply as two lines on a scatterplot of the data.  We may want to use different colors or symbols / line styles for men vs. women, but at any rate we would see a football-ish (or rugby-ball-ish, depending on where you live) shaped cloud of points with two parallel lines going through it.  The important part is that the lines are parallel; if someone asked you what the effect would be of the father being 1 inch (1 cm) taller, you would respond with $\beta_{\text{height}}$.  If they further asked you what the effect would be if the child were male or female, you would respond, 'that doesn't matter, you would expect them to be $\beta_{\text{height}}$ taller as an adult either way'.  That is because the lines are parallel (with the same slope, $\beta_{\text{height}}$) / there is no interaction.
Now imagine the case of anxiety on test taking performance when examining two populations: emotionally stable vs. emotionally unstable people.  Lets imagine that there is an interaction such that emotionally unstable people are more strongly affected by anxiety.  Then, if we plotted the model similarly, we would see two lines that are not parallel.  One line (representing emotionally stable individuals) might be sloping downward gradually, while the other line (representing unstable students) might move downward much more quickly.  If we had used reference cell coding, with the stable individuals as the reference category, the fitted regression model might be:
$$
\text{test performance}=\beta_0 + \beta_1\text{anxiety} + \beta_2\text{unstable} + \beta_3\text{anxiety}*\text{unstable}
$$
In such a case, the slope of the first line would be $\beta_\text{anxiety}$ (since $\text{unstable}$ would equal 0), but the slope of the second line would be $\beta_1+\beta_3$.  If someone asked you how much test taking performance would be impaired if anxiety went up by one unit, you would have to say, 'that depends, emotionally stable students would score $\beta_1$ points lower, but emotionally unstable individuals would drop by $\beta_1+\beta_3$ points'.
This is the essence of what an interaction is.  In addition, these examples illustrate the necessity of interpreting simple effects only when interactions exist, and the value of using plots of your model to facilitate understanding.

With a generalized linear model, the situation is essentially the same, but you may have to take into account the additional complexity of the link function (a non-linear transformation), depending on which scale you want to use to make your interpretation.  Consider the case of logistic regression, there are (at least) three scales available: The betas exist on the logit (log odds) scale, whereas $\pi$ (the probability of 'success') exists only in the interval $(0,1)$ and behaves quite differently; in addition, the odds lie between them.  So you need to chose which of these you want to use to interpret your model.  For example, with respect to the log odds, the model is linear, and everything can be understood just as above.
If you were using the odds, you can get odds ratios by exponentiating your betas.  For example, if there is no interaction, the odds ratio associated with a one unit increase in $X_1$ is $\exp(\beta_1)$.  This would also be the odds ratio of the reference category (like the emotionally stable students above) if there were an interaction with a dichotomous variable, but the contrasting category would be associated with an odds ratio of $\exp(\beta_1)*\exp(\beta_2)$.
Unfortunately, neither of those are very intuitively accessible for people, and the non-linear transformation (the link function) makes life more complicated.  It is important to recognize that this isn't specific to interactions; the change in the probability of 'success' associated with increasing $X$ by one unit is never the same as (say) decreasing $X$ by one unit (except in the special case where $x_i$ is associated with $\pi=.5$).  In other words, the change in probability associated with a one unit change in $X$ depends on where you are starting from (in this sense, you could perhaps metaphorically say that it interacts with itself).  The best way to determine the change in probability associated with moving from one level of $X$ to another, is to plug in those levels, solve the regression equation for $\hat\pi$, and then subtract.  The same thing is true if you have more than one variable, but no 'interaction' with the variable in question.  This isn't anything special, it's just that 'where you are starting from' depends on the other variables as well.  Again, the best way to determine the change in probability would be to solve for $\hat\pi$ at both places and subtract.

Interactions in a GLiM should also be treated similarly.  It is best not to interpret interaction effects, but only simple effects (that is, the effect of $X_1$ on $Y$ holding $X_2$ constant).  In addition, it's best to overlay plots of the predicted values (say, when $X_2=0$ vs. when $X_2=1$) on a scatterplot of your data.  Now, for a logistic regression, it is often difficult to get a decent plot of your data as the points are all 0's and 1's, so you might just choose to leave them out.  Nonetheless, a plot of the two curves will typically be the best thing to use.  After you have the plot, a qualitative (verbal) description is often easy (e.g., 'probabilities don't start moving away from 0 until larger levels of $X_1$, and even then, raise more slowly').
Your situation is perhaps a little more complicated than this, because you have two continuous variables, rather than a continuous and a dichotomous one.  However, this isn't a problem.  Typically in this situation, people will be thinking primarily in terms of one of the predictor variables; then you can plot the relationship between that variable and $Y$ at several levels of the other predictor.  If there are theoretically meaningful levels, you could use those, if not, you could use the mean and +/- 1 SD.  If you didn't have a preference for one of the variables, you could flip a coin, or plot it both ways and see which will be easier to work with.
I don't know if / how SPSS will let you make those plots, but if you aren't able to find a way, they should be easy to make manually in Excel.
Comment: It can be hard to see the *data* in a plot, b/c they're only just 1's & 0's, but the sigmoid curve can be perfectly easy to see & informative. If your software can't do it, just get a column of X values in Excel, & plug those into your regression equation, then pass the output through an inverse logit transformation and make a line plot with the result & the original X.
Comment: Thanks so much for the lengthy answer but on the plots isn't a visual interpretation of the interaction difficult because the relationship is non-linear? Meaning, I was thinking the method for graphing that you are describing in the last paragraph only  works well in a linear situation.
Comment: I see what you are getting at and I will give that a try. Thanks so much!
Comment: Gung, I did something similar to what you suggested but I have some reservations. If you would be willing to give me some further help contact me on email. Thanks
Comment: I don't know what your reservations would be, @user20334. See if you could upload the plot to something like http://imgur.com/, & then you could post a new question w/ a link to the plot w/ what you want to know. I, or another user, could edit your new question to display your plot. Then maybe we'd be able to help you further.
Comment: For an example of a plot of predicted probabilities when there is an interaction, it may help to see my answer here: [Graphing a probability curve for a logit model with multiple predictors](http://stats.stackexchange.com/questions/31597//31600#31600).

Interaction in generalized linear model


How to customize Ubuntu 10.10 Netbook Edition Gnome panel?

Question: In 10.10 Ubuntu Netbook edition the panel is even more locked down than in 10.04. Is it possible to unlock it so that one can add/remove things from it? Will the 10.04 method of unlocking work with 10.10?
Answer: No, that method won't work, as the new UNE interface uses a specifically created panel, not in any form related to the old gnome-panel UNE in Lucid used. So, as of now, you really can't customize/add/remove things.
This new panel only holds down the indicator-applet (indicator-applet-complete) package. Let's see what's coming in Natty for UNE and if options like this one, autohide, etc, are added.
Answer: The Ubuntu Network Edition has the Unity interface. This provides the dock on the side and the panel. The panel is not gnome-panel, but part of unity so you can't add panel applets to it. I think Unity is deliberately unconfigurable to improve usability (it is up to you whether or not you agree with this philosophy).
If you want a more configurable interface, you can switch to using a normal GNOME desktop. You can add a panel applet for the global menu to the GNOME panel and use a dock such as docky. This will give you a similar, but more configurable) interface. You will, however, lose out on some of unity's features such as the search interface.
Answer: to remove a program from the side panel: right click -> remove from launcher.
to add a program to the side panel: open program, right click -> Keep in launcher.
Comment: To clarify the question was about customizing the top panel.


Is it okay for Christians to study philosophy?

Question: With this question I regard the general makeup of philosophy. Many claim that both philosophy and Christianity contradict and therefore cannot coexist. I do not mention this to ask, 'can a Christian study philosophy,' because it obviously is possible. Many philosophers have made themselves famous by finding clever ways to isolate and hide evidence of a God and the discoveries by them is what is fundamentally taught, so I ask, is it okay for Christians to study philosophy?
Comment: It is a sign of a truly sad state of affairs that a Christian must ask permission to study the fundamental nature of knowledge, reality, and existence.
Comment: If you will "believe" God *just because it's good*, *it has been said it's good*, or *my mother said me I should believe in God* you probably be Christian just officially, not really. You will not **believe**. You must find your own way how you will get to God. Everyone must. If the philosophy is your way, so be it.
Comment: Your reasoning is the answer to your question. If your perception is that a practice of philosophers is deceitful, then you must decide if you want to involve yourself in the deception.
Comment: Yes, it is okay for Christians to study philosophy. Rene Descartes was one of those philosophers who happened to be Christian. :)
Answer: Let's take a look at Paul.
The book of Acts details the spread of the Gospel from Jerusalem into wider Judea and Samaria, then off through Syria, Asia, Greece, before it concludes with Paul preaching the Gospel in the capital city of the Roman Empire. If we follow along with the way the Christians are preaching the Gospel, we find that once they start talking to Gentiles the references to the Hebrew scriptures drop dramatically.
When we arrive at Acts 17, Paul is standing in the Areopagus, preaching the Gospel to Greek philosophers. He doesn't quote the Law or the Prophets or the Psalms, because they have (little to) no experience with the Hebrew scriptures. Instead, Paul quotes (from memory!) passages from Aratus' Phaenomena and Epimenides' Cretica (Acts 17.28).
And when we read Paul's personal letters, we find: he paraphrases the thought process found in the Jewish book Wisdom of Solomon (Romans 1.18-32; and probably in several other places), he cites Menander's Thais (1 Corinthians 15.33), and again from Epimenides' Cretica (Titus 1.12).
These were works of drama, poetry, and wisdom, both Jewish and Gentile. Paul certainly didn't agree with everything he found in those books, but he had no problems reading them and assimilating some of, in his mind, their best points. And really, Paul's magnum opus, his letter to the Romans, functions as a philosophical argument.
Yes, Christians may study philosophy.
Answer: Even when a philosophy is contrary to Christianity, it is often good to study it, so as to be able to understand what other people think. Such philosophies may also have valid points, despite some erroneous parts.
For example, Marxism, which is fundamentally incompatible with Christianity  because it is explicitly materialistic and promotes a violent class struggle, still raises important concerns that need to be taken seriously. (For instance, it correctly says that it is unjust for those who possess the means of production to exploit their workers. However, it misidentifies what constitutes this exploitation, or alienation.)
More importantly, a good philosophy (especially one based on the metaphysics of being) is essential for the correct understanding of Christianity. The early Church Councils used the terminology of Aristotle to help formulate our beliefs in the Trinity and in Christology. (Concepts such as ousia and hypostasis--translated in the West as substance and person--come from Aristotle.) Many of the Church Fathers, both Greek and Latin, skillfully used Platonic and Neoplatonic philosophy to their advantage.
Naturally, philosophy can be misused: it was an exaggerated adherence to middle Platonism that led Arius to deny the divinity of the Word (the Second Person).
However, there is no fundamental conflict between faith and philosophy. Philosophy should be used critically, but it can be a great help to understanding the Faith.
Answer: 1 Corinthians 10:23

All things are legitimate [permissible—and we are free to do anything
  we please], but not all things are helpful (expedient, profitable, and
  wholesome). All things are legitimate, but not all things are
  constructive [to character] and edifying [to spiritual life].

You can do anything you want - but is it productive?

Ecclesiastes 12:12-13

12 But about going further [than the words given by one Shepherd], my
  son, be warned. Of making many books there is no end [so do not
  believe everything you read], and much study is a weariness of the
  flesh.
       13 All has been heard; the end of the matter is: Fear God [revere and worship Him, knowing that He is] and keep His commandments, for
  this is the whole of man [the full, original purpose of his creation,
  the object of God's providence, the root of character, the foundation
  of all happiness, the adjustment to all inharmonious circumstances and
  conditions under the sun] and the whole [duty] for every man.

This speaks for itself.

1 Corinthians 3:19

For this world's wisdom is foolishness (absurdity and stupidity) with
  God, for it is written, He lays hold of the wise in their [own]
  craftiness;

Proverbs 9:10

The reverent and worshipful fear of the Lord is the beginning (the
  chief and choice part) of Wisdom, and the knowledge of the Holy One is
  insight and understanding.

Solomon was wise by inspiration, yet he had to make a search to collect the proverbs which we can stand by as being God's own direction. Yet to do that, no doubt he himself had to wade through a lot of philosophical trash of his time.

Daniel ( Known for having sharp wisdom ) had been instruction in the wisdom/philosophies of the Chaldeans (some of their contributions to worldly wisdom still have value), yet it's obvious Godly wisdom was Daniel's foundation. He was also inspired.

Luke ( Christian example ) was a physician and no doubt had access to all sorts of his own modern day resources of philosophy, practical or not. Yet the same as the above two, Godly wisdom was the main determinant in his understandings.

Apostle Paul (Christian Example) most certainly knew a great deal in philosophy of every sort (he was able to quote a poet of his time for an example) yet its obvious he relied on God's wisdom to determine fact from foolishness.

Many things taught as fact today are indeed hollow philosophies, and some things we are required to be exposed to. But with God's wisdom as the standard of judgement (and an honest approach on a student's part) it should be easy to separate the pearls from the garbage among today's "philosophies".
Many, many, many people make the mistake of not using mental discipline when looking through beliefs/philosophies and tend to go with whatever is fun or attractive. Conversely if you avoid bias and make an honest search, you could easily follow the paths of the good example such as the ones stated above.
Answer: It is really a myth that philosophy is explicitly anti religious. Sure there are non or anti religious people among them but I'm not convinced they are more or less than any other profession. Do not think Phil people are really like the Movie God is not dead. It is not like that at all.
If you want to defend the Christian world view in any academic setting a good education in the Philosophy of Religion will be a great asset.
It is also worth noting that at least to William Lane Craig mind there has been a great Renaissance in the philosophy of religion in the US in the last 50 years. He often mentions it that just 50 years ago it would have been unheard of for there to be professional philosophical journals dedicated to the Philosophy of religion and now there are several. He often cites this as evidence for a religious renaissance.
He also tells the story in one of his old podcasts where he was approached by Rutgers. (A school that to be fair is very liberal.) They asked him if he would write a book for them to use in a general religious type of class. Maybe as an introduction to the Philosophy of Religion type of class.
He said "You betcha I will" and did it. Afterwards he told the people at Rutgers something to the effect of "This is a very conservative view of Christianity." to Which they replied "We know that is what the people want."
So I would just like to say that not only should a person who wants to make it his life's work to minister in some fashion or another be open to a good philosophy education but also that you may now find it a much more easier task as what was the case when WLC or Alvin Plantinga was looking into further education.
Answer:
Rom 16:19  For your obedience is come abroad unto all men. I am glad therefore on your behalf: but yet I would have you wise unto that which is good, and simple concerning evil.
Jas 4:17  Therefore to him that knoweth to do good, and doeth it not, to him it is sin.

If your part of a group that forbids you from studying any topic not expressly evil (we are commanded to be simple concerning evil) then you should leave.
Christ is a philosopher His teachings majored in ethics just as much as they did pneumatology. That is to say modern philosophers like Kant, Hegel, Marx and ect are all imperfect human beings and not the God head bodily. Some of their humanistic statements are flawed possibly even evil. Its up to you to discern by the power of the Holy Spirit (read your inner intuition) based on the Bible whats good and whats bad.

Mat 11:19  The Son of man came eating and drinking, and they say, Behold a man gluttonous, and a winebibber, a friend of publicans and sinners. But wisdom is justified of her children.

For instance as per the above verse Christ believes the ends justifies the means in some situations and modern ethics does not.

1Th 5:21  Prove all things; hold fast that which is good.
1Th 5:22  Abstain from all appearance of evil.

Ethics and other parts of philosophy are good hold to it. (Through ethical behaviour comes not salvation though.)


Longest double increasing subsequence (LIS variant)

Question: I'll start with the definitions:Let $S = s_1s_2...s_n$ be a sequence of $n$ integers. A double increasing subsequence of $S$ is a sequence $P=p_1p_2...p_k$ (not necessarily continuous) where for each $2<i\leq k$ we have $p_{i-2} < p_i$. For example, if $S = 1 \space 4\space 2\space 7\space 1\space 6$, a possible double increasing subsequence is $P = 1\space 2\space 7\space 6$ because $7 > 1$ and $6 > 2$. (For every sequence $S$ with more than 2 elements, there's a trivial subsequence of length 2) The problem is to determine the length of longest double increasing subsequence (LDIS) of a given series of integers, $S$.
This is what I've done: I defined $C[i]$ to be the length of the LDIS of the series that ends with $s_i$, and $E[i]$ to be the element before the last element of the LDIS that ends with $s_i$. In the example aforementioned, $C[6] = 5$, and $E[6]=7$. If there are several options for $E[i]$, we'll take the minimal one. For example for $C[5] = 2$ we have 3 different options for LDIS, all of lengths 2: $4 \space 1$,  $2 \space 1$ and  $7 \space 1$ (Trivial LDIS's), so we'll define $E[5] = 2$.
Now my dynamic programming solution is just like LIS solution (the $n^2$, not the $nlogn$):
If $C$ and $E$ are my $n$-sized arrays, $C[1] = 1, E[1] = \inf$(meaning there's no previous value), $C[2]=2,E[2]=s_1$, and for every $2<i\leq n$ we finding $C[i]$ by iterating over the previous $i$ calculates values, and we take the maximum over the $C[i]$'s such that $s_i>E[i]$, plus 1. (Again, if there are several candidates, we take E[i] as the minimal of the possible options) After calculating all $n$ values, we iterate over the array and choose the index that hold the maximal $C[i]$.
This is my mind set in general, maybe I've missed several details but I believe I delivered the idea. Now these are my problems with my solution:
1) It misses strong, well defined recursive formula. I can phrase some sort of recursive relation according to the regularity of the question, but it feels kinda forced. (Despite of the iterative solution I've describe, which is fairly simple)
2) I've ran the algorithm on several examples and it seems to give a right answer, but as a consequence of 1, I have hard time "believing" my solution is correct. I feel like there's more simple and elegant solution to the problem.
Any ideas will be vastly appreciated, thanks in advance.
Comment: Do you have any specific question about either 1) or 2)?  As it is, your post is a status report, not a question. What have you tried towards a recursive formulation and a correctness proof?
Comment: If you're not sure that your solution works, prove that it does. That's the best way to know for sure.
Comment: @YuvalFilmus The OP has already identified that he's missing a recursive formulation and correctness proof.
Comment: You say you've "ran the algorithm" and are looking for a "recursive formula", if you provide the algorithm code explicitly, perhaps we can be of use in providing the formula ;)
Comment: Are the $p_i$ required to be distinct? I assume so.
Answer: A counter example where your algorithm fails:
S = 0 7 1 4 6 5 3 2.
Expected : 5, your algorithm would produce 3
There is an O(n^3) dynamic programming based algorithm for this if you are interested :)


How to get a texture from current point of view in OpenGL 2.0 ES?

Question: Probably the title is confusing, but I didn't know how to ask better, sorry about that. What I would like to do is get a bitmap texture that represents exactly what's rendered at one point in time and save it as a file (I know how to save it, I need only to find out how get the bitmap data form OpenGL) Like a screen shoot, sort of.
Answer: I think that changing the Render Target is what you're looking for. This is also known as "Render to texture".
When you draw stuff in GLES (or GL, or DirectX, or whatever you use), the place the stuff you draw to is called the "Render Target". Usually you render on a backbuffer to be drawn onto the screen, but graphic engines also allow you to draw on a custom render target you can then use as a texture for drawing other stuff.
Custom render textures are the key to enable interesting effects such as mirrors, shadow mapping, PiP, among many others.
Here's another explanation of render buffers, for XNA.
In particular, for GLES, you may want to look at glGenRenderbuffers, glRenderbufferStorage, glBindRenderbuffer and other associated functions.
Here's an example of how to do it in desktop OpenGL.
Comment: You're right, this iswhat i'm looking for, thank you!
Comment: @Meda Make sure you read Trevor Powell's answer as well. Changing the render target only helps you when you're going to use the result of a rendering for further rendering, without taking your texture out of the GPU. If you want to pull the pixels out from the GPU back to the CPU, you have to use `glReadPixels` like Trevor Powell says.
Answer: glReadPixels can read back pixel values from the framebuffer, which you can then save out to disk.
(Note that you don't want to use glReadPixels normally, as it makes your code stall while the GPU catches up, and reading pixels back from the GPU is usually a rather slow operation.  But for the purposes of saving screenshots or debugging rendering issues, it's absolutely what you want to use.  If the eventual goal is to feed rendered images back into the rendering system for use as a texture, then Panda's answer is the correct and performance-friendly way to do that.  But if you need to get the pixel values back to the CPU so you can save them out, glReadPixels is really the only way to do that.)
Comment: Will keep in mind the glreadpixels function, thanks, would upvote if I could.


What was the meaning of the name "Allah" before Islam?

Question: What does the name of Allah mean in the eyes of the Arabs before Islam? (Given that the name of the father of the Prophet of Islam was Abdullah)
Answer: The pagans of Mecca believed in "Allah" as the head of their pantheon and the creator god, with other deities ascribed as his children.
Islamic history states this was because the Arabs were originally monotheists, being the descendants of Abraham through Ishmael and followed Abraham's religion of aniconic monotheism ... though over the ages corruptions such as polytheism and idolatry crept in.
Abraham and Ishmael built the Kaabah in Mecca and Ishmael and his progeny settled there, and the Quraysh and other Arabian tribes claimed descent from him.

Quran 2:127-129 And [mention] when Abraham was raising the foundations of the House and [with him] Ishmael, [saying], "Our Lord, accept [this] from us. Indeed You are the Hearing, the Knowing. Our Lord, and make us Muslims [in submission] to You and from our descendants a Muslim nation [in submission] to You. And show us our rites and accept our repentance. Indeed, You are the Accepting of repentance, the Merciful. Our Lord, and send among them a messenger from themselves who will recite to them Your verses and teach them the Book and wisdom and purify them. Indeed, You are the Exalted in Might, the Wise."
Quran 14:35-37 And [mention, O Muhammad], when Abraham said, "My Lord, make this city [Makkah] secure and keep me and my sons away from worshipping idols. My Lord, indeed they have led astray many among the people. So whoever follows me - then he is of me; and whoever disobeys me - indeed, You are [yet] Forgiving and Merciful. Our Lord, I have settled some of my descendants in an uncultivated valley near Your sacred House, our Lord, that they may establish prayer. So make hearts among the people incline toward them and provide for them from the fruits that they might be grateful.

Jami Tirmizi and (variant) Sahih Muslim, Book of Virtue :
قال رسول الله صلى الله عليه وسلم  " ان الله اصطفى من ولد ابراهيم اسماعيل واصطفى من ولد اسماعيل بني كنانة واصطفى من بني كنانة قريشا واصطفى من قريش بني هاشم واصطفاني من بني هاشم
The Messenger of Allah said:  "Indeed Allah has chosen Ishmael from the children of Abraham, and He chose Banu Kinanah from the children of Ishmael, and He chose the Quraish from Banu Kinanah, and He chose Banu Hashim from Quraish, and He chose me from Banu Hashim."

You can find a detailed accounts of this in e.g  the Seerah of Ibn Kathir here.

Regarding the origin of the name Allah. Its a special form of ilah (god) and is cognate to the Hebrew Elohim which is from Eloah (also see Aramaic Elah) which is thought to be derived from the semitic name EL (as in GabriEL and IshmaEL), all forms occur in the Torah\Tanakh to refer to God.
Examples of their usage in the Tanakh\Old Testament:

Bereshit, bara elohim, et hashamayim, ve'et ha'aretz
In the beginning God created the heaven and the earth.
 — Genesis 1:1

...

Vayishman yeshurun vayiv'at, shamanta avita kasita; vayittosh eloah asahu, vaynabbel tzur yeshu'ato
And Jeshurun became fat and rebelled; you grew fat, thick and rotund;
[Israel] forsook the God Who made them, and spurned the [Mighty]
Rock of their salvation.
 — Deuteronomy 32:15

...

bishnat ẖada lekhovresh malkaˈ kovresh malkaˈ sam teˈem bet-ˈelaha virushelem
In the first year of Cyrus the king the same Cyrus the king made a
decree concerning the house of God at Jerusalem.
 — Ezra 6:3
Answer: Arabs knew Allah before Islam. Their problem was that they didn't worship Him alone.
Quran explains this in many places, for example:

And if you should ask them, "Who has created the heavens and the
  earth?" they would surely say, "They were created by the Exalted in
  Might, the Knowing." 43-9

Also

Unquestionably, for Allah is the pure religion. And those who take
  protectors besides Him [say], "We only worship them that they may
  bring us nearer to Allah in position." Indeed, Allah will judge
  between them concerning that over which they differ. Indeed, Allah
  does not guide he who is a liar and [confirmed] disbeliever. 39-3

As you mentioned also, Arabs before Islam had names like Abdu-Allah, (Allah's servant).
Comment: In Arabic Christians and Jews use Allah. In Hebrew  used to call Him YaHwe, or in the past YAHWA (ya Hwa- meaning O He). In the bible  you can find it as Ela, or as in the Movie of Jesus, Ala.
Comment: Yes they worshipped idols, but remember they had followers of Abraham, christians, and from the jews amongest them.
For them Allah was The creator, and they thought they would become nearer by worshipping the idols.
Comment: With regard, how Arabs familiar with Allah before Islam? And what they known about Allah, before Islam? And what about Idol and idolatry? As their religion was Idolatry, who was believe Idol, what place did Allah have for them?
Comment: Is Allah name common within Christians and Jews? What is the God name within this religions?
Answer: There were different types of Arabs before islam majority were pagans but some where christians or jews but all arabs used the word Allah for god .there are archaeological evidences showing rings worned by arab christians with the word Allah inscribed on it


Leak only inside the tire

Question: I have a tube with a Schrader valve, previously repaired (twice). I needed to use it, so I inflated it by hand until it ballooned to 2x the size, search for leakages in water (valve too) and let it all night to check for slow leakages, but none were found. Later, I put it inside the tire, inflated it by hand (~15 psi) again, put a little soap in the valve, and went to check my email. Ten minutes later, it was totally flat. I repeat the whole procedure twice and it was the same story: the tire showed no leakage outside the tire but lost all pressure when inside the tire. (Finally, it blew out while outside the tire). Why is this happening? I'm just curious ...
Comment: The most sensible thing to do is buy another tube. They're cheap and expendable and meant to be replaced from time to time. If it happens again, check the inside of the tire and rim for glass/wire/splinters...anything that will perforate the tube.
Comment: But my guess would be a defect near the stem that is somehow opened up by placing it on the rim.
Comment: Tube was not perforated ...
Comment: 15 PSI is hardly inflated.  Did you try inflating it to a higher pressure while in the tire?
Comment: First time I inflated it at the gas station (40 psi). The other times I used a small hand pump, that give 20 psi at most (good enough for getting to the gas station)
Comment: Just out of curiosity, when it popped, where was the hole?
Answer: Your tire tube is still subject to the basic laws of physics and logic on this Earth. If air is leaking out of it, then there is a leak somewhere and it is perforated.
There is probably something in your tire causing the damage, especially if this continues to happen. It's also possible that the leak was close to the valve, and whenever the valve was up against the rim of your wheel, it was bent just so to allow the leak.
Answer: Try putting the tire in water with a bit of dish soap. The soap will make the bubbles a bit more apparent.  Adding a bit more pressure and trying to articulate the area around the valve may help identify the source of the leak. Keep an eye out for tiny air bubbles forming on the surface of the tube while you hold it under water. Also, be careful to check around existing patches.
After checking the tube thoroughly, check the inside of the rim for any sharp ridges or places where the rim tape maybe has been worn too much and may let a sharp edge protrude under pressure.
Then check the tire itself for any items which may be lodged in it.  Glass and metal shards can hide within the rubber of the tire, and when under load or pressure, the fragment can puncture your tube. They may not always be visibly apparent. Slowly feel around the inner surfaces of your tire (lining up the label on the tire with the valve stem can help you identify where to look if you find a hole in the tube).  Sometimes I try and work slowly around the tire and bend the tire so that any gaps in the inside of the tire would open slightly and expose the fragment.
Answer: Well, I think it is not the fact that it is inside the tyre, but you are probably inflating it to much larger pressure when inside the tyre. At larger pressure tube starts to leak.

Leak only inside the tire


Voice recognition in Raspberry Pi in custom language

Question: I want to build a voice controlled system for very simple tasks using the RPi. Like lighting an LED or running a motor. But I want to set up the voice system in my own language and define my own custom words and actions associated with them. I am not looking for creating complex commands such as searching online etc. Is this doable? Where do I even begin?
Comment: I would start with controlling a motor led etc. then add voice control (normal language) and only when I was sure the first two worked as expected go about inventing my own language. If not done this way you will have a nightmare trying to debug the system. Does it not work because of an electronics problem? Software? the voice recognition? the parser? pattern matcher? etc.
Comment: Welcome to the Raspberry Pi flavoured corner of the Stack Exchange Network. I think Mr @SteveRobillard has not noticed that English may __not be your native language__ and that you want to know if there are any speech recognition systems/libraries/methods that work for _other, __real___ languages used in the world at the moment, not ones that are being constructed by the coder or a group of enthusiasts. (I guess Esperanto and Klingon are included in the former groups)...!
Comment: Thanks for the tip! But again, how do you get started on the speech recognition part?
Answer: According to this related question on our sister Stack Exchange "Can I get Speech Recognition in language other than English on Android?" Pocket Sphinx might be a possible route to go down.  The answer there suggested that it only had Language Models and Dictionary Files for English languages - perhaps that has improved since the answer was given a couple of years ago.
For the record Pocket Sphinx is one of a group of Speech recognition engines collective called CMU Sphinx from Carnegie Mellon University.
Answer: you can refer this link : https://diyhacking.com/best-voice-recognition-software-for-raspberry-pi
and also this one : https://stackoverflow.com/questions/26827178/voice-to-text-translator-raspberry-pi
Comment: We're trying a new policy with regard to informationless link-only answers here. If this post is not edited to contain information that can stand as an answer, however minimal, in 48 hours it will be converted to Community Wiki to simplify having it corrected by the community.


Are rejections usually quick for papers submitted to journals?

Question: When submitting papers to journals, I understand from experience that acceptance can take quite some time (on the order of several months), even when a reviewer is immediately assigned to the paper.  But can a referee usually tell fairly quickly if the article should be rejected?  Are there any horror stories of waiting several months after a reviewer agrees to look at your paper, only to get a rejection letter?
Comment: If we had a dataset we could make conclusions: https://opendata.stackexchange.com/questions/13071/journal-acceptance-rejection-dataset-with-timeline
Comment: _acceptance can take quite some time (on the order of several months)_ - or years, depending on the field.
Comment: I think it's a rather too extreme (and partially hypothetical) situation to warrant being a proper answer, but: Mochizuki's proof of the abc conjecture remains under review after over 5 years.  And some experts seem to feel there are reasons that the proof is critically flawed, and if deemed unfixable it would then be rejected (though since Mochizuki is the managing editor of the journal he submitted to, who knows...). Such a review time is not considered unreasonable for such a complex, lengthy, and (potentially) significant result, however. It was similar for Wiles' work.
Comment: On the other end of the extreme: I got a paper rejection after 26 hours (this was from a very reputable journal in my field). I guess there is no universally applicable answer here. You could probably apply the generel tendency of longer review times to the first response times, e.g. mathematics takes longer than most other fields.
Comment: Sadly not. Everyone has (well many people have) a story of waiting two years and then getting  a rejection.  Some journals have a first phase where the editor often rejects without sending out for review. Those come quickly.
Answer: The answer depends on the journal, the paper, and the reviewer(s). You might hear relatively quickly if there is a trusted reviewer available quickly and he/she isn't too busy with other work and the paper is either especially good, or especially bad. Often the bad is easier to judge than the good, of course. The longest reviews are the intermediate papers, especially if different reviewers have different opinions about it. "We want to publish this. Do we have room in an upcoming issue? We have a lot of competing papers. I love it. I don't think it's quite ripe yet. Etc. Etc. Etc."
Note also that the reviews of intermediate papers (and even some judged to be quite good) may come with some advice for improvement that will, perhaps, lead to acceptance after additional review. This will depend on the journal, of course.
However, don't wait to hear the judgement of the reviewers. Continue work on the project, working to improve both the result and its presentation. Work to extend the result.
Answer: Yes, it can happen. I've seen one paper which was rejected after four rounds of revisions. The reviewer was dubious about the method employed, but was not confident enough to advocate immediate rejection. After some back-and-forth with the authors the reviewer eventually decided that the method was too adventurous to give reliable results, and the paper was rejected.
Having said that, it's possible also that the reviewer writes a quick report with "this paper is so bad, it doesn't have X, Y and Z, and I'm shocked you're even considering publishing it". The exact specifics will depend on the paper in question.
Here's a source on the rough timeline in mathematics (not necessarily applicable to your field). To quote:

Our average time to reject a non-serious submission is 7 days, our average to reject a more serious submission is 47 days, and our average time to accept is 121 days. There is considerable variance in these figures, so they should be interpreted cautiously.
Comment: Reproducing that blog passage and calling it "the timeline in mathematics" is really misleading.  These are the statistics for one journal at the end of its first year, after less than 100 submitted papers.  They are not typical in any way: rather, they are very quick (and that is presumably the point of the editor of the new journal reporting them).  Also "I meant it to illustrate that rejections are not always quick (if 7 days is quick, then 47 days surely isn't)." doesn't make any sense to me: both 7 days and 47 days are extremely quick processing times in mathematics.
Comment: That timeline is particular to that journal and area, though.  In my own field, at least in my own experience, it is common to wait more like 6-7 months (~180-200 days) to receive the first review.  As such this is usually the earliest you receive a rejection that wasn't a desk rejection. In some cases the editor might try to find reviewers, fail, and then reject after a few months; or you might get lucky and get a speedy reviewer (fastest turn-around I've heard of is two weeks). Revisions can easily tack on another few months before acceptance, and are almost always needed.
Comment: I was that reviewer once. A claim was dubious, I demanded the proof—which is well-known in the literature how to demonstrate—and didn't get it across multiple rounds of revision. When I did, it proved the claim was dubious and that the authors didn't understand what a major chunk of their work was actually saying. Rejection quickly followed.
Comment: @zibadawatimmy right, I meant it to illustrate that rejections are not always quick (if 7 days is quick, then 47 days surely isn't).
Comment: My horror story -- after waiting 6 months, my submission on the system disappeared!   So I had to email the editor-in-chief but he/she did not respond.  So I decided to submit it to another journal.  After one month, the paper was accepted by the journal that 'erased' my submission.  Consequently, I had to withdraw the article from the other journal.
Answer: We once had a rejection after about 24 months and the journal would refuse to give us any meaningful status updates that would have helped up decide whether to withdraw the submission and go with another journal. On one occasion, after waiting for about 16 months to hear back about a submission, I wrote to the editors directly, politely telling them that I was considering withdrawing my paper with them. After a couple of weeks I have received the reports from the referees and the paper was accepted.
These situations are always a bit tricky to handle. If you decide to go with another journal, there is no guarantee that the process will be faster, and besides you have probably waited for some months already. Try to find out the typical wait period of a journal with your colleagues first to get an idea of what could be in store for you, keeping in mind that every submission is a story on its own.
Good luck!
Answer: Short Answer: Desk rejects are quick, but if it goes out to review, then rejections tend to take as long as any other first-round outcome. So if you haven't heard anything from a journal after 2 or more months, it probably means that your article has been sent out for review, but nothing more.
Longer Answer
Desk reject: This is where the article does not get sent out for external review. Rather someone on the editorial team (e.g., editor, action editor, a team) review the manuscript and deem that it is not worth sending out for review. Desk rejects are usually quite quick (e.g., 1 to 4 weeks is common in my experience). Note that not all journals do desk rejects, and many journals vary in how much they filter at this stage.
First round rejections: This is where the paper is rejected after the first round of external review. In my experience, the time to reach a decision is often unrelated to the outcome, and therefore it takes as long as the review process takes. Your question implies that a reviewer looks at a paper and can quickly determine that it should be rejected. It's more likely that the manuscript is sitting in a reviewers inbox, and the reviewer is waiting to find the half-day or so to review the paper. In my area 2 to 4 months for an external review is common. But as you'll read, first round review times vary a lot between journals and fields, and from manuscript to manuscript.
That said, occasionally I've had review assignments taken away from me around the one month mark because one of the other reviewers gave a review sufficient to make it clear that the paper should be rejected. And sometimes editors will get an additional reviewer, if the first set of reviewers are inconclusive. So occasionally, the external review process may be quicker if it's a clear reject. But in general, the length of the first round review process is not diagnostic as to whether it will be accepted or rejected.
Second/third/etc round rejections: Your question does not seem to be asking about rejections at this stage. But the general point remains that the time to get a response is relatively unrelated to the outcome. Perhaps the main question here related to time wasting is where the journal gives you a revise and resubmit but then rejects your manuscript after you make the revisions. In general, good journals will give you a sense of what the likely outcome is if you conscientiously make the revisions. Some will use language like accept subject to revisions, minor revisions, major revisions, allowed to submit again, etc. This can give you some sense of the scale of revisions. Sometimes the editor will say that you can resubmit, but that it is a "high-risk resubmission". Thus, good journals will manage expectations about what the likely outcome will be given a thorough and conscientious implementation of the requested revisions.
Horror stories: You also asked the following question:

Are there any horror stories of waiting several months after a reviewer agrees to look at your paper, only to get a rejection letter?

First, time between submission and acceptance might look something like this:

administrative screen (1 week)
editorial screen with potential for desk reject (1 to 4 weeks)
potential reviewers are contacted
time for reviewers to complete assignment vary and review process is determined by slowest reviewer (can be anything, but often 1 to 4 months)
editor/action editor has to review external reviewers (anything from days to months) and reach a first-round decision.

As an author, you don't usually find out how long the components of the review process take. Your question implies that there is one person "a reviewer" deciding to review and then rejecting. But rather, these are usually different people, and there are multiple reviewers. At most journals, the external reviewers inform and make recommendations to an editor / action editor. They do not make the decision.
So in general, there are different norms about how long a review takes. But in my field of psychology (1 month is amazing, 2 months is nice, 3 months is par, 4 months is okay, 5-6 months is slow, beyond 6 months would be concerning). Other fields and journals have different norms. The point is I would not see waiting 4 to 6 months as a horror story. It's a bit slow. But It's just how long things sometimes take, and something that might factor into where I send my work in the future. And  the length of time has almost nothing to do with the outcome. So in general, rejection is unpleasant and slow review processes are also unpleasant, but they're separate issues.
If the first-round review process is taking an amount of time well beyond the norms of your discipline, then you may wish to contact the journal to see what is the hold-up. Based on the response you get, you could weigh up the pros and cons of withdrawing your manuscript. That said, given the energy that may have already been invested in reviewing manuscript, I'd see withdrawing a manuscript as very much a last resort.
Answer: I had a rejection once after 7 months of waiting accompanied with review reports that in my opinion did not motivate a rejection. I guess my paper was just felt out of scope for this journal.
I suspect there will be many horror stories. If you want to break the chain just continue (all work will eventually be accepted somewhere) and make sure you don't become 'such a reviewer' later on in your career. As a reviewer, I fight against my own desire to take revenge when I notice thoughts crossing my mind like 'my work was rejected for less'.
Unfortunately, the review process lacks transparency and external quality control. There is no training or feedback for reviewers either.
Answer: In my (pure math) experience, rejections after review are often significantly faster than other outcomes (minor corrections etc.). There are two likely reasons for this.

There are several possible reasons for recommending rejection, but a common one is "not interesting enough for this journal". It's possible to reach such a conclusion very quickly, and there is certainly no need to check the proofs in any great detail in that case.
Many journals have a guideline that one recommendation to reject is sufficient, but two positive reviews are needed for another outcome; the second review may come in much later than the first.