After issuing DROP TABLE or ALTER TABLE command pg_stat_activity table becomes full of Locks and the query hangs forever. Killing PIDs and reissuing query gives the same result. The problem disappears after the system gets restarted (I restart docker container for that). How to investigate this issue?

Our production environment just froze* this morning for a while when altering a table, adding a column actually.   Offending SQL:ALTER TABLE cliente ADD COLUMN topicos character varying(20)[];  * Login into our system requires a select from that very same table, so no one could login during the alter table. We actually had to kill the process to allow the system resume normal operations.    Table Structure:   CREATE TABLE cliente (   rut character varying(30) NOT NULL,   nombre character varying(150) NOT NULL,   razon_social character varying(150) NOT NULL,   direccion character varying(200) NOT NULL,   comuna character varying(100) NOT NULL,   ciudad character varying(100) NOT NULL,   codigo_pais character varying(3) NOT NULL,   activo boolean DEFAULT true,   id serial NOT NULL,   stock boolean DEFAULT false,   vigente boolean DEFAULT true,   clase integer DEFAULT 1,   plan integer DEFAULT 1,   plantilla character varying(15) DEFAULT 'WAYPOINT'::character varying,   facturable integer DEFAULT 1,   toolkit integer DEFAULT 0,   propietario integer DEFAULT 0,   creacion timestamp without time zone DEFAULT now(),   codelco boolean NOT NULL DEFAULT false,   familia integer DEFAULT 0,   enabled_machines boolean DEFAULT false,   enabled_canbus boolean DEFAULT false,   enabled_horometro boolean DEFAULT false,   enabled_comap boolean DEFAULT false,   enabled_frio boolean DEFAULT false,   enabled_panico boolean DEFAULT false,   enabled_puerta boolean DEFAULT false,   enabled_rpm boolean DEFAULT false,   enabled_supervisor integer DEFAULT 0,   demo boolean,   interno boolean,   mqtt_enable boolean NOT NULL DEFAULT false,   topicos character varying(20)[],   CONSTRAINT pk_cliente PRIMARY KEY (rut),   CONSTRAINT fk_cliente_familiaid FOREIGN KEY (familia)       REFERENCES cliente_familia (id) MATCH SIMPLE       ON UPDATE NO ACTION ON DELETE NO ACTION,   CONSTRAINT pk_pais FOREIGN KEY (codigo_pais)       REFERENCES pais (codigo) MATCH SIMPLE       ON UPDATE NO ACTION ON DELETE NO ACTION,   CONSTRAINT unique_id_cliente UNIQUE (id) ) WITH (   OIDS=FALSE ); ALTER TABLE cliente   OWNER TO waypoint; GRANT ALL ON TABLE cliente TO waypoint; GRANT ALL ON TABLE cliente TO waypointtx; GRANT SELECT, UPDATE, INSERT, DELETE ON TABLE cliente TO waypointtomcat; GRANT SELECT ON TABLE cliente TO waypointphp; GRANT SELECT ON TABLE cliente TO waypointpphppublic; GRANT ALL ON TABLE cliente TO waypointsoporte; GRANT SELECT, INSERT ON TABLE cliente TO waypointsalesforce; GRANT SELECT ON TABLE cliente TO waypointadminuser; GRANT SELECT ON TABLE cliente TO waypointagenda; GRANT SELECT ON TABLE cliente TO waypointmachines; GRANT SELECT ON TABLE cliente TO waypointreports; GRANT SELECT ON TABLE cliente TO readonly;  CREATE INDEX index_cliente   ON cliente   USING btree   (rut COLLATE pg_catalog."default");  CREATE INDEX index_cliente_activo   ON cliente   USING btree   (activo);  CREATE INDEX index_cliente_id_activo   ON cliente   USING btree   (id, activo);  CREATE INDEX index_cliente_rut_activo   ON cliente   USING btree   (rut COLLATE pg_catalog."default", activo);   CREATE TRIGGER trigger_default_admin   AFTER INSERT   ON cliente   FOR EACH ROW   EXECUTE PROCEDURE crea_default_admin();  CREATE TRIGGER trigger_default_grupo   AFTER INSERT   ON cliente   FOR EACH ROW   EXECUTE PROCEDURE crea_default_clientegrupo();     Should I disable CONSTRAINTS, TRIGGERS, or something else?  Perhaps any DB Tuning?  What else should I provide for further analysis?  Version: PostgreSQL 9.4.5 on x86_64-unknown-linux-gnu, compiled by gcc (Debian 4.9.2-10) 4.9.2, 64-bit


A Plugin ( download monitor ) saves uploaded files in a certain folder called "dlm_uploads" within the WP upload directory. All files are visible in Media Library. Unfortunately the upload path cannot be changed in the plugin. can I hide this folder in the media library? thanks

I have some section where user can upload CV and profile images,  I'm using the native attachment functions,  $attachment_cv_id = media_handle_upload( 'candidate_cv', 0 ); if ( ! is_wp_error( $attachment_cv_id ) ) {     // We link this file to the post      // add_post_meta( $result , 'wpcf-cv-file', wp_get_attachment_url($attachment_cv_id)); } else {     $submit_candidate_errors[] = lang("Hubo error subiendo la CV"); }   Is there any way I can hide this files from the media section in the wp-admin? ( perhaps changing its folder )  Thanks  -EDIT-  i'm trying like Dave suggested, adding a meta: 'rrhh-file'  $attachment_id = media_handle_upload( 'apply_file', 0 );  if ( ! is_wp_error( $attachment_id ) ) {     // The image was uploaded successfully!     add_post_meta($attachment_id, 'rrhh-file', true); }   And even that it has the attribute:  var_dump(get_post_meta(1200)); // last id I uploaded die();   Prints out:  array(4) {   ["_wp_attached_file"]=>   array(1) {     [0]=>     string(20) "2017/06/image001.jpg"   }   ["_wp_attachment_metadata"]=>   array(1) {     [0]=>     string(666) "a:5:{s:5:"width";i:523;s:6:"height";i:122;s:4:"file";s:20:"2017/06/image001.jpg";s:5:"sizes";a:2:{s:9:"thumbnail";a:4:{s:4:"file";s:20:"image001-150x122.jpg";s:5:"width";i:150;s:6:"height";i:122;s:9:"mime-type";s:10:"image/jpeg";}s:6:"medium";a:4:{s:4:"file";s:19:"image001-300x70.jpg";s:5:"width";i:300;s:6:"height";i:70;s:9:"mime-type";s:10:"image/jpeg";}}s:10:"image_meta";a:12:{s:8:"aperture";s:1:"0";s:6:"credit";s:0:"";s:6:"camera";s:0:"";s:7:"caption";s:0:"";s:17:"created_timestamp";s:1:"0";s:9:"copyright";s:0:"";s:12:"focal_length";s:1:"0";s:3:"iso";s:1:"0";s:13:"shutter_speed";s:1:"0";s:5:"title";s:0:"";s:11:"orientation";s:1:"1";s:8:"keywords";a:0:{}}}"   }   ["rrhh-file"]=> // <-- here   array(1) {     [0]=>     string(1) "1"   }   ["_edit_lock"]=>   array(1) {     [0]=>     string(12) "1498731595:1"   } }   With this action this attachment still shows up in the media library  add_action( 'pre_get_posts', 'wpse_hide_cv_media_list_view' ); function wpse_hide_cv_media_list_view( $query ) {     // Bail if this is not the admin area.     if ( ! is_admin() ) {         return;     }      // Bail if this is not the main query.     if ( ! $query->is_main_query() ) {         return;     }      // Only proceed if this the attachment upload screen.     $screen = get_current_screen();     if ( ! $screen || 'upload' !== $screen->id || 'attachment' !== $screen->post_type ) {         return;     }      // Modify the query.     $query->set( 'meta_query', [         [             'key'     => 'rrhh-file',             'compare' => 'NOT EXISTS',         ]     ]);      return; }   Any idea what i'm missing?


Can anyone explain intuitively what actually are components of forces (in the $x,\,y,\,z$ directions)? Are they actual forces? Can the components have their own components in other directions?

Let's say we have an object lying on a slope, the weight of the object can be divided into two components one horizontal and one vertical. My question is does the weight act only in these two directions or does it spread evenly between the the both components?


$C[a,b]$ denotes the space of continuous real-valued functions on $[a,b]$. The metric associated with $C[a,b]$ here is $d(f,g)=sup[|f(x)-g(x)|]$ where the supremum is taken over $[a,b]$. $C^1[a,b]$ denotes the one of continuously differentiable functions on $[a,b]$.  I think the second is a closed subset of the first but I can't get my head around a proof! Can someone give me a plan, a hint or anything, so I can try this out again? It would be very helpful and clarify what I (probably) didn't understand.   Thank you very much!

So, I have the following question:      Let $C[a,b]$ denote the space of continuous real-valued functions on   $[a,b]$ with the sup-metric. Let $C^1[a,b]$ denote the space of   continuously differentiable functions on $[a,b]$. Is $C^1[a,b]$ a   closed subset of $C[a,b]$?   So, what I've done so far. The sup metric is $d_{\infty}(f,g) = \sup \left\{|f(x) - g(x)| : a \leq x \leq b \right\}$ for $f,g\in C[a,b]$  Clearly $C^1[a,b] \subset C[a,b]$  $C^1[a,b]$ is a closed subset of $C[a,b]$ if $C[a,b]\backslash C^1[a,b]$ is open in $C[a,b]$ - i.e.  $\forall h \in C[a,b]\backslash C^1[a,b]$, $\exists \epsilon > 0$ such that $\left\{ f \in C[a,b] : d_{\infty}(f,h) < \epsilon \right\} \subseteq C[a,b]\backslash C^1[a,b]$  Which seems to be saying that, essentially, for any non-differentiable continuous function $h$ we can find an $\epsilon > 0$ such that when the supremum of the distance between $h$ and all other continuous functions on $[a,b]$ is less than $\epsilon$, then they will also not be differentiable.   This is where I get stuck, not least because I'm not convinced whether that is true or not. Clearly, it's easily possible to create further non-differentiable functions by, for example, moving one point of $h$ less than $\epsilon$. My instinct is that you're not going to be able to turn a non-differentiable function into a differentiable one with an arbitrarily small $\epsilon$, so I think such an $\epsilon$ exists - but this obviously isn't formal (or even likely to be correct)  Thanks.


I know that a superposition is a state in which there are 50% and 50% (other % also) chances of two things to happen so why am I not in a superposition state? Example, I am at rest and i now choose to be in motion so there can be a 50-50% chance of myself that i will be walking or running, so I think I am in a superposition state so can't we say that everything in this universe is in a superposition state?

Many introductory quantum mechanics textbooks include simple exercises on computing the de Broglie wavelength of macroscopic objects, often contrasting the results with that of a proton, etc.  For instance, this example, taken from a textbook:     Calculate the de Broglie wavelength for      (a) a proton of kinetic energy 70 MeV      (b) a 100 g bullet moving at 900 m/s   The pedagogical motivation behind these questions is obvious: when the de Broglie wavelength is small compared to the size of an object, the wave behaviour of the object is undetectable.  But what is the validity of the actual approach of applying the formula naively? Of course, a 100g bullet is not a fundamental object of 100g but a lattice of some $10^{23}$ atoms bound by the electromagnetic force. But is the naive answer close to the actual one (i.e. within an order of magnitude or two)? How does one even calculate the de Broglie wavelength for a many body system accurately?


I use __FILE__ during logging and debug my program. And when I use it, I get full source file path. So, I wanna write my own macro similar the macro __FILE__.  I looked for a solution, but I found nothing about it.  So, does it exist a CMake way to implement user macro, that will be generate something data similar the __FILE__ macro?

I'm using GCC; __FILE__ returns the current source file's entire path and name: /path/to/file.cpp. Is there a way to get just the file's name file.cpp (without its path) at compile time? Is it possible to do this in a portable way? Can template meta programming be applied to strings?  I am using this in an error logging macro. I really do not want my source's full path making its way into the executable.


It is known that mean value inequality is very useful. It is:     For any $0 \le a_i (i=1,2,\dots,n)$,    $$ a_1 a_2\dots a_n\le (\frac{a_1+a_2+\dots + a_n}{n})^n \tag1 $$   My question is: how many ways by which the mean value inequality can be proved?  Thanks for your help.

The arithmetic - geometric mean inequality states that $$\frac{x_1+ \ldots + x_n}{n} \geq \sqrt[n]{x_1 \cdots x_n}$$ I'm looking for some original proofs of this inequality. I can find the usual proofs on the internet but I was wondering if someone knew a proof that is unexpected in some way. e.g. can you link the theorem to some famous theorem, can you find a non-trivial geometric proof (I can find some of those), proofs that use theory that doesn't link to this inequality at first sight (e.g. differential equations …)?  Induction, backward induction, use of Jensen inequality, swapping terms, use of Lagrange multiplier, proof using thermodynamics (yeah, I know, it's rather some physical argument that this theorem might be true, not really a proof), convexity, … are some of the proofs I know.


Grep with -r was not working for me.  I then made a test situation.  The directory /home/den/backup now contains a file with the word washer in it.  I also made a subdirectory within /home/den/backup.  In that directory a file contains the word washer.  The following should return two hits at  /home/den/backup/great.txt and /home/den/backup/aaa/info.txt  If I issue   grep -r "washer" /home/den/backup/*.*   the result is one hit.  If I issue  grep -r "washer" /home/den/backup/aaa/*.*   the result is one hit.  Shouldn't the first one have also found the second one, which is in one if its sub-directories?

Normally while searching using grep, the command I was using was this:  grep -nri "String"   whereas most of my colleagues do this:  grep -nri "String" *   What does the latter do (the * part)?


I use Ubuntu 15.04, I have a SSD drive also. Very recently onwards the ubuntu is taking long to shut down nearly 1:30 minutes.  I checked the shutdown log messages and I get the follow message.  A stop job is running for Session c2 of user ***** (25s/ 1min 30 s)   It count downs till 1:30 minutes and then shutdown the machine.  Why is it happening.

After upgrade to 15.04 my ubuntu loads really slowly, slower than Windows 8 on the same machine, which insults me.  I turned off splash screen, and when I boot the system I get this:  A start job is running for dev-hdb2.device   and It stays that way for 1:30 minute, with a time counter next to it set exactly to 1:30.   Also when I reboot I get this message:  A stop job is running for Session c2 of user MrMino   same here - it stays that way for 1:30  Output of dmesg:   Unfortunately bootchart isn't working for some reason not known to me now, so I can't post logs from it.  How to make this go away? I'm running ubuntu on Dell Inspiron 3537.


To define my own math operators, I usually use 's \DeclareMathOperator. However, with \DeclareMathOperator{\Res}{Res} does not give me the desired "limits" under the operator even in displayed math.  Searching this site, I found \operatorname* (and ) which implements the desired behavior.  \begin{equation}     \operatorname*{Res}_{x = y} \frac{1}{x - y}     = 1. \end{equation}   gives    However, I'm still unsure if this can or should somehow be combined with \DeclareMathOperator and generally when to choose \operatorname* over \DeclareMathOperator (besides this particular case).

I use at the picture above:  \DeclareMathOperator{\vo}{vol} And this is the complete line:    \[ \lim_{a}=\vo_{a} \]   I can make that the a will be below the vol? (like the lim).  Thank you!!


Sorry, this is all I remember. A story where the end was a hail of micrometeorites all falling to Earth at once which incinerated the atmosphere from the collective heat from their re-entry. I think it was caused by either the moon being blown up or by a comet being destroyed by missiles.  I also think that it was called a "Soft Rain", but searching for a soft rain just gets me a different story about an automated house.  Any help on finding this story would be very much appreciated, this is one that's been on my mind for ages.

I am looking for the title of a novel that I only caught part of on audio. It takes place within our current time frame and deals with the Moon getting struck and fragmented into (initially) 7 pieces by a high-speed asteroid that they called "The Agent".  Within a few weeks of this episode, scientists figure out the the Moon will continue to break down in a cascade reaction over the next couple of years until the planet gets bombarded by so much debris that it sterilizes Earth. The governments of the world frantically start to build a series of ships using swarming concepts to evacuate the planet as much as possible... and that's all I have heard so far.  Thanks for any info.


I want to study Einsteins General Theory of Relativity, but before i start reading about it can anyone of you recommend some good books about Curved Geometry? since i will need it to understand the first part.

What are some good books for learning general relativity?


User has requested to update timezones.  e.g - (GMT-08:00) Pacific Standard Time (America/Los_Angeles) for a user. I update TimesZoneIdKey of this user as - America/Los_Angeles.   Expected - (GMT-08:00) Pacific Standard Time (America/Los_Angeles Actual -    (GMT-08:00) Pacific Daylight Time (America/Los_Angeles  Facing same issue for each timezone. Even (GMT-08:00) Pacific Standard Time (America/Los_Angeles is not available in timezone picklist. Please suggest me where i am doing wrong.

I have changed my user Time Zone to "Pacific Daylight Time (America/Los_Angeles)". When i retrieve it through apex code(Timezone class) i'm getting result as       "Pacific Standard Time (America/Los_Angeles)". Does there any work around to fix this? And does it effect Timing differences?


How specifically did the word "pink" derive?

I do not know how else to put the question.  On my third attempt, what is the origin of the word "pink" in the English language?


I'm looking for this book I read 5 to 6 years ago about a military helicopter pilot who somehow gets the power to control portals and he travels through a portal to find out that they lead to an alien planet that the military is siphoning resources from.

I picked up a book a year ago and read the summary at the back(part of a series maybe?) at a airport bookshop but had to stop because of my flight was about to depart. I can't remember the author or the title but I liked the plot and premise. Basically, the summary at the back of the book describes a soldier or marine or was it a unit? that was transported to a different reality that has magic/fantasy element in it. I know it's kinda vague but I hope you can help me out. I just found the plot so cool so anything close will be good enough for me.


I am completely new with Wine. I haven't installed any games through Wine. What are the steps to install  on Ubuntu 12.04?

I am looking for a step by step instruction to guide me in the ways of installing, configuring and debugging many of the issues new users have when dealing with Wine in Ubuntu.  What is the recommended way of installing Wine, some of the key issues that it has and how to solve them?  If I have a specific problem with an App in Wine, how do I go about solving it? What are the recommended steps to ensure that I can fix a problem related to an app I wish to use?


I'm doing Code Academy's tutorials on Python, and I'm a bit confused about the definition of method and function. From the tutorial:     You already know about some of the built-in functions we've used on (or to create) strings, such as .upper(), .lower(), str(), and len().    Coming from C++, I would think .upper() and .lower() would be called methods and len() and str() functions. In the tutorial, the terms seem to be used interchangeably.  Does Python distinguish between methods and functions in the way C++ does?  Unlike , I'm asking about the particulars of Python. The terms 'method' and 'function' do not seem to always follow the definition given in the accepted answer of the linked question.

Can someone provide a simple explanation of methods vs. functions in OOP context?


I wanted to create new field in QGIS to store date and time from a datetime string field named dateposte. Here is the code I used to make it: import datetime   layers = QgsProject.instance().mapLayers() for layer_id, layer in layers.items():     #creating new field     layer.dataProvider().addAttributes( [ QgsField("date", QVariant.Date) ] )     layer.dataProvider().addAttributes( [ QgsField("time", QVariant.Time) ] )     layer.updateFields()     with edit(layer):         for feature in layer.getFeatures():             thedatetime = datetime.datetime.strptime(feature['dateposte'], '%Y-%m-%d %H:%M:%S')             feature.setAttribute(feature.fieldNameIndex('date'), thedatetime.date())             feature.setAttribute(feature.fieldNameIndex('time'), thedatetime.time())             layer.updateFeature(feature)  But I got error on this line: feature.setAttribute(feature.fieldNameIndex('time'), thedatetime.time())  and getting error message Erreur OGR lors la création du champ time : Can't create fields of type Time on shapefile layers.  How can I do this?

I have a shapefile with date in a string field. I create a new field with date type and use the calculator to make the conversion. But the result only provide the date part, the time part is removed. Even when the preview show the correct conversion.  Here you can see the original string field time and the result date time2. And the use of the conversion function to_datetime() and the preview result at the end    If you go to the layer properties you can change the edit mode to date/time. Then if go to the data and try to edit time2 you get the current date/time. So is possible save date and time in the same field. But the update tool still doesn't work as expected      As J.R said. Even when you can change QGIS edit to allow Date/Time the save to shapefile will discard the time.


Hi am a beginner to blender and I am stuck at a tutorial can someone please I have a lot of vertices and i need to decrease them the video I am watching is   and I am stuck at 8:33 cause the blender guru has fewer vertices then me

I am making a donut from a tutorial my the blender guru the ultimate beginner cause I have been using blender for only 2 weeks and i am making a coffee cup but I have too many vertices so I am stuck can anyone help me


I know how to use \LaTeX to get a fancy version of the word LaTex; I’ve seen a similar version of the spelling of BibTeX but \BibTeX doesn’t work. I’ve tried a few variants on capitalization and not hit on one that works.  The problem with searching about anything to do with BibTeX is there are so many articles on how to use it that this specific question does not show up in queries.  It  to do this:

I'm looking after a macro to write the (La)TeX logo (with parentheses), i.e. something similar to \TeX, \LaTeX, but where the output includes ()'s.


I am performing a PCA analysis in Matlab on a $110\times 7$ dataset using some custom code. I am checking my code against Matlab's princomp and my eigenvectors are the same except that the 3rd and the 7th column are of the opposite sign.   What does that mean? And why does this happen?  My code is:   mu = mean(data); data = bsxfun(@minus,data,mu); sigma = transpose(data) * data / size(data, 1); [eigenvectors, eigenvalues]=eig(sigma); eigenvalues=diag(eigenvalues) [ev index]=sort(eigenvalues,'descend'); eigenvectors=eigenvectors(:,index); pc = data*eigenvectors';

I performed principal component analysis (PCA) with R using two different functions (prcomp and princomp) and observed that the PCA scores differed in sign. How can it be?  Consider this:  set.seed(999) prcomp(data.frame(1:10,rnorm(10)))$x              PC1        PC2  [1,] -4.508620 -0.2567655  [2,] -3.373772 -1.1369417  [3,] -2.679669  1.0903445  [4,] -1.615837  0.7108631  [5,] -0.548879  0.3093389  [6,]  0.481756  0.1639112  [7,]  1.656178 -0.9952875  [8,]  2.560345 -0.2490548  [9,]  3.508442  0.1874520 [10,]  4.520055  0.1761397  set.seed(999) princomp(data.frame(1:10,rnorm(10)))$scores          Comp.1     Comp.2  [1,]  4.508620  0.2567655  [2,]  3.373772  1.1369417  [3,]  2.679669 -1.0903445  [4,]  1.615837 -0.7108631  [5,]  0.548879 -0.3093389  [6,] -0.481756 -0.1639112  [7,] -1.656178  0.9952875  [8,] -2.560345  0.2490548  [9,] -3.508442 -0.1874520 [10,] -4.520055 -0.1761397   Why do the signs (+/-) differ for the two analyses? If I was then using principal components PC1 and PC2 as predictors in a regression, i.e. lm(y ~ PC1 + PC2), this would completely change my understanding of the effect of the two variables on y depending on which method I used! How could I then say that PC1 has e.g. a positive effect on y and PC2 has e.g. a negative effect on y?    In addition: If the sign of PCA components is meaningless, is this true for factor analysis (FA) as well? Is it acceptable to flip (reverse) the sign of individual PCA/FA component scores (or of loadings, as a column of loading matrix)?


How could we decide over how much memory will be good enough for a sql server 2012 standard edition instance having only 1 DB of around 250GB and it's very busy database through out the day, having high number of INSERTs/UPDATEs/DELETEs compared to SELECTs. Also lots of work done in Temptables by almost more than 1000 stored procedures everyday.  Thanks!

I'm trying to come up with a sane way to understand if the max server memory (mb) setting is appropriate (either should be lower, or higher, or stay the way it is).  I am aware that max server memory (mb) should always be low enough to leave room for the operating system itself, etc.    The environment I'm looking at has several hundred servers; I need a reliable formula I can use to determine if the present size of the buffer pool is appropriate since RAM is costed per GB allocated to each server.  The entire environment is virtualized, and "physical" RAM allocated to a VM can easily be changed up or down.  I have a particular SQL Server Instance I'm looking at now with a PLE of 1,100,052 seconds, which equates to 12.7 days (the amount of time the server has been up).  The server has a max server memory setting of 2560MB (2.5GB), of which only 1380MB (1.3GB) is actually committed.    I've read several items including one by Jonathan Keheyias () and another by Paul Randal (), and several others.  Jonathan advocates monitoring for a PLE below 300 per 4GB of buffer pool as being too low.  For the SQL Server Instance above, 300 * (2.5 / 4) = 187 results in a really really low target PLE below 300.  This instance has 290GB of SQL Server data (not including log files), and is only used for integration testing.  Assuming the last 12 days is representative of typical usage for this server, I'd say the max server memory (mb) setting could be lowered.  At the other end of the scale, I have another integration-test server with a PLE of 294, that has a max server memory (mb) setting of only 1GB.  This server has only 224MB of SQL Server data not including logs, and is running some BizFlow databases.  This server might benefit from a higher max server memory (mb) setting.  I'm thinking a good starting place for targets that might be assigned too much memory could include looking at:  SELECT      RamMB = physical_memory_in_bytes / 1048576     , BufferPoolCommittedMB = bpool_committed * 8192E0 / 1048576     , BufferPoolCommitTargetMB = bpool_commit_target * 8192E0 / 1048576     , PercentOfDesiredSizeMB = CONVERT(INT,(CONVERT(DECIMAL(18,2),bpool_committed)                              / bpool_commit_target) * 100) FROM sys.dm_os_sys_info;   If BufferPoolCommitTargetMB / BufferPoolCommittedMB is greater than 1, the server is not using the entire buffer pool.  If the machine in question also has a PLE of greater than "x" then it might be a good candidate for a decrease in max server memory (mb).  Since the Buffer Manager:Lazy writes/sec performance counter tracks the number of times SQLOS has written pages out to disk between checkpoints due to memory pressure, this might be another good thing to look at.  DECLARE @WaitTime DATETIME; SET @WaitTime = '00:00:15'; DECLARE @NumSeconds INT; SET @NumSeconds = DATEDIFF(SECOND, 0, @WaitTime); DECLARE @LazyWrites1 BIGINT; DECLARE @LazyWrites2 BIGINT;  SELECT @LazyWrites1 = cntr_value  FROM sys.dm_os_performance_counters dopc WHERE (         dopc.counter_name LIKE 'Lazy writes/sec%' COLLATE SQL_Latin1_General_CP1_CI_AS     )     AND dopc.object_name = 'MSSQL$' + CONVERT(VARCHAR(255),                SERVERPROPERTY('InstanceName')) + ':Buffer Manager';  WAITFOR DELAY @WaitTime;  SELECT @LazyWrites2 = cntr_value  FROM sys.dm_os_performance_counters dopc WHERE (         dopc.counter_name LIKE 'Lazy writes/sec%' COLLATE SQL_Latin1_General_CP1_CI_AS     )     AND dopc.object_name = 'MSSQL$' + CONVERT(VARCHAR(255),                SERVERPROPERTY('InstanceName')) + ':Buffer Manager';  SELECT LazyWritesPerSecond = (@LazyWrites2 - @LazyWrites1) / @NumSeconds;   The above code assumes the server is under load during the 15 seconds it takes to run, otherwise it will report 0; which might be a misleading false-negative.  Should I also look at PAGELATCHIO_* wait stats or some other wait type as an indicator of memory pressure, or lack thereof?   My question is, how can I reliably determine a "good" target value for PLE and max server memory (mb)?


If I have an array and I delete certain elements, I end up with an array that has non-consecutive keys:    var arr = [15,16,20,21,-1]; delete arr[1]; delete arr[3]; console.log(arr); // [0: 15, 2: 20, 4: -1]     How can I "reset" the array's keys?  I should end up with an array like so:  [0: 15, 1: 20, 2: -1]

How do I remove empty elements from an array in JavaScript?   Is there a straightforward way, or do I need to loop through it and remove them manually?


Give $A \in M_n(\mathbb{C})$ such that $A^2=A$, Then Prove that $rank(A)=Tr(A)$  My try:  I took two cases:  Case $1.$ If $A$ is Invertible then we have the only idempotent matrix as $A=I$  $$Rank(I)=n=Tr(I)$$  Case $2.$ If $A$ is Non invertible Then  $Rank(A) \lt n$  But now how to prove it is Trace?

How could we prove that the "The trace of an idempotent matrix equals the rank of the matrix"?  This is another property that is used in my module without any proof, could anybody tell me how to prove this one?


Since some software is constantly changing the solutions for the questions are also changing quite quickly.   E.g. , with different versions of the software, the API to the third-party tool changes. It ends up with legacy answers ranking highest because of the highest votes.   Is there a way to re-rank the deprecated solutions to the bottom?

On Stack Overflow, there are many questions that relate to currently-developing technologies such as HTML5 and CSS3. The accepted answers to these questions may become outdated, and better answers may appear. However, because the answers are accepted, it is likely that they will continue to be upvoted by users reading the answers, and the OP will likely not notice that a better, more up-to-date answer may exist.  Should these outdated answers be voted down? If not, what should we do with them?


I recently picked up a Braum (Aldi) TV from the nature strip to play around with. The TV seems to work perfectly fine (Channels, DVD input, sound etc) except that there's no working backlight. I've proceeded to disassemble the TV, and found there is 9 lights x 3 strips = 27 backlights. Each strip seems to have an identifier "94V-0 E348124". The product number for the strip: K395A0835350309686-Rev1.1 I. Looking online it seems to match a Sceptre LED backstrip. I assume the 94V is referring to the forward voltage required to switch on the LEDS? I think the LEDs seem to be in series, so is the voltage roughly 10.5 V required per LED? (Or would it be 3.5V, assuming 3 strips?) If they are in series, if one fails they'll all fail right (hence 0% backlight)? I can see two pin contacts to test each LED which is nice. What equipment should I use to go about testing the strips? I don't believe I have any equipment that can supply 10.5V, and haven't really done anything like this before. From looking at other  forums it seems that a common TV backlit LED runs with >3V and about 150mA. Looking for an inexpensive option.

I have some "NDV rev1.1 4248 back lights" from a television.   There is a print that sais "94V" on the strip, and on the wire supplying the strips it said "96V".   Every strip has 9x buttons which have 3 LED's in them. So i devided 94 by 9 and figured that every button should have 10.4V roughly, which makes sense, because a white LED is normally 3.5 volts.  I have a 12v Lithium battery which measured 11.1V so i tested one of the LED's with it and it lasted less than one second.   Are the LED's are rated for 10.4V roughly and not more?


how can I pass a reference to a generic method?  I have the class below.  public static class DataTableUtil {     public static List<T> DataTableToList<T>(DataTable dt)     {         List<T> lstItems = new List<T>();         if (dt != null && dt.Rows.Count > 0)             foreach (DataRow row in dt.Rows)                 lstItems.Add(ConvertDataRowToGenericType<T>(row));         else             lstItems = null;         return lstItems;     }...   I'm consuming the class this way  var lista = DataTableUtil.DataTableToList<SasRating>(retorno).AsEnumerable();   The SasRating class is a POCO class. I would like to send this parameter dynamically through a factory pattern. It is possible ? How to do this ?  Here's an example of some (invalid) code that demonstrates what I'm looking for:  var genericObj = T;  if(T is SasRating) {      T = SasRating } else {      T = SasTest; }  var lista = DataTableUtil.DataTableToList<T>(retorno).AsEnumerable();

What's the best way to call a generic method when the type parameter isn't known at compile time, but instead is obtained dynamically at runtime?  Consider the following sample code - inside the Example() method, what's the most concise way to invoke GenericMethod<T>() using the Type stored in the myType variable?  public class Sample {     public void Example(string typeName)     {         Type myType = FindType(typeName);          // What goes here to call GenericMethod<T>()?         GenericMethod<myType>(); // This doesn't work          // What changes to call StaticMethod<T>()?         Sample.StaticMethod<myType>(); // This also doesn't work     }      public void GenericMethod<T>()     {         // ...     }      public static void StaticMethod<T>()     {         //...     } }


My processor is an AMD 32-bit, but supports up to 8GB of RAM.  I'm going to install ubuntu 13.10 alongside windows 7 with 6 gigs and I want to know if windows 32bit supports 6 gigs if ubuntu 13.10 32bit supports 6 gigs,  if not possible and need to install 64-bit to use more gigs, I can install the versions of windows and ubuntu 64 bit on my 32-bit processor?  please help.  thanks in advance

What is the difference between 32-bit and 64-bit Ubuntu? I've heard the 64-bit platform performs better and can detect more than 4GB of RAM. Also, while some apps haven't ported to 64-bit yet, ia32-libs lets a 64-bit machine run them.  If so, why not promote 64-bit over 32-bit?


I was thinking doing it by contradiction, but feel there are too many variables to take into account. Any help?

Let $f(x)$ be continuous on $[a,b]$ and suppose $\int_a^b f(x)g(x)dx = 0$ for every continuous function $g$ on $[a,b]$. Prove that $f(x)=0$ on $[a,b]$.   I understand that $f(x)$ must be zero otherwise the integral can't possibly be zero for all possible $g$. But, I am not sure how to approach this systematically. Any suggestions would be appreciated. Thanks!


If 2 waves have the same frequency and amplitude moving over each other but one of them is ahead of the second so that the phase difference is pi "half wave length" so a perfect and complete destructive interference occur,, in that case what happens to the energy? And where does it go?

In case of interference, we know, energy is neither destroyed, nor created; but only redistributed. But in the case of an extremely thin film, due to a reflection and hence a phase difference of $\pi$, the film always appears dark due to destructive interference. So, where does the energy go?


I have installed the YaCy P2P search engine following these instructions (adding the YaCy repo to my sources and installing from there):   That page includes instructions on starting/stopping the YaCy daemon:  sudo /etc/init.d/yacy stop sudo /etc/init.d/yacy start sudo /etc/init.d/yacy restart   I can stop YaCy right now, but it starts again the next time I boot up. How can I stop it doing that, and only start when I tell it to (with sudo /etc/init.d/yacy start)?  This Upstart technique to permanently disable a service (accepted answer at ) does not work (YaCy still starts next time I boot):  sudo sh -c "echo 'manual' > /etc/init/yacy.override" #doesn't work

I read about how to enable and disable services in Ubuntu and it seems that there are different possibilities to manage them.  The first method I found is update-rc.d to add new services to startup, which aims on the /etc/init.d folder and its contents.  The other one I found is to edit .conf files in the /etc/init folder.  What's the recommended way to enable / disable / add services and why?  Could you please give a short bulletproof step by step example on how to add a service in Ubuntu and enable and disable it?


I'm wondering if there is a function or method in JavaScript such as var_dump() in PHP that prints or returns detailed information about the content of a variable, i.e. value(s) and data type. Especially in case of more complex data types like arrays and objects such a function would be very helpful...

We need to see what methods/fields an object has in Javascript.


I have an app that I store sensitive user data which requires user to set a password to login the app and I use this password as key to encrypt the data.  Now, I want to add an option to login the app with PIN. My problem is if user adds a PIN obviously I can't use it to decrypt the data. The only solution comes to my mind is to encrypt the password with PIN and store it locally. So when user enters the PIN, I can decrypt the password by using PIN then decrypt the data with this password.   Is it secure? Is there another way to achieve this problem? Is it possible to encrypt the data such that I can decrypt it with password or PIN only?

is there some generally available algorithm which will encrypt a short string and generate two unique keys so that any of the two can be used to decrypt the message again? It doesn't has to be "super secure".


My phone (Nokia XL) did not come with Google Play application. How do i install it (i've already tried with some weird .apk files)? If my phone cant use Google Play can you at least tell me if there is some way i can download the apps on my computer and then send them to my phone through USB. Thanks

I have recently installed a custom ROM and cannot find the Play Store. It seems like all apps that belong to Google are missing.  How can I install the Google Apps Package (Play Store, ...) on my Android device?


I am trying to solve an exercise but I don't know how to do it at all :  Given $m,n \in \mathbb N$ with $m>n>0$ and $r = m \bmod n$ Find ($2^m-1) \bmod (2^n-1)$ (as a function of $r$)   I don't know at all where to start or what to do... How can the value of the remainder help me to find the required result ? Thank you.


Is there some way of initializing a Java HashMap like this?:  Map<String,String> test =      new HashMap<String, String>{"test":"test","test":"test"};   What would be the correct syntax? I have not found anything regarding this. Is this possible? I am looking for the shortest/fastest way to put some "final/static" values in a map that never change and are known in advance when creating the Map.

How would you initialise a static Map in Java?  Method one: static initialiser  Method two: instance initialiser (anonymous subclass) or some other method?  What are the pros and cons of each?  Here is an example illustrating the two methods:  import java.util.HashMap; import java.util.Map;  public class Test {     private static final Map<Integer, String> myMap = new HashMap<>();     static {         myMap.put(1, "one");         myMap.put(2, "two");     }      private static final Map<Integer, String> myMap2 = new HashMap<>(){         {             put(1, "one");             put(2, "two");         }     }; }


I have to prove that for $n = 1, 2...$ it holds: $2\sqrt{n+1} - 2 < 1 + \frac{1}{\sqrt2} + \frac{1}{\sqrt3} + ... + \frac{1}{\sqrt{n}}$  Base: For $n = 1$ holds, because $2\sqrt{2}-2 < 1$  Step: assume holds for $n_0$.  $2\sqrt{n+2} - 2 < 1 + \frac{1}{\sqrt2} + \frac{1}{\sqrt3} + ... + \frac{1}{\sqrt{n + 1}}$. But I do not know what to do next? How this can be proved?

Prove that for any positive integer $n$, $$2\sqrt{n + 1} − 2 \le 1 +\frac 1 {\sqrt 2}+\frac 1 {\sqrt 3}+ \dots +\frac 1 {\sqrt n} \le 2\sqrt n − 1$$ Progress I think Riemann sum should be used for the middle term. I got the limit as $n\to \infty$ of the function inside using Riemann sum but what I cannot get are the lower and upper bound.


When my view is on the positive view axis, it zooms in just fine.  But when I rotate to the other side, when I zoom in, it infinitely gets slower and slower until I can't zoom in anymore.  How do I make both zooms even?

I often find that I can zoom in to a point, but then cannot zoom any more, even when there is a lot of room to zoom to the meshes on the scene.   This is particularly annoying in the following scenario:  I often land up left clicking on the scene and the 3D cursor shifts there. I use Shift+C to shift the 3D cursor back to the origin. However, this also centers the view on the cursor and shifts the view to show all objects, and sometimes this zooms things way out – at this point, if I try to zoom in, I can zoom in to a point (using the pinch/zoom on trackpad), but then it stops zooming in.   How do I zoom in after that? Is there anything else I am doing wrong in this case?


In my work directory, I have a list of directories that looks like this: 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 0.11 0.12   and so on. I would like to only add the directory 0 to my next commit because all the others contain lots of files and so are heavy. The thing is, I would also like to add multiple other files to my commit, also located in the same work directory. For this reason, I would like to avoid having to git add my 0 directory and then everyone of these files. Instead, I am looking for a way to commit everything but the mentioned directories that I don't want.

How can I ignore directories or folders in Git using msysgit on Windows?


So I have a variable called "direction" which describes the direction my player is facing, duh. The problem is that I take in this variable when the player collides with something and if the player changes directions while inside an object weird things happen. For example, the player passes through a door (its a platformer) but if it switches directions the door gets flipped horizontally.  How do I fix this?

How can I easily detect when a variable changes value? I would like the execution of the program to break on the debugger whenever a specified variable changes value. Right now I'm using Eclipse's debugger.


Just i was thinking about the other ways of writing singleton class. So is this class considered as a singleton class?        public class MyClass{             static Myclass myclass;              static { myclass = new MyClass();}              private MyClass(){}              public static MyClass getInstance()             {                  return myclass;             }        }   as the static block run only once.

What is an efficient way to implement a singleton pattern in Java?


I am trying to prove that $\langle x-a, y-b, z-c\rangle$ is a maximal ideal in $K[x,y,z]$, where $K$ is a field.  My guess:  Define the homorphism from $K[x,y,z]\rightarrow K$ as $$f(x,y,z)\mapsto f(a,b,c)$$  This is a surjective homomorphism and the image is a  field. So if we can show that the kernel is the ideal $\langle x-a, y-b, z-c\rangle$, then we are done. It is clear that $$\langle x-a, y-b, z-c\rangle\subseteq\text{Kernel}$$  How to prove the other inclusion ?

Let $K$ be a field, and $a_1,\dots,a_n \in K$. Prove that the ideal $$(X_1-a_1,\dots,X_n-a_n)$$ is maximal in $K[X_1,\dots,X_n]$.   I tried proving that the only elements outside the ideal are the invertibles of $K$ (I should still prove that this implies maximality, but it shouldn't be too difficult).  Is there a better strategy, or another stategy?


When one loses weight, where does the lost poundage (I assume comprised mainly of fat) go?  Is it urinated out? Defecated out? If a combination of both, does the percentage of each differ depending on how much of what your are losing was pure fat?

So I know that it’s not from tears or sweat because they are composed of mainly water and sodium, it’s not from going poo or pee as poo and pee are made of the parts of food that supply your body with no nutrients and your body also doesn’t “burn body fat” because there is a theory that no matter is ever destroyed so it’s none of those but another thing is it’s not your hair, ear wax, finger nails or anything of that sort because people can lose over 17 pounds in 3 months but you can’t build up that amount of hair , ear wax or whatever else in three months so how does body fat leave your body


So I'd like to start a D&D 5E game with my friends via discord and Roll20.  The problem however is that altough I have watched a lot of D&D, I nor my players (except 1)  actually have ever played it. I've tried to do a lot of research, and am currently laying the land for a short one shot and/or small campaign. However I suspect that starting as a DM who hasn't even played the game before, I'm most likely going to screw this up, probably even killing the motivation for the players to come back.  I don't want this to happen. It took me a very long time to even realize my friends were interested, and it's not in my native tongue.  Honestly, I'm even scared to start.  Currently, I feel like I'm drowning in rules, and don't know how to make sure I'm prepared and my players are prepared.  That's why I decided to come here and ask people here if they know of tips and tricks, tutorials, important rules, essential material or anything that could help me make this as enjoyable as possible for my players. I'd really like this to be the start of something great, and not be the end of my interest in the game :/  So yeah, if someone can help me, I'd be eternally grateful.   Much luv, a New DM

Some friends and I want to start playing D&D (5e), but none of us, DM included (not me) have played before to any great extent. The DM and I have some cursory experience with 4e, but have never been able to play to any great extent. Is this advisable, or should we play with existing groups first? We live in a relatively remote area, making it hard to find experienced players.


I have to calculate the following limit: $$\lim_{x \to 0} \left[\frac{a_1^x+a_2^x+\cdots+a_n^x}{n}\right]^{\frac{1}{x}}$$ I said that as $x→0$ the $a_1^x+a_2^x+\cdots+a_n^x$ are approaching $n$ since we have $n$ terms, so we will get:  $$\lim_{x \to 0} \left[\frac{n}{n}\right]^{\frac{1}{x}}$$ $$\therefore \lim_{x \to 0} \left(1\right)^{\frac{1}{x}}$$ as $x→0$, $1/x→\infty$ $$\therefore \left(1\right)^{\infty}=1$$ But one friend said that it was a false way to calculate that limit, where is my error and what is it's solution?  (where $a_i$ are positive real numbers)

For $a,b,c>0$, Find $$ \lim_{n \to \infty}\left(\frac{a^{1/n}+b^{1/n}+c^{1/n}}{3}\right)^n$$  how can I find the limit of sequence above?  Provide me a hint or full solution. thanks ^^


I recently found out that crimson/corruption spreads. I have played in my world for a few weeks. How much has it spread since I started my world do you think? Is it something I should worry about? How fast does it spread? Can I stop the spread? If so at what point of the game should I stop the spread? I would appreciate it if you could answer my questions and I will most definitely upvote your answer if its good!

After the Wall of Flesh, the Hallow appears and Corruption/Crimson spreads even faster.   Corruption/Crimson spreads through everything   Except Hallow  Hallow spreads through everything   Except mud (jungle) Except synthetic blocks like gray-brick  The results of Hallow and Corruption meeting are unpredictable   How can I stop them both permanently and effectively from taking over the world, considering both the top layer and underground?  (Eg, simply placing gray brick on top of the surface won't stop the underground spread?)  And, is it worth the effort?


I would like to run Ubuntu headless , keyboard less, and mouse less.  I plan on logging in remotely to the box from a Mac. The primary reason for doing this is lack of space.  How can I install and setup this up without hassles?  Meaning, I don't want to have recompile my kernel or tweak driver settings.   Thanks

I have an Ubuntu 14.04 server that has no external monitor connected.  I use NoMachine to remote control the machine.  When I do so, the Unity/Gnome interface doesn't see any monitors connected, so I can only use 800x600 when connecting with NoMachine.  If I plug in a monitor, I can set the resolution to whatever size the NoMachine window is on the remote computer.  Is there a way to create a "fake" monitor device on Ubuntu so I can set a desktop resolution in Unity/Gnome?


Call me crazy, but I've got an itch I can't scratch. I read a lot in school and one of the books I remember from Junior High (early 2000's) was a book about some children that were being experimented on in a lab. I think I recall they had powers and the boy's eyes glowed blue as he was able to read minds/move objects with his mind etc. I'm pretty sure he was trying to escape the lab and the doctors.

I have been trying to find a book I read quite a few years ago. Well, there are 2, one being the sequel.  Now I'm sure my memory has been kind enough to mix parts of the 2 books, but I will do my best with the description.  The cover of the book had a hand print. As far as the story, a boy finds out he has some powers from some guy. I think he had a ring that allowed him to use his power. Later when training the boy, he has him learn to control his power by deflecting rocks or meteors or some rocky item. The boy ends up using too much force and shatters them, but eventually gets the hang of it. Another part close to the end, the boy has a vision, I think, of some other kid getting struck by lightning, so he figures out a way to save the kid, but gets struck by the lightning himself.  In the second book, I remember a part early on where a sign falls from a building toward some child, but the boy uses his power to save the kid; afterwards, no trace of the boy is found. A lady who witnessed it said something like it was her dead son (I'm guessing his mom from the previous book).   I'm having trouble remembering anything but that. I read them in '97 or '98, I believe. As far as the publication dates, I never checked.


I have a Siteground cloud server, and I know nothing about servers. It hosts 8 websites, although 3 of them have their own dedicated IP addresses and cPanels.  It's on a Linux server, but there's something w/ NGinx mixed in there.  For instance, sometimes they have to restart NGinx for me ... some type of combo or something.  The basic details on the server are:   2 CPU cores 3 GB RAM 40 GB SSD storage space I'm paying about $90/month for this   If I go into my WHM, Service Status, it says this:   Server Load: 0.69 (2 CPUs) 31.4% (987,744 of 3,145,728) Swap Used: 0.01% (268 of 2,097,152) Disk Information: 74% usage   They're all WordPress installations, and recently -- despite no major changes -- my administrative areas in all Siteground websites began lagging extremely slowly and eventually timing out.  The techs are usually good, but this guy just told me to purchase 2 additional cores; he said I didn't need to purchase additional storage space or an extra GB RAM.  The Sites:  They're basically low maintenance sites and not too heavy w/ traffic.  ,  (SSLd), and then my nonprofit organization,  (SSLd, and is the largest and most visited of any of the 8 websites.  As server experts, is it possible for anybody here to tell if this tech is correct?  Will adding 2 CPUs help, so I don't get locked out of my FTP, cPanel, and back-end of my websites? Is it possible to tell with the little amount of information I'm knowledgeable enough to provide?  Or am I way off here and should I be doing something else, leery of the tech's advice?  Thank you for any guidance anybody can offer!

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


Does anyone know how to code up long-polling AJAX requests (for server PUSH notifications) in ASP.NET MVC?  Whenever I do it, it seems that only the last browser to open up a window gets the notifications.  As if IIS/ASP.NET were canceling the last request because it was hung or something.

I've been looking at ways to implement gmail-like messaging inside a browser, and arrived at the  concept. However, I haven't been able to find a good .NET implementation that allows me to do this within IIS (our application is written in ASP.NET 2.0).   The solutions I found (or could think of, for that matter) require leaving a running thread per user - so that it could return a response to him once he gets a message. This doesn't scale at all, of course.  So my question is - do you know of an ASP.NET implementation for Comet that works in a different way? Is that even possible with IIS?


Fisher's principle states that there should be a 1:1 ratio between males and females born on average for a population.  However, if you look at birth statistics your find that boys are slightly more likely to be born then girls.     If it was truly advantageous for an even sex ratio to exist at birth I imagine we would have evolved to make that happen, by slightly favoring more female sperm or by having the processes that decides which embryos to spontaneously abort be stricter for males embryos then females.  For that matter since it's more important for males to be exceptionally healthy then it is for females, since males have to compete for a mate while females don't, you would think more strict filtering for 'bad' embryos in the case of males then females would make sense anyways.  Thus I'm inclined to think that the increased number of males to females is not random evolutionary fluke, but adaptive.  I'm wondering what would cause there to be a benefit for males to be slightly more common then females.  I know males are more likely to die in childhood, due to risk taking activities to impress the females, so could it be that the increase in males is due to the expectation that more males will die before reaching sexual maturity?  I'm not certain I buy this logic, it doesn't seem you should favor a sex any more because it's likely to take higher risks.  I know that strong/healthy mates would prefer males and weak ones prefer females, since strong males would out compete weak males for mates it's good to have strong males that can achieve multiple mates and weak females since their guaranteed to have at least one mate.  Is it possible that our increased nutrition and health of recent generations simply results in more males because our bodies judge each of us as 'healthy' compared to the standard that existed for 99% of our evolution, ie, evolution hasn't caught up with technology when judging health to decide which sex to favor?  Is there some more obvious explanation for why favoring males slightly would be adaptive in humans?  Edit: I want to stress again, I'm not asking how the bias happens.  The article I linked clearly explains what causes males to occur more in terms of pregnancy.  I'm asking why the bias happens.  This could be evolved away in the past if it was disadvantageous,  Whatever mechanisms cause there to be a bias this bias is presumably adaptive for it not to be evolved away.  Both the possible duplicate and the current answer only address what causes the bias to happen today, not why it would be evolutionarily adaptive to have.

For every 104 male babies, we have 100 female babies and there are statistics which are more reliable. (Those tell us that we have 997 female infants born per 1000 male infants born.) What is the reason for that? Why do we have more male babies than female babies?


I'm doing an essay for school and Ineed the quote and page number for where it's located

In a similar vein to , is the statement that Grendel can't be harmed by weapons a claim about some supernatural protection he's had, or a prediction about how he's going to be defeated?  Update: I mean in the ancient epic poem, not the recent film.


Under "SITE SETTINGS > MY LOGINS" one may remove all related email addresses and add other emails.  Now I wonder, if someone hacks my SO account, removes my logins and creates a new login with a new mail - is there any chance that I get back my old account or is it simply lost?

When you're logged in to a Stack Exchange account, it's possible to add and remove logins (associated OpenID/OAuth accounts) without performing any form of reauthentication.  This is not a full vulnerability in itself, but it provides an extremely easy way for an attacker who's found a temporary XSS vulnerability to turn that into a permanent account hijack. An XSS exploit on its own may only provide a minute of indirect access to a user's account. But with this login configuration, the attacker could use that minute to automatically:   Add a new attacker-controlled login to the account. For example:   The XSS JavaScript would generate a random identifier, and use that to construct a login URL of the form http://hacker.example/openid/1234567. The hacker.example server would automatically authenticate the first OpenID login request made with a given identifier, allowing it to be added to the account without user interaction. All subsequent login attempts would be automatically rejected for the user. The hacker.example server would notify the operator with the account name and the generated identifier, and would allow them to login to it.  Remove all existing logins from the account. Log the user out of their account, with no way to get back in.   If this exploit were used to hijack moderator and staff accounts it could makes it more difficult to quickly respond to an attack, creating a greater opportunity for extended abuse.  This is a broader instance of the same fundamental vulnerability which was previously-reported as . That instance is a little more straightforward to fix: just ask for the password again when changing it. However, safe reauthentication with OpenID/OAuth logins is more complicated. Most users' OpenID providers will be configured to automatically re-authenticate upon request, so there would be minimal security gain from requesting that.  Instead or as well, my suggestion is that for users that have a verified email address, require an emailed confirmation link to be clicked before committing any login changes.    I'm not a real security expert, but I've just found that fellow Stack Overflow user , who is, previously described this vulnerability in his 2012 blog post :     If an attacker can add additional login accounts then they can create a persistent mechanism to get back into that Stack Overflow account at any time without needing to hijack the session. Now of course the victim can always go into their account settings and identify the presence of the new login, but it’s a question of how much damage is done before then.      How would an attacker mitigate the risk of having their newly added account removed? Just remove the victim’s original account(s) instead.      [...]      Finally, this is also a lesson for those considering using third party authentication providers. Yes, it’s great that you can farm off this work to someone who has a solid implementation, but you still have responsibility for securing the authenticated session on your site. If you choose not to, be aware of the risks because certainly we’ve seen them exploited before.


I was trying to install Ubuntu as a dual boot option from my usb disk but every-time i tried i failed. I went to UEFI mode of windows. Then I disabled the Widnows secure boot option and selected the primary boot as USB. However it starts the windows again rather booting from USB. I tried multiple times but run out of luck. Any suggestion? I really appreciate your help .. Thanks

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


The sequence of numbers $F_n$ for $n \in N$ defined below are called the Fibonnaci numbers.  $F_1 = F_2 = 1$, and for $n \geq 2$, $F_{n+1} = F_n + F_{n-1}$.  Prove the following facts about the Fibonnaci numbers  For each of the following, $n \in N$  a) $\displaystyle \sum_{i=1}^nF_i = F_{n+2} - 1$  I started this proof by using strong induction  To prove something by strong induction, you have to prove that if all natural numbers strictly less than $N$ have the property, then $N$ has the property.  $n \geq 2$, $F_{n+1} = F_n + F_{n-1}$  Check basis step $n=2$:   $F_1 + F_2 = 1 + 1 = 2 = 3-1 = F_4 - 1$, therefore TRUE  I'm unsure how to go any further, when it comes to strong induction I'm lost on how to set up my IH, and proceed for the rest of the steps

For the Fibonacci sequence $F_1=F_2=1$, $F_{n+2}=F_n+F_{n+1}$,  prove that $$\sum_{i=1}^n  F_i= F_{n+2} - 1$$ for $n\ge 1$.   I don't quite know how to approach this problem.   Can someone help and explain please?


While running apt-get i get the following error :-  W: GPG error: https://dl.bintray.com  Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 99E82A75642AC823 W: Failed to fetch http://ppa.launchpad.net/picaso/octave/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found  W: Failed to fetch http://ppa.launchpad.net/picaso/octave/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found  W: Failed to fetch http://ppa.launchpad.net/samrog131/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found  W: Failed to fetch http://ppa.launchpad.net/samrog131/ppa/ubuntu/dists/trusty/main/binary-i386/Packages  404  Not Found  E: Some index files failed to download. They have been ignored, or old ones used instead.   I have tried a number of solutions each of which failed. I can't install any software using sudo apt-get update in their script now :( I have already tried system updates, trying to contact the keyserver (which always returns a timeout)

PPA seems to be constantly offline. Whenever I use sudo apt-get update, this error is shown:  W: Failed to fetch http://ppa.launchpad.net/ 404  Not Found   How do I fix these errors?


I don't believe "notified" is accurate, as it implies the notification has been already made and received.    I'm looking for a word that labels a recipient that specifically is waiting for a notification.  The word "recipient" is technically viable, but then one asks "what are you receiving?  A gift?  A punishment?  An inheritance?".    Does a word exist that encapsulates being a recipient of,  specifically, notifications?

In general usage (and hopefully correct usage) a "notifier" is someone who notifies.  What is the word for the person who is notified?  For example: "Instruct each [X] to respond to the notification within 3 days."


today I was surfing the site while I caught upto a tab.     But the questions there are already answered.     What do actually mean by Unanswered Question?

Why does the "Unanswered Questions" tab show questions that have answers?


Basically, I am making a weapon for Skyrim, I already finished the mesh itself and used the cycles render materials and surface nodes as the texture. Now, I have run into a wall, I can't seem to find a way to export the existing texture . Is there a way to do this or is this an exercise in futility?

I created a interior scene and  i don't know how to bake a texture using cycles bake.


user decided to reboot his pc during copy from usb stick and it corrupted his precious data. I'm trying to diagnose what's wrong but unfortunately i hit a wall and can't understand the issue with the stick.  I can see this disk in Disk Utility, but seems like all it has is unallocated space.  sudo fsck /dev/sdc fsck from util-linux 2.27.1 e2fsck 1.42.13 (17-May-2015) fsck.ext2: Attempt to read block from filesystem resulted in short read while trying to open /dev/sdc Could this be a zero-length partition?  fdisk -l /dev/sdc fdisk: cannot open /dev/sdc: Input/output error   Any help would be greatly appreciated.    dmesg /syslog:  [ 6073.351716] sd 6:0:0:0: [sdc] tag#0 Sense Key : Not Ready [current] [ 6073.351719] sd 6:0:0:0: [sdc] tag#0 Add. Sense: Medium not present [ 6073.351722] sd 6:0:0:0: [sdc] tag#0 CDB: Read(10) 28 00 00 76 c6 80 00 00 08 00 [ 6073.351724] blk_update_request: I/O error, dev sdc, sector 7784064 [ 6073.351726] Buffer I/O error on dev sdc, logical block 973008, async page read   He tried to copy around 500mb of work files from that stick, it froze and he rebooted "Just in case". As far I know that was the only copy of those files. Is there any way to try to restore data?     It's getting weirder and weirder. I gave up with restoring data and tried to wipe this stick with shred or dd. Outputs:  shred: /dev/sdd: error writing at offset 19218807296: Input/output error shred: /dev/sdd: error writing at offset 19218807808: Input/output error  dd: error writing '/dev/sdc': Input/output error 1+0 records in 0+0 records out 0 bytes copied, 0,00123257 s, 0,0 kB/s   Tried to format on Win workstation, cant even plug it in or access through cli, got over hundred "Wrong folder name errors" in a few seconds.

I've run across (personally or by proxy) a bunch of storage media that exhibited physical problems during their life. Hard disks, solid state drives and other flash storage media all fail after some time. The situation is worse with USB flash drives and flash cards because of the large amount of suppliers with inferior flash cell and flash controller quality.  How can I reliably detect if a storage drive suffers from physical damage?  Note that this question isn't about file system integrity (which can be checked with ).


I have purchased 15 iPhones in Chennai and I want to bring them to Delhi. Will I have to pay duty for that in Chennai? I have the receipt proving I bought them in Chennai.

I am planning to travel to India (COK airport, Kerala) from United States. I want to take my laptop as well as my tablet (iPad). Am I allowed to take both in my backpack with my documents related my work. I think I am allowed to take only one computer as per the rule. Will the customs consider my iPad as a computer?  What all I can take?   One of my friends took 2 laptops (1 work and 1 personal) and had trouble at the airport.  Also I am planning to take some wristwatches (7 of them, each avg price is 45 $). I read in a website that I can take stuff up to max 35000 INR. Is that true? In that case, how will I manage my stuff?


I am new in using ubuntu so I hope to show me the steps specifically shujaa-addin@Shujaa:~$ lsusb Bus 002 Device 022: ID 0bda:f179 Realtek Semiconductor Corp.  Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 008 Device 004: ID 093a:2510 Pixart Imaging, Inc. Optical Mouse Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 006 Device 010: ID 413c:2003 Dell Computer Corp. Keyboard Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

19 DEC 2019 - I really, really wanted to use the Cinnamon desktop to set up a new system my 83-year-old Dad could navigate. I struggled to get any USB WiFi device working with Debian using Cinnamon, gave up and installed Ubuntu, but still struggled (I think) because I had immediately changed to the Cinnamon desktop before attempting to get the WiFi device set up.  It just kept prompting for the password, no matter what fixes I tried. Not sure if Cinnamon was the problem, or if I just hadn't found the right solution online.


I have never posted on StackExchange before but enjoy reading the threads and have helped me start my own little hobby. A friend of mine works at a night club and is being told they need a vector logo for tshirts. I said no problem send me logo. I opened in Illustrator and see these random little lines everywhere. Before I go and create the art again for him in illustrator I wanted to see if anyone knew what this was or how this was caused? I asked him how he created the logo and said in photoshop but it is used on video boards. So I assume it is created in a different program all together and then he put it in photoshop and saved to send to the tshirt company.   Anyways long story short, do I need to recreate this art for him or is there a way to clean up these random lines quickly?   UPDATE: I started seperating the logo to patchs and notice these lines on just the curves. See second screenshot. I think I can just use the paths and create the logo again?  Thanks- Thomas

After creating a path with rounded corners in Illustrator, I added a dashed stroke and aligned it inside the path (but the problem is the same when aligning outside). Strangely I ended up with a lot of strange 'glitches' (?) along the path:    When aligned centered, the stroke looks neat and sharp:    I've tried changing stroke properties but nothing really helps. Has anyone ever experienced similar behaviour? How can I get those sharp strokes back?  To create this symmetrical shape I first created the left half, copied it, reflected the copy and united the both parts with Pathfinder.  Here's the actual document in case someone is interested:


When I run the latest version of sp_blitz I get the following: Warning: Null value is eliminated by an aggregate or other SET operation.     Msg 1934, Level 16, State 1, Procedure sp_Blitz, Line 3467      INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.   It seems no one else is having this problem except me. What have I done wrong?

I installed this third party thingy, sp_Blitz.  sqlcmd -S localhost -U sa -i ./sp_Blitz.sql   But when I run   1> EXEC sp_blitz; 2> go   I get,  Warning: Null value is eliminated by an aggregate or other SET operation Msg 1934, Level 16, State 1, Server x230, Procedure sp_blitz, Line 4338      INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.     Attempts at the server  When I try to configure QUOTED_IDENTIFIER I get,  1> sp_configure 'QUOTED_IDENTIFIER'; 2> GO Msg 15123, Level 16, State 1, Server x230, Procedure sp_configure, Line 62 The configuration option 'QUOTED_IDENTIFIER' does not exist, or it may be an advanced option.   That's having previously run sp_configure 'show advanced options', 1; RECONFIGURE;  Attempts at the client  sqlcmd.exe  Ok.. So      -I Sets the SET QUOTED_IDENTIFIER connection option to ON. By default, it is set to OFF. For more information, see SET QUOTED_IDENTIFIER (Transact-SQL).   However, running with -I will show SESSIONPROPERTY('QUOTED_IDENTIFIER') as 1 but it doesn't seem to work either  sqlcmd -S localhost -U Sa -I Password:  1> EXEC sp_blitz; 2> GO Warning: Null value is eliminated by an aggregate or other SET operation. Msg 1934, Level 16, State 1, Server x230, Procedure sp_blitz, Line 4338 INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify that SET options are correct for use with indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or XML data type methods and/or spatial index operations.   mssql-cli  This starts up with SESSIONPROPERTY('QUOTED_IDENTIFIER') set to 1 by default, but it generates the same error as above.


After passing through all the steps mentioned .  I see nothing but a black screen, even after I wait for more than 15 minutes, nothing shows up. Help plz.

I am trying to boot Ubuntu on my computer.  When I boot Ubuntu, it boots to a black screen.  How can I fix this? Table of Contents:


In the standard styles, bibtex automatically lowercases the titles of bibliography entries:  \documentclass{article} \begin{document} \nocite{inproceedings-minimal} \bibliographystyle{plain} \bibliography{xampl} \end{document}     When using biblatex, however, this somewhat dubious behaviour is not retained:  \documentclass{article} \usepackage{biblatex} \bibliography{xampl} \begin{document} \nocite{inproceedings-minimal} \printbibliography \end{document}     (I'm still using biblatex v1.7, which probably makes a difference, but I can't see anything in the latest release that indicates this has changed.)  Is there any way to have biblatex behave like the standard bibtex styles?  While I understand the philosophy of preserving the case of the entry (just do it right the first time!), in my case I've been building a bibliography for some ten years now and just this once would like to indeed lowercase my entries. I'm normalising my bibliography by hand as we speak, but it's probably a good idea to archive this here in case other people have the same issue.

My understanding is that bibtex lets the citation style handle capitalization of titles, which is what I would expect from an automated citation tool. Do biblatex and Biber also do this? The document I am working on with these tools seems to be preserving the capitalization in the bib database, which is NOT what I want, and I haven't found any clear references that explain what the expected behavior is.


i have previously install and uninstall ubuntu in my computer now i want install but I didn't get to know which partitions to install on it  Please help me

I'm absolutely new to Linux. I would like to know how to install Ubuntu alongside the pre-installed Windows 8+ OS.  Should I do it with Wubi, or through the Live USB/DVD?  What steps do I need to take to correctly install Ubuntu?


I want to remove those element from list which has repetition more than one it's like set but order should not be change   [4,6,2,6,1,2] should become [4,6,2,1]   I'am looking for any inbuilt method or list comprehension

Is there a built-in that removes duplicates from list in Python, whilst preserving order? I know that I can use a set to remove duplicates, but that destroys the original order. I also know that I can roll my own like this:  def uniq(input):   output = []   for x in input:     if x not in output:       output.append(x)   return output   (Thanks to  for that .)  But I'd like to avail myself of a built-in or a more Pythonic idiom if possible.  Related question:


When I place an object bigger than the background, I want it to cut off by itself just like Photoshop. But in Illustrator it doesn't do that. I tried clipping mask but it doesn't do anything.

Is it possible to hide the objects that are outside of the artboard?  As you can see in the picture below, the polygons are shown outside of the artboard.  I want to hide everything that is outside of the artboard.


I am making a news website. I want the administrator to have the default drupal 7 theme Seven. But I want to give the editor a custom theme that is more usable and streamlined for the task they do.   I have seen this module called  As far as I read it gives a lot of functions. For me as now only thing I want is when the user of the role editor login, they should be served with different admin theme. Thats all. Is there any hooks or something? Are there any examples or recommendations for achieving this?

Is there a way to use different administration themes according to the roles assigned to users? I have two roles (admin, editor), and I want that, when creating content, users with the admin role use the garland theme, while users with the editor role use another theme.


I was looking for a community to ask a question for a website recommendation but can't find one. What is the best or closest community for these questions?

Is there any Stack Exchange site where I can ask others to recommend me good web sites for solving specific problems?  For example I would like to know if there is any URL shortening website that can allow me to define the url.  For example instead of http://bit.ly/1gX2dD0 I would like it to be http://bit.ly/superflow - if "superflow" is not available then I will invent another word.  I can imagine that such services are paid but I don't need the link to last more than one day, and maybe there is such a website.


I installed ubuntu tweaks but this seems not to have a possibility to switch off the drum sound. What else can I try?

I would have expected System ▸ Administration ▸ Login Screen ▸ Play login sound to control this, but unchecking it does not prevent the drum beat sound from playing.


so toray my computer was slowing down, so I checked the task manager to see what was going on. and svchost.exe was using about 1GB of ram. anyone have an idea to stop this?  os: Win 7 (non-genuine since I have used the same HDD in many PC's)

I installed Windows 7 fresh and installed SP1. Now, when I try to check manually for Windows Updates it just hangs on the Checking for updates screen.    I tried running the tools in , but this did not fix the issue either:  No matter what I do it just hangs on the "Checking for updates..." screen and goes no further.


I want to do coupon collector's for a dice roll, or the expected number of rolls to get all 6 numbers from definition of expected value as opposed to using linearity of expectation.   $\tau = min\{ t \vert X_t = i, \forall k \neq i,\ \exists j<t:  X_j = k ,\ \forall l< t, \ X_l \neq i \}$.   $\mathbb{E}[\tau] = \sum_{j = 1}^{\infty} j\mathbb{P}(\tau = j)$ is the definition.   I try to compute $\mathbb{P}(\tau = j)$, and for j rolls, you must have 5 numbers in the first $j-1$ rolls, and a 6th number in the $j$th spot, and the 6th number can't be in any of the first $j-1$ spots. So   $\mathbb{P}(\tau = j) = 6[\frac{1}{6^6}5! \binom{j-1}{5} (\frac{5}{6})^{j-6}$].   $\frac{1}{6^6}$ is for six numbers being in those spots (say, 1-5 being in the first j-1 spots, 6 being in the last), $5!$ is the ways of arranging the 5 numbers, $\binom{j-1}{5}$ is to choose the ways of putting $1,2,3,4,5$ in $j-1$ spots, and $(\frac{5}{6})^{j-6}$ is so the $j-1$ spots which you didn't place 1 to 5, don't contain a 6. then multiply by 6 since 1 through 5 can also be at the jth position.   This doesn't work out to be the right sum. Where is this wrong?

I'm trying to solve the well known Coupon Collector's Problem by explicitly finding the probability distribution (so far all the methods I read involve using some sort of trick). However, I'm not having much luck getting anywhere as combinatorics is not something I'm particularly good at.   The Coupon Collector's Problem is stated as:  There are $m$ different kinds of coupons to be collected from boxes. Assuming each type of coupon is equally likely to be found per box, what's the expected amount of boxes one has to buy to collect all types of coupons?  What I'm attempting:  Let $N$ be the random variable associated with the number of boxes one has to buy to find all coupons. Then $P(N=n)=\frac{|A_n|}{|\Omega _n|}$, where $A_n$ is the set of all outcomes such that all types of coupons are observed in $n$ buys, and $\Omega _n$ is the set of all the possible outcomes in $n$ buys. I think $|\Omega _n| = m^n$, but I'm not even sure about that anymore, as all my attempts so far led to garbage probabilities that either diverged or didn't sum up to 1.


Using article for document class the code is as following, but when I compile pdflatex, bibtex and again pdflatex twice the bibliography doesn't appear in the pdf file. I created a bib database called bibliography.  \maketitle  \begin{abstract} A \end{abstract}  \section{Introduction}  \paragraph{Outline} A  \section{Previous work}\label{previous work}   \section{Results}\label{results}   \section{Conclusions}\label{conclusions}   \bibliographystyle{alpha}  \bibliography{bibliography}   What should I check to find out what goes wrong?

Is there any way to have BibTeX or biblatex insert a bibliography without having citations in the body of the document itself? Maybe a way to hide the in-text citations, so that BibTeX still sees them and includes them in the bibliography, but does not print them in the body?


As a non- native speaker of English, I often find myself struggling with the usage of the suffix -al in adjectives. For instance, what's the difference between the words "historic" and "historical", "metaphoric" and "metaphorical", etc? Are there any rules as far as this suffix is concerned?

I just came across a course name: Geometric and Theoretical Optics. The mismatched endings bug me. Why do we have both -ical and -ic endings?   Is there any difference in meaning between, say, theoretic and theoretical? I know that acoustic and acoustical mean slightly different things, but is this difference inherent in the words, or is it just usage — we happen to use the former for sound, and the latter for ceilings?


I've come up with this little routine for doing encryption using the SHA-2 (in this case SHA-256) hash function. As such it is a block cipher with a 256 bit (32 byte) block size and an arbitrary key length. It's easy to see that you could replace the hash function and get an entirely new type of algorithm.  I want to know if there are any problems, especially flaws, in this construction, and whether algorithms of this type have been studied.  Initialization with key:  $$ S_0 = H(k) $$  Encryption for plaintext blocks $P_1, \dots P_n$:  $$ S_i = H(S_{i-1})$$   $$ C_i = P_i \oplus S_i $$  Decryption for ciphertext blocks $C_1 \dots C_n$:  $$ S_i = H(S_{i-1})$$   $$ P_i = C_i \oplus S_i $$  Here is some sample C source code using SSL:  #include <openssl/sha.h>  struct sha_crypt_state {     unsigned char digest[SHA256_DIGEST_LENGTH]; };  void sha_crypt_set_key( sha_crypt_state *state, unsigned char *key, int key_length ) {     SHA256( key, key_length, state->digest ); }  void sha_crypt( sha_crypt_state *state, unsigned char *block ) {     sha_crypt_state temp;     SHA256( state->digest, sizeof(state->digest), temp.digest );     memcpy( state->digest, temp.digest, sizeof(temp.digest) );      for ( int i = 0; i < sizeof(state->digest); ++i ) {         block[i] ^= state->digest[i];     } }  void sha_crypt_test() {     const char *key = "secret";      // prepare a test block     char block[SHA256_DIGEST_LENGTH];     memset( block, 0, sizeof(block) );     strcpy( block, "Hello, testing encryption!" );      // test encrypt     sha_crypt_state state;     set_key( &state, (unsigned char *)key, strlen(key) );     sha_crypt( &state, (unsigned char *)block );      // test decrypt     set_key( &state, (unsigned char *)key, strlen(key) );     sha_crypt( &state, (unsigned char *)block ); }

A few years ago I devised a symmetric-key system that worked like so:  H()   = some hashing function h     = the number of bits in the result of H() key   = bits to be used as a key ^     = the XOR operation +     = concatenation len() = the length function (in bits)  max = ceiling(len(cipertext) / h) pad = pad_0 + ... + pad_max pad_0 = H(key) ^ H(plaintext) pad_n = H(pad_(n-1)) cipherpart_n = plaintext_n ^ pad_n ciphertext = H(plaintext) + cipherpart_0  + ... cipherpart_max   Basically, it builds up a "pad" based on the hash of the message and hash of the key and XORs the message against it.  I am not actually an expert, so I was wondering why an approach like this isn't very common.


Im using Regex to match string ignoring case in Unity.  My code:  ... string _word = "Esto Es Una Cadena Con Texto" string final = "esto es una cadena con texto"  if(Regex.IsMatch(final, Regex.Escape(_word), RegexOptions.IgnoreCase)){ // } ...   According this:  string _word = "Estó Es Uná Cadená Cón Textó" string final = "esto es una cadena con texto"   Is there a code to match previous string ignoring case and accent?

I'm trying to convert some strings that are in French Canadian and basically, I'd like to be able to take out the French accent marks in the letters while keeping the letter. (E.g. convert é to e, so crème brûlée would become creme brulee)  What is the best method for achieving this?


Which of the above is correct?  I am in a dilemma which one is correct. I have an inkling that has is right.

I'm writing an college-entrance essay and for me it's imperative that I understand and implement the correct one of these two expressions:     "Much of it is" or "Much of it are"   If you need context:     I'm having trouble with my writing. The reason I'm having trouble is that much of it is about....   Should there be an "is" or an "are"?


I have read some books about information theory but I don't have any ideas how can they find the definition of entropy? We have  $$H(X)=-\sum_{x\in X}p(x)\, \text{log}\, p (x)$$ X is a discrete random variable.

I have bumped many times into entropy, but it has never been clear for me why we use this formula:  If $X$ is random variable then its entropy is:  $$H(X) = -\displaystyle\sum_{x} p(x)\log p(x).$$  Why are we using this formula? Where did this formula come from? I'm looking for the intuition. Is it because this function just happens to have some good analytical and practical properties? Is it just because it works? Where did Shannon get this from? Did he sit under a tree and entropy fell to his head like the apple did for Newton? How do you interpret this quantity in the real physical world?


im using the closed nvidia driver: i think my xorg.config is missing:  ls in the directory /etc/X11 shows:  app-defaults             rgb.txt             Xreset      Xsession.d cursors                  xinit               Xreset.d    Xsession.options default-display-manager  xkb                 Xresources  xsm fonts                    xorg.conf.failsafe  Xsession    Xwrapper.config   is this normal? i would like to edit the file with this:   "Option "Coolbits" "12""  Thanks

As Ubuntu 10.10 seems to neither detect my graphics card (Intel 82852/855GM) automatically nor use the corresponding Intel driver even after manually installing it, I am looking into manually configuring X (shouldn't I?). Where can I find the configuration files I need to edit?


Background: I'm a fourth year student studying a commerce and science degree at one of the top univerisities in Australia, namely, Monash University. My majors are in finance and mathematics. Unfortunately I didn't do well in the first two years of my degree and my GPA is, in short, very average. However, I plan to do an honours in finance (if I can get in) or masters in econometrics/statistics/financial mathematics (for which I satisfy the pre requisites). The institution I attend is very reputable in econemtrics. I really have only been thinking about doing a phd for a few days now, and want to apply to NYU's finance or statistics program, 3 or 4 years down the road.  With a 2.5/4 GPA in my undergraduate, are my chances severely diminished even if my postgraduate scores are stellar, and have a competitive GMAT score? If it makes a difference, my undergraduate GPA in my commerce(finance) degree alone is something like 3.2(granted not great, but better than a 2.5!) it's the science component which drags me down. I don't know too much about American univerisities but have accepted that there isn't a chance in hell for me to get into Ivy's like Harvard, but would am still heavily interested in NYU tier universities for something in finance or econometrics. Any help or advice is very much appreciated! Thanks! Apologies for any typos - am on my phone.

I have a master's degree in International Studies, and a double major with Computer Science from undergrad.  My transcripts suck.  There's no other way to dress it up.  I have pretty good teaching experience, and my GRE scores are awesome, and I suspect my recommendations are as bland as everyone else's.  Basically, to an admissions committee, I suspect I'm the model of a student who is probably smart enough but didn't work hard enough.  I want to do a Ph.D. in Political Science, but the response from my applications is looking pretty grim.  Am I permanently out of the running, or is there something I can do for the next few years which will help to counterbalance my unfavorable GPA?


I can not connect to a public Wi-Fi hotspot that does not require a password but instead shows a captive portal pop-up window.  The pop-up opens blank with the error "The web page couldn't be loaded" () This is with Mojave Public Beta (18A314K) on a 2017 15" MBP.  I did see  but the solution there did not work for me.   Specifically - When I go to  in Safari (v. 12.0, 14606.1.20.40.3), I just see text in the upper left corner of the webpage saying "Success" (minus the quotes) in an otherwise plain white background. If I open a new tab and try browsing, nothing loads saying there's no internet connection. If I open Chrome (v. 67.0.3396.99 64-bit), I also get no internet connection.   How can I tell if I'm getting a valid IP address or if this is a bug in my build that I could work around?

I can not connect to a single public Wi-Fi hotspot that does not require a password but instead shows a pop-up window pointed to captive.apple.com  The pop-up opens blank with the error "The web page couldn't be loaded"  Any idea on how to fix this?


From wiki on       the basic requirement is to have a TeX compiler (which is used to   generate output files from source), fonts, and the LaTeX macro set.   Assuming I have a TeX engine and I would like to add to it LaTeX support. I would expect it to be similar to any language where I should #include or import or whatever is the equivalent, all the LaTeX macros, which are written already in the TeX language. Then, when I have to build a LaTeX written file, I would first have to pre compile the macro files (to be able to use LaTeX tags) and after the file the user has written.  I did find the  repository of the latest LaTeX release. But I am confused why there is a build.lua file? What exactly is it building?   Can someone tell me if my logic regarding adding LaTeX support is correct? If not, how exactly should I proceed? I have a problem understanding the global picture and mainly how LaTeX macros interact with the TeX engine.

I know LaTeX and I've heard that LaTeX is a set of macros in TeX. But what does it exactly mean?


I'm reading the Hunger Games (now starting Mockingjay), and I have seen the movies (not the new one).   While I'm reading, I have a big question. Are there no other countries to avoid this type of games? Because in the book says that Panem is EEUU in a future... Or that is what I understood.. So what about (for example) other nations like France, Italy, Spain, Mexico, Russia... to stop it?

We know that Panem exists in a post-apocalyptic North America but are there other established governments on other continents?


At present, GitLab is running as an omnibus docker (includes both postgres and redis as part of single container) and the size of data directory is 500 MB after 2 months of usage. We have around 70 developers. I have to move from the current setup and split GitLab into separate docker images (GitLab, PostegreSQL and Redis).  What should be the recommended size for each container if i have to persist their corresponding data on disk?  I think GitLab will be the one having the maximum space as it will house the code as well. After that PostgreSQL might be the one with lesser space and then Redis with the least. Just guessing. Looking for some figures (GB)

This is a  about  Related:      I have a question regarding capacity planning. Can the Server Fault community please help with the following:   What kind of server do I need to handle some number of users? How many users can a server with some specifications handle? Will some server configuration be fast enough for my use case? I'm building a social networking site: what kind of hardware do I need? How much bandwidth do I need for some project? How much bandwidth will some number of users use in some application?


In ubuntu we can see a list of files with permissions, simply using the commandls -l. But can I add the filter in this case? For example, a list of all files that are permission set to read only?

How can I find a list of files that have some specific permissions?  I want to find files owned by root user that have rwx permission for the owner.   Is there any way to find a list of such files? I am using Ubuntu 16.04.


The following sentence is copied from the Cambridge Dictionary.     Our goods sell so well in this country that we have no need to export.   There are two questions of this sentence.   The first part of this sentence has noun phrase but it has one words which is not noun or adjective. Is it allowable to use adjective and adverb in the noun phrase. The second part of this sentence that we have no need to export looks to me a present simple tense but the rule says that it should be written as we do not have need to export. Needs some comments on it.   Regards;

Our clothes sell so well in this country that we have no need to export.   Two questions.        Our clothes sell so well in this country...      Is this part of the sentence a noun phrase although it has two words which are not nouns (so and well)? Can a noun phrase have adverbs and adjectives in it? Please explain.        We have no need to export.      The second part of the sentence does not show any tense like present or past or future. Sometimes sentences have no situation, like present or past as in "all is well" or "everything is good". Does in such cases in sense of grammar we should use "be" verbs or sentence will be used as the present simple tense? What are the rules of grammar in such situations?


I do have latest version of Ubuntu , and I would like to remove it to INstall Windows 8.1  but when I begin installing Windows , it tells me can't install in this partition because it's not NTFS or something ... what should I Do please ? Thank you

I have absolutely no experience with Linux, and I desperately need to get my computer back up and running again with Windows.  How do I remove Ubuntu and reinstall Windows?    Editor's note: many of the answers are about removing Ubuntu from dual-boot but keeping Windows (which is a bit complicated), while other answers are about removing Ubuntu from single-boot (which is easy: basically just format the disk while installing Windows). The question as written is ambiguous between dual-boot or single-boot.


I have this so far but I'm needing to get my values at the most to 2 decimal places but for some reason I'm drawing a blank on how to do it right now.  { public static double celciusToFahrenheit(double celcius)  {   double fahrenheit = (9.0 / 5) * celcius + 32;   return fahrenheit; }  public static double fahrenheitToCelcius(double fahrenheit)  {   double celcius = (5.0 / 9) * (fahrenheit - 32);   return celcius; }       public static void main(String[] args)    {       System.out.println("Celcius\tFahrenheit\t|\tFahrenheit\tCelcius");       for (int i = 0; i < 10; i++ )       {          double celcius = 40 - i;         double convertedCelcius = celciusToFahrenheit(celcius);         double fahrenheit = 120 - (i * 10);         double convertedFahrenheit = fahrenheitToCelcius(fahrenheit);          System.out.print(celcius + "\t" + convertedCelcius + "\t|\t" + fahrenheit + "\t" + convertedFahrenheit + "\n");   }    } }   and my result looks like this  Celcius Fahrenheit  |   Fahrenheit  Celcius 40.0    104.0   |   120.0   48.88888888888889 39.0    102.2   |   110.0   43.333333333333336 38.0    100.4   |   100.0   37.77777777777778 37.0    98.60000000000001   |   90.0    32.22222222222222 36.0    96.8    |   80.0    26.666666666666668 35.0    95.0    |   70.0    21.11111111111111 34.0    93.2    |   60.0    15.555555555555557 33.0    91.4    |   50.0    10.0 32.0    89.6    |   40.0    4.444444444444445 31.0    87.80000000000001   |   30.0    -1.1111111111111112

What I would like is a method to convert a double to a string which rounds using the half-up method - i.e. if the decimal to be rounded is 5, it always rounds up to the next number. This is the standard method of rounding most people expect in most situations.  I also would like only significant digits to be displayed - i.e. there should not be any trailing zeroes.  I know one method of doing this is to use the String.format method:  String.format("%.5g%n", 0.912385);   returns:  0.91239   which is great, however it always displays numbers with 5 decimal places even if they are not significant:   String.format("%.5g%n", 0.912300);   returns:  0.91230   Another method is to use the DecimalFormatter:  DecimalFormat df = new DecimalFormat("#.#####"); df.format(0.912385);   returns:  0.91238   However as you can see this uses half-even rounding. That is it will round down if the previous digit is even. What I'd like is this:  0.912385 -> 0.91239 0.912300 -> 0.9123   What is the best way to achieve this in Java?